more fixes for w4267
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -54,7 +54,7 @@ namespace BarrierInput
|
||||
int ReadU8() { int ret = data[0]; data += 1; return ret; }
|
||||
void Eat(int len) { data += len; }
|
||||
|
||||
void InsertString(const char* str) { int len = strlen(str); memcpy(end, str, len); end += len; }
|
||||
void InsertString(const char* str) { int len = static_cast<int>(strlen(str)); memcpy(end, str, len); end += len; }
|
||||
void InsertU32(int a) { end[0] = a >> 24; end[1] = a >> 16; end[2] = a >> 8; end[3] = a; end += 4; }
|
||||
void InsertU16(int a) { end[0] = a >> 8; end[1] = a; end += 2; }
|
||||
void InsertU8(int a) { end[0] = a; end += 1; }
|
||||
@@ -93,7 +93,7 @@ namespace BarrierInput
|
||||
stream.InsertString("Barrier");
|
||||
stream.InsertU16(1);
|
||||
stream.InsertU16(4);
|
||||
stream.InsertU32(pContext->GetClientScreenName().length());
|
||||
stream.InsertU32(static_cast<int>(pContext->GetClientScreenName().length()));
|
||||
stream.InsertString(pContext->GetClientScreenName().c_str());
|
||||
stream.ClosePacket();
|
||||
return barrierSendFunc(pContext, stream.GetBuffer(), stream.GetLength());
|
||||
@@ -268,7 +268,7 @@ namespace BarrierInput
|
||||
int i;
|
||||
for (i = 0; i < numPackets; ++i)
|
||||
{
|
||||
const int len = strlen(s_packets[i].pattern);
|
||||
const int len = static_cast<int>(strlen(s_packets[i].pattern));
|
||||
if (packetLength >= len && memcmp(stream.GetData(), s_packets[i].pattern, len) == 0)
|
||||
{
|
||||
bool bDone = false;
|
||||
|
||||
Reference in New Issue
Block a user