Fix -Wold-style-cast warning (#1751)
This commit is contained in:
parent
b63d50671d
commit
55e99c4030
14
httplib.h
14
httplib.h
@ -2705,7 +2705,9 @@ inline bool mmap::is_open() const { return addr_ != nullptr; }
|
|||||||
|
|
||||||
inline size_t mmap::size() const { return size_; }
|
inline size_t mmap::size() const { return size_; }
|
||||||
|
|
||||||
inline const char *mmap::data() const { return (const char *)addr_; }
|
inline const char *mmap::data() const {
|
||||||
|
return static_cast<const char *>(addr_);
|
||||||
|
}
|
||||||
|
|
||||||
inline void mmap::close() {
|
inline void mmap::close() {
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
@ -8693,11 +8695,11 @@ inline bool SSLClient::initialize_ssl(Socket &socket, Error &error) {
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
[&](SSL *ssl2) {
|
[&](SSL *ssl2) {
|
||||||
// NOTE: With -Wold-style-cast, this can produce a warning, since
|
// NOTE: Direct call instead of using the OpenSSL macro to suppress
|
||||||
// SSL_set_tlsext_host_name is a macro (in OpenSSL), which contains
|
// -Wold-style-cast warning
|
||||||
// an old style cast. Short of doing compiler specific pragma's
|
// SSL_set_tlsext_host_name(ssl2, host_.c_str());
|
||||||
// here, we can't get rid of this warning. :'(
|
SSL_ctrl(ssl2, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name,
|
||||||
SSL_set_tlsext_host_name(ssl2, host_.c_str());
|
static_cast<void *>(const_cast<char *>(host_.c_str())));
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user