summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVic Lee <llyzs@163.com>2009-11-04 23:18:36 +0800
committerJohannes Schindelin <johannes.schindelin@gmx.de>2009-11-10 14:22:59 +0100
commita4cc897222b8cbfb621d27c7c9f070dbbb05def9 (patch)
tree22ab803866eee61ea0982ad6e4963be88e8486f4
parentf49a292783407c14869d811c05c2bbd009af27f7 (diff)
downloadlibvncserver-a4cc897222b8cbfb621d27c7c9f070dbbb05def9.zip
libvncserver-a4cc897222b8cbfb621d27c7c9f070dbbb05def9.tar.gz
Fix various compilation warnings
Signed-off-by: Vic Lee <llyzs@163.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
-rw-r--r--client_examples/ppmtest.c2
-rw-r--r--examples/example.c2
-rw-r--r--libvncclient/sockets.c5
-rw-r--r--libvncclient/zrle.c2
-rw-r--r--libvncserver/cursor.c2
-rw-r--r--libvncserver/tightvnc-filetransfer/rfbtightserver.c2
-rw-r--r--vncterm/VNConsole.c4
7 files changed, 11 insertions, 8 deletions
diff --git a/client_examples/ppmtest.c b/client_examples/ppmtest.c
index dbb5d57..0422937 100644
--- a/client_examples/ppmtest.c
+++ b/client_examples/ppmtest.c
@@ -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);
for(j=0;j<client->height*row_stride;j+=row_stride)
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;
if(bpp==4)
v=*(unsigned int*)p;
diff --git a/examples/example.c b/examples/example.c
index 71548fa..871ab0c 100644
--- a/examples/example.c
+++ b/examples/example.c
@@ -263,7 +263,7 @@ static void MakeRichCursor(rfbScreenInfoPtr rfbScreen)
c=rfbScreen->cursor = rfbMakeXCursor(w,h,bitmap,bitmap);
c->xhot = 16; c->yhot = 24;
- c->richSource = (char*)malloc(w*h*bpp);
+ c->richSource = (unsigned char*)malloc(w*h*bpp);
c->cleanupRichSource = TRUE;
for(j=0;j<h;j++) {
for(i=0;i<w;i++) {
diff --git a/libvncclient/sockets.c b/libvncclient/sockets.c
index 489608f..598dd39 100644
--- a/libvncclient/sockets.c
+++ b/libvncclient/sockets.c
@@ -36,6 +36,7 @@
#define close closesocket
#define read(sock,buf,len) recv(sock,buf,len,0)
#define write(sock,buf,len) send(sock,buf,len,0)
+#define socklen_t int
#else
#include <sys/socket.h>
#include <netinet/in.h>
@@ -457,7 +458,7 @@ AcceptTcpConnection(int listenSock)
{
int sock;
struct sockaddr_in addr;
- int addrlen = sizeof(addr);
+ socklen_t addrlen = sizeof(addr);
int one = 1;
sock = accept(listenSock, (struct sockaddr *) &addr, &addrlen);
@@ -537,7 +538,7 @@ rfbBool
SameMachine(int sock)
{
struct sockaddr_in peeraddr, myaddr;
- int addrlen = sizeof(struct sockaddr_in);
+ socklen_t addrlen = sizeof(struct sockaddr_in);
getpeername(sock, (struct sockaddr *)&peeraddr, &addrlen);
getsockname(sock, (struct sockaddr *)&myaddr, &addrlen);
diff --git a/libvncclient/zrle.c b/libvncclient/zrle.c
index 6ff3008..da2db4b 100644
--- a/libvncclient/zrle.c
+++ b/libvncclient/zrle.c
@@ -239,8 +239,10 @@ static int HandleZRLETile(rfbClient* client,
uint8_t* buffer_copy = buffer;
uint8_t* buffer_end = buffer+buffer_length;
uint8_t type;
+#if BPP!=8
uint8_t zywrle_level = (client->appData.qualityLevel & 0x80) ?
0 : (3 - client->appData.qualityLevel / 3);
+#endif
if(buffer_length<1)
return -2;
diff --git a/libvncserver/cursor.c b/libvncserver/cursor.c
index 154bf11..5e30017 100644
--- a/libvncserver/cursor.c
+++ b/libvncserver/cursor.c
@@ -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) {
if (interp) {
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) {
unsigned char* uc = (unsigned char*) p;
SETRGB(uc);
diff --git a/libvncserver/tightvnc-filetransfer/rfbtightserver.c b/libvncserver/tightvnc-filetransfer/rfbtightserver.c
index ef29514..43f5a9b 100644
--- a/libvncserver/tightvnc-filetransfer/rfbtightserver.c
+++ b/libvncserver/tightvnc-filetransfer/rfbtightserver.c
@@ -355,7 +355,7 @@ rfbSendInteractionCaps(rfbClientPtr cl)
rfbBool
-rfbTightExtensionInit(rfbClientPtr cl, void** data)
+rfbTightExtensionInit(rfbClientPtr cl, void* data)
{
rfbSendInteractionCaps(cl);
diff --git a/vncterm/VNConsole.c b/vncterm/VNConsole.c
index 720a42e..d0757ba 100644
--- a/vncterm/VNConsole.c
+++ b/vncterm/VNConsole.c
@@ -299,7 +299,7 @@ void vcPrintF(vncConsolePtr c,char* format,...)
char buf[4096];
va_start(args, format);
vsprintf(buf, format, args);
- vcPrint(c,buf);
+ vcPrint(c,(unsigned char*)buf);
va_end(args);
}
@@ -309,7 +309,7 @@ void vcPrintFColour(vncConsolePtr c,unsigned char foreColour,unsigned char backC
char buf[4096];
va_start(args, format);
vsprintf(buf, format, args);
- vcPrintColour(c,buf,foreColour,backColour);
+ vcPrintColour(c,(unsigned char*)buf,foreColour,backColour);
va_end(args);
}
OpenPOWER on IntegriCloud