Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6106 in orxonox.OLD for branches/network/src/subprojects


Ignore:
Timestamp:
Dec 14, 2005, 3:05:31 PM (19 years ago)
Author:
bwuest
Message:

Converter.h and Converter.cc added; Note: They don't function for negative numbers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/subprojects/network/network_unit_test.cc

    r6043 r6106  
    1111#include "network_stream.h"
    1212#include "synchronizeable.h"
     13#include "converter.h"
    1314
    1415#include "simple_sync.h"
     
    284285
    285286
     287int converter(int argc, char** argv)
     288{
     289  int x = -12;
     290  printf("To convert: %i\n", x);
     291  byte* res = Converter::intToByteArray(x);
     292  for (int i = 0; i < 4; i++)
     293    printf("%i  ", res[i]);
     294  printf("\n");
     295 
     296  int z = Converter::byteArrayToInt(res);
     297 
     298  printf("ReConvert: %i\n", z);
     299
     300 
     301  return 0;
     302}
     303
     304
    286305
    287306/**
     
    308327    else if (! strcmp( "--listen", argv[i]) || !strcmp("-l", argv[i]))
    309328      return startListen(argc, argv);
     329    else if (! strcmp( "--converter", argv[i]) || !strcmp("-o", argv[i]))
     330      return converter(argc, argv);
    310331  }
    311332
Note: See TracChangeset for help on using the changeset viewer.