pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:8811:    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();    } -  -  /* if arr->_sizeof && arr->`[] -  array ret; ret[i]=arr[i]; -  ret=map(ret,fun,@extra); */ -  -  f = FIND_LFUN(o->prog->inherits[osub].prog, -  LFUN_INDEX) | -  FIND_LFUN(o->prog->inherits[osub].prog, -  LFUN__SIZEOF); -  -  if( f != -1 ) -  { -  struct svalue tmp; -  TYPEOF(tmp) = PIKE_T_INT; -  SUBTYPEOF(tmp) = 0; -  n=pike_sizeof(mysp-3); -  push_array(d=allocate_array(n)); -  types = 0; -  for (i=0; i<n; i++) -  { -  tmp.u.integer = i; -  object_index_no_free(ITEM(d)+i, o, osub, &tmp ); -  types |= 1 << TYPEOF(ITEM(d)[i]); +     } -  d->type_field = types; -  free_svalue(mysp-3); -  mysp[-3]=*(--Pike_sp); -  dmalloc_touch_svalue(Pike_sp); -  f_map(args); -  return; -  } -  } +        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");    }