summaryrefslogtreecommitdiff
path: root/src/Convert.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2019-03-17 17:19:45 -0400
committerAlan Coopersmith <alan.coopersmith@oracle.com>2019-04-06 10:31:25 -0700
commitcf9e8c73c4ffa671d580938c9a84d6ef0bd2710d (patch)
tree21cd4cab8b92df9f9050ea8df40d9cc35bed451d /src/Convert.c
parentfb7e899e94dd402c868e8eb59ccf32284732f6ac (diff)
This cleans up the "easy" warning fixes which can be made using my
Regress script, comparing object-files before/after the edits: https://invisible-island.net/ansification/index.html https://invisible-island.net/scripts/readme.html The changes are casts, which quiet the gcc warnings about implicit conversion that my "gcc-normal" script would show. I avoided reformatting the code. The change reduces the number of gcc warnings from 769 to 163. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/Convert.c')
-rw-r--r--src/Convert.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Convert.c b/src/Convert.c
index 70004da..f9cafe3 100644
--- a/src/Convert.c
+++ b/src/Convert.c
@@ -207,15 +207,15 @@ void _XtTableAddConverter(
XtFree((char *)p);
}
- p = (ConverterPtr) __XtMalloc(sizeof(ConverterRec) +
- sizeof(XtConvertArgRec) * num_args);
+ p = (ConverterPtr) __XtMalloc((Cardinal)(sizeof(ConverterRec) +
+ sizeof(XtConvertArgRec) * num_args));
p->next = *pp;
*pp = p;
p->from = from_type;
p->to = to_type;
p->converter = converter;
p->destructor = destructor;
- p->num_args = num_args;
+ p->num_args = (unsigned short) num_args;
p->global = global;
args = ConvertArgs(p);
while (num_args--)
@@ -223,7 +223,7 @@ void _XtTableAddConverter(
p->new_style = new_style;
p->do_ref_count = False;
if (destructor || (cache_type & 0xff)) {
- p->cache_type = cache_type & 0xff;
+ p->cache_type = (char) (cache_type & 0xff);
if (cache_type & XtCacheRefCount)
p->do_ref_count = True;
} else {
@@ -367,7 +367,7 @@ CacheEnter(
pHashEntry = &cacheHashTable[hash & CACHEHASHMASK];
if ((succeeded && destructor) || do_ref) {
- p = (CachePtr) _XtHeapAlloc(heap, (sizeof(CacheRec) +
+ p = (CachePtr) _XtHeapAlloc(heap, (Cardinal) (sizeof(CacheRec) +
sizeof(CacheRecExt) +
num_args * sizeof(XrmValue)));
CEXT(p)->prev = pHashEntry;
@@ -377,7 +377,7 @@ CacheEnter(
p->has_ext = True;
}
else {
- p = (CachePtr)_XtHeapAlloc(heap, (sizeof(CacheRec) +
+ p = (CachePtr)_XtHeapAlloc(heap, (Cardinal) (sizeof(CacheRec) +
num_args * sizeof(XrmValue)));
p->has_ext = False;
}
@@ -403,7 +403,7 @@ CacheEnter(
p->from.addr = (XPointer)_XtHeapAlloc(heap, from->size);
(void) memmove((char *)p->from.addr, (char *)from->addr, from->size);
}
- p->num_args = num_args;
+ p->num_args = (unsigned short) num_args;
if (num_args) {
XrmValue *pargs = CARGS(p);
for (i = 0; i < num_args; i++) {
@@ -540,7 +540,7 @@ static Boolean ResourceQuarkToOffset(
for (i = 0; i < wc->core_class.num_resources; i++, resources++) {
res = *resources;
if (res->xrm_name == name) {
- *offset = -res->xrm_offset - 1;
+ *offset = (Cardinal) (-res->xrm_offset - 1);
return True;
}
} /* for i in resources */