Windows: fix compiler warnings

This commit is contained in:
Bert Belder 2012-03-09 17:04:26 +01:00
parent 019118c3ab
commit 18b37d4a49
2 changed files with 17 additions and 6 deletions

View File

@ -490,11 +490,13 @@ uv_err_t uv_interface_addresses(uv_interface_address_t** addresses,
unsigned long size = 0;
IP_ADAPTER_ADDRESSES* adapter_addresses;
IP_ADAPTER_ADDRESSES* adapter_address;
IP_ADAPTER_UNICAST_ADDRESS_XP* unicast_address;
uv_interface_address_t* address;
struct sockaddr* sock_addr;
int length;
char* name;
/* Use IP_ADAPTER_UNICAST_ADDRESS_XP to retain backwards compatibility */
/* with Windows XP */
IP_ADAPTER_UNICAST_ADDRESS_XP* unicast_address;
if (GetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &size)
!= ERROR_BUFFER_OVERFLOW) {
@ -517,7 +519,8 @@ uv_err_t uv_interface_addresses(uv_interface_address_t** addresses,
for (adapter_address = adapter_addresses;
adapter_address != NULL;
adapter_address = adapter_address->Next) {
unicast_address = adapter_address->FirstUnicastAddress;
unicast_address = (IP_ADAPTER_UNICAST_ADDRESS_XP*)
adapter_address->FirstUnicastAddress;
while (unicast_address) {
(*count)++;
unicast_address = unicast_address->Next;
@ -536,7 +539,8 @@ uv_err_t uv_interface_addresses(uv_interface_address_t** addresses,
adapter_address != NULL;
adapter_address = adapter_address->Next) {
name = NULL;
unicast_address = adapter_address->FirstUnicastAddress;
unicast_address = (IP_ADAPTER_UNICAST_ADDRESS_XP*)
adapter_address->FirstUnicastAddress;
while (unicast_address) {
sock_addr = unicast_address->Address.lpSockaddr;

View File

@ -4323,10 +4323,17 @@ typedef NTSTATUS (NTAPI *sNtSetInformationFile)
/*
* Kernel32 headers
*/
#define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1
#define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
#ifndef FILE_SKIP_COMPLETION_PORT_ON_SUCCESS
# define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1
#endif
#define SYMBOLIC_LINK_FLAG_DIRECTORY 0x1
#ifdef FILE_SKIP_SET_EVENT_ON_HANDLE
# define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
#endif
#ifndef SYMBOLIC_LINK_FLAG_DIRECTORY
# define SYMBOLIC_LINK_FLAG_DIRECTORY 0x1
#endif
#ifdef __MINGW32__
typedef struct _OVERLAPPED_ENTRY {