Changeset 6341 in orxonox.OLD for trunk/src/subprojects/network
- Timestamp:
- Dec 30, 2005, 1:57:12 AM (19 years ago)
- Location:
- trunk/src/subprojects/network
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/subprojects/network/Makefile.am
r6139 r6341 22 22 $(MAINSRCDIR)/lib/lang/class_list.cc \ 23 23 $(MAINSRCDIR)/util/loading/load_param.cc \ 24 $(MAINSRCDIR)/util/loading/factory.cc \ 24 25 $(MAINSRCDIR)/lib/util/substring.cc \ 25 26 $(MAINSRCDIR)/util/loading/load_param_description.cc \ -
trunk/src/subprojects/network/network_unit_test.cc
r6139 r6341 284 284 } 285 285 286 286 void testFloatConverter(float f) 287 { 288 char* s = Converter::floatToBinString(f); 289 printf("%f = ", f); 290 printf(s); printf("\n"); 291 292 byte* res = Converter::floatToByteArray(f); 293 printf("Byte Array: "); 294 for (int i = 0; i < 4; i++) 295 printf("%i ", res[i]); 296 printf("\n"); 297 298 float b = Converter::byteArrayToFloat(res); 299 printf("ReConvert: %f \n", b); 300 } 301 302 void testFloatConverter2(float f) 303 { 304 char* s = Converter::floatToBinString(f); 305 printf("### %f = ", f); 306 printf(s); printf("\n"); 307 308 byte* res = Converter::_floatToByteArray(f); 309 printf("Byte Array: "); 310 for (int i = 0; i < 4; i++) 311 printf("%i ", res[i]); 312 printf("\n"); 313 314 float b = Converter::_byteArrayToFloat(res); 315 printf("ReConvert: %f \n", b); 316 } 287 317 int converter(int argc, char** argv) 288 318 { 319 /* 289 320 int x = 200564786; 290 321 printf("To convert: %i\n", x); … … 305 336 printf("\n"); 306 337 338 */ 339 /* 307 340 float y; 308 341 char* s; … … 328 361 printf(s); printf("\n"); 329 362 330 363 y = -4.7824f; 364 s = Converter::floatToBinString(y); 365 printf("%f = ", y); 366 printf(s); printf("\n"); 367 368 y = -14.35e14f; 369 s = Converter::floatToBinString(y); 370 printf("%f = ", y); 371 printf(s); printf("\n"); 372 */ 373 374 375 /* 376 float a = 12.3f; 377 378 char* s = Converter::floatToBinString(a); 379 printf("%f = ", a); 380 printf(s); printf("\n"); 381 382 byte* res = Converter::floatToByteArray(a); 383 printf("Byte Array: \n"); 384 for (int i = 0; i < 4; i++) 385 printf("%i ", res[i]); 386 printf("\n"); 387 388 float b = Converter::byteArrayToFloat(res); 389 printf("ReConvert: %f \n", b); 390 */ 391 // testFloatConverter(12.3e-53f); printf("\n"); 392 // testFloatConverter(134.26455646546548741661675165f); printf("\n"); 393 // testFloatConverter(35.67e14f); printf("\n"); 394 395 testFloatConverter(12.3e-7f); printf("\n"); 396 testFloatConverter(134.26455646546548741661675165f); printf("\n"); 397 testFloatConverter(35.67e14f); printf("\n"); 331 398 332 399 return 0; -
trunk/src/subprojects/network/read_sync.cc
r6139 r6341 60 60 * write data to Synchronizeable 61 61 */ 62 void ReadSync::writeBytes(const byte* data, int length)62 int ReadSync::writeBytes(const byte* data, int length, int sender) 63 63 { 64 64 PRINTF(0)("ReadSync: got %i bytes of data\n", length); -
trunk/src/subprojects/network/read_sync.h
r6139 r6341 16 16 ~ReadSync(); 17 17 18 virtual void writeBytes(const byte* data, int length);18 virtual int writeBytes(const byte* data, int length, int sender); 19 19 virtual int readBytes(byte* data, int maxLength, int * reciever); 20 20 -
trunk/src/subprojects/network/simple_sync.cc
r6139 r6341 66 66 * write data to Synchronizeable 67 67 */ 68 void SimpleSync::writeBytes(const byte* data, int length)68 int SimpleSync::writeBytes(const byte* data, int length, int sender) 69 69 { 70 70 PRINTF(0)("SimpleSync: got %i bytes of data\n", length); -
trunk/src/subprojects/network/simple_sync.h
r6139 r6341 16 16 ~SimpleSync(); 17 17 18 virtual void writeBytes(const byte* data, int length);18 virtual int writeBytes(const byte* data, int length, int sender); 19 19 virtual int readBytes(byte* data, int maxLength, int * reciever); 20 20 -
trunk/src/subprojects/network/write_sync.cc
r6139 r6341 66 66 * write data to Synchronizeable 67 67 */ 68 void WriteSync::writeBytes(const byte* data, int length)68 int WriteSync::writeBytes(const byte* data, int length, int sender) 69 69 { 70 70 PRINTF(0)("WriteSync: got %i bytes of data\n", length); -
trunk/src/subprojects/network/write_sync.h
r6139 r6341 16 16 ~WriteSync(); 17 17 18 virtual void writeBytes(const byte* data, int length);18 virtual int writeBytes(const byte* data, int length, int sender); 19 19 virtual int readBytes(byte* data, int maxLength, int * reciever); 20 20
Note: See TracChangeset
for help on using the changeset viewer.