From: Victor Julien Date: Thu, 5 Oct 2017 16:50:22 +0000 (+0200) Subject: app-layer: cleanup: use true bool type for 'logger' X-Git-Tag: suricata-4.1.0-beta1~547 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66530c6179d83376a67bcaa3dfa3f76a80178f4e;p=thirdparty%2Fsuricata.git app-layer: cleanup: use true bool type for 'logger' --- diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index ecf35b9980..3069b5ad01 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -89,7 +89,7 @@ typedef struct AppLayerParserProtoCtx_ { /* 0 - to_server, 1 - to_client. */ AppLayerParserFPtr Parser[2]; - char logger; + bool logger; void *(*StateAlloc)(void); void (*StateFree)(void *); @@ -457,7 +457,7 @@ void AppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto) { SCEnter(); - alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].logger = TRUE; + alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].logger = true; SCReturn; } @@ -732,7 +732,7 @@ uint64_t AppLayerTransactionGetActiveDetectLog(Flow *f, uint8_t flags) AppLayerParserProtoCtx *p = &alp_ctx.ctxs[f->protomap][f->alproto]; uint64_t log_id = f->alparser->log_id; uint64_t inspect_id = f->alparser->inspect_id[flags & STREAM_TOSERVER ? 0 : 1]; - if (p->logger == TRUE) { + if (p->logger == true) { return (log_id < inspect_id) ? log_id : inspect_id; } else { return inspect_id; @@ -751,7 +751,7 @@ uint64_t AppLayerTransactionGetActiveLogOnly(Flow *f, uint8_t flags) { AppLayerParserProtoCtx *p = &alp_ctx.ctxs[f->protomap][f->alproto]; - if (p->logger == TRUE) { + if (p->logger == true) { uint64_t log_id = f->alparser->log_id; SCLogDebug("returning %"PRIu64, log_id); return log_id; @@ -913,7 +913,7 @@ uint64_t AppLayerParserGetTransactionActive(const Flow *f, uint64_t log_id = pstate->log_id; uint64_t inspect_id = pstate->inspect_id[direction & STREAM_TOSERVER ? 0 : 1]; - if (alp_ctx.ctxs[f->protomap][f->alproto].logger == TRUE) { + if (alp_ctx.ctxs[f->protomap][f->alproto].logger == true) { active_id = (log_id < inspect_id) ? log_id : inspect_id; } else { active_id = inspect_id; @@ -1215,7 +1215,7 @@ int AppLayerParserProtocolHasLogger(uint8_t ipproto, AppProto alproto) { SCEnter(); int ipproto_map = FlowGetProtoMapping(ipproto); - int r = (alp_ctx.ctxs[ipproto_map][alproto].logger == 0) ? 0 : 1; + int r = (alp_ctx.ctxs[ipproto_map][alproto].logger == false) ? 0 : 1; SCReturnInt(r); }