pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.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: stralloc.c,v 1.170 2005/11/18 01:14:22 nilsson Exp $ + || $Id: stralloc.c,v 1.171 2006/03/14 17:39:03 grubba Exp $   */      #include "global.h"   #include "stralloc.h"   #include "pike_macros.h"   #include "dynamic_buffer.h"   #include "pike_macros.h"   #include "pike_memory.h"   #include "pike_error.h"   #include "gc.h"
pike.git/src/stralloc.c:17:   #include "bignum.h"   #include "interpret.h"   #include "block_alloc.h"   #include "operators.h"      #include <errno.h>   #include <float.h>   #include <ctype.h>   #include <math.h>    - RCSID("$Id: stralloc.c,v 1.170 2005/11/18 01:14:22 nilsson Exp $"); + RCSID("$Id: stralloc.c,v 1.171 2006/03/14 17:39:03 grubba Exp $");      /* #define STRALLOC_USE_PRIMES */      #ifdef STRALLOC_USE_PRIMES      #define SET_HSIZE(X) htable_size=hashprimes[(X)]   #define HMODULO(X) ((X) % htable_size)      #else   
pike.git/src/stralloc.c:1299:    tmp=MEMCMP(a, b, alen);    if(tmp) return tmp;    return -1;    }else{    return MEMCMP(a, b, alen);    }    }else{    INT32 pos;    for(pos=0;pos< MINIMUM(alen,blen) ;pos++)    { -  INT32 ac=generic_extract(a,asize,pos); -  INT32 bc=generic_extract(b,bsize,pos); -  if(ac-bc) return ac-bc; +  p_wchar2 ac=generic_extract(a,asize,pos); +  p_wchar2 bc=generic_extract(b,bsize,pos); +  if(ac != bc) { +  if (ac < bc) return -1; +  return 1;    } -  +  }    return alen-blen;    }   }      PMOD_EXPORT int c_compare_string(struct pike_string *s, char *foo, int len)   {    return s->len == len && s->size_shift == 0 && !MEMCMP(s->str,foo,len);   }      #ifndef HAVE_STRCOLL