Branch: Tag:

2001-02-20

2001-02-20 00:08:19 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Some more struct pike_type fixes.

Rev: src/builtin_functions.c:1.343

5:   \*/   /**/   #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.342 2001/02/19 23:49:57 grubba Exp $"); + RCSID("$Id: builtin_functions.c,v 1.343 2001/02/20 00:08:19 grubba Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"
2378:      /* this should probably be moved to pike_constants.c or something */   #define FIX_OVERLOADED_TYPE(n, lf, X) fix_overloaded_type(n,lf,X,CONSTANT_STRLEN(X)) + /* FIXME: This function messes around with the implementation of pike_type, +  * and should probably be in pike_types.h instead. +  */   static node *fix_overloaded_type(node *n, int lfun, const char *deftype, int deftypelen)   {    node **first_arg; -  struct pike_string *t,*t2; +  struct pike_type *t, *t2;    first_arg=my_get_arg(&_CDR(n), 0);    if(!first_arg) return 0;    t=first_arg[0]->type;
2511:   #endif /* PIKE_DEBUG */    do {    if (types[argno]) { -  struct pike_string *t = or_pike_types(types[argno], arg->type, 0); +  struct pike_type *t = or_pike_types(types[argno], arg->type, 0);    free_type(types[argno]);    types[argno] = t;   #ifdef PIKE_DEBUG
2756:    * object_program(object(is|implements foo))    */    node *nn; -  struct pike_string *new_type = NULL; +  struct pike_type *new_type = NULL;       if (!n->type) { -  copy_shared_string(n->type, program_type_string); +  copy_type(n->type, program_type_string);    }    if (!(nn = CDR(n))) return NULL;    if ((nn->token == F_ARG_LIST) && (!(nn = CAR(nn)))) return NULL;
5651:    */   PMOD_EXPORT void f__typeof(INT32 args)   { -  struct pike_string *s; +  struct pike_string *t;    if(!args)    SIMPLE_TOO_FEW_ARGS_ERROR("_typeof", 1);    -  s = get_type_of_svalue(Pike_sp-args); +  t = get_type_of_svalue(Pike_sp-args);       pop_n_elems(args); -  push_string(s); -  Pike_sp[-1].type = T_TYPE; +  push_type_value(t);   }      /*! @decl void replace_master(object o)