src: remove unused variables

Example of warning by new clang:

runmodes.c:537:12: warning: variable 'file_logger_count' set but not used [-Wunused-but-set-global]
  537 | static int file_logger_count = 0;
pull/16338/head
Philippe Antoine 1 month ago committed by Victor Julien
parent 8b379a3b04
commit e63bbf57d8

@ -60,7 +60,6 @@ static void DetectFiledataRegisterTests(void);
#endif
static void DetectFiledataSetupCallback(
const DetectEngineCtx *de_ctx, Signature *s, const DetectBufferType *map);
static int g_file_data_buffer_id = 0;
/* file API */
int PrefilterMpmFiledataRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx,
@ -172,8 +171,6 @@ void DetectFiledataRegister(void)
DetectBufferTypeSetDescriptionByName("file_data", "data from tracked files");
DetectBufferTypeSupportsMultiInstance("file_data");
g_file_data_buffer_id = DetectBufferTypeGetByName("file_data");
}
static void SetupDetectEngineConfig(DetectEngineCtx *de_ctx) {

@ -65,7 +65,6 @@ static int DetectFilenameSetupSticky(DetectEngineCtx *de_ctx, Signature *s, cons
#ifdef UNITTESTS
static void DetectFilenameRegisterTests(void);
#endif
static int g_file_match_list_id = 0;
static int g_file_name_buffer_id = 0;
static int PrefilterMpmFilenameRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx,
@ -105,7 +104,6 @@ void DetectFilenameRegister(void)
DetectBufferTypeSetDescriptionByName("file.name", "file name");
g_file_match_list_id = DetectBufferTypeRegister("files");
g_file_name_buffer_id = DetectBufferTypeRegister("file.name");
SCLogDebug("registering filename rule option");

@ -59,8 +59,6 @@
static int DetectUricontentSetup(DetectEngineCtx *, Signature *, const char *);
static void DetectUricontentFree(DetectEngineCtx *de_ctx, void *);
static int g_http_uri_buffer_id = 0;
/**
* \brief Registration function for uricontent: keyword
*/
@ -74,8 +72,6 @@ void DetectUricontentRegister (void)
sigmatch_table[DETECT_URICONTENT].Free = DetectUricontentFree;
sigmatch_table[DETECT_URICONTENT].flags = (SIGMATCH_QUOTES_MANDATORY|SIGMATCH_HANDLE_NEGATION);
sigmatch_table[DETECT_URICONTENT].alternative = DETECT_HTTP_URI;
g_http_uri_buffer_id = DetectBufferTypeRegister("http_uri");
}
/**

@ -534,7 +534,6 @@ static void RunOutputFreeList(void)
}
}
static int file_logger_count = 0;
static int filedata_logger_count = 0;
int RunModeOutputFiledataEnabled(void)
@ -588,7 +587,6 @@ void RunModeShutDown(void)
OutputClearActiveLoggers();
/* Reset logger counts. */
file_logger_count = 0;
filedata_logger_count = 0;
}
@ -656,7 +654,6 @@ static void SetupOutput(
SCLogDebug("%s is a file logger", module->name);
SCOutputRegisterFileLogger(module->logger_id, module->name, module->FileLogFunc, output_ctx,
module->ThreadInit, module->ThreadDeinit);
file_logger_count++;
} else if (module->StreamingLogFunc) {
SCLogDebug("%s is a streaming logger", module->name);
SCOutputRegisterStreamingLogger(module->logger_id, module->name, module->StreamingLogFunc,

@ -27,9 +27,6 @@
#include "source-lib.h"
#include "util-device-private.h"
/* Set time to the first packet timestamp when replaying a PCAP. */
static bool time_set = false;
/** \brief initialize the "Decode" module.
*
* \param tv Pointer to the per-thread structure.
@ -65,7 +62,6 @@ static TmEcode DecodeLibThreadDeinit(ThreadVars *tv, void *data)
if (data != NULL)
DecodeThreadVarsFree(tv, data);
time_set = false;
SCReturnInt(TM_ECODE_OK);
}

Loading…
Cancel
Save