fix some compiler warnings

This commit is contained in:
walker0643 2018-01-31 10:03:34 -05:00
parent 9240cc12df
commit b77eec1f17
4 changed files with 7 additions and 6 deletions

View File

@ -106,7 +106,7 @@ void IpcClient::sendCommand(const QString& command, ElevateMode const elevate)
std::string stdStringCommand = command.toStdString(); std::string stdStringCommand = command.toStdString();
const char* charCommand = stdStringCommand.c_str(); const char* charCommand = stdStringCommand.c_str();
int length = strlen(charCommand); int length = (int)strlen(charCommand);
char lenBuf[4]; char lenBuf[4];
intToBytes(length, lenBuf, 4); intToBytes(length, lenBuf, 4);

View File

@ -91,13 +91,14 @@ IArchString::convStringWCToMB(char* dst,
} }
ARCH->unlockMutex(s_mutex); ARCH->unlockMutex(s_mutex);
return len; return (int)len;
} }
int int
IArchString::convStringMBToWC(wchar_t* dst, IArchString::convStringMBToWC(wchar_t* dst,
const char* src, UInt32 n, bool* errors) const char* src, UInt32 n_param, bool* errors)
{ {
ptrdiff_t n = (ptrdiff_t)n_param; // fix compiler warning
ptrdiff_t len = 0; ptrdiff_t len = 0;
wchar_t dummy; wchar_t dummy;
@ -185,5 +186,5 @@ IArchString::convStringMBToWC(wchar_t* dst,
} }
ARCH->unlockMutex(s_mutex); ARCH->unlockMutex(s_mutex);
return len; return (int)len;
} }

View File

@ -180,7 +180,7 @@ Log::print(const char* file, int line, const char* fmt, ...)
sprintf(timestamp, "%04i-%02i-%02iT%02i:%02i:%02i", tm->tm_year + 1900, tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); sprintf(timestamp, "%04i-%02i-%02iT%02i:%02i:%02i", tm->tm_year + 1900, tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
// square brackets, spaces, comma and null terminator take about 10 // square brackets, spaces, comma and null terminator take about 10
int size = 10; size_t size = 10;
size += strlen(timestamp); size += strlen(timestamp);
size += strlen(g_priority[priority]); size += strlen(g_priority[priority]);
size += strlen(buffer); size += strlen(buffer);

View File

@ -337,7 +337,7 @@ TCPSocket::doRead()
// slurp up as much as possible // slurp up as much as possible
do { do {
m_inputBuffer.write(buffer, bytesRead); m_inputBuffer.write(buffer, (UInt32)bytesRead);
bytesRead = ARCH->readSocket(m_socket, buffer, sizeof(buffer)); bytesRead = ARCH->readSocket(m_socket, buffer, sizeof(buffer));
} while (bytesRead > 0); } while (bytesRead > 0);