]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
misc: Eliminate compiler warnings
authorJeff Lucovsky <jlucovsky@oisf.net>
Fri, 20 Sep 2024 13:57:53 +0000 (09:57 -0400)
committerVictor Julien <victor@inliniac.net>
Thu, 10 Oct 2024 07:07:45 +0000 (09:07 +0200)
Issue: 7314

Fixup macro usages to eliminate compiler warnings.

src/util-magic.c
src/util-memcmp.c
src/util-profiling.c
src/util-spm.c

index 63c991cc92d8a09072f9cddd44544c3cc514da78..1308964717598ca321fdadb521f6cce4020fc9f9 100644 (file)
@@ -120,12 +120,6 @@ char *MagicThreadLookup(magic_t *ctx, const uint8_t *buf, uint32_t buflen)
 
 #ifdef UNITTESTS
 
-#if defined OS_FREEBSD || defined OS_DARWIN
-#define MICROSOFT_OFFICE_DOC "OLE 2 Compound Document"
-#else
-#define MICROSOFT_OFFICE_DOC "Microsoft Office Document"
-#endif
-
 /** \test magic lib calls -- init */
 static int MagicInitTest01(void)
 {
index 7113b82dd60ced6e1b94db539008bdb31d4720de..40f4fd67d63a57f9ae5d356db60427063f5a0492 100644 (file)
@@ -154,11 +154,10 @@ static int MemcmpTest13 (void)
 
 #include "util-cpu.h"
 
-#define TEST_RUNS 1000000
-
 static int MemcmpTest14 (void)
 {
 #ifdef PROFILING
+#define TEST_RUNS 1000000
     uint64_t ticks_start = 0;
     uint64_t ticks_end = 0;
     const char *a[] = { "0123456789012345", "abc", "abcdefghij", "suricata", "test", "xyz", "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr", "abcdefghijklmnopqrstuvwxyz", NULL };
index 101b1e5ac80fe466f6e33d2306756b6f3051b11d..295253eca30836a24fce430217695617af5b0991 100644 (file)
@@ -42,9 +42,6 @@
 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
 #endif
 
-#define DEFAULT_LOG_FILENAME "profile.log"
-#define DEFAULT_LOG_MODE_APPEND "yes"
-
 static pthread_mutex_t packet_profile_lock;
 static FILE *packet_profile_csv_fp = NULL;
 
index 63510596c7a333567e560fee79dbdbb938d118d3..dce8c737e1f9380f3b6ddbf0984afc2819c7cc04 100644 (file)
@@ -267,9 +267,6 @@ uint8_t *BoyerMooreNocaseSearch(const uint8_t *text, uint32_t textlen,
  *  #define ENABLE_SEARCH_STATS 1
  */
 
-/* Number of times to repeat the search (for stats) */
-#define STATS_TIMES 1000000
-
 /**
  * \brief Unittest helper function wrappers for the search algorithms
  * \param text pointer to the buffer to search in
@@ -403,6 +400,9 @@ static uint8_t *BoyerMooreNocaseWrapper(uint8_t *text, uint8_t *in_needle, int t
 }
 
 #ifdef ENABLE_SEARCH_STATS
+/* Number of times to repeat the search (for stats) */
+#define STATS_TIMES 1000000
+
 /**
  * \brief Unittest helper function wrappers for the search algorithms
  * \param text pointer to the buffer to search in