Skip to content

Commit

Permalink
misc: Eliminate compiler warnings
Browse files Browse the repository at this point in the history
Issue: 2290

Fixup the macro usage to eliminate compiler warnings.
  • Loading branch information
jlucovsky committed Sep 20, 2024
1 parent cbae137 commit e14e58a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/util-magic.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ char *MagicThreadLookup(magic_t *ctx, const uint8_t *buf, uint32_t buflen)

#ifdef UNITTESTS

#if 0
#if defined OS_FREEBSD || defined OS_DARWIN
#define MICROSOFT_OFFICE_DOC "OLE 2 Compound Document"
#else
#define MICROSOFT_OFFICE_DOC "Microsoft Office Document"
#endif
#endif

/** \test magic lib calls -- init */
static int MagicInitTest01(void)
Expand Down
3 changes: 1 addition & 2 deletions src/util-memcmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
6 changes: 3 additions & 3 deletions src/util-spm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e14e58a

Please sign in to comment.