Changeset 24031 for main/branches
- Timestamp:
- 2011-05-19T09:26:07+12:00 (13 years ago)
- Location:
- main/branches/64_bit_Greenstone/greenstone2/common-src/indexers/mg/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/branches/64_bit_Greenstone/greenstone2/common-src/indexers/mg/lib/perf_hash.c
r16583 r24031 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/branches/64_bit_Greenstone/greenstone2/common-src/indexers/mg/lib/perf_hash.h
r16583 r24031 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/branches/64_bit_Greenstone/greenstone2/common-src/indexers/mg/lib/random.c
r16583 r24031 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/branches/64_bit_Greenstone/greenstone2/common-src/indexers/mg/lib/random.h
r16583 r24031 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
Note:
See TracChangeset
for help on using the changeset viewer.