app-layer: fix integer warnings

Ticket: 4516
pull/7242/head
Philippe Antoine 3 years ago committed by Victor Julien
parent 1c8559b3ab
commit f30975fb16

@ -1845,7 +1845,7 @@ int AppLayerProtoDetectSetup(void)
memset(&alpd_ctx, 0, sizeof(alpd_ctx));
uint16_t spm_matcher = SinglePatternMatchDefaultMatcher();
uint16_t mpm_matcher = PatternMatchDefaultMatcher();
uint8_t mpm_matcher = PatternMatchDefaultMatcher();
alpd_ctx.spm_global_thread_ctx = SpmInitGlobalThreadCtx(spm_matcher);
if (alpd_ctx.spm_global_thread_ctx == NULL) {

@ -70,7 +70,7 @@ Frame *FrameGetByIndex(Frames *frames, const uint32_t idx)
FrameDebug("get_by_idx(s)", frames, frame);
return frame;
} else {
const uint16_t o = idx - FRAMES_STATIC_CNT;
const uint32_t o = idx - FRAMES_STATIC_CNT;
Frame *frame = &frames->dframes[o];
FrameDebug("get_by_idx(d)", frames, frame);
return frame;

@ -1256,7 +1256,7 @@ int AppLayerParserParse(ThreadVars *tv, AppLayerParserThreadCtx *alp_tctx, Flow
void *alstate = NULL;
uint64_t p_tx_cnt = 0;
uint32_t consumed = input_len;
const int direction = (flags & STREAM_TOSERVER) ? 0 : 1;
const uint8_t direction = (flags & STREAM_TOSERVER) ? 0 : 1;
/* we don't have the parser registered for this protocol */
if (p->StateAlloc == NULL)

@ -345,7 +345,7 @@ static int TCPProtoDetect(ThreadVars *tv,
{
AppProto *alproto;
AppProto *alproto_otherdir;
int direction = (flags & STREAM_TOSERVER) ? 0 : 1;
uint8_t direction = (flags & STREAM_TOSERVER) ? 0 : 1;
if (flags & STREAM_TOSERVER) {
alproto = &f->alproto_ts;
@ -651,7 +651,7 @@ int AppLayerHandleTCPData(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
goto end;
}
const int direction = (flags & STREAM_TOSERVER) ? 0 : 1;
const uint8_t direction = (flags & STREAM_TOSERVER) ? 0 : 1;
if (flags & STREAM_TOSERVER) {
alproto = f->alproto_ts;

@ -853,10 +853,10 @@ int SignatureHasStreamContent(const Signature *s)
*
* \retval mpm algo value
*/
uint16_t PatternMatchDefaultMatcher(void)
uint8_t PatternMatchDefaultMatcher(void)
{
const char *mpm_algo;
uint16_t mpm_algo_val = mpm_default_matcher;
uint8_t mpm_algo_val = mpm_default_matcher;
/* Get the mpm algo defined in config file by the user */
if ((ConfGet("mpm-algo", &mpm_algo)) == 1) {

@ -43,7 +43,7 @@ int DetectMpmPrepareBuiltinMpms(DetectEngineCtx *de_ctx);
uint32_t PatternStrength(uint8_t *, uint16_t);
uint16_t PatternMatchDefaultMatcher(void);
uint8_t PatternMatchDefaultMatcher(void);
uint32_t DnsQueryPatternSearch(DetectEngineThreadCtx *det_ctx, uint8_t *buffer, uint32_t buffer_len, uint8_t flags);
void PatternMatchPrepare(MpmCtx *, uint16_t);

Loading…
Cancel
Save