From 7ab5fb65b2f17600ea84324e4b6e8300e3e6ac8f Mon Sep 17 00:00:00 2001 From: yhirose Date: Fri, 16 Jun 2023 18:08:28 -0400 Subject: [PATCH] Code cleanup (#1593) --- httplib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/httplib.h b/httplib.h index f7acf2b..0f7134b 100644 --- a/httplib.h +++ b/httplib.h @@ -2024,7 +2024,7 @@ inline bool from_hex_to_i(const std::string &s, size_t i, size_t cnt, } inline std::string from_i_to_hex(size_t n) { - const char *charset = "0123456789abcdef"; + static const auto charset = "0123456789abcdef"; std::string ret; do { ret = charset[n & 15] + ret; @@ -2364,7 +2364,7 @@ inline int close_socket(socket_t sock) { } template inline ssize_t handle_EINTR(T fn) { - ssize_t res = false; + ssize_t res = 0; while (true) { res = fn(); if (res < 0 && errno == EINTR) { continue; } @@ -3389,7 +3389,7 @@ inline bool brotli_decompressor::decompress(const char *data, return 0; } - const uint8_t *next_in = reinterpret_cast(data); + auto next_in = reinterpret_cast(data); size_t avail_in = data_length; size_t total_out;