pike.git / src / post_modules / GTK2 / source / support.c

version» Context lines:

pike.git/src/post_modules/GTK2/source/support.c:853:    ptrdiff_t offset;    offset = low_get_storage(o->prog, p);    if(offset == -1)    Pike_error("This class can not be instantiated on its own.\n");    ((struct mixin_wrapper *)Pike_fp->current_storage)->offset = offset;   }      LONGEST pgtk2_get_int(struct svalue *s) {    if (TYPEOF(*s) == PIKE_T_INT)    return s->u.integer; - #ifdef AUTO_BIGNUM +     if (is_bignum_object_in_svalue(s)) {    LONGEST res;    int64_from_bignum(&res,s->u.object);    return res;    } - #endif +     if (TYPEOF(*s) == PIKE_T_FLOAT)    return (LONGEST)s->u.float_number;    return 0;   }      int pgtk2_is_int(struct svalue *s) {    return ((TYPEOF(*s) == PIKE_T_INT) || -  (TYPEOF(*s) == PIKE_T_FLOAT) - #ifdef AUTO_BIGNUM -  || is_bignum_object_in_svalue(s) - #endif -  ); +  (TYPEOF(*s) == PIKE_T_FLOAT) || +  is_bignum_object_in_svalue(s));   }      /* double should be enough */   double pgtk2_get_float(struct svalue *s) {    if (TYPEOF(*s) == PIKE_T_FLOAT)    return s->u.float_number;    if (TYPEOF(*s) == PIKE_T_INT)    return (double)s->u.integer; - #ifdef AUTO_BIGNUM +     if (is_bignum_object_in_svalue(s)) {    FLOAT_TYPE f;    ref_push_type_value(float_type_string);    stack_swap();    f_cast();    f=Pike_sp[-1].u.float_number;    pop_stack();    return (double)f;    } - #endif +     return 0.0;   }      void pgtk2_free_object(struct object *o) {    free_object(o);   }      int pgtk2_is_float(struct svalue *s) {    return ((TYPEOF(*s) == PIKE_T_FLOAT) || -  (TYPEOF(*s) == PIKE_T_INT) - #ifdef AUTO_BIGNUM -  || is_bignum_object_in_svalue(s) - #endif -  ); +  (TYPEOF(*s) == PIKE_T_INT) || +  is_bignum_object_in_svalue(s));   }      void pgtk2_set_property(GObject *g, char *prop, struct svalue *sv) {    GParamSpec *gps;    GType v;    gps=g_object_class_find_property(G_OBJECT_GET_CLASS(g),prop);    if (!gps)    Pike_error("This object does not have a property called %s.\n",prop);    if (!(gps->flags & G_PARAM_WRITABLE))    Pike_error("This property is not writable.\n");