kopia lustrzana https://github.com/Hamlib/Hamlib
Convert macros in rig.h to use STATE()
Note that the other pointer macros are NOT converted - they should be changed one-by-one as any are moved.pull/1561/head
rodzic
a63e518393
commit
ce25f63843
|
@ -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",spaces(rig->state.depth), __FILE__, __LINE__)
|
||||
#define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s%s(%d) trace\n",spaces(STATE(rig)->depth), __FILE__, __LINE__)
|
||||
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -618,13 +618,13 @@ typedef unsigned int vfo_t;
|
|||
// Compared to older rigs which have one or the other
|
||||
// So we need to distinguish between them
|
||||
//! @cond Doxygen_Suppress
|
||||
#define VFO_HAS_A_B ((rig->state.vfo_list & (RIG_VFO_A|RIG_VFO_B)) == (RIG_VFO_A|RIG_VFO_B))
|
||||
#define VFO_HAS_MAIN_SUB ((rig->state.vfo_list & (RIG_VFO_MAIN|RIG_VFO_SUB)) == (RIG_VFO_MAIN|RIG_VFO_SUB))
|
||||
#define VFO_HAS_A_B ((STATE(rig)->vfo_list & (RIG_VFO_A|RIG_VFO_B)) == (RIG_VFO_A|RIG_VFO_B))
|
||||
#define VFO_HAS_MAIN_SUB ((STATE(rig)->vfo_list & (RIG_VFO_MAIN|RIG_VFO_SUB)) == (RIG_VFO_MAIN|RIG_VFO_SUB))
|
||||
#define VFO_HAS_MAIN_SUB_ONLY ((!VFO_HAS_A_B) & VFO_HAS_MAIN_SUB)
|
||||
#define VFO_HAS_MAIN_SUB_A_B_ONLY (VFO_HAS_A_B & VFO_HAS_MAIN_SUB)
|
||||
#define VFO_HAS_A_B_ONLY (VFO_HAS_A_B & (!VFO_HAS_MAIN_SUB))
|
||||
#define VFO_DUAL (RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B)
|
||||
#define VFO_HAS_DUAL ((rig->state.vfo_list & VFO_DUAL) == VFO_DUAL)
|
||||
#define VFO_HAS_DUAL ((STATE(rig)->vfo_list & VFO_DUAL) == VFO_DUAL)
|
||||
//! @endcond
|
||||
|
||||
/**
|
||||
|
@ -3739,7 +3739,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", spaces(rig->state.depth), rig->state.depth, __func__, elapsed_ms(&__begin, HAMLIB_ELAPSED_GET));
|
||||
#define ELAPSED2 rig_debug(RIG_DEBUG_VERBOSE, "%s%d:%s: elapsed=%.0lfms\n", spaces(STATE(rig)->depth), STATE(rig)->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