Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6108 in orxonox.OLD


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

Converter.h and Converter.cc changed. They should now function for both positive and negative numbers

Location:
branches/network/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/converter.cc

    r6106 r6108  
    8989  const int step = 256; // = 2 ^ 8
    9090  int result = 0;
    91   for (int i = 0; i < INTSIZE - 2; i++)
     91  for (int i = 0; i < INTSIZE - 1; i++)
    9292  {
    9393    result += a[i] * mult;
     
    9595  }
    9696 
    97   if (a[INTSIZE - 1] > sgnadd)
     97  printf("tara: %i", result);
     98 
     99  if (a[INTSIZE - 1] >= sgnadd)
    98100  {
    99101    result += (a[INTSIZE - 1] - sgnadd) * mult;
  • branches/network/src/subprojects/network/network_unit_test.cc

    r6106 r6108  
    287287int converter(int argc, char** argv)
    288288{
    289   int x = -12;
     289  int x = 200564786;
    290290  printf("To convert: %i\n", x);
    291291  byte* res = Converter::intToByteArray(x);
Note: See TracChangeset for help on using the changeset viewer.