Fix some state.depth values

pull/1289/head^2
Mike Black W9MDB 2023-05-13 16:02:41 -05:00
rodzic 006ca07b3c
commit 300c0c415a
4 zmienionych plików z 26 dodań i 22 usunięć

Wyświetl plik

@ -3639,7 +3639,7 @@ int newcat_get_powerstat(RIG *rig, powerstat_t *status)
if (priv->ret_data[2] == '1')
{
*status = 1;
return RIG_OK;
RETURNFUNC(RIG_OK);
}
hl_usleep(1200000); // then we must be waking up
@ -11175,7 +11175,7 @@ rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width)
ncboolean narrow;
int i;
ENTERFUNC;
ENTERFUNC2;
*width = RIG_PASSBAND_NORMAL;
@ -11204,7 +11204,7 @@ rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width)
{
if (newcat_get_narrow(rig, vfo, &narrow) != RIG_OK)
{
RETURNFUNC(newcat_mode_conv[i].mode);
RETURNFUNC2(newcat_mode_conv[i].mode);
}
if (narrow == TRUE)
@ -11219,14 +11219,14 @@ rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width)
}
// don't use RETURNFUNC here as that macros expects an int for the return code
return (newcat_mode_conv[i].mode);
RETURNFUNC2 (newcat_mode_conv[i].mode);
}
}
rig_debug(RIG_DEBUG_VERBOSE, "%s fell out the bottom %c %s\n", __func__,
mode, rig_strrmode(mode));
RETURNFUNC('0');
RETURNFUNC2('0');
}
int newcat_send_voice_mem(RIG *rig, vfo_t vfo, int ch)

Wyświetl plik

@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
#define NEWCAT_VER "20230510"
#define NEWCAT_VER "20230513"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129

Wyświetl plik

@ -167,6 +167,7 @@ void errmsg(int err, char *s, const char *func, const char *file, int line);
#define RETURNFUNC(rc) {do { \
int rctmp = rc; \
rig_debug(RIG_DEBUG_VERBOSE, "%.*s%d:%s(%d):%s returning(%ld) %s\n", rig->state.depth, spaces(), rig->state.depth, __FILENAME__, __LINE__, __func__, (long int) (rctmp), rctmp<0?rigerror2(rctmp):""); \
if (rig->state.depth == 0) rig_debug(RIG_DEBUG_ERR, "%s(%d) depth=0 ******************\n", __func__, __LINE__); \
--rig->state.depth; \
return (rctmp); \
} while(0);}

Wyświetl plik

