From: David Galeano Date: Wed, 9 Jan 2013 07:29:00 +0000 (+0800) Subject: Fixed compiler warnings on Windows. X-Git-Tag: accepted/2.0/20130307.220733~325 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=396d68b96488282b45a2d6f974b0e5744c4e477d;p=profile%2Fivi%2Flibwebsockets.git Fixed compiler warnings on Windows. --- diff --git a/lib/handshake.c b/lib/handshake.c index 70fe3a8..fda50b5 100644 --- a/lib/handshake.c +++ b/lib/handshake.c @@ -151,14 +151,14 @@ handshake_00(struct libwebsocket_context *context, struct libwebsocket *wsi) /* lay them out in network byte order (MSB first */ - sum[0] = key1 >> 24; - sum[1] = key1 >> 16; - sum[2] = key1 >> 8; - sum[3] = key1; - sum[4] = key2 >> 24; - sum[5] = key2 >> 16; - sum[6] = key2 >> 8; - sum[7] = key2; + sum[0] = (unsigned char)(key1 >> 24); + sum[1] = (unsigned char)(key1 >> 16); + sum[2] = (unsigned char)(key1 >> 8); + sum[3] = (unsigned char)(key1); + sum[4] = (unsigned char)(key2 >> 24); + sum[5] = (unsigned char)(key2 >> 16); + sum[6] = (unsigned char)(key2 >> 8); + sum[7] = (unsigned char)(key2); /* follow them with the challenge token we were sent */ diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 9912aa5..ef4a3c5 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -22,7 +22,8 @@ #include "private-libwebsockets.h" #ifdef WIN32 - +#include +#include #else #include #include @@ -444,7 +445,9 @@ libwebsockets_get_peer_addresses(int fd, char *name, int name_len, char ip[128]; unsigned char *p; int n; - struct sockaddr_un *un; +#ifdef AF_LOCAL + struct sockaddr_un *un; +#endif rip[0] = '\0'; name[0] = '\0'; @@ -948,7 +951,7 @@ libwebsockets_generate_client_handshake(struct libwebsocket_context *context, p += strlen(wsi->key_b64); p += sprintf(p, "\x0d\x0a"); if (wsi->c_origin) - p += sprintf(p, "Sec-WebSocket-Origin: %s\x0d\x0a", + p += sprintf(p, "Sec-WebSocket-Origin: %s\x0d\x0a", wsi->c_origin); if (wsi->c_protocol) p += sprintf(p, "Sec-WebSocket-Protocol: %s\x0d\x0a", @@ -2557,7 +2560,7 @@ libwebsocket_create_context(int port, const char *interf, poll = emulated_poll; /* if windows socket lib available, use his WSAPoll */ - wsdll = GetModuleHandle("Ws2_32.dll"); + wsdll = GetModuleHandle(_T("Ws2_32.dll")); if (wsdll) poll = (PFNWSAPOLL)GetProcAddress(wsdll, "WSAPoll"); }