Skip to content
Snippets Groups Projects
Commit ae234d24 authored by Edric Milaret's avatar Edric Milaret Committed by gerrit2
Browse files

remove lots of warning during Win32 build

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