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

version» Context lines:

pike.git/src/modules/Image/image.c:2213:    if(!args)    {    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)    { +  struct program *o;    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; +  o = sp[-1].u.program;    stack_swap();    push_object(clone_object(o, 1));    push_constant_text("random");    o_index();    if(TYPEOF(sp[-1])!=T_FUNCTION)    Pike_error("random is not a function.\n");    }    else if(TYPEOF(sp[-1])!=T_FUNCTION)    {    Pike_error("Expected seed or random function.\n");
pike.git/src/modules/Image/image.c:2257:   **! returns the new image   **! note   **! May be subject to change or cease without prior warning.   **!   **! see also: gradients, tuned_box   */      static void image_test(INT32 args)   {    int i; +  struct svalue *s;    select_random(args); -  struct svalue *s = &Pike_sp[-1]; +  s = &Pike_sp[-1];       for (i=0; i<5; i++)    {    push_int(THIS->xsize); apply_svalue(s, 1);    push_int(THIS->ysize); apply_svalue(s, 1);    push_int((i!=0)?255:0); apply_svalue(s, 1);    push_int((i!=1)?255:0); if (i!=4) apply_svalue(s, 1);    push_int((i!=2)?255:0); if (i!=3) apply_svalue(s, 1);    f_aggregate(5);    }