Fix clang warning

Clang doesn't seem to like defining a function within a function.
pull/1295/head
Ken Steele 12 years ago committed by Victor Julien
parent 23d2a1c422
commit d31db4ed1c

@ -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);
}

Loading…
Cancel
Save