summaryrefslogtreecommitdiff
path: root/math/qhull/patches/patch-aa
blob: 18d8da02687e3315a4eb08b1753da207a9e0d90d (plain)
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
$NetBSD: patch-aa,v 1.1 2011/11/30 10:55:50 drochner Exp $

poly.c-qh_gethash.patch from upstream

--- src/poly.c.orig	2004-01-31 11:00:15.000000000 +0000
+++ src/poly.c
@@ -403,6 +403,7 @@ unsigned qh_gethash (int hashsize, setT 
   void **elemp= SETelemaddr_(set, firstindex, void);
   ptr_intT hash = 0, elem;
   int i;
+  unsigned result;
 
   switch (size-firstindex) {
   case 1:
@@ -441,9 +442,10 @@ unsigned qh_gethash (int hashsize, setT 
     }while(*elemp);
     break;
   }
-  hash %= (ptr_intT) hashsize;
-  /* hash= 0; for debugging purposes */
-  return hash;
+  result= (unsigned)hash;
+  result %= (unsigned)hashsize;
+  /* result= 0; for debugging purposes */
+  return result;
 } /* gethash */
 
 /*-<a                             href="qh-poly.htm#TOC"