pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:655:    return;    }       orig = Pike_sp[-args].u.string;       if( orig->flags & STRING_IS_LOWERCASE )    return;       ret = begin_wide_shared_string(orig->len, orig->size_shift);    -  MEMCPY(ret->str, orig->str, orig->len << orig->size_shift); +  memcpy(ret->str, orig->str, orig->len << orig->size_shift);       i = orig->len;       if (!orig->size_shift) {    p_wchar0 *str = STR0(ret);       while(i--) {    DO_LOWER_CASE_SHIFT0(str[i]);    }    } else if (orig->size_shift == 1) {
pike.git/src/builtin_functions.c:731:    return;    }       orig = Pike_sp[-args].u.string;    if( orig->flags & STRING_IS_UPPERCASE )    {    return;    }       ret=begin_wide_shared_string(orig->len,orig->size_shift); -  MEMCPY(ret->str, orig->str, orig->len << orig->size_shift); +  memcpy(ret->str, orig->str, orig->len << orig->size_shift);       i = orig->len;       if (!orig->size_shift) {    p_wchar0 *str = STR0(ret);       while(i--) {    if(str[i]!=0xff && str[i]!=0xb5) {    DO_UPPER_CASE_SHIFT0(str[i]);    } else {
pike.git/src/builtin_functions.c:1198:    }       /* Trivial cases. */    if ((a == b)||(!b->len)) {    pop_n_elems(args);    push_int(1);    return;    }       if (a->size_shift == b->size_shift) { -  int res = !MEMCMP(a->str, b->str, b->len << b->size_shift); +  int res = !memcmp(a->str, b->str, b->len << b->size_shift);    pop_n_elems(args);    push_int(res);    return;    }       /* At this point a->size_shift > b->size_shift */   #define TWO_SHIFTS(S1, S2) ((S1)|((S2)<<2))    switch(TWO_SHIFTS(a->size_shift, b->size_shift)) {   #define CASE_SHIFT(S1, S2) \    case TWO_SHIFTS(S1, S2): \
pike.git/src/builtin_functions.c:1271:    }       /* Trivial cases. */    if ((a == b)||(!b->len)) {    pop_n_elems(args);    push_int(1);    return;    }       if (a->size_shift == b->size_shift) { -  int res = !MEMCMP(a->str + ((a->len - b->len)<<b->size_shift), b->str, +  int res = !memcmp(a->str + ((a->len - b->len)<<b->size_shift), b->str,    b->len << b->size_shift);    pop_n_elems(args);    push_int(res);    return;    }       /* At this point a->size_shift > b->size_shift */   #define TWO_SHIFTS(S1, S2) ((S1)|((S2)<<2))    switch(TWO_SHIFTS(a->size_shift, b->size_shift)) {   #define CASE_SHIFT(S1, S2) \
pike.git/src/builtin_functions.c:1689:    ptrdiff_t i;       get_all_args("string_to_unicode", args, "%W", &in);       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 */ +  memset(out->str, 0, len); /* Clear the upper (and lower) byte */   #ifdef PIKE_DEBUG    if (d_flag) {    for(i = len; i--;) {    if (out->str[i]) { -  Pike_fatal("MEMSET didn't clear byte %ld of %ld\n", +  Pike_fatal("memset didn't clear byte %ld of %ld\n",    PTRDIFF_T_TO_LONG(i+1),    PTRDIFF_T_TO_LONG(len));    }    }    }   #endif /* PIKE_DEBUG */    for(i = in->len; i--;) {    out->str[i * 2 + 1] = in->str[i];    }    }
pike.git/src/builtin_functions.c:1718:    /* 16 bit characters */    /* FIXME: Should we check for 0xfffe & 0xffff here too? */    len = in->len * 2;    out = begin_shared_string(len);   #if (PIKE_BYTEORDER == 4321)    /* Big endian -- We don't need to do much...    *    * FIXME: Future optimization: Check if refcount is == 1,    * and perform sufficient magic to be able to convert in place.    */ -  MEMCPY(out->str, in->str, len); +  memcpy(out->str, in->str, len);   #else    /* Other endianness, may need to do byte-order conversion also. */    {    p_wchar1 *str1 = STR1(in);    for(i = in->len; i--;) {    unsigned INT32 c = str1[i];    out->str[i * 2 + 1] = c & 0xff;    out->str[i * 2] = c >> 8;    }    }
pike.git/src/builtin_functions.c:1897:       } else       str2[i] = str0[-1];       } else    /*    * FIXME: Future optimization: Perform sufficient magic    * to do the conversion in place if the ref-count is == 1.    */ -  MEMCPY(out->str, (char *)(str0-len), len*2); +  memcpy(out->str, str0-len, len*2);    } else {    /* Reverse endian */       if (num_surrogates) {    /* Convert surrogates */       p_wchar2 *str2 = STR2(out);       for (i = len; i--; --str0) {   
pike.git/src/builtin_functions.c:4171:    if (ctx->empty_repl) add_ref(ctx->empty_repl);    for (e = 0; e < num; e++) {    add_ref(ctx->v[e].ind);    add_ref(ctx->v[e].val);    }    }       fsort((char *)ctx->v, num, sizeof(struct replace_many_tupel),    (fsortfun)replace_sortfun);    -  MEMSET(ctx->set_start, 0, sizeof(ctx->set_start)); -  MEMSET(ctx->set_end, 0, sizeof(ctx->set_end)); +  memset(ctx->set_start, 0, sizeof(ctx->set_start)); +  memset(ctx->set_end, 0, sizeof(ctx->set_end));    ctx->other_start = num;       for(e=0;e<num;e++)    {    {    p_wchar2 x;       if (ctx->v[num-1-e].ind->len) {    x=index_shared_string(ctx->v[num-1-e].ind,0);    if ((size_t) x < NELEM(ctx->set_start))
pike.git/src/builtin_functions.c:5498: Inside #if defined(PIKE_DEBUG) and #if defined(YYDEBUG)
      get_all_args("_compiler_trace", args, "%i", &yyd);    pop_n_elems(args);    push_int(yydebug);    yydebug = yyd;   }      #endif /* YYDEBUG */   #endif    - #if defined(HAVE_LOCALTIME) || defined(HAVE_GMTIME) +    static void encode_struct_tm(struct tm *tm)   {    push_static_text("sec");    push_int(tm->tm_sec);    push_static_text("min");    push_int(tm->tm_min);    push_static_text("hour");    push_int(tm->tm_hour);       push_static_text("mday");
pike.git/src/builtin_functions.c:5522: Inside #if defined(HAVE_LOCALTIME) || defined(HAVE_GMTIME)
   push_static_text("year");    push_int(tm->tm_year);       push_static_text("wday");    push_int(tm->tm_wday);    push_static_text("yday");    push_int(tm->tm_yday);    push_static_text("isdst");    push_int(tm->tm_isdst);   } - #endif +     - #if defined (HAVE_GMTIME) || defined (HAVE_GMTIME_R) || defined (HAVE_GMTIME_S) +    /*! @decl mapping(string:int) gmtime(int timestamp)    *!    *! Convert seconds since 00:00:00 UTC, Jan 1, 1970 into components.    *!    *! This function works like @[localtime()] but the result is    *! not adjusted for the local time zone.    *!    *! @seealso    *! @[localtime()], @[time()], @[ctime()], @[mktime()]    */
pike.git/src/builtin_functions.c:5568:   #endif    if (!tm) Pike_error ("gmtime() on this system cannot handle "    "the timestamp %"PRINTLONGEST"d.\n", (LONGEST) t);    pop_n_elems(args);    encode_struct_tm(tm);       push_static_text("timezone");    push_int(0);    f_aggregate_mapping(20);   } - #endif +     - #ifdef HAVE_LOCALTIME +    /*! @decl mapping(string:int) localtime(int timestamp)    *!    *! Convert seconds since 00:00:00 UTC, 1 Jan 1970 into components.    *!    *! @returns    *! This function returns a mapping with the following components:    *! @mapping    *! @member int(0..60) "sec"    *! Seconds over the minute.    *! @member int(0..59) "min"
pike.git/src/builtin_functions.c:5645:    push_int(-tm->__tm_gmtoff);   #elif defined(HAVE_EXTERNAL_TIMEZONE)    /* Assume dst is one hour. */    push_int(timezone - 3600*tm->tm_isdst);   #else    /* Assume dst is one hour. */    push_int(-3600*tm->tm_isdst);   #endif    f_aggregate_mapping(20);   } - #endif +     - #if defined (HAVE_GMTIME) || defined (HAVE_LOCALTIME) -  +    #define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)      static const int mon_lengths[2][12] = {    {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},    {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}   };      static void normalize_date (struct tm *t)   /* Normalizes t->tm_mday and t->tm_mon. */   {
pike.git/src/builtin_functions.c:5868:    else    return 0;    });    }       CHECKED_ADD (current_ts, displacement, return 0);       *result = current_ts;    return 1;   } - #endif /* HAVE_GMTIME || HAVE_LOCALTIME */ +     - #if defined (HAVE_MKTIME) || defined (HAVE_LOCALTIME) +    /*! @decl int mktime(mapping(string:int) tm)    *! @decl int mktime(int sec, int min, int hour, int mday, int mon, int year, @    *! int|void isdst, int|void tz)    *!    *! This function converts information about date and time into an integer    *! which contains the number of seconds since 00:00:00 UTC, Jan 1, 1970.    *!    *! You can either call this function with a mapping containing the    *! following elements:    *! @mapping
pike.git/src/builtin_functions.c:5924: Inside #if defined (HAVE_MKTIME) || defined (HAVE_LOCALTIME)
   INT_TYPE sec, min, hour, mday, mon, year;    INT_TYPE isdst = -1, tz = 0;    struct tm date;    time_t retval;       if (args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("mktime", 1);       if(args == 1)    { -  MEMSET(&date, 0, sizeof(date)); +  memset(&date, 0, sizeof(date));       push_static_text("sec");    push_static_text("min");    push_static_text("hour");    push_static_text("mday");    push_static_text("mon");    push_static_text("year");    push_static_text("isdst");    push_static_text("timezone");    f_aggregate(8);
pike.git/src/builtin_functions.c:5946: Inside #if defined (HAVE_MKTIME) || defined (HAVE_LOCALTIME)
   Pike_sp--;    dmalloc_touch_svalue(Pike_sp);    push_array_items(Pike_sp->u.array);       args=8;    }       get_all_args("mktime",args, "%i%i%i%i%i%i.%i%i",    &sec, &min, &hour, &mday, &mon, &year, &isdst, &tz);    -  MEMSET(&date, 0, sizeof(date)); +  memset(&date, 0, sizeof(date));    date.tm_sec=sec;    date.tm_min=min;    date.tm_hour=hour;    date.tm_mday=mday;    date.tm_mon=mon;    date.tm_year=year;    date.tm_isdst=isdst;       /* date.tm_zone = NULL; */    - #ifdef HAVE_GMTIME +     if((args > 7) && (SUBTYPEOF(Pike_sp[7-args]) == NUMBER_NUMBER))    {    /* UTC-relative time. Use gmtime. */    if (!my_time_inverse (&date, &retval, gmtime))    PIKE_ERROR("mktime", "Time conversion failed.\n", Pike_sp, args);    retval += tz;    } else - #endif /* HAVE_GMTIME */ +        { - #ifndef HAVE_GMTIME - #ifdef STRUCT_TM_HAS_GMTOFF -  /* BSD-style */ -  date.tm_gmtoff = 0; - #else - #ifdef STRUCT_TM_HAS___TM_GMTOFF -  /* (Old) Linux-style */ -  date.__tm_gmtoff = 0; - #else -  if((args > 7) && (SUBTYPEOF(Pike_sp[7-args]) == NUMBER_NUMBER)) -  { -  /* Pre-adjust for the timezone. -  * -  * Note that pre-adjustment must be done on AIX for dates -  * near Jan 1, 1970, since AIX mktime(3) doesn't support -  * negative time. -  */ -  date.tm_sec += tz - #ifdef HAVE_EXTERNAL_TIMEZONE -  - timezone - #endif /* HAVE_EXTERNAL_TIMEZONE */ -  ; -  } - #endif /* STRUCT_TM_HAS___TM_GMTOFF */ - #endif /* STRUCT_TM_HAS_GMTOFF */ - #endif /* !HAVE_GMTIME */ -  - #ifdef HAVE_MKTIME +     retval = mktime(&date);    if (retval == -1) - #endif +     { - #ifdef HAVE_LOCALTIME +     /* mktime might fail on dates before 1970 (e.g. GNU libc 2.3.2),    * so try our own inverse function with localtime.    *    * Note that localtime on Win32 will also fail for dates before 1970.    */    if (!my_time_inverse (&date, &retval, localtime)) - #endif +     PIKE_ERROR("mktime", "Time conversion unsuccessful.\n", Pike_sp, args);    } -  - #if !defined (HAVE_GMTIME) && (defined(STRUCT_TM_HAS_GMTOFF) || defined(STRUCT_TM_HAS___TM_GMTOFF)) -  if((args > 7) && (SUBTYPEOF(Pike_sp[7-args]) == NUMBER_NUMBER)) -  { -  /* Post-adjust for the timezone. -  * -  * Note that tm_gmtoff has the opposite sign of timezone. -  * -  * Note also that it must be post-adjusted, since the gmtoff -  * field is set by mktime(3). -  */ - #ifdef STRUCT_TM_HAS_GMTOFF -  retval += tz + date.tm_gmtoff; - #else -  retval += tz + date.__tm_gmtoff; - #endif /* STRUCT_TM_HAS_GMTOFF */ +     } - #endif /* !HAVE_GMTIME && (STRUCT_TM_HAS_GMTOFF || STRUCT_TM_HAS___TM_GMTOFF) */ +     -  } -  +     pop_n_elems(args);   #if SIZEOF_TIME_T > SIZEOF_INT_TYPE    push_int64 (retval);   #else    push_int(retval);   #endif   } - #define GOT_F_MKTIME - #endif /* HAVE_MKTIME || HAVE_LOCALTIME */ +       /* Common case: both strings are 8bit. */   static int does_match_8_8( const unsigned char *s, int j, int sl,    const unsigned char *m, int i, int ml)   {    for (; i<ml; i++)    {    switch (m[i])    {    case '?':
pike.git/src/builtin_functions.c:6382:    int minfree = 0;       /* Initialize the lookup table */    max += 1;    max *= 2;    /* max will be the padding at the end. */    size = (nelems + max) * 8; /* Initial size */    if (!(tab = malloc(size + max))) {    SIMPLE_OUT_OF_MEMORY_ERROR("interleave_array", size+max);    } -  MEMSET(tab, 0, size + max); +  memset(tab, 0, size + max);       for (i = 0; i < order->size; i++) {    int low = ITEM(min)[i].u.integer;    int j = ITEM(order)[i].u.integer;    int offset = 0;    int ok = 0;    struct mapping *m;    struct mapping_data *md;    INT32 e;    struct keypair *k;
pike.git/src/builtin_functions.c:6434:    ITEM(min)[i].u.integer = offset;       /* Check need for realloc */    if (offset >= size) {    char *newtab = realloc(tab, size*2 + max);    if (!newtab) {    free(tab);    Pike_error("Couldn't extend table!\n");    }    tab = newtab; -  MEMSET(tab + size + max, 0, size); +  memset(tab + size + max, 0, size);    size = size * 2;    }    }    free(tab);    }       /* We want these two to survive the stackpopping. */    add_ref(min);    add_ref(order);   
pike.git/src/builtin_functions.c:6556:    *! ordered sequence of elements in the array.    *!    *! @seealso    *! @[diff()]    */   static void f_longest_ordered_sequence(INT32 args)   {    struct array *a = NULL;    struct array *aa = NULL;    -  get_all_args("Array.longest_ordered_sequence", args, "%a", &a); +  get_all_args("longest_ordered_sequence", args, "%a", &a);       /* THREADS_ALLOW(); */       aa = longest_ordered_sequence(a);       /* THREADS_DISALLOW(); */       if (!aa) { -  SIMPLE_OUT_OF_MEMORY_ERROR("Array.longest_ordered_sequence", +  SIMPLE_OUT_OF_MEMORY_ERROR("longest_ordered_sequence",    (int)sizeof(int *)*a->size*2);    }       pop_n_elems(args);    push_array(aa);   }      /**** diff ************************************************************/      static struct array* diff_compare_table(struct array *a,struct array *b,int *u)
pike.git/src/builtin_functions.c:8631:    *! @item mapping    *! @[fun] is applied to the values, and each result is assigned    *! to the same index in a new mapping, which is returned.    *!    *! @item program    *! The program is treated as a mapping containing the    *! identifiers that are indexable from it and their values.    *!    *! @item object    *! If there is a @[lfun::cast] method in the object, it's -  *! called -  *! to try to cast the object to an array, a mapping, or a -  *! multiset, in that order, which is then handled as described -  *! above. +  *! called to try to cast the object to an array, a mapping, or +  *! a multiset, in that order, which is then handled as +  *! described above.    *! @enddl    *!    *! @[fun] is applied in different ways depending on its type:    *!    *! @dl    *! @item function    *! @[fun] is called for each element. It gets the current    *! element as the first argument and @[extra] as the rest. The    *! result of the call is collected.    *!
pike.git/src/builtin_functions.c:8758:    return;       case T_OBJECT:    /* if arr->cast :    try map((array)arr,fun,@extra);    try map((mapping)arr,fun,@extra);    try map((multiset)arr,fun,@extra); */       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; +  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); -  /* 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_map(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_map(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_map(args);    return;    }    pop_stack();    } -  pop_stack(); -  -  /* if arr->_sizeof && arr->`[] -  array ret; ret[i]=arr[i]; -  ret=map(ret,fun,@extra); */ -  -  /* class myarray { int a0=1,a1=2; int `[](int what) { return ::`[]("a"+what); } int _sizeof() { return 2; } } -  map(myarray(),lambda(int in){ werror("in=%d\n",in); }); */ -  -  push_svalue(mysp-3); -  push_constant_text("`[]"); -  f_arrow(2); -  push_svalue(mysp-3); -  push_constant_text("_sizeof"); -  f_arrow(2); -  if (!UNSAFE_IS_ZERO(Pike_sp-2)&&!UNSAFE_IS_ZERO(Pike_sp-1)) -  { -  f_call_function(1); -  if (TYPEOF(Pike_sp[-1]) != T_INT) -  SIMPLE_BAD_ARG_ERROR("map", 1, -  "object sizeof() returning integer"); -  n=Pike_sp[-1].u.integer; -  pop_stack(); -  push_array(d=allocate_array(n)); -  types = 0; -  stack_swap(); -  for (i=0; i<n; i++) -  { -  stack_dup(); /* `[] */ -  push_int(i); -  f_call_function(2); -  stack_pop_to_no_free (ITEM(d) + i); -  types |= 1 << TYPEOF(*ITEM(d)); +     } -  d->type_field = types; -  pop_stack(); -  free_svalue(mysp-3); -  mysp[-3]=*(--Pike_sp); -  dmalloc_touch_svalue(Pike_sp); -  f_map(args); -  return; -  } -  pop_stack(); -  pop_stack(); +        SIMPLE_BAD_ARG_ERROR("map",1,    "object that works in map");       default:    SIMPLE_BAD_ARG_ERROR("map",1,    "array|mapping|program|function|"    "multiset|string|object");    }   
pike.git/src/builtin_functions.c:9082:       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");    pop_n_elems(args-2);    }    else { -  MEMMOVE(Pike_sp-args+1,Pike_sp-args,args*sizeof(*Pike_sp)); +  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);    }       f=Pike_sp[-1].u.array;    a=Pike_sp[-2].u.array;    n=a->size;    for (k=m=i=0; i<n; i++)
pike.git/src/builtin_functions.c:9120:    if (k > 1) f_add(k);    stack_pop_2_elems_keep_top();    return;       case T_MAPPING:    case T_PROGRAM:    case T_FUNCTION:    /* mapping ret =    mkmapping(indices(arr),    map(values(arr),fun,@extra)); */ -  MEMMOVE(Pike_sp-args+2,Pike_sp-args,args*sizeof(*Pike_sp)); +  memmove(Pike_sp-args+2,Pike_sp-args,args*sizeof(*Pike_sp));    Pike_sp+=2;    mark_free_svalue (Pike_sp-args-2);    mark_free_svalue (Pike_sp-args-1);       push_svalue(Pike_sp-args);    f_indices(1);    dmalloc_touch_svalue(Pike_sp-1);    Pike_sp--;    Pike_sp[-args-2]=*Pike_sp;    dmalloc_touch_svalue(Pike_sp);
pike.git/src/builtin_functions.c:9189:    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");    }   }
pike.git/src/builtin_functions.c:10086:       /* FIXME: Could have a stricter type. */    ADD_EFUN("__get_first_arg_type", f___get_first_arg_type,    tFunc(tType(tCallable), tType(tMix)),    OPT_TRY_OPTIMIZE);       ADD_EFUN("__get_type_attributes", f___get_type_attributes,    tFunc(tType(tMix), tArr(tString)),    OPT_TRY_OPTIMIZE);    - #ifdef HAVE_LOCALTIME -  +    /* function(int:mapping(string:int)) */    ADD_EFUN("localtime",f_localtime,    tFunc(tInt,tMap(tStr,tInt)),OPT_EXTERNAL_DEPEND); - #endif - #ifdef HAVE_GMTIME +       /* function(int:mapping(string:int)) */    ADD_EFUN("gmtime",f_gmtime,tFunc(tInt,tMap(tStr,tInt)),OPT_TRY_OPTIMIZE); - #endif +     - #ifdef GOT_F_MKTIME -  +    /* function(int,int,int,int,int,int,int,void|int:int)|function(object|mapping:int) */    ADD_EFUN("mktime",f_mktime,    tOr(tFunc(tInt tInt tInt tInt tInt tInt    tOr(tVoid,tInt) tOr(tVoid,tInt),tInt),    tFunc(tOr(tObj,tMapping),tInt)),OPT_TRY_OPTIMIZE); - #endif +       /* function(:void) */    ADD_EFUN("_verify_internals",f__verify_internals,    tFunc(tNone,tVoid),OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND);      #ifdef PIKE_DEBUG      /* function(int:int) */    ADD_EFUN("_debug",f__debug,    tFunc(tIntPos,tIntPos),OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND);