Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Nov 28, 2005, 6:49:58 PM (19 years ago)
Author:
patrick
Message:

network: made some functions and arguments const, since they musn't change any data.

Location:
branches/network/src/subprojects/network
Files:
3 edited

Legend:

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

    r5805 r5806  
    143143  if(error == -1) printf("\n\nerror on address resolution, program inconsistancy\n\n");
    144144  nm->establishConnection(ip, *clientSync);
    145   SDL_Delay(1000);
     145  /* adding some break for connection setup */
     146  SDL_Delay(20);
    146147
    147148  /* synchronize the data 1 time (increment for longer tests) */
  • branches/network/src/subprojects/network/simple_sync.cc

    r5805 r5806  
    6060 *  write data to Synchronizeable
    6161 */
    62 void SimpleSync::writeBytes(byte* data, int length)
     62void SimpleSync::writeBytes(const byte* data, int length)
    6363{
    6464  PRINTF(0)("SimpleSync: got %i bytes of data\n", length);
     
    8080 *  read data from Synchronizeable
    8181 */
    82 int SimpleSync::readBytes(byte* data)
     82int SimpleSync::readBytes(byte* data) const
    8383{
    8484  PRINTF(0)("SimpleSync: sent %i bytes of data\n", this->outLength);
    8585
     86  /* debug msg */
     87  this->readDebug();
     88
    8689  /* write the test message */
    8790  for( int i = 0; i < this->outLength; i++)
    88   {
    8991    data[i] = this->outData[i];
    90   }
    9192
    92   /* debug msg */
    93   this->readDebug();
    9493  /* return the length of the test */
    9594  return this->outLength;
     
    9796
    9897
    99 void SimpleSync::writeDebug()
     98void SimpleSync::writeDebug() const
    10099{
    101100  PRINTF(0)("Write in bytes: \t(0 <-) |");
     
    108107
    109108
    110 void SimpleSync::readDebug()
     109void SimpleSync::readDebug() const
    111110{
    112111  PRINTF(0)("Read out bytes: \t(0 ->) |");
  • branches/network/src/subprojects/network/simple_sync.h

    r5804 r5806  
    1616    ~SimpleSync();
    1717
    18     virtual void writeBytes(byte* data, int length);
    19     virtual int readBytes(byte* data);
     18    virtual void writeBytes(const byte* data, int length);
     19    virtual int readBytes(byte* data) const;
    2020
    2121
    2222  private:
    23     virtual void writeDebug();
    24     virtual void readDebug();
     23    virtual void writeDebug() const;
     24    virtual void readDebug() const;
    2525
    2626
Note: See TracChangeset for help on using the changeset viewer.