--- a/qhull-2003.1/src/poly.c
+++ b/qhull-2003.1/src/poly.c
@@ -403,6 +403,7 @@ unsigned qh_gethash (int hashsize, setT *set, int size, int firstindex, void *sk
   void **elemp= SETelemaddr_(set, firstindex, void);
   ptr_intT hash = 0, elem;
   int i;
+  unsigned result;
 
   switch (size-firstindex) {
   case 1:
@@ -441,7 +442,8 @@ unsigned qh_gethash (int hashsize, setT *set, int size, int firstindex, void *sk
     }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 */
 
