Changeset 2741 for trunk/gsdl
- Timestamp:
- 2001-09-20T14:31:59+12:00 (23 years ago)
- Location:
- trunk/gsdl/packages/mg/lib
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/packages/mg/lib/Makefile.in
r1598 r2741 83 83 bitio_m_mems.h bitio_stdio.h huffman_stdio.h sptree.h \ 84 84 pathmax.h getpagesize.h \ 85 random.h simplefrenchstem.h unitool.h 85 random.h simplefrenchstem.h unitool.h longlong.h 86 86 # regex.h rx.h 87 87 -
trunk/gsdl/packages/mg/lib/WIN32.MAK
r2338 r2741 54 54 bitio_m_mems.h bitio_stdio.h huffman_stdio.h sptree.h \ 55 55 rx.h pathmax.h getpagesize.h \ 56 random.h win32in.h simplefrenchstem.h unitool.h 56 random.h win32in.h simplefrenchstem.h unitool.h \ 57 longlong.h 57 58 58 59 SOURCES = \ -
trunk/gsdl/packages/mg/lib/bitio_gen.c
r439 r2741 24 24 /* 25 25 $Log$ 26 Revision 1.2 2001/09/21 12:45:03 kjm18 27 updated mg to be in line with version mg-1.3f. Now uses long long for 28 some variables to enable indexing of very large collections. 29 26 30 Revision 1.1 1999/08/10 21:16:42 sjboddie 27 31 renamed mg-1.3d directory mg … … 131 135 } 132 136 137 138 /* adjustment is a hack to overcome inaccuracies in floating point, 139 where (int)(ln4/ln2) can equal 1, not 2. */ 140 /* copied from mg-1.3f, 17-09-01 kjm18 */ 133 141 int 134 142 BIO_Gamma_Bound (int N, int p) 135 143 { 136 return ((int) (p * (2 * log2 ((double) N / p) + 1))); 144 //return ((int) (p * (2 * log2 ((double) N / p) + 1))); 145 return ((int) (p * (2 * log2 (((double) N * 1.0001) / p) + 1))); 137 146 } 138 147 -
trunk/gsdl/packages/mg/lib/bitio_random.c
r439 r2741 1 /************************************************************************* *1 /************************************************************************* 2 2 * 3 3 * bitio_random.c -- Functions for bitio to a file (random access) … … 24 24 /* 25 25 $Log$ 26 Revision 1.2 2001/09/21 12:45:03 kjm18 27 updated mg to be in line with version mg-1.3f. Now uses long long for 28 some variables to enable indexing of very large collections. 29 26 30 Revision 1.1 1999/08/10 21:16:46 sjboddie 27 31 renamed mg-1.3d directory mg … … 42 46 #include "memlib.h" 43 47 48 #include "longlong.h" 49 44 50 #include "bitio_m_random.h" 45 51 #include "bitio_m.h" … … 284 290 return (t); 285 291 } 292 293 #ifdef USE_LONG_LONG 294 295 void 296 BIO_Random_Seek_LL (mg_ullong pos, random_bitio_state * bs) 297 { 298 ENCODE_CONTINUE(*bs) 299 300 if ((((pos) >> 3) >= (mg_ullong)__base) && 301 ((((pos)+7) >> 3) < (mg_ullong)(__base + __len))) 302 { 303 __pos = (long)((pos) - (mg_ullong)(__base << 3)); 304 } 305 else 306 { 307 ENCODE_FLUSH; 308 __base = (long)(((pos) >> (__sft+3)) << __sft); 309 310 fseek(__file,__base,0); 311 fread(__buf,1,__len,__file); 312 __pos = (long)((pos) & ((8 << __sft)-1)); 313 } 314 315 ENCODE_PAUSE(*bs) 316 } 317 318 mg_ullong 319 BIO_Random_Tell_LL (random_bitio_state * bs) 320 { 321 mg_ullong t; 322 ENCODE_CONTINUE(*bs) 323 t = (((mg_ullong)__base) << 3ull) + __pos; 324 ENCODE_PAUSE(*bs) 325 return(t); 326 } 327 328 #endif -
trunk/gsdl/packages/mg/lib/bitio_random.h
r439 r2741 30 30 * and just continue processing. 31 31 * 32 * Modified: 33 * - long long seek and tell ops 34 * (1999-08-03 Tim Bell <[email protected]>) 32 35 **************************************************************************/ 33 36 … … 35 38 #define H_BITIO_RANDOM 36 39 40 #include "longlong.h" 37 41 38 42 … … 114 118 unsigned long BIO_Random_Tell (random_bitio_state * bs); 115 119 120 #ifdef USE_LONG_LONG 121 122 void BIO_Random_Seek_LL (mg_ullong pos, random_bitio_state * bs); 123 mg_ullong BIO_Random_Tell_LL (random_bitio_state * bs); 124 125 #endif /* USE_LONG_LONG */ 116 126 117 127 #endif -
trunk/gsdl/packages/mg/lib/win32in.c
r439 r2741 9 9 10 10 return x; 11 } 12 13 mg_ullong ntohll(mg_ullong y) 14 { 15 #if defined (LITTLE_ENDIAN) || defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN) 16 x = 17 ((x >> 56) & 0x00000000000000FF) | ((x >> 40) & 0x000000000000FF00) | 18 ((x >> 24) & 0x0000000000FF0000) | ((x >> 8) & 0x00000000FF000000) | 19 ((x << 8) & 0x000000FF00000000) | ((x << 24) & 0x0000FF0000000000) | 20 ((x << 40) & 0x00FF000000000000) | ((x << 56) & 0xFF00000000000000); 21 #endif 22 return x; 11 23 } 12 24 -
trunk/gsdl/packages/mg/lib/win32in.h
r439 r2741 4 4 unsigned long htonl(unsigned long x); 5 5 unsigned long ntohl(unsigned long x); 6 mg_ullong ntohll(mg_ullong x); 6 7 unsigned short htons(unsigned short x); 7 8 unsigned short ntohs(unsigned short x);
Note:
See TracChangeset
for help on using the changeset viewer.