Branch: Tag:

2001-02-19

2001-02-19 23:50:03 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Introduced struct pike_type in preparation for new implementation of type type.
Added copy_type() & free_type() for the same reason.
f_cast() now expects a value of type type as the first argument.

Rev: src/builtin_functions.c:1.342
Rev: src/constants.c:1.25
Rev: src/constants.h:1.16
Rev: src/docode.c:1.104
Rev: src/global.h:1.57
Rev: src/interpret.h:1.77
Rev: src/interpret_functions.h:1.45
Rev: src/language.yacc:1.224
Rev: src/las.c:1.234
Rev: src/las.h:1.47
Rev: src/opcodes.c:1.99
Rev: src/opcodes.h:1.12
Rev: src/pike_types.c:1.147
Rev: src/pike_types.h:1.48
Rev: src/program.c:1.295
Rev: src/program.h:1.116
Rev: src/svalue.h:1.76
Rev: src/treeopt.in:1.56

5:   \*/   /**/   #include "global.h" - RCSID("$Id: docode.c,v 1.103 2001/02/05 21:13:10 grubba Exp $"); + RCSID("$Id: docode.c,v 1.104 2001/02/19 23:49:59 grubba Exp $");   #include "las.h"   #include "program.h"   #include "pike_types.h"
163:   static INT32 current_switch_default;   static INT32 current_switch_values_on_stack;   static INT32 *current_switch_jumptable =0; - static struct pike_string *current_switch_type = NULL; + static struct pike_type *current_switch_type = NULL;      void upd_int(int offset, INT32 tmp)   {
1011:    DO_CODE_BLOCK(CAR(n));    return 0;    } -  tmp1=store_prog_string(n->type); -  emit1(F_STRING, DO_NOT_WARN((INT32)tmp1)); +  { +  struct svalue sv; +  sv.type = T_TYPE; +  sv.subtype = 0; +  sv.u.type = n->type; +  tmp1 = store_constant(&sv, 1, n->name); +  emit1(F_CONSTANT, DO_NOT_WARN((INT32)tmp1)); +  }       tmp1=do_docode(CAR(n),0);    if(!tmp1) { emit0(F_CONST0); tmp1=1; }
1023:       case F_SOFT_CAST:    if (runtime_options & RUNTIME_CHECK_TYPES) { -  tmp1 = store_prog_string(n->type); -  emit1(F_STRING, DO_NOT_WARN((INT32)tmp1)); +  { +  struct svalue sv; +  sv.type = T_TYPE; +  sv.subtype = 0; +  sv.u.type = n->type; +  tmp1 = store_constant(&sv, 1, n->name); +  emit1(F_CONSTANT, DO_NOT_WARN((INT32)tmp1)); +  }    tmp1 = do_docode(CAR(n), 0);    if (!tmp1) { emit0(F_CONST0); tmp1 = 1; }    if (tmp1 > 1) do_pop(DO_NOT_WARN((INT32)(tmp1 - 1)));