@ -168,7 +168,7 @@ const char hamlib_copyright[231] = /* hamlib 1.2 ABI specifies 231 bytes */
#define CHECK_RIG_ARG(r) (!(r) || !(r)->caps || !(r)->state.comm_state)
#define CHECK_RIG_CAPS(r) (!(r) || !(r)->caps)
#define LOCK \
#define LOCK if (rig->state.depth == 1) { rig_debug(RIG_DEBUG_ERR, "%s: lock!! *******************************************\n", __func__); }
#ifdef PTHREAD
#define MUTEX(var) static pthread_mutex_t var = PTHREAD_MUTEX_INITIALIZER
@ -831,11 +831,11 @@ int HAMLIB_API rig_open(RIG *rig)
//unsigned int net1, net2, net3, net4, net5, net6, net7, net8, port;
int is_network = 0;
ENTERFUNC;
ENTERFUNC2;
if (!rig || !rig->caps)
{
RETURNFUNC(-RIG_EINVAL);
RETURNFUNC2(-RIG_EINVAL);
}
caps = rig->caps;
@ -847,7 +847,7 @@ int HAMLIB_API rig_open(RIG *rig)
{
rig_debug(RIG_DEBUG_ERR, "%s: 'USB' is not a valid COM port name\n", __func__);
errno = 2;
RETURNFUNC(-RIG_EINVAL);
RETURNFUNC2(-RIG_EINVAL);
}
// rigctl/rigctld may have deprecated values -- backwards compatibility
@ -987,7 +987,7 @@ int HAMLIB_API rig_open(RIG *rig)
rs->comm_state);
port_close(&rs->rigport, rs->rigport.type.rig);
rs->comm_state = 0;
RETURNFUNC(-RIG_EINVAL);
RETURNFUNC2(-RIG_EINVAL);
}
rs->rigport.fd = -1;
@ -1001,7 +1001,7 @@ int HAMLIB_API rig_open(RIG *rig)
"%s: cannot set RTS with hardware handshake \"%s\"\n",
__func__,
rs->rigport.pathname);
RETURNFUNC(-RIG_ECONF);
RETURNFUNC2(-RIG_ECONF);
}
if ('\0' == rs->pttport.pathname[0]
@ -1015,7 +1015,7 @@ int HAMLIB_API rig_open(RIG *rig)
"%s: cannot set RTS with PTT by RTS \"%s\"\n",
__func__,
rs->rigport.pathname);
RETURNFUNC(-RIG_ECONF);
RETURNFUNC2(-RIG_ECONF);
}
if (rs->rigport.parm.serial.dtr_state != RIG_SIGNAL_UNSET
@ -1025,7 +1025,7 @@ int HAMLIB_API rig_open(RIG *rig)
"%s: cannot set DTR with PTT by DTR \"%s\"\n",
__func__,
rs->rigport.pathname);
RETURNFUNC(-RIG_ECONF);
RETURNFUNC2(-RIG_ECONF);
}
}
}
@ -1038,7 +1038,7 @@ int HAMLIB_API rig_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s: rs->comm_state==0?=%d\n", __func__,
rs->comm_state);
rs->comm_state = 0;
RETURNFUNC(status);
RETURNFUNC2(status);
}
switch (rs->pttport.type.ptt)
@ -1256,7 +1256,7 @@ int HAMLIB_API rig_open(RIG *rig)
if (status < 0)
{
port_close(&rs->rigport, rs->rigport.type.rig);
RETURNFUNC(status);
RETURNFUNC2(status);
}
status = async_data_handler_start(rig);
@ -1264,7 +1264,7 @@ int HAMLIB_API rig_open(RIG *rig)
if (status < 0)
{
port_close(&rs->rigport, rs->rigport.type.rig);
RETURNFUNC(status);
RETURNFUNC2(status);
}
add_opened_rig(rig);
@ -1295,7 +1295,7 @@ int HAMLIB_API rig_open(RIG *rig)
"%s: rig power is off, use --set-conf=auto_power_on=1 if power on is wanted\n",
__func__);
return (-RIG_EPOWER);
RETURNFUNC2 (-RIG_EPOWER);
}
// don't need auto_power_on if power is already on
@ -1310,7 +1310,7 @@ int HAMLIB_API rig_open(RIG *rig)
__func__);
// A TS-480 user was showing ;;;;PS; not working so we'll just show the error message for now
// https://github.com/Hamlib/Hamlib/issues/1226
//return (-RIG_EPOWER);
//RETURNFUNC2 (-RIG_EPOWER);
}
}
@ -1323,7 +1323,7 @@ int HAMLIB_API rig_open(RIG *rig)
port_close(&rs->rigport, rs->rigport.type.rig);
memcpy(&rs->rigport_deprecated, &rs->rigport, sizeof(hamlib_port_t_deprecated));
rs->comm_state = 0;
RETURNFUNC(status);
RETURNFUNC2(status);
}
}
@ -1425,7 +1425,7 @@ int HAMLIB_API rig_open(RIG *rig)
memcpy(&rs->rigport_deprecated, &rs->rigport, sizeof(hamlib_port_t_deprecated));
memcpy(&rs->pttport_deprecated, &rs->pttport, sizeof(hamlib_port_t_deprecated));
memcpy(&rs->dcdport_deprecated, &rs->dcdport, sizeof(hamlib_port_t_deprecated));
RETURNFUNC(RIG_OK);
RETURNFUNC2(RIG_OK);
}
@ -1784,6 +1784,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
vfo_t vfo_save;
ELAPSED1;
LOCK;
#if BUILTINFUNC
rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s, freq=%.0f, called from %s\n",
__func__,
@ -2043,6 +2044,8 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
rmode_t mode;
pbwidth_t width;
LOCK;
if (CHECK_RIG_ARG(rig))
{
RETURNFUNC2(-RIG_EINVAL);
@ -2526,7 +2529,7 @@ int HAMLIB_API rig_get_mode(RIG *rig,
{
*mode = rig->state.cache.modeMainA;
*width = rig->state.cache.widthMainA;
return RIG_OK;
RETURNFUNC(RIG_OK);
}
if ((*mode != RIG_MODE_NONE && cache_ms_mode < rig->state.cache.timeout_ms)