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.
142
2001/
10
/
28
18:
02:
27
nilsson
Exp $");
+
RCSID("$Id: operators.c,v 1.
143
2001/
12/
10 02:
08:16
mast
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:927:
sp[-1].u.array, PIKE_ARRAY_OP_SUB); pop_n_elems(2); push_mapping(m); return; } case T_MULTISET: { struct mapping *m;
+
#ifdef PIKE_NEW_MULTISETS
+
int got_cmp_less = !!multiset_get_cmp_less (sp[-1].u.multiset);
+
struct array *ind = multiset_indices (sp[-1].u.multiset);
+
pop_stack();
+
push_array (ind);
+
if (got_cmp_less)
+
m=merge_mapping_array_unordered(sp[-2].u.mapping,
+
sp[-1].u.array,
+
PIKE_ARRAY_OP_SUB);
+
else
m=merge_mapping_array_ordered(sp[-2].u.mapping,
-
+
sp[-1].u.array,
+
PIKE_ARRAY_OP_SUB);
+
#else
+
m=merge_mapping_array_ordered(sp[-2].u.mapping,
sp[-1].u.multiset->ind, PIKE_ARRAY_OP_SUB);
-
+
#endif
+
pop_n_elems(2); push_mapping(m); return; } } bad_arg_error("`-", sp-2, 2, 2, get_name_of_type(sp[-2].type), sp-1, "Subtract on different types.\n"); }
pike.git/src/operators.c:1173:
sp[-1].u.array, PIKE_ARRAY_OP_AND); pop_n_elems(2); push_mapping(m); return; } case T_MULTISET: { struct mapping *m;
+
#ifdef PIKE_NEW_MULTISETS
+
int got_cmp_less = !!multiset_get_cmp_less (sp[-1].u.multiset);
+
struct array *ind = multiset_indices (sp[-1].u.multiset);
+
pop_stack();
+
push_array (ind);
+
if (got_cmp_less)
+
m=merge_mapping_array_unordered(sp[-2].u.mapping,
+
sp[-1].u.array,
+
PIKE_ARRAY_OP_AND);
+
else
m=merge_mapping_array_ordered(sp[-2].u.mapping,
-
+
sp[-1].u.array,
+
PIKE_ARRAY_OP_AND);
+
#else
+
m=merge_mapping_array_ordered(sp[-2].u.mapping,
sp[-1].u.multiset->ind, PIKE_ARRAY_OP_AND);
-
+
#endif
+
pop_n_elems(2); push_mapping(m); return; } default: { int args = 2; SIMPLE_BAD_ARG_ERROR("`&", 2, "mapping"); } }