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

1:   /* -  * $Id: interpret_functions.h,v 1.44 2001/02/05 21:13:10 grubba Exp $ +  * $Id: interpret_functions.h,v 1.45 2001/02/19 23:49:59 grubba Exp $    *    * Opcode definitions for the interpreter.    */
1401:    }   #endif /* PIKE_DEBUG */    if (runtime_options & RUNTIME_CHECK_TYPES) { -  struct pike_string *sval_type = get_type_of_svalue(Pike_sp-1); -  if (!pike_types_le(sval_type, Pike_sp[-2].u.string)) { +  struct pike_type *sval_type = get_type_of_svalue(Pike_sp-1); +  if (!pike_types_le(sval_type, Pike_sp[-2].u.type)) {    /* get_type_from_svalue() doesn't return a fully specified type    * for array, mapping and multiset, so we perform a more lenient    * check for them.
1430:    t2 = describe_type(sval_type);    SET_ONERROR(tmp2, do_free_string, t2);    -  free_string(sval_type); +  free_type(sval_type);       bad_arg_error(NULL, Pike_sp-1, 1, 1, t1->str, Pike_sp-1,    "%s(): Soft cast failed. Expected %s, got %s\n",
1442:    free_string(t1);    }    } -  free_string(sval_type); +  free_type(sval_type);   #ifdef PIKE_DEBUG    if (d_flag > 2) { -  struct pike_string *t = describe_type(Pike_sp[-2].u.string); +  struct pike_string *t = describe_type(Pike_sp[-2].u.type);    fprintf(stderr, "Soft cast to %s\n", t->str);    free_string(t);    }