Browse Source

ANSIfy, fix some warnings from Linus' sparse

pull/1/head
dscho 17 years ago
parent
commit
8bee4eb990
  1. 3
      ChangeLog
  2. 2
      VisualNaCro/configure.ac
  3. 6
      VisualNaCro/default8x16.h
  4. 58
      VisualNaCro/nacro.c
  5. 5
      client_examples/SDLvncviewer.c
  6. 18
      client_examples/ppmtest.c
  7. 8
      contrib/zippy.c
  8. 28
      examples/example.c
  9. 10
      examples/fontsel.c
  10. 4
      examples/pnmshow.c
  11. 2
      examples/pnmshow24.c
  12. 6
      examples/radon.h
  13. 2
      examples/storepasswd.c
  14. 27
      examples/vncev.c
  15. 1
      libvncclient/listen.c
  16. 24
      libvncclient/rfbproto.c
  17. 1
      libvncclient/sockets.c
  18. 11
      libvncclient/vncviewer.c
  19. 6
      libvncserver/auth.c
  20. 10
      libvncserver/cargs.c
  21. 31
      libvncserver/corre.c
  22. 18
      libvncserver/cursor.c
  23. 32
      libvncserver/d3des.c
  24. 6
      libvncserver/font.c
  25. 67
      libvncserver/hextile.c
  26. 6
      libvncserver/httpd.c
  27. 54
      libvncserver/main.c
  28. 23
      libvncserver/private.h
  29. 54
      libvncserver/rfbregion.c
  30. 123
      libvncserver/rfbserver.c
  31. 31
      libvncserver/rre.c
  32. 4
      libvncserver/selbox.c
  33. 34
      libvncserver/sockets.c
  34. 300
      libvncserver/tight.c
  35. 29
      libvncserver/translate.c
  36. 8
      libvncserver/vncauth.c
  37. 18
      libvncserver/zlib.c
  38. 3
      libvncserver/zrle.c
  39. 2
      libvncserver/zrleencodetemplate.c
  40. 3
      libvncserver/zrleoutstream.c
  41. 6
      rfb/default8x16.h
  42. 5
      rfb/rfb.h
  43. 4
      rfb/rfbproto.h
  44. 5
      test/copyrecttest.c
  45. 20
      test/cursortest.c
  46. 48
      test/encodingstest.c
  47. 2
      vncterm/VNCommand.c
  48. 1
      vncterm/VNConsole.c

3
ChangeLog

@ -1,3 +1,6 @@
2005-05-15 Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
* almost every file: ANSIfy, fix warnings from Linus' sparse
2005-05-14 Karl Runge <runge@karlrunge.com>
* x11vnc: more work on -scrollcopyrect and -xkb modes.

2
VisualNaCro/configure.ac

