pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:710:       if(d == 0.0)    {    code_entry(TAG_FLOAT,0,data);    code_entry(TAG_FLOAT,0,data);    }else{    INT64 x;    int y;    double tmp;    -  tmp = FREXP(d, &y); +  tmp = frexp(d, &y);    x = DO_NOT_WARN((INT64)((((INT64)1)<<(sizeof(INT64)*8 - 2))*tmp));    y -= sizeof(INT64)*8 - 2;       EDB(2,fprintf(stderr,    "Encoding float... tmp: %10g, x: 0x%016llx, y: %d\n",    tmp, x, y));      #if 0    if (x && !(x & 0xffffffffUL)) {   #endif /* 0 */
pike.git/src/encode.c:1194: Inside #if defined(PIKE_PORTABLE_BYTECODE)
  #endif /* 0 */    }    }   #endif /* PIKE_PORTABLE_BYTECODE */    /* Dump the identifiers in a portable manner... */    {    int inherit_num = 1;    struct svalue str_sval;    char *id_dumped = alloca(p->num_identifiers);    int d_min = 0; -  MEMSET(id_dumped,0,p->num_identifiers); +  memset(id_dumped,0,p->num_identifiers);    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   
pike.git/src/encode.c:1378:    */    if ((i < 0) || !is_variant_dispatcher(p, i)) {    Pike_error("Failed to find dispatcher for inherited "    "variant function: %S\n", id->name);    }    if (PTR_FROM_INT(p, i)->inherit_offset) {    Pike_error("Dispatcher for variant function %S "    "is inherited.\n", id->name);    }    gs_flags = ref->id_flags & PTR_FROM_INT(p, i)->id_flags; -  if (id_dumped[PTR_FROM_INT(p, i)->identifier_offset] || -  (i < d)) { +  if (id_dumped[PTR_FROM_INT(p, i)->identifier_offset]) {    /* Either already dumped, or the dispatcher is in    * front of us, which indicates that we are overloading    * an inherited function with a variant.    */    gs_flags |= ID_VARIANT;    } else {    /* First variant. */    id_dumped[PTR_FROM_INT(p, i)->identifier_offset] = 1;    }    }
pike.git/src/encode.c:1528:    code_number(id->opt_flags, data);    break;       case IDENTIFIER_C_FUNCTION:    if (is_variant_dispatcher(p, d)) {    /* This is handled by end_first_pass() et all. */    /* NB: This can be reached even though id_dumped    * for it gets set by the variant functions,    * if it is overriding an old definition.    * -  * We thus need to make sure id_dumped stays cleared. +  * Note that this means that even the first local +  * function must have the variant modifier (since +  * otherwise it would have overridden the old def +  * and not the dispatcher). This is handled +  * automatically by the use of id_dumped for the +  * dispatcher as marker for whether the first +  * variant has been added or not.    */ -  id_dumped[ref->identifier_offset] = 0; +     continue;    }    /* Not supported. */    Pike_error("Cannot encode functions implemented in C "    "(identifier=\"%S\").\n",    id->name);    break;       case IDENTIFIER_VARIABLE:    if (d < d_min) {
pike.git/src/encode.c:2113:    what &= TAG_MASK; \    if(what<0 || what>2) \    decode_error (data, NULL, "Illegal size shift %d.\n", what); \    sz = (ptrdiff_t) num << what; \    if (sz < 0) \    decode_error (data, NULL, "Illegal negative size %td.\n", sz); \    if (sz > data->len - data->ptr) \    decode_error (data, NULL, "Too large size %td (max is %td).\n", \    sz, data->len - data->ptr); \    STR=begin_wide_shared_string(num, what); \ -  MEMCPY(STR->str, data->data + data->ptr, sz); \ +  memcpy(STR->str, data->data + data->ptr, sz); \    data->ptr += sz; \    BITFLIP(STR); \    STR=end_shared_string(STR); \    }else{ \    ptrdiff_t sz = (LEN); \    if (sz < 0) \    decode_error (data, NULL, "Illegal negative size %td.\n", sz); \    if (sz > data->len - data->ptr) \    decode_error (data, NULL, "Too large size %td (max is %td).\n", \    sz, data->len - data->ptr); \
pike.git/src/encode.c:2620:       case Pike_FP_PINF: /* Positive infinity */    push_float(DO_NOT_WARN((FLOAT_TYPE)MAKE_INF(1)));    break;       case Pike_FP_NZERO: /* Negative Zero */    push_float(-0.0); /* Does this do what we want? */    break;       default: -  push_float(DO_NOT_WARN((FLOAT_TYPE)LDEXP(res, num))); +  push_float(DO_NOT_WARN((FLOAT_TYPE)ldexp(res, num)));    break;    }    break;    }    -  push_float(DO_NOT_WARN((FLOAT_TYPE)LDEXP(res, num))); +  push_float(DO_NOT_WARN((FLOAT_TYPE)ldexp(res, num)));    break;    }       case TAG_TYPE:    {    struct pike_type *t;       decode_type(t, data);    check_type_string(t);    push_type_value(t);
pike.git/src/encode.c:4639:    switch (args) {    default:   #ifdef ENCODE_DEBUG    debug = Pike_sp[2-args].u.integer;    /* Fall through. */    case 2:   #endif    if (TYPEOF(Pike_sp[1-args]) == T_OBJECT) {    if (SUBTYPEOF(Pike_sp[1-args])) {    struct decode_data data; -  MEMSET (&data, 0, sizeof (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. */    case 1:    if (!get_master()) {
pike.git/src/encode.c:4669: Inside #if defined(ENCODE_DEBUG)
   if(!my_decode(s, codec   #ifdef ENCODE_DEBUG    , debug   #endif    ))    {    char *v=s->str;    ptrdiff_t l=s->len;    struct decode_data data;    ONERROR uwp; -  MEMSET (&data, 0, sizeof (data)); +  memset (&data, 0, sizeof (data));    data.data_str = s; /* Not refcounted. */    SET_ONERROR (uwp, restore_current_decode, current_decode);    current_decode = &data;    rec_restore_value(&v, &l);    CALL_AND_UNSET_ONERROR (uwp);    }    assign_svalue(Pike_sp-args-1, Pike_sp-1);    pop_n_elems(args);   }