Skip to content
Snippets Groups Projects
Commit cbfdcbe7 authored by Izzard, Robert Dr (Maths & Physics)'s avatar Izzard, Robert Dr (Maths & Physics)
Browse files

improve macros for error description in buffered_printf

parent 439f1632
No related branches found
No related tags found
No related merge requests found
......@@ -5,12 +5,12 @@
/*
* testing settings
*/
/*
#undef BUFFERED_STRING_OVERRUN_WARNINGS
#define BUFFERED_STRING_OVERRUN_WARNINGS
#undef BUFFERED_PRINTF_MAX_BUFFER_SIZE
#define BUFFERED_PRINTF_MAX_BUFFER_SIZE ((size_t)(1024*2))
*/
#undef BUFFERED_STRING_OVERRUN_WARNINGS
#define BUFFERED_STRING_OVERRUN_WARNINGS
#undef BUFFERED_PRINTF_MAX_BUFFER_SIZE
#define BUFFERED_PRINTF_MAX_BUFFER_SIZE ((size_t)(1024*2))
static size_t __deslash(char * const string);
static void __buffered_printf_error(struct tmpstore_t * t,
......@@ -306,7 +306,7 @@ int Gnu_format_args(3,4) buffered_printf(
{
__buffered_printf_error(
stardata->tmpstore,
"SYSTEM_ERROR buffered_printf uncaught problem %d \"%s\" : time = %g\n",
"SYSTEM_ERROR buffered_printf error %d \"%s\" : time = %g\n",
retval,
Buffered_printf_error_string(retval),
stardata->model.time
......
......@@ -17,11 +17,11 @@
*/
#define Buffered_printf_error_string(N) \
( \
(N) == BUFFERED_PRINTF_GENERIC_ERROR ? "Generic" : \
(N) == BUFFERED_PRINTF_ASPRINTF_ERROR ? "asprintf" : \
(N) == BUFFERED_PRINTF_ALLOC_ERROR ? "alloc" : \
(N) == BUFFERED_PRINTF_FULL_ERROR ? "full" : \
(N) == BUFFERED_PRINTF_STARDATA_ERROR ? "stardata" : \
(N) == BUFFERED_PRINTF_GENERIC_ERROR ? "generic problem" : \
(N) == BUFFERED_PRINTF_ASPRINTF_ERROR ? "asprintf failed" : \
(N) == BUFFERED_PRINTF_ALLOC_ERROR ? "alloc failed" : \
(N) == BUFFERED_PRINTF_FULL_ERROR ? "buffer is full" : \
(N) == BUFFERED_PRINTF_STARDATA_ERROR ? "stardata or stardata->tmpstore is NULL" : \
"unknown" \
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment