Branch: Tag:

2001-03-03

2001-03-03 00:24:40 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Now uses MAKE_CONSTANT_TYPE().

Rev: src/builtin_functions.c:1.348
Rev: src/constants.c:1.28
Rev: src/las.c:1.242
Rev: src/program.c:1.300

5:   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.241 2001/02/25 13:37:50 grubba Exp $"); + RCSID("$Id: las.c,v 1.242 2001/03/03 00:22:44 grubba Exp $");      #include "language.h"   #include "interpret.h"
3452:    /* Check the iterator type */    struct pike_type *iterator_type;    struct pike_type *foreach_call_type; -  MAKE_CONSTANT_SHARED_STRING(iterator_type, +  MAKE_CONSTANT_TYPE(iterator_type,    tOr5(tArray, tStr, tObj,    tMapping, tMultiset));    if (!pike_types_le(CAAR(n)->type, iterator_type)) {
3484:    /* Check the index type */    struct pike_type *index_fun_type;    struct pike_type *index_type; -  MAKE_CONSTANT_SHARED_STRING(index_fun_type, +  MAKE_CONSTANT_TYPE(index_fun_type,    tOr4(tFunc(tOr(tArray, tStr), tZero),    tFunc(tMap(tSetvar(0, tMix),    tMix), tVar(0)),
3513:    /* Check the value type */    struct pike_type *value_fun_type;    struct pike_type *value_type; -  MAKE_CONSTANT_SHARED_STRING(value_fun_type, +  MAKE_CONSTANT_TYPE(value_fun_type,    tOr5(tFunc(tArr(tSetvar(0, tMix)),    tVar(0)),    tFunc(tStr, tZero),
3543:    } else {    /* Old-style foreach */    struct pike_type *array_zero; -  MAKE_CONSTANT_SHARED_STRING(array_zero, tArr(tZero)); +  MAKE_CONSTANT_TYPE(array_zero, tArr(tZero));       if (!pike_types_le(array_zero, CAAR(n)->type)) {    yyerror("Bad argument 1 to foreach().");
3606:    }    }    /* FIXME: */ -  MAKE_CONSTANT_SHARED_STRING(n->type, tIntPos); +  MAKE_CONSTANT_TYPE(n->type, tIntPos);    break;       case F_UNDEFINED:
3647:    case F_MAGIC_INDEX:    /* FIXME: Could have a stricter type for ::`->(). */    /* FIXME: */ -  MAKE_CONSTANT_SHARED_STRING(n->type, tFunc(tMix,tMix)); +  MAKE_CONSTANT_TYPE(n->type, tFunc(tMix,tMix));    break;    case F_MAGIC_SET_INDEX:    /* FIXME: Could have a stricter type for ::`->=(). */    /* FIXME: */ -  MAKE_CONSTANT_SHARED_STRING(n->type, tFunc(tMix tSetvar(0,tMix), tVar(0))); +  MAKE_CONSTANT_TYPE(n->type, tFunc(tMix tSetvar(0,tMix), tVar(0)));    break;       case F_CATCH:
4004: Inside #if defined(SHARED_NODES) && !defined(IN_TPIKE)
   if (!(usage[CDR(n)->u.integer.a] & 1)) {    /* Value isn't used. */    struct pike_type *ref_type; -  MAKE_CONSTANT_SHARED_STRING(ref_type, tOr(tComplex, tString)); +  MAKE_CONSTANT_TYPE(ref_type, tOr(tComplex, tString));    if (!match_types(CDR(n)->type, ref_type)) {    /* The variable doesn't hold a refcounted value. */    free_type(ref_type);