pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.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: builtin_functions.c,v 1.541 2004/04/19 22:30:19 nilsson Exp $ + || $Id: builtin_functions.c,v 1.542 2004/04/29 01:05:29 nilsson Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.541 2004/04/19 22:30:19 nilsson Exp $"); + RCSID("$Id: builtin_functions.c,v 1.542 2004/04/29 01:05:29 nilsson Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"   #include "constants.h"   #include "mapping.h"   #include "stralloc.h"
pike.git/src/builtin_functions.c:3056:    continue;       v[num].ind=ITEM(from)[e].u.string;    v[num].val=ITEM(to)[e].u.string;    v[num].prefix=-2; /* Uninitialized */    num++;    }       fsort((char *)v,num,sizeof(struct tupel),(fsortfun)replace_sortfun);    -  for(e=0;e<(INT32)NELEM(set_end);e++) -  set_end[e]=set_start[e]=0; +  MEMSET(set_start, 0, sizeof(set_start)); +  MEMSET(set_end, 0, sizeof(set_end));       for(e=0;e<num;e++)    {    INT32 x;    x=index_shared_string(v[num-1-e].ind,0); -  if((x >= 0) && (x<(INT32)NELEM(set_start))) +  if((x<(INT32)NELEM(set_start)) && (x >= 0))    set_start[x]=num-e-1;    x=index_shared_string(v[e].ind,0); -  if((x >= 0) && (x<(INT32)NELEM(set_end))) +  if((x<(INT32)NELEM(set_end)) && (x >= 0))    set_end[x]=e+1;    }       init_string_builder(&ret,str->size_shift);       length=str->len;       for(s=0;length > 0;)    {    INT32 a,b;    ptrdiff_t ch;       ch=index_shared_string(str,s); -  if((ch >= 0) && (ch<(ptrdiff_t)NELEM(set_end))) +  if((ch<(ptrdiff_t)NELEM(set_end)) && (ch >= 0))    b=set_end[ch];    else    b=num;       if(b)    { -  if((ch >= 0) && (ch<(ptrdiff_t)NELEM(set_start))) +  if((ch<(ptrdiff_t)NELEM(set_start)) && (ch >= 0))    a=set_start[ch];    else    a=0;       a=find_longest_prefix(str->str+(s << str->size_shift),    length,    str->size_shift,    v, a, b);       if(a!=-1)