From: Peter Howkins Date: Wed, 14 Jan 2015 11:41:38 +0000 (+0000) Subject: libDtHelp: Resolve 11 compiler warnings. X-Git-Tag: 2.2.3~40 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f8f04a5977136c5e22666eaf4066764e03445eb5;p=oweals%2Fcde.git libDtHelp: Resolve 11 compiler warnings. --- diff --git a/cde/lib/DtHelp/AccessCCDF.c b/cde/lib/DtHelp/AccessCCDF.c index e7c5d152..6f729d36 100644 --- a/cde/lib/DtHelp/AccessCCDF.c +++ b/cde/lib/DtHelp/AccessCCDF.c @@ -1377,7 +1377,7 @@ _DtHelpCeGetCcdfDocStamp ( *ret_time = (char *) malloc (sizeof(time_t) * 3 + 1); if (*ret_time != NULL) { - sprintf(*ret_time, "%u", buf.st_mtime); + sprintf(*ret_time, "%u", (unsigned) buf.st_mtime); return -2; } } diff --git a/cde/lib/DtHelp/Environ_c.c b/cde/lib/DtHelp/Environ_c.c index 4ffb05f6..07da371a 100644 --- a/cde/lib/DtHelp/Environ_c.c +++ b/cde/lib/DtHelp/Environ_c.c @@ -88,7 +88,10 @@ char * _DtCliSrvGetDtUserSession() return NULL; } *display = 0; - fgets(display, BUFSIZ, pp); + if(NULL == fgets(display, BUFSIZ, pp)) { + perror("fgets() failed to read"); + return NULL; + } while (isspace(display[strlen(display)-1])) display[strlen(display)-1] = 0; pclose(pp); diff --git a/cde/lib/DtHelp/GlobSearch.c b/cde/lib/DtHelp/GlobSearch.c index 5b60a89a..c4a65709 100644 --- a/cde/lib/DtHelp/GlobSearch.c +++ b/cde/lib/DtHelp/GlobSearch.c @@ -1074,7 +1074,7 @@ done: } /* WARNING: depends on pointers and integers the same size */ #ifdef __LP64__ - return (NULL == ((int64_t)hit|(int64_t)posFile|(int64_t)locationIdList)) ? -1 : 0; + return (0 == ((int64_t)hit|(int64_t)posFile|(int64_t)locationIdList)) ? -1 : 0; #else return (0 == ((int)hit|(int)posFile|(int)locationIdList)) ? -1 : 0; #endif diff --git a/cde/lib/DtHelp/bufio.c b/cde/lib/DtHelp/bufio.c index e1b6e639..f17d8ba2 100644 --- a/cde/lib/DtHelp/bufio.c +++ b/cde/lib/DtHelp/bufio.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include "bufioI.h" @@ -62,7 +63,7 @@ extern int errno; #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #endif -#define FileDes(f) ((int) (f)->hidden) +#define FileDes(f) ((intptr_t) (f)->hidden) #define CompressFileDes(f) (((CECompressInfoPtr) (f)->hidden)->fd) #define CompressSize(f) (((CECompressInfoPtr) (f)->hidden)->size) @@ -122,7 +123,7 @@ _DtHelpCeBufFileOpenWr (int fd) { BufFilePtr f; - f = _DtHelpCeBufFileCreate ((char *) fd, BufFileRawFlush, NULL, _DtHelpCeBufFileFlush); + f = _DtHelpCeBufFileCreate ((char *) (intptr_t) fd, BufFileRawFlush, NULL, _DtHelpCeBufFileFlush); f->bufp = f->buffer; f->left = BUFFILESIZE; return f; @@ -316,7 +317,7 @@ _DtHelpCeBufFileCreate ( BufFilePtr _DtHelpCeBufFileRdWithFd (int fd) { - return _DtHelpCeBufFileCreate ((char *) fd, FdRawRead, BufFileRawSkip, FdClose); + return _DtHelpCeBufFileCreate ((char *) (intptr_t) fd, FdRawRead, BufFileRawSkip, FdClose); } /*****************************************************************************