Skip to content

Commit

Permalink
Fixed some debug trace format specifiers to reduce compile-time warni…
Browse files Browse the repository at this point in the history
…ngs (round two)
  • Loading branch information
joseph-henry committed Feb 21, 2018
1 parent 9fba2a6 commit c107f2c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/bindings/cpp/ipv6adhoc/ipv6adhocserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int main(int argc, char **argv)
in6.sin6_family = AF_INET6;
in6.sin6_addr = in6addr_any;

fprintf(stderr, "nwid=%llx\n", nwid);
fprintf(stderr, "nwid=%llx\n", (unsigned long long)nwid);
exit(-1);

// --- BEGIN EXAMPLE CODE
Expand Down
4 changes: 2 additions & 2 deletions src/VirtualTap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ bool VirtualTap::addIp(const InetAddress &ip)
#endif
#if defined(STACK_PICO) || defined(STACK_LWIP)
char ipbuf[INET6_ADDRSTRLEN];
DEBUG_EXTRA("addr=%s, nwid=%llx", ip.toString(ipbuf), _nwid);
DEBUG_EXTRA("addr=%s, nwid=%llx", ip.toString(ipbuf), (unsigned long long)_nwid);
Mutex::Lock _l(_ips_m);
if (registerIpWithStack(ip)) {
if (std::find(_ips.begin(),_ips.end(),ip) == _ips.end()) {
Expand Down Expand Up @@ -193,7 +193,7 @@ std::string VirtualTap::nodeId() const
if (zt1ServiceRef) {
char id[ZTO_ID_LEN];
memset(id, 0, sizeof(id));
sprintf(id, "%llx",((ZeroTier::OneService *)zt1ServiceRef)->getNode()->address());
sprintf(id, "%llx", (unsigned long long)((ZeroTier::OneService *)zt1ServiceRef)->getNode()->address());
return std::string(id);
}
else {
Expand Down
4 changes: 2 additions & 2 deletions src/libzt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ ssize_t zts_sendmsg(int fd, const struct msghdr *msg, int flags)

ssize_t zts_recv(int fd, void *buf, size_t len, int flags)
{
DEBUG_TRANS("fd=%d, len=%zu", fd);
DEBUG_TRANS("fd=%d, len=%zu", fd, len);
if (zts_ready() == false) {
DEBUG_ERROR("service not started yet, call zts_startjoin()");
return -1;
Expand All @@ -519,7 +519,7 @@ ssize_t zts_recv(int fd, void *buf, size_t len, int flags)
ssize_t zts_recvfrom(int fd, void *buf, size_t len, int flags,
struct sockaddr *addr, socklen_t *addrlen)
{
DEBUG_TRANS("fd=%d, len=%zu", fd);
DEBUG_TRANS("fd=%d, len=%zu", fd, len);
if (zts_ready() == false) {
DEBUG_ERROR("service not started yet, call zts_startjoin()");
return -1;
Expand Down
8 changes: 4 additions & 4 deletions test/selftest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ inline unsigned int gettid()
#define _READ read
#define _WRITE write

#define _RECV recv
#define _SEND send
//#define _RECV recv
//#define _SEND send

#if defined(_WIN32)
#define _CLOSE closesocket
Expand Down Expand Up @@ -2895,7 +2895,7 @@ int main(int argc , char *argv[])
zts_start(argv[3], true);
zts_join(nwid);
sleep(2);
DEBUG_TEST("generated id: %llx", nodeId);
DEBUG_TEST("generated id: %llx", (unsigned long long)nodeId);
exit(0);
}
}
Expand Down Expand Up @@ -2985,7 +2985,7 @@ int main(int argc , char *argv[])
}
zts_startjoin(path.c_str(), nwid);
uint64_t nodeId = zts_get_node_id();
DEBUG_TEST("I am %llx, %s", nodeId, me.c_str());
DEBUG_TEST("I am %llx, %s", (unsigned long long)nodeId, me.c_str());
if (mode == TEST_MODE_SERVER) {
DEBUG_TEST("Ready. You should start selftest program on second host now...\n\n");
}
Expand Down

0 comments on commit c107f2c

Please sign in to comment.