ports/math/spooles/files/patch-I2Ohash-large-input
Maho Nakata f18cdd2f47 Cosmetic updates
- Clean up a malloc() call to get rid of some warnings.
- Pet portlint by using "makepatch" for the patches, added the license,
  changed a tab after the WWW line.

PR: 208295
Submitted by: pfg@
2016-04-18 11:28:17 +00:00

35 lines
1.3 KiB
Text

--- I2Ohash/src/util.c.orig 1998-05-30 22:45:12 UTC
+++ I2Ohash/src/util.c
@@ -39,7 +39,9 @@ fflush(stdout) ;
*/
loc1 = (key1 + 1) % hashtable->nlist ;
loc2 = (key2 + 1) % hashtable->nlist ;
-loc = (loc1*loc2) % hashtable->nlist ;
+/*loc = (loc1*loc2) % hashtable->nlist ;*/
+long int 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) ;
fflush(stdout) ;
@@ -158,7 +160,9 @@ fflush(stdout) ;
#endif
loc1 = (key1 + 1) % hashtable->nlist ;
loc2 = (key2 + 1) % hashtable->nlist ;
-loc = (loc1*loc2) % hashtable->nlist ;
+/*loc = (loc1*loc2) % hashtable->nlist ;*/
+long int 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) ;
fflush(stdout) ;
@@ -229,7 +233,9 @@ if ( hashtable == NULL || pvalue == NULL
}
loc1 = (key1 + 1) % hashtable->nlist ;
loc2 = (key2 + 1) % hashtable->nlist ;
-loc = (loc1*loc2) % hashtable->nlist ;
+/*loc = (loc1*loc2) % hashtable->nlist ;*/
+long int loc3 = (long int)loc1*(long int)loc2 % hashtable->nlist ;
+loc=(int)loc3;
/*
---------------------------------------------------
find the location of the first (key1,key2,*) triple