kopia lustrzana https://github.com/Hamlib/Hamlib
Change debug statements to use spaces() function
rodzic
9b817f325d
commit
34f953ba0b
|
@ -33,7 +33,7 @@
|
|||
// Our shared secret password
|
||||
#define HAMLIB_SECRET_LENGTH 32
|
||||
|
||||
#define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%.*s%s(%d) trace\n",rig->state.depth-1, spaces(), __FILE__, __LINE__)
|
||||
#define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s%s(%d) trace\n",spaces(rig->state.depth-1), __FILE__, __LINE__)
|
||||
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -3692,7 +3692,7 @@ extern HAMLIB_EXPORT_VAR(char) debugmsgsave3[DEBUGMSGSAVE_SIZE]; // last-2 debu
|
|||
|
||||
// Measuring elapsed time -- local variable inside function when macro is used
|
||||
#define ELAPSED1 struct timespec __begin; elapsed_ms(&__begin, HAMLIB_ELAPSED_SET);
|
||||
#define ELAPSED2 rig_debug(RIG_DEBUG_VERBOSE, "%.*s%d:%s: elapsed=%.0lfms\n", rig->state.depth-1, spaces(), rig->state.depth, __func__, elapsed_ms(&__begin, HAMLIB_ELAPSED_GET));
|
||||
#define ELAPSED2 rig_debug(RIG_DEBUG_VERBOSE, "%s%d:%s: elapsed=%.0lfms\n", spaces(rig->state.depth-1), rig->state.depth, __func__, elapsed_ms(&__begin, HAMLIB_ELAPSED_GET));
|
||||
|
||||
// use this instead of snprintf for automatic detection of buffer limit
|
||||
#define SNPRINTF(s,n,...) { snprintf(s,n,##__VA_ARGS__);if (strlen(s) > n-1) fprintf(stderr,"****** %s(%d): buffer overflow ******\n", __func__, __LINE__); }
|
||||
|
|
Ładowanie…
Reference in New Issue