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.80 1999/11/26 01:08:02 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.81 1999/11/26 01:31:08 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:1586:    if(EXTRACT_UCHAR(b)==T_VOID || EXTRACT_UCHAR(a)==T_VOID)    {    a+=type_length(a);    b+=type_length(b);    }else{    if(!low_match_types(a,b,flags | NO_MAX_ARGS)) return 0;    }    if(!(flags & NO_MAX_ARGS))    max_correct_args=0x7fffffff;    /* check the returntype */ -  if(!low_match_types(a,b,flags)) return 0; +  if ((EXTRACT_UCHAR(b) == T_VOID) && (EXTRACT_UCHAR(a) != T_VOID)) { +  /* Promote b to a function returning zero. */ +  if (!low_match_types(a, tZero, flags)) return 0; +  } else if ((EXTRACT_UCHAR(a) == T_VOID) && (EXTRACT_UCHAR(b) != T_VOID)) { +  /* Promote a to a function returning zero. */ +  if(!low_match_types(tZero,b,flags)) return 0; +  } else if(!low_match_types(a,b,flags)) return 0;    break;       case T_MAPPING:    if(!low_match_types(++a,++b,flags)) return 0;    if(!low_match_types(a+type_length(a),b+type_length(b),flags)) return 0;    break;       case T_OBJECT:   #if 0    if(extract_type_int(a+2) || extract_type_int(b+2))
pike.git/src/pike_types.c:1926:    ret=1;    switch(EXTRACT_UCHAR(a))    {    case T_FUNCTION:    /*    * function(A...:B) <= function(C...:D) iff C <= A && B <= D    */    /*    * function(:int) <= function(int:int)    * function(int|string:int) <= function(int:int) +  * function(:int) <= function(:void)    * function(string:int) != function(int:int)    * function(int:int) != function(:int)    */    a++;    b++;    while(EXTRACT_UCHAR(a)!=T_MANY || EXTRACT_UCHAR(b)!=T_MANY)    {    char *a_tmp,*b_tmp;    if(EXTRACT_UCHAR(a)==T_MANY)    {