unwarn compilation

pull/1/head
dscho 23 years ago
parent fde8958dc5
commit 598c460ceb

@ -2,7 +2,7 @@ INCLUDES=-I.
VNCSERVERLIB=-L. -lvncserver -L/usr/local/lib -lz -ljpeg VNCSERVERLIB=-L. -lvncserver -L/usr/local/lib -lz -ljpeg
# for Solaris # for Solaris
#CC=gcc CC=gcc
#EXTRALIBS=-lsocket -lnsl -L/usr/X/lib #EXTRALIBS=-lsocket -lnsl -L/usr/X/lib
# for FreeBSD # for FreeBSD
@ -16,7 +16,7 @@ VNCSERVERLIB=-L. -lvncserver -L/usr/local/lib -lz -ljpeg
# The code for 3 Bytes/Pixel is not very efficient! # The code for 3 Bytes/Pixel is not very efficient!
FLAG24 = -DALLOW24BPP FLAG24 = -DALLOW24BPP
OPTFLAGS=-g -Wall OPTFLAGS=-g -Wall -pedantic
#OPTFLAGS=-O2 -Wall #OPTFLAGS=-O2 -Wall
CFLAGS=$(OPTFLAGS) $(PTHREADDEF) $(FLAG24) $(INCLUDES) $(EXTRAINCLUDES) -DBACKCHANNEL CFLAGS=$(OPTFLAGS) $(PTHREADDEF) $(FLAG24) $(INCLUDES) $(EXTRAINCLUDES) -DBACKCHANNEL
RANLIB=ranlib RANLIB=ranlib

