From b0c5941e3ed5ba6077cb5ffdb5b0013ee99ed626 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Mon, 2 Apr 2018 21:31:50 +0100 Subject: [PATCH] libdtsvc: Compiler warning prevention --- cde/lib/DtSvc/DtUtil1/ActionDb.c | 5 +++-- cde/lib/DtSvc/DtUtil1/inttab.c | 3 ++- cde/lib/DtSvc/DtUtil1/strtab.c | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) 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); } -- 2.25.1