pike.git / src / modules / Image / image.c

version» Context lines:

pike.git/src/modules/Image/image.c:2201:       push_object(o);   }      static void select_random(INT32 args)   {    if(args>1)    Pike_error("Too may arguments.\n");    if(!args)    { -  push_svalue(simple_mapping_string_lookup(get_builtin_constants(), -  "random")); -  if(TYPEOF(sp[-1])!=T_FUNCTION) +  struct svalue *random = +  simple_mapping_string_lookup(get_builtin_constants(), "random"); +  if(!random || (TYPEOF(*random) != T_FUNCTION))    Pike_error("Unable to resolve random function.\n"); -  +  push_svalue(random);    }    else if(TYPEOF(sp[-1])==T_INT)    {    push_constant_text("Random.Deterministic");    SAFE_APPLY_MASTER("resolv_or_error",1);    if(TYPEOF(sp[-1])!=T_PROGRAM)    Pike_error("Unable to resolve Random.Deterministic program.\n");    struct program *o = sp[-1].u.program;    stack_swap();    push_object(clone_object(o, 1));