Fix (most) MinGW32 compiler warnings.

pull/1/head
Christian Beier 13 years ago
parent 56234cd0b6
commit fe1ca16e9b

@ -10,22 +10,22 @@
#define FUNCNAME rfbRotate #define FUNCNAME rfbRotate
#define FUNC(i, j) (h - 1 - j + i * h) #define FUNC(i, j) (h - 1 - j + i * h)
#define SWAPDIMENSIONS #define SWAPDIMENSIONS
#define OUT 8 #define OUTBITS 8
#include "rotatetemplate.c" #include "rotatetemplate.c"
#define OUT 16 #define OUTBITS 16
#include "rotatetemplate.c" #include "rotatetemplate.c"
#define OUT 32 #define OUTBITS 32
#include "rotatetemplate.c" #include "rotatetemplate.c"
#undef FUNCNAME #undef FUNCNAME
#undef FUNC #undef FUNC
#define FUNCNAME rfbRotateCounterClockwise #define FUNCNAME rfbRotateCounterClockwise
#define FUNC(i, j) (j + (w - 1 - i) * h) #define FUNC(i, j) (j + (w - 1 - i) * h)
#define OUT 8 #define OUTBITS 8
#include "rotatetemplate.c" #include "rotatetemplate.c"
#define OUT 16 #define OUTBITS 16
#include "rotatetemplate.c" #include "rotatetemplate.c"
#define OUT 32 #define OUTBITS 32
#include "rotatetemplate.c" #include "rotatetemplate.c"
#undef FUNCNAME #undef FUNCNAME
#undef FUNC #undef FUNC
@ -33,33 +33,33 @@
#define FUNCNAME rfbFlipHorizontally #define FUNCNAME rfbFlipHorizontally
#define FUNC(i, j) ((w - 1 - i) + j * w) #define FUNC(i, j) ((w - 1 - i) + j * w)
#define OUT 8 #define OUTBITS 8
#include "rotatetemplate.c" #include "rotatetemplate.c"
#define OUT 16 #define OUTBITS 16
#include "rotatetemplate.c" #include "rotatetemplate.c"
#define OUT 32 #define OUTBITS 32
#include "rotatetemplate.c" #include "rotatetemplate.c"
#undef FUNCNAME #undef FUNCNAME
#undef FUNC #undef FUNC
#define FUNCNAME rfbFlipVertically #define FUNCNAME rfbFlipVertically
#define FUNC(i, j) (i + (h - 1 - j) * w) #define FUNC(i, j) (i + (h - 1 - j) * w)
#define OUT 8 #define OUTBITS 8
#include "rotatetemplate.c" #include "rotatetemplate.c"
#define OUT 16 #define OUTBITS 16
#include "rotatetemplate.c" #include "rotatetemplate.c"
#define OUT 32 #define OUTBITS 32
#include "rotatetemplate.c" #include "rotatetemplate.c"
#undef FUNCNAME #undef FUNCNAME
#undef FUNC #undef FUNC
#define FUNCNAME rfbRotateHundredAndEighty #define FUNCNAME rfbRotateHundredAndEighty
#define FUNC(i, j) ((w - 1 - i) + (h - 1 - j) * w) #define FUNC(i, j) ((w - 1 - i) + (h - 1 - j) * w)
#define OUT 8 #define OUTBITS 8
#include "rotatetemplate.c" #include "rotatetemplate.c"
#define OUT 16 #define OUTBITS 16
#include "rotatetemplate.c" #include "rotatetemplate.c"
#define OUT 32 #define OUTBITS 32
#include "rotatetemplate.c" #include "rotatetemplate.c"
#undef FUNCNAME #undef FUNCNAME
#undef FUNC #undef FUNC

