Changeset 25147 for main/trunk/greenstone2/common-src/indexers/mg/lib
- Timestamp:
- 2012-02-28T13:59:00+13:00 (12 years ago)
- Location:
- main/trunk/greenstone2/common-src/indexers/mg/lib
- Files:
-
- 40 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/common-src/indexers/mg/lib/Makefile.in
r22070 r25147 34 34 AR = ar 35 35 CC = @CC@ 36 CFLAGS = @CFLAGS@ @COMPAT32BITFLAGS@-fpic36 CFLAGS = @CFLAGS@ -fpic 37 37 DEFS = @DEFS@ 38 38 RANLIB = @RANLIB@ … … 41 41 # Uncomment for compiling for the nzdl project 42 42 # 43 CFLAGS = @CFLAGS@ @COMPAT32BITFLAGS@-DQUIET -fpic43 CFLAGS = @CFLAGS@ -DQUIET -fpic 44 44 ########################################## 45 45 -
main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_gen.c
r16583 r25147 28 28 int fprintf (FILE *, const char *,...); 29 29 30 unsignedlong31 BIO_Unary_Length ( unsignedlong val)30 mg_u_long 31 BIO_Unary_Length (mg_u_long val) 32 32 { 33 register unsignedlong num;33 register mg_u_long num; 34 34 UNARY_LENGTH (val, num); 35 35 return (num); … … 37 37 38 38 39 unsignedlong40 BIO_Binary_Length ( unsigned long val, unsignedlong b)39 mg_u_long 40 BIO_Binary_Length (mg_u_long val, mg_u_long b) 41 41 { 42 register unsignedlong num;42 register mg_u_long num; 43 43 BINARY_LENGTH (val, b, num); 44 44 return (num); … … 46 46 47 47 48 unsignedlong49 BIO_Gamma_Length ( unsignedlong val)48 mg_u_long 49 BIO_Gamma_Length (mg_u_long val) 50 50 { 51 register unsignedlong num;51 register mg_u_long num; 52 52 GAMMA_LENGTH (val, num); 53 53 return (num); … … 55 55 56 56 57 unsignedlong58 BIO_Delta_Length ( unsignedlong val)57 mg_u_long 58 BIO_Delta_Length (mg_u_long val) 59 59 { 60 register unsignedlong num;60 register mg_u_long num; 61 61 DELTA_LENGTH (val, num); 62 62 return (num); … … 64 64 65 65 66 unsignedlong67 BIO_Elias_Length ( unsigned long val, unsignedlong b, double s)66 mg_u_long 67 BIO_Elias_Length (mg_u_long val, mg_u_long b, double s) 68 68 { 69 register unsignedlong num;69 register mg_u_long num; 70 70 ELIAS_LENGTH (val, b, s, num); 71 71 return (num); 72 72 } 73 73 74 unsignedlong75 BIO_Bblock_Length ( unsigned long val, unsignedlong b)74 mg_u_long 75 BIO_Bblock_Length (mg_u_long val, mg_u_long b) 76 76 { 77 register unsignedlong num;77 register mg_u_long num; 78 78 BBLOCK_LENGTH (val, b, num); 79 79 return (num); -
main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_gen.h
r16583 r25147 33 33 #define H_BITIO_GEN 34 34 35 unsigned long BIO_Unary_Length (unsignedlong val);35 mg_u_long BIO_Unary_Length (mg_u_long val); 36 36 37 unsigned long BIO_Binary_Length (unsigned long val, unsignedlong b);37 mg_u_long BIO_Binary_Length (mg_u_long val, mg_u_long b); 38 38 39 unsigned long BIO_Gamma_Length (unsignedlong val);39 mg_u_long BIO_Gamma_Length (mg_u_long val); 40 40 41 unsigned long BIO_Delta_Length (unsignedlong val);41 mg_u_long BIO_Delta_Length (mg_u_long val); 42 42 43 unsigned long BIO_Elias_Length (unsigned long val, unsignedlong b, double s);43 mg_u_long BIO_Elias_Length (mg_u_long val, mg_u_long b, double s); 44 44 45 unsigned long BIO_Bblock_Length (unsigned long val, unsignedlong b);45 mg_u_long BIO_Bblock_Length (mg_u_long val, mg_u_long b); 46 46 47 47 int BIO_Bblock_Init (int N, int p); -
main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_m.h
r16583 r25147 50 50 #define POSITIVE(f, x) \ 51 51 if ((x)<=0) \ 52 fprintf(stderr,"Error: Cannot "#f" encode % lu\n",(unsignedlong)x),exit(1);52 fprintf(stderr,"Error: Cannot "#f" encode %d\n",(mg_u_long)x),exit(1); 53 53 54 54 … … 75 75 #define UNARY_ENCODE(x) \ 76 76 do { \ 77 register unsignedlong _B_x = (x); \77 register mg_u_long _B_x = (x); \ 78 78 BIO_ENCODE_PROLOGUE; \ 79 79 POSITIVE(unary, _B_x); \ … … 85 85 #define UNARY_ENCODE_L(x, count) \ 86 86 do { \ 87 register unsignedlong _B_x = (x); \87 register mg_u_long _B_x = (x); \ 88 88 BIO_ENCODE_PROLOGUE; \ 89 89 POSITIVE(unary, _B_x); \ … … 124 124 #define BINARY_ENCODE(x, b) \ 125 125 do { \ 126 register unsignedlong _B_x = (x); \127 register unsignedlong _B_b = (b); \126 register mg_u_long _B_x = (x); \ 127 register mg_u_long _B_b = (b); \ 128 128 register int _B_nbits, _B_logofb, _B_thresh; \ 129 129 BIO_ENCODE_PROLOGUE; \ … … 145 145 #define BINARY_ENCODE_L(x, b, count) \ 146 146 do { \ 147 register unsignedlong _B_x = (x); \148 register unsignedlong _B_b = (b); \147 register mg_u_long _B_x = (x); \ 148 register mg_u_long _B_b = (b); \ 149 149 register int _B_nbits, _B_logofb, _B_thresh; \ 150 150 BIO_ENCODE_PROLOGUE; \ … … 168 168 #define BINARY_DECODE(x, b) \ 169 169 do { \ 170 register unsignedlong _B_x = 0; \171 register unsignedlong _B_b = (b); \170 register mg_u_long _B_x = 0; \ 171 register mg_u_long _B_b = (b); \ 172 172 register int _B_i, _B_logofb, _B_thresh; \ 173 173 BIO_DECODE_PROLOGUE; \ … … 193 193 #define BINARY_DECODE_L(x, b, count) \ 194 194 do { \ 195 register unsignedlong _B_x = 0; \196 register unsignedlong _B_b = (b); \195 register mg_u_long _B_x = 0; \ 196 register mg_u_long _B_b = (b); \ 197 197 register int _B_i, _B_logofb, _B_thresh; \ 198 198 BIO_DECODE_PROLOGUE; \ … … 220 220 #define BINARY_LENGTH(x, b, count) \ 221 221 do { \ 222 register unsignedlong _B_x = (x); \223 register unsignedlong _B_b = (b); \222 register mg_u_long _B_x = (x); \ 223 register mg_u_long _B_b = (b); \ 224 224 register int _B_nbits, _B_logofb, _B_thresh; \ 225 225 POSITIVE(binary, _B_x); \ … … 240 240 #define GAMMA_ENCODE(x) \ 241 241 do { \ 242 register unsignedlong _B_xx = (x); \242 register mg_u_long _B_xx = (x); \ 243 243 register int _B_logofb; \ 244 244 register int _B_nbits; \ … … 255 255 #define GAMMA_ENCODE_L(x, count) \ 256 256 do { \ 257 register unsignedlong _B_xx = (x); \257 register mg_u_long _B_xx = (x); \ 258 258 register int _B_logofb; \ 259 259 register int _B_nbits; \ … … 271 271 #define GAMMA_DECODE(x) \ 272 272 do { \ 273 register unsignedlong _B_xx = 1; \273 register mg_u_long _B_xx = 1; \ 274 274 register int _B_nbits = 0; \ 275 275 BIO_DECODE_PROLOGUE; \ … … 283 283 #define GAMMA_DECODE_L(x, count) \ 284 284 do { \ 285 register unsignedlong _B_xx = 1; \285 register mg_u_long _B_xx = 1; \ 286 286 register int _B_nbits = 0; \ 287 287 BIO_DECODE_PROLOGUE; \ … … 296 296 #define GAMMA_LENGTH(x, count) \ 297 297 do { \ 298 register unsignedlong _B_xx = (x); \298 register mg_u_long _B_xx = (x); \ 299 299 register int _B_logofb; \ 300 300 POSITIVE(gamma, _B_xx); \ … … 310 310 #define DELTA_ENCODE(x) \ 311 311 do { \ 312 register unsignedlong _B_xxx = (x); \312 register mg_u_long _B_xxx = (x); \ 313 313 register int _B_logx; \ 314 314 FLOORLOG_2(_B_xxx, _B_logx); \ … … 319 319 #define DELTA_ENCODE_L(x, count) \ 320 320 do { \ 321 register unsignedlong _B_xxx = (x); \321 register mg_u_long _B_xxx = (x); \ 322 322 register int _B_logx; \ 323 323 FLOORLOG_2(_B_xxx, _B_logx); \ … … 329 329 #define DELTA_DECODE(x) \ 330 330 do { \ 331 register unsignedlong _B_xxx; \331 register mg_u_long _B_xxx; \ 332 332 register int _B_logx; \ 333 333 GAMMA_DECODE(_B_logx); --_B_logx; \ … … 338 338 #define DELTA_DECODE_L(x, count) \ 339 339 do { \ 340 register unsignedlong _B_xxx; \340 register mg_u_long _B_xxx; \ 341 341 register int _B_logx; \ 342 342 GAMMA_DECODE_L(_B_logx, count); --_B_logx; \ … … 347 347 #define DELTA_LENGTH(x, count) \ 348 348 do { \ 349 register unsignedlong _B_xxx = (x); \349 register mg_u_long _B_xxx = (x); \ 350 350 register int _B_logx, _B_dcount; \ 351 351 FLOORLOG_2(_B_xxx, _B_logx); \ … … 363 363 #define ELIAS_ENCODE(x, b, s) \ 364 364 do { \ 365 register unsignedlong _B_xx = (x); \366 register unsignedlong _B_b = (b); \365 register mg_u_long _B_xx = (x); \ 366 register mg_u_long _B_b = (b); \ 367 367 register double _B_s = (s); \ 368 368 register int _B_lower=1, _B_upper=1; \ … … 383 383 #define ELIAS_ENCODE_L(x, b, s, count) \ 384 384 do { \ 385 register unsignedlong _B_xx = (x); \386 register unsignedlong _B_b = (b); \385 register mg_u_long _B_xx = (x); \ 386 register mg_u_long _B_b = (b); \ 387 387 register double _B_s = (s); \ 388 388 register int _B_lower=1, _B_upper=1; \ … … 403 403 #define ELIAS_DECODE(x, b, s) \ 404 404 do { \ 405 register unsignedlong _B_xx; \406 register unsignedlong _B_b = (b); \405 register mg_u_long _B_xx; \ 406 register mg_u_long _B_b = (b); \ 407 407 register double _B_s = (s); \ 408 408 register int _B_lower=1, _B_upper=1; \ … … 423 423 #define ELIAS_DECODE_L(x, b, s, count) \ 424 424 do { \ 425 register unsignedlong _B_xx; \426 register unsignedlong _B_b = (b); \425 register mg_u_long _B_xx; \ 426 register mg_u_long _B_b = (b); \ 427 427 register double _B_s = (s); \ 428 428 register int _B_lower=1, _B_upper=1; \ … … 443 443 #define ELIAS_LENGTH(x, b, s, count) \ 444 444 do { \ 445 register unsignedlong _B_xx = (x); \446 register unsignedlong _B_b = (b); \445 register mg_u_long _B_xx = (x); \ 446 register mg_u_long _B_b = (b); \ 447 447 register double _B_s = (s); \ 448 448 register int _B_lower=1, _B_upper=1; \ … … 468 468 #define BBLOCK_ENCODE(x, b) \ 469 469 do { \ 470 register unsignedlong _B_xx = (x); \471 register unsignedlong _B_bb = (b); \470 register mg_u_long _B_xx = (x); \ 471 register mg_u_long _B_bb = (b); \ 472 472 register int _B_xdivb = 0; \ 473 473 POSITIVE(bblock, _B_xx); \ … … 484 484 #define BBLOCK_ENCODE_L(x, b, count) \ 485 485 do { \ 486 register unsignedlong _B_xx = (x); \487 register unsignedlong _B_bb = (b); \486 register mg_u_long _B_xx = (x); \ 487 register mg_u_long _B_bb = (b); \ 488 488 register int _B_xdivb = 0; \ 489 489 POSITIVE(bblock, _B_xx); \ … … 500 500 #define BBLOCK_DECODE(x, b) \ 501 501 do { \ 502 register unsignedlong _B_x1, _B_xx = 0; \503 register unsignedlong _B_bb = (b); \502 register mg_u_long _B_x1, _B_xx = 0; \ 503 register mg_u_long _B_bb = (b); \ 504 504 register int _B_xdivb; \ 505 505 UNARY_DECODE(_B_xdivb); --_B_xdivb; \ … … 512 512 #define BBLOCK_DECODE_L(x, b, count) \ 513 513 do { \ 514 register unsignedlong _B_x1, _B_xx = 0; \515 register unsignedlong _B_bb = (b); \514 register mg_u_long _B_x1, _B_xx = 0; \ 515 register mg_u_long _B_bb = (b); \ 516 516 register int _B_xdivb; \ 517 517 UNARY_DECODE_L(_B_xdivb, count); --_B_xdivb; \ … … 524 524 #define BBLOCK_LENGTH(x, b, count) \ 525 525 do { \ 526 register unsignedlong _B_bcount, _B_xx = (x); \527 register unsignedlong _B_bb = (b); \526 register mg_u_long _B_bcount, _B_xx = (x); \ 527 register mg_u_long _B_bb = (b); \ 528 528 register int _B_xdivb = 0; \ 529 529 POSITIVE(bblock, _B_xx); \ -
main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_m_mems.h
r16583 r25147 36 36 { 37 37 unsigned char *Base; 38 unsignedlong pos;38 mg_u_long pos; 39 39 } 40 40 mems_bitio_state; … … 44 44 { \ 45 45 register unsigned char *__base = b; \ 46 register unsignedlong __pos = p;46 register mg_u_long __pos = p; 47 47 48 48 #define ENCODE_CONTINUE(b) \ 49 49 { \ 50 50 register unsigned char *__base = (b).Base; \ 51 register unsignedlong __pos = (b).pos;51 register mg_u_long __pos = (b).pos; 52 52 53 53 #define ENCODE_BIT(b) \ … … 76 76 { \ 77 77 register unsigned char *__base = b; \ 78 register unsignedlong __pos = p;78 register mg_u_long __pos = p; 79 79 80 80 #define DECODE_CONTINUE(b) \ 81 81 { \ 82 82 register unsigned char *__base = (b).Base; \ 83 register unsignedlong __pos = (b).pos;83 register mg_u_long __pos = (b).pos; 84 84 85 85 #define DECODE_ADD_FF(b) \ -
main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_m_random.h
r16583 r25147 38 38 FILE *File; 39 39 unsigned char *Buf; 40 unsignedlong Base;41 unsignedlong Used;42 unsignedlong pos;43 unsignedlong len;44 unsignedlong sft;40 mg_u_long Base; 41 mg_u_long Used; 42 mg_u_long pos; 43 mg_u_long len; 44 mg_u_long sft; 45 45 } 46 46 random_bitio_state; … … 51 51 register FILE *__file = f; \ 52 52 register unsigned char *__buf; \ 53 register unsignedlong __pos = 0; \54 register unsignedlong __base = 0; \55 register unsignedlong __is_used = 0; \56 register unsignedlong __len = (l)-1; \57 register unsignedlong __sft = 0; \53 register mg_u_long __pos = 0; \ 54 register mg_u_long __base = 0; \ 55 register mg_u_long __is_used = 0; \ 56 register mg_u_long __len = (l)-1; \ 57 register mg_u_long __sft = 0; \ 58 58 while (__len) { ++__sft; __len >>=1; } \ 59 59 __len = 1<<__sft; \ … … 66 66 register FILE *__file = (b).File; \ 67 67 register unsigned char *__buf = (b).Buf; \ 68 register unsignedlong __pos = (b).pos; \69 register unsignedlong __base = (b).Base; \70 register unsignedlong __is_used = (b).Used; \71 register unsignedlong __len = (b).len; \72 register unsignedlong __sft = (b).sft;68 register mg_u_long __pos = (b).pos; \ 69 register mg_u_long __base = (b).Base; \ 70 register mg_u_long __is_used = (b).Used; \ 71 register mg_u_long __len = (b).len; \ 72 register mg_u_long __sft = (b).sft; 73 73 74 74 #define SEEK fprintf(stderr, "Seek to %d\n",__base) -
main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_mem.c
r16583 r25147 55 55 56 56 void 57 BIO_Mem_Unary_Encode ( unsignedlong val, mem_bitio_state * bs,58 unsignedlong *bits)57 BIO_Mem_Unary_Encode (mg_u_long val, mem_bitio_state * bs, 58 mg_u_long *bits) 59 59 { 60 60 ENCODE_CONTINUE (*bs) … … 67 67 68 68 69 unsignedlong69 mg_u_long 70 70 BIO_Mem_Unary_Decode (mem_bitio_state * bs, 71 unsignedlong *bits)72 { 73 register unsignedlong val;71 mg_u_long *bits) 72 { 73 register mg_u_long val; 74 74 DECODE_CONTINUE (*bs) 75 75 if (bits) … … 88 88 89 89 void 90 BIO_Mem_Binary_Encode ( unsigned long val, unsignedlong b,91 mem_bitio_state * bs, unsignedlong *bits)90 BIO_Mem_Binary_Encode (mg_u_long val, mg_u_long b, 91 mem_bitio_state * bs, mg_u_long *bits) 92 92 { 93 93 ENCODE_CONTINUE (*bs) … … 100 100 101 101 102 unsignedlong103 BIO_Mem_Binary_Decode ( unsignedlong b, mem_bitio_state * bs,104 unsignedlong *bits)105 { 106 register unsignedlong val;102 mg_u_long 103 BIO_Mem_Binary_Decode (mg_u_long b, mem_bitio_state * bs, 104 mg_u_long *bits) 105 { 106 register mg_u_long val; 107 107 DECODE_CONTINUE (*bs) 108 108 if (bits) … … 121 121 122 122 void 123 BIO_Mem_Gamma_Encode ( unsignedlong val, mem_bitio_state * bs,124 unsignedlong *bits)123 BIO_Mem_Gamma_Encode (mg_u_long val, mem_bitio_state * bs, 124 mg_u_long *bits) 125 125 { 126 126 ENCODE_CONTINUE (*bs) … … 133 133 134 134 135 unsignedlong136 BIO_Mem_Gamma_Decode (mem_bitio_state * bs, unsignedlong *bits)137 { 138 register unsignedlong val;135 mg_u_long 136 BIO_Mem_Gamma_Decode (mem_bitio_state * bs, mg_u_long *bits) 137 { 138 register mg_u_long val; 139 139 DECODE_CONTINUE (*bs) 140 140 if (bits) … … 150 150 151 151 void 152 BIO_Mem_Delta_Encode ( unsignedlong val, mem_bitio_state * bs,153 unsignedlong *bits)152 BIO_Mem_Delta_Encode (mg_u_long val, mem_bitio_state * bs, 153 mg_u_long *bits) 154 154 { 155 155 ENCODE_CONTINUE (*bs) … … 162 162 163 163 164 unsignedlong165 BIO_Mem_Delta_Decode (mem_bitio_state * bs, unsignedlong *bits)166 { 167 register unsignedlong val;164 mg_u_long 165 BIO_Mem_Delta_Decode (mem_bitio_state * bs, mg_u_long *bits) 166 { 167 register mg_u_long val; 168 168 DECODE_CONTINUE (*bs) 169 169 if (bits) … … 176 176 177 177 void 178 BIO_Mem_Elias_Encode ( unsigned long val, unsignedlong b, double s,179 mem_bitio_state * bs, unsignedlong *bits)178 BIO_Mem_Elias_Encode (mg_u_long val, mg_u_long b, double s, 179 mem_bitio_state * bs, mg_u_long *bits) 180 180 { 181 181 ENCODE_CONTINUE (*bs) … … 188 188 189 189 190 unsignedlong191 BIO_Mem_Elias_Decode ( unsignedlong b, double s,192 mem_bitio_state * bs, unsignedlong *bits)193 { 194 register unsignedlong val;190 mg_u_long 191 BIO_Mem_Elias_Decode (mg_u_long b, double s, 192 mem_bitio_state * bs, mg_u_long *bits) 193 { 194 register mg_u_long val; 195 195 DECODE_CONTINUE (*bs) 196 196 if (bits) … … 203 203 204 204 void 205 BIO_Mem_Bblock_Encode ( unsigned long val, unsignedlong b,206 mem_bitio_state * bs, unsignedlong *bits)205 BIO_Mem_Bblock_Encode (mg_u_long val, mg_u_long b, 206 mem_bitio_state * bs, mg_u_long *bits) 207 207 { 208 208 ENCODE_CONTINUE (*bs) … … 215 215 216 216 217 unsignedlong218 BIO_Mem_Bblock_Decode ( unsignedlong b, mem_bitio_state * bs,219 unsignedlong *bits)220 { 221 register unsignedlong val;217 mg_u_long 218 BIO_Mem_Bblock_Decode (mg_u_long b, mem_bitio_state * bs, 219 mg_u_long *bits) 220 { 221 register mg_u_long val; 222 222 DECODE_CONTINUE (*bs) 223 223 if (bits) … … 230 230 231 231 void 232 BIO_Mem_Decode_Seek ( unsignedlong pos, mem_bitio_state * bs)232 BIO_Mem_Decode_Seek (mg_u_long pos, mem_bitio_state * bs) 233 233 { 234 234 DECODE_CONTINUE (*bs) -
main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_mem.h
r16583 r25147 61 61 62 62 63 void BIO_Mem_Unary_Encode ( unsignedlong val, mem_bitio_state * bs,64 unsignedlong *bits);65 unsignedlong BIO_Mem_Unary_Decode (mem_bitio_state * bs,66 unsignedlong *bits);63 void BIO_Mem_Unary_Encode (mg_u_long val, mem_bitio_state * bs, 64 mg_u_long *bits); 65 mg_u_long BIO_Mem_Unary_Decode (mem_bitio_state * bs, 66 mg_u_long *bits); 67 67 68 68 69 69 70 void BIO_Mem_Binary_Encode ( unsigned long val, unsignedlong b,71 mem_bitio_state * bs, unsignedlong *bits);72 unsigned long BIO_Mem_Binary_Decode (unsignedlong b, mem_bitio_state * bs,73 unsignedlong *bits);70 void BIO_Mem_Binary_Encode (mg_u_long val, mg_u_long b, 71 mem_bitio_state * bs, mg_u_long *bits); 72 mg_u_long BIO_Mem_Binary_Decode (mg_u_long b, mem_bitio_state * bs, 73 mg_u_long *bits); 74 74 75 75 76 76 77 void BIO_Mem_Gamma_Encode ( unsignedlong val, mem_bitio_state * bs,78 unsignedlong *bits);79 unsigned long BIO_Mem_Gamma_Decode (mem_bitio_state * bs, unsignedlong *bits);77 void BIO_Mem_Gamma_Encode (mg_u_long val, mem_bitio_state * bs, 78 mg_u_long *bits); 79 mg_u_long BIO_Mem_Gamma_Decode (mem_bitio_state * bs, mg_u_long *bits); 80 80 81 81 82 82 83 void BIO_Mem_Delta_Encode ( unsignedlong val, mem_bitio_state * bs,84 unsignedlong *bits);85 unsigned long BIO_Mem_Delta_Decode (mem_bitio_state * bs, unsignedlong *bits);83 void BIO_Mem_Delta_Encode (mg_u_long val, mem_bitio_state * bs, 84 mg_u_long *bits); 85 mg_u_long BIO_Mem_Delta_Decode (mem_bitio_state * bs, mg_u_long *bits); 86 86 87 87 88 void BIO_Mem_Elias_Encode ( unsigned long val, unsignedlong b, double s,89 mem_bitio_state * bs, unsignedlong *bits);90 unsigned long BIO_Mem_Elias_Decode (unsignedlong b, double s,91 mem_bitio_state * bs, unsignedlong *bits);88 void BIO_Mem_Elias_Encode (mg_u_long val, mg_u_long b, double s, 89 mem_bitio_state * bs, mg_u_long *bits); 90 mg_u_long BIO_Mem_Elias_Decode (mg_u_long b, double s, 91 mem_bitio_state * bs, mg_u_long *bits); 92 92 93 93 94 void BIO_Mem_Bblock_Encode ( unsigned long val, unsignedlong b,95 mem_bitio_state * bs, unsignedlong *bits);96 unsigned long BIO_Mem_Bblock_Decode (unsignedlong b, mem_bitio_state * bs,97 unsignedlong *bits);94 void BIO_Mem_Bblock_Encode (mg_u_long val, mg_u_long b, 95 mem_bitio_state * bs, mg_u_long *bits); 96 mg_u_long BIO_Mem_Bblock_Decode (mg_u_long b, mem_bitio_state * bs, 97 mg_u_long *bits); 98 98 99 99 100 void BIO_Mem_Decode_Seek ( unsignedlong pos, mem_bitio_state * bs);100 void BIO_Mem_Decode_Seek (mg_u_long pos, mem_bitio_state * bs); 101 101 102 102 -
main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_mems.c
r16583 r25147 30 30 31 31 void 32 BIO_Mems_Encode_Start (unsigned char *buf, unsignedlong pos,32 BIO_Mems_Encode_Start (unsigned char *buf, mg_u_long pos, 33 33 mems_bitio_state * bs) 34 34 { … … 46 46 47 47 void 48 BIO_Mems_Decode_Start (unsigned char *buf, unsignedlong pos,48 BIO_Mems_Decode_Start (unsigned char *buf, mg_u_long pos, 49 49 mems_bitio_state * bs) 50 50 { … … 57 57 58 58 void 59 BIO_Mems_Unary_Encode ( unsignedlong val, mems_bitio_state * bs,60 unsignedlong *bits)59 BIO_Mems_Unary_Encode (mg_u_long val, mems_bitio_state * bs, 60 mg_u_long *bits) 61 61 { 62 62 ENCODE_CONTINUE (*bs) … … 69 69 70 70 71 unsignedlong71 mg_u_long 72 72 BIO_Mems_Unary_Decode (mems_bitio_state * bs, 73 unsignedlong *bits)74 { 75 register unsignedlong val;73 mg_u_long *bits) 74 { 75 register mg_u_long val; 76 76 DECODE_CONTINUE (*bs) 77 77 if (bits) … … 90 90 91 91 void 92 BIO_Mems_Binary_Encode ( unsigned long val, unsignedlong b,93 mems_bitio_state * bs, unsignedlong *bits)92 BIO_Mems_Binary_Encode (mg_u_long val, mg_u_long b, 93 mems_bitio_state * bs, mg_u_long *bits) 94 94 { 95 95 ENCODE_CONTINUE (*bs) … … 102 102 103 103 104 unsignedlong105 BIO_Mems_Binary_Decode ( unsignedlong b, mems_bitio_state * bs,106 unsignedlong *bits)107 { 108 register unsignedlong val;104 mg_u_long 105 BIO_Mems_Binary_Decode (mg_u_long b, mems_bitio_state * bs, 106 mg_u_long *bits) 107 { 108 register mg_u_long val; 109 109 DECODE_CONTINUE (*bs) 110 110 if (bits) … … 123 123 124 124 void 125 BIO_Mems_Gamma_Encode ( unsignedlong val, mems_bitio_state * bs,126 unsignedlong *bits)125 BIO_Mems_Gamma_Encode (mg_u_long val, mems_bitio_state * bs, 126 mg_u_long *bits) 127 127 { 128 128 ENCODE_CONTINUE (*bs) … … 135 135 136 136 137 unsignedlong138 BIO_Mems_Gamma_Decode (mems_bitio_state * bs, unsignedlong *bits)139 { 140 register unsignedlong val;137 mg_u_long 138 BIO_Mems_Gamma_Decode (mems_bitio_state * bs, mg_u_long *bits) 139 { 140 register mg_u_long val; 141 141 DECODE_CONTINUE (*bs) 142 142 if (bits) … … 152 152 153 153 void 154 BIO_Mems_Delta_Encode ( unsignedlong val, mems_bitio_state * bs,155 unsignedlong *bits)154 BIO_Mems_Delta_Encode (mg_u_long val, mems_bitio_state * bs, 155 mg_u_long *bits) 156 156 { 157 157 ENCODE_CONTINUE (*bs) … … 164 164 165 165 166 unsignedlong167 BIO_Mems_Delta_Decode (mems_bitio_state * bs, unsignedlong *bits)168 { 169 register unsignedlong val;166 mg_u_long 167 BIO_Mems_Delta_Decode (mems_bitio_state * bs, mg_u_long *bits) 168 { 169 register mg_u_long val; 170 170 DECODE_CONTINUE (*bs) 171 171 if (bits) … … 178 178 179 179 void 180 BIO_Mems_Elias_Encode ( unsigned long val, unsignedlong b, double s,181 mems_bitio_state * bs, unsignedlong *bits)180 BIO_Mems_Elias_Encode (mg_u_long val, mg_u_long b, double s, 181 mems_bitio_state * bs, mg_u_long *bits) 182 182 { 183 183 ENCODE_CONTINUE (*bs) … … 190 190 191 191 192 unsignedlong193 BIO_Mems_Elias_Decode ( unsignedlong b, double s,194 mems_bitio_state * bs, unsignedlong *bits)195 { 196 register unsignedlong val;192 mg_u_long 193 BIO_Mems_Elias_Decode (mg_u_long b, double s, 194 mems_bitio_state * bs, mg_u_long *bits) 195 { 196 register mg_u_long val; 197 197 DECODE_CONTINUE (*bs) 198 198 if (bits) … … 205 205 206 206 void 207 BIO_Mems_Bblock_Encode ( unsigned long val, unsignedlong b,208 mems_bitio_state * bs, unsignedlong *bits)207 BIO_Mems_Bblock_Encode (mg_u_long val, mg_u_long b, 208 mems_bitio_state * bs, mg_u_long *bits) 209 209 { 210 210 ENCODE_CONTINUE (*bs) … … 217 217 218 218 219 unsignedlong220 BIO_Mems_Bblock_Decode ( unsignedlong b, mems_bitio_state * bs,221 unsignedlong *bits)222 { 223 register unsignedlong val;219 mg_u_long 220 BIO_Mems_Bblock_Decode (mg_u_long b, mems_bitio_state * bs, 221 mg_u_long *bits) 222 { 223 register mg_u_long val; 224 224 DECODE_CONTINUE (*bs) 225 225 if (bits) … … 232 232 233 233 void 234 BIO_Mems_Decode_Seek ( unsignedlong pos, mems_bitio_state * bs)234 BIO_Mems_Decode_Seek (mg_u_long pos, mems_bitio_state * bs) 235 235 { 236 236 DECODE_CONTINUE (*bs) … … 240 240 241 241 void 242 BIO_Mems_Encode_Seek ( unsignedlong pos, mems_bitio_state * bs)242 BIO_Mems_Encode_Seek (mg_u_long pos, mems_bitio_state * bs) 243 243 { 244 244 ENCODE_CONTINUE (*bs) -
main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_mems.h
r16583 r25147 38 38 { 39 39 unsigned char *Base; 40 unsignedlong pos;40 mg_u_long pos; 41 41 } 42 42 mems_bitio_state; … … 46 46 47 47 48 void BIO_Mems_Encode_Start (char *buf, unsignedlong pos, mems_bitio_state * bs);48 void BIO_Mems_Encode_Start (char *buf, mg_u_long pos, mems_bitio_state * bs); 49 49 void BIO_Mems_Encode_Done (mems_bitio_state * bs); 50 50 51 51 52 52 53 void BIO_Mems_Decode_Start (void *buf, unsignedlong pos, mems_bitio_state * bs);53 void BIO_Mems_Decode_Start (void *buf, mg_u_long pos, mems_bitio_state * bs); 54 54 55 55 56 56 57 void BIO_Mems_Unary_Encode ( unsignedlong val, mems_bitio_state * bs,58 unsignedlong *bits);59 unsignedlong BIO_Mems_Unary_Decode (mems_bitio_state * bs,60 unsignedlong *bits);57 void BIO_Mems_Unary_Encode (mg_u_long val, mems_bitio_state * bs, 58 mg_u_long *bits); 59 mg_u_long BIO_Mems_Unary_Decode (mems_bitio_state * bs, 60 mg_u_long *bits); 61 61 62 62 63 63 64 void BIO_Mems_Binary_Encode ( unsigned long val, unsignedlong b,65 mems_bitio_state * bs, unsignedlong *bits);66 unsigned long BIO_Mems_Binary_Decode (unsignedlong b, mems_bitio_state * bs,67 unsignedlong *bits);64 void BIO_Mems_Binary_Encode (mg_u_long val, mg_u_long b, 65 mems_bitio_state * bs, mg_u_long *bits); 66 mg_u_long BIO_Mems_Binary_Decode (mg_u_long b, mems_bitio_state * bs, 67 mg_u_long *bits); 68 68 69 69 70 70 71 void BIO_Mems_Gamma_Encode ( unsignedlong val, mems_bitio_state * bs,72 unsignedlong *bits);73 unsigned long BIO_Mems_Gamma_Decode (mems_bitio_state * bs, unsignedlong *bits);71 void BIO_Mems_Gamma_Encode (mg_u_long val, mems_bitio_state * bs, 72 mg_u_long *bits); 73 mg_u_long BIO_Mems_Gamma_Decode (mems_bitio_state * bs, mg_u_long *bits); 74 74 75 75 76 76 77 void BIO_Mems_Delta_Encode ( unsignedlong val, mems_bitio_state * bs,78 unsignedlong *bits);79 unsigned long BIO_Mems_Delta_Decode (mems_bitio_state * bs, unsignedlong *bits);77 void BIO_Mems_Delta_Encode (mg_u_long val, mems_bitio_state * bs, 78 mg_u_long *bits); 79 mg_u_long BIO_Mems_Delta_Decode (mems_bitio_state * bs, mg_u_long *bits); 80 80 81 81 82 void BIO_Mems_Elias_Encode ( unsigned long val, unsignedlong b, double s,83 mems_bitio_state * bs, unsignedlong *bits);84 unsigned long BIO_Mems_Elias_Decode (unsignedlong b, double s,85 mems_bitio_state * bs, unsignedlong *bits);82 void BIO_Mems_Elias_Encode (mg_u_long val, mg_u_long b, double s, 83 mems_bitio_state * bs, mg_u_long *bits); 84 mg_u_long BIO_Mems_Elias_Decode (mg_u_long b, double s, 85 mems_bitio_state * bs, mg_u_long *bits); 86 86 87 87 88 void BIO_Mems_Bblock_Encode ( unsigned long val, unsignedlong b,89 mems_bitio_state * bs, unsignedlong *bits);90 unsigned long BIO_Mems_Bblock_Decode (unsignedlong b, mems_bitio_state * bs,91 unsignedlong *bits);88 void BIO_Mems_Bblock_Encode (mg_u_long val, mg_u_long b, 89 mems_bitio_state * bs, mg_u_long *bits); 90 mg_u_long BIO_Mems_Bblock_Decode (mg_u_long b, mems_bitio_state * bs, 91 mg_u_long *bits); 92 92 93 93 94 void BIO_Mems_Decode_Seek ( unsignedlong pos, mems_bitio_state * bs);94 void BIO_Mems_Decode_Seek (mg_u_long pos, mems_bitio_state * bs); 95 95 96 96 -
main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_random.c
r16583 r25147 30 30 31 31 void 32 BIO_Random_Start (FILE * f, unsignedlong len,32 BIO_Random_Start (FILE * f, mg_u_long len, 33 33 random_bitio_state * bs) 34 34 { … … 64 64 65 65 void 66 BIO_Random_Unary_Encode ( unsignedlong val, random_bitio_state * bs,67 unsignedlong *bits)66 BIO_Random_Unary_Encode (mg_u_long val, random_bitio_state * bs, 67 mg_u_long *bits) 68 68 { 69 69 ENCODE_CONTINUE (*bs) … … 76 76 77 77 78 unsignedlong78 mg_u_long 79 79 BIO_Random_Unary_Decode (random_bitio_state * bs, 80 unsignedlong *bits)81 { 82 register unsignedlong val;80 mg_u_long *bits) 81 { 82 register mg_u_long val; 83 83 DECODE_CONTINUE (*bs) 84 84 if (bits) … … 97 97 98 98 void 99 BIO_Random_Binary_Encode ( unsigned long val, unsignedlong b,100 random_bitio_state * bs, unsignedlong *bits)99 BIO_Random_Binary_Encode (mg_u_long val, mg_u_long b, 100 random_bitio_state * bs, mg_u_long *bits) 101 101 { 102 102 ENCODE_CONTINUE (*bs) … … 109 109 110 110 111 unsignedlong112 BIO_Random_Binary_Decode ( unsignedlong b,111 mg_u_long 112 BIO_Random_Binary_Decode (mg_u_long b, 113 113 random_bitio_state * bs, 114 unsignedlong *bits)115 { 116 register unsignedlong val;114 mg_u_long *bits) 115 { 116 register mg_u_long val; 117 117 DECODE_CONTINUE (*bs) 118 118 if (bits) … … 131 131 132 132 void 133 BIO_Random_Gamma_Encode ( unsignedlong val, random_bitio_state * bs,134 unsignedlong *bits)133 BIO_Random_Gamma_Encode (mg_u_long val, random_bitio_state * bs, 134 mg_u_long *bits) 135 135 { 136 136 ENCODE_CONTINUE (*bs) … … 143 143 144 144 145 unsignedlong145 mg_u_long 146 146 BIO_Random_Gamma_Decode (random_bitio_state * bs, 147 unsignedlong *bits)148 { 149 register unsignedlong val;147 mg_u_long *bits) 148 { 149 register mg_u_long val; 150 150 DECODE_CONTINUE (*bs) 151 151 if (bits) … … 161 161 162 162 void 163 BIO_Random_Delta_Encode ( unsignedlong val, random_bitio_state * bs,164 unsignedlong *bits)163 BIO_Random_Delta_Encode (mg_u_long val, random_bitio_state * bs, 164 mg_u_long *bits) 165 165 { 166 166 ENCODE_CONTINUE (*bs) … … 173 173 174 174 175 unsignedlong175 mg_u_long 176 176 BIO_Random_Delta_Decode (random_bitio_state * bs, 177 unsignedlong *bits)178 { 179 register unsignedlong val;177 mg_u_long *bits) 178 { 179 register mg_u_long val; 180 180 DECODE_CONTINUE (*bs) 181 181 if (bits) … … 188 188 189 189 void 190 BIO_Random_Elias_Encode ( unsigned long val, unsignedlong b, double s,191 random_bitio_state * bs, unsignedlong *bits)190 BIO_Random_Elias_Encode (mg_u_long val, mg_u_long b, double s, 191 random_bitio_state * bs, mg_u_long *bits) 192 192 { 193 193 ENCODE_CONTINUE (*bs) … … 200 200 201 201 202 unsignedlong203 BIO_Random_Elias_Decode ( unsignedlong b, double s,202 mg_u_long 203 BIO_Random_Elias_Decode (mg_u_long b, double s, 204 204 random_bitio_state * bs, 205 unsignedlong *bits)206 { 207 register unsignedlong val;205 mg_u_long *bits) 206 { 207 register mg_u_long val; 208 208 DECODE_CONTINUE (*bs) 209 209 if (bits) … … 216 216 217 217 void 218 BIO_Random_Bblock_Encode ( unsigned long val, unsignedlong b,219 random_bitio_state * bs, unsignedlong *bits)218 BIO_Random_Bblock_Encode (mg_u_long val, mg_u_long b, 219 random_bitio_state * bs, mg_u_long *bits) 220 220 { 221 221 ENCODE_CONTINUE (*bs) … … 228 228 229 229 230 unsignedlong231 BIO_Random_Bblock_Decode ( unsignedlong b,230 mg_u_long 231 BIO_Random_Bblock_Decode (mg_u_long b, 232 232 random_bitio_state * bs, 233 unsignedlong *bits)234 { 235 register unsignedlong val;233 mg_u_long *bits) 234 { 235 register mg_u_long val; 236 236 DECODE_CONTINUE (*bs) 237 237 if (bits) … … 244 244 245 245 void 246 BIO_Random_Seek ( unsignedlong pos, random_bitio_state * bs)246 BIO_Random_Seek (mg_u_long pos, random_bitio_state * bs) 247 247 { 248 248 ENCODE_CONTINUE (*bs) … … 258 258 } 259 259 260 unsignedlong260 mg_u_long 261 261 BIO_Random_Tell (random_bitio_state * bs) 262 262 { 263 register unsignedlong t;263 register mg_u_long t; 264 264 ENCODE_CONTINUE (*bs) 265 265 t = ENCODE_TELL; … … 278 278 ((((pos)+7) >> 3) < (mg_ullong)(__base + __len))) 279 279 { 280 __pos = ( long)((pos) - (mg_ullong)(__base << 3));280 __pos = (mg_s_long)((pos) - (mg_ullong)(__base << 3)); 281 281 } 282 282 else 283 283 { 284 284 ENCODE_FLUSH; 285 __base = ( long)(((pos) >> (__sft+3)) << __sft);285 __base = (mg_s_long)(((pos) >> (__sft+3)) << __sft); 286 286 287 287 fseek(__file,__base,0); 288 288 fread(__buf,1,__len,__file); 289 __pos = ( long)((pos) & ((8 << __sft)-1));289 __pos = (mg_s_long)((pos) & ((8 << __sft)-1)); 290 290 } 291 291 -
main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_random.h
r16583 r25147 43 43 FILE *File; 44 44 unsigned char *Buf; 45 unsignedlong Base;46 unsignedlong Used;47 unsignedlong pos;48 unsignedlong len;49 unsignedlong sft;45 mg_u_long Base; 46 mg_u_long Used; 47 mg_u_long pos; 48 mg_u_long len; 49 mg_u_long sft; 50 50 } 51 51 random_bitio_state; … … 55 55 56 56 57 void BIO_Random_Start (FILE * f, unsignedlong len,57 void BIO_Random_Start (FILE * f, mg_u_long len, 58 58 random_bitio_state * bs); 59 59 void BIO_Random_Done (random_bitio_state * bs); … … 61 61 62 62 63 void BIO_Random_Decode_Start (void *buf, unsignedlong pos,63 void BIO_Random_Decode_Start (void *buf, mg_u_long pos, 64 64 random_bitio_state * bs); 65 65 … … 69 69 70 70 71 void BIO_Random_Unary_Encode ( unsignedlong val, random_bitio_state * bs,72 unsignedlong *bits);73 unsignedlong BIO_Random_Unary_Decode (random_bitio_state * bs,74 unsignedlong *bits);71 void BIO_Random_Unary_Encode (mg_u_long val, random_bitio_state * bs, 72 mg_u_long *bits); 73 mg_u_long BIO_Random_Unary_Decode (random_bitio_state * bs, 74 mg_u_long *bits); 75 75 76 76 77 77 78 void BIO_Random_Binary_Encode ( unsigned long val, unsignedlong b,79 random_bitio_state * bs, unsignedlong *bits);80 unsigned long BIO_Random_Binary_Decode (unsignedlong b, random_bitio_state * bs,81 unsignedlong *bits);78 void BIO_Random_Binary_Encode (mg_u_long val, mg_u_long b, 79 random_bitio_state * bs, mg_u_long *bits); 80 mg_u_long BIO_Random_Binary_Decode (mg_u_long b, random_bitio_state * bs, 81 mg_u_long *bits); 82 82 83 83 84 84 85 void BIO_Random_Gamma_Encode ( unsignedlong val, random_bitio_state * bs,86 unsignedlong *bits);87 unsignedlong BIO_Random_Gamma_Decode (random_bitio_state * bs,88 unsignedlong *bits);85 void BIO_Random_Gamma_Encode (mg_u_long val, random_bitio_state * bs, 86 mg_u_long *bits); 87 mg_u_long BIO_Random_Gamma_Decode (random_bitio_state * bs, 88 mg_u_long *bits); 89 89 90 90 91 91 92 void BIO_Random_Delta_Encode ( unsignedlong val, random_bitio_state * bs,93 unsignedlong *bits);94 unsignedlong BIO_Random_Delta_Decode (random_bitio_state * bs,95 unsignedlong *bits);92 void BIO_Random_Delta_Encode (mg_u_long val, random_bitio_state * bs, 93 mg_u_long *bits); 94 mg_u_long BIO_Random_Delta_Decode (random_bitio_state * bs, 95 mg_u_long *bits); 96 96 97 97 98 void BIO_Random_Elias_Encode ( unsigned long val, unsignedlong b, double s,99 random_bitio_state * bs, unsignedlong *bits);100 unsigned long BIO_Random_Elias_Decode (unsignedlong b, double s,98 void BIO_Random_Elias_Encode (mg_u_long val, mg_u_long b, double s, 99 random_bitio_state * bs, mg_u_long *bits); 100 mg_u_long BIO_Random_Elias_Decode (mg_u_long b, double s, 101 101 random_bitio_state * bs, 102 unsignedlong *bits);102 mg_u_long *bits); 103 103 104 104 105 void BIO_Random_Bblock_Encode ( unsigned long val, unsignedlong b,106 random_bitio_state * bs, unsignedlong *bits);107 unsigned long BIO_Random_Bblock_Decode (unsignedlong b,105 void BIO_Random_Bblock_Encode (mg_u_long val, mg_u_long b, 106 random_bitio_state * bs, mg_u_long *bits); 107 mg_u_long BIO_Random_Bblock_Decode (mg_u_long b, 108 108 random_bitio_state * bs, 109 unsignedlong *bits);109 mg_u_long *bits); 110 110 111 111 112 void BIO_Random_Seek ( unsignedlong pos, random_bitio_state * bs);112 void BIO_Random_Seek (mg_u_long pos, random_bitio_state * bs); 113 113 114 114 void BIO_Random_Flush (random_bitio_state * bs); 115 115 116 unsignedlong BIO_Random_Tell (random_bitio_state * bs);116 mg_u_long BIO_Random_Tell (random_bitio_state * bs); 117 117 118 118 #ifdef USE_LONG_LONG -
main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_stdio.c
r16583 r25147 72 72 73 73 void 74 BIO_Stdio_Unary_Encode ( unsignedlong val, stdio_bitio_state * bs,75 unsignedlong *bits)74 BIO_Stdio_Unary_Encode (mg_u_long val, stdio_bitio_state * bs, 75 mg_u_long *bits) 76 76 { 77 77 ENCODE_CONTINUE (*bs) … … 84 84 85 85 86 unsignedlong86 mg_u_long 87 87 BIO_Stdio_Unary_Decode (stdio_bitio_state * bs, 88 unsignedlong *bits)89 { 90 register unsignedlong val;88 mg_u_long *bits) 89 { 90 register mg_u_long val; 91 91 DECODE_CONTINUE (*bs) 92 92 if (bits) … … 105 105 106 106 void 107 BIO_Stdio_Binary_Encode ( unsigned long val, unsignedlong b,108 stdio_bitio_state * bs, unsignedlong *bits)107 BIO_Stdio_Binary_Encode (mg_u_long val, mg_u_long b, 108 stdio_bitio_state * bs, mg_u_long *bits) 109 109 { 110 110 ENCODE_CONTINUE (*bs) … … 117 117 118 118 119 unsignedlong120 BIO_Stdio_Binary_Decode ( unsignedlong b, stdio_bitio_state * bs,121 unsignedlong *bits)122 { 123 register unsignedlong val;119 mg_u_long 120 BIO_Stdio_Binary_Decode (mg_u_long b, stdio_bitio_state * bs, 121 mg_u_long *bits) 122 { 123 register mg_u_long val; 124 124 DECODE_CONTINUE (*bs) 125 125 if (bits) … … 138 138 139 139 void 140 BIO_Stdio_Gamma_Encode ( unsignedlong val, stdio_bitio_state * bs,141 unsignedlong *bits)140 BIO_Stdio_Gamma_Encode (mg_u_long val, stdio_bitio_state * bs, 141 mg_u_long *bits) 142 142 { 143 143 ENCODE_CONTINUE (*bs) … … 150 150 151 151 152 unsignedlong152 mg_u_long 153 153 BIO_Stdio_Gamma_Decode (stdio_bitio_state * bs, 154 unsignedlong *bits)155 { 156 register unsignedlong val;154 mg_u_long *bits) 155 { 156 register mg_u_long val; 157 157 DECODE_CONTINUE (*bs) 158 158 if (bits) … … 168 168 169 169 void 170 BIO_Stdio_Delta_Encode ( unsignedlong val, stdio_bitio_state * bs,171 unsignedlong *bits)170 BIO_Stdio_Delta_Encode (mg_u_long val, stdio_bitio_state * bs, 171 mg_u_long *bits) 172 172 { 173 173 ENCODE_CONTINUE (*bs) … … 180 180 181 181 182 unsignedlong182 mg_u_long 183 183 BIO_Stdio_Delta_Decode (stdio_bitio_state * bs, 184 unsignedlong *bits)185 { 186 register unsignedlong val;184 mg_u_long *bits) 185 { 186 register mg_u_long val; 187 187 DECODE_CONTINUE (*bs) 188 188 if (bits) … … 198 198 199 199 void 200 BIO_Stdio_Elias_Encode ( unsigned long val, unsignedlong b, double s,201 stdio_bitio_state * bs, unsignedlong *bits)200 BIO_Stdio_Elias_Encode (mg_u_long val, mg_u_long b, double s, 201 stdio_bitio_state * bs, mg_u_long *bits) 202 202 { 203 203 ENCODE_CONTINUE (*bs) … … 210 210 211 211 212 unsignedlong213 BIO_Stdio_Elias_Decode ( unsignedlong b, double s,212 mg_u_long 213 BIO_Stdio_Elias_Decode (mg_u_long b, double s, 214 214 stdio_bitio_state * bs, 215 unsignedlong *bits)216 { 217 register unsignedlong val;215 mg_u_long *bits) 216 { 217 register mg_u_long val; 218 218 DECODE_CONTINUE (*bs) 219 219 if (bits) … … 228 228 229 229 void 230 BIO_Stdio_Bblock_Encode ( unsigned long val, unsignedlong b,231 stdio_bitio_state * bs, unsignedlong *bits)230 BIO_Stdio_Bblock_Encode (mg_u_long val, mg_u_long b, 231 stdio_bitio_state * bs, mg_u_long *bits) 232 232 { 233 233 ENCODE_CONTINUE (*bs) … … 240 240 241 241 242 unsignedlong243 BIO_Stdio_Bblock_Decode ( unsignedlong b, stdio_bitio_state * bs,244 unsignedlong *bits)245 { 246 register unsignedlong val;242 mg_u_long 243 BIO_Stdio_Bblock_Decode (mg_u_long b, stdio_bitio_state * bs, 244 mg_u_long *bits) 245 { 246 register mg_u_long val; 247 247 DECODE_CONTINUE (*bs) 248 248 if (bits) … … 255 255 256 256 void 257 BIO_Stdio_Decode_Seek ( unsignedlong pos, stdio_bitio_state * bs)257 BIO_Stdio_Decode_Seek (mg_u_long pos, stdio_bitio_state * bs) 258 258 { 259 259 DECODE_CONTINUE (*bs) -
main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_stdio.h
r16583 r25147 59 59 60 60 61 void BIO_Stdio_Unary_Encode ( unsignedlong val, stdio_bitio_state * bs,62 unsignedlong *bits);63 unsignedlong BIO_Stdio_Unary_Decode (stdio_bitio_state * bs,64 unsignedlong *bits);61 void BIO_Stdio_Unary_Encode (mg_u_long val, stdio_bitio_state * bs, 62 mg_u_long *bits); 63 mg_u_long BIO_Stdio_Unary_Decode (stdio_bitio_state * bs, 64 mg_u_long *bits); 65 65 66 66 67 67 68 void BIO_Stdio_Binary_Encode ( unsigned long val, unsignedlong b,69 stdio_bitio_state * bs, unsignedlong *bits);70 unsigned long BIO_Stdio_Binary_Decode (unsignedlong b, stdio_bitio_state * bs,71 unsignedlong *bits);68 void BIO_Stdio_Binary_Encode (mg_u_long val, mg_u_long b, 69 stdio_bitio_state * bs, mg_u_long *bits); 70 mg_u_long BIO_Stdio_Binary_Decode (mg_u_long b, stdio_bitio_state * bs, 71 mg_u_long *bits); 72 72 73 73 74 74 75 void BIO_Stdio_Gamma_Encode ( unsignedlong val, stdio_bitio_state * bs,76 unsignedlong *bits);77 unsignedlong BIO_Stdio_Gamma_Decode (stdio_bitio_state * bs,78 unsignedlong *bits);75 void BIO_Stdio_Gamma_Encode (mg_u_long val, stdio_bitio_state * bs, 76 mg_u_long *bits); 77 mg_u_long BIO_Stdio_Gamma_Decode (stdio_bitio_state * bs, 78 mg_u_long *bits); 79 79 80 80 81 81 82 void BIO_Stdio_Delta_Encode ( unsignedlong val, stdio_bitio_state * bs,83 unsignedlong *bits);84 unsignedlong BIO_Stdio_Delta_Decode (stdio_bitio_state * bs,85 unsignedlong *bits);82 void BIO_Stdio_Delta_Encode (mg_u_long val, stdio_bitio_state * bs, 83 mg_u_long *bits); 84 mg_u_long BIO_Stdio_Delta_Decode (stdio_bitio_state * bs, 85 mg_u_long *bits); 86 86 87 87 88 88 89 void BIO_Stdio_Elias_Encode ( unsigned long val, unsignedlong b, double s,90 stdio_bitio_state * bs, unsignedlong *bits);91 unsigned long BIO_Stdio_Elias_Decode (unsignedlong b, double s,89 void BIO_Stdio_Elias_Encode (mg_u_long val, mg_u_long b, double s, 90 stdio_bitio_state * bs, mg_u_long *bits); 91 mg_u_long BIO_Stdio_Elias_Decode (mg_u_long b, double s, 92 92 stdio_bitio_state * bs, 93 unsignedlong *bits);93 mg_u_long *bits); 94 94 95 95 96 void BIO_Stdio_Bblock_Encode ( unsigned long val, unsignedlong b,97 stdio_bitio_state * bs, unsignedlong *bits);98 unsigned long BIO_Stdio_Bblock_Decode (unsignedlong b, stdio_bitio_state * bs,99 unsignedlong *bits);96 void BIO_Stdio_Bblock_Encode (mg_u_long val, mg_u_long b, 97 stdio_bitio_state * bs, mg_u_long *bits); 98 mg_u_long BIO_Stdio_Bblock_Decode (mg_u_long b, stdio_bitio_state * bs, 99 mg_u_long *bits); 100 100 101 101 102 void BIO_Stdio_Decode_Seek ( unsignedlong pos, stdio_bitio_state * bs);102 void BIO_Stdio_Decode_Seek (mg_u_long pos, stdio_bitio_state * bs); 103 103 104 104 #endif -
main/trunk/greenstone2/common-src/indexers/mg/lib/filestats.c
r16583 r25147 28 28 29 29 File * 30 Fopen (char *name, char *mode, unsignedlong magic)30 Fopen (char *name, char *mode, mg_u_long magic) 31 31 { 32 32 FILE *f; 33 33 File *F; 34 unsignedlong m;34 mg_u_long m; 35 35 if (!(f = fopen (name, mode))) 36 36 return (NULL); … … 90 90 91 91 int 92 Fseek (File * F, long offset, int ptrname)92 Fseek (File * F, mg_s_long offset, int ptrname) 93 93 { 94 94 int num; -
main/trunk/greenstone2/common-src/indexers/mg/lib/filestats.h
r16583 r25147 23 23 #define H_FILESTATS 24 24 25 #include "mglong.h" 25 26 26 27 typedef struct FileStats 27 28 { 28 unsignedlong NumSeeks;29 unsignedlong NumReads;30 unsignedlong NumBytes;29 mg_u_long NumSeeks; 30 mg_u_long NumReads; 31 mg_u_long NumBytes; 31 32 } 32 33 FileStats; … … 45 46 46 47 /* if magic is 0 no magic number is read or written */ 47 File *Fopen (char *name, char *mode, unsignedlong magic);48 File *Fopen (char *name, char *mode, mg_u_long magic); 48 49 49 50 size_t Fread (void *ptr, size_t size, size_t nitems, File * F); 50 51 51 int Fseek (File * F, long offset, int ptrname);52 int Fseek (File * F, mg_s_long offset, int ptrname); 52 53 53 54 void Rewind (File * F); -
main/trunk/greenstone2/common-src/indexers/mg/lib/gmalloc.c
r16583 r25147 401 401 { 402 402 __ptr_t result; 403 unsigned long intadj;403 mg_u_long adj; 404 404 405 405 result = (*__morecore) (size); 406 adj = ( unsigned long int) ((unsigned long int) ((char *) result -406 adj = (mg_u_long) ((mg_u_long) ((char *) result - 407 407 (char *) NULL)) % BLOCKSIZE; 408 408 if (adj != 0) … … 549 549 block = BLOCK (result); 550 550 if (--_heapinfo[block].busy.info.frag.nfree != 0) 551 _heapinfo[block].busy.info.frag.first = ( unsigned long int)552 (( unsigned long int) ((char *) next->next - (char *) NULL)551 _heapinfo[block].busy.info.frag.first = (mg_u_long) 552 ((mg_u_long) ((char *) next->next - (char *) NULL) 553 553 % BLOCKSIZE) >> log; 554 554 … … 872 872 prev = (struct list *) ptr; 873 873 _heapinfo[block].busy.info.frag.nfree = 1; 874 _heapinfo[block].busy.info.frag.first = ( unsigned long int)875 (( unsigned long int) ((char *) ptr - (char *) NULL)874 _heapinfo[block].busy.info.frag.first = (mg_u_long) 875 ((mg_u_long) ((char *) ptr - (char *) NULL) 876 876 % BLOCKSIZE >> type); 877 877 prev->next = _fraghead[type].next; … … 1284 1284 { 1285 1285 __ptr_t result; 1286 unsignedlong int adj;1286 mg_u_long int adj; 1287 1287 1288 1288 size = ((size + alignment - 1) / alignment) * alignment; … … 1291 1291 if (result == NULL) 1292 1292 return NULL; 1293 adj = ( unsigned long int) ((unsigned long int) ((char *) result -1293 adj = (mg_u_long) ((mg_u_long) ((char *) result - 1294 1294 (char *) NULL)) % alignment; 1295 1295 if (adj != 0) -
main/trunk/greenstone2/common-src/indexers/mg/lib/huffman.c
r16583 r25147 30 30 */ 31 31 huff_data * 32 Generate_Huffman_Data (int num, long *freqs, huff_data * data,33 u_long * mem)32 Generate_Huffman_Data (int num, mg_s_long *freqs, huff_data * data, 33 mg_u_long * mem) 34 34 { 35 35 int HNum, i, count; 36 unsignedlong *heap;36 mg_u_long *heap; 37 37 huff_data *hd = data; 38 38 if (!hd) … … 73 73 if (heap[heap[curr - 1]] > heap[heap[child - 1]]) 74 74 { 75 register u_long temp;75 register mg_u_long temp; 76 76 temp = heap[child - 1]; 77 77 heap[child - 1] = heap[curr - 1]; … … 141 141 142 142 /* Calculate the code lens */ 143 heap[0] = -1 UL;143 heap[0] = -1; 144 144 heap[1] = 0; 145 145 for (i = 2; i < num * 2; i++) … … 154 154 for (i = 0; i < num; i++) 155 155 { 156 register u_long codelen = heap[i + num];156 register mg_u_long codelen = heap[i + num]; 157 157 hd->clens[i] = (char) codelen; 158 158 if (!codelen) … … 190 190 } 191 191 192 unsignedlong *193 Generate_Huffman_Codes (huff_data * data, u_long * mem)192 mg_u_long * 193 Generate_Huffman_Codes (huff_data * data, mg_u_long * mem) 194 194 { 195 195 int i; 196 unsignedlong *codes;197 unsignedlong mc[MAX_HUFFCODE_LEN + 1];196 mg_u_long *codes; 197 mg_u_long mc[MAX_HUFFCODE_LEN + 1]; 198 198 199 199 if (!data) … … 212 212 213 213 214 unsignedlong **215 Generate_Huffman_Vals (huff_data * data, u_long * mem)214 mg_u_long ** 215 Generate_Huffman_Vals (huff_data * data, mg_u_long * mem) 216 216 { 217 217 int i; 218 unsignedlong *fcode[MAX_HUFFCODE_LEN + 1];219 unsignedlong **values;220 unsignedlong *vals;218 mg_u_long *fcode[MAX_HUFFCODE_LEN + 1]; 219 mg_u_long **values; 220 mg_u_long *vals; 221 221 222 222 if (!data) … … 224 224 if (!(vals = Xmalloc (data->num_codes * sizeof (*vals)))) 225 225 return (NULL); 226 if (!(values = Xmalloc ((MAX_HUFFCODE_LEN + 1) * sizeof ( unsignedlong *))))226 if (!(values = Xmalloc ((MAX_HUFFCODE_LEN + 1) * sizeof (mg_u_long *)))) 227 227 { 228 228 free (vals); … … 230 230 } 231 231 232 bzero ((char *) values, (MAX_HUFFCODE_LEN + 1) * sizeof ( unsignedlong *));232 bzero ((char *) values, (MAX_HUFFCODE_LEN + 1) * sizeof (mg_u_long *)); 233 233 234 234 if (mem) 235 235 *mem += data->num_codes * sizeof (*vals) + 236 (MAX_HUFFCODE_LEN + 1) * sizeof ( unsignedlong *);236 (MAX_HUFFCODE_LEN + 1) * sizeof (mg_u_long *); 237 237 238 238 fcode[0] = values[0] = &vals[0]; … … 249 249 250 250 double 251 Calculate_Huffman_Size (int num, long *freqs,long *counts)251 Calculate_Huffman_Size (int num, mg_s_long *freqs, mg_s_long *counts) 252 252 { 253 253 double size = 0; … … 321 321 static int 322 322 General_Read_Huffman_Data (size_t (*rd) (), void *f, 323 huff_data * hd, u_long * mem,u_long * disk)323 huff_data * hd, mg_u_long * mem, mg_u_long * disk) 324 324 { 325 325 if (rd (&hd->num_codes, sizeof (hd->num_codes), 1, f) != 1) … … 392 392 393 393 int 394 Read_Huffman_Data (FILE * f, huff_data * hd, u_long * mem,u_long * disk)394 Read_Huffman_Data (FILE * f, huff_data * hd, mg_u_long * mem, mg_u_long * disk) 395 395 { 396 396 return General_Read_Huffman_Data (fread, f, hd, mem, disk); … … 401 401 402 402 int 403 F_Read_Huffman_Data (File * f, huff_data * hd, u_long * mem,u_long * disk)403 F_Read_Huffman_Data (File * f, huff_data * hd, mg_u_long * mem, mg_u_long * disk) 404 404 { 405 405 return General_Read_Huffman_Data (Fread, f, hd, mem, disk); -
main/trunk/greenstone2/common-src/indexers/mg/lib/huffman.h
r16583 r25147 37 37 int maxcodelen; 38 38 int lencount[MAX_HUFFCODE_LEN + 1]; 39 unsignedlong min_code[MAX_HUFFCODE_LEN + 1];39 mg_u_long min_code[MAX_HUFFCODE_LEN + 1]; 40 40 char *clens; 41 41 } … … 43 43 44 44 45 huff_data *Generate_Huffman_Data (int num, long *freqs, huff_data * data,46 u_long * mem);45 huff_data *Generate_Huffman_Data (int num, mg_s_long *freqs, huff_data * data, 46 mg_u_long * mem); 47 47 48 unsigned long *Generate_Huffman_Codes (huff_data * data,u_long * mem);48 mg_u_long *Generate_Huffman_Codes (huff_data * data, mg_u_long * mem); 49 49 50 unsigned long **Generate_Huffman_Vals (huff_data * data,u_long * mem);50 mg_u_long **Generate_Huffman_Vals (huff_data * data, mg_u_long * mem); 51 51 52 52 int Write_Huffman_Data (FILE * f, huff_data * hd); 53 53 54 int Read_Huffman_Data (FILE * f, huff_data * hd, u_long * mem,u_long * disk);54 int Read_Huffman_Data (FILE * f, huff_data * hd, mg_u_long * mem, mg_u_long * disk); 55 55 56 int F_Read_Huffman_Data (File * f, huff_data * hd, u_long * mem,u_long * disk);56 int F_Read_Huffman_Data (File * f, huff_data * hd, mg_u_long * mem, mg_u_long * disk); 57 57 58 58 /* Calculate the number of bits required to code the data with the 59 59 specified frequencies. Normally freqs and counts should point to 60 60 the same array. */ 61 double Calculate_Huffman_Size (int num, long *freqs,long *counts);61 double Calculate_Huffman_Size (int num, mg_s_long *freqs, mg_s_long *counts); 62 62 63 63 … … 67 67 register int __i; \ 68 68 register int __clen = (lens)[x]; \ 69 register unsignedlong __code = (codes)[x]; \69 register mg_u_long __code = (codes)[x]; \ 70 70 for (__i=__clen-1; __i>=0; --__i) \ 71 71 ENCODE_BIT((__code >> __i) & 1); \ … … 81 81 #define HUFF_DECODE(x, mcodes, values) \ 82 82 do { \ 83 register unsignedlong *__min_code = (mcodes); \84 register unsignedlong *__mclen = __min_code; \85 register unsignedlong **__values = (values); \86 register unsignedlong __code = 0; \83 register mg_u_long *__min_code = (mcodes); \ 84 register mg_u_long *__mclen = __min_code; \ 85 register mg_u_long **__values = (values); \ 86 register mg_u_long __code = 0; \ 87 87 do \ 88 88 { \ … … 96 96 #define HUFF_DECODE_L(x, mcodes, values, count) \ 97 97 do { \ 98 register unsignedlong *__min_code = (mcodes); \99 register unsignedlong *__mclen = __min_code; \100 register unsignedlong **__values = (values); \101 register unsignedlong __code = 0; \98 register mg_u_long *__min_code = (mcodes); \ 99 register mg_u_long *__mclen = __min_code; \ 100 register mg_u_long **__values = (values); \ 101 register mg_u_long __code = 0; \ 102 102 do \ 103 103 { \ -
main/trunk/greenstone2/common-src/indexers/mg/lib/huffman_mem.c
r16583 r25147 30 30 31 31 void 32 BIO_Mem_Huff_Encode ( unsigned long val, unsignedlong *codes,32 BIO_Mem_Huff_Encode (mg_u_long val, mg_u_long *codes, 33 33 char *clens, mem_bitio_state * bs) 34 34 { … … 38 38 } 39 39 40 unsignedlong41 BIO_Mem_Huff_Decode ( unsignedlong *mincodes,42 unsignedlong **values, mem_bitio_state * bs)40 mg_u_long 41 BIO_Mem_Huff_Decode (mg_u_long *mincodes, 42 mg_u_long **values, mem_bitio_state * bs) 43 43 { 44 unsignedlong val;44 mg_u_long val; 45 45 DECODE_CONTINUE (*bs) 46 46 HUFF_DECODE (val, mincodes, values); -
main/trunk/greenstone2/common-src/indexers/mg/lib/huffman_mem.h
r16583 r25147 25 25 26 26 27 void BIO_Mem_Huff_Encode ( unsigned long val, unsignedlong *codes,27 void BIO_Mem_Huff_Encode (mg_u_long val, mg_u_long *codes, 28 28 char *clens, mem_bitio_state * bs); 29 29 30 unsigned long BIO_Mem_Huff_Decode (unsignedlong *mincodes,31 unsignedlong **values, mem_bitio_state * bs);30 mg_u_long BIO_Mem_Huff_Decode (mg_u_long *mincodes, 31 mg_u_long **values, mem_bitio_state * bs); 32 32 33 33 -
main/trunk/greenstone2/common-src/indexers/mg/lib/huffman_stdio.c
r16583 r25147 33 33 34 34 void 35 BIO_Stdio_Huff_Encode ( unsigned long val, unsignedlong *codes,35 BIO_Stdio_Huff_Encode (mg_u_long val, mg_u_long *codes, 36 36 char *clens, stdio_bitio_state * bs) 37 37 { … … 41 41 } 42 42 43 unsignedlong44 BIO_Stdio_Huff_Decode ( unsignedlong *mincodes,45 unsignedlong **values,43 mg_u_long 44 BIO_Stdio_Huff_Decode (mg_u_long *mincodes, 45 mg_u_long **values, 46 46 stdio_bitio_state * bs) 47 47 { 48 unsignedlong val;48 mg_u_long val; 49 49 DECODE_CONTINUE (*bs) 50 50 HUFF_DECODE (val, mincodes, values); -
main/trunk/greenstone2/common-src/indexers/mg/lib/huffman_stdio.h
r16583 r25147 25 25 26 26 27 void BIO_Stdio_Huff_Encode ( unsigned long val, unsignedlong *codes,27 void BIO_Stdio_Huff_Encode (mg_u_long val, mg_u_long *codes, 28 28 char *clens, stdio_bitio_state * bs); 29 29 30 30 31 unsigned long BIO_Stdio_Huff_Decode (unsignedlong *mincodes,32 unsignedlong **values,31 mg_u_long BIO_Stdio_Huff_Decode (mg_u_long *mincodes, 32 mg_u_long **values, 33 33 stdio_bitio_state * bs); 34 34 -
main/trunk/greenstone2/common-src/indexers/mg/lib/longlong.h
r16583 r25147 22 22 #ifndef H_LONGLONG 23 23 #define H_LONGLONG 24 25 #include "mglong.h" 24 26 25 27 #ifndef __WIN32__ … … 71 73 72 74 /* Not using GCC, so fall back on plain "long" (32-bit) types */ 73 typedef u nsigned long int mg_ullong;74 typedef long int mg_llong;75 typedef uint32_t mg_ullong; 76 typedef int32_t mg_llong; 75 77 76 #define ULL_FS " lu"77 #define LL_FS " ld"78 #define ULL_FS "u" 79 #define LL_FS "d" 78 80 79 81 #endif /* __GNUC__ */ -
main/trunk/greenstone2/common-src/indexers/mg/lib/messages.c
r16583 r25147 28 28 29 29 30 void VOLATILE30 void 31 31 FatalError (int ExitCode, const char *fmt,...) 32 32 { -
main/trunk/greenstone2/common-src/indexers/mg/lib/messages.h
r16583 r25147 31 31 extern char *msg_prefix; 32 32 33 void VOLATILEFatalError (int ExitCode, const char *fmt,...);33 void FatalError (int ExitCode, const char *fmt,...); 34 34 35 35 void Message (const char *fmt,...); -
main/trunk/greenstone2/common-src/indexers/mg/lib/netorder.h
r22257 r25147 17 17 #define HTOND(d) \ 18 18 do { \ 19 unsignedlong tmph, tmpl; \19 mg_u_long tmph, tmpl; \ 20 20 bcopy ((char *) &d, (char *) &tmph, sizeof(double) >> 1); \ 21 21 bcopy ((char *) &d + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1); \ … … 27 27 #define NTOHD(d) \ 28 28 do { \ 29 unsignedlong tmph, tmpl; \29 mg_u_long tmph, tmpl; \ 30 30 bcopy ((char *) &d, (char *) &tmph, sizeof(double) >> 1); \ 31 31 bcopy ((char *) &d + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1); \ … … 37 37 #define HTOND2(hd, nd) \ 38 38 do { \ 39 unsignedlong tmph, tmpl; \39 mg_u_long tmph, tmpl; \ 40 40 bcopy ((char *) &hd, (char *) &tmph, sizeof(double) >> 1); \ 41 41 bcopy ((char *) &hd + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1); \ … … 47 47 #define NTOHD2(nd, hd) \ 48 48 do { \ 49 unsignedlong tmph, tmpl; \49 mg_u_long tmph, tmpl; \ 50 50 bcopy ((char *) &nd, (char *) &tmph, sizeof(double) >> 1); \ 51 51 bcopy ((char *) &nd + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1); \ … … 59 59 #define HTONF(f) \ 60 60 do { \ 61 unsignedlong tmp; \61 mg_u_long tmp; \ 62 62 bcopy ((char *) &(f), (char *) &tmp, sizeof (float)); \ 63 63 HTONUL (tmp); \ … … 66 66 #define NTOHF(f) \ 67 67 do { \ 68 unsignedlong tmp; \68 mg_u_long tmp; \ 69 69 bcopy ((char *) &(f), (char *) &tmp, sizeof (float)); \ 70 70 NTOHUL (tmp); \ … … 73 73 #define HTONF2(hf, nf) \ 74 74 do { \ 75 unsignedlong tmp; \75 mg_u_long tmp; \ 76 76 bcopy ((char *) &(hf), (char *) &tmp, sizeof (float)); \ 77 77 HTONUL (tmp); \ … … 80 80 #define NTOHF2(nf, hf) \ 81 81 do { \ 82 unsignedlong tmp; \82 mg_u_long tmp; \ 83 83 bcopy ((char *) &(nf), (char *) &tmp, sizeof (float)); \ 84 84 NTOHUL (tmp); \ … … 115 115 116 116 /* pointers */ 117 #define HTONP(p) ((p) = (void *) htonl (( unsignedlong) p))118 #define NTOHP(p) ((p) = (void *) ntohl (( unsignedlong) p))119 #define HTONP2(hp, np) ((np) = (void *) htonl (( unsignedlong) hp))120 #define NTOHP2(np, hp) ((hp) = (void *) ntohl (( unsignedlong) np))117 #define HTONP(p) ((p) = (void *) htonl ((mg_u_long) p)) 118 #define NTOHP(p) ((p) = (void *) ntohl ((mg_u_long) p)) 119 #define HTONP2(hp, np) ((np) = (void *) htonl ((mg_u_long) hp)) 120 #define NTOHP2(np, hp) ((hp) = (void *) ntohl ((mg_u_long) np)) 121 121 122 122 /* unsigned long */ … … 127 127 128 128 /* signed long */ 129 #define HTONSL(l) ((l) = ( long) htonl ((unsignedlong) (l)))130 #define NTOHSL(l) ((l) = ( long) ntohl ((unsignedlong) (l)))131 #define HTONSL2(hl, nl) ((nl) = ( long) htonl ((unsignedlong) (hl)))132 #define NTOHSL2(nl, hl) ((hl) = ( long) ntohl ((unsignedlong) (nl)))129 #define HTONSL(l) ((l) = (mg_s_long) htonl ((mg_u_long) (l))) 130 #define NTOHSL(l) ((l) = (mg_s_long) ntohl ((mg_u_long) (l))) 131 #define HTONSL2(hl, nl) ((nl) = (mg_s_long) htonl ((mg_u_long) (hl))) 132 #define NTOHSL2(nl, hl) ((hl) = (mg_s_long) ntohl ((mg_u_long) (nl))) 133 133 134 134 /* unsigned int */ 135 #define HTONUI(i) ((i) = (unsigned int) htonl (( unsignedlong) (i)))136 #define NTOHUI(i) ((i) = (unsigned int) ntohl (( unsignedlong) (i)))137 #define HTONUI2(hi, ni) ((ni) = (unsigned int) htonl (( unsignedlong) (hi)))138 #define NTOHUI2(ni, hi) ((hi) = (unsigned int) ntohl (( unsignedlong) (ni)))135 #define HTONUI(i) ((i) = (unsigned int) htonl ((mg_u_long) (i))) 136 #define NTOHUI(i) ((i) = (unsigned int) ntohl ((mg_u_long) (i))) 137 #define HTONUI2(hi, ni) ((ni) = (unsigned int) htonl ((mg_u_long) (hi))) 138 #define NTOHUI2(ni, hi) ((hi) = (unsigned int) ntohl ((mg_u_long) (ni))) 139 139 140 140 /* signed int */ 141 #define HTONSI(i) ((i) = (int) htonl (( unsignedlong) (i)))142 #define NTOHSI(i) ((i) = (int) ntohl (( unsignedlong) (i)))143 #define HTONSI2(hi, ni) ((ni) = (int) htonl (( unsignedlong) (hi)))144 #define NTOHSI2(ni, hi) ((hi) = (int) ntohl (( unsignedlong) (ni)))141 #define HTONSI(i) ((i) = (int) htonl ((mg_u_long) (i))) 142 #define NTOHSI(i) ((i) = (int) ntohl ((mg_u_long) (i))) 143 #define HTONSI2(hi, ni) ((ni) = (int) htonl ((mg_u_long) (hi))) 144 #define NTOHSI2(ni, hi) ((hi) = (int) ntohl ((mg_u_long) (ni))) 145 145 146 146 /* unsigned short */ -
main/trunk/greenstone2/common-src/indexers/mg/lib/perf_hash.c
r16583 r25147 42 42 43 43 /* Random Number stuff */ 44 static long seed[] = {0, 0};44 static mg_s_long seed[] = {0, 0}; 45 45 #define RANDOM() irandm(seed) 46 46 #define SEED_RANDOM(the_seed) do{ seed[0] = the_seed; }while(0) … … 105 105 106 106 #ifndef STRUCT 107 static long **tb0, **tb1, **tb2;107 static mg_s_long **tb0, **tb1, **tb2; 108 108 #else 109 109 struct tb_entry **tb; … … 128 128 { /* deletes edge e from list of v */ 129 129 130 int b; 131 130 int b, norm_b; 132 131 b = FIRST[v]; 133 132 assert (norm (b) != 0); … … 700 699 { 701 700 if (tb0) 702 if (!(tb0[i] = Xmalloc (sizeof ( long) * MAX_L)))701 if (!(tb0[i] = Xmalloc (sizeof (mg_s_long) * MAX_L))) 703 702 ok = 0; 704 703 if (tb1) 705 if (!(tb1[i] = Xmalloc (sizeof ( long) * MAX_L)))704 if (!(tb1[i] = Xmalloc (sizeof (mg_s_long) * MAX_L))) 706 705 ok = 0; 707 706 if (tb2) 708 if (!(tb2[i] = Xmalloc (sizeof ( long) * MAX_L)))707 if (!(tb2[i] = Xmalloc (sizeof (mg_s_long) * MAX_L))) 709 708 ok = 0; 710 709 } … … 744 743 745 744 if (r <= 0) 746 SEED_RANDOM (( long) time ((time_t *) NULL));745 SEED_RANDOM ((mg_s_long) time ((time_t *) NULL)); 747 746 else 748 747 SEED_RANDOM (r); … … 907 906 { 908 907 if (phd->tb0) 909 if (!(phd->tb0[i] = Xmalloc (sizeof ( long) * phd->MAX_L)))908 if (!(phd->tb0[i] = Xmalloc (sizeof (mg_s_long) * phd->MAX_L))) 910 909 ok = 0; 911 910 if (phd->tb1) 912 if (!(phd->tb1[i] = Xmalloc (sizeof ( long) * phd->MAX_L)))911 if (!(phd->tb1[i] = Xmalloc (sizeof (mg_s_long) * phd->MAX_L))) 913 912 ok = 0; 914 913 if (phd->tb2) 915 if (!(phd->tb2[i] = Xmalloc (sizeof ( long) * phd->MAX_L)))914 if (!(phd->tb2[i] = Xmalloc (sizeof (mg_s_long) * phd->MAX_L))) 916 915 ok = 0; 917 916 } … … 951 950 int j; 952 951 953 tot += fread ((char *) phd->tb0[i], sizeof ( long), phd->MAX_L, f) *952 tot += fread ((char *) phd->tb0[i], sizeof (mg_s_long), phd->MAX_L, f) * 954 953 sizeof (int); 955 tot += fread ((char *) phd->tb1[i], sizeof ( long), phd->MAX_L, f) *954 tot += fread ((char *) phd->tb1[i], sizeof (mg_s_long), phd->MAX_L, f) * 956 955 sizeof (int); 957 tot += fread ((char *) phd->tb2[i], sizeof ( long), phd->MAX_L, f) *956 tot += fread ((char *) phd->tb2[i], sizeof (mg_s_long), phd->MAX_L, f) * 958 957 sizeof (int); 959 958 -
main/trunk/greenstone2/common-src/indexers/mg/lib/perf_hash.h
r16583 r25147 23 23 #define H_PERF_HASH 24 24 25 26 25 #include "mglong.h" 27 26 28 27 struct tb_entry 29 28 { 30 long tb0, tb1, tb2;29 mg_s_long tb0, tb1, tb2; 31 30 }; 32 31 -
main/trunk/greenstone2/common-src/indexers/mg/lib/random.c
r16583 r25147 33 33 * The table mt[0:127] is defined by mt[i] = 69069 ** (128-i) 34 34 */ 35 36 #define MASK ((long) 593970775) 35 #include "random.h" 36 37 #define MASK ((mg_s_long) 593970775) 37 38 /* or in hex, 23674657 */ 38 39 … … 40 41 /* i.e. 2 to power -31 */ 41 42 42 static long mt [128] = {43 static mg_s_long mt [128] = { 43 44 902906369, 44 45 2030498053, … … 172 173 173 174 double 174 random ( long is [2])175 random (mg_s_long is [2]) 175 176 { 176 long it, leh, nit;177 mg_s_long it, leh, nit; 177 178 178 179 it = is [0]; … … 187 188 is [0] = it; is [1] = leh; 188 189 if (leh < 0) leh = ~leh; 189 return (SCALE * (( long) (leh | 1)));190 return (SCALE * ((mg_s_long) (leh | 1))); 190 191 } 191 192 192 193 193 194 194 long195 irandm ( long is [2])195 mg_s_long 196 irandm (mg_s_long is [2]) 196 197 { 197 long it, leh, nit;198 mg_s_long it, leh, nit; 198 199 199 200 it = is [0]; -
main/trunk/greenstone2/common-src/indexers/mg/lib/random.h
r16583 r25147 36 36 * The table mt[0:127] is defined by mt[i] = 69069 ** (128-i) 37 37 */ 38 #include "mglong.h" 38 39 39 double random ( long is [2]);40 long irandm (long is [2]);40 double random (mg_s_long is [2]); 41 mg_s_long irandm (mg_s_long is [2]); 41 42 42 43 #endif -
main/trunk/greenstone2/common-src/indexers/mg/lib/regex.c
r16583 r25147 2896 2896 register char *fastmap = bufp->fastmap; 2897 2897 unsigned char *pattern = bufp->buffer; 2898 unsignedlong size = bufp->used;2898 mg_u_long size = bufp->used; 2899 2899 unsigned char *p = pattern; 2900 2900 register unsigned char *pend = pattern + size; -
main/trunk/greenstone2/common-src/indexers/mg/lib/regex.h
r16583 r25147 292 292 293 293 /* Number of bytes to which `buffer' points. */ 294 unsignedlong allocated;294 mg_u_long allocated; 295 295 296 296 /* Number of bytes actually used in `buffer'. */ 297 unsignedlong used;297 mg_u_long used; 298 298 299 299 /* Syntax setting with which the pattern was compiled. */ -
main/trunk/greenstone2/common-src/indexers/mg/lib/rx.c
r16583 r25147 615 615 616 616 #ifdef __STDC__ 617 RX_DECL unsignedlong617 RX_DECL mg_u_long 618 618 rx_bitset_hash (int size, rx_Bitset b) 619 619 #else 620 RX_DECL unsignedlong620 RX_DECL mg_u_long 621 621 rx_bitset_hash (size, b) 622 622 int size; … … 625 625 { 626 626 int x; 627 u nsigned long hash = (unsigned long)rx_bitset_hash;627 uintptr_t hash = (uintptr_t)rx_bitset_hash; 628 628 629 629 for (x = rx_bitset_numb_subsets(size) - 1; x >= 0; --x) … … 701 701 702 702 703 static unsignedlong rx_hash_masks[4] =703 static mg_u_long rx_hash_masks[4] = 704 704 { 705 705 0x12488421, … … 714 714 RX_DECL struct rx_hash_item * 715 715 rx_hash_find (struct rx_hash * table, 716 unsignedlong hash,716 mg_u_long hash, 717 717 void * value, 718 718 struct rx_hash_rules * rules) … … 721 721 rx_hash_find (table, hash, value, rules) 722 722 struct rx_hash * table; 723 unsignedlong hash;723 mg_u_long hash; 724 724 void * value; 725 725 struct rx_hash_rules * rules; … … 728 728 rx_hash_eq eq = rules->eq; 729 729 int maskc = 0; 730 long mask = rx_hash_masks [0];730 mg_s_long mask = rx_hash_masks [0]; 731 731 int bucket = (hash & mask) % 13; 732 732 … … 755 755 RX_DECL struct rx_hash_item * 756 756 rx_hash_store (struct rx_hash * table, 757 unsignedlong hash,757 mg_u_long hash, 758 758 void * value, 759 759 struct rx_hash_rules * rules) … … 762 762 rx_hash_store (table, hash, value, rules) 763 763 struct rx_hash * table; 764 unsignedlong hash;764 mg_u_long hash; 765 765 void * value; 766 766 struct rx_hash_rules * rules; … … 769 769 rx_hash_eq eq = rules->eq; 770 770 int maskc = 0; 771 long mask = rx_hash_masks[0];771 mg_s_long mask = rx_hash_masks[0]; 772 772 int bucket = (hash & mask) % 13; 773 773 int depth = 0; … … 803 803 { 804 804 struct rx_hash_item * them = table->buckets[bucket]; 805 unsignedlong newmask = rx_hash_masks[maskc + 1];805 mg_u_long newmask = rx_hash_masks[maskc + 1]; 806 806 while (them) 807 807 { … … 855 855 { 856 856 struct rx_hash * table = it->table; 857 unsignedlong hash = it->hash;857 mg_u_long hash = it->hash; 858 858 int depth = (table->parent 859 859 ? (table->parent->parent … … 1775 1775 : (!vb 1776 1776 ? 1 1777 : (( long)a->car < (long)b->car1777 : ((intptr_t)a->car < (intptr_t)b->car 1778 1778 ? 1 1779 : (( long)a->car > (long)b->car1779 : ((intptr_t)a->car > (intptr_t)b->car 1780 1780 ? -1 1781 1781 : se_list_cmp ((void *)a->cdr, (void *)b->cdr)))))); … … 1842 1842 #endif 1843 1843 { 1844 long hash = (long)car ^ (long)cdr;1844 intptr_t hash = (intptr_t)car ^ (intptr_t)cdr; 1845 1845 struct rx_se_list template; 1846 1846 … … 1955 1955 template.cdr = set; 1956 1956 node = rx_hash_store (memo, 1957 ((( long)state) >> 8) ^ (long)set,1957 (((intptr_t)state) >> 8) ^ (intptr_t)set, 1958 1958 &template, &nfa_set_hash_rules); 1959 1959 if (!node) … … 2264 2264 RX_DECL int 2265 2265 rx_compactify_nfa (struct rx *rx, 2266 void **mem, unsignedlong *size)2266 void **mem, mg_u_long *size) 2267 2267 #else 2268 2268 RX_DECL int … … 2270 2270 struct rx *rx; 2271 2271 void **mem; 2272 unsignedlong *size;2272 mg_u_long *size; 2273 2273 #endif 2274 2274 { … … 2279 2279 int se_list_consc = count_hash_nodes (&rx->se_list_memo); 2280 2280 int nfa_setc = count_hash_nodes (&rx->set_list_memo); 2281 unsignedlong total_size;2281 mg_u_long total_size; 2282 2282 2283 2283 /* This takes place in two stages. First, the total size of the … … 2407 2407 { 2408 2408 sp = rx_hash_find (&rx->se_list_memo, 2409 ( long)sesrc->car ^ (long)sesrc->cdr,2409 (intptr_t)sesrc->car ^ (intptr_t)sesrc->cdr, 2410 2410 sesrc, &se_list_hash_rules); 2411 2411 if (sp->binding) … … 2425 2425 { 2426 2426 sp = rx_hash_find (&rx->set_list_memo, 2427 (((( long)destlst->car) >> 8)2428 ^ ( long)destlst->cdr),2427 ((((intptr_t)destlst->car) >> 8) 2428 ^ (intptr_t)destlst->cdr), 2429 2429 destlst, &nfa_set_hash_rules); 2430 2430 if (sp->binding) … … 2798 2798 (rx_hash_find 2799 2799 (&cache->superset_table, 2800 ( unsigned long)set->car ^ set->id ^ (unsigned long)set->cdr,2800 (intptr_t)set->car ^ set->id ^ (intptr_t)set->cdr, 2801 2801 (void *)set, 2802 2802 &cache->superset_hash_rules), … … 3056 3056 = ((struct rx_cache *) 3057 3057 ((char *)rules 3058 - ( unsigned long)(&((struct rx_cache *)0)->superset_hash_rules)));3058 - (intptr_t)(&((struct rx_cache *)0)->superset_hash_rules))); 3059 3059 struct rx_superset * template = (struct rx_superset *)val; 3060 3060 struct rx_superset * newset … … 3088 3088 = ((struct rx_cache *) 3089 3089 ((char *)rules 3090 - ( unsigned long)(&((struct rx_cache *)0)->superset_hash_rules)));3090 - (intptr_t)(&((struct rx_cache *)0)->superset_hash_rules))); 3091 3091 return ((struct rx_hash *) 3092 3092 rx_cache_malloc_or_get (cache, … … 3107 3107 struct rx_cache * cache 3108 3108 = ((struct rx_cache *) 3109 (char *)rules - ( long)(&((struct rx_cache *)0)->superset_hash_rules));3109 (char *)rules - (intptr_t)(&((struct rx_cache *)0)->superset_hash_rules)); 3110 3110 rx_cache_free (cache, &cache->free_hash, (char *)hash); 3111 3111 } … … 3264 3264 template.id = car->id; 3265 3265 hit = rx_hash_store (&cache->superset_table, 3266 ( unsigned long)car ^ car->id ^ (unsigned long)cdr,3266 (intptr_t)car ^ car->id ^ (intptr_t)cdr, 3267 3267 (void *)&template, 3268 3268 &cache->superset_hash_rules); … … 4332 4332 return; 4333 4333 case r_side_effect: 4334 if ( (( long)rexp->params.side_effect >= 0)4335 && (params [( long)rexp->params.side_effect].se == re_se_backref))4336 out[ params [( long)rexp->params.side_effect].op1] = 1;4334 if ( ((intptr_t)rexp->params.side_effect >= 0) 4335 && (params [(intptr_t)rexp->params.side_effect].se == re_se_backref)) 4336 out[ params [(intptr_t)rexp->params.side_effect].op1] = 1; 4337 4337 return; 4338 4338 } … … 4516 4516 case r_side_effect: 4517 4517 { 4518 int se = ( long)rexp->params.side_effect;4518 int se = (intptr_t)rexp->params.side_effect; 4519 4519 if ( (se >= 0) 4520 4520 && ( ((enum re_side_effects)params[se].se == re_se_lparen) … … 4563 4563 return pointless_if_repeated (node->params.pair.left, params); 4564 4564 case r_side_effect: 4565 switch ((enum re_side_effects) ((( long)node->params.side_effect < 0)4566 ? (enum re_side_effects) ( long) node->params.side_effect4567 : (enum re_side_effects)params[( long)node->params.side_effect].se))4565 switch ((enum re_side_effects) (((intptr_t)node->params.side_effect < 0) 4566 ? (enum re_side_effects) (intptr_t) node->params.side_effect 4567 : (enum re_side_effects)params[(intptr_t)node->params.side_effect].se)) 4568 4568 { 4569 4569 case re_se_try: … … 4588 4588 case re_se_backref: 4589 4589 return 0; 4590 case re_se_pushback: 4591 case re_se_push0: 4592 case re_se_pushpos: 4593 case re_se_chkpos: 4594 case re_se_poppos: 4595 case re_se_tv: 4596 case re_floogle_flap: 4597 return -1; 4590 4598 } 4591 4599 case r_data: … … 4637 4645 case r_side_effect: 4638 4646 { 4639 int se = ( long)rexp->params.side_effect;4647 int se = (intptr_t)rexp->params.side_effect; 4640 4648 if ( in_danger 4641 4649 && (se >= 0) … … 4757 4765 case r_side_effect: 4758 4766 return 4759 !(( long)rexp->params.side_effect > 04760 ? idempotent_complex_se [ params [( long)rexp->params.side_effect].se ]4761 : idempotent_se [-( long)rexp->params.side_effect]);4767 !((intptr_t)rexp->params.side_effect > 0 4768 ? idempotent_complex_se [ params [(intptr_t)rexp->params.side_effect].se ] 4769 : idempotent_se [-(intptr_t)rexp->params.side_effect]); 4762 4770 4763 4771 case r_alternate: … … 4811 4819 4812 4820 case r_side_effect: 4813 return (( long)rexp->params.side_effect >= 0);4821 return ((intptr_t)rexp->params.side_effect >= 0); 4814 4822 4815 4823 case r_alternate: … … 5204 5212 if (need_sync) 5205 5213 { 5206 int sync_se = paramc;5214 intptr_t sync_se = paramc; 5207 5215 params = (params 5208 5216 ? ((struct re_se_params *) … … 5552 5560 handle_close: 5553 5561 /* See similar code for backslashed left paren above. */ 5554 if (COMPILE_STACK_EMPTY) 5555 if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) 5562 if (COMPILE_STACK_EMPTY){ 5563 if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD){ 5556 5564 goto normal_char; 5557 else 5565 } 5566 else{ 5558 5567 return REG_ERPAREN; 5568 } 5569 } 5559 5570 5560 5571 /* Since we just checked for an empty stack above, this … … 5573 5584 this_group_regnum = COMPILE_STACK_TOP.regnum; 5574 5585 { 5575 int left_se = paramc;5576 int right_se = paramc + 1;5586 intptr_t left_se = paramc; 5587 intptr_t right_se = paramc + 1; 5577 5588 5578 5589 params = (params … … 5625 5636 last_expression = &alt->params.pair.right; 5626 5637 { 5627 int sync_se = paramc;5638 intptr_t sync_se = paramc; 5628 5639 5629 5640 params = (params … … 5742 5753 /* Otherwise, we have a nontrivial interval. */ 5743 5754 { 5744 int iter_se = paramc;5745 int end_se = paramc + 1;5755 intptr_t iter_se = paramc; 5756 intptr_t end_se = paramc + 1; 5746 5757 params = (params 5747 5758 ? ((struct re_se_params *) … … 5939 5950 5940 5951 { 5941 int backref_se = paramc;5952 intptr_t backref_se = paramc; 5942 5953 params = (params 5943 5954 ? ((struct re_se_params *) … … 6009 6020 6010 6021 { 6011 int win_se = paramc;6022 intptr_t win_se = paramc; 6012 6023 params = (params 6013 6024 ? ((struct re_se_params *) … … 6149 6160 { 6150 6161 void * mem = (void *)rxb->buffer; 6151 unsignedlong size = rxb->allocated;6162 mg_u_long size = rxb->allocated; 6152 6163 int start_id; 6153 6164 char * perm_mem; … … 6757 6768 while (list) 6758 6769 { 6759 if (( long)list->car >= 0)6770 if ((intptr_t)list->car >= 0) 6760 6771 ++x; 6761 6772 list = list->cdr; … … 6812 6823 for (ai = al - 1; ai >= 0; --ai) 6813 6824 { 6814 while (( long)ap->car < 0)6825 while ((intptr_t)ap->car < 0) 6815 6826 ap = ap->cdr; 6816 6827 av[ai] = ap->car; … … 6820 6831 for (bi = bl - 1; bi >= 0; --bi) 6821 6832 { 6822 while (( long)bp->car < 0)6833 while ((intptr_t)bp->car < 0) 6823 6834 bp = bp->cdr; 6824 6835 bv[bi] = bp->car; -
main/trunk/greenstone2/common-src/indexers/mg/lib/rx.h
r16583 r25147 22 22 /* t. lord Wed Sep 23 18:20:57 1992 */ 23 23 24 25 26 27 28 29 30 24 #include "mglong.h" 31 25 32 26 #ifndef RX_WANT_SE_DEFS … … 91 85 struct rx_hash_item * next_same_hash; 92 86 struct rx_hash * table; 93 unsignedlong hash;87 mg_u_long hash; 94 88 void * data; 95 89 void * binding; … … 273 267 */ 274 268 void * buffer; 275 unsignedlong allocated;269 mg_u_long allocated; 276 270 277 271 /* Clients of RX can ask for some extra storage in the space pointed … … 280 274 * at (buffer + allocated - reserved) 281 275 */ 282 unsignedlong reserved;276 mg_u_long reserved; 283 277 284 278 /* --------- The remaining fields are for internal use only. --------- */ … … 1274 1268 1275 1269 void * buffer; /* Malloced memory for the nfa. */ 1276 unsignedlong allocated; /* Size of that memory. */1270 mg_u_long allocated; /* Size of that memory. */ 1277 1271 1278 1272 /* Pointer to a fastmap, if any, otherwise zero. re_search uses … … 1580 1574 rx_Bitset a, rx_Bitset b); 1581 1575 RX_DECL void rx_bitset_xor (int size, rx_Bitset a, rx_Bitset b); 1582 RX_DECL unsignedlong rx_bitset_hash (int size, rx_Bitset b);1576 RX_DECL mg_u_long rx_bitset_hash (int size, rx_Bitset b); 1583 1577 RX_DECL struct rx_hash_item * rx_hash_find (struct rx_hash * table, 1584 unsignedlong hash,1578 mg_u_long hash, 1585 1579 void * value, 1586 1580 struct rx_hash_rules * rules); 1587 1581 RX_DECL struct rx_hash_item * rx_hash_store (struct rx_hash * table, 1588 unsignedlong hash,1582 mg_u_long hash, 1589 1583 void * value, 1590 1584 struct rx_hash_rules * rules); … … 1637 1631 RX_DECL void rx_delete_epsilon_transitions (struct rx *rx); 1638 1632 RX_DECL int rx_compactify_nfa (struct rx *rx, 1639 void **mem, unsignedlong *size);1633 void **mem, mg_u_long *size); 1640 1634 RX_DECL void rx_release_superset (struct rx *rx, 1641 1635 struct rx_superset *set); … … 1665 1659 RX_DECL void rx_bitset_revdifference (); 1666 1660 RX_DECL void rx_bitset_xor (); 1667 RX_DECL unsignedlong rx_bitset_hash ();1661 RX_DECL mg_u_long rx_bitset_hash (); 1668 1662 RX_DECL struct rx_hash_item * rx_hash_find (); 1669 1663 RX_DECL struct rx_hash_item * rx_hash_store (); … … 2230 2224 2231 2225 2232 2233 2226 /* How many characters in the character set. */ 2234 2227 #define CHAR_SET_SIZE (1 << CHARBITS) … … 2344 2337 RX_DECL __inline__ int 2345 2338 rx_search (struct re_pattern_buffer * rxb, 2346 int startpos,2339 intptr_t startpos, 2347 2340 int range, 2348 2341 int stop, … … 2361 2354 app_closure, regs, resume_state, save_state) 2362 2355 struct re_pattern_buffer * rxb; 2363 int startpos;2356 intptr_t startpos; 2364 2357 int range; 2365 2358 int stop; … … 2739 2732 { 2740 2733 enum rx_test_match_entry test_pc; 2741 int inx;2734 intptr_t inx; 2742 2735 test_pc = search_state.test_match_resume_pt; 2743 2736 if (test_pc == rx_test_start) … … 2839 2832 ((struct rx_superstate *) 2840 2833 ((char *)this_tr_table 2841 - (( unsignedlong)2834 - ((mg_u_long) 2842 2835 ((struct rx_superstate *)0)->transitions))); 2843 2836 … … 2904 2897 ((struct rx_superstate *) 2905 2898 ((char *)this_tr_table 2906 - ((u nsigned long)2899 - ((uintptr_t) 2907 2900 ((struct rx_superstate *)0)->transitions))); 2908 2901 } … … 2911 2904 * Dispatch that instruction: 2912 2905 */ 2913 inx = (int )search_state.ifr->inx;2906 inx = (intptr_t)search_state.ifr->inx; 2914 2907 #ifdef RX_DEBUG_0 2915 2908 if (rx_debug_trace) … … 2949 2942 while (el) 2950 2943 { 2951 longeffect;2952 effect = ( long)el->car;2944 intptr_t effect; 2945 effect = (intptr_t)el->car; 2953 2946 if (effect < 0) 2954 2947 { … … 2990 2983 = ((struct rx_superstate *) 2991 2984 ((char *)search_state.ifr->data 2992 - ( long)(((struct rx_superstate *)0)2985 - (intptr_t)(((struct rx_superstate *)0) 2993 2986 ->transitions))); 2994 2987 goto top_of_cycle; -
main/trunk/greenstone2/common-src/indexers/mg/lib/sptree.c
r16583 r25147 293 293 q->par = p; \ 294 294 q->rght = p->left; \ 295 if(q->rght) \ 296 q->rght->par = q; \ 295 if(q->rght){ \ 296 q->rght->par = q; \ 297 } \ 297 298 p->left = q; \ 298 if(p->par) \ 299 if(q == p->par->left) \ 300 p->par->left = p; \ 301 else \ 302 p->par->rght = p; \ 299 if(p->par){ \ 300 if(q == p->par->left){ \ 301 p->par->left = p; \ 302 } \ 303 else{ \ 304 p->par->rght = p; \ 305 } \ 306 } \ 303 307 }while(0) 304 308 … … 308 312 q->par = p; \ 309 313 q->left = p->rght; \ 310 if(q->left) \ 311 q->left->par = q; \ 314 if(q->left){ \ 315 q->left->par = q; \ 316 } \ 312 317 p->rght = q; \ 313 if(p->par) \ 314 if(q == p->par->left) \ 315 p->par->left = p; \ 316 else \ 317 p->par->rght = p; \ 318 if(p->par){ \ 319 if(q == p->par->left){ \ 320 p->par->left = p; \ 321 } \ 322 else{ \ 323 p->par->rght = p; \ 324 } \ 325 } \ 318 326 }while(0) 319 327 … … 341 349 if (p == q->left) 342 350 { 343 if (g == NNULL) 351 if (g == NNULL){ 344 352 ROTATER (p, q); 353 } 345 354 else if (q == g->left) 346 355 { … … 356 365 else 357 366 { 358 if (g == NNULL) 367 if (g == NNULL){ 359 368 ROTATEL (p, q); 369 } 360 370 else if (q == g->rght) 361 371 { -
main/trunk/greenstone2/common-src/indexers/mg/lib/sptree.h
r16583 r25147 29 29 { 30 30 int no_of_items; 31 unsignedlong mem_in_use;31 mg_u_long mem_in_use; 32 32 int (*cmp) (void *, void *); 33 33 void *root; -
main/trunk/greenstone2/common-src/indexers/mg/lib/unitool.c
r23431 r25147 15 15 * column 16 16 */ 17 unsignedlong *unicode_cat_data=NULL;17 mg_u_long *unicode_cat_data=NULL; 18 18 19 19 … … 1464 1464 * column 1465 1465 */ 1466 unsignedlong *unicode_cat_data;1466 mg_u_long *unicode_cat_data; 1467 1467 1468 1468 void create_unicat_data () { … … 1470 1470 int min_start=0; 1471 1471 int min_end=0; 1472 register unsignedlong min_value=0; /* filling the whole byte */1472 register mg_u_long min_value=0; /* filling the whole byte */ 1473 1473 1474 1474 const unirange *letter_here = letter_info; … … 1529 1529 1530 1530 } else { 1531 register unsignedlong mask = 3 << ((i % 16) * 2);1531 register mg_u_long mask = 3 << ((i % 16) * 2); 1532 1532 unicode_cat_data[i/16] = (unicode_cat_data[i/16] & (~mask)) | 1533 1533 (min_value & mask); -
main/trunk/greenstone2/common-src/indexers/mg/lib/win32in.c
r16583 r25147 4 4 /* unix systems. */ 5 5 6 unsigned long htonl(unsignedlong x) {6 mg_u_long htonl(mg_u_long x) { 7 7 #if defined (LITTLE_ENDIAN) || defined (_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN) 8 8 x = ((x >> 24) & 0x000000FF) | ((x >> 8) & 0x0000FF00) | … … 25 25 } 26 26 27 unsigned long ntohl(unsignedlong x) {27 mg_u_long ntohl(mg_u_long x) { 28 28 #if defined (LITTLE_ENDIAN) || defined (_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN) 29 29 x = ((x >> 24) & 0x000000FF) | ((x >> 8) & 0x0000FF00) | … … 51 51 52 52 main () { 53 long x;53 mg_s_long x; 54 54 short sx; 55 55 -
main/trunk/greenstone2/common-src/indexers/mg/lib/win32in.h
r16583 r25147 4 4 #include "longlong.h" 5 5 6 unsigned long htonl(unsignedlong x);7 unsigned long ntohl(unsignedlong x);6 mg_u_long htonl(mg_u_long x); 7 mg_u_long ntohl(mg_u_long x); 8 8 mg_ullong ntohll(mg_ullong x); 9 9 unsigned short htons(unsigned short x);
Note:
See TracChangeset
for help on using the changeset viewer.