Fix various compilation warnings

Signed-off-by: Vic Lee <llyzs@163.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
pull/1/head
Vic Lee 13 years ago committed by Johannes Schindelin
parent f49a292783
commit a4cc897222

@ -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;

@ -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++) {

@ -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);

@ -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;

@ -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);

@ -355,7 +355,7 @@ rfbSendInteractionCaps(rfbClientPtr cl)
rfbBool
rfbTightExtensionInit(rfbClientPtr cl, void** data)
rfbTightExtensionInit(rfbClientPtr cl, void* data)
{
rfbSendInteractionCaps(cl);

@ -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);
}

Loading…
Cancel
Save