diff --git a/src/docode.c b/src/docode.c index d3ca9376c60818a0b95648037e357ac00c6172af..28c9ad1f02d88a9793fc2e7f3161b32beb6d713d 100644 --- a/src/docode.c +++ b/src/docode.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: docode.c,v 1.104 2001/02/19 23:49:59 grubba Exp $"); +RCSID("$Id: docode.c,v 1.105 2001/02/21 18:25:24 grubba Exp $"); #include "las.h" #include "program.h" #include "pike_types.h" @@ -1162,7 +1162,7 @@ static int do_docode2(node *n, INT16 flags) INT32 prev_switch_case = current_switch_case; INT32 prev_switch_default = current_switch_default; INT32 *prev_switch_jumptable = current_switch_jumptable; - struct pike_string *prev_switch_type = current_switch_type; + struct pike_type *prev_switch_type = current_switch_type; #ifdef PIKE_DEBUG struct svalue *save_sp=Pike_sp; #endif diff --git a/src/las.c b/src/las.c index 44109eb983523a172c7998b44fecad958b134dd6..a978420a937fbec57f4bb9025e153316eff35846 100644 --- a/src/las.c +++ b/src/las.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: las.c,v 1.234 2001/02/19 23:50:00 grubba Exp $"); +RCSID("$Id: las.c,v 1.235 2001/02/21 18:25:24 grubba Exp $"); #include "language.h" #include "interpret.h" @@ -478,12 +478,12 @@ static node *freeze_node(node *orig) if (n->type) { /* Use the new type if it's stricter. */ if (pike_types_le(orig->type, n->type)) { - free_string(n->type); - copy_shared_string(n->type, orig->type); + free_type(n->type); + copy_type(n->type, orig->type); } } else { /* This probably doesn't happen, but... */ - copy_shared_string(n->type, orig->type); + copy_type(n->type, orig->type); } } if (!found) { @@ -733,7 +733,7 @@ void debug_free_node(node *n) n = n->parent; - if(dead->type) free_string(dead->type); + if(dead->type) free_type(dead->type); if(dead->name) free_string(dead->name); #ifdef PIKE_DEBUG if(dead->current_file) free_string(dead->current_file); @@ -752,7 +752,7 @@ void debug_free_node(node *n) #endif /* SHARED_NODES && PIKE_DEBUG */ n = n->parent; - if(dead->type) free_string(dead->type); + if(dead->type) free_type(dead->type); if(dead->name) free_string(dead->name); #ifdef PIKE_DEBUG if(dead->current_file) free_string(dead->current_file); @@ -783,7 +783,7 @@ void debug_free_node(node *n) } #endif /* SHARE_NODES && PIKE_DEBUG */ - if(n->type) free_string(n->type); + if(n->type) free_type(n->type); if(n->name) free_string(n->name); #ifdef PIKE_DEBUG if(n->current_file) free_string(n->current_file); @@ -1258,7 +1258,7 @@ node *debug_mkexternalnode(struct program *parent_prog, int i) #ifdef PIKE_DEBUG if(d_flag) { - check_string(id->type); + check_type_string(id->type); check_string(id->name); } #endif @@ -1832,9 +1832,9 @@ node *copy_node(node *n) case F_IDENTIFIER: case F_TRAMPOLINE: b=mknewintnode(0); - if(b->type) free_string(b->type); + if(b->type) free_type(b->type); *b=*n; - copy_shared_string(b->type, n->type); + copy_type(b->type, n->type); return b; default: @@ -3426,7 +3426,7 @@ void fix_type_field(node *n) break; case F_UNDEFINED: - MAKE_CONSTANT_SHARED_STRING(n->type, tZero); + copy_type(n->type, zero_type_string); break; case F_ARG_LIST: @@ -4623,8 +4623,8 @@ static node *eval(node *n) if (n->type && (!new->type || ((n->type != new->type) && pike_types_le(n->type,new->type)))) { if (new->type) - free_string(new->type); - copy_shared_string(new->type,n->type); + free_type(new->type); + copy_type(new->type, n->type); } } free_node(n); diff --git a/src/opcodes.c b/src/opcodes.c index 6c4b47fb1efc79e7f504bb683935aa8677f3e42f..8aedf1c7376a5fa88e4af1e2a08553d673bddddc 100644 --- a/src/opcodes.c +++ b/src/opcodes.c @@ -26,7 +26,7 @@ #include "bignum.h" #include "operators.h" -RCSID("$Id: opcodes.c,v 1.100 2001/02/20 13:02:11 grubba Exp $"); +RCSID("$Id: opcodes.c,v 1.101 2001/02/21 18:25:25 grubba Exp $"); void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind) { @@ -648,7 +648,7 @@ PMOD_EXPORT void f_cast(void) sp[-2].type); #endif o_cast(sp[-2].u.type, - compile_type_to_runtime_type(sp[-2].u.string)); + compile_type_to_runtime_type(sp[-2].u.type)); #ifdef PIKE_DEBUG if(save_sp != sp) fatal("Internal error: o_cast() left droppings on stack.\n"); diff --git a/src/operators.c b/src/operators.c index ceec25d77a50ea15cbd1379cc6b5ef6e173a422b..8eb12bb910f26062d7cfe7eb02cce33a611c61e6 100644 --- a/src/operators.c +++ b/src/operators.c @@ -6,7 +6,7 @@ /**/ #include "global.h" #include <math.h> -RCSID("$Id: operators.c,v 1.125 2001/02/20 15:59:49 grubba Exp $"); +RCSID("$Id: operators.c,v 1.126 2001/02/21 18:25:25 grubba Exp $"); #include "interpret.h" #include "svalue.h" #include "multiset.h" @@ -1093,7 +1093,7 @@ PMOD_EXPORT void o_and(void) type_stack_mark(); push_object_type(0, p->id); free_svalue(sp - 2); - sp[-2].u.string = pop_unfinished_type(); + sp[-2].u.type = pop_unfinished_type(); sp[-2].type = T_TYPE; } if (sp[-1].type != T_TYPE) @@ -1107,7 +1107,7 @@ PMOD_EXPORT void o_and(void) type_stack_mark(); push_object_type(0, p->id); free_svalue(sp - 1); - sp[-1].u.string = pop_unfinished_type(); + sp[-1].u.type = pop_unfinished_type(); sp[-1].type = T_TYPE; } } @@ -1184,11 +1184,10 @@ PMOD_EXPORT void o_and(void) case T_TYPE: { - struct pike_string *t; - t = and_pike_types(sp[-2].u.string, sp[-1].u.string); + struct pike_type *t; + t = and_pike_types(sp[-2].u.type, sp[-1].u.type); pop_n_elems(2); - push_string(t); - sp[-1].type = T_TYPE; + push_type_value(t); return; } @@ -1196,9 +1195,9 @@ PMOD_EXPORT void o_and(void) case T_PROGRAM: { struct program *p; - struct pike_string *a; - struct pike_string *b; - struct pike_string *t; + struct pike_type *a; + struct pike_type *b; + struct pike_type *t; p = program_from_svalue(sp - 2); if (!p) { @@ -1221,10 +1220,9 @@ PMOD_EXPORT void o_and(void) t = and_pike_types(a, b); pop_n_elems(2); - push_string(t); - sp[-1].type = T_TYPE; - free_string(a); - free_string(b); + push_type_value(t); + free_type(a); + free_type(b); return; } @@ -1432,7 +1430,7 @@ PMOD_EXPORT void o_or(void) type_stack_mark(); push_object_type(0, p->id); free_svalue(sp - 2); - sp[-2].u.string = pop_unfinished_type(); + sp[-2].u.type = pop_unfinished_type(); sp[-2].type = T_TYPE; } if (sp[-1].type != T_TYPE) { @@ -1444,7 +1442,7 @@ PMOD_EXPORT void o_or(void) type_stack_mark(); push_object_type(0, p->id); free_svalue(sp - 1); - sp[-1].u.string = pop_unfinished_type(); + sp[-1].u.type = pop_unfinished_type(); sp[-1].type = T_TYPE; } } else { @@ -1493,11 +1491,10 @@ PMOD_EXPORT void o_or(void) case T_TYPE: { - struct pike_string *t; - t = or_pike_types(sp[-2].u.string, sp[-1].u.string, 0); + struct pike_type *t; + t = or_pike_types(sp[-2].u.type, sp[-1].u.type, 0); pop_n_elems(2); - push_string(t); - sp[-1].type = T_TYPE; + push_type_value(t); return; } @@ -1505,9 +1502,9 @@ PMOD_EXPORT void o_or(void) case T_PROGRAM: { struct program *p; - struct pike_string *a; - struct pike_string *b; - struct pike_string *t; + struct pike_type *a; + struct pike_type *b; + struct pike_type *t; p = program_from_svalue(sp - 2); if (!p) { @@ -1530,10 +1527,9 @@ PMOD_EXPORT void o_or(void) t = or_pike_types(a, b, 0); pop_n_elems(2); - push_string(t); - sp[-1].type = T_TYPE; - free_string(a); - free_string(b); + push_type_value(t); + free_type(a); + free_type(b); return; } @@ -1642,7 +1638,7 @@ PMOD_EXPORT void o_xor(void) type_stack_mark(); push_object_type(0, p->id); free_svalue(sp - 2); - sp[-2].u.string = pop_unfinished_type(); + sp[-2].u.type = pop_unfinished_type(); sp[-2].type = T_TYPE; } if (sp[-1].type != T_TYPE) { @@ -1654,7 +1650,7 @@ PMOD_EXPORT void o_xor(void) type_stack_mark(); push_object_type(0, p->id); free_svalue(sp - 1); - sp[-1].u.string = pop_unfinished_type(); + sp[-1].u.type = pop_unfinished_type(); sp[-1].type = T_TYPE; } } else { @@ -1714,8 +1710,7 @@ PMOD_EXPORT void o_xor(void) type_stack_mark(); push_object_type(0, p->id); pop_stack(); - push_string(pop_unfinished_type()); - sp[-1].type = T_TYPE; + push_type_value(pop_unfinished_type()); stack_swap(); @@ -1728,24 +1723,21 @@ PMOD_EXPORT void o_xor(void) type_stack_mark(); push_object_type(0, p->id); pop_stack(); - push_string(pop_unfinished_type()); - sp[-1].type = T_TYPE; + push_type_value(pop_unfinished_type()); } /* FALL_THROUGH */ case T_TYPE: { /* a ^ b == (a&~b)|(~a&b) */ - struct pike_string *a; - struct pike_string *b; - copy_shared_string(a, sp[-2].u.string); - copy_shared_string(b, sp[-1].u.string); + struct pike_type *a; + struct pike_type *b; + copy_type(a, sp[-2].u.type); + copy_type(b, sp[-1].u.type); o_compl(); /* ~b */ o_and(); /* a&~b */ - push_string(a); - sp[-1].type = T_TYPE; + push_type_value(a); o_compl(); /* ~a */ - push_string(b); - sp[-1].type = T_TYPE; + push_type_value(b); o_and(); /* ~a&b */ o_or(); /* (a&~b)|(~a&b) */ return; @@ -2835,8 +2827,7 @@ PMOD_EXPORT void o_compl(void) push_type(T_NOT); } pop_stack(); - push_string(pop_unfinished_type()); - sp[-1].type = T_TYPE; + push_type_value(pop_unfinished_type()); break; case T_FUNCTION: @@ -2851,8 +2842,7 @@ PMOD_EXPORT void o_compl(void) push_object_type(0, p->id); push_type(T_NOT); pop_stack(); - push_string(pop_unfinished_type()); - sp[-1].type = T_TYPE; + push_type_value(pop_unfinished_type()); } break;