pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:261:    *! @[hash()], @[7.0::hash()]    */   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(Pike_sp[-args].type != T_STRING) +  if(TYPEOF(Pike_sp[-args]) != T_STRING)    SIMPLE_BAD_ARG_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(Pike_sp[1-args].type != T_INT) +  if(TYPEOF(Pike_sp[1-args]) != T_INT)    SIMPLE_BAD_ARG_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:327:    *!    *! @seealso    *! @[hash()], @[7.4::hash()]    */   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(Pike_sp[-args].type != T_STRING) +  if(TYPEOF(Pike_sp[-args]) != T_STRING)    SIMPLE_BAD_ARG_ERROR("7.0::hash", 1, "string");       if( s->size_shift )    {    f_hash_7_4( args );    return;    }       i = DO_NOT_WARN((unsigned int)hashstr( (unsigned char *)s->str,    MINIMUM(100,s->len)));    if(args > 1)    { -  if(Pike_sp[1-args].type != T_INT) +  if(TYPEOF(Pike_sp[1-args]) != T_INT)    SIMPLE_BAD_ARG_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:389:    *! @[7.0::hash()], @[7.4::hash()], @[hash_value]    */   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(Pike_sp[-args].type != T_STRING) +  if(TYPEOF(Pike_sp[-args]) != T_STRING)    SIMPLE_BAD_ARG_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;
pike.git/src/builtin_functions.c:412: Inside #if defined(PIKE_DEBUG)
   break;   #ifdef PIKE_DEBUG    default:    Pike_fatal("hash(): Unsupported string shift: %d\n", s->size_shift);    break;   #endif    }       if(args > 1)    { -  if(Pike_sp[1-args].type != T_INT) +  if(TYPEOF(Pike_sp[1-args]) != T_INT)    SIMPLE_BAD_ARG_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:656:    *! @[upper_case()], @[Locale.Charset.decoder]    */   PMOD_EXPORT void f_lower_case(INT32 args)   {    ptrdiff_t i;    struct pike_string *orig;    struct pike_string *ret;       check_all_args("lower_case", args, BIT_STRING|BIT_INT, 0);    -  if (Pike_sp[-args].type == T_INT) { +  if (TYPEOF(Pike_sp[-args]) == T_INT) {    /* NOTE: Performs the case change in place. */    DO_LOWER_CASE(Pike_sp[-args].u.integer);    pop_n_elems(args-1);    return;    }       orig = Pike_sp[-args].u.string;    ret = begin_wide_shared_string(orig->len, orig->size_shift);       MEMCPY(ret->str, orig->str, orig->len << orig->size_shift);
pike.git/src/builtin_functions.c:726:    *! @seealso    *! @[lower_case()], @[Locale.Charset.decoder]    */   PMOD_EXPORT void f_upper_case(INT32 args)   {    ptrdiff_t i;    struct pike_string *orig;    struct pike_string *ret;    check_all_args("upper_case", args, BIT_STRING|BIT_INT, 0);    -  if (Pike_sp[-args].type == T_INT) { +  if (TYPEOF(Pike_sp[-args]) == T_INT) {    /* NOTE: Performs the case change in place. */    DO_UPPER_CASE(Pike_sp[-args].u.integer);    pop_n_elems(args-1);    return;    }       orig = Pike_sp[-args].u.string;    ret=begin_wide_shared_string(orig->len,orig->size_shift);    MEMCPY(ret->str, orig->str, orig->len << orig->size_shift);   
pike.git/src/builtin_functions.c:824:    *! This function sets the initial value for the random generator.    *!    *! @seealso    *! @[random()]    */   PMOD_EXPORT void f_random_seed(INT32 args)   {    INT_TYPE i;   #ifdef AUTO_BIGNUM    check_all_args("random_seed",args,BIT_INT | BIT_OBJECT, 0); -  if(Pike_sp[-args].type == T_INT) +  if(TYPEOF(Pike_sp[-args]) == T_INT)    {    i=Pike_sp[-args].u.integer;    }else{    i=hash_svalue(Pike_sp-args);    }   #else    get_all_args("random_seed",args,"%i",&i);   #endif    my_srand(i);    pop_n_elems(args);
pike.git/src/builtin_functions.c:915:    *! @[indices()], @[values()], @[zero_type()], @[has_value()],    *! @[has_prefix()], @[has_suffix()]    */   PMOD_EXPORT void f_search(INT32 args)   {    ptrdiff_t start;       if(args < 2)    SIMPLE_TOO_FEW_ARGS_ERROR("search", 2);    -  switch(Pike_sp[-args].type) +  switch(TYPEOF(Pike_sp[-args]))    {    case T_STRING:    {    struct pike_string *haystack = Pike_sp[-args].u.string;       start=0;    if(args > 2)    { -  if(Pike_sp[2-args].type!=T_INT) +  if(TYPEOF(Pike_sp[2-args]) != T_INT)    SIMPLE_BAD_ARG_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,    "Start must not be greater than the "    "length of the string.\n");    -  if ((Pike_sp[1-args].type == T_INT) || -  ((Pike_sp[1-args].type == T_STRING) && +  if ((TYPEOF(Pike_sp[1-args]) == T_INT) || +  ((TYPEOF(Pike_sp[1-args]) == T_STRING) &&    (Pike_sp[1-args].u.string->len == 1))) {    INT_TYPE val; -  if (Pike_sp[1-args].type == T_INT) { +  if (TYPEOF(Pike_sp[1-args]) == T_INT) {    val = Pike_sp[1-args].u.integer;    } else {    val = index_shared_string(Pike_sp[1-args].u.string, 0);    }       switch(Pike_sp[-args].u.string->size_shift) {    case 0:    {    p_wchar0 *str = STR0(haystack);    if (val >= 256) {
pike.git/src/builtin_functions.c:995: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    default:    Pike_fatal("search(): Unsupported string shift: %d!\n",    haystack->size_shift);    break;   #endif    }    if (start >= haystack->len) {    start = -1;    } -  } else if(Pike_sp[1-args].type == T_STRING) { +  } 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");    }    pop_n_elems(args);    push_int64(start);    break;    }       case T_ARRAY:    start=0;    if(args > 2)    { -  if(Pike_sp[2-args].type!=T_INT) +  if(TYPEOF(Pike_sp[2-args]) != T_INT)    SIMPLE_BAD_ARG_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);
pike.git/src/builtin_functions.c:1045:    Pike_sp[-args]=*Pike_sp;    dmalloc_touch_svalue(Pike_sp);    pop_n_elems(args-1);    return;       case T_OBJECT:    {    struct program *p;    if ((p = (Pike_sp[-args].u.object->prog))) {    struct object *o = Pike_sp[-args].u.object; -  int id_level = p->inherits[Pike_sp[-args].subtype].identifier_level; +  int id_level = p->inherits[SUBTYPEOF(Pike_sp[-args])].identifier_level;    int id;    int next, ind; -  p = p->inherits[Pike_sp[-args].subtype].prog; +  p = p->inherits[SUBTYPEOF(Pike_sp[-args])].prog;       /* NOTE: Fake lfun! */    id = low_find_lfun(p, LFUN__SEARCH);    /* First try lfun::_search(). */    if (id >= 0) {    apply_low(o, id + id_level, args-1);    stack_pop_n_elems_keep_top(1);    return;    }   
pike.git/src/builtin_functions.c:1126:    *!    *! @seealso    *! @[has_suffix()], @[has_value()], @[search()]    */   PMOD_EXPORT void f_has_prefix(INT32 args)   {    struct pike_string *a, *b;       if(args<2)    SIMPLE_TOO_FEW_ARGS_ERROR("has_prefix", 2); -  if((Pike_sp[-args].type!=T_STRING) && (Pike_sp[-args].type!=T_OBJECT)) +  if((TYPEOF(Pike_sp[-args]) != T_STRING) && +  (TYPEOF(Pike_sp[-args]) != T_OBJECT))    SIMPLE_ARG_TYPE_ERROR("has_prefix", 1, "string|object"); -  if(Pike_sp[1-args].type!=T_STRING) +  if(TYPEOF(Pike_sp[1-args]) != T_STRING)    SIMPLE_ARG_TYPE_ERROR("has_prefix", 2, "string");       b = Pike_sp[1-args].u.string;    -  if (Pike_sp[-args].type == T_OBJECT) { +  if (TYPEOF(Pike_sp[-args]) == T_OBJECT) {    ptrdiff_t i;    struct object *o = Pike_sp[-args].u.object; -  int inherit_no = Pike_sp[-args].subtype; +  int inherit_no = SUBTYPEOF(Pike_sp[-args]);       apply_lfun(o, LFUN__SIZEOF, 0); -  if ((Pike_sp[-1].type != T_INT) || (Pike_sp[-1].u.integer < b->len)) { +  if ((TYPEOF(Pike_sp[-1]) != T_INT) || (Pike_sp[-1].u.integer < b->len)) {    pop_n_elems(args + 1);    push_int(0);    return;    }       for (i = 0; i < b->len; i++) {    p_wchar2 ch = index_shared_string(b, i);    Pike_sp[-1].u.integer = i;    /* Note: Integers do not need to be freed. */    object_index_no_free(Pike_sp-1, o, inherit_no, Pike_sp-1); -  if (Pike_sp[-1].type != PIKE_T_INT) { +  if (TYPEOF(Pike_sp[-1]) != PIKE_T_INT) {    Pike_error("Unexepected value returned from index operator.\n");    }    if (ch != Pike_sp[-1].u.integer) {    pop_n_elems(args + 1);    push_int(0);    return;    }    }    pop_n_elems(args+1);    push_int(1);
pike.git/src/builtin_functions.c:1230:    *!    *! @seealso    *! @[has_prefix()], @[has_value()], @[search()]    */   PMOD_EXPORT void f_has_suffix(INT32 args)   {    struct pike_string *a, *b;       if(args<2)    SIMPLE_TOO_FEW_ARGS_ERROR("has_suffix", 2); -  if(Pike_sp[-args].type!=T_STRING) +  if(TYPEOF(Pike_sp[-args]) != T_STRING)    SIMPLE_ARG_TYPE_ERROR("has_suffix", 1, "string"); -  if(Pike_sp[1-args].type!=T_STRING) +  if(TYPEOF(Pike_sp[1-args]) != T_STRING)    SIMPLE_ARG_TYPE_ERROR("has_suffix", 2, "string");       a = Pike_sp[-args].u.string;    b = Pike_sp[1-args].u.string;       /* First handle some common special cases. */    if ((b->len > a->len) || (b->size_shift > a->size_shift)) {    pop_n_elems(args);    push_int(0);    return;
pike.git/src/builtin_functions.c:1323:    */   PMOD_EXPORT void f_has_index(INT32 args)   {    int t = 0;       if(args < 2)    SIMPLE_TOO_FEW_ARGS_ERROR("has_index", 2);    if(args > 2)    pop_n_elems(args-2);    -  switch(Pike_sp[-2].type) +  switch(TYPEOF(Pike_sp[-2]))    {    case T_STRING: -  if(Pike_sp[-1].type == T_INT) +  if(TYPEOF(Pike_sp[-1]) == T_INT)    t = (0 <= Pike_sp[-1].u.integer && Pike_sp[-1].u.integer < Pike_sp[-2].u.string->len);       pop_n_elems(args);    push_int(t);    break;       case T_ARRAY: -  if(Pike_sp[-1].type == T_INT) +  if(TYPEOF(Pike_sp[-1]) == T_INT)    t = (0 <= Pike_sp[-1].u.integer && Pike_sp[-1].u.integer < Pike_sp[-2].u.array->size);       pop_n_elems(args);    push_int(t);    break;       case T_MULTISET:    case T_MAPPING:    f_index(2);    f_zero_type(1);      #ifdef PIKE_DEBUG -  if(Pike_sp[-1].type != T_INT) +  if(TYPEOF(Pike_sp[-1]) != T_INT)    PIKE_ERROR("has_index",    "Function `zero_type' gave incorrect result.\n", Pike_sp, args);   #endif    Pike_sp[-1].u.integer = !Pike_sp[-1].u.integer;    break;       case T_OBJECT:    case T_PROGRAM:    /* FIXME: If the object behaves like an array, it will throw an    error for non-valid indices. Therefore it's not a good idea
pike.git/src/builtin_functions.c:1372:       /Noring */    /* If it is an iterator object we may want to use the iterator    interface to look for the index. */       stack_swap();    f_indices(1);    stack_swap();    f_search(2);    -  if(Pike_sp[-1].type == T_INT) +  if(TYPEOF(Pike_sp[-1]) == T_INT)    Pike_sp[-1].u.integer = (Pike_sp[-1].u.integer != -1);    else    PIKE_ERROR("has_index",    "Function `search' gave incorrect result.\n", Pike_sp, args);    break;       default:    SIMPLE_ARG_TYPE_ERROR ("has_index", 1,    "string|array|mapping|multiset|object|program");    }
pike.git/src/builtin_functions.c:1419:    *! @[has_index()], @[indices()], @[search()], @[has_prefix()],    *! @[has_suffix()], @[values()], @[zero_type()]    */   PMOD_EXPORT void f_has_value(INT32 args)   {    if(args < 2)    SIMPLE_TOO_FEW_ARGS_ERROR("has_value", 2);    if(args > 2)    pop_n_elems(args-2);    -  switch(Pike_sp[-2].type) +  switch(TYPEOF(Pike_sp[-2]))    {    case T_MAPPING:    f_search(2);    f_zero_type(1);    -  if(Pike_sp[-1].type == T_INT) +  if(TYPEOF(Pike_sp[-1]) == T_INT)    Pike_sp[-1].u.integer = !Pike_sp[-1].u.integer;    else    PIKE_ERROR("has_value",    "Function `zero_type' gave incorrect result.\n", Pike_sp, args);    break;       case T_PROGRAM:    case T_OBJECT:    /* FIXME: It's very sad that we always have to do linear search    with `values' in case of objects. The problem is that we cannot
pike.git/src/builtin_functions.c:1459:    stack_swap();    f_values(1);    stack_swap();       /* FALL_THROUGH */       case T_STRING: /* Strings are odd. /Noring */    case T_ARRAY:    f_search(2);    -  if(Pike_sp[-1].type == T_INT) +  if(TYPEOF(Pike_sp[-1]) == T_INT)    Pike_sp[-1].u.integer = (Pike_sp[-1].u.integer != -1);    else    PIKE_ERROR("has_value", "Search gave incorrect result.\n", Pike_sp, args);    break;       default:    SIMPLE_ARG_TYPE_ERROR ("has_value", 1, "string|array|mapping|object|program");    }   }   
pike.git/src/builtin_functions.c:1496:    *! @seealso    *! @[all_constants()]    */   PMOD_EXPORT void f_add_constant(INT32 args)   {    ASSERT_SECURITY_ROOT("add_constant");       if(args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("add_constant", 1);    -  if(Pike_sp[-args].type!=T_STRING) +  if(TYPEOF(Pike_sp[-args]) != T_STRING)    SIMPLE_BAD_ARG_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:1579:    *! In all other cases @[zero_type()] will return @expr{0@} (zero).    *!    *! @seealso    *! @[find_call_out()]    */   PMOD_EXPORT void f_zero_type(INT32 args)   {    if(args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("zero_type",1);    -  if((Pike_sp[-args].type==T_OBJECT || Pike_sp[-args].type==T_FUNCTION) +  if((TYPEOF(Pike_sp[-args]) == T_OBJECT || +  TYPEOF(Pike_sp[-args]) == T_FUNCTION)    && !Pike_sp[-args].u.object->prog)    {    pop_n_elems(args);    push_int(NUMBER_DESTRUCTED);    } -  else if(Pike_sp[-args].type != T_INT) +  else if(TYPEOF(Pike_sp[-args]) != T_INT)    {    pop_n_elems(args);    push_int(0);    }    else    {    pop_n_elems(args-1); -  Pike_sp[-1].u.integer=Pike_sp[-1].subtype; -  Pike_sp[-1].subtype=NUMBER_NUMBER; +  Pike_sp[-1].u.integer = SUBTYPEOF(Pike_sp[-1]); +  SET_SVAL_SUBTYPE(Pike_sp[-1], NUMBER_NUMBER);    }   }      static int generate_zero_type(node *n)   {    struct compilation *c = THIS_COMPILATION;    CHECK_COMPILER();    if(count_args(CDR(n)) != 1) return 0;    if(do_docode(CDR(n),DO_NOT_COPY) != 1)    Pike_fatal("Count args was wrong in generate_zero_type().\n");
pike.git/src/builtin_functions.c:2356:    pop_n_elems(args);    push_string(out);   }      /*! @decl string(0..255) __parse_pike_type(string(0..255) t)    */   static void f_parse_pike_type( INT32 args )   {    struct pike_type *t;    -  if( !args || Pike_sp[-1].type != T_STRING || +  if( !args || TYPEOF(Pike_sp[-1]) != T_STRING ||    Pike_sp[-1].u.string->size_shift )    Pike_error( "__parse_pike_type requires a 8bit string as its first argument\n" );    t = parse_type( (char *)STR0(Pike_sp[-1].u.string) );    pop_stack();       push_string(type_to_string(t));    free_type(t);   }      /*! @decl type __soft_cast(type to, type from)    *!    *! Return the resulting type from a soft cast of @[from] to @[to].    */   static void f___soft_cast(INT32 args)   {    struct pike_type *res;    if (args < 2) Pike_error("Bad number of arguments to __soft_cast().\n"); -  if (Pike_sp[-args].type != PIKE_T_TYPE) { +  if (TYPEOF(Pike_sp[-args]) != PIKE_T_TYPE) {    Pike_error("Bad argument 1 to __soft_cast() expected type.\n");    } -  if (Pike_sp[1-args].type != PIKE_T_TYPE) { +  if (TYPEOF(Pike_sp[1-args]) != PIKE_T_TYPE) {    Pike_error("Bad argument 2 to __soft_cast() expected type.\n");    }    if (!(res = soft_cast(Pike_sp[-args].u.type,    Pike_sp[1-args].u.type, 0))) {    pop_n_elems(args);    push_undefined();    } else {    pop_n_elems(args);    push_type_value(res);    }
pike.git/src/builtin_functions.c:2419:    *! Returns a continuation type on success.    *!    *! Returns @tt{0@} (zero) on failure.    */   static void f___low_check_call(INT32 args)   {    struct pike_type *res;    INT32 flags = 0;    struct svalue *sval = NULL;    if (args < 2) Pike_error("Bad number of arguments to __low_check_call().\n"); -  if (Pike_sp[-args].type != PIKE_T_TYPE) { +  if (TYPEOF(Pike_sp[-args]) != PIKE_T_TYPE) {    Pike_error("Bad argument 1 to __low_check_call() expected type.\n");    } -  if (Pike_sp[1-args].type != PIKE_T_TYPE) { +  if (TYPEOF(Pike_sp[1-args]) != PIKE_T_TYPE) {    Pike_error("Bad argument 2 to __low_check_call() expected type.\n");    }    if (args > 2) { -  if (Pike_sp[2-args].type != PIKE_T_INT) { +  if (TYPEOF(Pike_sp[2-args]) != PIKE_T_INT) {    Pike_error("Bad argument 3 to __low_check_call() expected int.\n");    }    flags = Pike_sp[2-args].u.integer;    }    if (args > 3) sval = Pike_sp + 3 - args;    if (!(res = low_new_check_call(Pike_sp[-args].u.type,    Pike_sp[1-args].u.type, flags, sval))) {    pop_n_elems(args);    push_undefined();    } else {
pike.git/src/builtin_functions.c:2458:    *! Returns the type of the returned value on success    *!    *! Returns @tt{0@} (zero) on failure.    */   static void f___get_return_type(INT32 args)   {    struct pike_type *res;    if (args != 1) {    Pike_error("Bad number of arguments to __get_return_type().\n");    } -  if (Pike_sp[-1].type != PIKE_T_TYPE) { +  if (TYPEOF(Pike_sp[-1]) != PIKE_T_TYPE) {    Pike_error("Bad argument 1 to __get_return_type() expected type.\n");    }    if (!(res = new_get_return_type(Pike_sp[-1].u.type, 0))) {    pop_n_elems(args);    push_undefined();    } else {    pop_n_elems(args);    push_type_value(res);    }   }
pike.git/src/builtin_functions.c:2487:    *!    *! Returns @tt{0@} (zero) if a function of the type @[fun_type]    *! may not be called with any argument, or if it is not callable.    */   static void f___get_first_arg_type(INT32 args)   {    struct pike_type *res;    if (args != 1) {    Pike_error("Bad number of arguments to __get_first_arg_type().\n");    } -  if (Pike_sp[-1].type != PIKE_T_TYPE) { +  if (TYPEOF(Pike_sp[-1]) != PIKE_T_TYPE) {    Pike_error("Bad argument 1 to __get_first_arg_type() expected type.\n");    }    if (!(res = get_first_arg_type(Pike_sp[-1].u.type, 0))) {    pop_n_elems(args);    push_undefined();    } else {    pop_n_elems(args);    push_type_value(res);    }   }
pike.git/src/builtin_functions.c:2516:    *! @seealso    *! @[__get_return_type()], @[__get_first_arg_type()]    */   static void f___get_type_attributes(INT32 args)   {    struct pike_type *t;    int count = 0;    if (args != 1) {    Pike_error("Bad number of arguments to __get_type_attributes().\n");    } -  if (Pike_sp[-1].type != PIKE_T_TYPE) { +  if (TYPEOF(Pike_sp[-1]) != PIKE_T_TYPE) {    Pike_error("Bad argument 1 to __get_type_attributes() expected type.\n");    }    t = Pike_sp[-1].u.type;    /* Note: We assume that the set of attributes is small    * enough that we won't run out of stack. */    while ((t->type == PIKE_T_ATTRIBUTE) || (t->type == PIKE_T_NAME)) {    if (t->type == PIKE_T_ATTRIBUTE) {    ref_push_string((struct pike_string *)t->car);    count++;    }
pike.git/src/builtin_functions.c:2649:    SIMPLE_ARG_ERROR ("allocate", 1, "Integer too large to use as array size.");       a=allocate_array(size);    if(args>1)    {    INT32 e;    push_array (a);    if (init) {    for(e=0;e<size;e++)    copy_svalues_recursively_no_free(a->item+e, init, 1, 0); -  a->type_field = 1 << init->type; +  a->type_field = 1 << TYPEOF(*init);    }    else {    /* It's somewhat quirky that allocate(17) and allocate(17, UNDEFINED)    * have different behavior, but it's of some use, and it's compatible    * with previous versions. */    for(e=0;e<size;e++)    ITEM (a)[e] = svalue_undefined;    a->type_field = BIT_INT;    }    stack_pop_n_elems_keep_top (args);
pike.git/src/builtin_functions.c:2690:    *! objects belonging to the lexically surrounding classes. If the    *! 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 (Pike_sp[-args].type != T_INT || Pike_sp[-args].u.integer < 0) +  if (TYPEOF(Pike_sp[-args]) != T_INT || Pike_sp[-args].u.integer < 0)    SIMPLE_BAD_ARG_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++) {
pike.git/src/builtin_functions.c:2733:    /* Not a constant expression. Make sure there are parent    * pointers all the way. */    int i;    for (i = 0; i < c->compilation_depth; i++, state = state->previous)    state->new_program->flags |= PROGRAM_USES_PARENT | PROGRAM_NEEDS_PARENT;    return NULL;    }    else {    int i;   #ifdef PIKE_DEBUG -  if (CDR (n)->u.sval.type != T_INT || CDR (n)->u.sval.u.integer < 0) +  if (TYPEOF(CDR(n)->u.sval) != T_INT || CDR(n)->u.sval.u.integer < 0)    Pike_fatal ("The type check for this_object() failed.\n");   #endif    level = CDR (n)->u.sval.u.integer;    for (i = MINIMUM(level, c->compilation_depth); i;    i--, state = state->previous) {    state->new_program->flags |=    PROGRAM_USES_PARENT | PROGRAM_NEEDS_PARENT;    }    }    }
pike.git/src/builtin_functions.c:2778:    int level;    struct compilation *c = THIS_COMPILATION;    CHECK_COMPILER();       if (CDR (n)) {    if (CDR (n)->token != F_CONSTANT)    /* Not a constant expression. Make a call to f_this_object. */    return 0;    else {   #ifdef PIKE_DEBUG -  if (CDR (n)->u.sval.type != T_INT || CDR (n)->u.sval.u.integer < 0) +  if (TYPEOF(CDR(n)->u.sval) != T_INT || CDR(n)->u.sval.u.integer < 0)    Pike_fatal ("The type check for this_object() failed.\n");   #endif    level = CDR (n)->u.sval.u.integer;    }    }    else level = 0;       emit1(F_THIS_OBJECT, level);    modify_stack_depth(1);    return 1;
pike.git/src/builtin_functions.c:2840:    *! @[_exit()]    */   PMOD_EXPORT void f_exit(INT32 args)   {    static int in_exit=0;    ASSERT_SECURITY_ROOT("exit");       if(args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("exit", 1);    -  if(Pike_sp[-args].type != T_INT) +  if(TYPEOF(Pike_sp[-args]) != T_INT)    SIMPLE_BAD_ARG_ERROR("exit", 1, "int");       if(in_exit) Pike_error("exit already called!\n");    in_exit=1;    -  if(args>1 && Pike_sp[1-args].type==T_STRING) { +  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();    } else {    fprintf(stderr, "No efun::werror() at exit.\n");    pop_n_elems(args-1);    }    args=1;
pike.git/src/builtin_functions.c:2922:    *! The third syntax can be used to measure time more preciely than one    *! second. It return how many seconds has passed since @[t]. The precision    *! of this function varies from system to system.    *!    *! @seealso    *! @[ctime()], @[localtime()], @[mktime()], @[gmtime()],    *! @[System.gettimeofday], @[gethrtime]    */   PMOD_EXPORT void f_time(INT32 args)   { -  if(!args || (Pike_sp[-args].type == T_INT && Pike_sp[-args].u.integer == 0)) +  if(!args || +  (TYPEOF(Pike_sp[-args]) == T_INT && Pike_sp[-args].u.integer == 0))    {    GETTIMEOFDAY(&current_time);    }else{ -  if(Pike_sp[-args].type == T_INT && Pike_sp[-args].u.integer > 1) +  if(TYPEOF(Pike_sp[-args]) == T_INT && Pike_sp[-args].u.integer > 1)    {    struct timeval tmp;    GETTIMEOFDAY(&current_time);    tmp.tv_sec=Pike_sp[-args].u.integer;    tmp.tv_usec=0;    my_subtract_timeval(&tmp,&current_time);    pop_n_elems(args);    push_float( - (FLOAT_TYPE)tmp.tv_sec-((FLOAT_TYPE)tmp.tv_usec)/1000000 );    return;    }
pike.git/src/builtin_functions.c:3037:    *! object. If no argument is given, the current object is destructed.    *!    *! All pointers and function pointers to this object will become zero.    *! The destructed object will be freed from memory as soon as possible.    */   PMOD_EXPORT void f_destruct(INT32 args)   {    struct object *o;    if(args)    { -  if(Pike_sp[-args].type != T_OBJECT) { -  if ((Pike_sp[-args].type == T_INT) && +  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");    }       o=Pike_sp[-args].u.object;    }else{    if(!Pike_fp) {
pike.git/src/builtin_functions.c:3094:    *! @[values()], @[types()], @[lfun::_indices()]    */   PMOD_EXPORT void f_indices(INT32 args)   {    ptrdiff_t size;    struct array *a = NULL;       if(args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("indices", 1);    -  switch(Pike_sp[-args].type) +  switch(TYPEOF(Pike_sp[-args]))    {    case T_STRING:    size=Pike_sp[-args].u.string->len;    goto qjump;       case T_ARRAY:    size=Pike_sp[-args].u.array->size;       qjump:    a=allocate_array_no_init(size,0);
pike.git/src/builtin_functions.c:3122:       case T_MAPPING:    a=mapping_indices(Pike_sp[-args].u.mapping);    break;       case T_MULTISET:    a = multiset_indices (Pike_sp[-args].u.multiset);    break;       case T_OBJECT: -  a=object_indices(Pike_sp[-args].u.object, Pike_sp[-args].subtype); +  a=object_indices(Pike_sp[-args].u.object, SUBTYPEOF(Pike_sp[-args]));    break;       case T_PROGRAM:    a = program_indices(Pike_sp[-args].u.program);    break;       case T_FUNCTION:    {    struct program *p = program_from_svalue(Pike_sp-args);    if (p) {
pike.git/src/builtin_functions.c:3394:    *! @seealso    *! @[indices()], @[types()], @[lfun::_values()]    */   PMOD_EXPORT void f_values(INT32 args)   {    ptrdiff_t size;    struct array *a = NULL;    if(args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("values", 1);    -  switch(Pike_sp[-args].type) +  switch(TYPEOF(Pike_sp[-args]))    {    case T_STRING:    size = Pike_sp[-args].u.string->len;    a = allocate_array_no_init(size,0);    while(--size >= 0)    {    /* Elements are already integers. */    ITEM(a)[size].u.integer = index_shared_string(Pike_sp[-args].u.string, size);    }    a->type_field = BIT_INT;
pike.git/src/builtin_functions.c:3420:       case T_MAPPING:    a=mapping_values(Pike_sp[-args].u.mapping);    break;       case T_MULTISET:    a = multiset_values (Pike_sp[-args].u.multiset);    break;       case T_OBJECT: -  a=object_values(Pike_sp[-args].u.object, Pike_sp[-args].subtype); +  a=object_values(Pike_sp[-args].u.object, SUBTYPEOF(Pike_sp[-args]));    break;       case T_PROGRAM:    a = program_values(Pike_sp[-args].u.program);    break;       case T_FUNCTION:    {    struct program *p = program_from_svalue(Pike_sp - args);    if (p) {
pike.git/src/builtin_functions.c:3477:    */   PMOD_EXPORT void f_types(INT32 args)   {    ptrdiff_t size;    struct array *a = NULL;    struct pike_type *default_type = mixed_type_string;       if(args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("types", 1);    -  switch(Pike_sp[-args].type) +  switch(TYPEOF(Pike_sp[-args]))    {    case T_STRING:    default_type = int_type_string;    size=Pike_sp[-args].u.string->len;    goto qjump;       case T_MAPPING:    size = Pike_sp[-args].u.mapping->data->size;    goto qjump;   
pike.git/src/builtin_functions.c:3502:    goto qjump;       case T_ARRAY:    size=Pike_sp[-args].u.array->size;       qjump:    a=allocate_array_no_init(size,0);    while(--size>=0)    {    /* Elements are already integers. */ -  add_ref(ITEM(a)[size].u.type = default_type); -  ITEM(a)[size].type = PIKE_T_TYPE; +  SET_SVAL(ITEM(a)[size], PIKE_T_TYPE, 0, type, default_type); +  add_ref(default_type);    }    a->type_field = BIT_TYPE;    break;       case T_OBJECT: -  a=object_types(Pike_sp[-args].u.object, Pike_sp[-args].subtype); +  a=object_types(Pike_sp[-args].u.object, SUBTYPEOF(Pike_sp[-args]));    break;       case T_PROGRAM:    a = program_types(Pike_sp[-args].u.program);    break;       case T_FUNCTION:    {    struct program *p = program_from_svalue(Pike_sp-args);    if (p) {
pike.git/src/builtin_functions.c:3566:   PMOD_EXPORT void f_next_object(INT32 args)   {    struct object *o;       ASSERT_SECURITY_ROOT("next_object");       if(args < 1)    {    o = first_object;    }else{ -  if(Pike_sp[-args].type != T_OBJECT) +  if(TYPEOF(Pike_sp[-args]) != T_OBJECT)    SIMPLE_BAD_ARG_ERROR("next_object", 1, "object");    o = Pike_sp[-args].u.object->next;    }    while(o && !o->prog) o=o->next;    pop_n_elems(args);    if(!o)    {    push_int(0);    }else{    ref_push_object(o);
pike.git/src/builtin_functions.c:3594:    *! the generating function will be returned.    *!    *! If @[o] is not an object or has been destructed @expr{0@} (zero)    *! will be returned.    */   PMOD_EXPORT void f_object_program(INT32 args)   {    if(args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("object_program", 1);    -  if(Pike_sp[-args].type == T_OBJECT) +  if(TYPEOF(Pike_sp[-args]) == T_OBJECT)    {    struct object *o=Pike_sp[-args].u.object;    struct program *p = o->prog;      #if 0    /* This'd be nice, but it doesn't work well since the returned    * function can't double as a program (program_from_svalue returns    * NULL for it). */    if (p == pike_trampoline_program) {    struct pike_trampoline *t = (struct pike_trampoline *) o->storage;
pike.git/src/builtin_functions.c:3616: Inside #if 0
   add_ref (o = t->frame->current_object);    pop_n_elems (args);    push_function (o, t->func);    return;    }    }   #endif       if(p)    { -  if (Pike_sp[-args].subtype) { +  if (SUBTYPEOF(Pike_sp[-args])) {    /* FIXME: This probably works for the subtype-less case as well.    */    struct external_variable_context loc;    loc.o = o; -  p = (loc.inherit = p->inherits + Pike_sp[-args].subtype)->prog; +  p = (loc.inherit = p->inherits + SUBTYPEOF(Pike_sp[-args]))->prog;    if (p->flags & PROGRAM_USES_PARENT) {    loc.parent_identifier = loc.inherit->parent_identifier;    find_external_context(&loc, 1);    add_ref(loc.o);    pop_n_elems(args);    push_function(loc.o, loc.parent_identifier);    return;    }    } else if((p->flags & PROGRAM_USES_PARENT) &&    PARENT_INFO(o)->parent &&
pike.git/src/builtin_functions.c:3715:    *! @seealso    *! @[sscanf()]    */   PMOD_EXPORT void f_reverse(INT32 args)   {    struct svalue *sv;    int start = 0, end = -1;       get_all_args("reverse", args, "%*.%d%d", &sv, &start, &end);    -  switch(sv->type) +  switch(TYPEOF(*sv))    {    case T_STRING:    {    INT32 e;    struct pike_string *s;    struct pike_string *orig = sv->u.string;;    if (start < 0) {    start = 0;    } else if (start >= orig->len) {    /* Noop. */
pike.git/src/builtin_functions.c:4235:    *! @[a] will then be returned.    *!    *! @note    *! Note that @[replace()] on arrays and mappings is a destructive operation.    */   PMOD_EXPORT void f_replace(INT32 args)   {    if(args < 3)    {    if (args==2 && -  Pike_sp[-1].type==T_MAPPING) +  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)");    }    }
pike.git/src/builtin_functions.c:4260:    f_values(1);    args++;    }    else    SIMPLE_TOO_FEW_ARGS_ERROR("replace", 3);    } else if (args > 3) {    pop_n_elems(args-3);    args = 3;    }    -  switch(Pike_sp[-args].type) +  switch(TYPEOF(Pike_sp[-args]))    {    case T_ARRAY:    {    array_replace(Pike_sp[-args].u.array,Pike_sp+1-args,Pike_sp+2-args);    pop_n_elems(args-1);    break;    }       case T_MAPPING:    {    mapping_replace(Pike_sp[-args].u.mapping,Pike_sp+1-args,Pike_sp+2-args);    pop_n_elems(args-1);    break;    }       case T_STRING:    {    struct pike_string *s; -  switch(Pike_sp[1-args].type) +  switch(TYPEOF(Pike_sp[1-args]))    {    default:    SIMPLE_BAD_ARG_ERROR("replace", 2, "string|array");       case T_STRING: -  if(Pike_sp[2-args].type != T_STRING) +  if(TYPEOF(Pike_sp[2-args]) != T_STRING)    SIMPLE_BAD_ARG_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 (Pike_sp[2-args].type == T_STRING) { +  if (TYPEOF(Pike_sp[2-args]) == T_STRING) {    push_int(Pike_sp[1-args].u.array->size);    stack_swap();    f_allocate(2); -  } else if(Pike_sp[2-args].type != T_ARRAY) +  } else if(TYPEOF(Pike_sp[2-args]) != T_ARRAY)    SIMPLE_BAD_ARG_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;
pike.git/src/builtin_functions.c:4400:    /* eval_low() returned -1. */    goto failed;    }    }       replace_obj = clone_object(replace_compiler, args);       push_object(replace_obj);    if (replace_obj->prog &&    ((lfun = FIND_LFUN(replace_obj->prog, LFUN_CALL)) != -1)) { -  Pike_sp[-1].subtype = lfun; -  Pike_sp[-1].type = PIKE_T_FUNCTION; +  SET_SVAL(Pike_sp[-1], PIKE_T_FUNCTION, lfun, object, replace_obj);    ADD_NODE_REF2(*arg0,    ret = mkapplynode(mkconstantsvaluenode(Pike_sp-1),    *arg0);    );       UNSETJMP(tmp);    pop_n_elems(Pike_sp - save_sp);       free_type(array_zero);    free_type(mapping_zero);
pike.git/src/builtin_functions.c:4498:   void f_set_weak_flag(INT32 args)   {    struct svalue *s;    INT_TYPE ret;    int flags;       get_all_args("set_weak_flag",args,"%*%i",&s,&ret);       if (ret == 1) ret = PIKE_WEAK_BOTH;    -  switch(s->type) +  switch(TYPEOF(*s))    {    case T_ARRAY:    flags = array_get_flags(s->u.array);    SETFLAG(flags,ARRAY_WEAK_FLAG,ret & PIKE_WEAK_VALUES);    s->u.array = array_set_flags(s->u.array, flags);    break;    case T_MAPPING:    flags = mapping_get_flags(s->u.mapping);    flags = (flags & ~PIKE_WEAK_BOTH) | (ret & PIKE_WEAK_BOTH);    mapping_set_flags(s->u.mapping, flags);
pike.git/src/builtin_functions.c:4533:    *! Returns @expr{1@} if @[arg] is an object, @expr{0@} (zero) otherwise.    *!    *! @seealso    *! @[mappingp()], @[programp()], @[arrayp()], @[stringp()], @[functionp()],    *! @[multisetp()], @[floatp()], @[intp()]    */   PMOD_EXPORT void f_objectp(INT32 args)   {    if(args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("objectp", 1); -  if(Pike_sp[-args].type != T_OBJECT || !Pike_sp[-args].u.object->prog +  if(TYPEOF(Pike_sp[-args]) != T_OBJECT || !Pike_sp[-args].u.object->prog   #ifdef AUTO_BIGNUM    || is_bignum_object(Pike_sp[-args].u.object)   #endif    )    {    pop_n_elems(args);    push_int(0);    }else{    pop_n_elems(args);    push_int(1);
pike.git/src/builtin_functions.c:4560:    *!    *! @seealso    *! @[mappingp()], @[programp()], @[arrayp()], @[stringp()], @[objectp()],    *! @[multisetp()], @[floatp()], @[intp()]    */   PMOD_EXPORT void f_functionp(INT32 args)   {    int res = 0;    if(args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("functionp", 1); -  if( Pike_sp[-args].type == T_FUNCTION && -  (Pike_sp[-args].subtype == FUNCTION_BUILTIN || Pike_sp[-args].u.object->prog)) +  if( TYPEOF(Pike_sp[-args]) == T_FUNCTION && +  (SUBTYPEOF(Pike_sp[-args]) == FUNCTION_BUILTIN || +  Pike_sp[-args].u.object->prog))    res=1;    pop_n_elems(args);    push_int(res);   }      /*! @decl int callablep(mixed arg)    *!    *! Returns @expr{1@} if @[arg] is a callable, @expr{0@} (zero) otherwise.    *!    *! @seealso    *! @[mappingp()], @[programp()], @[arrayp()], @[stringp()], @[objectp()],    *! @[multisetp()], @[floatp()], @[intp()]    */   PMOD_EXPORT void f_callablep(INT32 args)   {    int res = 0;    if(args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("callablep", 1);    -  switch( Pike_sp[-args].type ) +  switch( TYPEOF(Pike_sp[-args]) )    {    case T_FUNCTION: -  if( Pike_sp[-args].subtype != FUNCTION_BUILTIN +  if( SUBTYPEOF(Pike_sp[-args]) != FUNCTION_BUILTIN    && !Pike_sp[-args].u.object->prog)    break;    res = 1;    break;    case T_PROGRAM:    res = 1;    break;    case T_OBJECT:    {    struct program *p;    if((p = Pike_sp[-args].u.object->prog) && -  FIND_LFUN(p->inherits[Pike_sp[-args].subtype].prog, +  FIND_LFUN(p->inherits[SUBTYPEOF(Pike_sp[-args])].prog,    LFUN_CALL ) != -1)    res = 1;    }    break;    case T_ARRAY:    /* FIXME: What about the recursive case? */    array_fix_type_field(Pike_sp[-args].u.array);    if( (Pike_sp[-args].u.array->type_field==BIT_CALLABLE) ||    !Pike_sp[-args].u.array->type_field) {    res = 1;    }    else if( !(Pike_sp[-args].u.array->type_field &    ~(BIT_CALLABLE|BIT_INT)) ) {    struct array *a = Pike_sp[-args].u.array;    int i;    res = 1;    for(i=0; i<a->size; i++) -  if( ITEM(a)[i].type == T_INT && ITEM(a)[i].u.integer ) { +  if( TYPEOF(ITEM(a)[i]) == T_INT && ITEM(a)[i].u.integer ) {    res = 0;    break;    }    }    break;    }    pop_n_elems(args);    push_int(res);   }   #ifndef HAVE_AND_USE_POLL
pike.git/src/builtin_functions.c:4728:    *! intervals so it's normally not necessary to do this.    *!    *! @seealso    *! @[signal()], @[delay()]    */   PMOD_EXPORT void f_sleep(INT32 args)   {    double delay=0.0;    unsigned do_abort_on_signal;    -  switch(Pike_sp[-args].type) +  switch(TYPEOF(Pike_sp[-args]))    {    case T_INT:    delay=(double)Pike_sp[-args].u.integer;    break;       case T_FLOAT:    delay=(double)Pike_sp[-args].u.float_number;    break;    }   
pike.git/src/builtin_functions.c:4766:    *! to achieve the highest possible accuracy.    *!    *! @seealso    *! @[signal()], @[sleep()]    */   PMOD_EXPORT void f_delay(INT32 args)   {    double delay=0.0;    unsigned do_abort_on_signal;    -  switch(Pike_sp[-args].type) +  switch(TYPEOF(Pike_sp[-args]))    {    case T_INT:    delay=(double)Pike_sp[-args].u.integer;    break;       case T_FLOAT:    delay=(double)Pike_sp[-args].u.float_number;    break;    }   
pike.git/src/builtin_functions.c:4827:   #endif         #define TYPEP(ID,NAME,TYPE,TYPE_NAME) \    PMOD_EXPORT void ID(INT32 args) \    { \    int t; \    struct program *p; \    if (args<1) \    SIMPLE_TOO_FEW_ARGS_ERROR(NAME, 1); \ -  if (Pike_sp[-args].type == T_OBJECT && \ +  if (TYPEOF(Pike_sp[-args]) == T_OBJECT && \    (p = Pike_sp[-args].u.object->prog)) \    { \ -  int fun = FIND_LFUN(p->inherits[Pike_sp[-args].subtype].prog, \ +  int fun = FIND_LFUN(p->inherits[SUBTYPEOF(Pike_sp[-args])].prog, \    LFUN__IS_TYPE); \    if (fun != -1) \    { \    int id_level = \ -  p->inherits[Pike_sp[-args].subtype].identifier_level; \ +  p->inherits[SUBTYPEOF(Pike_sp[-args])].identifier_level; \    push_constant_text(TYPE_NAME); \    apply_low(Pike_sp[-args-1].u.object, fun + id_level, 1); \    stack_unlink(args); \    return; \    } \    } \ -  t = Pike_sp[-args].type == TYPE; \ +  t = TYPEOF(Pike_sp[-args]) == TYPE; \    pop_n_elems(args); \    push_int(t); \    }      /*! @decl int undefinedp(mixed arg)    *!    *! Returns @expr{1@} if @[arg] is undefined, @expr{0@} (zero) otherwise.    *!    *! @seealso    *! @[zero_type], @[destructedp], @[intp]
pike.git/src/builtin_functions.c:4890:    *! Returns @expr{1@} if @[arg] is a program, @expr{0@} (zero) otherwise.    *!    *! @seealso    *! @[mappingp()], @[intp()], @[arrayp()], @[stringp()], @[objectp()],    *! @[multisetp()], @[floatp()], @[functionp()]    */   PMOD_EXPORT void f_programp(INT32 args)   {    if(args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("programp", 1); -  switch(Pike_sp[-args].type) +  switch(TYPEOF(Pike_sp[-args]))    {    case T_PROGRAM:    pop_n_elems(args);    push_int(1);    return;       case T_FUNCTION:    if(program_from_function(Pike_sp-args))    {    pop_n_elems(args);
pike.git/src/builtin_functions.c:5032:    *! @seealso    *! @[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(Pike_sp[-args].type != T_ARRAY) +  if(TYPEOF(Pike_sp[-args]) != T_ARRAY)    SIMPLE_BAD_ARG_ERROR("sort", 1, "array");    a = Pike_sp[-args].u.array;       for(e=1;e<args;e++)    { -  if(Pike_sp[e-args].type != T_ARRAY) +  if(TYPEOF(Pike_sp[e-args]) != T_ARRAY)    SIMPLE_BAD_ARG_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);
pike.git/src/builtin_functions.c:5098:       /* Optimization */    if(tmp->refs == 1)    {    struct svalue sval;    tmp->type_field = BIT_MIXED | BIT_UNFINISHED;    types = 0;    for(e=0;e<tmp->size;e++)    {    index_no_free(&sval, val, ITEM(tmp)+e); -  types |= 1 << sval.type; +  types |= 1 << TYPEOF(sval);    free_svalue(ITEM(tmp)+e);    move_svalue (ITEM(tmp) + e, &sval);    }    tmp->type_field = types;    stack_swap();    pop_stack();    return;    }       push_array(a=allocate_array(tmp->size));    types = 0;    for(e=0;e<a->size;e++) {    index_no_free(ITEM(a)+e, val, ITEM(tmp)+e); -  types |= 1 << ITEM(a)[e].type; +  types |= 1 << TYPEOF(ITEM(a)[e]);    }    a->type_field = types;       Pike_sp--;    dmalloc_touch_svalue(Pike_sp);    pop_n_elems(args);    push_array(a);   }      /*! @decl void verify_internals()
pike.git/src/builtin_functions.c:5743: Inside #if defined (HAVE_MKTIME) || defined (HAVE_LOCALTIME)
   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) && (Pike_sp[7-args].subtype == NUMBER_NUMBER)) +  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) && (Pike_sp[7-args].subtype == NUMBER_NUMBER)) +  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
pike.git/src/builtin_functions.c:5797: Inside #if defined(HAVE_LOCALTIME)
   * 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) && (Pike_sp[7-args].subtype == NUMBER_NUMBER)) +  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;
pike.git/src/builtin_functions.c:5849:   {    ptrdiff_t i;    ptrdiff_t offset = 0;    struct svalue *old_sp = Pike_sp;       for (i=offset; i < slen; i++) {    if (s[i] == '%') {    ptrdiff_t j;    if (i != offset) {    push_string(make_shared_binary_string0(s + offset, i)); -  if ((Pike_sp != old_sp+1) && (Pike_sp[-2].type == T_STRING)) { +  if ((Pike_sp != old_sp+1) && (TYPEOF(Pike_sp[-2]) == T_STRING)) {    /* Concat. */    f_add(2);    }    }       for (j = i+1;j<slen;j++) {    int c = s[j];       switch(c) {    /* Flags */
pike.git/src/builtin_functions.c:5891:    case ':':    case ';':    continue;    /* Attribute value */    case '1': case '2': case '3': case '4': case '5':    case '6': case '7': case '8': case '9':    continue;    /* Specials */    case '%':    push_constant_text("%"); -  if ((Pike_sp != old_sp+1) && (Pike_sp[-2].type == T_STRING)) { +  if ((Pike_sp != old_sp+1) && (TYPEOF(Pike_sp[-2]) == T_STRING)) {    /* Concat. */    f_add(2);    }    break;    case '{':    i = j + 1 + low_parse_format(s + j + 1, slen - (j+1));    f_aggregate(1);    if ((i + 2 >= slen) || (s[i] != '%') || (s[i+1] != '}')) {    Pike_error("parse_format(): Expected %%}.\n");    }
pike.git/src/builtin_functions.c:5926:    }    if (j == slen) {    Pike_error("parse_format(): Unterminated %%-expression.\n");    }    offset = i = j;    }    }       if (i != offset) {    push_string(make_shared_binary_string0(s + offset, i)); -  if ((Pike_sp != old_sp+1) && (Pike_sp[-2].type == T_STRING)) { +  if ((Pike_sp != old_sp+1) && (TYPEOF(Pike_sp[-2]) == T_STRING)) {    /* Concat. */    f_add(2);    }    }       f_aggregate(DO_NOT_WARN(Pike_sp - old_sp));    return i;   }      /** @decl array parse_format(string fmt)
pike.git/src/builtin_functions.c:5954:    ptrdiff_t len;       get_all_args("parse_format", args, "%W", &s);       len = low_parse_format(STR0(s), s->len);    if (len != s->len) {    Pike_error("parse_format(): Unexpected %%} in format string at offset %ld\n",    PTRDIFF_T_TO_LONG(len));    }   #ifdef PIKE_DEBUG -  if (Pike_sp[-1].type != T_ARRAY) { +  if (TYPEOF(Pike_sp[-1]) != T_ARRAY) {    Pike_fatal("parse_format(): Unexpected result from low_parse_format()\n");    }   #endif /* PIKE_DEBUG */    a = (--Pike_sp)->u.array;    debug_malloc_touch(a);       pop_n_elems(args);    push_array(a);   }   
pike.git/src/builtin_functions.c:6147:    struct svalue *glob;    int nglobs;       if(args < 2)    SIMPLE_TOO_FEW_ARGS_ERROR("glob", 2);       if(args > 2)    pop_n_elems(args-2);    args=2;    -  if (Pike_sp[-args].type==T_STRING) +  if (TYPEOF(Pike_sp[-args]) == T_STRING)    {    glob=Pike_sp-args;    nglobs = 1;    } -  else if( Pike_sp[-args].type==PIKE_T_ARRAY) +  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( ga->item[i].type != PIKE_T_STRING ) +  if( TYPEOF(ga->item[i]) != PIKE_T_STRING )    SIMPLE_BAD_ARG_ERROR("glob", 1, "string|array(string)");    }    else    SIMPLE_BAD_ARG_ERROR("glob", 1, "string|array(string)");       -  switch(Pike_sp[1-args].type) +  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;
pike.git/src/builtin_functions.c:6257:    push_array(min = allocate_array(arr->size));       /* Initialize the min array */    for (i = 0; i < arr->size; i++) {    struct mapping_data *md;    /* e and k are used by NEW_MAPPING_LOOP() */    INT32 e;    struct keypair *k;    INT_TYPE low = MAX_INT_TYPE;   #ifdef PIKE_DEBUG -  if (ITEM(arr)[i].type != T_MAPPING) { +  if (TYPEOF(ITEM(arr)[i]) != T_MAPPING) {    Pike_error("interleave_array(): Element %d is not a mapping!\n", i);    }   #endif /* PIKE_DEBUG */    md = ITEM(arr)[i].u.mapping->data;    NEW_MAPPING_LOOP(md) { -  if (k->ind.type != T_INT) { +  if (TYPEOF(k->ind) != T_INT) {    Pike_error("interleave_array(): Index not an integer in mapping %d!\n", i);    }    if (low > k->ind.u.integer) {    low = k->ind.u.integer;    if (low < 0) {    Pike_error("interleave_array(): Index %"PRINTPIKEINT"d in mapping %d is negative!\n",    low, i);    }    }    if (max < k->ind.u.integer) {
pike.git/src/builtin_functions.c:6520:       map=allocate_mapping(256);    push_mapping(map); /* in case of out of memory */       for (i=0; i<b->size; i++)    {    pval=low_mapping_lookup(map,b->item+i);    if (!pval)    {    struct svalue val; -  val.type=T_ARRAY; -  val.u.array=low_allocate_array(1,1); +  SET_SVAL(val, T_ARRAY, 0, array, low_allocate_array(1,1));    ITEM(val.u.array)[0].u.integer=i;    val.u.array->type_field = BIT_INT;    mapping_insert(map,ITEM(b)+i,&val);    free_svalue(&val);    if (u) {    (*u)++;    }    }    else    {    struct array *a = pval->u.array=    resize_array(pval->u.array,pval->u.array->size+1);    struct svalue *s = ITEM(a) + pval->u.array->size-1; -  s->type=T_INT; -  s->subtype=NUMBER_NUMBER; -  s->u.integer=i; +  SET_SVAL(*s, T_INT, NUMBER_NUMBER, integer, i);    }    }       res=low_allocate_array(a->size,0);    types = 0;       for (i=0; i<a->size; i++)    {    pval=low_mapping_lookup(map,a->item+i);    if (!pval)    { -  ITEM(res)[i].type=T_ARRAY; -  add_ref(ITEM(res)[i].u.array=&empty_array); +  SET_SVAL(ITEM(res)[i], T_ARRAY, 0, array, &empty_array); +  add_ref(&empty_array);    types |= BIT_ARRAY;    }    else    {    assign_svalue(ITEM(res)+i,pval); -  types |= 1 << ITEM(res)[i].type; +  types |= 1 << TYPEOF(ITEM(res)[i]);    }    }       res->type_field = types;    pop_stack();    return res;   }      struct diff_magic_link   {
pike.git/src/builtin_functions.c:7189:    *! @[shuffle()]    */   PMOD_EXPORT void f_permute( INT32 args )   {    INT_TYPE q, i=0, n;    struct array *a;    struct svalue *it;       if( args != 2 )    SIMPLE_TOO_FEW_ARGS_ERROR("permute", 2); -  if( Pike_sp[ -2 ].type != T_ARRAY ) +  if( TYPEOF(Pike_sp[ -2 ]) != T_ARRAY )    SIMPLE_BAD_ARG_ERROR("permute", 1, "array"); -  if (Pike_sp[ -1 ].type != T_INT) +  if (TYPEOF(Pike_sp[ -1 ]) != T_INT)    SIMPLE_BAD_ARG_ERROR("permute", 2, "int");       n = Pike_sp[ -1 ].u.integer;    a = copy_array( Pike_sp[ -2 ].u.array );    pop_n_elems( args );    q = a->size;    it = a->item;    while( n && q )    {    int x = n % q;
pike.git/src/builtin_functions.c:7533:    struct svalue tmp;       ASSERT_SECURITY_ROOT("_next");       if(!args)    SIMPLE_TOO_FEW_ARGS_ERROR("_next", 1);       pop_n_elems(args-1);    args = 1;    tmp=Pike_sp[-1]; -  switch(tmp.type) +  switch(TYPEOF(tmp))    {    case T_OBJECT: tmp.u.object=tmp.u.object->next; break;    case T_ARRAY: tmp.u.array=tmp.u.array->next; break;    case T_MAPPING: tmp.u.mapping=tmp.u.mapping->next; break;    case T_MULTISET:tmp.u.multiset=tmp.u.multiset->next; break;    case T_PROGRAM: tmp.u.program=tmp.u.program->next; break;    case T_STRING: tmp.u.string=next_pike_string(tmp.u.string); break;    default:    SIMPLE_BAD_ARG_ERROR("_next", 1,    "object|array|mapping|multiset|program|string");
pike.git/src/builtin_functions.c:7581:    struct svalue tmp;       ASSERT_SECURITY_ROOT("_prev");       if(!args)    SIMPLE_TOO_FEW_ARGS_ERROR("_prev", 1);       pop_n_elems(args-1);    args = 1;    tmp=Pike_sp[-1]; -  switch(tmp.type) +  switch(TYPEOF(tmp))    {    case T_OBJECT: tmp.u.object=tmp.u.object->prev; break;    case T_ARRAY: tmp.u.array=tmp.u.array->prev; break;    case T_MAPPING: tmp.u.mapping=tmp.u.mapping->prev; break;    case T_MULTISET:tmp.u.multiset=tmp.u.multiset->prev; break;    case T_PROGRAM: tmp.u.program=tmp.u.program->prev; break;    default:    SIMPLE_BAD_ARG_ERROR("_prev", 1, "object|array|mapping|multiset|program");    }    if(tmp.u.refs)
pike.git/src/builtin_functions.c:7621:    *! @seealso    *! @[_next()], @[_prev()]    */   PMOD_EXPORT void f__refs(INT32 args)   {    INT32 i;       if(!args)    SIMPLE_TOO_FEW_ARGS_ERROR("_refs", 1);    -  if(Pike_sp[-args].type > MAX_REF_TYPE) +  if(TYPEOF(Pike_sp[-args]) > MAX_REF_TYPE)    SIMPLE_BAD_ARG_ERROR("refs", 1,    "array|mapping|multiset|object|"    "function|program|string");       i=Pike_sp[-args].u.refs[0];    pop_n_elems(args);    push_int(i);   }      #ifdef PIKE_DEBUG   /* This function is for debugging *ONLY*    * do not document please. /Hubbe    */   PMOD_EXPORT void f__leak(INT32 args)   {    INT32 i;       if(!args)    SIMPLE_TOO_FEW_ARGS_ERROR("_leak", 1);    -  if(Pike_sp[-args].type > MAX_REF_TYPE) +  if(TYPEOF(Pike_sp[-args]) > MAX_REF_TYPE)    SIMPLE_BAD_ARG_ERROR("_leak", 1,    "array|mapping|multiset|object|"    "function|program|string");       add_ref(Pike_sp[-args].u.dummy);    i=Pike_sp[-args].u.refs[0];    pop_n_elems(args);    push_int(i);   }   #endif
pike.git/src/builtin_functions.c:7695:    *! @seealso    *! @[master()]    */   PMOD_EXPORT void f_replace_master(INT32 args)   {    struct object *new_master;    ASSERT_SECURITY_ROOT("replace_master");       if(!args)    SIMPLE_TOO_FEW_ARGS_ERROR("replace_master", 1); -  if(Pike_sp[-args].type != T_OBJECT) +  if(TYPEOF(Pike_sp[-args]) != T_OBJECT)    SIMPLE_BAD_ARG_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 (Pike_sp[-args].subtype) +  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_constant_text ("is_pike_master");    args++;    object_set_index (new_master, 0, Pike_sp - 1, &svalue_int_one);       free_object(master_object);    master_object=new_master;    add_ref(master_object);
pike.git/src/builtin_functions.c:8056:    *! @seealso    *! @[`/()], @[`*()], @[`+()], @[`-()], @[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 (Pike_sp[i-args].type!=T_ARRAY) +  if (TYPEOF(Pike_sp[i-args]) != T_ARRAY)    SIMPLE_BAD_ARG_ERROR("splice", i+1, "array");    else    if (Pike_sp[i-args].u.array->size < size)    size=Pike_sp[i-args].u.array->size;       out=allocate_array(args * size);    if (!args)    {    push_array(out);    return;
pike.git/src/builtin_functions.c:8124:    bad_arg_error("everynth", Pike_sp-args, args, 2, "int", Pike_sp+1-args,    "Argument negative.\n");    case 1:    ina=Pike_sp[-args].u.array;    }       a=allocate_array(((size=ina->size)-start+n-1)/n);    types = 0;    for(k=0; start<size; k++, start+=n) {    assign_svalue_no_free(ITEM(a) + k, ina->item+start); -  types |= 1 << ITEM(a)[k].type; +  types |= 1 << TYPEOF(ITEM(a)[k]);    }    a->type_field=types;       pop_n_elems(args);    push_array(a);    return;   }      /*! @decl array(array) transpose(array(array) matrix)    *! Takes an array of equally sized arrays (essentially a matrix of size M*N)
pike.git/src/builtin_functions.c:8150:    struct array *out;    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 (Pike_sp[-args].type!=T_ARRAY) +  if (TYPEOF(Pike_sp[-args]) != T_ARRAY)    SIMPLE_BAD_ARG_ERROR("transpose", 1, "array(array)");       in=Pike_sp[-args].u.array;    sizein=in->size;       if(!sizein)    {    pop_n_elems(args);    out=allocate_array(0);    push_array(out);
pike.git/src/builtin_functions.c:8191:    struct svalue * ett;    struct svalue * tva;       outinner=allocate_array(sizein);    ett=outinner->item;    tva=in->item;    for(i=0; i<sizein; i++)    assign_svalue_no_free(ett+i, tva[i].u.array->item+j);       outinner->type_field=type; -  out->item[j].u.array=outinner; -  out->item[j].type=T_ARRAY; +  SET_SVAL(out->item[j], T_ARRAY, 0, array, outinner);    }       out->type_field=BIT_ARRAY;    pop_n_elems(args);    push_array(out);    return;   }      /*! @endmodule    */
pike.git/src/builtin_functions.c:8330: Inside #if defined(PIKE_DEBUG)
   *! @note    *! This function only exists if the Pike runtime has been compiled    *! with RTL debug.    */   PMOD_EXPORT void f__gc_set_watch(INT32 args)   {    ASSERT_SECURITY_ROOT("_gc_set_watch");       if (args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("_gc_set_watch", 1); -  if (Pike_sp[-args].type > MAX_REF_TYPE) +  if (TYPEOF(Pike_sp[-args]) > MAX_REF_TYPE)    SIMPLE_BAD_ARG_ERROR("_gc_set_watch", 1, "reference type");    gc_watch(Pike_sp[-args].u.refs);    pop_n_elems(args);   }      /*! @decl void dump_backlog()    *! @belongs Debug    *!    *! Dumps the 1024 latest executed opcodes, along with the source    *! code lines, to standard error. The backlog is only collected on
pike.git/src/builtin_functions.c:8437:    struct svalue *mysp;    struct array *a,*d;    int splice,i,n;    TYPE_FIELD types;       if (args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("map", 1);    else if (args<2)    { push_int(0); args++; }    -  switch (Pike_sp[-args].type) +  switch (TYPEOF(Pike_sp[-args]))    {    case T_ARRAY:    break;       case T_MAPPING:    case T_PROGRAM:    case T_FUNCTION:    /* mapping ret =    mkmapping(indices(arr),    map(values(arr),fun,@extra)); */
pike.git/src/builtin_functions.c:8519:    push_svalue(mysp-3);    push_constant_text("cast");    f_arrow(2);    if (!UNSAFE_IS_ZERO(Pike_sp-1))    {    pop_stack();       push_constant_text("array");    /* FIXME: Object subtype! */    safe_apply(mysp[-3].u.object,"cast",1); -  if (Pike_sp[-1].type==T_ARRAY) +  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();       push_constant_text("mapping");    /* FIXME: Object subtype! */    safe_apply(mysp[-3].u.object,"cast",1); -  if (Pike_sp[-1].type==T_MAPPING) +  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();       push_constant_text("multiset");    /* FIXME: Object subtype! */    safe_apply(mysp[-3].u.object,"cast",1); -  if (Pike_sp[-1].type==T_MULTISET) +  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();
pike.git/src/builtin_functions.c:8573:       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 (Pike_sp[-1].type!=T_INT) +  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 << ITEM(d)->type; +  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();
pike.git/src/builtin_functions.c:8625:    return;    }       f_aggregate(args-2);    mysp=Pike_sp;    splice=mysp[-1].u.array->size;       a=mysp[-3].u.array;    n=a->size;    -  switch (mysp[-2].type) +  switch (TYPEOF(mysp[-2]))    {    case T_FUNCTION:    case T_PROGRAM:    case T_OBJECT:    case T_ARRAY:    /* ret[i]=fun(arr[i],@extra); */    push_array(d=allocate_array(n));    d=Pike_sp[-1].u.array;    types = 0;    -  if(mysp[-2].type == T_FUNCTION && -  mysp[-2].subtype == FUNCTION_BUILTIN) +  if(TYPEOF(mysp[-2]) == T_FUNCTION && +  SUBTYPEOF(mysp[-2]) == FUNCTION_BUILTIN)    {    c_fun fun=mysp[-2].u.efun->function;    struct svalue *spbase=Pike_sp;       if(splice)    {    for (i=0; i<n; i++)    {    push_svalue(a->item+i);    add_ref_svalue(mysp-1);    push_array_items(mysp[-1].u.array);    (* fun)(1+splice);    if(Pike_sp>spbase)    {    stack_pop_to_no_free (ITEM(d) + i); -  types |= 1 << ITEM(d)[i].type; +  types |= 1 << TYPEOF(ITEM(d)[i]);    pop_n_elems(Pike_sp-spbase);    }    else    types |= BIT_INT;    }    }else{    for (i=0; i<n; i++)    {    push_svalue(ITEM(a)+i);    (* fun)(1);    if(Pike_sp>spbase)    {    stack_pop_to_no_free (ITEM(d) + i); -  types |= 1 << ITEM(d)[i].type; +  types |= 1 << TYPEOF(ITEM(d)[i]);    pop_n_elems(Pike_sp-spbase);    }    else    types |= BIT_INT;    }    }    }else{    for (i=0; i<n; i++)    {    push_svalue(ITEM(a)+i);
pike.git/src/builtin_functions.c:8689:    {    add_ref_svalue(mysp-1);    push_array_items(mysp[-1].u.array);    apply_svalue(mysp-2,1+splice);    }    else    {    apply_svalue(mysp-2,1);    }    stack_pop_to_no_free (ITEM(d) + i); -  types |= 1 << ITEM(d)[i].type; +  types |= 1 << TYPEOF(ITEM(d)[i]);    }    }    d->type_field = types;    stack_pop_n_elems_keep_top(3); /* fun arr extra d -> d */    return;       case T_MAPPING:    case T_MULTISET:    /* ret[i]=fun[arr[i]]; */    pop_stack();
pike.git/src/builtin_functions.c:8723:    if(UNSAFE_IS_ZERO(Pike_sp-1))    {    types |= BIT_INT;    pop_stack();    continue;    }    add_ref_svalue(mysp-1);    push_array_items(mysp[-1].u.array);    f_call_function(splice+1);    stack_pop_to_no_free (ITEM(d) + i); -  types |= 1 << ITEM(d)[i].type; +  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,    "function|program|object|"    "string|int(0..0)|multiset");    }
pike.git/src/builtin_functions.c:8824:    */   PMOD_EXPORT void f_filter(INT32 args)   {    int n,i,m,k;    struct array *a,*y,*f;    struct svalue *mysp;       if (args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("filter", 1);    -  switch (Pike_sp[-args].type) +  switch (TYPEOF(Pike_sp[-args]))    {    case T_ARRAY: -  if (args >= 2 && Pike_sp[1-args].type == 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));    dmalloc_touch_svalue(Pike_sp);    Pike_sp++;    add_ref_svalue(Pike_sp-args);    f_map(args);
pike.git/src/builtin_functions.c:8951:    push_svalue(mysp-3);    push_constant_text("cast");    f_arrow(2);    if (!UNSAFE_IS_ZERO(Pike_sp-1))    {    pop_stack();       push_constant_text("array");    /* FIXME: Object subtype! */    safe_apply(mysp[-3].u.object,"cast",1); -  if (Pike_sp[-1].type==T_ARRAY) +  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();       push_constant_text("mapping");    /* FIXME: Object subtype! */    safe_apply(mysp[-3].u.object,"cast",1); -  if (Pike_sp[-1].type==T_MAPPING) +  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();       push_constant_text("multiset");    /* FIXME: Object subtype! */    safe_apply(mysp[-3].u.object,"cast",1); -  if (Pike_sp[-1].type==T_MULTISET) +  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();
pike.git/src/builtin_functions.c:9014:    int argno;    node **cb_;    /* Assume worst case. */    int node_info = OPT_SIDE_EFFECT | OPT_EXTERNAL_DEPEND;       /* Note: argument 2 has argno 1. */    for (argno = 1; (cb_ = my_get_arg(&_CDR(n), argno)); argno++) {    node *cb = *cb_;       if ((cb->token == F_CONSTANT) && -  (cb->u.sval.type == T_FUNCTION) && -  (cb->u.sval.subtype == FUNCTION_BUILTIN)) { +  (TYPEOF(cb->u.sval) == T_FUNCTION) && +  (SUBTYPEOF(cb->u.sval) == FUNCTION_BUILTIN)) {    if (cb->u.sval.u.efun->optimize == fix_map_node_info) {    /* map() or filter(). */    continue;    }    node_info &= cb->u.sval.u.efun->flags;    }    /* FIXME: Type-checking? */    break;    }   
pike.git/src/builtin_functions.c:9084:    push_int(1);    args++;    }    if (args<3)    {    push_int(0);    args++;    }       if (args<=3 && -  (Pike_sp[1-args].type==T_INT && -  Pike_sp[2-args].type==T_INT)) +  (TYPEOF(Pike_sp[1-args]) == T_INT && +  TYPEOF(Pike_sp[2-args]) == T_INT))    {    INT_TYPE step,start;       get_all_args("enumerate", args, "%i%i%i", &n, &step, &start);    if (n<0)    SIMPLE_BAD_ARG_ERROR("enumerate",1,"int(0..)");       pop_n_elems(args);    push_array(d=allocate_array(n));    for (i=0; i<n; i++)
pike.git/src/builtin_functions.c:9117: Inside #if defined(AUTO_BIGNUM)
   convert_stack_top_to_bignum();    f_enumerate(3);    return;    }   #endif    start+=step;    }    d->type_field = BIT_INT;    }    else if (args<=3 && -  ((Pike_sp[1-args].type==T_INT || -  Pike_sp[1-args].type==T_FLOAT) && -  (Pike_sp[2-args].type==T_INT || -  Pike_sp[2-args].type==T_FLOAT) ) ) +  ((TYPEOF(Pike_sp[1-args]) == T_INT || +  TYPEOF(Pike_sp[1-args]) == T_FLOAT) && +  (TYPEOF(Pike_sp[2-args]) == T_INT || +  TYPEOF(Pike_sp[2-args]) == T_FLOAT) ) )    {    FLOAT_TYPE step, start;       get_all_args("enumerate", args, "%i%F%F", &n, &step, &start);    if (n<0)    SIMPLE_BAD_ARG_ERROR("enumerate",1,"int(0..)");       pop_n_elems(args);       push_array(d=allocate_array(n));    for (i=0; i<n; i++)    { -  d->item[i].u.float_number=start; -  d->item[i].type=T_FLOAT; +  SET_SVAL(d->item[i], T_FLOAT, 0, float_number, start);    start+=step;    }    d->type_field = BIT_FLOAT;    }    else    {    TYPE_FIELD types = 0;    get_all_args("enumerate", args, "%i", &n);    if (n<0) SIMPLE_BAD_ARG_ERROR("enumerate",1,"int(0..)");    if (args>4) pop_n_elems(args-4);    push_array(d=allocate_array(n));    if (args<4)    {    push_svalue(Pike_sp-2); /* start */    for (i=0; i<n; i++)    {    assign_svalue_no_free(ITEM(d)+i,Pike_sp-1); -  types |= 1 << ITEM(d)[i].type; +  types |= 1 << TYPEOF(ITEM(d)[i]);    if (i<n-1)    {    push_svalue(Pike_sp-4); /* step */    f_add(2);    }    }    }    else    {    push_svalue(Pike_sp-3); /* start */    for (i=0; i<n; i++)    {    assign_svalue_no_free(ITEM(d)+i,Pike_sp-1); -  types |= 1 << ITEM(d)[i].type; +  types |= 1 << TYPEOF(ITEM(d)[i]);    if (i<n-1)    {    push_svalue(Pike_sp-3); /* function */    stack_swap();    push_svalue(Pike_sp-6); /* step */    f_call_function(3);    }    }    }    d->type_field = types;
pike.git/src/builtin_functions.c:9197:    *! Returns an array with the programs that @[p] has inherited.    */   PMOD_EXPORT void f_inherit_list(INT32 args)   {    struct program *p;    struct svalue *arg;    struct object *par;    int parid,e,q=0;       get_all_args("inherit_list",args,"%*",&arg); -  if(Pike_sp[-args].type == T_OBJECT) +  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");    -  if(arg->type == T_FUNCTION) +  if(TYPEOF(*arg) == T_FUNCTION)    {    par=arg->u.object; -  parid=arg->subtype; +  parid = SUBTYPEOF(*arg);    }else{    par=0;    parid=-1;    }       check_stack(p->num_inherits);    for(e=0;e<p->num_inherits;e++)    {    struct inherit *in=p->inherits+e;   
pike.git/src/builtin_functions.c:9283:    *! Returns a string with filename and linenumber where @[fun]    *! was defined.    *!    *! Returns @expr{0@} (zero) when no line can be found, e.g. for    *! builtin functions and functions in destructed objects.    */   PMOD_EXPORT void f_function_defined(INT32 args)   {    check_all_args("Function.defined",args,BIT_FUNCTION, 0);    -  if(Pike_sp[-args].subtype != FUNCTION_BUILTIN && +  if(SUBTYPEOF(Pike_sp[-args]) != FUNCTION_BUILTIN &&    Pike_sp[-args].u.object->prog)    {    struct program *p = Pike_sp[-args].u.object->prog;    struct program *id_prog, *p2; -  int func = Pike_sp[-args].subtype; +  int func = SUBTYPEOF(Pike_sp[-args]);    struct identifier *id;    INT32 line;    struct pike_string *file = NULL;       if (p == pike_trampoline_program) {    struct pike_trampoline *t =    (struct pike_trampoline *) Pike_sp[-args].u.object->storage;    if (t->frame->current_object->prog) {    p = t->frame->current_object->prog;    func = t->func;