pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:133:    else {    ref_push_object (m);    ref_push_string (codec_name);    o_index();    if (UNSAFE_IS_ZERO (Pike_sp - 1)) {    add_ref (m);    return m;    }    else {    apply_svalue (Pike_sp - 1, 0); -  if (Pike_sp[-1].type != T_OBJECT) +  if (TYPEOF(Pike_sp[-1]) != T_OBJECT)    Pike_error ("master()->%s() did not return an object. Got: %O\n",    codec_name->str, Pike_sp - 1);    m = (--Pike_sp)->u.object;    pop_stack();    return m;    }    }   }      struct encode_data
pike.git/src/encode.c:332:    default:    Pike_fatal("error in type tree: %d.\n", t->type);    /*NOTREACHED*/       break;       case PIKE_T_ATTRIBUTE: /* FIXME: Strip this in compat mode. */    case PIKE_T_NAME:    {    struct svalue sval; -  sval.type = PIKE_T_STRING; -  sval.subtype = 0; -  sval.u.string = (void *)t->car; -  +  SET_SVAL(sval, PIKE_T_STRING, 0, string, (void *)t->car);    encode_value2(&sval, data, 0);    }    t=t->cdr;    goto one_more_type;       case T_ASSIGN:    {    ptrdiff_t marker = CAR_TO_INT(t);    if ((marker < 0) || (marker > 9)) {    Pike_fatal("Bad assign marker: %ld\n",
pike.git/src/encode.c:514:   #ifdef PIKE_DEBUG   #undef encode_value2   #define encode_value2(X,Y,Z) do { \    struct svalue *_=Pike_sp; \    struct svalue *X_ = (X); \    encode_value2_(X_,Y,Z); \    if(Pike_sp != _) { \    fprintf(stderr, "Stack error when encoding:\n"); \    print_svalue(stderr, X_); \    fprintf(stderr, "\n"); \ -  if (X_->type == T_PROGRAM) { \ +  if (TYPEOF(*X_) == T_PROGRAM) { \    dump_program_tables(X_->u.program, 2); \    } \    Pike_fatal("encode_value2() failed %p != %p!\n", \    Pike_sp, _); \    } \    } while(0)   #endif      {    static struct svalue dested = SVALUE_INIT (T_INT, NUMBER_DESTRUCTED, 0);    INT32 i;    struct svalue *tmp;    struct svalue entry_id;      #ifdef ENCODE_DEBUG    data->depth += 2;   #endif    -  if((val->type == T_OBJECT || -  (val->type==T_FUNCTION && val->subtype!=FUNCTION_BUILTIN)) && +  if((TYPEOF(*val) == T_OBJECT || +  (TYPEOF(*val) == T_FUNCTION && SUBTYPEOF(*val) != FUNCTION_BUILTIN)) &&    !val->u.object->prog)    val = &dested;       if((tmp=low_mapping_lookup(data->encoded, val)))    {    entry_id = *tmp; /* It's always a small integer. */    if (entry_id.u.integer < COUNTER_START)    entry_id.u.integer = CONVERT_ENTRY_ID (entry_id.u.integer);    if (force_encode && tmp->u.integer < COUNTER_START) {    EDB(1,    fprintf(stderr, "%*sEncoding delayed thing to <%d>: ",    data->depth, "", entry_id.u.integer);    if(data->debug == 1)    { -  fprintf(stderr,"TAG%d",val->type); +  fprintf(stderr,"TAG%d", TYPEOF(*val));    }else{    print_svalue(stderr, val);       }    fputc('\n', stderr););    code_entry (TAG_DELAYED, entry_id.u.integer, data);    tmp->u.integer = entry_id.u.integer;    }    else {    EDB(1,fprintf(stderr, "%*sEncoding TAG_AGAIN from <%d>\n",    data->depth, "", entry_id.u.integer));    code_entry(TAG_AGAIN, entry_id.u.integer, data);    goto encode_done;    }    }else {   #ifdef PIKE_DEBUG    if (force_encode == 2)    Pike_fatal ("Didn't find old entry for delay encoded thing.\n");   #endif -  if (val->type != T_TYPE) { +  if (TYPEOF(*val) != T_TYPE) {    entry_id = data->counter; /* It's always a small integer. */    EDB(1,fprintf(stderr, "%*sEncoding to <%d>: ",    data->depth, "", entry_id.u.integer);    if(data->debug == 1)    { -  fprintf(stderr,"TAG%d",val->type); +  fprintf(stderr,"TAG%d", TYPEOF(*val));    }else{    print_svalue(stderr, val);    }    fputc('\n', stderr););    mapping_insert(data->encoded, val, &entry_id);    data->counter.u.integer++;    }    }    -  switch(val->type) +  switch(TYPEOF(*val))    {    case T_INT:    /* NOTE: Doesn't encode NUMBER_UNDEFINED et al. */    /* But that's a feature; NUMBER_UNDEFINED is an inherently    * transient value. It would lose its usefulness otherwise.    * /mast */      #if SIZEOF_INT_TYPE > 4    {    INT_TYPE i=val->u.integer;
pike.git/src/encode.c:837:    encode_value2(ITEM(Pike_sp[-2].u.array)+i, data, 0); /* indices */    encode_value2(ITEM(Pike_sp[-1].u.array)+i, data, 0); /* values */    }    pop_n_elems(2);    /* FIXME: What about flags? */    break;       case T_MULTISET: {    struct multiset *l = val->u.multiset;    -  if (multiset_indval (l) || multiset_get_cmp_less (l)->type != T_INT) +  if (multiset_indval (l) || +  TYPEOF(*multiset_get_cmp_less(l)) != T_INT)    Pike_error ("FIXME: Encoding of multisets with values and/or "    "custom sort function not yet implemented.\n");    else {    /* Encode valueless multisets without compare functions in a    * compatible way. */    code_entry(TAG_MULTISET, multiset_sizeof (l), data);    if (data->canonic) {    INT32 *order;    if (multiset_ind_types(l) & ~(BIT_BASIC & ~BIT_TYPE)) {    multiset_fix_type_field(l);
pike.git/src/encode.c:888: Inside #if defined(AUTO_BIGNUM)
   * but that will have to wait until next time. /Hubbe    */    if(is_bignum_object(val->u.object))    {    code_entry(TAG_OBJECT, 2, data);    /* 256 would be better, but then negative numbers    * won't work... /Hubbe    */    push_int(36);    apply(val->u.object,"digits",1); -  if(Pike_sp[-1].type != T_STRING) +  if(TYPEOF(Pike_sp[-1]) != T_STRING)    Pike_error("Gmp.mpz->digits did not return a string!\n");    encode_value2(Pike_sp-1, data, 0);    pop_stack();    break;    }   #endif       if (data->canonic)    Pike_error("Canonical encoding of objects not supported.\n");    push_svalue(val);    apply(encoder_codec (data), "nameof", 1);    EDB(5, fprintf(stderr, "%*s->nameof: ", data->depth, "");    print_svalue(stderr, Pike_sp-1);    fputc('\n', stderr);); -  switch(Pike_sp[-1].type) +  switch(TYPEOF(Pike_sp[-1]))    {    case T_INT: -  if(Pike_sp[-1].subtype == NUMBER_UNDEFINED) +  if(SUBTYPEOF(Pike_sp[-1]) == NUMBER_UNDEFINED)    {    int to_change = data->buf.s.len;    struct svalue tmp = entry_id;       EDB(5,fprintf(stderr, "%*s(UNDEFINED)\n", data->depth, ""));    -  if (val->subtype) { +  if (SUBTYPEOF(*val)) {    /* Subtyped object.    *    * Encode the subtype, and then try encoding the plain object.    */    code_entry(TAG_OBJECT, 4, data); -  code_number(val->subtype, data); +  code_number(SUBTYPEOF(*val), data);    pop_stack();    ref_push_object(val->u.object);    break;    }       /* We have to remove ourself from the cache */    map_delete(data->encoded, val);       pop_stack();    push_svalue(val);
pike.git/src/encode.c:984:    pop_stack();    break;       case T_FUNCTION:    /* FIXME: Ought to have special treatment of trampolines. */    if (data->canonic)    Pike_error("Canonical encoding of functions not supported.\n");    check_stack(1);    push_svalue(val);    apply(encoder_codec (data),"nameof", 1); -  if(Pike_sp[-1].type == T_INT && Pike_sp[-1].subtype==NUMBER_UNDEFINED) +  if(TYPEOF(Pike_sp[-1]) == T_INT && +  SUBTYPEOF(Pike_sp[-1]) == NUMBER_UNDEFINED)    { -  if(val->subtype != FUNCTION_BUILTIN) +  if(SUBTYPEOF(*val) != FUNCTION_BUILTIN)    {    if(really_low_find_shared_string_identifier( -  ID_FROM_INT(val->u.object->prog, val->subtype)->name, +  ID_FROM_INT(val->u.object->prog, SUBTYPEOF(*val))->name,    val->u.object->prog, -  SEE_PROTECTED|SEE_PRIVATE)==val->subtype) +  SEE_PROTECTED|SEE_PRIVATE) == SUBTYPEOF(*val))    {    /* We have to remove ourself from the cache for now */    struct svalue tmp = entry_id;    map_delete(data->encoded, val);       code_entry(TAG_FUNCTION, 1, data); -  push_svalue(val); -  Pike_sp[-1].type = T_OBJECT; -  Pike_sp[-1].subtype = 0; +  ref_push_object(val->u.object);    encode_value2(Pike_sp-1, data, 0); -  ref_push_string(ID_FROM_INT(val->u.object->prog, val->subtype)->name); +  ref_push_string(ID_FROM_INT(val->u.object->prog, +  SUBTYPEOF(*val))->name);    encode_value2(Pike_sp-1, data, 0);    pop_n_elems(3);       /* Put value back in cache */    mapping_insert(data->encoded, val, &tmp);    goto encode_done;    }    else {    /* FIXME: Encode the object, the inherit and the name. */    Pike_error("Cannot encode overloaded functions (yet).\n");
pike.git/src/encode.c:1041:    pop_stack();    break;    }    if (data->canonic)    Pike_error("Canonical encoding of programs not supported.\n");    if (!(val->u.program->flags & PROGRAM_FIXED))    Pike_error("Encoding of unfixated programs not supported.\n");    check_stack(1);    push_svalue(val);    apply(encoder_codec (data),"nameof", 1); -  if(Pike_sp[-1].type == val->type) +  if(TYPEOF(Pike_sp[-1]) == TYPEOF(*val))    Pike_error("Error in master()->nameof(), same type returned.\n"); -  if(Pike_sp[-1].type == T_INT && Pike_sp[-1].subtype == NUMBER_UNDEFINED) +  if(TYPEOF(Pike_sp[-1]) == T_INT && +  SUBTYPEOF(Pike_sp[-1]) == NUMBER_UNDEFINED)    {    struct program *p=val->u.program;    debug_malloc_touch(p);    pop_stack();    if( (p->flags & PROGRAM_HAS_C_METHODS) || p->event_handler )    {    if(p->parent)    {    /* We have to remove ourselves from the cache for now */    struct svalue tmp = entry_id;    map_delete(data->encoded, val);       code_entry(TAG_PROGRAM, 2, data);    ref_push_program(p->parent);    encode_value2(Pike_sp-1, data, 0);       ref_push_program(p);    f_function_name(1); -  if(Pike_sp[-1].type == PIKE_T_INT) +  if(TYPEOF(Pike_sp[-1]) == PIKE_T_INT)    Pike_error("Cannot encode C programs.\n");    encode_value2(Pike_sp-1, data, 0);       pop_n_elems(2);       /* Put value back in cache */    mapping_insert(data->encoded, val, &tmp);    goto encode_done;    }    if( p->event_handler )
pike.git/src/encode.c:1309:    code_number(p->relocations[d], data);    }       /* linenumbers */    adddata2(p->linenumbers, p->num_linenumbers);      #endif /* PIKE_PORTABLE_BYTECODE */       {    struct svalue str_sval; -  str_sval.type = T_STRING; -  str_sval.subtype = 0; +  SET_SVAL(str_sval, T_STRING, 0, string, NULL);    /* strings */    for(d=0;d<p->num_strings;d++) {    str_sval.u.string = p->strings[d];    encode_value2(&str_sval, data, 0);    }    }       EDB(5, dump_program_tables(p, data->depth));      #ifdef PIKE_PORTABLE_BYTECODE    /* Encode the efun constants since they are needed by the optimizer. */    {    struct svalue str_sval; -  str_sval.type = T_STRING; -  str_sval.subtype = 0; +  SET_SVAL(str_sval, T_STRING, 0, string, NULL);       /* constants */    for(d=0;d<p->num_constants;d++)    { -  if ((p->constants[d].sval.type == T_FUNCTION) && -  (p->constants[d].sval.subtype == FUNCTION_BUILTIN)) { +  if ((TYPEOF(p->constants[d].sval) == T_FUNCTION) && +  (SUBTYPEOF(p->constants[d].sval) == FUNCTION_BUILTIN)) {    code_number(ID_ENTRY_EFUN_CONSTANT, data); -  } else if (p->constants[d].sval.type == T_TYPE) { +  } else if (TYPEOF(p->constants[d].sval) == T_TYPE) {    code_number(ID_ENTRY_TYPE_CONSTANT, data);    } else {    continue;    }    code_number(d, data);    /* value */    encode_value2(&p->constants[d].sval, data, 0);       /* name */   #if 0
pike.git/src/encode.c:1366: Inside #if defined(PIKE_PORTABLE_BYTECODE)
   }    }   #endif /* PIKE_PORTABLE_BYTECODE */    /* Dump the identifiers in a portable manner... */    {    int inherit_num = 1;    struct svalue str_sval;    char *id_dumped = (char *) alloca(p->num_identifiers);    int d_min = 0;    MEMSET(id_dumped,0,p->num_identifiers); -  str_sval.type = T_STRING; -  str_sval.subtype = 0; +  SET_SVAL(str_sval, T_STRING, 0, string, NULL);       EDB(2,    fprintf(stderr, "%*sencode: encoding references\n",    data->depth, ""));      #ifdef ENCODE_DEBUG    data->depth += 2;   #endif       /* NOTE: d is incremented by hand inside the loop. */
pike.git/src/encode.c:1817:    code_number(ID_ENTRY_EOT, data);      #ifdef ENCODE_DEBUG    data->depth -= 2;   #endif    }       /* Encode the constant values table. */    {    struct svalue str_sval; -  str_sval.type = T_STRING; -  str_sval.subtype = 0; +  SET_SVAL(str_sval, T_STRING, 0, string, NULL);       /* constants */    for(d=0;d<p->num_constants;d++)    {   #ifdef PIKE_PORTABLE_BYTECODE -  if (((p->constants[d].sval.type == T_FUNCTION) && -  (p->constants[d].sval.subtype == FUNCTION_BUILTIN)) || -  (p->constants[d].sval.type == T_TYPE)) { +  if (((TYPEOF(p->constants[d].sval) == T_FUNCTION) && +  (SUBTYPEOF(p->constants[d].sval) == FUNCTION_BUILTIN)) || +  (TYPEOF(p->constants[d].sval) == T_TYPE)) {    /* Already encoded above. */    continue;    }   #endif /* PIKE_PORTABLE_BYTECODE */    /* value */    encode_value2(&p->constants[d].sval, data, 0);       /* name */   #if 0    if (p->constants[d].name) {
pike.git/src/encode.c:1935: Inside #if defined(ENCODE_DEBUG)
   * prototype, to keep the argument position free for    * other uses in the future. */    BIT_VOID | BIT_INT,   #endif    0);       initialize_buf(&data->buf);    data->canonic = 0;    data->encoded=allocate_mapping(128);    data->delayed = allocate_array (0); -  data->counter.type=T_INT; -  data->counter.subtype=NUMBER_NUMBER; -  data->counter.u.integer=COUNTER_START; +  SET_SVAL(data->counter, T_INT, NUMBER_NUMBER, integer, COUNTER_START);      #ifdef ENCODE_DEBUG    data->debug = args > 2 ? Pike_sp[2-args].u.integer : 0;    data->depth = -2;   #endif    -  if(args > 1 && Pike_sp[1-args].type == T_OBJECT) +  if(args > 1 && TYPEOF(Pike_sp[1-args]) == T_OBJECT)    { -  if (Pike_sp[1-args].subtype) { +  if (SUBTYPEOF(Pike_sp[1-args])) {    Pike_error("encode_value: "    "The codec may not be a subtyped object yet.\n");    }    data->codec=Pike_sp[1-args].u.object;    add_ref (data->codec);    }else{    data->codec=NULL;    }       SET_ONERROR(tmp, free_encode_data, data);
pike.git/src/encode.c:2015: Inside #if defined(ENCODE_DEBUG)
   * prototype, to keep the argument position free for    * other uses in the future. */    BIT_VOID | BIT_INT,   #endif    0);       initialize_buf(&data->buf);    data->canonic = 1;    data->encoded=allocate_mapping(128);    data->delayed = allocate_array (0); -  data->counter.type=T_INT; -  data->counter.subtype=NUMBER_NUMBER; -  data->counter.u.integer=COUNTER_START; +  SET_SVAL(data->counter, T_INT, NUMBER_NUMBER, integer, COUNTER_START);      #ifdef ENCODE_DEBUG    data->debug = args > 2 ? Pike_sp[2-args].u.integer : 0;    data->depth = -2;   #endif    -  if(args > 1 && Pike_sp[1-args].type == T_OBJECT) +  if(args > 1 && TYPEOF(Pike_sp[1-args]) == T_OBJECT)    { -  if (Pike_sp[1-args].subtype) { +  if (SUBTYPEOF(Pike_sp[1-args])) {    Pike_error("encode_value_canonic: "    "The codec may not be a subtyped object yet.\n");    }    data->codec=Pike_sp[1-args].u.object;    add_ref (data->codec);    }else{    data->codec=NULL;    }       SET_ONERROR(tmp, free_encode_data, data);
pike.git/src/encode.c:2432:    case T_MIXED:    case T_ZERO:    case T_VOID:    case PIKE_T_UNKNOWN:    push_type(tmp);    break;       case PIKE_T_ATTRIBUTE:    decode_value2(data);    -  if (Pike_sp[-1].type != PIKE_T_STRING) { +  if (TYPEOF(Pike_sp[-1]) != PIKE_T_STRING) {    decode_error(data, NULL, "Type attribute is not a string: %O\n",    Pike_sp - 1);    }    low_decode_type(data);    push_type_attribute(Pike_sp[-1].u.string);    pop_stack();    break;       case PIKE_T_NAME:    decode_value2(data);    -  if (Pike_sp[-1].type != PIKE_T_STRING) { +  if (TYPEOF(Pike_sp[-1]) != PIKE_T_STRING) {    decode_error(data, NULL, "Type name is not a string: %O\n",    Pike_sp - 1);    }    low_decode_type(data);    push_type_name(Pike_sp[-1].u.string);    pop_stack();    break;       case T_OBJECT:    {    int flag = GETC();       decode_value2(data); -  switch(Pike_sp[-1].type) +  switch(TYPEOF(Pike_sp[-1]))    {    case T_INT:    push_object_type_backwards(flag, Pike_sp[-1].u.integer );    break;       case T_PROGRAM:    push_object_type_backwards(flag, Pike_sp[-1].u.program->id);    break;       case T_FUNCTION:    {    struct program *prog; -  if (Pike_sp[-1].subtype == FUNCTION_BUILTIN) { +  if (SUBTYPEOF(Pike_sp[-1]) == FUNCTION_BUILTIN) {    decode_error(data, NULL, "Failed to decode object type.\n");    }    prog = program_from_svalue(Pike_sp-1);    if (!prog) {    decode_error(data, NULL, "Failed to decode object type.\n");    }    debug_malloc_touch(prog);    push_object_type_backwards(flag, prog->id);    }    break;       default:    decode_error(data, NULL, "Failed to decode type "    "(object(%s), expected object(zero|program)).\n", -  get_name_of_type(Pike_sp[-1].type)); +  get_name_of_type(TYPEOF(Pike_sp[-1])));    }    pop_stack();    }    }       UNSET_ONERROR(err2);    UNSET_ONERROR(err1);   }      
pike.git/src/encode.c:2524:   #define SETUP_DECODE_MEMOBJ(TYPE, U, VAR, ALLOCATE,SCOUR) do { \    struct svalue *tmpptr; \    struct svalue tmp; \    if(data->pass > 1 && \    (tmpptr=low_mapping_lookup(data->decoded, & entry_id))) \    { \    tmp=*tmpptr; \    VAR=tmp.u.U; \    SCOUR; \    }else{ \ -  tmp.type=TYPE; \ -  tmp.u.U=VAR=ALLOCATE; \ +  SET_SVAL(tmp, TYPE, 0, U, (VAR = ALLOCATE)); \    mapping_insert(data->decoded, & entry_id, &tmp); \    /* Since a reference to the object is stored in the mapping, we can \    * safely decrease this reference here. Thus it will be automatically \    * freed if something goes wrong. \    */ \    sub_ref(VAR); \    } \   }while(0)      /* This really needs to disable threads.... */
pike.git/src/encode.c:2688:       check_c_stack(1024);       DECODE("decode_value2");       switch(what & TAG_MASK)    {    case TAG_DELAYED:    EDB (2, fprintf(stderr, "%*sDecoding delay encoded from <%d>\n",    data->depth, "", num);); -  entry_id.type = T_INT; -  entry_id.subtype = NUMBER_NUMBER; -  entry_id.u.integer = num; +  SET_SVAL(entry_id, T_INT, NUMBER_NUMBER, integer, num);    if (!(delayed_enc_val = low_mapping_lookup (data->decoded, &entry_id)))    decode_error (data, NULL, "Failed to find previous record of "    "delay encoded entry <%d>.\n", num);    DECODE ("decode_value2");    break;       case TAG_AGAIN:    EDB (1, fprintf(stderr, "%*sDecoding TAG_AGAIN from <%d>\n",    data->depth, "", num);); -  entry_id.type=T_INT; -  entry_id.subtype=NUMBER_NUMBER; -  entry_id.u.integer=num; +  SET_SVAL(entry_id, T_INT, NUMBER_NUMBER, integer, num);    if((tmp2=low_mapping_lookup(data->decoded, &entry_id)))    {    push_svalue(tmp2);    }else{    decode_error(data, NULL, "Failed to decode TAG_AGAIN entry <%d>.\n",    num);    }    goto decode_done;       default:
pike.git/src/encode.c:2829:    data->depth, "", num, entry_id.u.integer));       SETUP_DECODE_MEMOBJ(T_ARRAY, array, a, allocate_array(num),    free_svalues(ITEM(a), a->size, a->type_field));       types = 0;    for(e=0;e<num;e++)    {    decode_value2(data);    stack_pop_to_no_free (ITEM(a) + e); -  types |= 1 << ITEM(a)[e].type; +  types |= 1 << TYPEOF(ITEM(a)[e]);    }    a->type_field = types;    ref_push_array(a);    goto decode_done;    }       case TAG_MAPPING:    {    struct mapping *m;    if(num<0)
pike.git/src/encode.c:2892:    SETUP_DECODE_MEMOBJ (T_MULTISET, multiset, m,    allocate_multiset (0, 0, NULL), ;);    /* FIXME: This array could be avoided by building the multiset directly. */    a = low_allocate_array (num, 0);       types = 0;    for(e=0;e<num;e++)    {    decode_value2(data);    stack_pop_to_no_free (ITEM(a) + e); -  types |= 1 << ITEM(a)[e].type; +  types |= 1 << TYPEOF(ITEM(a)[e]);    }    a->type_field = types;    {    struct multiset *l = mkmultiset (a);    free_array (a);    /* This special case is handled efficiently by merge_multisets. */    merge_multisets (m, l, PIKE_MERGE_DESTR_A | PIKE_ARRAY_OP_ADD);    free_multiset (l);    }    ref_push_multiset(m);
pike.git/src/encode.c:2967:    * compatibility mode. */    }else{    struct unfinished_obj_link *ol=ALLOC_STRUCT(unfinished_obj_link);    EDB(2,fprintf(stderr,    "%*sDecoded an unfinished object to <%d>: ",    data->depth, "", entry_id.u.integer);    print_svalue(stderr, Pike_sp-1);    fputc('\n', stderr););    add_ref(ol->o = o);    ol->next=data->unfinished_objects; -  ol->decode_arg.type = PIKE_T_INT; -  ol->decode_arg.subtype = NUMBER_UNDEFINED; -  ol->decode_arg.u.integer = 0; +  SET_SVAL(ol->decode_arg, PIKE_T_INT, NUMBER_UNDEFINED, +  integer, 0);    data->unfinished_objects=ol;    decode_value2(data);    assign_svalue(&ol->decode_arg, Pike_sp-1);    pop_stack();    break;    }    }       EDB(2,fprintf(stderr, "%*sDecoded an object to <%d>: ",    data->depth, "", entry_id.u.integer);
pike.git/src/encode.c:2992:       ref_push_object(o);    decode_value2(data);       fun = find_identifier("decode_object", decoder_codec (data)->prog);    if (fun < 0)    decode_error(data, Pike_sp - 1,    "Cannot decode objects without a "    "\"decode_object\" function in the codec.\n");    apply_low(data->codec,fun,2); -  if ((Pike_sp[-1].type == T_ARRAY) && o->prog && +  if ((TYPEOF(Pike_sp[-1]) == T_ARRAY) && o->prog &&    ((fun = FIND_LFUN(o->prog, LFUN_CREATE)) != -1)) {    /* Call lfun::create(@args). */    INT32 args;    Pike_sp--;    args = Pike_sp->u.array->size;    if (args) {    /* Note: Eats reference */    push_array_items(Pike_sp->u.array);    } else {    free_array(Pike_sp->u.array);
pike.git/src/encode.c:3039: Inside #if defined(AUTO_BIGNUM)
   }      #endif    case 3:    pop_stack();    decode_value2(data);    break;       case 4:    /* Subtyped object. */ -  if ((Pike_sp[-1].type != T_OBJECT) || Pike_sp[-1].subtype || +  if ((TYPEOF(Pike_sp[-1]) != T_OBJECT) || SUBTYPEOF(Pike_sp[-1]) ||    !Pike_sp[-1].u.object->prog) {    decode_error(data, NULL, "Expected plain object. Got: %O\n",    Pike_sp-1);    }    if ((subtype < 0) ||    (subtype >= Pike_sp[-1].u.object->prog->num_inherits)) {    decode_error(data, NULL,    "Invalid subtype for object: %d (max: %d). "    "Object: %O\n",    subtype, Pike_sp[-1].u.object->prog->num_inherits,    Pike_sp-1);    } -  Pike_sp[-1].subtype = subtype; +  SET_SVAL_SUBTYPE(Pike_sp[-1], subtype);    break;       default:    decode_error(data, NULL, "Object coding not compatible: %d\n", num);    break;    }    -  if((Pike_sp[-1].type != T_OBJECT) && data->pickyness) { +  if((TYPEOF(Pike_sp[-1]) != T_OBJECT) && data->pickyness) {    if (num != 2) {    decode_error(data, NULL, "Failed to decode object. Got: %O\n",    Pike_sp - 1); -  } else if (Pike_sp[-1].type != PIKE_T_INT) { +  } else if (TYPEOF(Pike_sp[-1]) != PIKE_T_INT) {    decode_error(data, NULL, "Failed to decode bignum. Got: %O\n",    Pike_sp - 1);    }    }       break;    }       case TAG_FUNCTION:    decode_value2(data);    stack_dup(); /* For diagnostic purposes... */       switch(num)    {    case 0:    apply(decoder_codec (data),"functionof", 1);    break;       case 1: {    struct program *p; -  if(Pike_sp[-1].type != T_OBJECT && data->pickyness) +  if(TYPEOF(Pike_sp[-1]) != T_OBJECT && data->pickyness)    decode_error(data, NULL,    "Failed to decode function object. Got: %O\n",    Pike_sp - 1);       decode_value2(data); -  if(Pike_sp[-1].type != T_STRING && data->pickyness) +  if(TYPEOF(Pike_sp[-1]) != T_STRING && data->pickyness)    decode_error(data, NULL,    "Failed to decode function identifier. Got: %O\n",    Pike_sp - 1);    -  if (Pike_sp[-2].type == T_OBJECT && -  Pike_sp[-1].type == T_STRING && +  if (TYPEOF(Pike_sp[-2]) == T_OBJECT && +  TYPEOF(Pike_sp[-1]) == T_STRING &&    (p = Pike_sp[-2].u.object->prog)) {    int f = really_low_find_shared_string_identifier(    Pike_sp[-1].u.string, -  p->inherits[Pike_sp[-2].subtype].prog, +  p->inherits[SUBTYPEOF(Pike_sp[-2])].prog,    SEE_PROTECTED|SEE_PRIVATE);    debug_malloc_touch(p);    if (f >= 0) {    struct svalue func;    low_object_index_no_free(&func, Pike_sp[-2].u.object, f);   #ifdef PIKE_SECURITY    /* FIXME: Check access to the function. */   #endif    debug_malloc_touch(p);    pop_n_elems(2);
pike.git/src/encode.c:3136:    }    pop_stack();    break;    }       default:    decode_error(data, NULL, "Function coding not compatible: %d\n", num);    break;    }    -  if((Pike_sp[-1].type != T_FUNCTION) && (Pike_sp[-1].type != T_PROGRAM) && +  if((TYPEOF(Pike_sp[-1]) != T_FUNCTION) && +  (TYPEOF(Pike_sp[-1]) != T_PROGRAM) &&    data->pickyness)    decode_error(data, Pike_sp - 2,    "Failed to decode function. Got: %O\n", Pike_sp - 1);       stack_pop_keep_top();       break;          case TAG_PROGRAM:
pike.git/src/encode.c:3215: Inside #if TWO_PASS_DECODE_WORKS
  #if TWO_PASS_DECODE_WORKS    if(! data->supporter.prog)    data->supporter.prog = p;   #endif       debug_malloc_touch(p);    ref_push_program(p);    apply(decoder_codec (data), "__register_new_program", 1);       /* return a placeholder */ -  if(Pike_sp[-1].type == T_OBJECT) +  if(TYPEOF(Pike_sp[-1]) == T_OBJECT)    {    placeholder=Pike_sp[-1].u.object;    if(placeholder->prog != null_program)    decode_error(data, NULL, "Placeholder object is not "    "a __null_program clone.\n");    dmalloc_touch_svalue(Pike_sp-1);    Pike_sp--;    } -  else if (Pike_sp[-1].type != T_INT || +  else if (TYPEOF(Pike_sp[-1]) != T_INT ||    Pike_sp[-1].u.integer)    decode_error (data, NULL, "Expected placeholder object or zero "    "from __register_new_program.\n");    else {    pop_stack();    }    }       if(placeholder)    SET_ONERROR(err4, zap_placeholder, placeholder);
pike.git/src/encode.c:3276:    decode_number(p->timestamp.tv_usec,data);       if(data->pass && p->parent)    {    free_program(p->parent);    p->parent=0;    }       debug_malloc_touch(p);    decode_value2(data); -  switch(Pike_sp[-1].type) +  switch(TYPEOF(Pike_sp[-1]))    {    case T_INT:    p->parent=0;    break;    case T_PROGRAM:    p->parent=Pike_sp[-1].u.program;    break;    case T_FUNCTION:    p->parent=program_from_svalue(Pike_sp-1);    break;
pike.git/src/encode.c:3470:    {    decode_number(p->inherits[d].inherit_level,data);    decode_number(p->inherits[d].identifier_level,data);    decode_number(p->inherits[d].parent_offset,data);    decode_number(p->inherits[d].parent_identifier,data);    decode_number(p->inherits[d].storage_offset,data);       decode_value2(data);    if(d==0)    { -  if(Pike_sp[-1].type != T_PROGRAM || +  if(TYPEOF(Pike_sp[-1]) != T_PROGRAM ||    Pike_sp[-1].u.program != p) {    ref_push_program (p);    decode_error(data, Pike_sp - 1,    "Program decode of self inherit failed. Got: %O\n",    Pike_sp - 2);    }    sub_ref(p);    }       if(data->pass > 1)
pike.git/src/encode.c:3495:    p->inherits[d].prog=0;    }       if(p->inherits[d].parent)    {    free_object(p->inherits[d].parent);    p->inherits[d].parent=0;    }    }    -  switch(Pike_sp[-1].type) +  switch(TYPEOF(Pike_sp[-1]))    {    case T_PROGRAM:    EDB(3, fprintf(stderr,"INHERIT%x = prog\n",p->id); );    p->inherits[d].prog=Pike_sp[-1].u.program;    Pike_sp--;    dmalloc_touch_svalue(Pike_sp);    break;       case T_FUNCTION: -  if(Pike_sp[-1].subtype != FUNCTION_BUILTIN) { -  EDB(3, fprintf(stderr,"INHERIT%x = func { %p, %d} \n",p->id,Pike_sp[-1].u.object, Pike_sp[-1].subtype); ); +  if(SUBTYPEOF(Pike_sp[-1]) != FUNCTION_BUILTIN) { +  EDB(3, fprintf(stderr,"INHERIT%x = func { %p, %d} \n",p->id,Pike_sp[-1].u.object, SUBTYPEOF(Pike_sp[-1])); );    -  p->inherits[d].parent_identifier=Pike_sp[-1].subtype; +  p->inherits[d].parent_identifier = SUBTYPEOF(Pike_sp[-1]);    p->inherits[d].prog=program_from_svalue(Pike_sp-1);    if(!p->inherits[d].prog) {    ref_push_program (p);    decode_error(data, Pike_sp - 1, "Failed to decode "    "inherited program. Got: %O\n", Pike_sp - 2);    }    add_ref(p->inherits[d].prog);    p->inherits[d].parent=Pike_sp[-1].u.object;    Pike_sp--;    dmalloc_touch_svalue(Pike_sp);
pike.git/src/encode.c:3759:       /* Note: We steal the references from l. */    push_object(o);    *(Pike_sp++) = l->decode_arg;       *ptr = l->next;    free((char *)l);       /* Let the codec do it's job... */    apply_low(decoder_codec (data), decode_fun, 2); -  if ((Pike_sp[-1].type == T_ARRAY) && +  if ((TYPEOF(Pike_sp[-1]) == T_ARRAY) &&    ((fun = FIND_LFUN(o->prog, LFUN_CREATE)) != -1)) {    /* Call lfun::create(@args). */    INT32 args;    Pike_sp--;    args = Pike_sp->u.array->size;    if (args) {    /* Note: Eats reference to the array. */    push_array_items(Pike_sp->u.array);    } else {    free_array(Pike_sp->u.array);
pike.git/src/encode.c:3795: Inside #if defined(_REENTRANT)
  #ifdef _REENTRANT    UNSET_ONERROR(err);    exit_threads_disable(NULL);   #endif    goto decode_done;    }       case 2:    decode_value2(data);    decode_value2(data); -  if(Pike_sp[-2].type==T_INT) +  if(TYPEOF(Pike_sp[-2]) == T_INT)    {    pop_stack();    }else{    f_arrow(2);    } -  if(Pike_sp[-1].type != T_PROGRAM && data->pickyness) +  if(TYPEOF(Pike_sp[-1]) != T_PROGRAM && data->pickyness)    decode_error(data, NULL, "Failed to decode program. Got: %O\n",    Pike_sp - 1);    break;       case 3:    decode_value2(data); -  if ((Pike_sp[-1].type == T_INT) && +  if ((TYPEOF(Pike_sp[-1]) == T_INT) &&    (Pike_sp[-1].u.integer < PROG_DYNAMIC_ID_START) &&    (Pike_sp[-1].u.integer > 0)) {    struct program *p = id_to_program(Pike_sp[-1].u.integer);    if (!p) {    decode_error(data, NULL, "Failed to get program from ID %O.\n",    Pike_sp - 1);    }    pop_stack();    ref_push_program(p);    } else {
pike.git/src/encode.c:3845:    data->delay_counter++;      #if 0    /* Is this necessary? In that case, how do we pass an    * adequate context to __register_new_program so that it    * knows which program is being decoded? */    ref_push_program (p);    apply (decoder_codec (data), "__register_new_program", 1);       /* Returns a placeholder. */ -  if (Pike_sp[-1].type == T_OBJECT) { +  if (TYPEOF(Pike_sp[-1]) == T_OBJECT) {    if (Pike_sp[-1].u.object->prog != null_program)    decode_error (data, NULL, "Placeholder object is not "    "a null_program clone.\n");    } -  else if (Pike_sp[-1].type != T_INT || +  else if (TYPEOF(Pike_sp[-1]) != T_INT ||    Pike_sp[-1].u.integer)    decode_error (data, NULL, "Expected placeholder object or zero "    "from __register_new_program.\n");    pop_stack();   #endif       break;    }       case 4: /* New-style encoding. */
pike.git/src/encode.c:3914:    decode_number(p_flags,data);    p_flags &= ~(PROGRAM_FINISHED | PROGRAM_OPTIMIZED |    PROGRAM_FIXED | PROGRAM_PASS_1_DONE);    p_flags |= PROGRAM_AVOID_CHECK;       if (delayed_enc_val) {    EDB(2,fprintf(stderr, "%*sdecoding a delay encoded program: ",    data->depth, "");    print_svalue(stderr, delayed_enc_val);    fputc('\n', stderr);); -  if (delayed_enc_val->type != T_PROGRAM || +  if (TYPEOF(*delayed_enc_val) != T_PROGRAM ||    delayed_enc_val->u.program->flags != PROGRAM_VIRGIN) {    decode_error (data, NULL, "Didn't get program embryo "    "for delay encoded program <%O>: %O\n",    &entry_id, delayed_enc_val);    }    /* No new ref here; low_start_new_program will add one for    * Pike_compiler->new_program and we want ride on that one    * just like when it's created there. */    p = delayed_enc_val->u.program;    debug_malloc_touch(p);
pike.git/src/encode.c:3963:       {    int fun = find_identifier("__register_new_program",    decoder_codec (data)->prog);       if (fun >= 0) {    ref_push_program(p);    apply_low(data->codec, fun, 1);       /* Returned a placeholder */ -  if(Pike_sp[-1].type == T_OBJECT) +  if(TYPEOF(Pike_sp[-1]) == T_OBJECT)    {    add_ref(c->placeholder=Pike_sp[-1].u.object);    if(c->placeholder->prog != null_program) {    decode_error(data, NULL, "Placeholder object is not "    "a __null_program clone.\n");    } -  } else if (Pike_sp[-1].type != T_INT || +  } else if (TYPEOF(Pike_sp[-1]) != T_INT ||    Pike_sp[-1].u.integer) {    decode_error (data, NULL, "Expected placeholder object or zero "    "from __register_new_program.\n");    }    pop_stack();    }    }       copy_shared_string(save_current_file, c->lex.current_file);    save_current_line = c->lex.current_line;       SET_ONERROR(err2, restore_current_file, save_current_file);       if (!delayed_enc_val) {    struct svalue prog; -  prog.type=T_PROGRAM; -  prog.u.program=p; +  SET_SVAL(prog, T_PROGRAM, 0, program, p);    EDB(2,fprintf(stderr, "%*sDecoding a program to <%d>: ",    data->depth, "", entry_id.u.integer);    print_svalue(stderr, &prog);    fputc('\n', stderr););    mapping_insert(data->decoded, &entry_id, &prog);    debug_malloc_touch(p);    } else {    data->delay_counter--;    }   
pike.git/src/encode.c:4021:       debug_malloc_touch(p);      #ifdef ENCODE_DEBUG    if (!data->debug)   #endif    data->pickyness++;       /* parent */    decode_value2(data); -  if (Pike_sp[-1].type == T_PROGRAM) { +  if (TYPEOF(Pike_sp[-1]) == T_PROGRAM) {    p->parent = Pike_sp[-1].u.program;    debug_malloc_touch(p->parent); -  } else if ((Pike_sp[-1].type == T_INT) && +  } else if ((TYPEOF(Pike_sp[-1]) == T_INT) &&    (!Pike_sp[-1].u.integer)) {    p->parent = NULL;    } else {    decode_error (data, NULL, "Bad type for parent program (%s).\n", -  get_name_of_type(Pike_sp[-1].type)); +  get_name_of_type(TYPEOF(Pike_sp[-1])));    }    dmalloc_touch_svalue(Pike_sp-1);    Pike_sp--;       /* Decode lengths. */   #define FOO(NUMTYPE,TYPE,ARGTYPE,NAME) \    decode_number(PIKE_CONCAT(local_num_, NAME), data);   #include "program_areas.h"       /* Byte-code method */
pike.git/src/encode.c:4116:    fputc('\n', stderr));    }       /* identifier_index & variable_index are created by    * fixate_program() and optimize_program().    */       /* Decode strings */    for (e=0; e<local_num_strings; e++) {    decode_value2(data); -  if (Pike_sp[-1].type != T_STRING) { +  if (TYPEOF(Pike_sp[-1]) != T_STRING) {    ref_push_program (p);    decode_error(data, Pike_sp - 1,    "Nonstrings in string table: %O\n", Pike_sp - 2);    }    add_to_strings(Pike_sp[-1].u.string);    dmalloc_touch_svalue(Pike_sp-1);    Pike_sp--;    }       /* First pass constants.    *    * These will be replaced later on.    */    {    struct program_constant constant; -  constant.sval.type = T_INT; -  constant.sval.subtype = NUMBER_UNDEFINED; -  constant.sval.u.integer = 0; +  SET_SVAL(constant.sval, T_INT, NUMBER_UNDEFINED, integer, 0);    constant.offset = -1;       for(e=0;e<local_num_constants;e++) {    add_to_constants(constant);    }    }       /* Decode identifier_references, inherits and identifiers. */    decode_number(entry_type, data);    EDB(4,
pike.git/src/encode.c:4169:    ref_push_program (p);    decode_error(data, Pike_sp - 1,    "Bad efun/type number: %d (expected 0 - %d).\n",    efun_no, local_num_constants-1);    }    constant = p->constants+efun_no;    /* value */    decode_value2(data);    switch(entry_type) {    case ID_ENTRY_EFUN_CONSTANT: -  if (((Pike_sp[-1].type != T_FUNCTION) || -  (Pike_sp[-1].subtype != FUNCTION_BUILTIN)) && +  if (((TYPEOF(Pike_sp[-1]) != T_FUNCTION) || +  (SUBTYPEOF(Pike_sp[-1]) != FUNCTION_BUILTIN)) &&    data->pickyness) {    ref_push_program (p);    decode_error(data, Pike_sp - 1,    "Expected efun constant: %O\n", Pike_sp - 2);    }    break;    case ID_ENTRY_TYPE_CONSTANT: -  if (Pike_sp[-1].type != T_TYPE && data->pickyness) { +  if (TYPEOF(Pike_sp[-1]) != T_TYPE && data->pickyness) {    ref_push_program (p);    decode_error(data, Pike_sp - 1,    "Expected type constant: %O\n", Pike_sp - 2);    }    break;    default:    if (data->pickyness)    decode_error(data, NULL, "Internal error: "    "Unsupported early constant (%d).\n",    entry_type);    break;    }    /* name */    decode_value2(data);   #if 0 -  if (Pike_sp[-1].type == T_STRING) { +  if (TYPEOF(Pike_sp[-1]) == T_STRING) {    constant->name = Pike_sp[-1].u.string; -  } else if ((Pike_sp[-1].type == T_INT) && +  } else if ((TYPEOF(Pike_sp[-1]) == T_INT) &&    !Pike_sp[-1].u.integer) {    constant->name = NULL;    } else {    ref_push_program (p);    decode_error(data, Pike_sp - 1,    "Name of constant is not a string: %O\n",    Pike_sp - 2);    }    constant->sval = Pike_sp[-2];    dmalloc_touch_svalue(Pike_sp-1);
pike.git/src/encode.c:4229:    while (entry_type != ID_ENTRY_EOT) {    decode_number(id_flags, data);    if ((entry_type != ID_ENTRY_RAW) &&    (entry_type != ID_ENTRY_INHERIT)) {    /* Common identifier fields. */       unsigned INT32 filename_strno;       /* name */    decode_value2(data); -  if (Pike_sp[-1].type != T_STRING) { +  if (TYPEOF(Pike_sp[-1]) != T_STRING) {    ref_push_program (p);    decode_error(data, Pike_sp - 1,    "Bad identifier name (not a string): %O\n",    Pike_sp - 2);    }       /* type */    decode_value2(data); -  if (Pike_sp[-1].type != T_TYPE) { +  if (TYPEOF(Pike_sp[-1]) != T_TYPE) {    ref_push_program (p);    decode_error(data, Pike_sp - 1,    "Bad identifier type (not a type): %O\n",    Pike_sp - 2);    }       /* filename */    decode_number(filename_strno, data);    if (filename_strno >= p->num_strings) {    ref_push_program(p);
pike.git/src/encode.c:4563:    decode_number(no, data);    if (no !=    Pike_compiler->new_program->num_identifier_references) {    ref_push_program (p);    decode_error(data, Pike_sp - 1,    "Bad inherit identifier offset: %d\n", no);    }       /* name */    decode_value2(data); -  if (Pike_sp[-1].type == T_STRING) { +  if (TYPEOF(Pike_sp[-1]) == T_STRING) {    name = Pike_sp[-1].u.string; -  } else if ((Pike_sp[-1].type != T_INT) || +  } else if ((TYPEOF(Pike_sp[-1]) != T_INT) ||    Pike_sp[-1].u.integer) {    ref_push_program (p);    decode_error(data, Pike_sp - 1,    "Bad inherit name (not a string): %O\n",    Pike_sp - 2);    }       /* prog */    decode_value2(data); -  if (Pike_sp[-1].type != T_PROGRAM) { +  if (TYPEOF(Pike_sp[-1]) != T_PROGRAM) {    ref_push_program (p);    decode_error(data, Pike_sp - 1,    "Bad inherit: Expected program, got: %O\n",    Pike_sp - 2);    }    prog = Pike_sp[-1].u.program;    if (prog == placeholder_program) {    ref_push_program (p);    decode_error (data, Pike_sp - 1,    "Trying to inherit placeholder program "
pike.git/src/encode.c:4598:    if(!(prog->flags & (PROGRAM_FINISHED | PROGRAM_PASS_1_DONE))) {    ref_push_program (p);    decode_error (data, Pike_sp - 1,    "Cannot inherit a program which is not "    "fully compiled yet (resolver or codec "    "problem): %O\n", Pike_sp - 2);    }       /* parent */    decode_value2(data); -  if (Pike_sp[-1].type == T_OBJECT) { +  if (TYPEOF(Pike_sp[-1]) == T_OBJECT) {    parent = Pike_sp[-1].u.object; -  } else if ((Pike_sp[-1].type != T_INT) || +  } else if ((TYPEOF(Pike_sp[-1]) != T_INT) ||    Pike_sp[-1].u.integer) {    ref_push_program (p);    decode_error(data, Pike_sp - 1,    "Bad inherit: Parent isn't an object: %O\n",    Pike_sp - 2);    }       /* parent_identifier */    decode_number(parent_identifier, data);   
pike.git/src/encode.c:4711:    bytecode_method); \    }   #include "program_areas.h"       /* Decode the actual constants    *    * This must be done after the program has been ended.    */    for (e=0; e<local_num_constants; e++) {    struct program_constant *constant = p->constants+e; -  if ((constant->sval.type != T_INT) || -  (constant->sval.subtype != NUMBER_UNDEFINED)) { +  if ((TYPEOF(constant->sval) != T_INT) || +  (SUBTYPEOF(constant->sval) != NUMBER_UNDEFINED)) {    /* Already initialized. */    EDB(5,    fprintf(stderr, "%*sskipping constant %d\n",    data->depth, "", e));    continue;    }    /* value */    decode_value2(data);    /* name */    decode_value2(data);   #if 0 -  if (Pike_sp[-1].type == T_STRING) { +  if (TYPEOF(Pike_sp[-1]) == T_STRING) {    constant->name = Pike_sp[-1].u.string; -  } else if ((Pike_sp[-1].type == T_INT) && +  } else if ((TYPEOF(Pike_sp[-1]) == T_INT) &&    !Pike_sp[-1].u.integer) {    constant->name = NULL;    } else {    ref_push_program (p);    decode_error(data, Pike_sp - 1,    "Name of constant is not a string: %O\n",    Pike_sp - 2);    }    constant->sval = Pike_sp[-2];    dmalloc_touch_svalue(Pike_sp-1);
pike.git/src/encode.c:4749:   #else /* !0 */    constant->offset = -1;    pop_stack();    constant->sval = Pike_sp[-1];    dmalloc_touch_svalue(Pike_sp-1);    Pike_sp -= 1;   #endif /* 0 */    EDB(5,    fprintf(stderr, "%*sDecoded constant %d to a %s\n",    data->depth, "", -  e, get_name_of_type(constant->sval.type))); +  e, get_name_of_type(TYPEOF(constant->sval))));    }      #ifdef ENCODE_DEBUG    if (!data->debug)   #endif    data->pickyness--;       /* The program should be consistent now. */    p->flags &= ~PROGRAM_AVOID_CHECK;   
pike.git/src/encode.c:4887:    if(delay)    {    debug_malloc_touch(data);    /* We have been delayed */    return;    }      #ifdef PIKE_DEBUG    if (!free_after_error) {    NEW_MAPPING_LOOP (data->decoded->data) { -  if (k->val.type == T_PROGRAM && +  if (TYPEOF(k->val) == T_PROGRAM &&    !(k->val.u.program->flags & PROGRAM_FINISHED)) {    decode_error (data, NULL,    "Got unfinished program <%O> after decode: %O\n",    &k->ind, &k->val);    }    }    if(data->unfinished_programs)    Pike_fatal("We have unfinished programs left in decode()!\n");    if(data->unfinished_objects)    Pike_fatal("We have unfinished objects left in decode()!\n");
pike.git/src/encode.c:5023:    if ((res = low_mapping_lookup(data->decoded, &val))) {    push_svalue(res);    return 1;    }    /* Possible recursion detected. */    /* return 0; */    }    }       data=ALLOC_STRUCT(decode_data); -  data->counter.type=T_INT; -  data->counter.subtype=NUMBER_NUMBER; -  data->counter.u.integer=COUNTER_START; +  SET_SVAL(data->counter, T_INT, NUMBER_NUMBER, integer, COUNTER_START);    data->data_str = tmp;    data->data=(unsigned char *)tmp->str;    data->len=tmp->len;    data->ptr=0;    data->codec=codec;    data->explicit_codec = codec ? 1 : 0;    data->pickyness=0;    data->pass=1;    data->unfinished_programs=0;    data->unfinished_objects=0;
pike.git/src/encode.c:5291:    switch(i)    {    case TAG_INT:    push_int(DO_NOT_WARN(t));    return;       case TAG_FLOAT:    if(sizeof(ptrdiff_t) < sizeof(FLOAT_TYPE)) /* FIXME FIXME FIXME FIXME */    decode_error(current_decode, NULL, "Float architecture not supported.\n");    push_int(DO_NOT_WARN(t)); /* WARNING! */ -  Pike_sp[-1].type = T_FLOAT; +  SET_SVAL_TYPE(Pike_sp[-1], T_FLOAT);    return;       case TAG_TYPE:    {    decode_error(current_decode, NULL, "TAG_TYPE not supported yet.\n");    }    return;       case TAG_STRING:    if(t<0) decode_error(current_decode, NULL,
pike.git/src/encode.c:5424:       s = Pike_sp[-args].u.string;       switch (args) {    default:   #ifdef ENCODE_DEBUG    debug = Pike_sp[2-args].u.integer;    /* Fall through. */    case 2:   #endif -  if (Pike_sp[1-args].type == T_OBJECT) { -  if (Pike_sp[1-args].subtype) { +  if (TYPEOF(Pike_sp[1-args]) == T_OBJECT) { +  if (SUBTYPEOF(Pike_sp[1-args])) {    struct decode_data data;    MEMSET (&data, 0, sizeof (data));    data.data_str = s; /* Not refcounted. */    decode_error(&data, NULL,    "The codec may not be a subtyped object yet.\n");    }    codec = Pike_sp[1-args].u.object;    break;    }    /* Fall through. */