pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: encode.c,v 1.225 2004/12/18 15:45:04 grubba Exp $ + || $Id: encode.c,v 1.226 2004/12/18 22:05:45 grubba Exp $   */      #include "global.h"   #include "stralloc.h"   #include "pike_macros.h"   #include "object.h"   #include "constants.h"   #include "interpret.h"   #include "svalue.h"   #include "mapping.h"
pike.git/src/encode.c:854:    switch(Pike_sp[-1].type)    {    case T_INT:    if(Pike_sp[-1].subtype == 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) { +  Pike_error("Encoding of subtyped objects is not supported yet.\n"); +  } +     /* We have to remove ourself from the cache */    map_delete(data->encoded, val);       pop_stack();    push_svalue(val);    f_object_program(1);       /* Code the program */    code_entry(TAG_OBJECT, 3,data);    encode_value2(Pike_sp-1, data, 1);
pike.git/src/encode.c:925:    {    if(find_shared_string_identifier(ID_FROM_INT(val->u.object->prog, val->subtype)->name,    val->u.object->prog)==val->subtype)    {    /* 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].type = T_OBJECT; +  Pike_sp[-1].subtype = 0;    encode_value2(Pike_sp-1, data, 0);    ref_push_string(ID_FROM_INT(val->u.object->prog, val->subtype)->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;    }    }
pike.git/src/encode.c:1681:    data->counter.subtype=NUMBER_NUMBER;    data->counter.u.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 (Pike_sp[1-args].subtype) { +  Pike_error("encode_value: " +  "The codec may not be a subtyped object yet.\n"); +  }    data->codec=Pike_sp[1-args].u.object;    }else{    data->codec=get_master();    if (!data->codec) {    /* Use a dummy if there's no master around yet, to avoid checks. */    push_object (clone_object (null_program, 0));    args++;    data->codec = Pike_sp[-1].u.object;    }    }
pike.git/src/encode.c:1760:    data->counter.type=T_INT;    data->counter.u.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 (Pike_sp[1-args].subtype) { +  Pike_error("encode_value_canonic: " +  "The codec may not be a subtyped object yet.\n"); +  }    data->codec=Pike_sp[1-args].u.object;    }else{    data->codec=get_master();    if (!data->codec) {    /* Use a dummy if there's no master around yet, to avoid checks. */    push_object (clone_object (null_program, 0));    args++;    data->codec = Pike_sp[-1].u.object;    }    }
pike.git/src/encode.c:2693:    "Failed to decode function object. Got: ");       decode_value2(data);    if(Pike_sp[-1].type != T_STRING && data->pickyness)    decode_error(NULL, Pike_sp - 1,    "Failed to decode function identifier. Got: ");       if (Pike_sp[-2].type == T_OBJECT &&    Pike_sp[-1].type == T_STRING &&    (p = Pike_sp[-2].u.object->prog)) { -  int f = find_shared_string_identifier(Pike_sp[-1].u.string, p); +  int f = find_shared_string_identifier(Pike_sp[-1].u.string, +  p->inherits[Pike_sp[-2].subtype].prog);    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    pop_n_elems(2);    *Pike_sp++ = func;    dmalloc_touch_svalue(Pike_sp-1);    break;
pike.git/src/encode.c:4651:    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) { +  Pike_error("decode_value: " +  "The codec may not be a subtyped object yet.\n"); +  }    codec = Pike_sp[1-args].u.object;    break;    }    /* Fall through. */    case 1:    codec = get_master();    if (!codec) {    /* Use a dummy if there's no master around yet, to avoid checks. */    push_object (clone_object (null_program, 0));    args++;