Changeset 23508 for main/branches/64_bit_Greenstone/greenstone2/common-src/indexers/mg/lib/bitio_random.c
- Timestamp:
- 2010-12-17T14:04:10+13:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/branches/64_bit_Greenstone/greenstone2/common-src/indexers/mg/lib/bitio_random.c
r16583 r23508 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
Note:
See TracChangeset
for help on using the changeset viewer.