src: fix strict-prototype warnings

Tested on Fedora 37 with clang 15.

app-layer.c:1055:27: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void AppLayerSetupCounters()
                          ^
                           void
app-layer.c:1176:29: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void AppLayerDeSetupCounters()
                            ^
                             void
2 errors generated.
pull/8387/head
Victor Julien 3 years ago
parent 55c4834e4e
commit ebd8728219

@ -40,7 +40,7 @@ SC_ATOMIC_DECLARE(uint64_t, htp_config_memcap);
SC_ATOMIC_DECLARE(uint64_t, htp_memuse);
SC_ATOMIC_DECLARE(uint64_t, htp_memcap);
void HTPParseMemcap()
void HTPParseMemcap(void)
{
const char *conf_val;

@ -1052,7 +1052,7 @@ void AppLayerRegisterGlobalCounters(void)
}
#define IPPROTOS_MAX 2
void AppLayerSetupCounters()
void AppLayerSetupCounters(void)
{
const uint8_t ipprotos[] = { IPPROTO_TCP, IPPROTO_UDP };
AppProto alprotos[ALPROTO_MAX];
@ -1173,7 +1173,7 @@ void AppLayerRegisterThreadCounters(ThreadVars *tv)
}
}
void AppLayerDeSetupCounters()
void AppLayerDeSetupCounters(void)
{
memset(applayer_counter_names, 0, sizeof(applayer_counter_names));
memset(applayer_counters, 0, sizeof(applayer_counters));

@ -1265,7 +1265,7 @@ uint64_t StatsGetLocalCounterValue(ThreadVars *tv, uint16_t id)
/**
* \brief Releases the resources alloted by the Stats API
*/
void StatsReleaseResources()
void StatsReleaseResources(void)
{
StatsLogSummary();
StatsReleaseCtx();

@ -38,7 +38,7 @@ DefragTrackerQueue *DefragTrackerQueueInit (DefragTrackerQueue *q)
return q;
}
DefragTrackerQueue *DefragTrackerQueueNew()
DefragTrackerQueue *DefragTrackerQueueNew(void)
{
DefragTrackerQueue *q = (DefragTrackerQueue *)SCMalloc(sizeof(DefragTrackerQueue));
if (q == NULL) {

@ -431,7 +431,7 @@ void CleanupRuleAnalyzer(void)
* \retval 1 if successful
* \retval 0 if on error
*/
int PerCentEncodingSetup ()
int PerCentEncodingSetup(void)
{
#define DETECT_PERCENT_ENCODING_REGEX "%[0-9|a-f|A-F]{2}"
int en;

@ -504,7 +504,7 @@ void DetectLoadersInit(void)
/**
* \brief Unpauses all threads present in tv_root
*/
void TmThreadWakeupDetectLoaderThreads()
void TmThreadWakeupDetectLoaderThreads(void)
{
ThreadVars *tv = NULL;
int i = 0;
@ -528,7 +528,7 @@ void TmThreadWakeupDetectLoaderThreads()
/**
* \brief Unpauses all threads present in tv_root
*/
void TmThreadContinueDetectLoaderThreads()
void TmThreadContinueDetectLoaderThreads(void)
{
ThreadVars *tv = NULL;
int i = 0;

@ -78,7 +78,7 @@ void TagDestroyCtx(void)
/** \brief Reset the tagging engine context
*/
void TagRestartCtx()
void TagRestartCtx(void)
{
TagDestroyCtx();
TagInitCtx();

@ -4861,7 +4861,7 @@ static int DetectEngineTest09(void)
#endif
void DetectEngineRegisterTests()
void DetectEngineRegisterTests(void)
{
#ifdef UNITTESTS
UtRegisterTest("DetectEngineTest01", DetectEngineTest01);

@ -181,7 +181,7 @@ int BypassedFlowManagerRegisterUpdateFunc(BypassedUpdateFunc UpdateFunc,
#endif
/** \brief spawn the flow bypass manager thread */
void BypassedFlowManagerThreadSpawn()
void BypassedFlowManagerThreadSpawn(void)
{
#ifdef CAPTURE_OFFLOAD_MANAGER

@ -951,7 +951,7 @@ static TmEcode FlowManager(ThreadVars *th_v, void *thread_data)
}
/** \brief spawn the flow manager thread */
void FlowManagerThreadSpawn()
void FlowManagerThreadSpawn(void)
{
intmax_t setting = 1;
(void)ConfGetInt("flow.managers", &setting);
@ -1146,7 +1146,7 @@ static bool FlowRecyclerReadyToShutdown(void)
}
/** \brief spawn the flow recycler thread */
void FlowRecyclerThreadSpawn()
void FlowRecyclerThreadSpawn(void)
{
intmax_t setting = 1;
(void)ConfGetInt("flow.recyclers", &setting);

@ -32,7 +32,7 @@
#include "util-debug.h"
#include "util-print.h"
FlowQueue *FlowQueueNew()
FlowQueue *FlowQueueNew(void)
{
FlowQueue *q = (FlowQueue *)SCMalloc(sizeof(FlowQueue));
if (q == NULL) {

@ -39,7 +39,7 @@ HostQueue *HostQueueInit (HostQueue *q)
return q;
}
HostQueue *HostQueueNew()
HostQueue *HostQueueNew(void)
{
HostQueue *q = (HostQueue *)SCMalloc(sizeof(HostQueue));
if (q == NULL) {

@ -39,7 +39,7 @@ IPPairQueue *IPPairQueueInit (IPPairQueue *q)
return q;
}
IPPairQueue *IPPairQueueNew()
IPPairQueue *IPPairQueueNew(void)
{
IPPairQueue *q = (IPPairQueue *)SCMalloc(sizeof(IPPairQueue));
if (q == NULL) {

@ -36,7 +36,7 @@
* \retval LogCustomFormatNode * ptr if created
* \retval NULL if failed to allocate
*/
LogCustomFormatNode * LogCustomFormatNodeAlloc()
LogCustomFormatNode *LogCustomFormatNodeAlloc(void)
{
LogCustomFormatNode * node = SCCalloc(1, sizeof(LogCustomFormatNode));
if (unlikely(node == NULL)) {
@ -51,7 +51,7 @@ LogCustomFormatNode * LogCustomFormatNodeAlloc()
* \retval LogCustomFormat * ptr if created
* \retval NULL if failed to allocate
*/
LogCustomFormat * LogCustomFormatAlloc()
LogCustomFormat *LogCustomFormatAlloc(void)
{
LogCustomFormat * cf = SCCalloc(1, sizeof(LogCustomFormat));
if (unlikely(cf == NULL)) {

@ -676,7 +676,7 @@ static int AFPConfigGeThreadsCount(void *conf)
return afp->threads;
}
int AFPRunModeIsIPS()
int AFPRunModeIsIPS(void)
{
int nlive = LiveGetDeviceCount();
int ldev;

@ -252,7 +252,7 @@ static void ArgumentsAddOptionAndArgument(struct Arguments *args, const char *op
SCReturn;
}
static void InitEal()
static void InitEal(void)
{
SCEnter();
int retval;

@ -320,7 +320,7 @@ static int NetmapConfigGeThreadsCount(void *conf)
return aconf->in.threads;
}
int NetmapRunModeIsIPS()
int NetmapRunModeIsIPS(void)
{
int nlive = LiveGetDeviceCount();
int ldev;

@ -446,7 +446,7 @@ AFPPeersList peerslist;
/**
* \brief Init the global list of ::AFPPeer
*/
TmEcode AFPPeersListInit()
TmEcode AFPPeersListInit(void)
{
SCEnter();
TAILQ_INIT(&peerslist.peers);
@ -463,7 +463,7 @@ TmEcode AFPPeersListInit()
*
* \retval TM_ECODE_FAILED if some threads are not peered or TM_ECODE_OK else.
*/
TmEcode AFPPeersListCheck()
TmEcode AFPPeersListCheck(void)
{
#define AFP_PEERS_MAX_TRY 4
#define AFP_PEERS_WAIT 20000
@ -574,7 +574,7 @@ static int AFPPeersListStarted(void)
/**
* \brief Clean the global peers list.
*/
void AFPPeersListClean()
void AFPPeersListClean(void)
{
AFPPeer *pitem;

@ -184,7 +184,7 @@ static void DPDKSetTimevalReal(struct timeval *machine_start_tv, struct timeval
}
/* get number of seconds from the reset of TSC counter (typically from the machine start) */
static uint64_t DPDKGetSeconds()
static uint64_t DPDKGetSeconds(void)
{
return CyclesToSeconds(rte_get_tsc_cycles());
}

@ -1268,7 +1268,7 @@ TmEcode DecodeNFQThreadDeinit(ThreadVars *tv, void *data)
/**
* \brief Clean global contexts. Must be called on exit.
*/
void NFQContextsClean()
void NFQContextsClean(void)
{
if (g_nfq_q != NULL) {
SCFree(g_nfq_q);

@ -135,7 +135,7 @@ void TmModuleDecodePcapFileRegister (void)
tmm_modules[TMM_DECODEPCAPFILE].flags = TM_FLAG_DECODE_TM;
}
void PcapFileGlobalInit()
void PcapFileGlobalInit(void)
{
memset(&pcap_g, 0x00, sizeof(pcap_g));
SC_ATOMIC_INIT(pcap_g.invalid_checksums);
@ -452,7 +452,7 @@ TmEcode DecodePcapFileThreadDeinit(ThreadVars *tv, void *data)
SCReturnInt(TM_ECODE_OK);
}
void PcapIncreaseInvalidChecksum()
void PcapIncreaseInvalidChecksum(void)
{
(void) SC_ATOMIC_ADD(pcap_g.invalid_checksums, 1);
}

@ -993,7 +993,7 @@ static int SourceWinDivertTestIfaceMatchFilter(void)
/**
* \brief this function registers unit tests for the WinDivert Source
*/
void SourceWinDivertRegisterTests()
void SourceWinDivertRegisterTests(void)
{
#ifdef UNITTESTS
UtRegisterTest("SourceWinDivertTestIfaceMatchFilter",

@ -195,7 +195,7 @@ int StreamTcpReassembleSetMemcap(uint64_t size)
*
* \return memcap memcap value
*/
uint64_t StreamTcpReassembleGetMemcap()
uint64_t StreamTcpReassembleGetMemcap(void)
{
uint64_t memcapcopy = SC_ATOMIC_GET(stream_config.reassembly_memcap);
return memcapcopy;

@ -1885,7 +1885,7 @@ again:
/**
* \brief Unpauses all threads present in tv_root
*/
void TmThreadContinueThreads()
void TmThreadContinueThreads(void)
{
SCMutexLock(&tv_root_lock);
for (int i = 0; i < TVT_MAX; i++) {
@ -2251,7 +2251,7 @@ void TmThreadsGetMinimalTimestamp(struct timeval *ts)
SCLogDebug("ts->tv_sec %"PRIuMAX, (uintmax_t)ts->tv_sec);
}
uint16_t TmThreadsGetWorkerThreadMax()
uint16_t TmThreadsGetWorkerThreadMax(void)
{
uint16_t ncpus = UtilCpuGetNumProcessorsOnline();
int thread_max = TmThreadGetNbThreads(WORKER_CPU_SET);

@ -95,7 +95,7 @@ static uint8_t ActionAsciiToFlag(const char *action)
*
* \retval 0 on success; -1 on fatal error;
*/
int ActionInitConfig()
int ActionInitConfig(void)
{
uint8_t actions_used = 0;
uint8_t action_flag = 0;

@ -162,7 +162,7 @@ static void BuildCpuset(const char *name, ConfNode *node, cpu_set_t *cpu)
* \brief Extract cpu affinity configuration from current config file
*/
void AffinitySetupLoadFromConfig()
void AffinitySetupLoadFromConfig(void)
{
#if !defined __CYGWIN__ && !defined OS_WIN32 && !defined __OpenBSD__ && !defined sun
ConfNode *root = ConfGetNode("threading.cpu-affinity");

@ -34,7 +34,7 @@ TmEcode ConfigSetLogDirectory(const char *name)
return ConfSetFinal("default-log-dir", name) ? TM_ECODE_OK : TM_ECODE_FAILED;
}
const char *ConfigGetLogDirectory()
const char *ConfigGetLogDirectory(void)
{
const char *log_dir = NULL;
@ -81,7 +81,7 @@ TmEcode ConfigSetDataDirectory(char *name)
return ConfSetFinal("default-data-dir", tmp) ? TM_ECODE_OK : TM_ECODE_FAILED;
}
const char *ConfigGetDataDirectory()
const char *ConfigGetDataDirectory(void)
{
const char *data_dir = NULL;

@ -408,7 +408,7 @@ void SCLogReleaseFGFilters(void)
*
* \retval count The no of FG filters
*/
int SCLogPrintFGFilters()
int SCLogPrintFGFilters(void)
{
SCLogFGFilterFile *fgf_file = NULL;
SCLogFGFilterFunc *fgf_func = NULL;

@ -1818,7 +1818,7 @@ static int SCLogTestInit05(void)
#endif /* UNITTESTS */
void SCLogRegisterTests()
void SCLogRegisterTests(void)
{
#ifdef UNITTESTS

@ -346,12 +346,12 @@ int LiveBuildDeviceListCustom(const char *runmode, const char *itemname)
*
* This can be useful in the case, this is not a real interface.
*/
void LiveDeviceHasNoStats()
void LiveDeviceHasNoStats(void)
{
live_devices_stats = 0;
}
int LiveDeviceListClean()
int LiveDeviceListClean(void)
{
SCEnter();
LiveDevice *pd, *tpd;

@ -940,7 +940,7 @@ uint32_t hashbig( const void *key, size_t length, uint32_t initval)
#ifdef SELF_TEST
/* used for timings */
void driver1()
void driver1(void)
{
uint8_t buf[256];
uint32_t i;
@ -962,7 +962,7 @@ void driver1()
#define HASHLEN 1
#define MAXPAIR 60
#define MAXLEN 70
void driver2()
void driver2(void)
{
uint8_t qa[MAXLEN+1], qb[MAXLEN+2], *a = &qa[0], *b = &qb[1];
uint32_t c[HASHSTATE], d[HASHSTATE], i=0, j=0, k, l, m=0, z;
@ -1032,7 +1032,7 @@ void driver2()
}
/* Check for reading beyond the end of the buffer and alignment problems */
void driver3()
void driver3(void)
{
uint8_t buf[MAXLEN+20], *b;
uint32_t len;
@ -1123,7 +1123,7 @@ void driver3()
}
/* check for problems with nulls */
void driver4()
void driver4(void)
{
uint8_t buf[1];
uint32_t h,i,state[HASHSTATE];
@ -1139,7 +1139,7 @@ void driver3()
}
}
void driver5()
void driver5(void)
{
uint32_t b,c;
b=0, c=0, hashlittle2("", 0, &c, &b);
@ -1160,8 +1160,7 @@ void driver5()
printf("hash is %.8lx\n", c); /* cd628161 */
}
int main()
int main(void)
{
driver1(); /* test that the key is hashed: used for timings */
driver2(); /* test that whole key is hashed thoroughly */

@ -47,7 +47,7 @@ static void SCLogFileCloseRedis(LogFileCtx *log_ctx);
/**
* \brief SCLogRedisInit() - Initializes global stuff before threads
*/
void SCLogRedisInit()
void SCLogRedisInit(void)
{
#ifdef HAVE_LIBEVENT_PTHREADS
evthread_use_pthreads();

@ -95,7 +95,7 @@ static void LockRecordFree(void *data)
SCFree(fn);
}
int LockRecordInitHash()
int LockRecordInitHash(void)
{
pthread_mutex_init(&lock_records_mutex, NULL);
pthread_mutex_lock(&lock_records_mutex);
@ -219,7 +219,7 @@ static void SCProfilingListLocks(void)
fclose(fp);
}
void LockRecordFreeHash()
void LockRecordFreeHash(void)
{
if (profiling_locks_enabled == 0)
return;

@ -314,7 +314,7 @@ release:
/**
* \brief get the maximum transmissible unit for all devices on the system
*/
int GetGlobalMTUWin32()
int GetGlobalMTUWin32(void)
{
uint32_t mtu = 0;
@ -1653,7 +1653,7 @@ static int Win32TestStripPcapPrefix(void)
}
#endif /* UNITTESTS */
void Win32SyscallRegisterTests()
void Win32SyscallRegisterTests(void)
{
#ifdef UNITTESTS
UtRegisterTest("Win32TestStripPcapPrefix", Win32TestStripPcapPrefix);

Loading…
Cancel
Save