mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-04 21:04:57 +00:00
lib/xmlparse.c: Address clang-tidy warning misc-no-recursion
This commit is contained in:
parent
004e55a7e1
commit
fe04a7f0ff
2 changed files with 11 additions and 7 deletions
|
@ -35,6 +35,7 @@ cd "$(dirname "$(type -P "$0")")"
|
||||||
checks_to_enable=(
|
checks_to_enable=(
|
||||||
bugprone-narrowing-conversions
|
bugprone-narrowing-conversions
|
||||||
bugprone-suspicious-string-compare
|
bugprone-suspicious-string-compare
|
||||||
|
misc-no-recursion
|
||||||
readability-avoid-const-params-in-decls
|
readability-avoid-const-params-in-decls
|
||||||
readability-named-parameter
|
readability-named-parameter
|
||||||
)
|
)
|
||||||
|
|
|
@ -1015,9 +1015,10 @@ generate_hash_secret_salt(XML_Parser parser) {
|
||||||
|
|
||||||
static unsigned long
|
static unsigned long
|
||||||
get_hash_secret_salt(XML_Parser parser) {
|
get_hash_secret_salt(XML_Parser parser) {
|
||||||
if (parser->m_parentParser != NULL)
|
const XML_Parser rootParser = getRootParserOf(parser, NULL);
|
||||||
return get_hash_secret_salt(parser->m_parentParser);
|
assert(! rootParser->m_parentParser);
|
||||||
return parser->m_hash_secret_salt;
|
|
||||||
|
return rootParser->m_hash_secret_salt;
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum XML_Error
|
static enum XML_Error
|
||||||
|
@ -2017,12 +2018,14 @@ int XMLCALL
|
||||||
XML_SetHashSalt(XML_Parser parser, unsigned long hash_salt) {
|
XML_SetHashSalt(XML_Parser parser, unsigned long hash_salt) {
|
||||||
if (parser == NULL)
|
if (parser == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
if (parser->m_parentParser)
|
|
||||||
return XML_SetHashSalt(parser->m_parentParser, hash_salt);
|
const XML_Parser rootParser = getRootParserOf(parser, NULL);
|
||||||
|
assert(! rootParser->m_parentParser);
|
||||||
|
|
||||||
/* block after XML_Parse()/XML_ParseBuffer() has been called */
|
/* block after XML_Parse()/XML_ParseBuffer() has been called */
|
||||||
if (parserBusy(parser))
|
if (parserBusy(rootParser))
|
||||||
return 0;
|
return 0;
|
||||||
parser->m_hash_secret_salt = hash_salt;
|
rootParser->m_hash_secret_salt = hash_salt;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue