Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 238


Ignore:
Timestamp:
Nov 24, 2007, 2:22:45 PM (17 years ago)
Author:
dumenim
Message:

changed Synchronise.cc, compiles now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/Synchronisable.cc

    r237 r238  
    99// Copyright: See COPYING file that comes with this distribution
    1010//
    11 //
     11
    1212#include "network/Synchronisable.h"
    1313
     
    4444  retVal.data = (unsigned char *)malloc(totalsize);
    4545  // copy to location
    46   for(int n=0, i=syncList.begin(); n<totalsize && i!=syncList.end(); i++){
    47     std::memcpy(retVal.data+n, i->size, sizeof(int));
     46  //CHANGED: REMOVED DECLARATION int n=0 FROM LOOP
     47  int n=0;
     48  for(i=syncList.begin(); n<totalsize && i!=syncList.end(); i++){
     49        //CHANGED: i->size TO (const void*)(&(i->size)) memcpy WANTS A CONST VOID* SO CONVERT INT TO CONST VOID* 
     50    std::memcpy(retVal.data+n, (const void*)(&(i->size)), sizeof(int));
    4851    n+=sizeof(int);
    49     std::memcpy(retVal.data+n, *(*i.var), *i.size);
     52    //CHANGED: i->var TO (const void*)(&(i->var)) SINCE var IS A POINTER, NO & BEFORE i
     53    std::memcpy(retVal.data+n, (const void*)(i->var), i->size);
    5054    n+=i->size;
    5155  }
     
    5862    if((int)*data==i->size){
    5963      data+=sizeof(int);
    60       memcpy(i->data, data, i->size);
     64      //CHANGED: THIS FROM i->var TO (void*)i->var SINCE var IS A CONST VOID* AND memcpy NEEDS A VOID* AS FIRST ARGUMENT
     65      memcpy((void*)i->var, data, i->size);
    6166      data+=i->size;
    6267    } else
Note: See TracChangeset for help on using the changeset viewer.