pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.188 2000/07/18 16:22:37 grubba Exp $"); + RCSID("$Id: las.c,v 1.189 2000/08/14 17:48:49 grubba Exp $");      #include "language.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"   #include "pike_types.h"
pike.git/src/las.c:295:      BLOCK_ALLOC(node_s, NODES)      #undef BLOCK_ALLOC_NEXT   #define BLOCK_ALLOC_NEXT next      #ifdef SHARED_NODES      struct node_hash_table node_hash;    - static unsigned INT32 hash_node(node *n) + static size_t hash_node(node *n)   {    return hashmem((unsigned char *)&(n->token),    sizeof(node) - OFFSETOF(node_s, token), sizeof(node));   }      static void add_node(node *n)   { -  unsigned INT32 hval = n->hash % node_hash.size; +  size_t hval = n->hash % node_hash.size;       n->next = node_hash.table[hval];    node_hash.table[hval] = n;   }      static void sub_node(node *n)   {    node *prior;       if (!node_hash.size) {
pike.git/src/las.c:337: Inside #if defined(SHARED_NODES)
   }    if (!prior) {    return;    }    prior->next = n->next;    }   }      static node *freeze_node(node *orig)   { -  unsigned INT32 hash = hash_node(orig); +  size_t hash = hash_node(orig);    node *n;       /* free_node() wants a correct hash */    orig->hash = hash;       if (orig->node_info & OPT_NOT_SHARED) {    /* No need to have this node in the hash-table. */    /* add_node(orig); */    return check_node_hash(dmalloc_touch(node *, orig));    }
pike.git/src/las.c:476:      void debug_free_node(node *n)   {    if(!n) return;   #ifdef PIKE_DEBUG    if(l_flag>9)    print_tree(n);      #ifdef SHARED_NODES    { -  unsigned INT32 hash; +  size_t hash;    if ((hash = hash_node(n)) != n->hash) { -  fprintf(stderr, "Hash-value is bad 0x%08x != 0x%08x\n", hash, n->hash); +  fprintf(stderr, "Hash-value is bad 0x%08x != 0x%08lx\n", +  DO_NOT_WARN((unsigned long)hash), +  DO_NOT_WARN((unsigned long)n->hash));    print_tree(n);    fatal("token:%d, car:%p cdr:%p file:%s line:%d\n",    n->token, _CAR(n), _CDR(n), n->current_file->str, n->line_number);    }    }   #endif /* SHARED_NODES */   #endif /* PIKE_DEBUG */      #ifdef SHARED_NODES    if (dmalloc_touch(node *, n) && --(n->refs)) {
pike.git/src/las.c:1116:    yyerror("Expected constant, got undefined identifier");    }    push_int(0);    return;       default:    {    char fnord[1000];    if(is_const(n))    { -  int args=eval_low(n); +  ptrdiff_t args=eval_low(n);    if(args==1) return;       if(args!=-1)    {    if(!args)    {    yyerror("Expected constant, got void expression");    }else{    yyerror("Possible internal error!!!"); -  pop_n_elems(args-1); +  pop_n_elems(DO_NOT_WARN(args-1));    return;    }    }    }       sprintf(fnord,"Expected constant, got something else (%d)",n->token);    yyerror(fnord);    push_int(0);    return;    }
pike.git/src/las.c:1287:    node_name);    } else {    yyerror("Failed to index module (Not a module?)");    }    pop_stack();    push_int(0);    break;       default:    { -  int c; +  ptrdiff_t c;    DECLARE_CYCLIC(); -  c=(int)BEGIN_CYCLIC(Pike_sp[-1].u.refs, id); +  c = (ptrdiff_t)BEGIN_CYCLIC(Pike_sp[-1].u.refs, id);    if(c>1)    {    my_yyerror("Recursive module dependency in '%s'.",id->str);    pop_stack();    push_int(0);    }else{    SET_CYCLIC_RET(c+1);    ref_push_string(id);    {    struct svalue *save_sp = Pike_sp-2;
pike.git/src/las.c:3690:   static void check_evaluation_time(struct callback *cb,void *tmp,void *ignored)   {    struct timer_oflo *foo=(struct timer_oflo *)tmp;    if(foo->counter-- < 0)    {    foo->yes=1;    pike_throw();    }   }    - int eval_low(node *n) + ptrdiff_t eval_low(node *n)   {    unsigned INT16 num_strings, num_constants;    INT32 jump;    struct svalue *save_sp = Pike_sp; -  int ret; +  ptrdiff_t ret;      #ifdef PIKE_DEBUG    if(l_flag > 3 && n)    {    fprintf(stderr,"Evaluating (tree info=%x):",n->tree_info);    print_tree(n);    }   #endif       if(Pike_compiler->num_parse_error) return -1;
pike.git/src/las.c:3801:    }       Pike_compiler->new_program->num_program=jump;       return ret;   }      static node *eval(node *n)   {    node *new; -  int args; +  ptrdiff_t args;    if(!is_const(n) || n->token==':')    return n;       args=eval_low(n);       switch(args)    {    case -1:    return n;    break;