Many Visual C++ compile warnings and errors fixed.

This commit is contained in:
Jan Vidar Krey
2011-01-02 02:39:25 +01:00
parent adb6641a17
commit 9b57279628
20 changed files with 163 additions and 115 deletions

View File

@@ -38,7 +38,7 @@ typedef void (*net_con_backend_init)(struct net_backend*, struct net_connection*
typedef void (*net_con_backend_add)(struct net_backend*, struct net_connection*, int mask);
typedef void (*net_con_backend_mod)(struct net_backend*, struct net_connection*, int mask);
typedef void (*net_con_backend_del)(struct net_backend*,struct net_connection*);
typedef const char* (*net_con_backend_name)(void);
typedef const char* (*net_con_backend_name)();
struct net_backend_handler
{

View File

@@ -34,12 +34,14 @@ static struct net_statistics stats_total;
int net_initialize()
{
#ifdef WINSOCK
struct WSAData wsa;
#endif
if (!net_initialized)
{
LOG_TRACE("Initializing network monitor.");
#ifdef WINSOCK
struct WSAData wsa;
if (WSAStartup(MAKEWORD(2, 2), &wsa) != NO_ERROR)
{
LOG_ERROR("Unable to initialize winsock.");
@@ -528,7 +530,7 @@ const char* net_address_to_string(int af, const void* src, char* dst, socklen_t
return NULL;
}
if (WSAAddressToString(addr, size, NULL, dst, &len) == 0)
if (WSAAddressToStringA(addr, size, NULL, dst, &len) == 0)
{
return dst;
}

View File

@@ -255,7 +255,7 @@ extern int net_stats_timeout();
extern void net_stats_get(struct net_statistics** intermediate, struct net_statistics** total);
#if defined(WINSOCK) && !defined(__CYGWIN__)
#if defined(WINSOCK) && !defined(__CYGWIN__) && !defined(_MSC_VER)
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EINPROGRESS WSAEINPROGRESS

View File

@@ -48,7 +48,8 @@ const char* net_backend_name_select()
int net_backend_poll_select(struct net_backend* data, int ms)
{
int found, res, n;
int res;
size_t n, found;
struct timeval tval;
struct net_backend_select* backend = (struct net_backend_select*) data;

View File

@@ -54,7 +54,7 @@ void timeout_queue_shutdown(struct timeout_queue* t)
size_t timeout_queue_process(struct timeout_queue* t, time_t now)
{
size_t pos = t->last;
size_t pos = (size_t) t->last;
size_t events = 0;
struct timeout_evt* evt = 0;
t->last = now;