2003-01-05
2003-01-05 00:55:44 by Martin Nilsson <mani@lysator.liu.se>
-
e74e2c1ebe471dea84cd4527a6315bb9bbd40b58
(22 lines)
(+13/-9)
[
Show
| Annotate
]
Branch: 7.9
Use the SIMPLE_ macros. Fixed droppings error in has_index and has_value.
Rev: src/builtin_functions.c:1.456
2:
|| This file is part of Pike. For copyright information see COPYRIGHT.
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| for more information.
- || $Id: builtin_functions.c,v 1.455 2003/01/04 15:24:51 nilsson Exp $
+ || $Id: builtin_functions.c,v 1.456 2003/01/05 00:55:44 nilsson Exp $
*/
#include "global.h"
- RCSID("$Id: builtin_functions.c,v 1.455 2003/01/04 15:24:51 nilsson Exp $");
+ RCSID("$Id: builtin_functions.c,v 1.456 2003/01/05 00:55:44 nilsson Exp $");
#include "interpret.h"
#include "svalue.h"
#include "pike_macros.h"
843:
{
int t = 0;
- if(args != 2)
- PIKE_ERROR("has_index", "Bad number of arguments.\n", Pike_sp, args);
+ if(args < 2)
+ SIMPLE_TOO_FEW_ARGS_ERROR("has_index", 2);
+ if(args > 2)
+ pop_n_elems(args-2);
switch(Pike_sp[-2].type)
{
927:
*/
PMOD_EXPORT void f_has_value(INT32 args)
{
- if(args != 2)
- PIKE_ERROR("has_value", "Bad number of arguments.\n", Pike_sp, args);
+ if(args < 2)
+ SIMPLE_TOO_FEW_ARGS_ERROR("has_value", 2);
+ if(args > 2)
+ pop_n_elems(args-2);
switch(Pike_sp[-2].type)
{
4201: Inside #if defined(HAVE_MKTIME)
if (args > 6) {
if (Pike_sp[6-args].type != T_INT) {
- PIKE_ERROR("mktime", "Bad argument 6 (expected int).\n", Pike_sp, args);
+ SIMPLE_BAD_ARG_ERROR("mktime", 6, "int");
}
if (args > 7) {
if (Pike_sp[7-args].type != T_INT) {
- PIKE_ERROR("mktime", "Bad argument 7 (expected int).\n",
- Pike_sp, args);
+ SIMPLE_BAD_ARG_ERROR("mktime", 7, "int");
}
}
}