From: Ken Steele Date: Tue, 30 Sep 2014 17:04:27 +0000 (-0400) Subject: Fix clang warning X-Git-Tag: suricata-2.1beta3~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d31db4ed1c91a72d2518ec9646d9812b0b9ba22c;p=thirdparty%2Fsuricata.git Fix clang warning Clang doesn't seem to like defining a function within a function. --- diff --git a/src/detect.c b/src/detect.c index 6b7537a7db..430986aea7 100644 --- a/src/detect.c +++ b/src/detect.c @@ -837,6 +837,13 @@ static inline void DetectPrefilterMergeSort(DetectEngineCtx *de_ctx, BUG_ON((det_ctx->pmq.rule_id_array_cnt + sgh->non_mpm_id_cnt) < det_ctx->match_array_cnt); } +static int DoSort(const void *a, const void *b) +{ + uint32_t x = *(uint32_t *)a; + uint32_t y = *(uint32_t *)b; + return x - y; +} + #define SMS_USE_FLOW_SGH 0x01 #define SMS_USED_PM 0x02 #define SMS_USED_STREAM_PM 0x04 @@ -1087,11 +1094,6 @@ static inline void DetectMpmPrefilter(DetectEngineCtx *de_ctx, /* Sort the rule list to lets look at pmq. * NOTE due to merging of 'stream' pmqs we *MAY* have duplicate entries */ if (det_ctx->pmq.rule_id_array_cnt) { - int DoSort(const void *a, const void *b) { - uint32_t x = *(uint32_t *)a; - uint32_t y = *(uint32_t *)b; - return x - y; - } qsort(det_ctx->pmq.rule_id_array, det_ctx->pmq.rule_id_array_cnt, sizeof(uint32_t), DoSort); }