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: builtin_functions.c,v 1.341 2001/02/06 23:48:23 nilsson Exp $"); + RCSID("$Id: builtin_functions.c,v 1.342 2001/02/19 23:49:57 grubba Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"
2067:      node *fix_this_object_type(node *n)   { -  free_string(n->type); +  free_type(n->type);    type_stack_mark();    push_type_int(Pike_compiler->new_program->id);    /* push_type(1); We are rather sure that we contain ourselves... */
2401:    (t2=check_call(function_type_string , ID_FROM_INT(p, fun)->type,    0)))    { -  free_string(n->type); +  free_type(n->type);    n->type=t2;    return 0;    }
2417: Inside #if 1
   t2=make_shared_binary_string(deftype, deftypelen);    t=n->type;    n->type=or_pike_types(t,t2,0); -  free_string(t); -  free_string(t2); +  free_type(t); +  free_type(t2);    }   #endif    }
2438:      static node *fix_aggregate_mapping_type(node *n)   { -  struct pike_string *types[2] = { NULL, NULL }; +  struct pike_type *types[2] = { NULL, NULL };    node *args = CDR(n); -  struct pike_string *new_type = NULL; +  struct pike_type *new_type = NULL;      #ifdef PIKE_DEBUG    if (l_flag > 2) {
2512:    do {    if (types[argno]) {    struct pike_string *t = or_pike_types(types[argno], arg->type, 0); -  free_string(types[argno]); +  free_type(types[argno]);    types[argno] = t;   #ifdef PIKE_DEBUG    if (l_flag > 4) {
2542:    }       type_stack_mark(); -  push_unfinished_type(types[1]->str); -  push_unfinished_type(types[0]->str); +  push_finished_type(types[1]); +  push_finished_type(types[0]);    push_type(T_MAPPING);    new_type = pop_unfinished_type();    } else {
2552:    }    if (new_type) {    set_type: -  free_string(n->type); +  free_type(n->type);    n->type = new_type;      #ifdef PIKE_DEBUG
2572:    args->parent = n;    }    if (types[1]) { -  free_string(types[1]); +  free_type(types[1]);    }    if (types[0]) { -  free_string(types[0]); +  free_type(types[0]);    }    return NULL;   }
2768:    /* Perform the actual conversion. */    new_type = object_type_to_program_type(nn->type);    if (new_type) { -  free_string(n->type); +  free_type(n->type);    n->type = new_type;    }    return NULL;