Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
warning removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Eisner authored and deisner committed Jul 20, 2015
1 parent c44f767 commit 3582cbe
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/dyad.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

#ifdef _WIN32
#define _WIN32_WINNT 0x501
#define _CRT_SECURE_NO_WARNINGS
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
Expand Down Expand Up @@ -60,7 +62,11 @@
} else {
memcpy(&addr.sai.sin_addr, src, sizeof(addr.sai.sin_addr));
}
res = WSAAddressToString(&addr.sa, sizeof(addr), 0, dst, (LPDWORD) &size);
#ifdef _WIN32
res = WSAAddressToStringA(&addr.sa, sizeof(addr), 0, dst, (LPDWORD) &size);
#else
res = WSAAddressToString(&addr.sa, sizeof(addr), 0, dst, (LPDWORD) &size);
#endif
if (res != 0) return NULL;
return dst;
}
Expand Down Expand Up @@ -700,8 +706,17 @@ void dyad_update(void) {
}

/* Init timeout value and do select */
#ifdef _WIN32
#pragma warning(push)
/* Disable double to long implicit conversion warning,
* because the type of timeval's fields don't agree across platforms */
#pragma warning(disable: 4244)
#endif
tv.tv_sec = dyad_updateTimeout;
tv.tv_usec = (dyad_updateTimeout - tv.tv_sec) * 1e6;
#ifdef _WIN32
#pragma warning(pop)
#endif

select(dyad_selectSet.maxfd + 1,
dyad_selectSet.fds[SELECT_READ],
Expand Down

0 comments on commit 3582cbe

Please sign in to comment.