Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6705 in orxonox.OLD for branches/network/src


Ignore:
Timestamp:
Jan 25, 2006, 3:19:39 PM (19 years ago)
Author:
bwuest
Message:

converter.cc and converter.h changed

File:
1 edited

Legend:

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

    r6703 r6705  
    338338 * @return: The number of written bytes
    339339 */
    340 int Converter::_floatToByteArray(float x, byte* a, int length)
     340int Converter::floatToByteArray(float x, byte* a, int length)
    341341{
    342342  if (length < FLOATSIZE)
     
    452452 * @return: The number of read bytes
    453453 */
    454 int Converter::_byteArrayToFloat(const byte* a, float* x)
     454int Converter::byteArrayToFloat(const byte* a, float* x)
    455455{
    456456    //handle 0
     
    527527 * @return: The number of written bytes
    528528 */
    529 int Converter::floatToByteArray(float x, byte* a, int length)
     529int Converter::_floatToByteArray(float x, byte* a, int length)
    530530{
    531531  if ( length< FLOATSIZE )
     
    549549 * @return: The number of read bytes
    550550 */
    551 int Converter::byteArrayToFloat(const byte* a, float* x)
     551int Converter::_byteArrayToFloat(const byte* a, float* x)
    552552{
    553553  *x = *((float*)a);
     
    673673  byte* res = new byte[4];
    674674
    675   int wr = _floatToByteArray(x, res, 4);
     675  int wr = floatToByteArray(x, res, 4);
    676676  for (int i = 0; i < 4; i++)
    677677    printf("%i ", res[i]);
     
    679679
    680680  float y;
    681   int rd = _byteArrayToFloat(res, &y);
     681  int rd = byteArrayToFloat(res, &y);
    682682  printf("ReConvert: %e\n", y);
    683683  printf("Read bytes: %i   ->  ", rd);
Note: See TracChangeset for help on using the changeset viewer.