pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:11333:      PMOD_EXPORT ptrdiff_t low_get_storage(struct program *o, struct program *p)   {    INT32 oid, pid;    ptrdiff_t offset;    unsigned INT32 hval;       if(!o) return -1;    oid=o->id;    pid=p->id; -  hval=oid*9248339 + pid; +  hval=(unsigned)oid*9248339 + (unsigned)pid;    hval%=GET_STORAGE_CACHE_SIZE;   #ifdef PIKE_DEBUG    if(hval>GET_STORAGE_CACHE_SIZE)    Pike_fatal("hval>GET_STORAGE_CACHE_SIZE\n");   #endif    if(get_storage_cache[hval].oid == oid &&    get_storage_cache[hval].pid == pid)    {    offset=get_storage_cache[hval].offset;    }else{
pike.git/src/program.c:11556:   struct implements_cache_s { INT32 aid, bid, ret; };   static struct implements_cache_s implements_cache[IMPLEMENTS_CACHE_SIZE];      /* returns 1 if a implements b, but faster */   PMOD_EXPORT int implements(struct program *a, struct program *b)   {    unsigned long hval;    if(!a || !b) return -1;    if(a==b) return 1;    -  hval = a->id*9248339 + b->id; +  hval = (unsigned)a->id*9248339 + (unsigned)b->id;    hval %= IMPLEMENTS_CACHE_SIZE;   #ifdef PIKE_DEBUG    if(hval >= IMPLEMENTS_CACHE_SIZE)    Pike_fatal("Implements_cache failed!\n");   #endif    if(implements_cache[hval].aid==a->id && implements_cache[hval].bid==b->id)    {    return implements_cache[hval].ret;    }    /* Do it the tedious way */
pike.git/src/program.c:11641:       /* Order the id's so we don't need double entries in the cache. */    aid = a->id;    bid = b->id;    if (aid > bid) {    int tmp = aid;    aid = bid;    bid = tmp;    }    -  hval = aid*9248339 + bid; +  hval = (unsigned long)aid*9248339 + (unsigned long)bid;    hval %= IMPLEMENTS_CACHE_SIZE;   #ifdef PIKE_DEBUG    if(hval >= IMPLEMENTS_CACHE_SIZE)    Pike_fatal("Implements_cache failed!\n");   #endif    if(is_compatible_cache[hval].aid==aid &&    is_compatible_cache[hval].bid==bid)    {    return is_compatible_cache[hval].ret;    }    if(implements_cache[hval].aid==aid &&    implements_cache[hval].bid==bid &&    implements_cache[hval].ret)    {    /* a implements b */    return 1;    } -  rhval = bid*9248339 + aid; +  rhval = (unsigned long)bid*9248339 + (unsigned long)aid;    rhval %= IMPLEMENTS_CACHE_SIZE;   #ifdef PIKE_DEBUG    if(rhval >= IMPLEMENTS_CACHE_SIZE)    Pike_fatal("Implements_cache failed!\n");   #endif    if(implements_cache[rhval].aid==bid &&    implements_cache[rhval].bid==aid &&    implements_cache[rhval].ret)    {    /* b implements a */