diff options
Diffstat (limited to 'libvncclient')
-rw-r--r-- | libvncclient/listen.c | 1 | ||||
-rw-r--r-- | libvncclient/rfbproto.c | 24 | ||||
-rw-r--r-- | libvncclient/sockets.c | 1 | ||||
-rw-r--r-- | libvncclient/vncviewer.c | 11 |
4 files changed, 22 insertions, 15 deletions
diff --git a/libvncclient/listen.c b/libvncclient/listen.c index dc6508c..7e0ed1d 100644 --- a/libvncclient/listen.c +++ b/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__ diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c index 40783c6..72c06a1 100644 --- a/libvncclient/rfbproto.c +++ b/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 diff --git a/libvncclient/sockets.c b/libvncclient/sockets.c index 21047fb..977912d 100644 --- a/libvncclient/sockets.c +++ b/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> diff --git a/libvncclient/vncviewer.c b/libvncclient/vncviewer.c index 60f3279..4427335 100644 --- a/libvncclient/vncviewer.c +++ b/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=""; |