Skip to content

Commit 7076ae0

Browse files
committed
Silence VC++ warnings about possibly lossy type conversions
1 parent cc5bd9b commit 7076ae0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
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.

0 commit comments

Comments
 (0)