Skip to content

Commit 501c117

Browse files
authored
Merge pull request #213 from robinlinden/fix-vs2019-build
Fix VS2019 warning due to discarding nodiscard value
2 parents dac9eef + 7076ae0 commit 501c117

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

autobahn/wamp_auth_utils.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ inline std::string base_64_encode(const std::string & data )
8181

8282
BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);
8383

84-
BIO_write(bio, (const unsigned char *) data.c_str(), data.size());
84+
BIO_write(bio, (const unsigned char *) data.c_str(), (int) data.size());
8585
(void)BIO_flush(bio);
8686

8787
BIO_get_mem_ptr(bio, &pBuf);
@@ -113,10 +113,10 @@ inline std::string derive_key(
113113
)
114114
{
115115

116-
int passwdLen = passwd.size();
116+
int passwdLen = (int) passwd.size();
117117
const char * pwd = passwd.c_str();
118118

119-
int saltLen = salt.size();
119+
int saltLen = (int) salt.size();
120120
unsigned char * salt_value = (unsigned char * ) salt.c_str();
121121

122122
std::string str_out;
@@ -169,7 +169,7 @@ inline std::string compute_wcs(
169169
HMAC_CTX *hmac = HMAC_CTX_new();
170170
if (!hmac)
171171
return "";
172-
HMAC_Init_ex(hmac, key.data(), key.length(), EVP_sha256(), NULL);
172+
HMAC_Init_ex(hmac, key.data(), (int) key.length(), EVP_sha256(), NULL);
173173
HMAC_Update(hmac, ( unsigned char* ) challenge.data(), challenge.length());
174174
HMAC_Final(hmac, hash, &len);
175175
HMAC_CTX_free(hmac);

autobahn/wamp_rawsocket_transport.ipp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void wamp_rawsocket_transport<Socket>::send_message(wamp_message&& message)
149149
packer.pack(message.fields());
150150

151151
// Write the length prefix as the message header.
152-
uint32_t length = htonl(buffer->size());
152+
uint32_t length = htonl((uint32_t) buffer->size());
153153
boost::asio::write(m_socket, boost::asio::buffer(&length, sizeof(length)));
154154

155155
// Write actual serialized message.

autobahn/wamp_session.ipp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ inline void wamp_session::process_challenge(wamp_message&& message)
790790
});
791791

792792
// make sure the context_response is copied into this lambda...
793-
context_response.get();
793+
(void)context_response.get();
794794
} catch (const std::exception&) {
795795
if (m_debug_enabled) {
796796
std::cerr << "failed to handle authentication" << std::endl;

0 commit comments

Comments
 (0)