pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:95:    optflags OPT_TRY_OPTIMIZE;   {    if(a->size != b->size)    bad_arg_error("mkmapping", sp-args, args, 2, "array", sp+1-args,    "mkmapping called on arrays of different sizes (%d != %d)\n",    a->size, b->size);       RETURN mkmapping(a,b);   }    - PIKEFUN int string_count(string haystack, string needle) + PIKEFUN ptrdiff_t string_count(string haystack, string needle)    errname String.count;    optflags OPT_TRY_OPTIMIZE;   { -  int c=0; -  int i,j; +  ptrdiff_t c = 0; +  ptrdiff_t i, j;       switch (needle->len)    {    case 0:    switch (haystack->len)    {    case 0: c=1; break; /* "" appears one time in "" */    case 1: c=0; break; /* "" doesn't appear in "x" */    default: c=haystack->len-1; /* one time between each character */    }