Branch: Tag:

2016-01-26

2016-01-26 19:38:42 by Martin Nilsson <nilsson@fastmail.com>

SIMPLE_BAD_ARG_ERROR is only kept for compatibility, but we still had 500+ uses of it.

299:    default:    {    INT32 args=1; -  SIMPLE_BAD_ARG_ERROR("`[]",1,"int(0..6)"); +  SIMPLE_ARG_TYPE_ERROR("`[]",1,"int(0..6)");    }    }   }
515:    _stat_index( tmp ? tmp->u.integer : 0 );    }    else -  SIMPLE_BAD_ARG_ERROR("`[]",1,"int(0..6)|string"); +  SIMPLE_ARG_TYPE_ERROR("`[]",1,"int(0..6)|string");    }    else if (args>=2) /* range */    {
528:       if (TYPEOF(sp[-2]) != T_INT &&    !(TYPEOF(sp[-2]) == T_OBJECT && is_bignum_object (sp[-2].u.object))) -  SIMPLE_BAD_ARG_ERROR("`[..]",1,"int"); +  SIMPLE_ARG_TYPE_ERROR("`[..]",1,"int");       if (TYPEOF(sp[-1]) != T_INT &&    !(TYPEOF(sp[-1]) == T_OBJECT && is_bignum_object (sp[-1].u.object))) -  SIMPLE_BAD_ARG_ERROR("`[..]",2,"int"); +  SIMPLE_ARG_TYPE_ERROR("`[..]",2,"int");       /* make in range 0..6 */    push_int(6);
759:       if (TYPEOF(sp[-2]) == T_INT) {    if (!got_int_val) -  SIMPLE_BAD_ARG_ERROR ("`[]=", 2, +  SIMPLE_ARG_TYPE_ERROR ("`[]=", 2,    "integer when the first argument is an integer");    if (!stat_compat_set (sp[-2].u.integer, int_val)) -  SIMPLE_BAD_ARG_ERROR ("`[]=", 1, "int(0..6)|string"); +  SIMPLE_ARG_TYPE_ERROR ("`[]=", 1, "int(0..6)|string");    }    else if (TYPEOF(sp[-2]) == T_STRING) {    INT_TYPE code;
780:    _stat_index_set( tmp->u.integer, sp-1, got_int_val, int_val);    }    -  else SIMPLE_BAD_ARG_ERROR ("`[]=", 1, "int(0..6)|string"); +  else SIMPLE_ARG_TYPE_ERROR ("`[]=", 1, "int(0..6)|string");       stack_swap();    pop_stack();
800:    if (!args)    SIMPLE_TOO_FEW_ARGS_ERROR("Stat cast",1);    if (TYPEOF(sp[-args]) != T_STRING) -  SIMPLE_BAD_ARG_ERROR("cast",1,"string"); +  SIMPLE_ARG_TYPE_ERROR("cast",1,"string");       type = Pike_sp[-args].u.string;    pop_stack(); /* type have at least one more reference. */
830:    SIMPLE_TOO_FEW_ARGS_ERROR("_sprintf",2);       if (TYPEOF(sp[-args]) != T_INT) -  SIMPLE_BAD_ARG_ERROR("_sprintf",0,"integer"); +  SIMPLE_ARG_TYPE_ERROR("_sprintf",0,"integer");       x=sp[-args].u.integer;    pop_n_elems(args);
916:    struct array *a = sp[-1].u.array;    int i;    if (a->size != 7) -  SIMPLE_BAD_ARG_ERROR ("create", 1, "stat array with 7 elements"); +  SIMPLE_ARG_TYPE_ERROR ("create", 1, "stat array with 7 elements");    for (i = 0; i < 7; i++) {    INT64 val;    if (TYPEOF(ITEM(a)[i]) == T_INT)
927:    Pike_error ("create: Too big integer in stat array.\n");    }    else -  SIMPLE_BAD_ARG_ERROR ("create", 1, "array(int)"); +  SIMPLE_ARG_TYPE_ERROR ("create", 1, "array(int)");    stat_compat_set (i, val);    }    }       else -  SIMPLE_BAD_ARG_ERROR ("create", 1, "void|Stdio.Stat|array(int)"); +  SIMPLE_ARG_TYPE_ERROR ("create", 1, "void|Stdio.Stat|array(int)");    }       pop_n_elems (args);