pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:8776:    struct object *o = mysp[-3].u.object;    INT16 osub = SUBTYPEOF(mysp[-3]);    int f = FIND_LFUN(o->prog->inherits[osub].prog,    LFUN_CAST);       if( f!=-1 )    {       ref_push_string(literal_array_string);    apply_low(o, f, 1); -  +     if (TYPEOF(Pike_sp[-1]) == T_ARRAY)    {    free_svalue(mysp-3);    mysp[-3]=*(--Pike_sp);    dmalloc_touch_svalue(Pike_sp);    f_map(args);    return;    }    pop_stack();   
pike.git/src/builtin_functions.c:9153:    Pike_sp--;    dmalloc_touch_svalue(Pike_sp);    Pike_sp[-args]=Pike_sp[0]; /* move it back */    f_filter(args);    o_cast(NULL,T_STRING); /* cast the array to a string */    return;       case T_OBJECT:    mysp=Pike_sp+3-args;    -  push_svalue(mysp-3); -  push_constant_text("cast"); -  f_arrow(2); -  if (!UNSAFE_IS_ZERO(Pike_sp-1)) +     { -  pop_stack(); +  struct object *o = mysp[-3].u.object; +  int f = FIND_LFUN(o->prog->inherits[SUBTYPEOF(mysp[-3])].prog, +  LFUN_CAST);    -  +  if( f!=-1 ) +  {    ref_push_string(literal_array_string); -  /* FIXME: Object subtype! */ -  safe_apply(mysp[-3].u.object,"cast",1); +  apply_low(o, f, 1);    if (TYPEOF(Pike_sp[-1]) == T_ARRAY)    {    free_svalue(mysp-3);    mysp[-3]=*(--Pike_sp);    dmalloc_touch_svalue(Pike_sp);    f_filter(args);    return;    }    pop_stack();       ref_push_string(literal_mapping_string); -  /* FIXME: Object subtype! */ -  safe_apply(mysp[-3].u.object,"cast",1); +  apply_low(o, f, 1);    if (TYPEOF(Pike_sp[-1]) == T_MAPPING)    {    free_svalue(mysp-3);    mysp[-3]=*(--Pike_sp);    dmalloc_touch_svalue(Pike_sp);    f_filter(args);    return;    }    pop_stack();       ref_push_string(literal_multiset_string); -  /* FIXME: Object subtype! */ -  safe_apply(mysp[-3].u.object,"cast",1); +  apply_low(o, f, 1);    if (TYPEOF(Pike_sp[-1]) == T_MULTISET)    {    free_svalue(mysp-3);    mysp[-3]=*(--Pike_sp);    dmalloc_touch_svalue(Pike_sp);    f_filter(args);    return;    }    pop_stack();    } -  pop_stack(); +  }       SIMPLE_BAD_ARG_ERROR("filter",1,    "...|object that can be cast to array, multiset or mapping");       default:    SIMPLE_BAD_ARG_ERROR("filter",1,    "array|mapping|program|function|"    "multiset|string|object");    }   }