@ -1,5 +1,5 @@
#define OUT_T CONCAT3E(uint,OUT,_t) #define OUT_T CONCAT3E(uint,OUTBITS,_t)
#define FUNCTION CONCAT2E(FUNCNAME,OUT) #define FUNCTION CONCAT2E(FUNCNAME,OUTBITS)
static void FUNCTION(rfbScreenInfoPtr screen) static void FUNCTION(rfbScreenInfoPtr screen)
{ {
@ -16,7 +16,7 @@ static void FUNCTION(rfbScreenInfoPtr screen)
#ifdef SWAPDIMENSIONS #ifdef SWAPDIMENSIONS
screen->width = h; screen->width = h;
screen->paddedWidthInBytes = h * OUT / 8; screen->paddedWidthInBytes = h * OUTBITS / 8;
screen->height = w; screen->height = w;
{ {
@ -31,7 +31,7 @@ static void FUNCTION(rfbScreenInfoPtr screen)
rfbMarkRectAsModified(screen, 0, 0, screen->width, screen->height); rfbMarkRectAsModified(screen, 0, 0, screen->width, screen->height);
} }
#if OUT == 32 #if OUTBITS == 32
void FUNCNAME(rfbScreenInfoPtr screen) { void FUNCNAME(rfbScreenInfoPtr screen) {
if (screen->serverFormat.bitsPerPixel == 32) if (screen->serverFormat.bitsPerPixel == 32)
CONCAT2E(FUNCNAME,32)(screen); CONCAT2E(FUNCNAME,32)(screen);
@ -48,5 +48,5 @@ void FUNCNAME(rfbScreenInfoPtr screen) {
#endif #endif
#undef FUNCTION #undef FUNCTION
#undef OUT #undef OUTBITS

@ -99,7 +99,8 @@ static enum rfbNewClientAction newclient(rfbClientPtr cl)
{ {
char buffer[1024]; char buffer[1024];
struct sockaddr_in addr; struct sockaddr_in addr;
unsigned int len=sizeof(addr),ip; socklen_t len=sizeof(addr);
unsigned int ip;
getpeername(cl->sock,(struct sockaddr*)&addr,&len); getpeername(cl->sock,(struct sockaddr*)&addr,&len);
ip=ntohl(addr.sin_addr.s_addr); ip=ntohl(addr.sin_addr.s_addr);

@ -29,6 +29,7 @@
#ifdef __MINGW32__ #ifdef __MINGW32__
#define close closesocket #define close closesocket
#include <winsock2.h> #include <winsock2.h>
#undef max
#else #else
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/utsname.h> #include <sys/utsname.h>

@ -1045,7 +1045,9 @@ InitialiseRFBConnection(rfbClient* client)
rfbProtocolVersionMsg pv; rfbProtocolVersionMsg pv;
int major,minor; int major,minor;
uint32_t authScheme; uint32_t authScheme;
#ifdef LIBVNCSERVER_WITH_CLIENT_TLS
uint32_t subAuthScheme; uint32_t subAuthScheme;
#endif
rfbClientInitMsg ci; rfbClientInitMsg ci;
/* if the connection is immediately closed, don't report anything, so /* if the connection is immediately closed, don't report anything, so

@ -37,7 +37,7 @@ HandleUltraBPP (rfbClient* client, int rx, int ry, int rw, int rh)
rfbZlibHeader hdr; rfbZlibHeader hdr;
int toRead=0; int toRead=0;
int inflateResult=0; int inflateResult=0;
int uncompressedBytes = (( rw * rh ) * ( BPP / 8 )); lzo_uint uncompressedBytes = (( rw * rh ) * ( BPP / 8 ));
if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbZlibHeader)) if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbZlibHeader))
return FALSE; return FALSE;
@ -119,7 +119,7 @@ HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
int toRead=0; int toRead=0;
int inflateResult=0; int inflateResult=0;
unsigned char *ptr=NULL; unsigned char *ptr=NULL;
int uncompressedBytes = ry + (rw * 65535); lzo_uint uncompressedBytes = ry + (rw * 65535);
unsigned int numCacheRects = rx; unsigned int numCacheRects = rx;
if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbZlibHeader)) if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbZlibHeader))
@ -170,7 +170,7 @@ HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
uncompressedBytes = client->raw_buffer_size; uncompressedBytes = client->raw_buffer_size;
inflateResult = lzo1x_decompress( inflateResult = lzo1x_decompress(
(lzo_byte *)client->ultra_buffer, toRead, (lzo_byte *)client->ultra_buffer, toRead,
(lzo_byte *)client->raw_buffer, (lzo_uintp) &uncompressedBytes, NULL); (lzo_byte *)client->raw_buffer, &uncompressedBytes, NULL);
if ( inflateResult != LZO_E_OK ) if ( inflateResult != LZO_E_OK )
{ {
rfbClientLog("ultra decompress returned error: %d\n", rfbClientLog("ultra decompress returned error: %d\n",

@ -363,7 +363,7 @@ static int HandleZRLETile(rfbClient* client,
{ {
return -8; return -8;
} }
else if( (type >= 130)&&(type <= 255) ) /* palette RLE */ else if( type >= 130 ) /* palette RLE */
{ {
CARDBPP palette[128]; CARDBPP palette[128];
int i,j; int i,j;

@ -1657,7 +1657,7 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
#ifdef LIBVNCSERVER_HAVE_LIBZ #ifdef LIBVNCSERVER_HAVE_LIBZ
/* compressed packet */ /* compressed packet */
nRet = uncompress(compBuff,&nRawBytes,(const unsigned char*)buffer, length); nRet = uncompress(compBuff,&nRawBytes,(const unsigned char*)buffer, length);
retval=write(cl->fileTransfer.fd, compBuff, nRawBytes); retval=write(cl->fileTransfer.fd, (char*)compBuff, nRawBytes);
#else #else
/* Write the file out as received... */ /* Write the file out as received... */
retval=write(cl->fileTransfer.fd, buffer, length); retval=write(cl->fileTransfer.fd, buffer, length);
@ -3265,7 +3265,7 @@ void
rfbNewUDPConnection(rfbScreenInfoPtr rfbScreen, rfbNewUDPConnection(rfbScreenInfoPtr rfbScreen,
int sock) int sock)
{ {
if (write(sock, &ptrAcceleration, 1) < 0) { if (write(sock, (char*) &ptrAcceleration, 1) < 0) {
rfbLogPerror("rfbNewUDPConnection: write"); rfbLogPerror("rfbNewUDPConnection: write");
} }
} }

@ -50,7 +50,7 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
+ (x * (cl->scaledScreen->bitsPerPixel / 8))); + (x * (cl->scaledScreen->bitsPerPixel / 8)));
int maxRawSize; int maxRawSize;
int maxCompSize; lzo_uint maxCompSize;
maxRawSize = (w * h * (cl->format.bitsPerPixel / 8)); maxRawSize = (w * h * (cl->format.bitsPerPixel / 8));
@ -92,7 +92,7 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
} }
/* Perform the compression here. */ /* Perform the compression here. */
deflateResult = lzo1x_1_compress((unsigned char *)cl->beforeEncBuf, (lzo_uint)(w * h * (cl->format.bitsPerPixel / 8)), (unsigned char *)cl->afterEncBuf, (lzo_uint *)&maxCompSize, cl->lzoWrkMem); deflateResult = lzo1x_1_compress((unsigned char *)cl->beforeEncBuf, (lzo_uint)(w * h * (cl->format.bitsPerPixel / 8)), (unsigned char *)cl->afterEncBuf, &maxCompSize, cl->lzoWrkMem);
/* maxCompSize now contains the compressed size */ /* maxCompSize now contains the compressed size */
/* Find the total size of the resulting compressed data. */ /* Find the total size of the resulting compressed data. */

Loading…
Cancel
Save