Branch: Tag:

2014-08-25

2014-08-25 18:29:35 by Martin Nilsson <nilsson@opera.com>

More consistent use of error macros.

299:    default:    {    INT32 args=1; -  SIMPLE_BAD_ARG_ERROR("Stat `[]",1,"int(0..6)"); +  SIMPLE_BAD_ARG_ERROR("`[]",1,"int(0..6)");    }    }   }
515:    _stat_index( tmp ? tmp->u.integer : 0 );    }    else -  SIMPLE_BAD_ARG_ERROR("Stat `[]",1,"int(0..6)|string"); +  SIMPLE_BAD_ARG_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("Stat `[..]",1,"int"); +  SIMPLE_BAD_ARG_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("Stat `[..]",2,"int"); +  SIMPLE_BAD_ARG_ERROR("`[..]",2,"int");       /* make in range 0..6 */    push_int(6);
559:      static void _stat_index_set (INT_TYPE code, struct svalue *val, int got_int_val, INT64 int_val )   { - #define BAD_ARG_2(X) bad_arg_error("Stat.`[]=", Pike_sp-2,2,2,X,val,msg_bad_arg,2,"Stat.`[]=",X) + #define BAD_ARG_2(X) bad_arg_error("`[]=", Pike_sp-2,2,2,X,val,msg_bad_arg,2,"`[]=",X)       if( got_int_val == -1 )    {
568:    else if (TYPEOF(*val) == T_OBJECT && is_bignum_object (val->u.object))    {    if (!int64_from_bignum (&int_val, val->u.object)) -  Pike_error ("Stat `[]=: Too big integer as value.\n"); +  Pike_error ("`[]=: Too big integer as value.\n");    else    got_int_val = 1;    }
759:       if (TYPEOF(sp[-2]) == T_INT) {    if (!got_int_val) -  SIMPLE_BAD_ARG_ERROR ("Stat `[]=", 2, +  SIMPLE_BAD_ARG_ERROR ("`[]=", 2,    "integer when the first argument is an integer");    if (!stat_compat_set (sp[-2].u.integer, int_val)) -  SIMPLE_BAD_ARG_ERROR ("Stat `[]=", 1, "int(0..6)|string"); +  SIMPLE_BAD_ARG_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 ("Stat `[]=", 1, "int(0..6)|string"); +  else SIMPLE_BAD_ARG_ERROR ("`[]=", 1, "int(0..6)|string");       stack_swap();    pop_stack();
912:    struct array *a = sp[-1].u.array;    int i;    if (a->size != 7) -  SIMPLE_BAD_ARG_ERROR ("Stat create", 1, "stat array with 7 elements"); +  SIMPLE_BAD_ARG_ERROR ("create", 1, "stat array with 7 elements");    for (i = 0; i < 7; i++) {    INT64 val;    if (TYPEOF(ITEM(a)[i]) == T_INT)
920:    else if (TYPEOF(ITEM(a)[i]) == T_OBJECT &&    is_bignum_object (ITEM(a)[i].u.object)) {    if (!int64_from_bignum (&val, ITEM(a)[i].u.object)) -  Pike_error ("Stat create: Too big integer in stat array.\n"); +  Pike_error ("create: Too big integer in stat array.\n");    }    else -  SIMPLE_BAD_ARG_ERROR ("Stat create", 1, "array(int)"); +  SIMPLE_BAD_ARG_ERROR ("create", 1, "array(int)");    stat_compat_set (i, val);    }    }       else -  SIMPLE_BAD_ARG_ERROR ("Stat create", 1, "void|Stdio.Stat|array(int)"); +  SIMPLE_BAD_ARG_ERROR ("create", 1, "void|Stdio.Stat|array(int)");    }       pop_n_elems (args);