pike.git
/
src
/
operators.c
version
»
Context lines:
10
20
40
80
file
none
3
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.
106
2000/09/26
03
:
17:
04 hedda Exp $");
+
RCSID("$Id: operators.c,v 1.
107
2000/09/26
10
:
04
:
33
hedda 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:1890:
OP_DIVISION_BY_ZERO_ERROR("`/"); if(len<0) { len=-len; size=(ptrdiff_t)ceil( ((double)sp[-2].u.string->len) / len); a=allocate_array(size); for(last=sp[-2].u.string->len,e=0;e<size-1;e++) {
-
pos=sp[-2].u.string->len - (ptrdiff_t)((e+1)*
len
);
+
pos=sp[-2].u.string->len - (ptrdiff_t)((e+1)*
len+0.5
);
a->item[size-1-e].u.string=string_slice(sp[-2].u.string, pos, last-pos); a->item[size-1-e].type=T_STRING; last=pos; } pos=0; a->item[0].u.string=string_slice(sp[-2].u.string, pos, last-pos); a->item[0].type=T_STRING; }else{ size=(ptrdiff_t)ceil( ((double)sp[-2].u.string->len) / len); a=allocate_array(size); for(last=0,e=0;e<size-1;e++) {
-
pos = DO_NOT_WARN((ptrdiff_t)((e+1)*
len
));
+
pos = DO_NOT_WARN((ptrdiff_t)((e+1)*
len+0.5
));
a->item[e].u.string=string_slice(sp[-2].u.string, last, pos-last); a->item[e].type=T_STRING; last=pos; } pos=sp[-2].u.string->len; a->item[e].u.string=string_slice(sp[-2].u.string, last, pos-last);
pike.git/src/operators.c:1979:
OP_DIVISION_BY_ZERO_ERROR("`/"); if(len<0) { len=-len; size = (ptrdiff_t)ceil( ((double)sp[-2].u.array->size) / len); a=allocate_array(size); for(last=sp[-2].u.array->size,e=0;e<size-1;e++) {
-
pos=sp[-2].u.array->size - (ptrdiff_t)((e+1)*
len
);
+
pos=sp[-2].u.array->size - (ptrdiff_t)((e+1)*
len+0.5
);
a->item[size-1-e].u.array=friendly_slice_array(sp[-2].u.array, pos, last); a->item[size-1-e].type=T_ARRAY; last=pos; } a->item[0].u.array=slice_array(sp[-2].u.array, 0, last); a->item[0].type=T_ARRAY; }else{ size = (ptrdiff_t)ceil( ((double)sp[-2].u.array->size) / len); a=allocate_array(size); for(last=0,e=0;e<size-1;e++) {
-
pos = (ptrdiff_t)((e+1)*
len
);
+
pos = (ptrdiff_t)((e+1)*
len+0.5
);
a->item[e].u.array=friendly_slice_array(sp[-2].u.array, last, pos); a->item[e].type=T_ARRAY; last=pos; } a->item[e].u.array=slice_array(sp[-2].u.array, last, sp[-2].u.array->size); a->item[e].type=T_ARRAY;