Commit fe1ca16e authored by Christian Beier's avatar Christian Beier

Fix (most) MinGW32 compiler warnings.

parent 56234cd0
......@@ -10,22 +10,22 @@
#define FUNCNAME rfbRotate
#define FUNC(i, j) (h - 1 - j + i * h)
#define SWAPDIMENSIONS
#define OUT 8
#define OUTBITS 8
#include "rotatetemplate.c"
#define OUT 16
#define OUTBITS 16
#include "rotatetemplate.c"
#define OUT 32
#define OUTBITS 32
#include "rotatetemplate.c"
#undef FUNCNAME
#undef FUNC
#define FUNCNAME rfbRotateCounterClockwise
#define FUNC(i, j) (j + (w - 1 - i) * h)
#define OUT 8
#define OUTBITS 8
#include "rotatetemplate.c"
#define OUT 16
#define OUTBITS 16
#include "rotatetemplate.c"
#define OUT 32
#define OUTBITS 32
#include "rotatetemplate.c"
#undef FUNCNAME
#undef FUNC
......@@ -33,33 +33,33 @@
#define FUNCNAME rfbFlipHorizontally
#define FUNC(i, j) ((w - 1 - i) + j * w)
#define OUT 8
#define OUTBITS 8
#include "rotatetemplate.c"
#define OUT 16
#define OUTBITS 16
#include "rotatetemplate.c"
#define OUT 32
#define OUTBITS 32
#include "rotatetemplate.c"
#undef FUNCNAME
#undef FUNC
#define FUNCNAME rfbFlipVertically
#define FUNC(i, j) (i + (h - 1 - j) * w)
#define OUT 8
#define OUTBITS 8
#include "rotatetemplate.c"
#define OUT 16
#define OUTBITS 16
#include "rotatetemplate.c"
#define OUT 32
#define OUTBITS 32
#include "rotatetemplate.c"
#undef FUNCNAME
#undef FUNC
#define FUNCNAME rfbRotateHundredAndEighty
#define FUNC(i, j) ((w - 1 - i) + (h - 1 - j) * w)
#define OUT 8
#define OUTBITS 8
#include "rotatetemplate.c"
#define OUT 16
#define OUTBITS 16
#include "rotatetemplate.c"
#define OUT 32
#define OUTBITS 32
#include "rotatetemplate.c"
#undef FUNCNAME
#undef FUNC
......
#define OUT_T CONCAT3E(uint,OUT,_t)
#define FUNCTION CONCAT2E(FUNCNAME,OUT)
#define OUT_T CONCAT3E(uint,OUTBITS,_t)
#define FUNCTION CONCAT2E(FUNCNAME,OUTBITS)
static void FUNCTION(rfbScreenInfoPtr screen)
{
......@@ -16,7 +16,7 @@ static void FUNCTION(rfbScreenInfoPtr screen)
#ifdef SWAPDIMENSIONS
screen->width = h;
screen->paddedWidthInBytes = h * OUT / 8;
screen->paddedWidthInBytes = h * OUTBITS / 8;
screen->height = w;
{
......@@ -31,7 +31,7 @@ static void FUNCTION(rfbScreenInfoPtr screen)
rfbMarkRectAsModified(screen, 0, 0, screen->width, screen->height);
}
#if OUT == 32
#if OUTBITS == 32
void FUNCNAME(rfbScreenInfoPtr screen) {
if (screen->serverFormat.bitsPerPixel == 32)
CONCAT2E(FUNCNAME,32)(screen);
......@@ -48,5 +48,5 @@ void FUNCNAME(rfbScreenInfoPtr screen) {
#endif
#undef FUNCTION
#undef OUT
#undef OUTBITS
......@@ -99,7 +99,8 @@ static enum rfbNewClientAction newclient(rfbClientPtr cl)
{
char buffer[1024];
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);
ip=ntohl(addr.sin_addr.s_addr);
......
......@@ -29,6 +29,7 @@
#ifdef __MINGW32__
#define close closesocket
#include <winsock2.h>
#undef max
#else
#include <sys/wait.h>
#include <sys/utsname.h>
......
......@@ -1045,7 +1045,9 @@ InitialiseRFBConnection(rfbClient* client)
rfbProtocolVersionMsg pv;
int major,minor;
uint32_t authScheme;
#ifdef LIBVNCSERVER_WITH_CLIENT_TLS
uint32_t subAuthScheme;
#endif
rfbClientInitMsg ci;
/* 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;
int toRead=0;
int inflateResult=0;
int uncompressedBytes = (( rw * rh ) * ( BPP / 8 ));
lzo_uint uncompressedBytes = (( rw * rh ) * ( BPP / 8 ));
if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbZlibHeader))
return FALSE;
......@@ -119,7 +119,7 @@ HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
int toRead=0;
int inflateResult=0;
unsigned char *ptr=NULL;
int uncompressedBytes = ry + (rw * 65535);
lzo_uint uncompressedBytes = ry + (rw * 65535);
unsigned int numCacheRects = rx;
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;
inflateResult = lzo1x_decompress(
(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 )
{
rfbClientLog("ultra decompress returned error: %d\n",
......
......@@ -363,7 +363,7 @@ static int HandleZRLETile(rfbClient* client,
{
return -8;
}
else if( (type >= 130)&&(type <= 255) ) /* palette RLE */
else if( type >= 130 ) /* palette RLE */
{
CARDBPP palette[128];
int i,j;
......
......@@ -1657,7 +1657,7 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
#ifdef LIBVNCSERVER_HAVE_LIBZ
/* compressed packet */
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
/* Write the file out as received... */
retval=write(cl->fileTransfer.fd, buffer, length);
......@@ -3265,7 +3265,7 @@ void
rfbNewUDPConnection(rfbScreenInfoPtr rfbScreen,
int sock)
{
if (write(sock, &ptrAcceleration, 1) < 0) {
if (write(sock, (char*) &ptrAcceleration, 1) < 0) {
rfbLogPerror("rfbNewUDPConnection: write");
}
}
......
......@@ -50,7 +50,7 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
+ (x * (cl->scaledScreen->bitsPerPixel / 8)));
int maxRawSize;
int maxCompSize;
lzo_uint maxCompSize;
maxRawSize = (w * h * (cl->format.bitsPerPixel / 8));
......@@ -92,7 +92,7 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
}
/* 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 */
/* Find the total size of the resulting compressed data. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment