Commit ae234d24 authored by Edric Milaret's avatar Edric Milaret Committed by gerrit2

remove lots of warning during Win32 build

Tuleap: #381
Change-Id: Ibf1cb1f72f874758d1bd86a5e3a8cd7d6d875fae
parent 7e2bc1e0
......@@ -146,6 +146,8 @@ void
IncomingCall(const std::string& accountId,
const std::string& callId, const std::string& message)
{
(void) accountId;
(void) message;
if (not isActive) {
DRing::accept(callId);
isActive = true;
......@@ -175,6 +177,8 @@ run()
}
DRing::fini();
return 0;
}
static void
......
......@@ -64,7 +64,9 @@
namespace ring { namespace fileutils {
// returns true if directory exists
bool check_dir(const char *path, mode_t dirmode, mode_t parentmode)
bool check_dir(const char *path,
mode_t UNUSED dirmode,
mode_t parentmode)
{
DIR *dir = opendir(path);
......@@ -211,7 +213,7 @@ loadFile(const std::string& path)
throw std::runtime_error("Can't read file: "+path);
file.seekg(0, std::ios::end);
std::streamsize size = file.tellg();
if (size > std::numeric_limits<unsigned>::max())
if ((unsigned)size > std::numeric_limits<unsigned>::max())
throw std::runtime_error("File is too big: "+path);
buffer.resize(size);
file.seekg(0, std::ios::beg);
......@@ -221,7 +223,9 @@ loadFile(const std::string& path)
}
void
saveFile(const std::string& path, const std::vector<uint8_t>& data, mode_t mode)
saveFile(const std::string& path,
const std::vector<uint8_t>& data,
mode_t UNUSED mode)
{
std::ofstream file(path, std::ios::trunc | std::ios::binary);
if (!file.is_open()) {
......
......@@ -128,10 +128,11 @@ ip_utils::getInterfaceAddr(const std::string &interface, pj_uint16_t family)
if (interface == DEFAULT_INTERFACE)
return getLocalAddr(family);
const auto unix_family = family == pj_AF_INET() ? AF_INET : AF_INET6;
IpAddr addr = {};
#ifndef _WIN32
const auto unix_family = family == pj_AF_INET() ? AF_INET : AF_INET6;
int fd = socket(unix_family, SOCK_DGRAM, 0);
if (fd < 0) {
RING_ERR("Could not open socket: %m");
......@@ -171,7 +172,7 @@ ip_utils::getInterfaceAddr(const std::string &interface, pj_uint16_t family)
DWORD dwRetval = getaddrinfo(interface.c_str(), "0", &hints, &result);
if (dwRetval != 0) {
RING_ERR("getaddrinfo failed with error: %d", dwRetval);
RING_ERR("getaddrinfo failed with error: %lu", dwRetval);
return addr;
}
......
......@@ -33,7 +33,9 @@ extern "C" {
* Print something, coloring it depending on the level
*/
void logger(const int level, const char* format, ...)
#ifdef __GNUC__
#ifdef _WIN32
__attribute__((format(gnu_printf, 2, 3)))
#elif defined(__GNUC__)
__attribute__((format(printf, 2, 3)))
#endif
;
......
......@@ -121,7 +121,11 @@ udp_resolve_host(const char* node, int service)
struct addrinfo* res = nullptr;
if (auto error = getaddrinfo(node, sport, &hints, &res)) {
res = nullptr;
#ifndef _WIN32
RING_ERR("getaddrinfo failed: %s\n", gai_strerror(error));
#else
RING_ERR("getaddrinfo failed: %S\n", gai_strerror(error));
#endif
}
return res;
......
......@@ -1216,7 +1216,7 @@ RingAccount::loadValues() const
}
remove(file.c_str());
}
RING_DBG("Loaded %lu values", values.size());
RING_DBG("Loaded %zu values", values.size());
return values;
}
......
......@@ -196,7 +196,7 @@ CertificateStore::pinCertificatePath(const std::string& path, std::function<void
}
paths_.emplace(path, std::move(scerts));
}
RING_DBG("CertificateStore: loaded %lu certificates from %s.",
RING_DBG("CertificateStore: loaded %zu certificates from %s.",
certs.size(), path.c_str());
if (cb)
cb(ids);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment