pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: program.c,v 1.472 2003/03/19 19:55:24 nilsson Exp $ + || $Id: program.c,v 1.473 2003/06/30 17:18:24 mast Exp $   */      #include "global.h" - RCSID("$Id: program.c,v 1.472 2003/03/19 19:55:24 nilsson Exp $"); + RCSID("$Id: program.c,v 1.473 2003/06/30 17:18:24 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:1303:    size+=p->PIKE_CONCAT(num_,NAME)*sizeof(p->NAME[0]);   #include "program_areas.h"       p->total_size=size + sizeof(struct program);       p->flags |= PROGRAM_OPTIMIZED;    make_program_executable(p);   }      /* internal function to make the index-table */ - static ptrdiff_t program_identifier_index_compare(int a, int b, + static int program_identifier_index_compare(int a, int b,    const struct program *p)   { -  ptrdiff_t val_a = ((char *)(ID_FROM_INT(p, a)->name))-(char *)0; -  ptrdiff_t val_b = ((char *)(ID_FROM_INT(p, b)->name))-(char *)0; -  -  return val_a - val_b; +  size_t val_a = (size_t) (((char *)(ID_FROM_INT(p, a)->name))-(char *)NULL); +  size_t val_b = (size_t) (((char *)(ID_FROM_INT(p, b)->name))-(char *)NULL); +  return val_a < val_b ? -1 : (val_a == val_b ? 0 : 1);   }      #define CMP(X,Y) program_identifier_index_compare(*(X), *(Y), prog)   #define EXTRA_ARGS , struct program *prog   #define XARGS , prog   #define ID fsort_program_identifier_index   #define TYPE unsigned short   #include "fsort_template.h"   #undef TYPE   #undef ID
pike.git/src/program.c:4420:    */   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; -  ptrdiff_t val_n = ((char *)name) - (char *)0; +  size_t val_n = (size_t) (((char *)name) - (char *)NULL);      #ifdef PIKE_DEBUG    if(!funindex)    Pike_fatal("No funindex in fixed program\n");   #endif       max = prog->num_identifier_index;    min = 0;    while(max != min)    { -  ptrdiff_t val_t; +  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]; -  val_t = ((char *)fun->name) - (char *)0; -  if ((val_n - val_t) < 0) { +  val_t = (size_t) (((char *)fun->name) - (char *)NULL); +  if (val_n < val_t) {    max = tst;    } else {    min = tst+1;    }    }    }else{    return really_low_find_shared_string_identifier(name,prog,0);    }    return -1;   }