Commit a4cc8972 authored by Vic Lee's avatar Vic Lee Committed by Johannes Schindelin

Fix various compilation warnings

Signed-off-by: 's avatarVic Lee <llyzs@163.com>
Signed-off-by: 's avatarJohannes Schindelin <johannes.schindelin@gmx.de>
parent f49a2927
...@@ -40,7 +40,7 @@ static void SaveFramebufferAsPPM(rfbClient* client, int x, int y, int w, int h) ...@@ -40,7 +40,7 @@ static void SaveFramebufferAsPPM(rfbClient* client, int x, int y, int w, int h)
fprintf(f,"P6\n# %s\n%d %d\n255\n",client->desktopName,client->width,client->height); fprintf(f,"P6\n# %s\n%d %d\n255\n",client->desktopName,client->width,client->height);
for(j=0;j<client->height*row_stride;j+=row_stride) for(j=0;j<client->height*row_stride;j+=row_stride)
for(i=0;i<client->width*bpp;i+=bpp) { for(i=0;i<client->width*bpp;i+=bpp) {
const char* p=client->frameBuffer+j+i; unsigned char* p=client->frameBuffer+j+i;
unsigned int v; unsigned int v;
if(bpp==4) if(bpp==4)
v=*(unsigned int*)p; v=*(unsigned int*)p;
......
...@@ -263,7 +263,7 @@ static void MakeRichCursor(rfbScreenInfoPtr rfbScreen) ...@@ -263,7 +263,7 @@ static void MakeRichCursor(rfbScreenInfoPtr rfbScreen)
c=rfbScreen->cursor = rfbMakeXCursor(w,h,bitmap,bitmap); c=rfbScreen->cursor = rfbMakeXCursor(w,h,bitmap,bitmap);
c->xhot = 16; c->yhot = 24; c->xhot = 16; c->yhot = 24;
c->richSource = (char*)malloc(w*h*bpp); c->richSource = (unsigned char*)malloc(w*h*bpp);
c->cleanupRichSource = TRUE; c->cleanupRichSource = TRUE;
for(j=0;j<h;j++) { for(j=0;j<h;j++) {
for(i=0;i<w;i++) { for(i=0;i<w;i++) {
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#define close closesocket #define close closesocket
#define read(sock,buf,len) recv(sock,buf,len,0) #define read(sock,buf,len) recv(sock,buf,len,0)
#define write(sock,buf,len) send(sock,buf,len,0) #define write(sock,buf,len) send(sock,buf,len,0)
#define socklen_t int
#else #else
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
...@@ -457,7 +458,7 @@ AcceptTcpConnection(int listenSock) ...@@ -457,7 +458,7 @@ AcceptTcpConnection(int listenSock)
{ {
int sock; int sock;
struct sockaddr_in addr; struct sockaddr_in addr;
int addrlen = sizeof(addr); socklen_t addrlen = sizeof(addr);
int one = 1; int one = 1;
sock = accept(listenSock, (struct sockaddr *) &addr, &addrlen); sock = accept(listenSock, (struct sockaddr *) &addr, &addrlen);
...@@ -537,7 +538,7 @@ rfbBool ...@@ -537,7 +538,7 @@ rfbBool
SameMachine(int sock) SameMachine(int sock)
{ {
struct sockaddr_in peeraddr, myaddr; struct sockaddr_in peeraddr, myaddr;
int addrlen = sizeof(struct sockaddr_in); socklen_t addrlen = sizeof(struct sockaddr_in);
getpeername(sock, (struct sockaddr *)&peeraddr, &addrlen); getpeername(sock, (struct sockaddr *)&peeraddr, &addrlen);
getsockname(sock, (struct sockaddr *)&myaddr, &addrlen); getsockname(sock, (struct sockaddr *)&myaddr, &addrlen);
......
...@@ -239,8 +239,10 @@ static int HandleZRLETile(rfbClient* client, ...@@ -239,8 +239,10 @@ static int HandleZRLETile(rfbClient* client,
uint8_t* buffer_copy = buffer; uint8_t* buffer_copy = buffer;
uint8_t* buffer_end = buffer+buffer_length; uint8_t* buffer_end = buffer+buffer_length;
uint8_t type; uint8_t type;
#if BPP!=8
uint8_t zywrle_level = (client->appData.qualityLevel & 0x80) ? uint8_t zywrle_level = (client->appData.qualityLevel & 0x80) ?
0 : (3 - client->appData.qualityLevel / 3); 0 : (3 - client->appData.qualityLevel / 3);
#endif
if(buffer_length<1) if(buffer_length<1)
return -2; return -2;
......
...@@ -410,7 +410,7 @@ void rfbMakeXCursorFromRichCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor ...@@ -410,7 +410,7 @@ void rfbMakeXCursorFromRichCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr cursor
for(i=0,bit=0x80;i<cursor->width;i++,bit=(bit&1)?0x80:bit>>1) { for(i=0,bit=0x80;i<cursor->width;i++,bit=(bit&1)?0x80:bit>>1) {
if (interp) { if (interp) {
int r = 0, g = 0, b = 0, grey; int r = 0, g = 0, b = 0, grey;
char *p = cursor->richSource+j*width+i*bpp; unsigned char *p = cursor->richSource+j*width+i*bpp;
if (bpp == 1) { if (bpp == 1) {
unsigned char* uc = (unsigned char*) p; unsigned char* uc = (unsigned char*) p;
SETRGB(uc); SETRGB(uc);
......
...@@ -355,7 +355,7 @@ rfbSendInteractionCaps(rfbClientPtr cl) ...@@ -355,7 +355,7 @@ rfbSendInteractionCaps(rfbClientPtr cl)
rfbBool rfbBool
rfbTightExtensionInit(rfbClientPtr cl, void** data) rfbTightExtensionInit(rfbClientPtr cl, void* data)
{ {
rfbSendInteractionCaps(cl); rfbSendInteractionCaps(cl);
......
...@@ -299,7 +299,7 @@ void vcPrintF(vncConsolePtr c,char* format,...) ...@@ -299,7 +299,7 @@ void vcPrintF(vncConsolePtr c,char* format,...)
char buf[4096]; char buf[4096];
va_start(args, format); va_start(args, format);
vsprintf(buf, format, args); vsprintf(buf, format, args);
vcPrint(c,buf); vcPrint(c,(unsigned char*)buf);
va_end(args); va_end(args);
} }
...@@ -309,7 +309,7 @@ void vcPrintFColour(vncConsolePtr c,unsigned char foreColour,unsigned char backC ...@@ -309,7 +309,7 @@ void vcPrintFColour(vncConsolePtr c,unsigned char foreColour,unsigned char backC
char buf[4096]; char buf[4096];
va_start(args, format); va_start(args, format);
vsprintf(buf, format, args); vsprintf(buf, format, args);
vcPrintColour(c,buf,foreColour,backColour); vcPrintColour(c,(unsigned char*)buf,foreColour,backColour);
va_end(args); va_end(args);
} }
......
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