pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:264:    */   static void f_hash_7_4(INT32 args)   {    size_t i = 0;    struct pike_string *s = Pike_sp[-args].u.string;       if(!args)    SIMPLE_TOO_FEW_ARGS_ERROR("7.4::hash",1);       if(TYPEOF(Pike_sp[-args]) != T_STRING) -  SIMPLE_BAD_ARG_ERROR("7.4::hash", 1, "string"); +  SIMPLE_ARG_TYPE_ERROR("7.4::hash", 1, "string");       i = simple_hashmem((unsigned char *)s->str, s->len<<s->size_shift,    100<<s->size_shift);       if(args > 1)    {    if(TYPEOF(Pike_sp[1-args]) != T_INT) -  SIMPLE_BAD_ARG_ERROR("7.4::hash",2,"int"); +  SIMPLE_ARG_TYPE_ERROR("7.4::hash",2,"int");       if(!Pike_sp[1-args].u.integer)    PIKE_ERROR("7.4::hash", "Modulo by zero.\n", Pike_sp, args);       i%=(unsigned INT32)Pike_sp[1-args].u.integer;    }    pop_n_elems(args);    push_int64(i);   }   
pike.git/src/builtin_functions.c:325:    *! @seealso    *! @[hash()], @[hash_7_4]    */   static void f_hash_7_0( INT32 args )   {    struct pike_string *s = Pike_sp[-args].u.string;    unsigned int i;    if(!args)    SIMPLE_TOO_FEW_ARGS_ERROR("7.0::hash",1);    if(TYPEOF(Pike_sp[-args]) != T_STRING) -  SIMPLE_BAD_ARG_ERROR("7.0::hash", 1, "string"); +  SIMPLE_ARG_TYPE_ERROR("7.0::hash", 1, "string");       if( s->size_shift )    {    f_hash_7_4( args );    return;    }       i = (unsigned int)hashstr( (unsigned char *)s->str,    MINIMUM(100,s->len));    if(args > 1)    {    if(TYPEOF(Pike_sp[1-args]) != T_INT) -  SIMPLE_BAD_ARG_ERROR("7.0::hash",2,"int"); +  SIMPLE_ARG_TYPE_ERROR("7.0::hash",2,"int");       if(!Pike_sp[1-args].u.integer)    PIKE_ERROR("7.0::hash", "Modulo by zero.\n", Pike_sp, args);       i%=(unsigned INT32)Pike_sp[1-args].u.integer;    }    pop_n_elems(args);    push_int( i );   }   
pike.git/src/builtin_functions.c:384:    */   PMOD_EXPORT void f_hash(INT32 args)   {    size_t i = 0;    struct pike_string *s;       if(!args)    SIMPLE_TOO_FEW_ARGS_ERROR("hash",1);       if(TYPEOF(Pike_sp[-args]) != T_STRING) -  SIMPLE_BAD_ARG_ERROR("hash", 1, "string"); +  SIMPLE_ARG_TYPE_ERROR("hash", 1, "string");       s = Pike_sp[-args].u.string;    switch(s->size_shift) {    case 0:    i = simple_hashmem(STR0(s), s->len, 100);    break;    case 1:    i = simple_hashmem1(STR1(s), s->len, 100);    break;    case 2:    i = simple_hashmem2(STR2(s), s->len, 100);    break;    }       if(args > 1)    {    if(TYPEOF(Pike_sp[1-args]) != T_INT) -  SIMPLE_BAD_ARG_ERROR("hash",2,"int"); +  SIMPLE_ARG_TYPE_ERROR("hash",2,"int");       if(Pike_sp[1-args].u.integer <= 0)    PIKE_ERROR("hash", "Modulo < 1.\n", Pike_sp, args);       i%=(unsigned INT32)Pike_sp[1-args].u.integer;    }    pop_n_elems(args);    push_int64(i);   }   
pike.git/src/builtin_functions.c:903:    switch(TYPEOF(Pike_sp[-args]))    {    case T_STRING:    {    struct pike_string *haystack = Pike_sp[-args].u.string;       start=0;    if(args > 2)    {    if(TYPEOF(Pike_sp[2-args]) != T_INT) -  SIMPLE_BAD_ARG_ERROR("search", 3, "int"); +  SIMPLE_ARG_TYPE_ERROR("search", 3, "int");       start=Pike_sp[2-args].u.integer;    if(start<0) {    bad_arg_error("search", Pike_sp-args, args, 3, "int(0..)", Pike_sp+2-args,    "Start must be greater or equal to zero.\n");    }    }       if(haystack->len < start)    bad_arg_error("search", Pike_sp-args, args, 3, "int(0..)", Pike_sp-args,
pike.git/src/builtin_functions.c:981:    start = -1;    }    } else if(TYPEOF(Pike_sp[1-args]) == T_STRING) {    /* Handle searching for the empty string. */    if (Pike_sp[1-args].u.string->len) {    start = string_search(haystack,    Pike_sp[1-args].u.string,    start);    }    } else { -  SIMPLE_BAD_ARG_ERROR("search", 2, "string | int"); +  SIMPLE_ARG_TYPE_ERROR("search", 2, "string | int");    }    pop_n_elems(args);    push_int64(start);    break;    }       case T_ARRAY:    start=0;    if(args > 2)    {    if(TYPEOF(Pike_sp[2-args]) != T_INT) -  SIMPLE_BAD_ARG_ERROR("search", 3, "int"); +  SIMPLE_ARG_TYPE_ERROR("search", 3, "int");       start=Pike_sp[2-args].u.integer;    if(start<0) {    bad_arg_error("search", Pike_sp-args, args, 3, "int(0..)", Pike_sp+2-args,    "Start must be greater or equal to zero.\n");    }    }    start=array_search(Pike_sp[-args].u.array,Pike_sp+1-args,start);    pop_n_elems(args);    push_int64(start);
pike.git/src/builtin_functions.c:1083:    push_undefined();    return;    }    pop_n_elems(2);    }    }    }    }    /* FALL_THROUGH */    default: -  SIMPLE_BAD_ARG_ERROR("search", 1, "string|array|mapping|object"); +  SIMPLE_ARG_TYPE_ERROR("search", 1, "string|array|mapping|object");    }   }      /*! @decl int has_prefix(string|object s, string prefix)    *!    *! Returns @expr{1@} if the string @[s] starts with @[prefix],    *! returns @expr{0@} (zero) otherwise.    *!    *! When @[s] is an object, it needs to implement    *! @[lfun::_sizeof()] and @[lfun::`[]].
pike.git/src/builtin_functions.c:1471:    *!    *! @seealso    *! @[all_constants()]    */   PMOD_EXPORT void f_add_constant(INT32 args)   {    if(args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("add_constant", 1);       if(TYPEOF(Pike_sp[-args]) != T_STRING) -  SIMPLE_BAD_ARG_ERROR("add_constant", 1, "string"); +  SIMPLE_ARG_TYPE_ERROR("add_constant", 1, "string");       if(args>1)    {    dmalloc_touch_svalue(Pike_sp-args+1);    low_add_efun(Pike_sp[-args].u.string, Pike_sp-args+1);    }else{    low_add_efun(Pike_sp[-args].u.string, 0);    }    pop_n_elems(args);   }
pike.git/src/builtin_functions.c:1661:       if (byteorder >= 2) {    if (byteorder == 2) {   #if PIKE_BYTEORDER == 1234    /* Little endian. */    byteorder = 1;   #else    byteorder = 0;   #endif    } else { -  SIMPLE_BAD_ARG_ERROR("string_to_unicode", 2, "int(0..2)|void"); +  SIMPLE_ARG_TYPE_ERROR("string_to_unicode", 2, "int(0..2)|void");    }    }       switch(in->size_shift) {    case 0:    /* Just 8bit characters */    len = in->len * 2;    out = begin_shared_string(len);    if (len) {    memset(out->str, 0, len); /* Clear the upper (and lower) byte */
pike.git/src/builtin_functions.c:1817:       if (byteorder >= 2) {    if (byteorder == 2) {   #if PIKE_BYTEORDER == 1234    /* Little endian. */    byteorder = 1;   #else    byteorder = 0;   #endif    } else { -  SIMPLE_BAD_ARG_ERROR("unicode_to_string", 2, "int(0..2)|void"); +  SIMPLE_ARG_TYPE_ERROR("unicode_to_string", 2, "int(0..2)|void");    }    }       if (byteorder !=   #if PIKE_BYTEORDER == 1234    1   #else    0   #endif    ) {
pike.git/src/builtin_functions.c:2867:    *! class containing the call has been inherited then the objects    *! surrounding the inheriting class are accessed.    */   void f_this_object(INT32 args)   {    int level, l;    struct object *o;       if (args) {    if (TYPEOF(Pike_sp[-args]) != T_INT || Pike_sp[-args].u.integer < 0) -  SIMPLE_BAD_ARG_ERROR ("this_object", 1, "a non-negative integer"); +  SIMPLE_ARG_TYPE_ERROR ("this_object", 1, "a non-negative integer");    level = Pike_sp[-args].u.integer;    }    else    level = 0;       pop_n_elems(args);       o = Pike_fp->current_object;    for (l = 0; l < level; l++) {    struct program *p = o->prog;
pike.git/src/builtin_functions.c:3016:    *! @[_exit()]    */   PMOD_EXPORT void f_exit(INT32 args)   {    static int in_exit=0;       if(args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("exit", 1);       if(TYPEOF(Pike_sp[-args]) != T_INT) -  SIMPLE_BAD_ARG_ERROR("exit", 1, "int"); +  SIMPLE_ARG_TYPE_ERROR("exit", 1, "int");       if(in_exit) Pike_error("exit already called!\n");    in_exit=1;       if(args>1 && TYPEOF(Pike_sp[1-args]) == T_STRING) {    struct svalue *s =    simple_mapping_string_lookup(get_builtin_constants(), "werror");    if (s) {    apply_svalue(s, args-1);    pop_stack();
pike.git/src/builtin_functions.c:3225:   {    struct object *o;    if(args)    {    if(TYPEOF(Pike_sp[-args]) != T_OBJECT) {    if ((TYPEOF(Pike_sp[-args]) == T_INT) &&    (!Pike_sp[-args].u.integer)) {    pop_n_elems(args);    return;    } -  SIMPLE_BAD_ARG_ERROR("destruct", 1, "object"); +  SIMPLE_ARG_TYPE_ERROR("destruct", 1, "object");    }       o=Pike_sp[-args].u.object;    }else{    if(!Pike_fp) {    PIKE_ERROR("destruct",    "Destruct called without argument from callback function.\n",    Pike_sp, args);    }    o=Pike_fp->current_object;
pike.git/src/builtin_functions.c:3326:    {    struct program *p = program_from_svalue(Pike_sp-args);    if (p) {    a = program_indices(p);    break;    }    }    /* FALL THROUGH */       default: -  SIMPLE_BAD_ARG_ERROR("indices", 1, +  SIMPLE_ARG_TYPE_ERROR("indices", 1,    "string|array|mapping|"    "multiset|object|program|function");    }    pop_n_elems(args);    push_array(a);   }      /* this should probably be moved to pike_types.c or something */   #define FIX_OVERLOADED_TYPE(n, lf, X) fix_overloaded_type(n,lf,X,CONSTANT_STRLEN(X))   /* FIXME: This function messes around with the implementation of pike_type,
pike.git/src/builtin_functions.c:3631:    {    struct program *p = program_from_svalue(Pike_sp - args);    if (p) {    a = program_values(p);    break;    }    }    /* FALL THROUGH */       default: -  SIMPLE_BAD_ARG_ERROR("values", 1, +  SIMPLE_ARG_TYPE_ERROR("values", 1,    "string|array|mapping|multiset|"    "object|program|function");    }    pop_n_elems(args);    push_array(a);   }      /*! @decl array(type(mixed)) types(string|array|mapping|multiset|object x)    *!    *! Return an array with the types of all valid indices for the value @[x].
pike.git/src/builtin_functions.c:3727:    {    struct program *p = program_from_svalue(Pike_sp-args);    if (p) {    a = program_types(p);    break;    }    }    /* FALL THROUGH */       default: -  SIMPLE_BAD_ARG_ERROR("types", 1, +  SIMPLE_ARG_TYPE_ERROR("types", 1,    "string|array|mapping|"    "multiset|object|program|function");    }    pop_n_elems(args);    push_array(a);   }      /*! @decl program|function object_program(mixed o)    *!    *! Return the program from which @[o] was instantiated. If the
pike.git/src/builtin_functions.c:3976:    case T_ARRAY:    {    struct array *a = sv->u.array;    a = reverse_array(a, start, (end < 0)?a->size:end);    pop_n_elems(args);    push_array(a);    break;    }       default: -  SIMPLE_BAD_ARG_ERROR("reverse", 1, "string|int|array"); +  SIMPLE_ARG_TYPE_ERROR("reverse", 1, "string|int|array");    }   }      /* Magic, magic and more magic */   /* Returns the index in v for the string that is the longest prefix of    * str (if any).    *    * v is the sorted (according to generic_quick_binary_strcmp()) vector    * of replacement strings. It also has the prefix forest identified.    *
pike.git/src/builtin_functions.c:4383:    {    if (args==2 &&    TYPEOF(Pike_sp[-1]) == T_MAPPING)    {    struct mapping *m = Pike_sp[-1].u.mapping;    if( (m->data->ind_types & ~BIT_STRING) ||    (m->data->val_types & ~BIT_STRING) ) {    mapping_fix_type_field(Pike_sp[-1].u.mapping);    if( (m->data->ind_types & ~BIT_STRING) ||    (m->data->val_types & ~BIT_STRING) ) { -  SIMPLE_BAD_ARG_ERROR("replace", 2, "mapping(string:string)"); +  SIMPLE_ARG_TYPE_ERROR("replace", 2, "mapping(string:string)");    }    }       stack_dup();    f_indices(1);    stack_swap();    f_values(1);    args++;    }    else
pike.git/src/builtin_functions.c:4422:    pop_n_elems(args-1);    break;    }       case T_STRING:    {    struct pike_string *s;    switch(TYPEOF(Pike_sp[1-args]))    {    default: -  SIMPLE_BAD_ARG_ERROR("replace", 2, "string|array"); +  SIMPLE_ARG_TYPE_ERROR("replace", 2, "string|array");       case T_STRING:    if(TYPEOF(Pike_sp[2-args]) != T_STRING) -  SIMPLE_BAD_ARG_ERROR("replace", 3, "string"); +  SIMPLE_ARG_TYPE_ERROR("replace", 3, "string");       s=string_replace(Pike_sp[-args].u.string,    Pike_sp[1-args].u.string,    Pike_sp[2-args].u.string);    break;       case T_ARRAY:    if (TYPEOF(Pike_sp[2-args]) == T_STRING) {    push_int(Pike_sp[1-args].u.array->size);    stack_swap();    f_allocate(2);    } else if(TYPEOF(Pike_sp[2-args]) != T_ARRAY) -  SIMPLE_BAD_ARG_ERROR("replace", 3, "array|string"); +  SIMPLE_ARG_TYPE_ERROR("replace", 3, "array|string");       s=replace_many(Pike_sp[-args].u.string,    Pike_sp[1-args].u.array,    Pike_sp[2-args].u.array);       }    pop_n_elems(args);    push_string(s);    break;    }       default: -  SIMPLE_BAD_ARG_ERROR("replace", 1, "array|mapping|string"); +  SIMPLE_ARG_TYPE_ERROR("replace", 1, "array|mapping|string");    }   }      node *optimize_replace(node *n)   {    node **arg0 = my_get_arg(&_CDR(n), 0);    struct pike_type *array_zero;    struct pike_type *mapping_zero;       if (!arg0) return NULL;
pike.git/src/builtin_functions.c:4659:    flags = mapping_get_flags(s->u.mapping);    flags = (flags & ~PIKE_WEAK_BOTH) | (ret & PIKE_WEAK_BOTH);    mapping_set_flags(s->u.mapping, flags);    break;    case T_MULTISET:    flags = multiset_get_flags (s->u.multiset);    flags = (flags & ~PIKE_WEAK_BOTH) | (ret & PIKE_WEAK_BOTH);    multiset_set_flags (s->u.multiset, flags);    break;    default: -  SIMPLE_BAD_ARG_ERROR("set_weak_flag",1,"array|mapping|multiset"); +  SIMPLE_ARG_TYPE_ERROR("set_weak_flag",1,"array|mapping|multiset");    }    pop_n_elems(args-1);   }      /*! @decl int objectp(mixed arg)    *!    *! Returns @expr{1@} if @[arg] is an object, @expr{0@} (zero) otherwise.    *!    *! @seealso    *! @[mappingp()], @[programp()], @[arrayp()], @[stringp()], @[functionp()],
pike.git/src/builtin_functions.c:5192:    *! @[Array.sort_array], @[reverse()]    */   PMOD_EXPORT void f_sort(INT32 args)   {    INT32 e,*order;    struct array *a;       if(args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("sort", 1);    if(TYPEOF(Pike_sp[-args]) != T_ARRAY) -  SIMPLE_BAD_ARG_ERROR("sort", 1, "array"); +  SIMPLE_ARG_TYPE_ERROR("sort", 1, "array");    a = Pike_sp[-args].u.array;       for(e=1;e<args;e++)    {    if(TYPEOF(Pike_sp[e-args]) != T_ARRAY) -  SIMPLE_BAD_ARG_ERROR("sort", e+1, "array"); +  SIMPLE_ARG_TYPE_ERROR("sort", e+1, "array");       if(Pike_sp[e-args].u.array->size != a->size)    bad_arg_error("sort", Pike_sp-args, args, e+1, "array", Pike_sp+e-args,    "Argument %d has wrong size.\n", (e+1));    }       if(args > 1)    {    order = stable_sort_array_destructively(a);    for(e=1;e<args;e++) order_array(Pike_sp[e-args].u.array,order);
pike.git/src/builtin_functions.c:5984:    glob=Pike_sp-args;    nglobs = 1;    }    else if( TYPEOF(Pike_sp[-args]) == PIKE_T_ARRAY)    {    struct array *ga = Pike_sp[-args].u.array;    glob = ga->item;    nglobs = ga->size;    for( i=0; i<nglobs; i++ )    if( TYPEOF(ga->item[i]) != PIKE_T_STRING ) -  SIMPLE_BAD_ARG_ERROR("glob", 1, "string|array(string)"); +  SIMPLE_ARG_TYPE_ERROR("glob", 1, "string|array(string)");    }    else -  SIMPLE_BAD_ARG_ERROR("glob", 1, "string|array(string)"); +  SIMPLE_ARG_TYPE_ERROR("glob", 1, "string|array(string)");          switch(TYPEOF(Pike_sp[1-args]))    {    case T_STRING:    i = any_does_match(glob,nglobs,Pike_sp[1-args].u.string);    pop_n_elems(2);    push_int(i);    break;       case T_ARRAY: {    INT32 j;    unsigned matches = 0;    struct svalue *res;    a=Pike_sp[1-args].u.array;       if( (a->type_field & ~BIT_STRING) &&    (array_fix_type_field(a) & ~BIT_STRING) ) -  SIMPLE_BAD_ARG_ERROR("glob", 2, "string|array(string)"); +  SIMPLE_ARG_TYPE_ERROR("glob", 2, "string|array(string)");       check_stack(120);    BEGIN_AGGREGATE_ARRAY (MINIMUM (a->size, 120)) {    res = Pike_sp - 1;       for(i=0;i<a->size;i++)    {    if(any_does_match(glob,nglobs,ITEM(a)[i].u.string) )    {    matches++;
pike.git/src/builtin_functions.c:6031:    /* We know what this array contains - avoid array_fix_type_field    * in END_AGGREGATE_ARRAY. */    res->u.array->type_field = matches ? BIT_STRING : 0;    } END_AGGREGATE_ARRAY;       stack_pop_n_elems_keep_top (2);    break;    }       default: -  SIMPLE_BAD_ARG_ERROR("glob", 2, "string|array(string)"); +  SIMPLE_ARG_TYPE_ERROR("glob", 2, "string|array(string)");    }   }      /* comb_merge */      /*! @module Array    */      /*! @decl array(int) interleave_array(array(mapping(int:mixed)) tab)    *!
pike.git/src/builtin_functions.c:6064:    int nelems = 0;    int i;       get_all_args("interleave_array", args, "%a", &arr);       /* We're not interrested in any other arguments. */    pop_n_elems(args-1);       if( (arr->type_field & ~BIT_MAPPING) &&    (array_fix_type_field(arr) & ~BIT_MAPPING) ) -  SIMPLE_BAD_ARG_ERROR("interleave_array", 1, "array(mapping(int:mixed))"); +  SIMPLE_ARG_TYPE_ERROR("interleave_array", 1, "array(mapping(int:mixed))");       /* The order array */    ref_push_array(arr);    f_indices(1);    order = Pike_sp[-1].u.array;       /* The min array */    push_array(min = allocate_array(arr->size));       /* Initialize the min array */
pike.git/src/builtin_functions.c:7548:    *! @seealso    *! @[master()]    */   PMOD_EXPORT void f_replace_master(INT32 args)   {    struct object *new_master;       if(!args)    SIMPLE_TOO_FEW_ARGS_ERROR("replace_master", 1);    if(TYPEOF(Pike_sp[-args]) != T_OBJECT) -  SIMPLE_BAD_ARG_ERROR("replace_master", 1, "object"); +  SIMPLE_ARG_TYPE_ERROR("replace_master", 1, "object");    new_master = Pike_sp[-args].u.object;    if(!new_master->prog)    bad_arg_error("replace_master", Pike_sp-args, args, 1, "object", Pike_sp-args,    "Called with destructed object.\n");       if (SUBTYPEOF(Pike_sp[-args]))    bad_arg_error("replace_master", Pike_sp-args, args, 1, "object", Pike_sp-args,    "Subtyped master objects are not supported yet.\n");       push_static_text ("is_pike_master");
pike.git/src/builtin_functions.c:7810: Inside #if defined(PROFILING)
  {    struct program *prog = 0;    int num_functions;    int i;       if (!args) {    SIMPLE_TOO_FEW_ARGS_ERROR("get_profiling_info", 1);    }    prog = program_from_svalue(Pike_sp-args);    if(!prog) -  SIMPLE_BAD_ARG_ERROR("get_profiling_info", 1, "program"); +  SIMPLE_ARG_TYPE_ERROR("get_profiling_info", 1, "program");       /* ({ num_clones, ([ "fun_name":({ num_calls, total_time, self_time }) ]) })    */       pop_n_elems(args-1);    args = 1;       push_int(prog->num_clones);       for(num_functions=i=0; i<(int)prog->num_identifiers; i++) {
pike.git/src/builtin_functions.c:7956:    *! @[`/()], @[`*()], @[`+()], @[`-()], @[everynth()]    */   PMOD_EXPORT void f_splice(INT32 args)   {    struct array *out;    INT32 size=0x7fffffff;    INT32 i,j,k;       for(i=0;i<args;i++)    if (TYPEOF(Pike_sp[i-args]) != T_ARRAY) -  SIMPLE_BAD_ARG_ERROR("splice", i+1, "array"); +  SIMPLE_ARG_TYPE_ERROR("splice", i+1, "array");    else    if (Pike_sp[i-args].u.array->size < size)    size=Pike_sp[i-args].u.array->size;       if(!args || !size)    {    push_empty_array();    return;    }   
pike.git/src/builtin_functions.c:8050:    struct array *in;    struct array *outinner;    INT32 sizeininner=0,sizein=0;    INT32 j,i;    TYPE_FIELD type=0;       if (args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("transpose", 1);       if (TYPEOF(Pike_sp[-args]) != T_ARRAY) -  SIMPLE_BAD_ARG_ERROR("transpose", 1, "array(array)"); +  SIMPLE_ARG_TYPE_ERROR("transpose", 1, "array(array)");       in=Pike_sp[-args].u.array;    sizein=in->size;       if(!sizein)    {    push_empty_array();    return;    }       if( (in->type_field != BIT_ARRAY) &&    (array_fix_type_field(in) != BIT_ARRAY) ) -  SIMPLE_BAD_ARG_ERROR("transpose", 1, "array(array)"); +  SIMPLE_ARG_TYPE_ERROR("transpose", 1, "array(array)");       sizeininner=in->item->u.array->size;       for(i=1 ; i<sizein; i++)    if (sizeininner!=(in->item+i)->u.array->size)    Pike_error("The array given as argument 1 to transpose must contain arrays of the same size.\n");       out=allocate_array(sizeininner);       for(i=0; i<sizein; i++)
pike.git/src/builtin_functions.c:8296:    free_svalue(mysp-3);    mysp[-3]=*(--Pike_sp);    dmalloc_touch_svalue(Pike_sp);    f_map(args);    return;    }    pop_stack();    }    }    -  SIMPLE_BAD_ARG_ERROR("map",1, +  SIMPLE_ARG_TYPE_ERROR("map",1,    "object that works in map");       default: -  SIMPLE_BAD_ARG_ERROR("map",1, +  SIMPLE_ARG_TYPE_ERROR("map",1,    "array|mapping|program|function|"    "multiset|string|object");    }       if (UNSAFE_IS_ZERO (Pike_sp-args+1)) {    free_svalue (Pike_sp-args+1);    move_svalue (Pike_sp-args+1, Pike_sp-args);    mark_free_svalue (Pike_sp-args);    mega_apply (APPLY_STACK, args-1, 0, 0);    stack_pop_keep_top();
pike.git/src/builtin_functions.c:8426:    push_array_items(mysp[-1].u.array);    f_call_function(splice+1);    stack_pop_to_no_free (ITEM(d) + i);    types |= 1 << TYPEOF(ITEM(d)[i]);    }    d->type_field = types;    stack_pop_n_elems_keep_top(3); /* fun arr extra d -> d */    return;       default: -  SIMPLE_BAD_ARG_ERROR("map",2, +  SIMPLE_ARG_TYPE_ERROR("map",2,    "function|program|object|"    "string|int(0..0)|multiset");    }   }      /*! @decl mixed filter(mixed arr, void|mixed fun, mixed ...extra)    *!    *! Filters the elements in @[arr] through @[fun].    *!    *! @[arr] is treated as a set of elements to be filtered, as
pike.git/src/builtin_functions.c:8525:    struct svalue *mysp;       if (args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("filter", 1);       switch (TYPEOF(Pike_sp[-args]))    {    case T_ARRAY:    if (args >= 2 && TYPEOF(Pike_sp[1-args]) == T_ARRAY) {    if (Pike_sp[1-args].u.array->size != Pike_sp[-args].u.array->size) -  SIMPLE_BAD_ARG_ERROR("filter", 2, "array of same size as the first"); +  SIMPLE_ARG_TYPE_ERROR("filter", 2, "array of same size as the first");    pop_n_elems(args-2);    }    else {    memmove(Pike_sp-args+1,Pike_sp-args,args*sizeof(*Pike_sp));    dmalloc_touch_svalue(Pike_sp);    Pike_sp++;    add_ref_svalue(Pike_sp-args);    f_map(args);    }   
pike.git/src/builtin_functions.c:8681:    free_svalue(mysp-3);    mysp[-3]=*(--Pike_sp);    dmalloc_touch_svalue(Pike_sp);    f_filter(args);    return;    }    pop_stack();    }    }    -  SIMPLE_BAD_ARG_ERROR("filter",1, +  SIMPLE_ARG_TYPE_ERROR("filter",1,    "...|object that can be cast to array, multiset or mapping");       default: -  SIMPLE_BAD_ARG_ERROR("filter",1, +  SIMPLE_ARG_TYPE_ERROR("filter",1,    "array|mapping|program|function|"    "multiset|string|object");    }   }      /* map() and filter() inherit sideeffects from their    * second argument.    */   static node *fix_map_node_info(node *n)   {
pike.git/src/builtin_functions.c:8968:    struct svalue *arg;    struct object *par;    int parid,e,q=0;       get_all_args("inherit_list",args,"%*",&arg);    if(TYPEOF(Pike_sp[-args]) == T_OBJECT)    f_object_program(1);       p=program_from_svalue(arg);    if(!p) -  SIMPLE_BAD_ARG_ERROR("inherit_list", 1, "program"); +  SIMPLE_ARG_TYPE_ERROR("inherit_list", 1, "program");       if(TYPEOF(*arg) == T_FUNCTION)    {    par=arg->u.object;    parid = SUBTYPEOF(*arg);    }else{    par=0;    parid=-1;    }