diff options
author | dscho <dscho> | 2005-05-15 13:57:51 +0000 |
---|---|---|
committer | dscho <dscho> | 2005-05-15 13:57:51 +0000 |
commit | 8bee4eb990273c3654431467ba6618eb916f030a (patch) | |
tree | f3077e1cb12a4cb778047814583fc0b2f26bb7b2 /VisualNaCro | |
parent | be5b1296e4aa4d8a51cd709853408ec0cd7b768b (diff) | |
download | libtdevnc-8bee4eb990273c3654431467ba6618eb916f030a.tar.gz libtdevnc-8bee4eb990273c3654431467ba6618eb916f030a.zip |
ANSIfy, fix some warnings from Linus' sparse
Diffstat (limited to 'VisualNaCro')
-rw-r--r-- | VisualNaCro/configure.ac | 2 | ||||
-rw-r--r-- | VisualNaCro/default8x16.h | 6 | ||||
-rw-r--r-- | VisualNaCro/nacro.c | 58 |
3 files changed, 33 insertions, 33 deletions
diff --git a/VisualNaCro/configure.ac b/VisualNaCro/configure.ac index 4472329..0fc6e8c 100644 --- a/VisualNaCro/configure.ac +++ b/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 diff --git a/VisualNaCro/default8x16.h b/VisualNaCro/default8x16.h index d557d47..252f411 100644 --- a/VisualNaCro/default8x16.h +++ b/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 }; diff --git a/VisualNaCro/nacro.c b/VisualNaCro/nacro.c index 9d4e9ed..b1a14cf 100644 --- a/VisualNaCro/nacro.c +++ b/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; |