diff options
-rw-r--r-- | examples/rotate.c | 30 | ||||
-rw-r--r-- | examples/rotatetemplate.c | 10 | ||||
-rw-r--r-- | examples/vncev.c | 3 | ||||
-rw-r--r-- | libvncclient/listen.c | 1 | ||||
-rw-r--r-- | libvncclient/rfbproto.c | 2 | ||||
-rw-r--r-- | libvncclient/ultra.c | 6 | ||||
-rw-r--r-- | libvncclient/zrle.c | 2 | ||||
-rw-r--r-- | libvncserver/rfbserver.c | 4 | ||||
-rw-r--r-- | libvncserver/ultra.c | 4 |
9 files changed, 33 insertions, 29 deletions
diff --git a/examples/rotate.c b/examples/rotate.c index e552e4a..028de8c 100644 --- a/examples/rotate.c +++ b/examples/rotate.c @@ -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 diff --git a/examples/rotatetemplate.c b/examples/rotatetemplate.c index 57dc052..0d7e007 100644 --- a/examples/rotatetemplate.c +++ b/examples/rotatetemplate.c @@ -1,5 +1,5 @@ -#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 diff --git a/examples/vncev.c b/examples/vncev.c index ba9441a..b185746 100644 --- a/examples/vncev.c +++ b/examples/vncev.c @@ -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); diff --git a/libvncclient/listen.c b/libvncclient/listen.c index 637abb1..58275a0 100644 --- a/libvncclient/listen.c +++ b/libvncclient/listen.c @@ -29,6 +29,7 @@ #ifdef __MINGW32__ #define close closesocket #include <winsock2.h> +#undef max #else #include <sys/wait.h> #include <sys/utsname.h> diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c index dd06ebd..d10e8a6 100644 --- a/libvncclient/rfbproto.c +++ b/libvncclient/rfbproto.c @@ -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 diff --git a/libvncclient/ultra.c b/libvncclient/ultra.c index 3be150d..dddb0c0 100644 --- a/libvncclient/ultra.c +++ b/libvncclient/ultra.c @@ -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", diff --git a/libvncclient/zrle.c b/libvncclient/zrle.c index 16fc091..a14ad44 100644 --- a/libvncclient/zrle.c +++ b/libvncclient/zrle.c @@ -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; diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c index 73be34c..70ae88b 100644 --- a/libvncserver/rfbserver.c +++ b/libvncserver/rfbserver.c @@ -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"); } } diff --git a/libvncserver/ultra.c b/libvncserver/ultra.c index 9a3b14f..47fab55 100644 --- a/libvncserver/ultra.c +++ b/libvncserver/ultra.c @@ -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. */ |