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.
109
2000/10/
14
22
:
17
:
58
grubba Exp $");
+
RCSID("$Id: operators.c,v 1.
110
2000/10/
15
12
:
24
:
14
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:1654:
ptrdiff_t asize, delta; if(sp[-1].u.float_number < 0) SIMPLE_BAD_ARG_ERROR("`*", 2, "float(0..)"); src = sp[-2].u.array; delta = src->size; asize = (ptrdiff_t)floor(delta * sp[-1].u.float_number + 0.5); ret = allocate_array(asize); pos = ret->item; if (asize >= delta) {
+
ret->type_field = src->type_field;
assign_svalues_no_free(pos, src->item, delta, src->type_field); pos += delta; asize -= delta; while (asize >= delta) { assign_svalues_no_free(pos, ret->item, delta, ret->type_field); pos += delta; asize -= delta; delta <<= 1; } if (asize) { assign_svalues_no_free(pos, ret->item, asize, ret->type_field); } } else if (asize) { assign_svalues_no_free(pos, src->item, asize, src->type_field);
-
+
array_fix_type_field(ret);
} pop_n_elems(2); push_array(ret); return; } case TWO_TYPES(T_STRING, T_FLOAT): { struct pike_string *src; struct pike_string *ret;