From 2da3dc40525efd924a65a5d7eb63af2130370fde Mon Sep 17 00:00:00 2001 From: Ned Wright Date: Mon, 4 Dec 2023 14:16:00 +0200 Subject: [PATCH] Fix constness --- components/security_apps/waap/waap_clib/ParserHTML.cc | 6 +++--- components/security_apps/waap/waap_clib/ParserHTML.h | 2 +- components/security_apps/waap/waap_clib/ParserXML.cc | 6 +++--- components/security_apps/waap/waap_clib/ParserXML.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/security_apps/waap/waap_clib/ParserHTML.cc b/components/security_apps/waap/waap_clib/ParserHTML.cc index b74f242..97e5900 100755 --- a/components/security_apps/waap/waap_clib/ParserHTML.cc +++ b/components/security_apps/waap/waap_clib/ParserHTML.cc @@ -206,7 +206,7 @@ ParserHTML::~ParserHTML() } bool -ParserHTML::filterErrors(xmlErrorPtr xmlError) +ParserHTML::filterErrors(const xmlError *xmlError) { dbgDebug(D_WAAP_PARSER_HTML) << "ParserHTML::filterErrors(): xmlError " @@ -245,7 +245,7 @@ ParserHTML::push(const char *data, size_t data_len) // Send zero-length chunk with "terminate" flag enabled to signify end-of-stream if (htmlParseChunk(m_pushParserCtxPtr, m_buf, 0, 1)) { - xmlErrorPtr xmlError = xmlCtxtGetLastError(m_pushParserCtxPtr); + auto xmlError = xmlCtxtGetLastError(m_pushParserCtxPtr); if (xmlError && filterErrors(xmlError)) { dbgDebug(D_WAAP_PARSER_HTML) << "ParserHTML::push(): xmlError: code=" @@ -320,7 +320,7 @@ ParserHTML::push(const char *data, size_t data_len) << i; if (m_pushParserCtxPtr) { if (htmlParseChunk(m_pushParserCtxPtr, data + i, data_len - i, 0)) { - xmlErrorPtr xmlError = xmlCtxtGetLastError(m_pushParserCtxPtr); + auto xmlError = xmlCtxtGetLastError(m_pushParserCtxPtr); if (xmlError && filterErrors(xmlError)) { dbgDebug(D_WAAP_PARSER_HTML) << "ParserHTML::push(): xmlError: code=" diff --git a/components/security_apps/waap/waap_clib/ParserHTML.h b/components/security_apps/waap/waap_clib/ParserHTML.h index 692ad7b..0d58481 100755 --- a/components/security_apps/waap/waap_clib/ParserHTML.h +++ b/components/security_apps/waap/waap_clib/ParserHTML.h @@ -68,7 +68,7 @@ private: // Filter out errors that should be ignored. Returns true if error should be treated, // false if an error should be ignored - bool filterErrors(xmlErrorPtr xmlError); + bool filterErrors(const xmlError *xmlError); IParserStreamReceiver &m_receiver; enum state m_state; diff --git a/components/security_apps/waap/waap_clib/ParserXML.cc b/components/security_apps/waap/waap_clib/ParserXML.cc index ae69d65..84da857 100755 --- a/components/security_apps/waap/waap_clib/ParserXML.cc +++ b/components/security_apps/waap/waap_clib/ParserXML.cc @@ -234,7 +234,7 @@ ParserXML::~ParserXML() { } } -bool ParserXML::filterErrors(xmlErrorPtr xmlError) { +bool ParserXML::filterErrors(const xmlError *xmlError) { dbgDebug(D_WAAP_PARSER_XML) << "ParserXML::filterErrors(): xmlError " << xmlError->code << ": '" << xmlError->message << "'"; @@ -262,7 +262,7 @@ size_t ParserXML::push(const char* data, size_t data_len) { // Send zero-length chunk with "terminate" flag enabled to signify end-of-stream if (xmlParseChunk(m_pushParserCtxPtr, m_buf, 0, 1)) { - xmlErrorPtr xmlError = xmlCtxtGetLastError(m_pushParserCtxPtr); + auto xmlError = xmlCtxtGetLastError(m_pushParserCtxPtr); if (xmlError && filterErrors(xmlError)) { dbgDebug(D_WAAP_PARSER_XML) << "ParserXML::push(): xmlError: code=" << xmlError->code << ": '" << xmlError->message << "'"; @@ -316,7 +316,7 @@ size_t ParserXML::push(const char* data, size_t data_len) { ": '" << std::string(data + i, data_len - i) << "'; i=" << i; if (m_pushParserCtxPtr) { if (xmlParseChunk(m_pushParserCtxPtr, data + i, data_len - i, 0)) { - xmlErrorPtr xmlError = xmlCtxtGetLastError(m_pushParserCtxPtr); + auto xmlError = xmlCtxtGetLastError(m_pushParserCtxPtr); if (xmlError && filterErrors(xmlError)) { dbgDebug(D_WAAP_PARSER_XML) << "ParserXML::push(): xmlError: code=" << xmlError->code << ": '" << xmlError->message << "'"; diff --git a/components/security_apps/waap/waap_clib/ParserXML.h b/components/security_apps/waap/waap_clib/ParserXML.h index 7c0f7b9..9238856 100755 --- a/components/security_apps/waap/waap_clib/ParserXML.h +++ b/components/security_apps/waap/waap_clib/ParserXML.h @@ -83,7 +83,7 @@ private: // Filter out errors that should be ignored. Returns true if error should be treated, // false if an error should be ignored - bool filterErrors(xmlErrorPtr xmlError); + bool filterErrors(const xmlError *xmlError); IParserStreamReceiver &m_receiver; enum state m_state;