Changeset 9596
- Timestamp:
- 2005-04-07T17:06:26+12:00 (19 years ago)
- Location:
- trunk/gsdl
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/packages/mg/lib/bitio_m.h
r439 r9596 59 59 register int _B_x = (x) - 1; \ 60 60 (v) = 0; \ 61 for (; _B_x ; _B_x>>=1, (v)++); \61 for (; _B_x ; _B_x>>=1, ++(v)); \ 62 62 } while(0) 63 63 … … 67 67 register int _B_x = (x); \ 68 68 (v) = -1; \ 69 for (; _B_x ; _B_x>>=1, (v)++); \69 for (; _B_x ; _B_x>>=1, ++(v)); \ 70 70 } while(0) 71 71 … … 100 100 BIO_DECODE_PROLOGUE; \ 101 101 (x) = 1; \ 102 while (!DECODE_BIT) (x)++; \102 while (!DECODE_BIT) ++(x); \ 103 103 BIO_DECODE_EPILOGUE; \ 104 104 } while(0) … … 108 108 BIO_DECODE_PROLOGUE; \ 109 109 (x) = 1; \ 110 while (!DECODE_BIT) (x)++; \110 while (!DECODE_BIT) ++(x); \ 111 111 (count) += (x); \ 112 112 BIO_DECODE_EPILOGUE; \ … … 178 178 CEILLOG_2(_B_b, _B_logofb); \ 179 179 _B_thresh = (1<<_B_logofb) - _B_b; \ 180 _B_logofb--; \181 for (_B_i=0; _B_i < _B_logofb; _B_i++) \180 --_B_logofb; \ 181 for (_B_i=0; _B_i < _B_logofb; ++_B_i) \ 182 182 DECODE_ADD(_B_x); \ 183 183 if (_B_x >= _B_thresh) \ … … 203 203 CEILLOG_2(_B_b, _B_logofb); \ 204 204 _B_thresh = (1<<_B_logofb) - _B_b; \ 205 _B_logofb--; \205 --_B_logofb; \ 206 206 (count) += _B_logofb; \ 207 for (_B_i=0; _B_i < _B_logofb; _B_i++) \207 for (_B_i=0; _B_i < _B_logofb; ++_B_i) \ 208 208 DECODE_ADD(_B_x); \ 209 209 if (_B_x >= _B_thresh) \ … … 211 211 DECODE_ADD(_B_x); \ 212 212 _B_x -= _B_thresh; \ 213 (count)++; \213 ++(count); \ 214 214 } \ 215 215 (x) = _B_x+1; \ … … 276 276 register int _B_nbits = 0; \ 277 277 BIO_DECODE_PROLOGUE; \ 278 while(!DECODE_BIT) _B_nbits++; \278 while(!DECODE_BIT) ++_B_nbits; \ 279 279 while (_B_nbits-- > 0) \ 280 280 DECODE_ADD(_B_xx); \ … … 288 288 register int _B_nbits = 0; \ 289 289 BIO_DECODE_PROLOGUE; \ 290 while(!DECODE_BIT) _B_nbits++; \290 while(!DECODE_BIT) ++_B_nbits; \ 291 291 (count) += _B_nbits*2+1; \ 292 292 while (_B_nbits-- > 0) \ … … 333 333 register unsigned long _B_xxx; \ 334 334 register int _B_logx; \ 335 GAMMA_DECODE(_B_logx); _B_logx--; \336 BINARY_DECODE(_B_xxx, 1<<_B_logx); _B_xxx--; \335 GAMMA_DECODE(_B_logx); --_B_logx; \ 336 BINARY_DECODE(_B_xxx, 1<<_B_logx); --_B_xxx; \ 337 337 (x) = _B_xxx + (1<<_B_logx); \ 338 338 } while (0) … … 342 342 register unsigned long _B_xxx; \ 343 343 register int _B_logx; \ 344 GAMMA_DECODE_L(_B_logx, count); _B_logx--; \345 BINARY_DECODE_L(_B_xxx, 1<<_B_logx, count); _B_xxx--; \344 GAMMA_DECODE_L(_B_logx, count); --_B_logx; \ 345 BINARY_DECODE_L(_B_xxx, 1<<_B_logx, count); --_B_xxx; \ 346 346 (x) = _B_xxx + (1<<_B_logx); \ 347 347 } while (0) … … 374 374 while (_B_xx>_B_upper) \ 375 375 { \ 376 _B_k++; \376 ++_B_k; \ 377 377 _B_lower = _B_upper+1; \ 378 378 _B_pow *= _B_s; \ … … 394 394 while (_B_xx>_B_upper) \ 395 395 { \ 396 _B_k++; \396 ++_B_k; \ 397 397 _B_lower = _B_upper+1; \ 398 398 _B_pow *= _B_s; \ … … 411 411 register int _B_k; \ 412 412 register double _B_pow=1.0; \ 413 UNARY_DECODE(_B_k); _B_k--; \413 UNARY_DECODE(_B_k); --_B_k; \ 414 414 while (_B_k--) \ 415 415 { \ … … 418 418 _B_upper += _B_b*_B_pow; \ 419 419 } \ 420 BINARY_DECODE(_B_xx, _B_upper-_B_lower+1); _B_xx--; \420 BINARY_DECODE(_B_xx, _B_upper-_B_lower+1); --_B_xx; \ 421 421 POSITIVE(gamma, _B_xx+_B_lower); \ 422 422 (x) = _B_xx+_B_lower; \ … … 431 431 register int _B_k; \ 432 432 register double _B_pow=1.0; \ 433 UNARY_DECODE_L(_B_k, count); _B_k--; \433 UNARY_DECODE_L(_B_k, count); --_B_k; \ 434 434 while (_B_k--) \ 435 435 { \ … … 438 438 _B_upper += _B_b*_B_pow; \ 439 439 } \ 440 BINARY_DECODE_L(_B_xx, _B_upper-_B_lower+1, count); _B_xx--; \440 BINARY_DECODE_L(_B_xx, _B_upper-_B_lower+1, count); --_B_xx; \ 441 441 POSITIVE(gamma, _B_xx+_B_lower); \ 442 442 (x) = _B_xx+_B_lower; \ … … 454 454 while (_B_xx>_B_upper) \ 455 455 { \ 456 _B_k++; \456 ++_B_k; \ 457 457 _B_lower = _B_upper+1; \ 458 458 _B_pow *= _B_s; \ … … 474 474 register int _B_xdivb = 0; \ 475 475 POSITIVE(bblock, _B_xx); \ 476 _B_xx--; \476 --_B_xx; \ 477 477 while (_B_xx >= _B_bb) \ 478 478 { \ 479 _B_xdivb++; \479 ++_B_xdivb; \ 480 480 _B_xx -= _B_bb; \ 481 481 } \ … … 490 490 register int _B_xdivb = 0; \ 491 491 POSITIVE(bblock, _B_xx); \ 492 _B_xx--; \492 --_B_xx; \ 493 493 while (_B_xx >= _B_bb) \ 494 494 { \ 495 _B_xdivb++; \495 ++_B_xdivb; \ 496 496 _B_xx -= _B_bb; \ 497 497 } \ … … 505 505 register unsigned long _B_bb = (b); \ 506 506 register int _B_xdivb; \ 507 UNARY_DECODE(_B_xdivb); _B_xdivb--; \507 UNARY_DECODE(_B_xdivb); --_B_xdivb; \ 508 508 while (_B_xdivb--) \ 509 509 _B_xx += _B_bb; \ … … 517 517 register unsigned long _B_bb = (b); \ 518 518 register int _B_xdivb; \ 519 UNARY_DECODE_L(_B_xdivb, count); _B_xdivb--; \519 UNARY_DECODE_L(_B_xdivb, count); --_B_xdivb; \ 520 520 while (_B_xdivb--) \ 521 521 _B_xx += _B_bb; \ … … 530 530 register int _B_xdivb = 0; \ 531 531 POSITIVE(bblock, _B_xx); \ 532 _B_xx--; \532 --_B_xx; \ 533 533 while (_B_xx >= _B_bb) \ 534 534 { \ 535 _B_xdivb++; \535 ++_B_xdivb; \ 536 536 _B_xx -= _B_bb; \ 537 537 } \ -
trunk/gsdl/packages/mg/lib/bitio_m_mem.h
r439 r9596 74 74 #define ENCODE_BIT(b) \ 75 75 do { \ 76 __btg--; \76 --__btg; \ 77 77 if (b) __buff |= (1 << __btg); \ 78 78 if (!__btg) \ … … 81 81 { \ 82 82 *__pos++ = __buff; \ 83 __remaining--; \83 --__remaining; \ 84 84 } \ 85 85 __buff = 0; \ … … 102 102 { \ 103 103 *__pos++ = __buff; \ 104 __remaining--; \104 --__remaining; \ 105 105 } \ 106 106 __btg = sizeof(__buff)*8; \ … … 135 135 { \ 136 136 __buff = *__pos++; \ 137 __remaining--; \137 --__remaining; \ 138 138 } \ 139 139 else \ … … 151 151 { \ 152 152 __buff = *__pos++; \ 153 __remaining--; \153 --__remaining; \ 154 154 } \ 155 155 else \ -
trunk/gsdl/packages/mg/lib/bitio_m_mems.h
r439 r9596 59 59 else \ 60 60 __base[__pos>>3] &= 0xff7f >> (__pos&7); \ 61 __pos++; \61 ++__pos; \ 62 62 } while(0) 63 63 … … 88 88 do { \ 89 89 (b) += (b) + (__base[__pos>>3] & (0x80 >> (__pos&7)) != 0); \ 90 __pos++; \90 ++__pos; \ 91 91 } while(0) 92 92 -
trunk/gsdl/packages/mg/lib/bitio_m_random.h
r439 r9596 58 58 register unsigned long __len = (l)-1; \ 59 59 register unsigned long __sft = 0; \ 60 while (__len) { __sft++; __len >>=1; } \60 while (__len) { ++__sft; __len >>=1; } \ 61 61 __len = 1<<__sft; \ 62 62 __buf = Xmalloc(__len); \ … … 93 93 __buf[__pos>>3] &= 0xff7f >> (__pos&7); \ 94 94 __used = 1; \ 95 __pos++; \95 ++__pos; \ 96 96 if ((__pos>>3) >= __len) \ 97 97 (void)WRITE_READ; \ -
trunk/gsdl/packages/mg/lib/bitio_m_stdio.h
r439 r9596 65 65 #define ENCODE_BIT(b) \ 66 66 do { \ 67 __btg--; \67 --__btg; \ 68 68 if (b) __buff |= (1 << __btg); \ 69 69 if (!__btg) \ -
trunk/gsdl/packages/mg/lib/huffman.h
r439 r9596 69 69 register int __clen = (lens)[x]; \ 70 70 register unsigned long __code = (codes)[x]; \ 71 for (__i=__clen-1; __i>=0; __i--) \71 for (__i=__clen-1; __i>=0; --__i) \ 72 72 ENCODE_BIT((__code >> __i) & 1); \ 73 73 } while(0) -
trunk/gsdl/packages/mg/src/text/hash.h
r439 r9596 34 34 register unsigned long hval; \ 35 35 if (len>25) len = 25; \ 36 for (hval=0; len; len--) \36 for (hval=0; len; --len) \ 37 37 hval = (hval << 5) - hval + *p++; \ 38 38 step = hval % (tablesize - 2) + 1; \ -
trunk/gsdl/packages/mg/src/text/words.h
r8693 r9596 116 116 ++numeric <= maxnumeric))) { \ 117 117 while (charlength-- > 0) { \ 118 *wptr++ = *(s_in)++; length++; \118 *wptr++ = *(s_in)++; ++length; \ 119 119 } \ 120 120 charlength = parse_utf8_char((s_in),(end),&c); \ … … 136 136 break; \ 137 137 *wptr++ = c; \ 138 length++; \138 ++length; \ 139 139 c = *++(s_in); \ 140 140 } \ … … 163 163 !is_unicode_letdig(c)) { \ 164 164 while (charlength-- > 0) { \ 165 *wptr++ = *(s_in)++; length++; \165 *wptr++ = *(s_in)++; ++length; \ 166 166 } \ 167 167 charlength = parse_utf8_char((s_in),(end),&c); \ … … 180 180 { \ 181 181 *wptr++ = c; \ 182 length++; \182 ++length; \ 183 183 c = *++(s_in); \ 184 184 } \ … … 214 214 ++numeric <= maxnumeric))) { \ 215 215 while (charlength-- > 0) { \ 216 *wptr++ = *(s_in)++; length++; \216 *wptr++ = *(s_in)++; ++length; \ 217 217 } \ 218 218 charlength = parse_utf8_char((s_in),(end),&c); \ … … 234 234 break; \ 235 235 *wptr++ = c; \ 236 length++; \236 ++length; \ 237 237 c = *++(s_in); \ 238 238 } \ … … 347 347 { \ 348 348 *wptr++ = c; \ 349 length++; \349 ++length; \ 350 350 c = *++(s_in); \ 351 351 } \ -
trunk/gsdl/src/checkis/checkis.cpp
r1632 r9596 35 35 36 36 // prepare for next iteration 37 dwIndex++;37 ++dwIndex; 38 38 keysize = 256; 39 39 comsize = 2048; -
trunk/gsdl/src/db2txt/db2txt.cpp
r2499 r9596 84 84 while (key.dptr != NULL) { 85 85 cout << "["; 86 for (i = 0; i < key.dsize; i++)86 for (i = 0; i < key.dsize; ++i) 87 87 cout << key.dptr[i]; 88 88 cout << "]\n"; 89 89 value = gdbm_fetch (dbf, key); 90 for (i = 0; i < value.dsize; i++)90 for (i = 0; i < value.dsize; ++i) 91 91 cout << value.dptr[i]; 92 92 cout << "\n----------------------------------------------------------------------\n"; -
trunk/gsdl/src/hashfile/hashfile.cpp
r1238 r9596 63 63 a.num[i] = (unsigned char)num; 64 64 65 i++;65 ++i; 66 66 } 67 67 … … 85 85 if (a.num[i] > b.num[i]) break; 86 86 if (a.num[i] < b.num[i]) return 0; 87 i--;87 --i; 88 88 } 89 89 } … … 105 105 a.num[j] = (unsigned char) num; 106 106 107 j++;107 ++j; 108 108 if (num != 0) len = j; 109 109 } … … 133 133 } 134 134 135 for (i=a.len-1, len=0; i >= 0; i--) {135 for (i=a.len-1, len=0; i >= 0; --i) { 136 136 result[len++] = convert[a.num[i]/16]; 137 137 result[len++] = convert[a.num[i]%16]; … … 201 201 // calculate 8 multiples of the prime number. 202 202 // These are used to find the remainder using only subtraction operations 203 for (i=0; i<8; i++) {203 for (i=0; i<8; ++i) { 204 204 primepow[i] = pow; 205 205 my_inc (pow, pow); … … 225 225 226 226 // remainder = remainder * 256 + c 227 for (i=remainder.len; i>0; i--) {227 for (i=remainder.len; i>0; --i) { 228 228 remainder.num[i] = remainder.num[i-1]; 229 229 } … … 232 232 233 233 // remainder = (remainder % large-prime-number) 234 for (i=7; i>=0; i--) {234 for (i=7; i>=0; --i) { 235 235 my_ifpos_dec (remainder, primepow[i]); 236 236 } … … 250 250 char *result; 251 251 252 for (i = 1; i < argc; i++) {252 for (i = 1; i < argc; ++i) { 253 253 result = hashfile (argv[i]); 254 254 if (result == NULL) { -
trunk/gsdl/src/setpasswd/setpasswd.cpp
r2438 r9596 74 74 arg.push_back (*c); 75 75 } 76 c ++;76 ++c; 77 77 } 78 78 if (!arg.empty()) args.push_back (arg); … … 84 84 else if (*here == "-p" && (++here != end)) password = *here; 85 85 else if (*here == "-o" && (++here != end)) output_gdbm_file = *here; 86 if (here != end) here ++;86 if (here != end) ++here; 87 87 } 88 88 if (username.empty() || password.empty() || output_gdbm_file.empty()) { -
trunk/gsdl/src/txt2db/txt2db.cpp
r982 r9596 124 124 } else if (c == '-') { 125 125 tmp.push_back ((unsigned char)c); 126 num_dashes++;126 ++num_dashes; 127 127 128 128 } else {
Note:
See TracChangeset
for help on using the changeset viewer.