pike.git / src / program.c

version» Context lines:

pike.git/src/program.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: program.c,v 1.317 2003/03/19 18:31:34 mast Exp $"); + RCSID("$Id: program.c,v 1.318 2003/06/30 17:29:40 mast Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "language.h"   #include "lex.h"   #include "pike_macros.h"   #include "fsort.h"
pike.git/src/program.c:541:   #include "program_areas.h"       p->total_size=size + sizeof(struct program);       p->flags |= PROGRAM_OPTIMIZED;   }      /* internal function to make the index-table */   int program_function_index_compare(const void *a,const void *b)   { -  return -  DO_NOT_WARN((int)my_order_strcmp(ID_FROM_INT(Pike_compiler->new_program, -  *(unsigned short *)a)->name, -  ID_FROM_INT(Pike_compiler->new_program, -  *(unsigned short *)b)->name)); +  size_t val_a = (size_t) +  ((char *) ID_FROM_INT(Pike_compiler->new_program, *(unsigned short *)a)->name - +  (char *) NULL); +  size_t val_b = (size_t) +  ((char *) ID_FROM_INT(Pike_compiler->new_program, *(unsigned short *)b)->name - +  (char *) NULL); +  return val_a < val_b ? -1 : (val_a == val_b ? 0 : 1);   }      #ifdef PIKE_DEBUG   char *find_program_name(struct program *p, INT32 *line)   {   #ifdef DEBUG_MALLOC    char *tmp;   #endif    ptrdiff_t pos;    INT32 l;
pike.git/src/program.c:3077:    */   int low_find_shared_string_identifier(struct pike_string *name,    struct program *prog)   {    int max,min,tst;    struct identifier *fun;       if(prog->flags & PROGRAM_FIXED)    {    unsigned short *funindex = prog->identifier_index; +  size_t val_a = (size_t) ((char *) name - (char *) NULL);      #ifdef PIKE_DEBUG    if(!funindex)    fatal("No funindex in fixed program\n");   #endif       max = prog->num_identifier_index;    min = 0;    while(max != min)    { -  +  size_t val_t;    tst=(max + min) >> 1;    fun = ID_FROM_INT(prog, funindex[tst]);    if(is_same_string(fun->name,name)) return funindex[tst]; -  if(my_order_strcmp(fun->name, name) > 0) +  val_t = (size_t) ((char *) fun->name - (char *) NULL); +  if(val_a < val_t)    max=tst;    else    min=tst+1;    }    }else{    return really_low_find_shared_string_identifier(name,prog,0);    }    return -1;   }