pike.git
/
src
/
operators.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/operators.c:2306:
} bad_arg_error("`-", sp-2, 2, 2, get_name_of_type(TYPEOF(sp[-2])), sp-1, "Subtract on different types.\n"); } switch(TYPEOF(sp[-2])) { case T_OBJECT: if(!call_lfun(LFUN_SUBTRACT, LFUN_RSUBTRACT))
-
bad
_
arg_error
("`-",
sp-2, 2, 2, get_name_of_type(TYPEOF(sp[-2])),
-
sp-1,
"Subtract on objects without
subtract
operator.\n");
+
PIKE
_
ERROR
("`-", "Subtract on objects without
`-
operator.\n"
, sp, 2
);
return; case T_ARRAY: { struct array *a; check_array_for_destruct(sp[-2].u.array); check_array_for_destruct(sp[-1].u.array); a = subtract_arrays(sp[-2].u.array, sp[-1].u.array); pop_n_elems(2);
pike.git/src/operators.c:2607:
else { int args = 2; SIMPLE_ARG_TYPE_ERROR("`&", 2, get_name_of_type(TYPEOF(sp[-2]))); } } switch(TYPEOF(sp[-2])) { case T_OBJECT:
-
call_lfun(LFUN_AND,LFUN_RAND);
-
break
;
+
if(!
call_lfun(LFUN_AND,LFUN_RAND)
)
+
PIKE_ERROR("`&", "Bitwise and on objects without `& operator.\n", sp, 2)
;
+
return
;
case T_INT: sp--; SET_SVAL(sp[-1], PIKE_T_INT, NUMBER_NUMBER, integer, sp[-1].u.integer & sp[0].u.integer);
-
break
;
+
return
;
case T_MAPPING: { struct mapping *m; m=merge_mappings(sp[-2].u.mapping, sp[-1].u.mapping, PIKE_ARRAY_OP_AND); pop_n_elems(2); push_mapping(m); return; }
pike.git/src/operators.c:2895:
} } else { int args = 2; SIMPLE_ARG_TYPE_ERROR("`|", 2, get_name_of_type(TYPEOF(sp[-2]))); } } switch(TYPEOF(sp[-2])) { case T_OBJECT:
-
call_lfun(LFUN_OR,LFUN_ROR);
-
break
;
+
if(!
call_lfun(LFUN_OR,LFUN_ROR)
)
+
PIKE_ERROR("`|", "Bitwise or on objects without `| operator.\n", sp, 2)
;
+
return
;
case T_INT: sp--; SET_SVAL(sp[-1], T_INT, NUMBER_NUMBER, integer, sp[-1].u.integer | sp[0].u.integer);
-
break
;
+
return
;
case T_MAPPING: { struct mapping *m; m=merge_mappings(sp[-2].u.mapping, sp[-1].u.mapping, PIKE_ARRAY_OP_OR); pop_n_elems(2); push_mapping(m); return; }
pike.git/src/operators.c:3142:
} else { int args = 2; SIMPLE_ARG_TYPE_ERROR("`^", 2, get_name_of_type(TYPEOF(sp[-2]))); } } switch(TYPEOF(sp[-2])) { case T_OBJECT: if(!call_lfun(LFUN_XOR,LFUN_RXOR))
-
{
-
int
args
= 2;
-
SIMPLE_ARG_TYPE_ERROR("
`^",
1
,
"type"
);
-
}
-
break
;
+
PIKE_ERROR("`^",
"Bitwise
xor
on
objects
without
`^
operator.\n
",
sp
,
2
);
+
return
;
case T_INT: sp--; SET_SVAL(sp[-1], T_INT, NUMBER_NUMBER, integer, sp[-1].u.integer ^ sp[0].u.integer);
-
break
;
+
return
;
case T_MAPPING: { struct mapping *m; m=merge_mappings(sp[-2].u.mapping, sp[-1].u.mapping, PIKE_ARRAY_OP_XOR); pop_n_elems(2); push_mapping(m); return; }
pike.git/src/operators.c:3693:
convert_stack_top_to_bignum(); goto do_lfun_multiply; } sp--; SET_SVAL(sp[-1], T_INT, NUMBER_NUMBER, integer, res); return; } default: do_lfun_multiply:
-
if(call_lfun(LFUN_MULTIPLY, LFUN_RMULTIPLY))
+
if(
!
call_lfun(LFUN_MULTIPLY, LFUN_RMULTIPLY))
+
PIKE_ERROR("`*", "Multiplication on objects without `* operator.\n", sp, 2);
return;
-
-
PIKE_ERROR("`*", "Bad arguments.\n", sp, 2);
+
} } /*! @decl object|int|float `**(object|int|float arg1, object|int|float arg2) *! *! Exponentiation. Raise arg1 to the power of arg2.
pike.git/src/operators.c:4051:
return; } } PIKE_ERROR("`/", "Division on different types.\n", sp, 2); } switch(TYPEOF(sp[-2])) { case T_OBJECT:
-
call_lfun(LFUN_DIVIDE,LFUN_RDIVIDE);
+
if(!
call_lfun(LFUN_DIVIDE,LFUN_RDIVIDE)
)
+
PIKE_ERROR("`/", "Division on objects without `/ operator.\n", sp, 2)
;
return; case T_STRING: { struct array *ret; ret=explode(sp[-2].u.string,sp[-1].u.string); free_string(sp[-2].u.string); free_string(sp[-1].u.string); SET_SVAL(sp[-2], T_ARRAY, 0, array, ret); sp--;