@ -180,7 +180,7 @@ AC_ARG_WITH(perl5,[ --with-perl5=path Set location of Perl5 executable],[
# First figure out what the name of Perl5 is
if test -z "$PERLBIN"; then
AC_CHECK_PROGS(PERL, perl perl5.6.1 perl5.6.0 perl5.004 perl5.003 perl5.002 perl5.001 perl5 perl)
AC_CHECK_PROGS(PERL, perl perl5.8.1 perl5.6.1 perl5.6.0 perl5.004 perl5.003 perl5.002 perl5.001 perl5 perl)
else
PERL="$PERLBIN"
fi

6
VisualNaCro/default8x16.h

@ -1,4 +1,4 @@
unsigned char default8x16FontData[4096+1]={
static unsigned char default8x16FontData[4096+1]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xbd,0x99,0x81,0x81,0x7e,0x00,0x00,0x00,0x00,
0x00,0x00,0x7e,0xff,0xdb,0xff,0xff,0xc3,0xe7,0xff,0xff,0x7e,0x00,0x00,0x00,0x00,
@ -256,6 +256,6 @@ unsigned char default8x16FontData[4096+1]={
0x00,0x00,0x00,0x00,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
int default8x16FontMetaData[256*5+1]={
static int default8x16FontMetaData[256*5+1]={
0,8,16,0,0,16,8,16,0,0,32,8,16,0,0,48,8,16,0,0,64,8,16,0,0,80,8,16,0,0,96,8,16,0,0,112,8,16,0,0,128,8,16,0,0,144,8,16,0,0,160,8,16,0,0,176,8,16,0,0,192,8,16,0,0,208,8,16,0,0,224,8,16,0,0,240,8,16,0,0,256,8,16,0,0,272,8,16,0,0,288,8,16,0,0,304,8,16,0,0,320,8,16,0,0,336,8,16,0,0,352,8,16,0,0,368,8,16,0,0,384,8,16,0,0,400,8,16,0,0,416,8,16,0,0,432,8,16,0,0,448,8,16,0,0,464,8,16,0,0,480,8,16,0,0,496,8,16,0,0,512,8,16,0,0,528,8,16,0,0,544,8,16,0,0,560,8,16,0,0,576,8,16,0,0,592,8,16,0,0,608,8,16,0,0,624,8,16,0,0,640,8,16,0,0,656,8,16,0,0,672,8,16,0,0,688,8,16,0,0,704,8,16,0,0,720,8,16,0,0,736,8,16,0,0,752,8,16,0,0,768,8,16,0,0,784,8,16,0,0,800,8,16,0,0,816,8,16,0,0,832,8,16,0,0,848,8,16,0,0,864,8,16,0,0,880,8,16,0,0,896,8,16,0,0,912,8,16,0,0,928,8,16,0,0,944,8,16,0,0,960,8,16,0,0,976,8,16,0,0,992,8,16,0,0,1008,8,16,0,0,1024,8,16,0,0,1040,8,16,0,0,1056,8,16,0,0,1072,8,16,0,0,1088,8,16,0,0,1104,8,16,0,0,1120,8,16,0,0,1136,8,16,0,0,1152,8,16,0,0,1168,8,16,0,0,1184,8,16,0,0,1200,8,16,0,0,1216,8,16,0,0,1232,8,16,0,0,1248,8,16,0,0,1264,8,16,0,0,1280,8,16,0,0,1296,8,16,0,0,1312,8,16,0,0,1328,8,16,0,0,1344,8,16,0,0,1360,8,16,0,0,1376,8,16,0,0,1392,8,16,0,0,1408,8,16,0,0,1424,8,16,0,0,1440,8,16,0,0,1456,8,16,0,0,1472,8,16,0,0,1488,8,16,0,0,1504,8,16,0,0,1520,8,16,0,0,1536,8,16,0,0,1552,8,16,0,0,1568,8,16,0,0,1584,8,16,0,0,1600,8,16,0,0,1616,8,16,0,0,1632,8,16,0,0,1648,8,16,0,0,1664,8,16,0,0,1680,8,16,0,0,1696,8,16,0,0,1712,8,16,0,0,1728,8,16,0,0,1744,8,16,0,0,1760,8,16,0,0,1776,8,16,0,0,1792,8,16,0,0,1808,8,16,0,0,1824,8,16,0,0,1840,8,16,0,0,1856,8,16,0,0,1872,8,16,0,0,1888,8,16,0,0,1904,8,16,0,0,1920,8,16,0,0,1936,8,16,0,0,1952,8,16,0,0,1968,8,16,0,0,1984,8,16,0,0,2000,8,16,0,0,2016,8,16,0,0,2032,8,16,0,0,2048,8,16,0,0,2064,8,16,0,0,2080,8,16,0,0,2096,8,16,0,0,2112,8,16,0,0,2128,8,16,0,0,2144,8,16,0,0,2160,8,16,0,0,2176,8,16,0,0,2192,8,16,0,0,2208,8,16,0,0,2224,8,16,0,0,2240,8,16,0,0,2256,8,16,0,0,2272,8,16,0,0,2288,8,16,0,0,2304,8,16,0,0,2320,8,16,0,0,2336,8,16,0,0,2352,8,16,0,0,2368,8,16,0,0,2384,8,16,0,0,2400,8,16,0,0,2416,8,16,0,0,2432,8,16,0,0,2448,8,16,0,0,2464,8,16,0,0,2480,8,16,0,0,2496,8,16,0,0,2512,8,16,0,0,2528,8,16,0,0,2544,8,16,0,0,2560,8,16,0,0,2576,8,16,0,0,2592,8,16,0,0,2608,8,16,0,0,2624,8,16,0,0,2640,8,16,0,0,2656,8,16,0,0,2672,8,16,0,0,2688,8,16,0,0,2704,8,16,0,0,2720,8,16,0,0,2736,8,16,0,0,2752,8,16,0,0,2768,8,16,0,0,2784,8,16,0,0,2800,8,16,0,0,2816,8,16,0,0,2832,8,16,0,0,2848,8,16,0,0,2864,8,16,0,0,2880,8,16,0,0,2896,8,16,0,0,2912,8,16,0,0,2928,8,16,0,0,2944,8,16,0,0,2960,8,16,0,0,2976,8,16,0,0,2992,8,16,0,0,3008,8,16,0,0,3024,8,16,0,0,3040,8,16,0,0,3056,8,16,0,0,3072,8,16,0,0,3088,8,16,0,0,3104,8,16,0,0,3120,8,16,0,0,3136,8,16,0,0,3152,8,16,0,0,3168,8,16,0,0,3184,8,16,0,0,3200,8,16,0,0,3216,8,16,0,0,3232,8,16,0,0,3248,8,16,0,0,3264,8,16,0,0,3280,8,16,0,0,3296,8,16,0,0,3312,8,16,0,0,3328,8,16,0,0,3344,8,16,0,0,3360,8,16,0,0,3376,8,16,0,0,3392,8,16,0,0,3408,8,16,0,0,3424,8,16,0,0,3440,8,16,0,0,3456,8,16,0,0,3472,8,16,0,0,3488,8,16,0,0,3504,8,16,0,0,3520,8,16,0,0,3536,8,16,0,0,3552,8,16,0,0,3568,8,16,0,0,3584,8,16,0,0,3600,8,16,0,0,3616,8,16,0,0,3632,8,16,0,0,3648,8,16,0,0,3664,8,16,0,0,3680,8,16,0,0,3696,8,16,0,0,3712,8,16,0,0,3728,8,16,0,0,3744,8,16,0,0,3760,8,16,0,0,3776,8,16,0,0,3792,8,16,0,0,3808,8,16,0,0,3824,8,16,0,0,3840,8,16,0,0,3856,8,16,0,0,3872,8,16,0,0,3888,8,16,0,0,3904,8,16,0,0,3920,8,16,0,0,3936,8,16,0,0,3952,8,16,0,0,3968,8,16,0,0,3984,8,16,0,0,4000,8,16,0,0,4016,8,16,0,0,4032,8,16,0,0,4048,8,16,0,0,4064,8,16,0,0,4080,8,16,0,0,};
rfbFontData default8x16Font = { default8x16FontData, default8x16FontMetaData };
static rfbFontData default8x16Font = { default8x16FontData, default8x16FontMetaData };

58
VisualNaCro/nacro.c

@ -36,14 +36,14 @@ typedef struct private_resource_t {
static private_resource_t resource_pool[MAX_RESOURCE_COUNT];
static int resource_count=0;
private_resource_t* get_resource(int resource)
static private_resource_t* get_resource(int resource)
{
if(resource>=MAX_RESOURCE_COUNT || resource<0 || resource_pool[resource].client==0)
return 0;
return NULL;
return resource_pool+resource;
}
private_resource_t* get_next_resource()
static private_resource_t* get_next_resource(void)
{
if(resource_count<MAX_RESOURCE_COUNT) {
memset(resource_pool+resource_count,0,sizeof(private_resource_t));
@ -56,19 +56,19 @@ private_resource_t* get_next_resource()
if(i<MAX_RESOURCE_COUNT)
return resource_pool+i;
}
return 0;
return NULL;
}
void free_resource(int resource)
static void free_resource(int resource)
{
private_resource_t* res=get_resource(resource);
if(res)
res->client=0;
res->client=NULL;
}
/* hooks */
void got_key(rfbBool down,rfbKeySym keysym,rfbClientRec* cl)
static void got_key(rfbBool down,rfbKeySym keysym,rfbClientRec* cl)
{
private_resource_t* res=(private_resource_t*)cl->screen->screenData;
@ -77,7 +77,7 @@ void got_key(rfbBool down,rfbKeySym keysym,rfbClientRec* cl)
res->result|=RESULT_KEY;
}
void got_mouse(int buttons,int x,int y,rfbClientRec* cl)
static void got_mouse(int buttons,int x,int y,rfbClientRec* cl)
{
private_resource_t* res=(private_resource_t*)cl->screen->screenData;
@ -87,7 +87,7 @@ void got_mouse(int buttons,int x,int y,rfbClientRec* cl)
res->result|=RESULT_MOUSE;
}
rfbBool malloc_frame_buffer(rfbClient* cl)
static rfbBool malloc_frame_buffer(rfbClient* cl)
{
private_resource_t* res=(private_resource_t*)cl->clientData;
@ -96,7 +96,7 @@ rfbBool malloc_frame_buffer(rfbClient* cl)
res->client->frameBuffer=malloc(w*4*h);
res->server=rfbGetScreen(0,0,w,h,8,3,4);
res->server=rfbGetScreen(NULL,NULL,w,h,8,3,4);
res->server->screenData=res;
res->server->port=res->listen_port;
res->server->frameBuffer=res->client->frameBuffer;
@ -110,7 +110,7 @@ rfbBool malloc_frame_buffer(rfbClient* cl)
}
}
bool_t do_visual_grep(private_resource_t* res,int x,int y,int w,int h)
static bool_t do_visual_grep(private_resource_t* res,int x,int y,int w,int h)
{
rfbClient* cl;
image_t* image;
@ -146,7 +146,7 @@ bool_t do_visual_grep(private_resource_t* res,int x,int y,int w,int h)
return 0;
}
void got_frame_buffer(rfbClient* cl,int x,int y,int w,int h)
static void got_frame_buffer(rfbClient* cl,int x,int y,int w,int h)
{
private_resource_t* res=(private_resource_t*)cl->clientData;
@ -182,8 +182,8 @@ resource_t initvnc(const char* server,int server_port,int listen_port)
res->client->serverHost=strdup(server);
res->client->serverPort=server_port;
res->client->appData.encodingsString="raw";
if(!rfbInitClient(res->client,&dummy,0)) {
res->client=0;
if(!rfbInitClient(res->client,&dummy,NULL)) {
res->client=NULL;
return -1;
}
return res-resource_pool;
@ -202,7 +202,7 @@ void closevnc(resource_t resource)
rfbClientCleanup(res->client);
res->client=0;
res->client=NULL;
}
/* PNM (image) helpers */
@ -240,7 +240,7 @@ bool_t savepnm(resource_t resource,const char* filename,int x1,int y1,int x2,int
return TRUE;
}
image_t* loadpnm(const char* filename)
static image_t* loadpnm(const char* filename)
{
FILE* f=fopen(filename,"rb");
char buffer[1024];
@ -248,25 +248,25 @@ image_t* loadpnm(const char* filename)
image_t* image;
if(f==0)
return 0;
return NULL;
if(!fgets(buffer,1024,f) || strcmp("P6\n",buffer)) {
fclose(f);
return 0;
return NULL;
}
do {
fgets(buffer,1024,f);
if(feof(f)) {
fclose(f);
return 0;
return NULL;
}
} while(buffer[0]=='#');
if( sscanf(buffer,"%d %d",&w,&h)!=2
|| !fgets(buffer,1024,f) || strcmp("255\n",buffer)) {
fclose(f);
return 0;
return NULL;
}
image=(image_t*)malloc(sizeof(image_t));
@ -276,7 +276,7 @@ image_t* loadpnm(const char* filename)
if(!image->buffer) {
fclose(f);
free(image);
return 0;
return NULL;
}
for(j=0;j<h;j++)
@ -286,7 +286,7 @@ image_t* loadpnm(const char* filename)
fclose(f);
free(image->buffer);
free(image);
return 0;
return NULL;
}
fclose(f);
@ -294,7 +294,7 @@ image_t* loadpnm(const char* filename)
return image;
}
void free_image(image_t* image)
static void free_image(image_t* image)
{
if(image->buffer)
free(image->buffer);
@ -304,7 +304,7 @@ void free_image(image_t* image)
/* process() and friends */
/* this function returns only if res->result in return_mask */
result_t private_process(resource_t resource,timeout_t timeout_in_seconds,result_t return_mask)
static result_t private_process(resource_t resource,timeout_t timeout_in_seconds,result_t return_mask)
{
private_resource_t* res=get_resource(resource);
fd_set fds;
@ -317,7 +317,7 @@ result_t private_process(resource_t resource,timeout_t timeout_in_seconds,result
assert(res->client);
gettimeofday(&tv_start,0);
gettimeofday(&tv_start,NULL);
res->result=0;
do {
@ -346,7 +346,7 @@ result_t private_process(resource_t resource,timeout_t timeout_in_seconds,result
if(res->client->sock>max_fd)
max_fd=res->client->sock;
gettimeofday(&tv_end,0);
gettimeofday(&tv_end,NULL);
timeout_done=tv_end.tv_usec-tv_start.tv_usec+
1000000L*(tv_end.tv_sec-tv_start.tv_sec);
if(timeout_done>=timeout)
@ -355,7 +355,7 @@ result_t private_process(resource_t resource,timeout_t timeout_in_seconds,result
tv.tv_usec=((timeout-timeout_done)%1000000);
tv.tv_sec=(timeout-timeout_done)/1000000;
count=select(max_fd+1,&fds,0,0,&tv);
count=select(max_fd+1,&fds,NULL,NULL,&tv);
if(count<0)
return 0;
@ -422,7 +422,7 @@ result_t visualgrep(resource_t resource,const char* filename,timeout_t timeout)
/* free image */
if(res->grep_image) {
free_image(res->grep_image);
res->grep_image=0;
res->grep_image=NULL;
}
return result;
@ -432,7 +432,7 @@ result_t visualgrep(resource_t resource,const char* filename,timeout_t timeout)
#include "default8x16.h"
void center_text(rfbScreenInfo* screen,const char* message,int* x,int* y,int* w,int* h)
static void center_text(rfbScreenInfo* screen,const char* message,int* x,int* y,int* w,int* h)
{
rfbFontData* font=&default8x16Font;
const char* pointer;

5
client_examples/SDLvncviewer.c

@ -46,7 +46,7 @@ static rfbBool resize(rfbClient* client) {
return TRUE;
}
rfbKeySym SDL_keysym2rfbKeySym(int keysym) {
static rfbKeySym SDL_keysym2rfbKeySym(int keysym) {
switch(keysym) {
case SDLK_BACKSPACE: return XK_BackSpace;
case SDLK_TAB: return XK_ISO_Left_Tab;
@ -184,9 +184,10 @@ rfbKeySym SDL_keysym2rfbKeySym(int keysym) {
case SDLK_BREAK: return XK_Break;
default: rfbClientLog("Unknown keysym: %d\n",keysym);
}
return 0;
}
void update(rfbClient* cl,int x,int y,int w,int h) {
static void update(rfbClient* cl,int x,int y,int w,int h) {
SDL_UpdateRect(cl->clientData, x, y, w, h);
}

18
client_examples/ppmtest.c

@ -6,11 +6,11 @@
#include <errno.h>
#include <rfb/rfbclient.h>
void PrintRect(rfbClient* client, int x, int y, int w, int h) {
static void PrintRect(rfbClient* client, int x, int y, int w, int h) {
rfbClientLog("Received an update for %d,%d,%d,%d.\n",x,y,w,h);
}
void SaveFramebufferAsPPM(rfbClient* client, int x, int y, int w, int h) {
static void SaveFramebufferAsPPM(rfbClient* client, int x, int y, int w, int h) {
static time_t t=0,t1;
FILE* f;
int i,j;
@ -19,7 +19,7 @@ void SaveFramebufferAsPPM(rfbClient* client, int x, int y, int w, int h) {
int row_stride=client->width*bpp;
/* save one picture only if the last is older than 2 seconds */
t1=time(0);
t1=time(NULL);
if(t1-t>2)
t=t1;
else
@ -46,6 +46,8 @@ void SaveFramebufferAsPPM(rfbClient* client, int x, int y, int w, int h) {
v=*(unsigned int*)p;
else if(bpp==2)
v=*(unsigned short*)p;
else
v=*(unsigned char*)p;
fputc((v>>pf->redShift)*256/(pf->redMax+1),f);
fputc((v>>pf->greenShift)*256/(pf->greenMax+1),f);
fputc((v>>pf->blueShift)*256/(pf->blueMax+1),f);
@ -53,14 +55,11 @@ void SaveFramebufferAsPPM(rfbClient* client, int x, int y, int w, int h) {
fclose(f);
}
int
int
main(int argc, char **argv)
{
int i;
rfbClient* client = rfbGetClient(8,3,4);
const char* vncServerHost="";
int vncServerPort=5900;
time_t t=time(0);
time_t t=time(NULL);
if(argc>1 && !strcmp("-print",argv[1])) {
client->GotFrameBufferUpdate = PrintRect;
@ -81,7 +80,8 @@ main(int argc, char **argv)
if (!rfbInitClient(client,&argc,argv))
return 1;
while (time(0)-t<5) {
/* TODO: better wait for update completion */
while (time(NULL)-t<5) {
static int i=0;
fprintf(stderr,"\r%d",i++);
if(WaitForMessage(client,50)<0)

8
contrib/zippy.c

@ -4,7 +4,7 @@
#include <rfb/keysym.h>
#include <rfb/default8x16.h>
int maxx=400, maxy=400, bpp=4;
static int maxx=400, maxy=400, bpp=4;
/* odd maxx doesn't work (vncviewer bug) */
/* Here we create a structure so that every client has it's own pointer */
@ -74,7 +74,7 @@ void draw_primary_colors (char* frame_buffer, int x1, int y1, int x2, int y2)
}
/* Dscho's versions (slower, but works for bpp != 3 or 4) */
void draw_primary_colours_generic(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2)
static void draw_primary_colours_generic(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2)
{
rfbPixelFormat f=s->serverFormat;
int i,j;
@ -88,7 +88,7 @@ void draw_primary_colours_generic(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2
rfbDrawPixel(s,i,j,f.blueMax<<f.blueShift);
}
void draw_primary_colours_generic_fast(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2)
static void draw_primary_colours_generic_fast(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2)
{
rfbPixelFormat f=s->serverFormat;
int i,j,y3=(y1*2+y2)/3,y4=(y1+y2*2)/3;
@ -106,7 +106,7 @@ void draw_primary_colours_generic_fast(rfbScreenInfoPtr s,int x1,int y1,int x2,i
}
}
void draw_primary_colours_generic_ultrafast(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2)
static void draw_primary_colours_generic_ultrafast(rfbScreenInfoPtr s,int x1,int y1,int x2,int y2)
{
rfbPixelFormat f=s->serverFormat;
int y3=(y1*2+y2)/3,y4=(y1+y2*2)/3;

28
examples/example.c

@ -34,13 +34,13 @@
#include <rfb/rfb.h>
#include <rfb/keysym.h>
const int bpp=4;
int maxx=800, maxy=600;
static const int bpp=4;
static int maxx=800, maxy=600;
/* TODO: odd maxx doesn't work (vncviewer bug) */
/* This initializes a nice (?) background */
void initBuffer(unsigned char* buffer)
static void initBuffer(unsigned char* buffer)
{
int i,j;
for(j=0;j<maxy;++j) {
@ -63,12 +63,12 @@ typedef struct ClientData {
int oldx,oldy;
} ClientData;
void clientgone(rfbClientPtr cl)
static void clientgone(rfbClientPtr cl)
{
free(cl->clientData);
}
enum rfbNewClientAction newclient(rfbClientPtr cl)
static enum rfbNewClientAction newclient(rfbClientPtr cl)
{
cl->clientData = (void*)calloc(sizeof(ClientData),1);
cl->clientGoneHook = clientgone;
@ -77,7 +77,7 @@ enum rfbNewClientAction newclient(rfbClientPtr cl)
/* switch to new framebuffer contents */
void newframebuffer(rfbScreenInfoPtr screen, int width, int height)
static void newframebuffer(rfbScreenInfoPtr screen, int width, int height)
{
unsigned char *oldfb, *newfb;
@ -94,7 +94,7 @@ void newframebuffer(rfbScreenInfoPtr screen, int width, int height)
/* aux function to draw a line */
void drawline(unsigned char* buffer,int rowstride,int bpp,int x1,int y1,int x2,int y2)
static void drawline(unsigned char* buffer,int rowstride,int bpp,int x1,int y1,int x2,int y2)
{
int i,j;
i=x1-x2; j=y1-y2;
@ -121,7 +121,7 @@ void drawline(unsigned char* buffer,int rowstride,int bpp,int x1,int y1,int x2,i
/* Here the pointer events are handled */
void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
static void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
{
ClientData* cd=cl->clientData;
@ -163,7 +163,7 @@ void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
/* Here the key events are handled */
void dokey(rfbBool down,rfbKeySym key,rfbClientPtr cl)
static void dokey(rfbBool down,rfbKeySym key,rfbClientPtr cl)
{
if(down) {
if(key==XK_Escape)
@ -205,8 +205,10 @@ void dokey(rfbBool down,rfbKeySym key,rfbClientPtr cl)
/* Example for an XCursor (foreground/background only) */
int exampleXCursorWidth=9,exampleXCursorHeight=7;
char exampleXCursor[]=
#ifdef JUST_AN_EXAMPLE
static int exampleXCursorWidth=9,exampleXCursorHeight=7;
static char exampleXCursor[]=
" "
" xx xx "
" xx xx "
@ -215,9 +217,11 @@ char exampleXCursor[]=
" xx xx "
" ";
#endif
/* Example for a rich cursor (full-colour) */
void MakeRichCursor(rfbScreenInfoPtr rfbScreen)
static void MakeRichCursor(rfbScreenInfoPtr rfbScreen)
{
int i,j,w=32,h=32;
rfbCursorPtr c = rfbScreen->cursor;

10
examples/fontsel.c

@ -3,16 +3,16 @@
#define FONTDIR "/usr/lib/kbd/consolefonts/"
#define DEFAULTFONT FONTDIR "default8x16"
char *fontlist[50]={
static char *fontlist[50]={
"8x16alt", "b.fnt", "c.fnt", "default8x16", "m.fnt", "ml.fnt", "mod_d.fnt",
"mod_s.fnt", "mr.fnt", "mu.fnt", "r.fnt", "rl.fnt", "ro.fnt", "s.fnt",
"sc.fnt", "scrawl_s.fnt", "scrawl_w.fnt", "sd.fnt", "t.fnt",
0
NULL
};
rfbScreenInfoPtr rfbScreen = 0;
rfbFontDataPtr curFont = 0;
void showFont(int index)
static rfbScreenInfoPtr rfbScreen = NULL;
static rfbFontDataPtr curFont = NULL;
static void showFont(int index)
{
char buffer[1024];

4
examples/pnmshow.c

@ -2,7 +2,7 @@
#include <rfb/rfb.h>
#include <rfb/keysym.h>
void HandleKey(rfbBool down,rfbKeySym key,rfbClientPtr cl)
static void HandleKey(rfbBool down,rfbKeySym key,rfbClientPtr cl)
{
if(down && (key==XK_Escape || key=='q' || key=='Q'))
rfbCloseClient(cl);
@ -96,6 +96,8 @@ int main(int argc,char** argv)
rfbScreen->frameBuffer[j*paddedWidth*4+i]=0;
}
break;
case GRAY:
break;
case BW:
/* correct the format from 1 bit to 8 bits */
for(j=height-1;j>=0;j--)

2
examples/pnmshow24.c

@ -6,7 +6,7 @@
#error "I need the ALLOW24BPP flag to work"
#endif
void HandleKey(rfbBool down,rfbKeySym key,rfbClientPtr cl)
static void HandleKey(rfbBool down,rfbKeySym key,rfbClientPtr cl)
{
if(down && (key==XK_Escape || key=='q' || key=='Q'))
rfbCloseClient(cl);

6
examples/radon.h

@ -1,4 +1,4 @@
unsigned char radonFontData[2280]={
static unsigned char radonFontData[2280]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 32 */
0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x10,0x10,0x00,0x00, /* 33 */
0x00,0x28,0x28,0x28,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 34 */
@ -190,6 +190,6 @@ unsigned char radonFontData[2280]={
0x04,0x18,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x3a,0x02,0x3c, /* 253 */
0x00,0x80,0x80,0x9c,0xa2,0x82,0xa2,0x9c,0x80,0x80,0x00,0x00, /* 254 */
};
int radonFontMetaData[256*5]={
static int radonFontMetaData[256*5]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,12,0,-2,12,8,12,0,-2,24,8,12,0,-2,36,8,12,0,-2,48,8,12,0,-2,60,8,12,0,-2,72,8,12,0,-2,84,8,12,0,-2,96,8,12,0,-2,108,8,12,0,-2,120,8,12,0,-2,132,8,12,0,-2,144,8,12,0,-2,156,8,12,0,-2,168,8,12,0,-2,180,8,12,0,-2,192,8,12,0,-2,204,8,12,0,-2,216,8,12,0,-2,228,8,12,0,-2,240,8,12,0,-2,252,8,12,0,-2,264,8,12,0,-2,276,8,12,0,-2,288,8,12,0,-2,300,8,12,0,-2,312,8,12,0,-2,324,8,12,0,-2,336,8,12,0,-2,348,8,12,0,-2,360,8,12,0,-2,372,8,12,0,-2,384,8,12,0,-2,396,8,12,0,-2,408,8,12,0,-2,420,8,12,0,-2,432,8,12,0,-2,444,8,12,0,-2,456,8,12,0,-2,468,8,12,0,-2,480,8,12,0,-2,492,8,12,0,-2,504,8,12,0,-2,516,8,12,0,-2,528,8,12,0,-2,540,8,12,0,-2,552,8,12,0,-2,564,8,12,0,-2,576,8,12,0,-2,588,8,12,0,-2,600,8,12,0,-2,612,8,12,0,-2,624,8,12,0,-2,636,8,12,0,-2,648,8,12,0,-2,660,8,12,0,-2,672,8,12,0,-2,684,8,12,0,-2,696,8,12,0,-2,708,8,12,0,-2,720,8,12,0,-2,732,8,12,0,-2,744,8,12,0,-2,756,8,12,0,-2,768,8,12,0,-2,780,8,12,0,-2,792,8,12,0,-2,804,8,12,0,-2,816,8,12,0,-2,828,8,12,0,-2,840,8,12,0,-2,852,8,12,0,-2,864,8,12,0,-2,876,8,12,0,-2,888,8,12,0,-2,900,8,12,0,-2,912,8,12,0,-2,924,8,12,0,-2,936,8,12,0,-2,948,8,12,0,-2,960,8,12,0,-2,972,8,12,0,-2,984,8,12,0,-2,996,8,12,0,-2,1008,8,12,0,-2,1020,8,12,0,-2,1032,8,12,0,-2,1044,8,12,0,-2,1056,8,12,0,-2,1068,8,12,0,-2,1080,8,12,0,-2,1092,8,12,0,-2,1104,8,12,0,-2,1116,8,12,0,-2,1128,8,12,0,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1140,8,12,0,-2,1152,8,12,0,-2,1164,8,12,0,-2,1176,8,12,0,-2,1188,8,12,0,-2,1200,8,12,0,-2,1212,8,12,0,-2,1224,8,12,0,-2,1236,8,12,0,-2,1248,8,12,0,-2,1260,8,12,0,-2,1272,8,12,0,-2,1284,8,12,0,-2,1296,8,12,0,-2,1308,8,12,0,-2,1320,8,12,0,-2,1332,8,12,0,-2,1344,8,12,0,-2,1356,8,12,0,-2,1368,8,12,0,-2,1380,8,12,0,-2,1392,8,12,0,-2,1404,8,12,0,-2,1416,8,12,0,-2,1428,8,12,0,-2,1440,8,12,0,-2,1452,8,12,0,-2,1464,8,12,0,-2,1476,8,12,0,-2,1488,8,12,0,-2,1500,8,12,0,-2,1512,8,12,0,-2,1524,8,12,0,-2,1536,8,12,0,-2,1548,8,12,0,-2,1560,8,12,0,-2,1572,8,12,0,-2,1584,8,12,0,-2,1596,8,12,0,-2,1608,8,12,0,-2,1620,8,12,0,-2,1632,8,12,0,-2,1644,8,12,0,-2,1656,8,12,0,-2,1668,8,12,0,-2,1680,8,12,0,-2,1692,8,12,0,-2,1704,8,12,0,-2,1716,8,12,0,-2,1728,8,12,0,-2,1740,8,12,0,-2,1752,8,12,0,-2,1764,8,12,0,-2,1776,8,12,0,-2,1788,8,12,0,-2,1800,8,12,0,-2,1812,8,12,0,-2,1824,8,12,0,-2,1836,8,12,0,-2,1848,8,12,0,-2,1860,8,12,0,-2,1872,8,12,0,-2,1884,8,12,0,-2,1896,8,12,0,-2,1908,8,12,0,-2,1920,8,12,0,-2,1932,8,12,0,-2,1944,8,12,0,-2,1956,8,12,0,-2,1968,8,12,0,-2,1980,8,12,0,-2,1992,8,12,0,-2,2004,8,12,0,-2,2016,8,12,0,-2,2028,8,12,0,-2,2040,8,12,0,-2,2052,8,12,0,-2,2064,8,12,0,-2,2076,8,12,0,-2,2088,8,12,0,-2,2100,8,12,0,-2,2112,8,12,0,-2,2124,8,12,0,-2,2136,8,12,0,-2,2148,8,12,0,-2,2160,8,12,0,-2,2172,8,12,0,-2,2184,8,12,0,-2,2196,8,12,0,-2,2208,8,12,0,-2,2220,8,12,0,-2,2232,8,12,0,-2,2244,8,12,0,-2,2256,8,12,0,-2,2268,8,12,0,-2,0,0,0,0,0,};
rfbFontData radonFont={radonFontData, radonFontMetaData};
static rfbFontData radonFont={radonFontData, radonFontMetaData};

2
examples/storepasswd.c

@ -22,7 +22,7 @@
#include <stdio.h>
#include <rfb/rfb.h>
void usage(void)
static void usage(void)
{
printf("\nusage: storepasswd <password> <filename>\n\n");

27
examples/vncev.c

@ -1,4 +1,5 @@
/* This program is a simple server to show events coming from the client */
#define _BSD_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
@ -8,10 +9,12 @@
#include <rfb/rfb.h>
#include <rfb/default8x16.h>
char f[640*480];
char* keys[0x400];
#define width 100
#define height 100
static char f[width*height];
static char* keys[0x400];
int hex2number(unsigned char c)
static int hex2number(unsigned char c)
{
if(c>'f') return(-1);
else if(c>'F')
@ -22,7 +25,7 @@ int hex2number(unsigned char c)
return(c-'0');
}
void read_keys()
static void read_keys(void)
{
int i,j,k;
char buffer[1024];
@ -60,15 +63,15 @@ void read_keys()
fclose(keysyms);
}
int lineHeight=16,lineY=480-16;
void output(rfbScreenInfoPtr s,char* line)
static int lineHeight=16,lineY=height-16;
static void output(rfbScreenInfoPtr s,char* line)
{
rfbDoCopyRect(s,0,0,640,480-lineHeight,0,-lineHeight);
rfbDoCopyRect(s,0,0,width,height-lineHeight,0,-lineHeight);
rfbDrawString(s,&default8x16Font,10,lineY,line,0x01);
rfbLog("%s\n",line);
}
void dokey(rfbBool down,rfbKeySym k,rfbClientPtr cl)
static void dokey(rfbBool down,rfbKeySym k,rfbClientPtr cl)
{
char buffer[1024+32];
@ -77,7 +80,7 @@ void dokey(rfbBool down,rfbKeySym k,rfbClientPtr cl)
output(cl->screen,buffer);
}
void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
static void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
{
char buffer[1024];
if(buttonMask) {
@ -87,7 +90,7 @@ void doptr(int buttonMask,int x,int y,rfbClientPtr cl)
}
enum rfbNewClientAction newclient(rfbClientPtr cl)
static enum rfbNewClientAction newclient(rfbClientPtr cl)
{
char buffer[1024];
struct sockaddr_in addr;
@ -103,7 +106,7 @@ enum rfbNewClientAction newclient(rfbClientPtr cl)
int main(int argc,char** argv)
{
rfbScreenInfoPtr s=rfbGetScreen(&argc,argv,640,480,8,1,1);
rfbScreenInfoPtr s=rfbGetScreen(&argc,argv,width,height,8,1,1);
s->colourMap.is16=FALSE;
s->colourMap.count=2;
s->colourMap.data.bytes=(unsigned char*)"\xd0\xd0\xd0\x30\x01\xe0";
@ -113,7 +116,7 @@ int main(int argc,char** argv)
s->ptrAddEvent=doptr;
s->newClientHook=newclient;
memset(f,0,640*480);
memset(f,0,width*height);
read_keys();
rfbInitServer(s);

1
libvncclient/listen.c

@ -21,6 +21,7 @@
* listen.c - listen for incoming connections
*/
#define _BSD_SOURCE
#include <unistd.h>
#include <sys/types.h>
#ifdef __MINGW32__

24
libvncclient/rfbproto.c

@ -23,6 +23,8 @@
* rfbproto.c - functions to deal with client side of RFB protocol.
*/
#define _BSD_SOURCE
#define _POSIX_SOURCE
#include <unistd.h>
#include <errno.h>
#ifndef __MINGW32__
@ -31,6 +33,10 @@
#include <rfb/rfbclient.h>
#ifdef LIBVNCSERVER_HAVE_LIBZ
#include <zlib.h>
#ifdef __CHECKER__
#undef Z_NULL
#define Z_NULL NULL
#endif
#endif
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
#include <jpeglib.h>
@ -44,7 +50,7 @@
rfbBool rfbEnableClientLogging=TRUE;
void
static void
rfbDefaultClientLog(const char *format, ...)
{
va_list args;
@ -69,7 +75,7 @@ rfbDefaultClientLog(const char *format, ...)
rfbClientLogProc rfbClientLog=rfbDefaultClientLog;
rfbClientLogProc rfbClientErr=rfbDefaultClientLog;
void FillRectangle(rfbClient* client, int x, int y, int w, int h, uint32_t colour) {
static void FillRectangle(rfbClient* client, int x, int y, int w, int h, uint32_t colour) {
int i,j;
#define FILL_RECT(BPP) \
@ -86,7 +92,7 @@ void FillRectangle(rfbClient* client, int x, int y, int w, int h, uint32_t colou
}
}
void CopyRectangle(rfbClient* client, uint8_t* buffer, int x, int y, int w, int h) {
static void CopyRectangle(rfbClient* client, uint8_t* buffer, int x, int y, int w, int h) {
int i,j;
#define COPY_RECT(BPP) \
@ -108,7 +114,7 @@ void CopyRectangle(rfbClient* client, uint8_t* buffer, int x, int y, int w, int
}
/* TODO: test */
void CopyRectangleFromRectangle(rfbClient* client, int src_x, int src_y, int w, int h, int dest_x, int dest_y) {
static void CopyRectangleFromRectangle(rfbClient* client, int src_x, int src_y, int w, int h, int dest_x, int dest_y) {
int i,j;
#define COPY_RECT_FROM_RECT(BPP) \
@ -225,7 +231,7 @@ ConnectToRFBServer(rfbClient* client,const char *hostname, int port)
rfbClientLog("Could not open %s.\n",client->serverHost);
return FALSE;
}
setbuf(rec->file,0);
setbuf(rec->file,NULL);
fread(buffer,1,strlen(magic),rec->file);
if (strncmp(buffer,magic,strlen(magic))) {
rfbClientLog("File %s was not recorded by vncrec.\n",client->serverHost);
@ -265,7 +271,7 @@ InitialiseRFBConnection(rfbClient* client)
uint32_t authScheme, reasonLen, authResult;
char *reason;
uint8_t challenge[CHALLENGESIZE];
char *passwd;
char *passwd=NULL;
int i;
rfbClientInitMsg ci;
@ -1028,8 +1034,7 @@ HandleRFBServerMessage(rfbClient* client)
*/
void
PrintPixelFormat(format)
rfbPixelFormat *format;
PrintPixelFormat(rfbPixelFormat *format)
{
if (format->bitsPerPixel == 1) {
rfbClientLog(" Single bit per pixel.\n");
@ -1143,9 +1148,6 @@ JpegSetSrcManager(j_decompress_ptr cinfo, uint8_t *compressedData,
/* avoid name clashes with LibVNCServer */
#define rfbEncryptBytes rfbClientEncryptBytes
#define rfbEncryptAndStorePasswd rfbClientEncryptAndStorePasswdUnused
#define rfbDecryptPasswdFromFile rfbClientDecryptPasswdFromFileUnused
#define rfbRandomBytes rfbClientRandomBytesUnused
#define rfbDes rfbClientDes
#define rfbDesKey rfbClientDesKey
#define rfbUseKey rfbClientUseKey

1
libvncclient/sockets.c

@ -21,6 +21,7 @@
* sockets.c - functions to deal with sockets.
*/
#define _BSD_SOURCE
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>

11
libvncclient/vncviewer.c

@ -21,6 +21,8 @@
* vncviewer.c - the Xt-based VNC viewer.
*/
#define _BSD_SOURCE
#define _POSIX_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -34,11 +36,12 @@ static rfbBool DummyPoint(rfbClient* client, int x, int y) {
}
static void DummyRect(rfbClient* client, int x, int y, int w, int h) {
}
#ifdef __MINGW32__
static char* NoPassword(rfbClient* client) {
return strdup("");
}
#ifndef __MINGW32__
#else
#include <stdio.h>
#include <termios.h>
#endif
@ -103,10 +106,10 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,
rfbClient* client=(rfbClient*)calloc(sizeof(rfbClient),1);
if(!client) {
rfbClientErr("Couldn't allocate client structure!\n");
return 0;
return NULL;
}
initAppData(&client->appData);
client->programName = 0;
client->programName = NULL;
client->endianTest = 1;
client->programName="";
client->serverHost="";

6
libvncserver/auth.c

@ -35,8 +35,7 @@
*/
void
rfbAuthNewClient(cl)
rfbClientPtr cl;
rfbAuthNewClient(rfbClientPtr cl)
{
char buf[4 + CHALLENGESIZE];
int len;
@ -68,8 +67,7 @@ rfbAuthNewClient(cl)
*/
void
rfbAuthProcessClientMessage(cl)
rfbClientPtr cl;
rfbAuthProcessClientMessage(rfbClientPtr cl)
{
int n;
uint8_t response[CHALLENGESIZE];

10
libvncserver/cargs.c

@ -14,7 +14,7 @@
#include <rfb/rfb.h>
extern rfbStringToAddr(char *str, in_addr_t *iface);
extern int rfbStringToAddr(char *str, in_addr_t *iface);
void
rfbUsage(void)
@ -88,7 +88,7 @@ rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[])
return FALSE;
}
passwds[0] = argv[++i];
passwds[1] = 0;
passwds[1] = NULL;
rfbScreen->authPasswdData = (void*)passwds;
rfbScreen->passwordCheck = rfbCheckPasswordByList;
} else if (strcmp(argv[i], "-deferupdate") == 0) { /* -deferupdate milliseconds */
@ -149,12 +149,6 @@ rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[])
return TRUE;
}
void rfbSizeUsage()
{
fprintf(stderr, "-width sets the width of the framebuffer\n");
fprintf(stderr, "-height sets the height of the framebuffer\n");
}
rfbBool
rfbProcessSizeArguments(int* width,int* height,int* bpp,int* argc, char *argv[])
{

31
libvncserver/corre.c

@ -57,9 +57,11 @@ static rfbBool rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl, int x, int y,
*/
rfbBool
rfbSendRectEncodingCoRRE(cl, x, y, w, h)
rfbClientPtr cl;
int x, y, w, h;
rfbSendRectEncodingCoRRE(rfbClientPtr cl,
int x,
int y,
int w,
int h)
{
if (h > cl->correMaxHeight) {
return (rfbSendRectEncodingCoRRE(cl, x, y, w, cl->correMaxHeight) &&
@ -85,9 +87,11 @@ rfbSendRectEncodingCoRRE(cl, x, y, w, h)
*/
static rfbBool
rfbSendSmallRectEncodingCoRRE(cl, x, y, w, h)
rfbClientPtr cl;
int x, y, w, h;
rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl,
int x,
int y,
int w,
int h)
{
rfbFramebufferUpdateRectHeader rect;
rfbRREHeader hdr;
@ -206,11 +210,7 @@ rfbSendSmallRectEncodingCoRRE(cl, x, y, w, h)
#define DEFINE_SUBRECT_ENCODE(bpp) \
static int \
subrectEncode##bpp(data,w,h) \
uint##bpp##_t *data; \
int w; \
int h; \
{ \
subrectEncode##bpp(uint##bpp##_t *data, int w, int h) { \
uint##bpp##_t cl; \
rfbCoRRERectangle subrect; \
int x,y; \
@ -277,7 +277,7 @@ subrectEncode##bpp(data,w,h) \
return -1; \
\
numsubs += 1; \
*((uint##bpp##_t*)(rreAfterBuf + rreAfterBufLen)) = cl; \
*((uint##bpp##_t*)(rreAfterBuf + rreAfterBufLen)) = cl; \
rreAfterBufLen += (bpp/8); \
memcpy(&rreAfterBuf[rreAfterBufLen],&subrect,sz_rfbCoRRERectangle); \
rreAfterBufLen += sz_rfbCoRRERectangle; \
@ -306,12 +306,9 @@ DEFINE_SUBRECT_ENCODE(32)
* getBgColour() gets the most prevalent colour in a byte array.
*/
static uint32_t
getBgColour(data,size,bpp)
char *data;
int size;
int bpp;
getBgColour(char *data, int size, int bpp)
{
#define NUMCLRS 256
static int counts[NUMCLRS];

18
libvncserver/cursor.c

@ -24,14 +24,14 @@
#include <rfb/rfb.h>
#include <rfb/rfbregion.h>
#include "private.h"
/*
* Send cursor shape either in X-style format or in client pixel format.
*/
rfbBool
rfbSendCursorShape(cl)
rfbClientPtr cl;
rfbSendCursorShape(rfbClientPtr cl)
{
rfbCursorPtr pCursor;
rfbFramebufferUpdateRectHeader rect;
@ -360,8 +360,8 @@ void rfbFreeCursor(rfbCursorPtr cursor)
else {
cursor->cleanup=cursor->cleanupSource=cursor->cleanupMask
=cursor->cleanupRichSource=FALSE;
cursor->source=cursor->mask=cursor->richSource=0;
cursor->alphaSource=0;
cursor->source=cursor->mask=cursor->richSource=NULL;
cursor->alphaSource=NULL;
}
}
@ -633,9 +633,9 @@ void rfbRedrawAfterHideCursor(rfbClientPtr cl,sraRegionPtr updateRegion)
}
}
/* for debugging */
#ifdef DEBUG
void rfbPrintXCursor(rfbCursorPtr cursor)
static void rfbPrintXCursor(rfbCursorPtr cursor)
{
int i,i1,j,w=(cursor->width+7)/8;
unsigned char bit;
@ -649,6 +649,8 @@ void rfbPrintXCursor(rfbCursorPtr cursor)
}
}
#endif
void rfbSetCursor(rfbScreenInfoPtr rfbScreen,rfbCursorPtr c)
{
rfbClientIteratorPtr iterator;