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

libdtsvc: Compiler warning prevention

This commit is contained in:
Peter Howkins 2018-04-02 21:31:50 +01:00
parent bcee6be5d8
commit b0c5941e3e
3 changed files with 8 additions and 5 deletions

View file

@ -683,7 +683,8 @@ _DtActCheckRecord(
char argnFieldName[
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 */

View file

@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
@ -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));

View file

@ -28,6 +28,7 @@
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
@ -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);
}