fix cppcheck analyzer warnings - bug 439

remotes/origin/master
Anoop Saldanha 14 years ago committed by Victor Julien
parent 081b0e05a2
commit c22755fec5

@ -11209,8 +11209,8 @@ int DetectFastPatternTest387(void)
result = 0;
sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_HSMDMATCH];
DetectContentData *ud = sm->ctx;
if (sm != NULL) {
DetectContentData *ud = sm->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP) &&
@ -11245,8 +11245,8 @@ int DetectFastPatternTest388(void)
result = 0;
sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_HSMDMATCH];
DetectContentData *ud = sm->ctx;
if (sm != NULL) {
DetectContentData *ud = sm->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
@ -12392,8 +12392,8 @@ int DetectFastPatternTest428(void)
result = 0;
sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_HSCDMATCH];
DetectContentData *ud = sm->ctx;
if (sm != NULL) {
DetectContentData *ud = sm->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP) &&
@ -12428,8 +12428,8 @@ int DetectFastPatternTest429(void)
result = 0;
sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_HSCDMATCH];
DetectContentData *ud = sm->ctx;
if (sm != NULL) {
DetectContentData *ud = sm->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
@ -13576,8 +13576,8 @@ int DetectFastPatternTest469(void)
result = 0;
sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_HSCDMATCH];
DetectContentData *ud = sm->ctx;
if (sm != NULL) {
DetectContentData *ud = sm->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP) &&
@ -13612,8 +13612,8 @@ int DetectFastPatternTest470(void)
result = 0;
sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_HSCDMATCH];
DetectContentData *ud = sm->ctx;
if (sm != NULL) {
DetectContentData *ud = sm->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&

@ -192,7 +192,7 @@ extern int sc_log_module_cleaned;
#define SCLog(x, ...) do { \
char _sc_log_msg[SC_LOG_MAX_LOG_MSG_LEN]; \
char _sc_log_msg[SC_LOG_MAX_LOG_MSG_LEN] = ""; \
char *_sc_log_temp = _sc_log_msg; \
if ( !( \
(sc_log_global_log_level >= x) && \
@ -211,7 +211,7 @@ extern int sc_log_module_cleaned;
} while(0)
#define SCLogErr(x, err, ...) do { \
char _sc_log_err_msg[SC_LOG_MAX_LOG_MSG_LEN]; \
char _sc_log_err_msg[SC_LOG_MAX_LOG_MSG_LEN] = ""; \
char *_sc_log_err_temp = _sc_log_err_msg; \
if ( !( \
(sc_log_global_log_level >= x) && \
@ -360,7 +360,7 @@ extern int sc_log_module_cleaned;
__FUNCTION__) == SC_OK) { \
snprintf(_sc_enter_temp, (SC_LOG_MAX_LOG_MSG_LEN - \
(_sc_enter_msg - _sc_enter_temp)), \
"%s", "Entering ... >>"); \
"Entering ... >>"); \
SCLogOutputBuffer(SC_LOG_DEBUG, \
_sc_enter_msg); \
} \
@ -467,9 +467,12 @@ extern int sc_log_module_cleaned;
*/
#define SCReturnCharPtr(x) do { \
if (sc_log_global_log_level >= SC_LOG_DEBUG) { \
SCLogDebug("Returning: %s ... <<", x); \
SCLogCheckFDFilterExit(__FUNCTION__); \
} \
if ((x) != NULL) { \
SCLogDebug("Returning: %s ... <<", x); \
} else { \
SCLogDebug("Returning: NULL ... <<"); \
} SCLogCheckFDFilterExit(__FUNCTION__); \
} \
return x; \
} while(0)

@ -65,10 +65,10 @@ SC_ATOMIC_EXTERN(unsigned int, engine_stage);
} \
\
global_mem += (a); \
if (print_mem_flag == 1) \
if (print_mem_flag == 1) { \
SCLogInfo("SCMalloc return at %p of size %"PRIuMAX, \
ptrmem, (uintmax_t)(a)); \
\
} \
(void*)ptrmem; \
})
@ -88,10 +88,10 @@ SC_ATOMIC_EXTERN(unsigned int, engine_stage);
} \
\
global_mem += (a); \
if (print_mem_flag == 1) \
if (print_mem_flag == 1) { \
SCLogInfo("SCRealloc return at %p (old:%p) of size %"PRIuMAX, \
ptrmem, (x), (uintmax_t)(a)); \
\
} \
(void*)ptrmem; \
})
@ -111,10 +111,10 @@ SC_ATOMIC_EXTERN(unsigned int, engine_stage);
} \
\
global_mem += (a)*(nm); \
if (print_mem_flag == 1) \
if (print_mem_flag == 1) { \
SCLogInfo("SCCalloc return at %p of size %"PRIuMAX" (nm) %"PRIuMAX, \
ptrmem, (uintmax_t)(a), (uintmax_t)(nm)); \
\
} \
(void*)ptrmem; \
})
@ -135,17 +135,18 @@ SC_ATOMIC_EXTERN(unsigned int, engine_stage);
} \
\
global_mem += len; \
if (print_mem_flag == 1) \
if (print_mem_flag == 1) { \
SCLogInfo("SCStrdup return at %p of size %"PRIuMAX, \
ptrmem, (uintmax_t)len); \
\
} \
(void*)ptrmem; \
})
#define SCFree(a) ({ \
extern uint8_t print_mem_flag; \
if (print_mem_flag == 1) \
if (print_mem_flag == 1) { \
SCLogInfo("SCFree at %p", (a)); \
} \
free((a)); \
})

@ -1689,8 +1689,11 @@ TmEcode B2gCudaMpmDispThreadInit(ThreadVars *tv, void *initdata, void **data)
MpmCudaConf *profile = NULL;
SCCudaHlModuleData *module_data = (SCCudaHlModuleData *)initdata;
if (PatternMatchDefaultMatcher() != MPM_B2G_CUDA)
return TM_ECODE_OK;
if (PatternMatchDefaultMatcher() != MPM_B2G_CUDA) {
SCLogError(SC_ERR_B2G_CUDA_ERROR, "b2g cuda mpm sees mpm that is "
"not b2g_cuda");
exit(EXIT_FAILURE);
}
if (SCCudaCtxPushCurrent(module_data->cuda_context) == -1) {
SCLogError(SC_ERR_B2G_CUDA_ERROR, "Error pushing cuda context");

Loading…
Cancel
Save