Fix more warnings and #197

This commit is contained in:
Alexey Sokolov
2012-08-17 00:56:53 +07:00
parent 395ae4fc9f
commit 892727ba2c
6 changed files with 16 additions and 18 deletions
+1 -1
View File
@@ -412,7 +412,7 @@ ssize_t CFile::Write(const char *pszBuffer, size_t iBytes) {
}
ssize_t res = write(m_iFD, pszBuffer, iBytes);
if (res != iBytes)
if (-1 == res)
m_bHadError = true;
return res;
}
+1 -1
View File
@@ -108,7 +108,7 @@ static void seedPRNG() {
// This is in [0:1e6], which means that roughly 20 bits are
// actually used, let's try to shuffle the high bits.
seed ^= (tv.tv_usec << 10) | tv.tv_usec;
seed ^= uint32_t((tv.tv_usec << 10) | tv.tv_usec);
} else
seed = (unsigned int)time(NULL);
+1 -1
View File
@@ -582,7 +582,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
CUtils::GetInput("Listen Host", sListenHost, sListenHost, "Blank for all ips");
CUtils::PrintAction("Verifying the listener");
CListener* pListener = new CListener(uListenPort, sListenHost, bListenSSL,
CListener* pListener = new CListener((unsigned short int)uListenPort, sListenHost, bListenSSL,
b6 ? ADDR_ALL : ADDR_IPV4ONLY, CListener::ACCEPT_ALL);
if (!pListener->Listen()) {
CUtils::PrintStatus(false, FormatBindError());