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

26:   #include "bignum.h"   #include "operators.h"    - RCSID("$Id: opcodes.c,v 1.98 2001/01/31 15:11:28 grubba Exp $"); + RCSID("$Id: opcodes.c,v 1.99 2001/02/19 23:50:01 grubba Exp $");      void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)   {
132:    sp++;   }    - void o_cast(struct pike_string *type, INT32 run_time_type) + void o_cast(struct pike_type *type, INT32 run_time_type)   {    INT32 i;   
492:    {    case T_ARRAY:    { -  struct pike_string *itype; +  struct pike_type *itype;    INT32 run_time_itype;    -  push_string(itype=index_type(type,int_type_string,0)); +  push_type_value(itype = index_type(type, int_type_string, 0));    run_time_itype=compile_type_to_runtime_type(itype);       if(run_time_itype != T_MIXED)
537:       case T_MULTISET:    { -  struct pike_string *itype; +  struct pike_type *itype;    INT32 run_time_itype;    -  push_string(itype=key_type(type,0)); +  push_type_value(itype = key_type(type, 0));    run_time_itype=compile_type_to_runtime_type(itype);       if(run_time_itype != T_MIXED)
585:       case T_MAPPING:    { -  struct pike_string *itype,*vtype; +  struct pike_type *itype, *vtype;    INT32 run_time_itype;    INT32 run_time_vtype;    -  push_string(itype=key_type(type,0)); +  push_type_value(itype = key_type(type, 0));    run_time_itype=compile_type_to_runtime_type(itype);    -  push_string(vtype=index_type(type,mixed_type_string,0)); +  push_type_value(vtype = index_type(type, mixed_type_string, 0));    run_time_vtype=compile_type_to_runtime_type(vtype);       if(run_time_itype != T_MIXED ||
643: Inside #if defined(PIKE_DEBUG)
  {   #ifdef PIKE_DEBUG    struct svalue *save_sp=sp; -  if(sp[-2].type != T_STRING) +  if(sp[-2].type != T_TYPE)    fatal("Cast expression destroyed stack or left droppings!\n");   #endif -  o_cast(sp[-2].u.string, +  o_cast(sp[-2].u.type,    compile_type_to_runtime_type(sp[-2].u.string));   #ifdef PIKE_DEBUG    if(save_sp != sp)