From: Peter Howkins Date: Mon, 2 Apr 2018 20:31:50 +0000 (+0100) Subject: libdtsvc: Compiler warning prevention X-Git-Tag: 2.2.4a~135 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b0c5941e3ed5ba6077cb5ffdb5b0013ee99ed626;p=oweals%2Fcde.git libdtsvc: Compiler warning prevention --- diff --git a/cde/lib/DtSvc/DtUtil1/ActionDb.c b/cde/lib/DtSvc/DtUtil1/ActionDb.c index 37078fe2..ebde6c9f 100644 --- a/cde/lib/DtSvc/DtUtil1/ActionDb.c +++ b/cde/lib/DtSvc/DtUtil1/ActionDb.c @@ -681,9 +681,10 @@ _DtActCheckRecord( int i; char *s; char argnFieldName[ - sizeof(_DtACTION_TTN_ARG) + /* ARGn prefix */ + sizeof(_DtACTION_TTN_ARG) + /* ARGn prefix */ 3 + /* space for 3 decimal digits */ - sizeof(_DtACTION_TTN_REP_TYPE)]; /* space for longest suffix */ + sizeof(_DtACTION_TTN_REP_TYPE) /* space for longest suffix */ + + 8]; /* addition space for warning prevention incase the digits are more than 3 */ char *buf; myassert(actionType); /* actionType should never be NULL */ diff --git a/cde/lib/DtSvc/DtUtil1/inttab.c b/cde/lib/DtSvc/DtUtil1/inttab.c index 98e43668..fc35c364 100644 --- a/cde/lib/DtSvc/DtUtil1/inttab.c +++ b/cde/lib/DtSvc/DtUtil1/inttab.c @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -103,7 +104,7 @@ _DtShmProtoAddInttab(DtShmProtoInttab intlist, unsigned int keyin, int datain) intlist_t * ptr = (intlist_t *) intlist; int ** data; - data = (int**)_DtUtilGetHash(ptr->tbl, (unsigned char *)keyin); + data = (int**)_DtUtilGetHash(ptr->tbl, (unsigned char *) (intptr_t) keyin); if(!*data) /* new */ { *data = (int *) malloc(sizeof(int)); diff --git a/cde/lib/DtSvc/DtUtil1/strtab.c b/cde/lib/DtSvc/DtUtil1/strtab.c index a1628d3a..afe90467 100644 --- a/cde/lib/DtSvc/DtUtil1/strtab.c +++ b/cde/lib/DtSvc/DtUtil1/strtab.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -174,7 +175,7 @@ _DtShmProtoAddStrtab(DtShmProtoStrtab strlist, const char * string, int * isnew) unsigned char ** sptr; *isnew = 1; *bucket = ret = ptr->sl_charcount; - sptr = (unsigned char**)_DtUtilGetHash(ptr->sl_bosons, (const unsigned char *)ret); + sptr = (unsigned char**)_DtUtilGetHash(ptr->sl_bosons, (const unsigned char *) (intptr_t) ret); *sptr = (unsigned char*)strdup(string); ptr->sl_charcount += strlen(string) + 1; } @@ -193,7 +194,7 @@ _DtShmProtoLookUpStrtab (DtShmProtoStrtab prototab, DtShmBoson boson) strlist_t * ptr = (strlist_t *) prototab; unsigned char ** sptr; - sptr = (unsigned char **) _DtUtilFindHash(ptr->sl_bosons, (const unsigned char *) boson); + sptr = (unsigned char **) _DtUtilFindHash(ptr->sl_bosons, (const unsigned char *) (intptr_t) boson); return(sptr?((const char *)*sptr):NULL); }