From adfda4d4b51cd7eb9ae22f13fecb2b18e3b2f28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Thu, 9 Apr 1998 21:48:41 -0700 Subject: [PATCH] warning removed Rev: src/gc.c:1.34 --- src/gc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gc.c b/src/gc.c index 85eeefce2f..ff180ced0c 100644 --- a/src/gc.c +++ b/src/gc.c @@ -25,7 +25,7 @@ struct callback *gc_evaluator_callback=0; #include "main.h" #include <math.h> -RCSID("$Id: gc.c,v 1.33 1998/04/10 04:37:38 hubbe Exp $"); +RCSID("$Id: gc.c,v 1.34 1998/04/10 04:48:41 hubbe Exp $"); /* Run garbage collect approximate every time we have * 20 percent of all arrays, objects and programs is @@ -101,7 +101,13 @@ static struct marker *getmark(void *a) unsigned long hashval; struct marker *m; - hashval=((unsigned long)a)%hashsize; + hashval=(unsigned long)a; + hashval%=hashsize; + +#ifdef DEBUG + if(hashval >= hashsize) + fatal("Compiler has buggy modulo operator.\n"); +#endif for(m=hash[hashval];m;m=m->next) if(m->marked == a) -- GitLab