Changeset 6705 in orxonox.OLD for branches/network
- Timestamp:
- Jan 25, 2006, 3:19:39 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/converter.cc
r6703 r6705 338 338 * @return: The number of written bytes 339 339 */ 340 int Converter:: _floatToByteArray(float x, byte* a, int length)340 int Converter::floatToByteArray(float x, byte* a, int length) 341 341 { 342 342 if (length < FLOATSIZE) … … 452 452 * @return: The number of read bytes 453 453 */ 454 int Converter:: _byteArrayToFloat(const byte* a, float* x)454 int Converter::byteArrayToFloat(const byte* a, float* x) 455 455 { 456 456 //handle 0 … … 527 527 * @return: The number of written bytes 528 528 */ 529 int Converter:: floatToByteArray(float x, byte* a, int length)529 int Converter::_floatToByteArray(float x, byte* a, int length) 530 530 { 531 531 if ( length< FLOATSIZE ) … … 549 549 * @return: The number of read bytes 550 550 */ 551 int Converter:: byteArrayToFloat(const byte* a, float* x)551 int Converter::_byteArrayToFloat(const byte* a, float* x) 552 552 { 553 553 *x = *((float*)a); … … 673 673 byte* res = new byte[4]; 674 674 675 int wr = _floatToByteArray(x, res, 4);675 int wr = floatToByteArray(x, res, 4); 676 676 for (int i = 0; i < 4; i++) 677 677 printf("%i ", res[i]); … … 679 679 680 680 float y; 681 int rd = _byteArrayToFloat(res, &y);681 int rd = byteArrayToFloat(res, &y); 682 682 printf("ReConvert: %e\n", y); 683 683 printf("Read bytes: %i -> ", rd);
Note: See TracChangeset
for help on using the changeset viewer.