Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6106 in orxonox.OLD


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

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

Location:
branches/network/src
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/Makefile.am

    r6066 r6106  
    1313                      server_socket.cc \
    1414                      handshake.cc \
    15                       entity_manager.cc
     15                      entity_manager.cc \
     16                      converter.cc
    1617
    1718
     
    2728                 server_socket.h \
    2829                 handshake.h \
    29                  entity_manager.h
     30                 entity_manager.h \
     31                 converter.h
    3032
    3133
  • branches/network/src/lib/network/entity_manager.h

    r6067 r6106  
    1010#include "netdefs.h"
    1111
    12 /* include base_object.h since all classes are derived from this one */
     12/* include synchronizeable.h since this class is derived from this one */
    1313#include "synchronizeable.h"
    1414
  • 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.