Branch: Tag:

1998-04-10

1998-04-10 22:24:22 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

Stdio.FILE x; now means object that x is an object that inherits Stdio.FILE.

Rev: src/ChangeLog:1.145
Rev: src/interpret.c:1.76
Rev: src/language.yacc:1.72
Rev: src/lex.c:1.50
Rev: src/pike_memory.c:1.20
Rev: src/pike_types.c:1.38
Rev: src/program.c:1.76
Rev: src/program.h:1.39
Rev: src/testsuite.in:1.88

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: program.c,v 1.75 1998/04/10 18:38:15 grubba Exp $"); + RCSID("$Id: program.c,v 1.76 1998/04/10 22:24:21 hubbe Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
2287:    INT32 oid, pid, offset;   } get_storage_cache[GET_STORAGE_CACHE_SIZE];    - char *get_storage(struct object *o, struct program *p) + int low_get_storage(struct program *o, struct program *p)   {    INT32 oid,pid, offset;    unsigned INT32 hval; -  if(!o->prog) return 0; -  oid=o->prog->id; +  if(!o) return 0; +  oid=o->id;    pid=p->id;    hval=oid*9248339 + pid;    hval%=GET_STORAGE_CACHE_SIZE;
2307:    }else{    INT32 e;    offset=-1; -  for(e=0;e<o->prog->num_inherits;e++) +  for(e=0;e<o->num_inherits;e++)    { -  if(o->prog->inherits[e].prog==p) +  if(o->inherits[e].prog==p)    { -  offset=o->prog->inherits[e].storage_offset; +  offset=o->inherits[e].storage_offset;    break;    }    }
2321:    get_storage_cache[hval].offset=offset;    }    +  return offset; + } +  + char *get_storage(struct object *o, struct program *p) + { +  int offset= low_get_storage(o->prog, p);    if(offset == -1) return 0;    return o->storage + offset;   }