pike.git / src / operators.c

version» Context lines:

pike.git/src/operators.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"   #include <math.h> - RCSID("$Id: operators.c,v 1.38 1998/07/31 07:06:40 hubbe Exp $"); + RCSID("$Id: operators.c,v 1.39 1998/07/31 20:15:11 grubba Exp $");   #include "interpret.h"   #include "svalue.h"   #include "multiset.h"   #include "mapping.h"   #include "array.h"   #include "stralloc.h"   #include "opcodes.h"   #include "operators.h"   #include "language.h"   #include "pike_memory.h"
pike.git/src/operators.c:1249:    {    struct array *a;    INT32 size,e,len,pos;       len=sp[-1].u.integer;    if(!len)    PIKE_ERROR("`/", "Division by zero.\n", sp, 2);       if(len<0)    { -  len=-len; -  size=sp[-2].u.array->size / len; -  pos=sp[-2].u.array->size % len; +  len = -len; +  pos = sp[-2].u.array->size % len;    }else{ -  size=sp[-2].u.array->size / len; -  pos=0; +  pos = 0;    } -  +  size = sp[-2].u.array->size / len; +     a=allocate_array(size);    for(e=0;e<size;e++)    {    a->item[e].u.array=friendly_slice_array(sp[-2].u.array,    pos,    pos+len);    pos+=len;    a->item[e].type=T_ARRAY;    }    a->type_field=BIT_ARRAY;