From: Miod Vallat Date: Wed, 25 Jun 2025 17:01:16 +0000 (+0200) Subject: Mark dns_{isspace,tolower,toupper} pure. X-Git-Tag: rec-5.3.0-alpha2~40^2~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0d6eb741d5dc69dfdc31546e302b10a7a0ed7a8b;p=thirdparty%2Fpdns.git Mark dns_{isspace,tolower,toupper} pure. Signed-off-by: Miod Vallat --- diff --git a/pdns/dnsname.hh b/pdns/dnsname.hh index 630e9be4d8..f9042b590a 100644 --- a/pdns/dnsname.hh +++ b/pdns/dnsname.hh @@ -39,21 +39,24 @@ using namespace std::string_view_literals; #include #include -inline bool dns_isspace(char c) +inline bool dns_isspace(char chr) __attribute__((pure)); +inline bool dns_isspace(char chr) { - return c == ' ' || c == '\t' || c == '\r' || c == '\n'; + return chr == ' ' || chr == '\t' || chr == '\r' || chr == '\n'; } -extern const unsigned char dns_toupper_table[256], dns_tolower_table[256]; +extern const unsigned char dns_toupper_table[256], dns_tolower_table[256]; -inline unsigned char dns_toupper(unsigned char c) +inline unsigned char dns_toupper(unsigned char chr) __attribute__((pure)); +inline unsigned char dns_toupper(unsigned char chr) { - return dns_toupper_table[c]; + return dns_toupper_table[chr]; } -inline unsigned char dns_tolower(unsigned char c) +inline unsigned char dns_tolower(unsigned char chr) __attribute__((pure)); +inline unsigned char dns_tolower(unsigned char chr) { - return dns_tolower_table[c]; + return dns_tolower_table[chr]; } #include "burtle.hh" @@ -243,7 +246,6 @@ private: size_t hash_value(DNSName const& d); - inline bool DNSName::canonCompare(const DNSName& rhs) const { // 01234567890abcd