Branch: Tag:

1998-02-23

1998-02-23 23:24:35 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

min, max, `<, `<=, `>=, `>, `==, `!=, `- and `/ now takes any amount
of arguments.

Rev: src/las.c:1.51
Rev: src/modules/math/math.c:1.9
Rev: src/operators.c:1.25
Rev: src/pike_types.c:1.32
Rev: src/pike_types.h:1.9

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: las.c,v 1.50 1998/02/01 04:01:34 hubbe Exp $"); + RCSID("$Id: las.c,v 1.51 1998/02/23 23:24:02 hubbe Exp $");      #include "language.h"   #include "interpret.h"
1424:    {    struct pike_string *s;    struct pike_string *f; +  INT32 max_args,args;    push_type(T_MIXED); /* match any return type, even void */    push_type(T_VOID); /* not varargs */    push_type(T_MANY);
1432:    s=pop_type();    f=CAR(n)->type?CAR(n)->type:mixed_type_string;    n->type=check_call(s,f); +  args=count_arguments(s); +  max_args=get_max_args(f);       if(!n->type)    {
1447:    switch(CAR(n)->u.sval.type)    {    case T_FUNCTION: +  if(CAR(n)->u.sval.subtype == FUNCTION_BUILTIN) +  { +  name=CAR(n)->u.sval.u.efun->name->str; +  }else{    name=ID_FROM_INT(CAR(n)->u.sval.u.object->prog,    CAR(n)->u.sval.subtype)->name->str; -  +  }    break;       case T_ARRAY:
1463:    name="`() (function call)";    break;    } +  break;       default:    name="unknown function";    }    -  if(max_correct_args == count_arguments(s)) +  if(max_args < args)    { -  +  my_yyerror("To many arguments to %s.\n",name); +  } +  else if(max_correct_args == args) +  {    my_yyerror("To few arguments to %s.\n",name);    }else{    my_yyerror("Bad argument %d to %s.",