pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:18:   #include "pike_error.h"   #include "operators.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "fsort.h"   #include "threads.h"   #include "stuff.h"   #include "version.h"   #include "bignum.h"    - RCSID("$Id: encode.c,v 1.81 2001/02/01 15:54:08 grubba Exp $"); + RCSID("$Id: encode.c,v 1.82 2001/02/20 15:59:49 grubba Exp $");      /* #define ENCODE_DEBUG */      #ifdef ENCODE_DEBUG   #define EDB(X) X   #else   #define EDB(X)   #endif      /* The sp macro conflicts with Solaris 2.5.1's <sys/conf.h>. */
pike.git/src/encode.c:1004:       int tmp;    ONERROR err1;    ONERROR err2;       SET_ONERROR(err1, restore_type_stack, Pike_compiler->type_stackp);    SET_ONERROR(err2, restore_type_mark, Pike_compiler->pike_type_mark_stackp);      one_more_type:    tmp = GETC(); -  push_type(tmp); +     switch(tmp)    {    default:    fatal("error in type string.\n");    /*NOTREACHED*/    break;       case T_ASSIGN: -  +  push_type(tmp);    push_type(GETC());    goto one_more_type;       case T_FUNCTION: -  +  push_type(tmp);    while(GETC()!=T_MANY)    {    data->ptr--;    low_decode_type(data);    }    push_type(T_MANY);       case T_MAPPING:    case T_OR:    case T_AND: -  +  push_type(tmp);    low_decode_type(data);       case T_ARRAY:    case T_MULTISET:    case T_NOT:    goto one_more_type;       case T_INT:    {    int i; -  +  push_type(tmp);    /* FIXME: I assume the type is saved in network byte order. Is it?    * /grubba 1999-03-07    */    for(i = 0; i < (int)(2*sizeof(INT32)); i++) {    push_type(GETC());    }    }    break;       case '0':
pike.git/src/encode.c:1064:    case '8':    case '9':    case T_FLOAT:    case T_TYPE:    case T_STRING:    case T_PROGRAM:    case T_MIXED:    case T_ZERO:    case T_VOID:    case PIKE_T_UNKNOWN: +  push_type(tmp);    break;       case T_OBJECT:    {    INT32 x; -  +  int flag = GETC();    -  push_type(GETC()); +     decode_value2(data); -  type_stack_mark(); +     switch(Pike_sp[-1].type)    {    case T_INT: -  push_type_int(0); +  push_object_type_backwards(flag, 0);    break;       case T_PROGRAM: -  push_type_int(Pike_sp[-1].u.program->id); +  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) {    Pike_error("Failed to decode object type.\n");    }    prog = program_from_svalue(Pike_sp-1);    if (!prog) {    Pike_error("Failed to decode object type.\n");    } -  push_type_int(prog->id); +  push_object_type_backwards(flag, prog->id);    }    break;       default:    Pike_error("Failed to decode type "    "(object(%s), expected object(zero|program)).\n",    get_name_of_type(Pike_sp[-1].type));    }    pop_stack(); -  type_stack_reverse(); +     }    }       UNSET_ONERROR(err2);    UNSET_ONERROR(err1);   }      /* This really needs to disable threads.... */   #define decode_type(X,data) do { \    type_stack_mark(); \