pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:834:   /*! @decl void random_seed(int seed)    *!    *! 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(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);   }      /*! @decl int query_num_arg()    *!    *! Returns the number of arguments given when the previous function was    *! called.    *!    *! This is useful for functions that take a variable number of arguments.
pike.git/src/builtin_functions.c:4630:    *!    *! @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(TYPEOF(Pike_sp[-args]) != T_OBJECT || !Pike_sp[-args].u.object->prog - #ifdef AUTO_BIGNUM -  || is_bignum_object(Pike_sp[-args].u.object) - #endif -  ) +  || is_bignum_object(Pike_sp[-args].u.object))    {    pop_n_elems(args);    push_int(0);    }else{    pop_n_elems(args);    push_int(1);    }   }      /*! @decl int functionp(mixed arg)
pike.git/src/builtin_functions.c:9197:       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++)    {    ITEM(d)[i].u.integer=start; - #ifdef AUTO_BIGNUM +     if ((step>0 && start+step<start) ||    (step<0 && start+step>start)) /* overflow */    {    pop_stack();    push_int(n);    push_int(step);    convert_stack_top_to_bignum();    push_int(start);    convert_stack_top_to_bignum();    f_enumerate(3);    return;    } - #endif +     start+=step;    }    d->type_field = BIT_INT;    }    else if (args<=3 &&    ((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) ) )    {