Replace all ASSERT calls to DEBUGASSERT
This commit is contained in:
parent
220653f21c
commit
5304ec5eec
@ -121,7 +121,7 @@ int cpuhog_main(int argc, char *argv[])
|
||||
|
||||
while (sem_wait(&g_state.sem) != 0)
|
||||
{
|
||||
ASSERT(errno == EINTR || errno == ECANCELED);
|
||||
DEBUGASSERT(errno == EINTR || errno == ECANCELED);
|
||||
}
|
||||
|
||||
/* Burn some inside semlock */
|
||||
|
@ -108,7 +108,7 @@ int i2sloop_main(int argc, char *argv[])
|
||||
/* Open the I2S character device */
|
||||
|
||||
fd = open("/dev/i2schar0", O_RDWR);
|
||||
ASSERT(0 < fd);
|
||||
DEBUGASSERT(0 < fd);
|
||||
|
||||
/* Setup sample freq for i2s */
|
||||
|
||||
@ -127,7 +127,7 @@ int i2sloop_main(int argc, char *argv[])
|
||||
desc.u.ppBuffer = &apb;
|
||||
|
||||
ret = apb_alloc(&desc);
|
||||
ASSERT(ret == sizeof(desc));
|
||||
DEBUGASSERT(ret == sizeof(desc));
|
||||
|
||||
signal(1, _signal_handler);
|
||||
g_i2sloop_running = true;
|
||||
|
@ -3703,7 +3703,7 @@ void nximage_blitrow(FAR nxgl_mxpixel_t *run, FAR const void **state)
|
||||
*run++ = color;
|
||||
}
|
||||
}
|
||||
ASSERT(width == SCALED_WIDTH);
|
||||
DEBUGASSERT(width == SCALED_WIDTH);
|
||||
|
||||
/* Save the start of the next row and return success */
|
||||
|
||||
|
@ -405,7 +405,7 @@ int nxterm_main(int argc, char **argv)
|
||||
g_nxterm_vars.pid = task_create("NxTerm", CONFIG_EXAMPLES_NXTERM_PRIO,
|
||||
CONFIG_EXAMPLES_NXTERM_STACKSIZE,
|
||||
nxterm_task, NULL);
|
||||
ASSERT(g_nxterm_vars.pid > 0);
|
||||
DEBUGASSERT(g_nxterm_vars.pid > 0);
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
/* Error Exits ************************************************************/
|
||||
|
@ -145,7 +145,7 @@ int tiff_convstrip(FAR struct tiff_info_s *info, FAR const uint8_t *strip)
|
||||
|
||||
ret = tiff_write(info->tmp2fd, info->iobuffer, nbytes);
|
||||
#ifdef CONFIG_DEBUG_GRAPHICS
|
||||
ASSERT(ntotal == info->bps);
|
||||
DEBUGASSERT(ntotal == info->bps);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
@ -349,7 +349,7 @@ int tiff_finalize(FAR struct tiff_info_s *info)
|
||||
#endif
|
||||
}
|
||||
#ifdef CONFIG_DEBUG_GRAPHICS
|
||||
ASSERT(total == info->tmp1size);
|
||||
DEBUGASSERT(total == info->tmp1size);
|
||||
#endif
|
||||
|
||||
/* Rewind to the beginning of tmpfile2 */
|
||||
@ -399,7 +399,7 @@ int tiff_finalize(FAR struct tiff_info_s *info)
|
||||
#endif
|
||||
}
|
||||
#ifdef CONFIG_DEBUG_GRAPHICS
|
||||
ASSERT(total == info->tmp2size);
|
||||
DEBUGASSERT(total == info->tmp2size);
|
||||
#endif
|
||||
|
||||
/* Close all files and return success */
|
||||
|
@ -214,7 +214,7 @@
|
||||
|
||||
#ifdef CONFIG_DEBUG_TIFFOFFSETS
|
||||
# define tiff_offset(o,l) (o) += (l)
|
||||
# define tiff_checkoffs(o,x) ASSERT((o) == (x))
|
||||
# define tiff_checkoffs(o,x) DEBUGASSERT((o) == (x))
|
||||
#else
|
||||
# define tiff_offset(o,l)
|
||||
# define tiff_checkoffs(o,x)
|
||||
|
@ -339,7 +339,7 @@ int tiff_putstring(int fd, FAR const char *string, int len)
|
||||
#ifdef CONFIG_DEBUG_GRAPHICS
|
||||
int actual = strlen(string);
|
||||
|
||||
ASSERT(len = actual+1);
|
||||
DEBUGASSERT(len = actual+1);
|
||||
#endif
|
||||
return tiff_write(fd, string, len);
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ static uint8_t prvucMBBIN2int8_t(uint8_t ucByte)
|
||||
{
|
||||
/* Programming error. */
|
||||
|
||||
ASSERT(0);
|
||||
DEBUGASSERT(0);
|
||||
}
|
||||
|
||||
return '0';
|
||||
@ -225,7 +225,7 @@ eMBErrorCode eMBASCIIReceive(uint8_t *pucRcvAddress, uint8_t **pucFrame,
|
||||
eMBErrorCode eStatus = MB_ENOERR;
|
||||
|
||||
ENTER_CRITICAL_SECTION();
|
||||
ASSERT(usRcvBufferPos < MB_SER_PDU_SIZE_MAX);
|
||||
DEBUGASSERT(usRcvBufferPos < MB_SER_PDU_SIZE_MAX);
|
||||
|
||||
/* Length and CRC check */
|
||||
|
||||
@ -307,7 +307,7 @@ bool xMBASCIIReceiveFSM(void)
|
||||
uint8_t ucByte;
|
||||
uint8_t ucResult;
|
||||
|
||||
ASSERT(eSndState == STATE_TX_IDLE);
|
||||
DEBUGASSERT(eSndState == STATE_TX_IDLE);
|
||||
|
||||
(void)xMBPortSerialGetByte((int8_t *) & ucByte);
|
||||
switch (eRcvState)
|
||||
@ -435,7 +435,7 @@ bool xMBASCIITransmitFSM(void)
|
||||
bool xNeedPoll = false;
|
||||
uint8_t ucByte;
|
||||
|
||||
ASSERT(eRcvState == STATE_RX_IDLE);
|
||||
DEBUGASSERT(eRcvState == STATE_RX_IDLE);
|
||||
switch (eSndState)
|
||||
{
|
||||
/* Start of transmission. The start of a frame is defined by sending
|
||||
@ -537,7 +537,7 @@ bool xMBASCIITimerT1SExpired(void)
|
||||
break;
|
||||
|
||||
default:
|
||||
ASSERT((eRcvState == STATE_RX_RCV) || (eRcvState == STATE_RX_WAIT_EOF));
|
||||
DEBUGASSERT((eRcvState == STATE_RX_RCV) || (eRcvState == STATE_RX_WAIT_EOF));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -62,8 +62,8 @@ void xMBUtilSetBits(uint8_t *ucByteBuf, uint16_t usBitOffset,
|
||||
uint16_t usNPreBits;
|
||||
uint16_t usValue = ucValue;
|
||||
|
||||
ASSERT(ucNBits <= 8);
|
||||
ASSERT((size_t)BITS_uint8_t == sizeof(uint8_t) * 8);
|
||||
DEBUGASSERT(ucNBits <= 8);
|
||||
DEBUGASSERT((size_t)BITS_uint8_t == sizeof(uint8_t) * 8);
|
||||
|
||||
/* Calculate byte offset for first byte containing the bit values starting
|
||||
* at usBitOffset.
|
||||
|
@ -178,7 +178,7 @@ void vMBPortSerialEnable(bool bEnableRx, bool bEnableTx)
|
||||
{
|
||||
/* it is not allowed that both receiver and transmitter are enabled. */
|
||||
|
||||
ASSERT(!bEnableRx || !bEnableTx);
|
||||
DEBUGASSERT(!bEnableRx || !bEnableTx);
|
||||
|
||||
if (bEnableRx)
|
||||
{
|
||||
@ -387,7 +387,7 @@ bool xMBPortSerialPoll(void)
|
||||
|
||||
bool xMBPortSerialPutByte(int8_t ucByte)
|
||||
{
|
||||
ASSERT(uiTxBufferPos < BUF_SIZE);
|
||||
DEBUGASSERT(uiTxBufferPos < BUF_SIZE);
|
||||
ucBuffer[uiTxBufferPos] = ucByte;
|
||||
uiTxBufferPos++;
|
||||
return true;
|
||||
@ -395,7 +395,7 @@ bool xMBPortSerialPutByte(int8_t ucByte)
|
||||
|
||||
bool xMBPortSerialGetByte(int8_t *pucByte)
|
||||
{
|
||||
ASSERT(uiRxBufferPos < BUF_SIZE);
|
||||
DEBUGASSERT(uiRxBufferPos < BUF_SIZE);
|
||||
*pucByte = ucBuffer[uiRxBufferPos];
|
||||
uiRxBufferPos++;
|
||||
return true;
|
||||
|
@ -182,7 +182,7 @@ void vMBMasterPortSerialEnable(bool bEnableRx, bool bEnableTx)
|
||||
{
|
||||
/* it is not allowed that both receiver and transmitter are enabled. */
|
||||
|
||||
ASSERT(!bEnableRx || !bEnableTx);
|
||||
DEBUGASSERT(!bEnableRx || !bEnableTx);
|
||||
|
||||
if (bEnableRx)
|
||||
{
|
||||
@ -398,7 +398,7 @@ bool xMBMasterPortSerialPoll( void )
|
||||
|
||||
bool xMBMasterPortSerialPutByte(int8_t ucByte)
|
||||
{
|
||||
ASSERT(uiTxBufferPos < BUF_SIZE);
|
||||
DEBUGASSERT(uiTxBufferPos < BUF_SIZE);
|
||||
ucBuffer[uiTxBufferPos] = ucByte;
|
||||
uiTxBufferPos++;
|
||||
return true;
|
||||
@ -406,7 +406,7 @@ bool xMBMasterPortSerialPutByte(int8_t ucByte)
|
||||
|
||||
bool xMBMasterPortSerialGetByte(int8_t *pucByte)
|
||||
{
|
||||
ASSERT(uiRxBufferPos < BUF_SIZE);
|
||||
DEBUGASSERT(uiRxBufferPos < BUF_SIZE);
|
||||
*pucByte = ucBuffer[uiRxBufferPos];
|
||||
uiRxBufferPos++;
|
||||
return true;
|
||||
|
@ -105,7 +105,7 @@ void vMBPortTimersEnable()
|
||||
{
|
||||
int res = gettimeofday(&xTimeLast, NULL);
|
||||
|
||||
ASSERT(res == 0);
|
||||
DEBUGASSERT(res == 0);
|
||||
bTimeoutEnable = true;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ void vMBMasterPortTimersEnable( void )
|
||||
{
|
||||
int res = gettimeofday(&xTimeLast, NULL);
|
||||
|
||||
ASSERT(res == 0);
|
||||
DEBUGASSERT(res == 0);
|
||||
bTimeoutEnable = true;
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ eMBErrorCode eMBRTUReceive(uint8_t *pucRcvAddress, uint8_t **pucFrame,
|
||||
eMBErrorCode eStatus = MB_ENOERR;
|
||||
|
||||
ENTER_CRITICAL_SECTION();
|
||||
ASSERT(usRcvBufferPos < MB_SER_PDU_SIZE_MAX);
|
||||
DEBUGASSERT(usRcvBufferPos < MB_SER_PDU_SIZE_MAX);
|
||||
|
||||
/* Length and CRC check */
|
||||
|
||||
@ -254,7 +254,7 @@ bool xMBRTUReceiveFSM(void)
|
||||
bool xTaskNeedSwitch = false;
|
||||
uint8_t ucByte;
|
||||
|
||||
ASSERT(eSndState == STATE_TX_IDLE);
|
||||
DEBUGASSERT(eSndState == STATE_TX_IDLE);
|
||||
|
||||
/* Always read the character. */
|
||||
|
||||
@ -320,7 +320,7 @@ bool xMBRTUTransmitFSM(void)
|
||||
{
|
||||
bool xNeedPoll = false;
|
||||
|
||||
ASSERT(eRcvState == STATE_RX_IDLE);
|
||||
DEBUGASSERT(eRcvState == STATE_RX_IDLE);
|
||||
|
||||
switch (eSndState)
|
||||
{
|
||||
@ -388,7 +388,7 @@ bool xMBRTUTimerT35Expired(void)
|
||||
/* Function called in an illegal state. */
|
||||
|
||||
default:
|
||||
ASSERT((eRcvState == STATE_RX_INIT) ||
|
||||
DEBUGASSERT((eRcvState == STATE_RX_INIT) ||
|
||||
(eRcvState == STATE_RX_RCV) ||
|
||||
(eRcvState == STATE_RX_ERROR));
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ eMBErrorCode eMBMasterRTUReceive(uint8_t *pucRcvAddress, uint8_t **pucFrame,
|
||||
eMBErrorCode eStatus = MB_ENOERR;
|
||||
|
||||
ENTER_CRITICAL_SECTION();
|
||||
ASSERT(usMasterRcvBufferPos < MB_SER_PDU_SIZE_MAX);
|
||||
DEBUGASSERT(usMasterRcvBufferPos < MB_SER_PDU_SIZE_MAX);
|
||||
|
||||
/* Length and CRC check */
|
||||
|
||||
@ -273,7 +273,7 @@ bool xMBMasterRTUReceiveFSM(void)
|
||||
bool xTaskNeedSwitch = false;
|
||||
uint8_t ucByte;
|
||||
|
||||
ASSERT((eSndState == STATE_M_TX_IDLE) ||
|
||||
DEBUGASSERT((eSndState == STATE_M_TX_IDLE) ||
|
||||
(eSndState == STATE_M_TX_XFWR));
|
||||
|
||||
/* Always read the character. */
|
||||
@ -347,7 +347,7 @@ bool xMBMasterRTUTransmitFSM(void)
|
||||
{
|
||||
bool xNeedPoll = false;
|
||||
|
||||
ASSERT(eRcvState == STATE_M_RX_IDLE);
|
||||
DEBUGASSERT(eRcvState == STATE_M_RX_IDLE);
|
||||
|
||||
switch (eSndState)
|
||||
{
|
||||
@ -432,7 +432,7 @@ bool xMBMasterRTUTimerExpired(void)
|
||||
/* Function called in an illegal state. */
|
||||
|
||||
default:
|
||||
ASSERT((eRcvState == STATE_M_RX_INIT) ||
|
||||
DEBUGASSERT((eRcvState == STATE_M_RX_INIT) ||
|
||||
(eRcvState == STATE_M_RX_RCV) ||
|
||||
(eRcvState == STATE_M_RX_ERROR) ||
|
||||
(eRcvState == STATE_M_RX_IDLE));
|
||||
@ -459,7 +459,7 @@ bool xMBMasterRTUTimerExpired(void)
|
||||
/* Function called in an illegal state. */
|
||||
|
||||
default:
|
||||
ASSERT((eSndState == STATE_M_TX_XFWR) ||
|
||||
DEBUGASSERT((eSndState == STATE_M_TX_XFWR) ||
|
||||
(eSndState == STATE_M_TX_IDLE));
|
||||
break;
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ static inline void cgi_semtake(void)
|
||||
* awakened by a signal.
|
||||
*/
|
||||
|
||||
ASSERT(errno == EINTR || errno == ECANCELED);
|
||||
DEBUGASSERT(errno == EINTR || errno == ECANCELED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,7 +200,7 @@ static int _open_with_http(const char *fullurl)
|
||||
}
|
||||
|
||||
s = socket(AF_INET, SOCK_STREAM, 0);
|
||||
ASSERT(s != -1);
|
||||
DEBUGASSERT(s != -1);
|
||||
|
||||
tv.tv_sec = 10; /* TODO */
|
||||
tv.tv_usec = 0;
|
||||
|
@ -72,7 +72,7 @@ static void show_usage(FAR const char *progname, int exitcode)
|
||||
|
||||
static bool get_cpuset(const char *arg, cpu_set_t *cpu_set)
|
||||
{
|
||||
ASSERT(NULL != arg);
|
||||
DEBUGASSERT(NULL != arg);
|
||||
|
||||
bool ret = false;
|
||||
int val = atoi(arg);
|
||||
|
Loading…
Reference in New Issue
Block a user