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
# for Solaris
#CC=gcc
CC=gcc
#EXTRALIBS=-lsocket -lnsl -L/usr/X/lib
# 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!
FLAG24 = -DALLOW24BPP
OPTFLAGS=-g -Wall
OPTFLAGS=-g -Wall -pedantic
#OPTFLAGS=-O2 -Wall
CFLAGS=$(OPTFLAGS) $(PTHREADDEF) $(FLAG24) $(INCLUDES) $(EXTRAINCLUDES) -DBACKCHANNEL
RANLIB=ranlib

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

@ -143,7 +143,7 @@ rfbSendCursorShape(cl)
bpp2=cl->format.bitsPerPixel/8;
(*cl->translateFn)(cl->translateLookupTable,
&(cl->screen->rfbServerFormat),
&cl->format, pCursor->richSource,
&cl->format, (char*)pCursor->richSource,
&cl->updateBuf[cl->ublen],
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++)
if(*cp!=' ') cursor->mask[j*w+i/8]|=bit;
} else
cursor->mask = (unsigned char*)rfbMakeMaskForXCursor(width,height,cursor->source);
cursor->mask = (unsigned char*)rfbMakeMaskForXCursor(width,height,(char*)cursor->source);
return(cursor);
}

@ -79,14 +79,14 @@ enum rfbNewClientAction newclient(rfbClientPtr cl)
void newframebuffer(rfbScreenInfoPtr screen, int width, int height)
{
char *oldfb, *newfb;
unsigned char *oldfb, *newfb;
maxx = width;
maxy = height;
oldfb = screen->frameBuffer;
newfb = (char*)malloc(maxx * maxy * bpp);
oldfb = (unsigned char*)screen->frameBuffer;
newfb = (unsigned char*)malloc(maxx * maxy * bpp);
initBuffer(newfb);
rfbNewFramebuffer(screen, newfb, maxx, maxy, 8, 3, bpp);
rfbNewFramebuffer(screen, (char*)newfb, maxx, maxy, 8, 3, bpp);
free(oldfb);
/*** 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;
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);
rfbMarkRectAsModified(cl->screen,x,y,cd->oldx,cd->oldy);
} 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) {
if(cl->screen->cursorIsDrawn)
rfbUndrawCursor(cl->screen);
initBuffer(cl->screen->frameBuffer);
initBuffer((unsigned char*)cl->screen->frameBuffer);
rfbMarkRectAsModified(cl->screen,0,0,maxx,maxy);
} else if (key == XK_Up) {
if (maxx < 1024) {
@ -283,7 +283,7 @@ int main(int argc,char** argv)
rfbScreen->newClientHook = newclient;
rfbScreen->httpDir = "./classes";
initBuffer(rfbScreen->frameBuffer);
initBuffer((unsigned char*)rfbScreen->frameBuffer);
rfbDrawString(rfbScreen,&radonFont,20,100,"Hello, World!",0xffffff);
/* This call creates a mask and then a cursor: */

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

@ -32,7 +32,9 @@
#include "rfb.h"
#include "sraRegion.h"
#ifdef HAVE_PTHREADS
MUTEX(logMutex);
#endif
int rfbEnableLogging=1;
@ -380,11 +382,11 @@ void defaultSetXCutText(char* text, int len, rfbClientPtr cl)
/* 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 =
{
"\000\102\044\030\044\102\000",
"\347\347\176\074\176\347\347",
(unsigned char*)"\000\102\044\030\044\102\000",
(unsigned char*)"\347\347\176\074\176\347\347",
8, 7, 3, 3,
0, 0, 0,
0xffff, 0xffff, 0xffff,

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

13
rfb.h

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

@ -25,6 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "rfb.h"
#include "sraRegion.h"
#ifdef WIN32
@ -76,7 +77,9 @@ void rfbIncrClientRef(rfbClientPtr cl) {}
void rfbDecrClientRef(rfbClientPtr cl) {}
#endif
#ifdef HAVE_PTHREADS
MUTEX(rfbClientListMutex);
#endif
struct rfbClientIterator {
rfbClientPtr next;
@ -86,6 +89,11 @@ struct rfbClientIterator {
void
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;
INIT_MUTEX(rfbClientListMutex);
}

File diff suppressed because it is too large Load Diff

@ -1,60 +1,60 @@
#ifndef SRAREGION_H
#define SRAREGION_H
/* -=- SRA - Simple Region Algorithm
* A simple rectangular region implementation.
* Copyright (c) 2001 James "Wez" Weatherall, Johannes E. Schindelin
*/
/* -=- sraRect */
typedef struct _rect {
int x1;
int y1;
int x2;
int y2;
} sraRect;
typedef struct sraRegion sraRegion;
/* -=- Region manipulation functions */
extern sraRegion *sraRgnCreate();
extern sraRegion *sraRgnCreateRect(int x1, int y1, int x2, int y2);
extern sraRegion *sraRgnCreateRgn(const sraRegion *src);
extern void sraRgnDestroy(sraRegion *rgn);
extern void sraRgnMakeEmpty(sraRegion *rgn);
extern Bool sraRgnAnd(sraRegion *dst, const sraRegion *src);
extern void sraRgnOr(sraRegion *dst, const sraRegion *src);
extern Bool sraRgnSubtract(sraRegion *dst, const sraRegion *src);
extern void sraRgnOffset(sraRegion *dst, int dx, int dy);
extern Bool sraRgnPopRect(sraRegion *region, sraRect *rect,
unsigned long flags);
extern unsigned long sraRgnCountRects(const sraRegion *rgn);
extern Bool sraRgnEmpty(const sraRegion *rgn);
/* -=- rectangle iterator */
typedef struct sraRectangleIterator {
Bool reverseX,reverseY;
int ptrSize,ptrPos;
struct sraSpan** sPtrs;
} sraRectangleIterator;
extern sraRectangleIterator *sraRgnGetIterator(sraRegion *s);
extern sraRectangleIterator *sraRgnGetReverseIterator(sraRegion *s,Bool reverseX,Bool reverseY);
extern Bool sraRgnIteratorNext(sraRectangleIterator *i,sraRect *r);
extern void sraRgnReleaseIterator(sraRectangleIterator *i);
void sraRgnPrint(const sraRegion *s);
/* -=- Rectangle clipper (for speed) */
extern Bool sraClipRect(int *x, int *y, int *w, int *h,
int cx, int cy, int cw, int ch);
#endif
#ifndef SRAREGION_H
#define SRAREGION_H
/* -=- SRA - Simple Region Algorithm
* A simple rectangular region implementation.
* Copyright (c) 2001 James "Wez" Weatherall, Johannes E. Schindelin
*/
/* -=- sraRect */
typedef struct _rect {
int x1;
int y1;
int x2;
int y2;
} sraRect;
typedef struct sraRegion sraRegion;
/* -=- Region manipulation functions */
extern sraRegion *sraRgnCreate();
extern sraRegion *sraRgnCreateRect(int x1, int y1, int x2, int y2);
extern sraRegion *sraRgnCreateRgn(const sraRegion *src);
extern void sraRgnDestroy(sraRegion *rgn);
extern void sraRgnMakeEmpty(sraRegion *rgn);
extern Bool sraRgnAnd(sraRegion *dst, const sraRegion *src);
extern void sraRgnOr(sraRegion *dst, const sraRegion *src);
extern Bool sraRgnSubtract(sraRegion *dst, const sraRegion *src);
extern void sraRgnOffset(sraRegion *dst, int dx, int dy);
extern Bool sraRgnPopRect(sraRegion *region, sraRect *rect,
unsigned long flags);
extern unsigned long sraRgnCountRects(const sraRegion *rgn);
extern Bool sraRgnEmpty(const sraRegion *rgn);
/* -=- rectangle iterator */
typedef struct sraRectangleIterator {
Bool reverseX,reverseY;
int ptrSize,ptrPos;
struct sraSpan** sPtrs;
} sraRectangleIterator;
extern sraRectangleIterator *sraRgnGetIterator(sraRegion *s);
extern sraRectangleIterator *sraRgnGetReverseIterator(sraRegion *s,Bool reverseX,Bool reverseY);
extern Bool sraRgnIteratorNext(sraRectangleIterator *i,sraRect *r);
extern void sraRgnReleaseIterator(sraRectangleIterator *i);
void sraRgnPrint(const sraRegion *s);
/* -=- Rectangle clipper (for speed) */
extern Bool sraClipRect(int *x, int *y, int *w, int *h,
int cx, int cy, int cw, int ch);
#endif

@ -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);
}
static Bool
CheckSolidTile(cl, x, y, w, h, colorPtr, needSameColor)
rfbClientPtr cl;
int x, y, w, h;
CARD32 *colorPtr;
Bool needSameColor;
static Bool CheckSolidTile(rfbClientPtr cl, int x, int y, int w, int h, CARD32* colorPtr, Bool needSameColor)
{
switch(cl->screen->rfbServerFormat.bitsPerPixel) {
case 32:
@ -449,11 +444,7 @@ CheckSolidTile(cl, x, y, w, h, colorPtr, needSameColor)
#define DEFINE_CHECK_SOLID_FUNCTION(bpp) \
\
static Bool \
CheckSolidTile##bpp(cl, x, y, w, h, colorPtr, needSameColor) \
rfbClientPtr cl; \
int x, y, w, h; \
CARD32 *colorPtr; \
Bool needSameColor; \
CheckSolidTile##bpp(rfbClientPtr cl, int x, int y, int w, int h, CARD32* colorPtr, Bool needSameColor) \
{ \
CARD##bpp *fbptr; \
CARD##bpp colorValue; \

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

Loading…
Cancel
Save