pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:609:    /* 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;    if (i != (INT32)i)    { - #ifdef AUTO_BIGNUM +     /* Reuse the id. */    data->counter.u.integer--;    /* Make sure we don't find ourselves again below... */    map_delete(data->encoded, val);       /* Encode as a bignum */    push_int(i);    convert_stack_top_to_bignum();    encode_value2(Pike_sp-1,data, 0);    pop_stack();       /* Restore the entry we removed above. */    mapping_insert(data->encoded, val, &entry_id); - #else -  Pike_error ("Cannot encode integers with more than 32 bits " -  "without bignum support.\n"); - #endif +     goto encode_done;    }    else    code_entry(TAG_INT, i,data);    }   #else    code_entry(TAG_INT, val->u.integer,data);   #endif    break;   
pike.git/src/encode.c:888:    for (; node; node = low_multiset_next (node))    encode_value2 (low_use_multiset_index (node, ind), data, 0);    }    }    break;    }       case T_OBJECT:    check_stack(1);    - #ifdef AUTO_BIGNUM +     /* This could be implemented a lot more generic,    * 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(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(TYPEOF(Pike_sp[-1]))    {
pike.git/src/encode.c:3072:    } else {    free_array(Pike_sp->u.array);    }    apply_low(o, fun, args);    }    pop_stack();    }       break;    - #ifdef AUTO_BIGNUM -  /* It is possible that we should do this even without -  * AUTO_BIGNUM /Hubbe -  * However, that requires that some of the bignum functions -  * are always available... -  */ +     case 2:    {    check_stack(2);    /* 256 would be better, but then negative numbers    * doesn't work... /Hubbe    */    push_int(36);    convert_stack_top_with_base_to_bignum();   #if SIZEOF_INT_TYPE > 4    reduce_stack_top_bignum();   #endif    break;    }    - #endif +     case 3:    pop_stack();    decode_value2(data);    break;       case 4:    /* Subtyped object. */    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",