summaryrefslogtreecommitdiff
path: root/src/util/hex.h
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2017-04-07 08:50:17 +0200
committerLoic Blot <loic.blot@unix-experience.fr>2017-04-07 08:50:17 +0200
commitf7088f69ab7406ea9fefa853fa7ce11f914e88cf (patch)
treea2457b54c9f5ed6ea65342b3a1fadeeee036d501 /src/util/hex.h
parentb751c59f43e04f698f517383b62a9c4e1f82523e (diff)
downloadminetest-f7088f69ab7406ea9fefa853fa7ce11f914e88cf.tar.gz
minetest-f7088f69ab7406ea9fefa853fa7ce11f914e88cf.tar.bz2
minetest-f7088f69ab7406ea9fefa853fa7ce11f914e88cf.zip
Clang-format: fix some header files and remove them from whitelist
Diffstat (limited to 'src/util/hex.h')
-rw-r--r--src/util/hex.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/util/hex.h b/src/util/hex.h
index 6f00a79bf..c205d01da 100644
--- a/src/util/hex.h
+++ b/src/util/hex.h
@@ -30,9 +30,8 @@ static inline std::string hex_encode(const char *data, unsigned int data_size)
char buf2[3];
buf2[2] = '\0';
- for(unsigned int i = 0; i < data_size; i++)
- {
- unsigned char c = (unsigned char) data[i];
+ for (unsigned int i = 0; i < data_size; i++) {
+ unsigned char c = (unsigned char)data[i];
buf2[0] = hex_chars[(c & 0xf0) >> 4];
buf2[1] = hex_chars[c & 0x0f];
ret.append(buf2);
@@ -43,16 +42,16 @@ static inline std::string hex_encode(const char *data, unsigned int data_size)
static inline std::string hex_encode(const std::string &data)
{
- return hex_encode(data.c_str(), data.size());
+ return hex_encode(data.c_str(), data.size());
}
static inline bool hex_digit_decode(char hexdigit, unsigned char &value)
{
- if(hexdigit >= '0' && hexdigit <= '9')
+ if (hexdigit >= '0' && hexdigit <= '9')
value = hexdigit - '0';
- else if(hexdigit >= 'A' && hexdigit <= 'F')
+ else if (hexdigit >= 'A' && hexdigit <= 'F')
value = hexdigit - 'A' + 10;
- else if(hexdigit >= 'a' && hexdigit <= 'f')
+ else if (hexdigit >= 'a' && hexdigit <= 'f')
value = hexdigit - 'a' + 10;
else
return false;