pike.git / src / error.c

version» Context lines:

pike.git/src/error.c:871:   #endif /* ERROR_DEBUG */      #define INIT_ERROR(FEL)\    va_list foo; \    struct object *o; \    va_start(foo,desc); \    ASSERT_THREAD_SWAPPED_IN(); \    DWERROR("%s(): Throwing a " #FEL " error\n", func); \    o=fast_clone_object(PIKE_CONCAT(FEL,_error_program))    - #define ERROR_DONE(FOO) \ -  PIKE_CONCAT(FOO,_error_va(o,func, \ -  base_sp, args, \ -  desc, &foo)); \ + #define ERROR_DONE() \ +  generic_error_va(o,func, base_sp, args, desc, &foo); \    va_end(foo)      #define ERROR_STRUCT(STRUCT,O) \    ((struct PIKE_CONCAT(STRUCT,_error_struct) *)((O)->storage + PIKE_CONCAT(STRUCT,_error_offset)))      #define ERROR_COPY(STRUCT,X) \    ERROR_STRUCT(STRUCT,o)->X=X      #define ERROR_COPY_SVALUE(STRUCT,X) do { \    if (X) { \
pike.git/src/error.c:987:   PMOD_EXPORT DECLSPEC(noreturn) void throw_error_object(    struct object *o,    const char *func, int args,    const char *desc, ...) ATTRIBUTE((noreturn))   {    const struct svalue *base_sp = Pike_sp - args;    va_list foo;    va_start(foo,desc);    ASSERT_THREAD_SWAPPED_IN();    DWERROR("%s(): Throwing an error object\n", func); -  ERROR_DONE(generic); +  ERROR_DONE();   }      /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void generic_error(    const char *func,    const struct svalue *base_sp, int args,    const char *desc, ...) ATTRIBUTE((noreturn))   {    INIT_ERROR(generic); -  ERROR_DONE(generic); +  ERROR_DONE();   }      /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void index_error(    const char *func, int args,    struct svalue *value,    struct svalue *index,    const char *desc, ...) ATTRIBUTE((noreturn))   {    const struct svalue *base_sp = Pike_sp - args;    INIT_ERROR(index);    ERROR_COPY_SVALUE(index, value);    ERROR_COPY_SVALUE(index, index); -  ERROR_DONE(generic); +  ERROR_DONE();   }      /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void bad_arg_error(    const char *func,    const struct svalue *base_sp, int args,    int which_argument,    const char *expected_type,    struct svalue *got_value,    const char *desc, ...) ATTRIBUTE((noreturn))
pike.git/src/error.c:1034:    if(!base_sp) base_sp = Pike_sp-args;    ERROR_COPY(bad_argument, which_argument);    if (expected_type)    ERROR_STRUCT(bad_argument,o)->expected_type =    make_shared_string(expected_type);    else    ERROR_STRUCT(bad_argument,o)->expected_type = NULL;    ERROR_COPY_SVALUE(bad_argument, got_value);    DWERROR("%s():Bad arg %d (expected %s)\n",    func, which_argument, expected_type); -  ERROR_DONE(generic); +  ERROR_DONE();   }      /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void math_error(    const char *func, int args,    struct svalue *number,    const char *desc, ...) ATTRIBUTE((noreturn))   {    INIT_ERROR(math);    const struct svalue *base_sp = Pike_sp - args;    if(number)    {    ERROR_COPY_SVALUE(math, number);    }else{    SET_SVAL(ERROR_STRUCT(math,o)->number, PIKE_T_INT, NUMBER_UNDEFINED,    integer, 0);    } -  ERROR_DONE(generic); +  ERROR_DONE();   }      /* coverity[+kill] */   static DECLSPEC(noreturn) void resource_error(    const char *func, int args,    size_t howmuch_,    const char *desc, ...) ATTRIBUTE((noreturn))   {    INT_TYPE howmuch = (INT_TYPE)howmuch_;    const struct svalue *base_sp = NULL;    INIT_ERROR(resource);    if(args>=0) base_sp = Pike_sp-args;    ERROR_COPY(resource, howmuch);    ERROR_STRUCT(resource,o)->resource_type=make_shared_string("memory"); -  ERROR_DONE(generic); +  ERROR_DONE();   }      PMOD_EXPORT DECLSPEC(noreturn) void out_of_memory_error (    const char *func, int args,    size_t amount)   {    resource_error (func, args, amount,    amount ? msg_out_of_mem_2 : msg_out_of_mem, amount);    UNREACHABLE();   }