@ -84,7 +84,7 @@ rfbAuthProcessClientMessage(cl)
return; return;
} }
if(!cl->screen->passwordCheck(cl,response,CHALLENGESIZE)) { if(!cl->screen->passwordCheck(cl,(const char*)response,CHALLENGESIZE)) {
rfbLog("rfbAuthProcessClientMessage: password check failed\n"); rfbLog("rfbAuthProcessClientMessage: password check failed\n");
authResult = Swap32IfLE(rfbVncAuthFailed); authResult = Swap32IfLE(rfbVncAuthFailed);
if (WriteExact(cl, (char *)&authResult, 4) < 0) { if (WriteExact(cl, (char *)&authResult, 4) < 0) {

@ -143,7 +143,7 @@ rfbSendCursorShape(cl)
bpp2=cl->format.bitsPerPixel/8; bpp2=cl->format.bitsPerPixel/8;
(*cl->translateFn)(cl->translateLookupTable, (*cl->translateFn)(cl->translateLookupTable,
&(cl->screen->rfbServerFormat), &(cl->screen->rfbServerFormat),
&cl->format, pCursor->richSource, &cl->format, (char*)pCursor->richSource,
&cl->updateBuf[cl->ublen], &cl->updateBuf[cl->ublen],
pCursor->width*bpp1, pCursor->width, pCursor->height); pCursor->width*bpp1, pCursor->width, pCursor->height);
@ -241,7 +241,7 @@ rfbCursorPtr rfbMakeXCursor(int width,int height,char* cursorString,char* maskSt
for(i=0,bit=0x80;i<width;i++,bit=(bit&1)?0x80:bit>>1,cp++) for(i=0,bit=0x80;i<width;i++,bit=(bit&1)?0x80:bit>>1,cp++)
if(*cp!=' ') cursor->mask[j*w+i/8]|=bit; if(*cp!=' ') cursor->mask[j*w+i/8]|=bit;
} else } else
cursor->mask = (unsigned char*)rfbMakeMaskForXCursor(width,height,cursor->source); cursor->mask = (unsigned char*)rfbMakeMaskForXCursor(width,height,(char*)cursor->source);
return(cursor); return(cursor);
} }

@ -79,14 +79,14 @@ enum rfbNewClientAction newclient(rfbClientPtr cl)
void newframebuffer(rfbScreenInfoPtr screen, int width, int height) void newframebuffer(rfbScreenInfoPtr screen, int width, int height)
{ {
char *oldfb, *newfb; unsigned char *oldfb, *newfb;
maxx = width; maxx = width;
maxy = height; maxy = height;
oldfb = screen->frameBuffer; oldfb = (unsigned char*)screen->frameBuffer;
newfb = (char*)malloc(maxx * maxy * bpp); newfb = (unsigned char*)malloc(maxx * maxy * bpp);
initBuffer(newfb); initBuffer(newfb);
rfbNewFramebuffer(screen, newfb, maxx, maxy, 8, 3, bpp); rfbNewFramebuffer(screen, (char*)newfb, maxx, maxy, 8, 3, bpp);
free(oldfb); free(oldfb);
/*** FIXME: Re-install cursor. ***/ /*** FIXME: Re-install cursor. ***/
@ -133,7 +133,7 @@ void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
int i,j,x1,x2,y1,y2; int i,j,x1,x2,y1,y2;
if(cd->oldButton==buttonMask) { /* draw a line */ if(cd->oldButton==buttonMask) { /* draw a line */
drawline(cl->screen->frameBuffer,cl->screen->paddedWidthInBytes,bpp, drawline((unsigned char*)cl->screen->frameBuffer,cl->screen->paddedWidthInBytes,bpp,
x,y,cd->oldx,cd->oldy); x,y,cd->oldx,cd->oldy);
rfbMarkRectAsModified(cl->screen,x,y,cd->oldx,cd->oldy); rfbMarkRectAsModified(cl->screen,x,y,cd->oldx,cd->oldy);
} else { /* draw a point (diameter depends on button) */ } else { /* draw a point (diameter depends on button) */
@ -174,7 +174,7 @@ void dokey(Bool down,KeySym key,rfbClientPtr cl)
else if(key==XK_Page_Up) { else if(key==XK_Page_Up) {
if(cl->screen->cursorIsDrawn) if(cl->screen->cursorIsDrawn)
rfbUndrawCursor(cl->screen); rfbUndrawCursor(cl->screen);
initBuffer(cl->screen->frameBuffer); initBuffer((unsigned char*)cl->screen->frameBuffer);
rfbMarkRectAsModified(cl->screen,0,0,maxx,maxy); rfbMarkRectAsModified(cl->screen,0,0,maxx,maxy);
} else if (key == XK_Up) { } else if (key == XK_Up) {
if (maxx < 1024) { if (maxx < 1024) {
@ -283,7 +283,7 @@ int main(int argc,char** argv)
rfbScreen->newClientHook = newclient; rfbScreen->newClientHook = newclient;
rfbScreen->httpDir = "./classes"; rfbScreen->httpDir = "./classes";
initBuffer(rfbScreen->frameBuffer); initBuffer((unsigned char*)rfbScreen->frameBuffer);
rfbDrawString(rfbScreen,&radonFont,20,100,"Hello, World!",0xffffff); rfbDrawString(rfbScreen,&radonFont,20,100,"Hello, World!",0xffffff);
/* This call creates a mask and then a cursor: */ /* This call creates a mask and then a cursor: */

@ -22,6 +22,7 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef WIN32 #ifdef WIN32
#include <winsock.h> #include <winsock.h>
@ -68,7 +69,6 @@ FILE* httpFP = NULL;
static char buf[BUF_SIZE]; static char buf[BUF_SIZE];
static size_t buf_filled=0; static size_t buf_filled=0;
/* /*
* httpInitSockets sets up the TCP socket to listen for HTTP connections. * httpInitSockets sets up the TCP socket to listen for HTTP connections.
*/ */
@ -303,7 +303,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
/* Open the file */ /* Open the file */
if ((fd = fopen(fullFname, "r")) <= 0) { if ((fd = fopen(fullFname, "r")) == 0) {
rfbLogPerror("httpProcessInput: open"); rfbLogPerror("httpProcessInput: open");
WriteExact(&cl, NOT_FOUND_STR, strlen(NOT_FOUND_STR)); WriteExact(&cl, NOT_FOUND_STR, strlen(NOT_FOUND_STR));
httpCloseSock(rfbScreen); httpCloseSock(rfbScreen);

@ -32,7 +32,9 @@
#include "rfb.h" #include "rfb.h"
#include "sraRegion.h" #include "sraRegion.h"
#ifdef HAVE_PTHREADS
MUTEX(logMutex); MUTEX(logMutex);
#endif
int rfbEnableLogging=1; int rfbEnableLogging=1;
@ -380,11 +382,11 @@ void defaultSetXCutText(char* text, int len, rfbClientPtr cl)
/* TODO: add a nice VNC or RFB cursor */ /* TODO: add a nice VNC or RFB cursor */
#if defined(WIN32) || defined(sparc) #if defined(WIN32) || defined(sparc) || !defined(NO_STRICT_ANSI)
static rfbCursor myCursor = static rfbCursor myCursor =
{ {
"\000\102\044\030\044\102\000", (unsigned char*)"\000\102\044\030\044\102\000",
"\347\347\176\074\176\347\347", (unsigned char*)"\347\347\176\074\176\347\347",
8, 7, 3, 3, 8, 7, 3, 3,
0, 0, 0, 0, 0, 0,
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,

@ -12,7 +12,7 @@ int main(int argc,char** argv)
{ {
FILE* in=stdin; FILE* in=stdin;
int i,j,k,width,height,paddedWidth; int i,j,k,width,height,paddedWidth;
unsigned char buffer[1024]; char buffer[1024];
rfbScreenInfoPtr rfbScreen; rfbScreenInfoPtr rfbScreen;
if(argc>1) { if(argc>1) {

13
rfb.h

@ -45,12 +45,9 @@ typedef CARD32 Pixel;
/* typedef CARD32 KeySym; */ /* typedef CARD32 KeySym; */
typedef unsigned long KeySym; typedef unsigned long KeySym;
#define SIGNED signed #define SIGNED signed
/* for some strange reason, "typedef signed char Bool;" yields a four byte
signed int on IRIX, but only for rfbserver.o!!! */ typedef signed char Bool;
#ifdef Bool
#undef Bool
#endif
#define Bool signed char
#undef FALSE #undef FALSE
#define FALSE 0 #define FALSE 0
#undef TRUE #undef TRUE
@ -90,6 +87,10 @@ typedef unsigned long KeySym;
#include <sys/endian.h> #include <sys/endian.h>
#endif #endif
#ifdef __sgi__
typedef int socklen_t;
#endif
#ifndef _BYTE_ORDER #ifndef _BYTE_ORDER
#define _BYTE_ORDER __BYTE_ORDER #define _BYTE_ORDER __BYTE_ORDER
#endif #endif

@ -25,6 +25,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include "rfb.h" #include "rfb.h"
#include "sraRegion.h" #include "sraRegion.h"
#ifdef WIN32 #ifdef WIN32
@ -76,7 +77,9 @@ void rfbIncrClientRef(rfbClientPtr cl) {}
void rfbDecrClientRef(rfbClientPtr cl) {} void rfbDecrClientRef(rfbClientPtr cl) {}
#endif #endif
#ifdef HAVE_PTHREADS
MUTEX(rfbClientListMutex); MUTEX(rfbClientListMutex);
#endif
struct rfbClientIterator { struct rfbClientIterator {
rfbClientPtr next; rfbClientPtr next;
@ -86,6 +89,11 @@ struct rfbClientIterator {
void void
rfbClientListInit(rfbScreenInfoPtr rfbScreen) rfbClientListInit(rfbScreenInfoPtr rfbScreen)
{ {
if(sizeof(Bool)!=1) {
/* a sanity check */
fprintf(stderr,"Bool's size is not 1 (%d)!\n",sizeof(Bool));
exit(1);
}
rfbScreen->rfbClientHead = NULL; rfbScreen->rfbClientHead = NULL;
INIT_MUTEX(rfbClientListMutex); INIT_MUTEX(rfbClientListMutex);
} }

@ -429,12 +429,7 @@ ExtendSolidArea(cl, x, y, w, h, colorValue, x_ptr, y_ptr, w_ptr, h_ptr)
*w_ptr += cx - (*x_ptr + *w_ptr); *w_ptr += cx - (*x_ptr + *w_ptr);
} }
static Bool static Bool CheckSolidTile(rfbClientPtr cl, int x, int y, int w, int h, CARD32* colorPtr, Bool needSameColor)
CheckSolidTile(cl, x, y, w, h, colorPtr, needSameColor)
rfbClientPtr cl;
int x, y, w, h;
CARD32 *colorPtr;
Bool needSameColor;
{ {
switch(cl->screen->rfbServerFormat.bitsPerPixel) { switch(cl->screen->rfbServerFormat.bitsPerPixel) {
case 32: case 32:
@ -449,11 +444,7 @@ CheckSolidTile(cl, x, y, w, h, colorPtr, needSameColor)
#define DEFINE_CHECK_SOLID_FUNCTION(bpp) \ #define DEFINE_CHECK_SOLID_FUNCTION(bpp) \
\ \
static Bool \ static Bool \
CheckSolidTile##bpp(cl, x, y, w, h, colorPtr, needSameColor) \ CheckSolidTile##bpp(rfbClientPtr cl, int x, int y, int w, int h, CARD32* colorPtr, Bool needSameColor) \
rfbClientPtr cl; \
int x, y, w, h; \
CARD32 *colorPtr; \
Bool needSameColor; \
{ \ { \
CARD##bpp *fbptr; \ CARD##bpp *fbptr; \
CARD##bpp colorValue; \ CARD##bpp colorValue; \

@ -24,6 +24,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <time.h> #include <time.h>

Loading…
Cancel
Save