1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

libDtHelp: Resolve 11 compiler warnings.

This commit is contained in:
Peter Howkins 2015-01-14 11:41:38 +00:00
parent 917e6cfc49
commit f8f04a5977
4 changed files with 10 additions and 6 deletions

View file

@ -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;
}
}

View file

@ -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);

View file

@ -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

View file

@ -50,6 +50,7 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#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);
}
/*****************************************************************************