pike.git/
src/
operators.c
Branch:
Tag:
Non-build tags
All tags
No tags
2000-09-22
2000-09-22 20:41:46 by Henrik Grubbström (Grubba) <grubba@grubba.org>
d67c6dcb7a9bfe46ce31fa06919bb414c02d3f8f (
38
lines) (+
37
/-
1
)
[
Show
|
Annotate
]
Branch:
7.9
`+(a, b, c) now behaves like a + b + c in all cases.
Rev: src/operators.c:1.103
6:
/**/ #include "global.h" #include <math.h>
-
RCSID("$Id: operators.c,v 1.
102
2000/09/22
12
:
25
:
59
grubba Exp $");
+
RCSID("$Id: operators.c,v 1.
103
2000/09/22
20
:
41
:
46
grubba Exp $");
#include "interpret.h" #include "svalue.h" #include "multiset.h"
207:
PCHARP buf; char buffer[50]; int max_shift=0;
+
+
if ((sp[-args].type != T_STRING) && (sp[1-args].type != T_STRING)) {
+
struct svalue *save_sp = sp;
+
/* We need to perform a normal addition first.
+
*/
+
for (e=-args; e < 0; e++) {
+
if (save_sp[e].type == T_STRING)
+
break;
+
*(sp++) = save_sp[e];
+
}
+
/* Perform the addition. */
+
f_add(args+e);
+
save_sp[--e] = *(--sp);
+
#ifdef PIKE_DEBUG
+
if (sp != save_sp) {
+
fatal("f_add(): Lost track of stack %p != %p\n", sp, save_sp);
+
}
+
#endif /* PIKE_DEBUG */
+
/* Perform the rest of the addition. */
+
f_add(-e);
+
#ifdef PIKE_DEBUG
+
if (sp != save_sp + 1 + e) {
+
fatal("f_add(): Lost track of stack (2) %p != %p\n",
+
sp, save_sp + 1 + e);
+
}
+
#endif /* PIKE_DEBUG */
+
/* Adjust the stack. */
+
save_sp[-args] = sp[-1];
+
sp = save_sp + 1 - args;
+
return;
+
} else {
+
e = -args;
+
}
+
+
size=0; for(e=-args;e<0;e++) {