File: I2Ohash-64bit.patch

package info (click to toggle)
spooles 2.2-16
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,760 kB
  • sloc: ansic: 146,836; sh: 7,571; csh: 3,615; makefile: 1,970; perl: 74
file content (83 lines) | stat: -rw-r--r-- 2,370 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Description: I2Ohash 64bit
--- spooles-2.2/I2Ohash/src/util.c~	1998-05-30 18:45:12.000000000 -0400
+++ spooles-2.2/I2Ohash/src/util.c	2008-12-29 02:20:52.000000000 -0500
@@ -20,6 +20,7 @@
    void      *value 
 ) {
 int   loc, loc1, loc2 ;
+long int loc3 ;
 I2OP  *i2op, *j2op, *prev ;
 
 if ( hashtable == NULL ) {
@@ -39,9 +40,10 @@
 */
 loc1 = (key1 + 1) % hashtable->nlist ;
 loc2 = (key2 + 1) % hashtable->nlist ;
-loc  = (loc1*loc2) % hashtable->nlist ;
+loc3  = (long int)loc1*(long int)loc2 % hashtable->nlist ;
+loc =(int) loc3;
 #if MYDEBUG > 0
-fprintf(stdout, "\n loc1 = %d, loc2 = %d, loc3 = %d", loc1, loc2, loc) ;
+fprintf(stdout, "\n loc1 = %d, loc2 = %d, loc3 = %ld, loc = %d", loc1, loc2, loc3, loc) ;
 fflush(stdout) ;
 #endif
 /*
@@ -139,6 +141,7 @@
    void      **pvalue 
 ) {
 int   loc, loc1, loc2, rc ;
+long int loc3 ;
 I2OP   *i2op ;
 /*
    ---------------
@@ -158,9 +161,10 @@
 #endif
 loc1 = (key1 + 1) % hashtable->nlist ;
 loc2 = (key2 + 1) % hashtable->nlist ;
-loc  = (loc1*loc2) % hashtable->nlist ;
+loc3  = (long int)loc1*(long int)loc2 % hashtable->nlist ;
+loc  = (int) loc3 ;
 #if MYDEBUG > 0
-fprintf(stdout, "\n loc1 = %d, loc2 = %d, loc3 = %d", loc1, loc2, loc) ;
+fprintf(stdout, "\n loc1 = %d, loc2 = %d, loc3 = %ld, loc = %d", loc1, loc2, loc3, loc) ;
 fflush(stdout) ;
 #endif
 /*
@@ -215,6 +219,7 @@
    void      **pvalue 
 ) {
 int   loc, loc1, loc2, rc ;
+long int loc3 ;
 I2OP   *i2op, *prev ;
 /*
    ---------------
@@ -229,7 +234,8 @@
 }
 loc1 = (key1 + 1) % hashtable->nlist ;
 loc2 = (key2 + 1) % hashtable->nlist ;
-loc  = (loc1*loc2) % hashtable->nlist ;
+loc3  = (long int)loc1*(long int)loc2 % hashtable->nlist ;
+loc  = (int) loc3 ;
 /*
    ---------------------------------------------------
    find the location of the first (key1,key2,*) triple
@@ -294,7 +300,7 @@
          count++ ;
          i2op = i2op->next ;
       }
-      measure += count*count ;
+      measure += (double)count*(double)count ;
    }
 }
 measure = sqrt(measure) ;
--- spooles-2.2/I2Ohash/src/IO.c~	1998-05-30 18:45:12.000000000 -0400
+++ spooles-2.2/I2Ohash/src/IO.c	2008-12-29 02:32:52.000000000 -0500
@@ -41,7 +41,7 @@
                  i2op->value0, i2op->value1, i2op->value2) ;
          i2op = i2op->next ;
       }
-      measure += count*count ;
+      measure += (double)count*(double)count ;
       nfull++ ;
    }
 }