pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: pike_types.c,v 1.182 2001/10/05 01:30:13 hubbe Exp $"); + RCSID("$Id: pike_types.c,v 1.183 2001/12/10 02:08:16 mast Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"   #include "stralloc.h"   #include "stuff.h"   #include "array.h"   #include "program.h"   #include "constants.h"   #include "object.h"   #include "multiset.h"
pike.git/src/pike_types.c:3938:    p=s->u.object->prog;    if(!p)    {    copy_pike_type(ret, zero_type_string);    }else{    copy_pike_type(ret, ID_FROM_INT(p,s->subtype)->type);    }    }    return ret;    -  case T_MULTISET: +     case T_ARRAY:    {    struct pike_type *arg_type; -  struct array *a; -  -  if (s->type == T_MULTISET) { -  a = s->u.multiset->ind; -  } else { -  a = s->u.array; -  } +  struct array *a = s->u.array;   #if 0    int i;       /* FIXME: Circular structures? */    copy_pike_type(arg_type, zero_type_string);    for (i = 0; i < a->size; i++) {    struct pike_type *tmp1 = get_type_of_svalue(a->item+i);    struct pike_type *tmp2 = or_pike_types(arg_type, tmp1, 1);    free_type(arg_type);    free_type(tmp1);
pike.git/src/pike_types.c:3974:    else    copy_pike_type(arg_type, zero_type_string);   #endif /* 0 */    type_stack_mark();    push_finished_type(arg_type);    free_type(arg_type);    push_type(s->type);    return pop_unfinished_type();    }    +  case T_MULTISET: +  type_stack_mark(); +  if (multiset_sizeof(s->u.multiset)) { +  push_type(T_MIXED); +  } +  else { +  push_type(T_ZERO); +  } +  push_type(T_MULTISET); +  return pop_unfinished_type();       case T_MAPPING:    type_stack_mark();    if (m_sizeof(s->u.mapping)) {    push_type(T_MIXED);    push_type(T_MIXED);    }    else {    push_type(T_ZERO);    push_type(T_ZERO);