mirror of
https://github.com/open-simh/simh.git
synced 2026-04-27 12:39:13 +00:00
SCP: Fixed Coverity issue for sim_debug arguments
This commit is contained in:
4
scp.c
4
scp.c
@@ -11253,11 +11253,7 @@ return stat | SCPE_NOMESSAGE;
|
|||||||
Callers should be calling sim_debug() which is a macro
|
Callers should be calling sim_debug() which is a macro
|
||||||
defined in scp.h which evaluates the action condition before
|
defined in scp.h which evaluates the action condition before
|
||||||
incurring call overhead. */
|
incurring call overhead. */
|
||||||
#if defined(__cplusplus)
|
|
||||||
void _sim_debug (uint32 dbits, void* vdptr, const char* fmt, ...)
|
|
||||||
#else
|
|
||||||
void _sim_debug (uint32 dbits, DEVICE* vdptr, const char* fmt, ...)
|
void _sim_debug (uint32 dbits, DEVICE* vdptr, const char* fmt, ...)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
DEVICE *dptr = (DEVICE *)vdptr;
|
DEVICE *dptr = (DEVICE *)vdptr;
|
||||||
if (sim_deb && dptr && (dptr->dctrl & dbits)) {
|
if (sim_deb && dptr && (dptr->dctrl & dbits)) {
|
||||||
|
|||||||
10
scp.h
10
scp.h
@@ -250,15 +250,6 @@ void sim_debug_bits (uint32 dbits, DEVICE* dptr, BITFIELD* bitdefs,
|
|||||||
#if defined (__DECC) && defined (__VMS) && (defined (__VAX) || (__DECC_VER < 60590001))
|
#if defined (__DECC) && defined (__VMS) && (defined (__VAX) || (__DECC_VER < 60590001))
|
||||||
#define CANT_USE_MACRO_VA_ARGS 1
|
#define CANT_USE_MACRO_VA_ARGS 1
|
||||||
#endif
|
#endif
|
||||||
#if defined(__cplusplus)
|
|
||||||
#ifdef CANT_USE_MACRO_VA_ARGS
|
|
||||||
#define _sim_debug sim_debug
|
|
||||||
void sim_debug (uint32 dbits, void* dptr, const char *fmt, ...) GCC_FMT_ATTR(3, 4);
|
|
||||||
#else
|
|
||||||
void _sim_debug (uint32 dbits, void* dptr, const char *fmt, ...) GCC_FMT_ATTR(3, 4);
|
|
||||||
#define sim_debug(dbits, dptr, ...) do { if (sim_deb && dptr && ((dptr)->dctrl & (dbits))) _sim_debug (dbits, dptr, __VA_ARGS__);} while (0)
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#ifdef CANT_USE_MACRO_VA_ARGS
|
#ifdef CANT_USE_MACRO_VA_ARGS
|
||||||
#define _sim_debug sim_debug
|
#define _sim_debug sim_debug
|
||||||
void sim_debug (uint32 dbits, DEVICE* dptr, const char *fmt, ...) GCC_FMT_ATTR(3, 4);
|
void sim_debug (uint32 dbits, DEVICE* dptr, const char *fmt, ...) GCC_FMT_ATTR(3, 4);
|
||||||
@@ -266,7 +257,6 @@ void sim_debug (uint32 dbits, DEVICE* dptr, const char *fmt, ...) GCC_FMT_ATTR(3
|
|||||||
void _sim_debug (uint32 dbits, DEVICE* dptr, const char *fmt, ...) GCC_FMT_ATTR(3, 4);
|
void _sim_debug (uint32 dbits, DEVICE* dptr, const char *fmt, ...) GCC_FMT_ATTR(3, 4);
|
||||||
#define sim_debug(dbits, dptr, ...) do { if (sim_deb && dptr && ((dptr)->dctrl & dbits)) _sim_debug (dbits, dptr, __VA_ARGS__);} while (0)
|
#define sim_debug(dbits, dptr, ...) do { if (sim_deb && dptr && ((dptr)->dctrl & dbits)) _sim_debug (dbits, dptr, __VA_ARGS__);} while (0)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
void fprint_stopped_gen (FILE *st, t_stat v, REG *pc, DEVICE *dptr);
|
void fprint_stopped_gen (FILE *st, t_stat v, REG *pc, DEVICE *dptr);
|
||||||
#define SCP_HELP_FLAT (1u << 31) /* Force flat help when prompting is not possible */
|
#define SCP_HELP_FLAT (1u << 31) /* Force flat help when prompting is not possible */
|
||||||
#define SCP_HELP_ONECMD (1u << 30) /* Display one topic, do not prompt */
|
#define SCP_HELP_ONECMD (1u << 30) /* Display one topic, do not prompt */
|
||||||
|
|||||||
Reference in New Issue
Block a user