pike.git / src / las.c

version» Context lines:

pike.git/src/las.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: las.c,v 1.145 1999/12/19 14:57:36 grubba Exp $"); + RCSID("$Id: las.c,v 1.146 1999/12/21 20:41:11 grubba Exp $");      #include "language.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"   #include "pike_types.h"
pike.git/src/las.c:961:    }       if(type==n->type) {    struct pike_string *t1 = describe_type(type);    yywarning("Soft cast to %s is a noop.", t1->str);    free_string(t1);    return n;    }       if (n->type) { -  if (!pike_types_le(type, n->type)) { +  if (!check_soft_cast(type, n->type)) {    struct pike_string *t1 = describe_type(type);    struct pike_string *t2 = describe_type(n->type);    yywarning("Soft cast to %s isn't a restriction of %s.",    t1->str, t2->str);    free_string(t2);    free_string(t1);    } -  +  /* FIXME: check_soft_cast() is weaker than pike_types_le() +  * The resulting type should probably be the and between the old +  * and the new type. +  */    }    res = mkemptynode();    res->token = F_SOFT_CAST;    copy_shared_string(res->type,type);       res->tree_info |= n->tree_info;       _CAR(res) = n;   #ifdef SHARED_NODES    _CDR(res) = (node *)type;
pike.git/src/las.c:2141:    return; /* assume it is correct */       old_type = n->type;    n->type = 0;    n->node_info &= ~OPT_TYPE_NOT_FIXED;       switch(n->token)    {    case F_SOFT_CAST:    if (CAR(n) && CAR(n)->type) { -  if (!pike_types_le(old_type, CAR(n)->type)) { +  if (!check_soft_cast(old_type, CAR(n)->type)) {    struct pike_string *t1 = describe_type(old_type);    struct pike_string *t2 = describe_type(CAR(n)->type);    yywarning("Soft cast to %s isn't a restriction of %s.",    t1->str, t2->str);    free_string(t2);    free_string(t1);    } -  +  /* FIXME: check_soft_cast() is weaker than pike_types_le() +  * The resulting type should probably be the and between the old +  * and the new type. +  */    }    /* FALL_THROUGH */    case F_CAST:    /* Type-field is correct by definition. */    copy_shared_string(n->type, old_type);    break;       case F_LAND:    case F_LOR:    if (!CAR(n) || CAR(n)->type == void_type_string) {