pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.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" - RCSID("$Id: pike_types.c,v 1.151 2001/02/25 15:03:18 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.152 2001/02/26 00:10:48 grubba Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"   #include "stralloc.h"   #include "stuff.h"   #include "array.h"   #include "program.h"   #include "constants.h"   #include "object.h"   #include "multiset.h"
pike.git/src/pike_types.c:2498:    fatal("Error in type string.\n");    }    return 1;   }      /*    * Check the function parameters.    * Note: The difference between this function, and pike_types_le()    * is the more lenient check for T_OR, and the handling of T_ARRAY.    */ - int strict_check_call(char *fun_type, char *arg_type) + static int low_strict_check_call(char *fun_type, char *arg_type)   {    while ((EXTRACT_UCHAR(fun_type) == T_OR) ||    (EXTRACT_UCHAR(fun_type) == T_ARRAY)) {    if (EXTRACT_UCHAR(fun_type++) == T_OR) { -  int res = strict_check_call(fun_type, arg_type); +  int res = low_strict_check_call(fun_type, arg_type);    if (res) return res;    fun_type += type_length(fun_type);    }    }    return low_pike_types_le(fun_type, arg_type, 0, 0);   }    -  + int strict_check_call(struct pike_type *fun_type, struct pike_type *arg_type) + { +  return low_strict_check_call(fun_type->str, arg_type->str); + } +    /*    * Check validity of soft-cast.    * Note: This uses a weaker check of function arguments, since    * people get confused otherwise.    */   int check_soft_cast(struct pike_type *to, struct pike_type *from)   {    return low_pike_types_le(to->str, from->str, 0, LE_WEAK_OBJECTS);   }   
pike.git/src/pike_types.c:3110:   {    check_type_string(args);    check_type_string(type);    clear_markers();    type_stack_mark();    max_correct_args=0;       if(low_get_return_type(type->str,args->str))    {    if (strict) { -  if (!strict_check_call(type->str, args->str)) { +  if (!strict_check_call(type, args)) {    struct pike_string *type_t = describe_type(type);       if (!low_pike_types_le(type->str, tFuncV(tNone,tZero,tMix), 0, 0)) {    yywarning("Calling non-function value.");    yywarning("Type called: %s", type_t->str);    } else {    struct pike_string *arg_t = describe_type(args);    yywarning("Arguments not strictly compatible.");    yywarning("Expected: %s", type_t->str);    yywarning("Got : %s", arg_t->str);