Changeset 6751 in orxonox.OLD for branches/network/src/lib/network/synchronizeable.h
- Timestamp:
- Jan 26, 2006, 12:29:02 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/synchronizeable.h
r6747 r6751 62 62 #define SYNCHELP_WRITE_INT(i) { __synchelp_write_n = \ 63 63 Converter::intToByteArray( i, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \ 64 assert( __synchelp_write_n == INTSIZE ); \ 64 65 if ( __synchelp_write_n <= 0) \ 65 66 { \ … … 67 68 return 0; \ 68 69 } \ 69 assert( __synchelp_write_n == INTSIZE ); \70 70 __synchelp_write_i += __synchelp_write_n; \ 71 71 } 72 72 #define SYNCHELP_WRITE_FLOAT(f) { __synchelp_write_n = \ 73 73 Converter::floatToByteArray( f, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \ 74 assert( __synchelp_write_n == FLOATSIZE ); \ 74 75 if ( __synchelp_write_n <= 0) \ 75 76 { \ … … 88 89 __synchelp_write_i++; \ 89 90 } 90 #define SYNCHELP_WRITE_STRING(s) { if (s!=NULL) \91 #define SYNCHELP_WRITE_STRING(s) { if (s!=NULL) {\ 91 92 __synchelp_write_n = \ 92 93 Converter::stringToByteArray( s, data+__synchelp_write_i, strlen(s), maxLength-__synchelp_write_i ); \ 93 else \ 94 assert( __synchelp_write_n == strlen(s)+INTSIZE ); \ 95 } else {\ 94 96 __synchelp_write_n = \ 95 97 Converter::stringToByteArray( "", data+__synchelp_write_i, strlen(""), maxLength-__synchelp_write_i ); \ 98 assert( __synchelp_write_n == strlen("")+INTSIZE ); } \ 96 99 if ( __synchelp_write_n <= 0) \ 97 100 { \ … … 117 120 return 0; \ 118 121 } \ 119 __synchelp_read_i += Converter::byteArrayToInt( data+__synchelp_read_i, &i ); \ 122 __synchelp_read_n = Converter::byteArrayToInt( data+__synchelp_read_i, &i ); \ 123 assert( __synchelp_read_n == INTSIZE ); \ 124 __synchelp_read_i += __synchelp_read_n; \ 120 125 } 121 126 #define SYNCHELP_READ_FLOAT(f) { \ … … 125 130 return 0; \ 126 131 } \ 127 __synchelp_read_i += Converter::byteArrayToFloat( data+__synchelp_read_i, &f ); \ 132 __synchelp_read_n = Converter::byteArrayToFloat( data+__synchelp_read_i, &f ); \ 133 assert( __synchelp_read_n == FLOATSIZE ) ;\ 134 __synchelp_read_i += __synchelp_read_n; \ 128 135 } 129 136 #define SYNCHELP_READ_STRING(s,l) { \ 130 137 __synchelp_read_n = Converter::byteArrayToString( data+__synchelp_read_i, s, l ); \ 138 assert( __synchelp_read_n == strlen(s)+INTSIZE ) ;\ 131 139 if ( __synchelp_read_n <0 ) \ 132 140 { \ … … 138 146 #define SYNCHELP_READ_STRINGM(s) { \ 139 147 __synchelp_read_n = Converter::byteArrayToStringM( data+__synchelp_read_i, s ); \ 148 assert( __synchelp_read_n == strlen(s)+INTSIZE ) ;\ 140 149 if ( __synchelp_read_n <0 ) \ 141 150 { \
Note: See TracChangeset
for help on using the changeset viewer.