Branch: Tag:

2016-01-11

2016-01-11 19:49:51 by Martin Nilsson <nilsson@fastmail.com>

Use variadic macros.

860:    */      #ifdef ERROR_DEBUG - #define DWERROR(X) fprintf X + #define DWERROR(...) fprintf(stderr, __VA_ARGS__)   #else /* !ERROR_DEBUG */ - #define DWERROR(X) + #define DWERROR(...)   #endif /* ERROR_DEBUG */      #define INIT_ERROR(FEL)\
870:    struct object *o; \    va_start(foo,desc); \    ASSERT_THREAD_SWAPPED_IN(); \ -  DWERROR((stderr, "%s(): Throwing a " #FEL " error\n", func)); \ +  DWERROR("%s(): Throwing a " #FEL " error\n", func); \    o=fast_clone_object(PIKE_CONCAT(FEL,_error_program))      #define ERROR_DONE(FOO) \
994:    va_list foo;    va_start(foo,desc);    ASSERT_THREAD_SWAPPED_IN(); -  DWERROR((stderr, "%s(): Throwing an error object\n", func)); +  DWERROR("%s(): Throwing an error object\n", func);    ERROR_DONE(generic);   }   
1039:    else    ERROR_STRUCT(bad_argument,o)->expected_type = NULL;    ERROR_COPY_SVALUE(bad_argument, got_value); -  DWERROR((stderr, "%s():Bad arg %d (expected %s)\n", -  func, which_argument, expected_type)); +  DWERROR("%s():Bad arg %d (expected %s)\n", +  func, which_argument, expected_type);    ERROR_DONE(generic);   }