Branch: Tag:

1999-12-17

1999-12-17 22:45:40 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Stricter handling of void in pike_types_le().

Rev: src/pike_types.c:1.103

5:   \*/   /**/   #include "global.h" - RCSID("$Id: pike_types.c,v 1.102 1999/12/17 00:27:33 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.103 1999/12/17 22:45:40 grubba Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"
2146:    return low_pike_types_le(a, b, array_cnt);    }    -  if (EXTRACT_UCHAR(b) == T_MIXED) { -  /* any_type <= 'mixed' */ -  if (array_cnt <= 0) { -  /* !array(mixed) */ +  /* NOTE: void only matches void. */ +  if (EXTRACT_UCHAR(a) == T_VOID) { +  /* void <= any_type */ +  if (array_cnt >= 0) { +  /* !array(void) */ +  if (!array_cnt && (EXTRACT_UCHAR(b) == T_VOID)) {    return 1;    } -  +  return 0;    } -  +  }    -  if (EXTRACT_UCHAR(a) == T_MIXED) { -  if (array_cnt >= 0) { -  /* !array(mixed) */ +  if (EXTRACT_UCHAR(b) == T_VOID) { +  if (array_cnt <= 0) { +  /* !array(void) */    return 0;    }    }    -  if (EXTRACT_UCHAR(a) == T_VOID) { -  /* void <= any_type */ -  if (array_cnt >= 0) { -  /* !array(void) */ +  if (EXTRACT_UCHAR(b) == T_MIXED) { +  /* any_type <= 'mixed' */ +  if (array_cnt <= 0) { +  /* !array(mixed) */    return 1;    }    }    -  if (EXTRACT_UCHAR(b) == T_VOID) { -  if (array_cnt <= 0) { -  /* !array(void) */ +  if (EXTRACT_UCHAR(a) == T_MIXED) { +  if (array_cnt >= 0) { +  /* !array(mixed) */    return 0;    }    }
2246:    * function(:int) <= function(:void)    * function(string:int) != function(int:int)    * function(int:int) != function(:int) +  * +  * FIXME: Enforcing of all required arguments?    */    a++;    b++;
2269:    }       if (EXTRACT_UCHAR(a_tmp) != T_VOID) { -  if ((EXTRACT_UCHAR(b_tmp) == T_VOID) && -  (a_tmp != a+1)) { -  /* a is not a many arg */ -  return 0; -  } +     if (!low_pike_types_le(b_tmp, a_tmp, 0)) return 0;    }    }