summaryrefslogtreecommitdiff
path: root/src/Convert.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2019-05-06 05:16:24 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2019-05-06 18:03:53 -0400
commit9112c3c104f0b3ec45ae776279e276034bc7dcc5 (patch)
tree55b4ba329cbaecaadb0093132f1b6c01cf8bb9b4 /src/Convert.c
parent37dce673d841e7df75091a3b31828431e71bd78f (diff)
fixes for gcc warnings, no object-change
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/Convert.c')
-rw-r--r--src/Convert.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Convert.c b/src/Convert.c
index 3adfb92..ebfc984 100644
--- a/src/Convert.c
+++ b/src/Convert.c
@@ -80,6 +80,7 @@ in this Software without prior written authorization from The Open Group.
#define CONVERTHASHSIZE ((unsigned)256)
#define CONVERTHASHMASK 255
#define ProcHash(from_type, to_type) (2 * (from_type) + to_type)
+#define HashCode(converter, from) (int)(((long)(converter) >> 2) + from->size + *((char *) from->addr))
typedef struct _ConverterRec *ConverterPtr;
typedef struct _ConverterRec {
@@ -640,7 +641,7 @@ void XtDirectConvert(
LOCK_PROCESS;
/* Try to find cache entry for conversion */
- hash = ((long) converter >> 2) + from->size + *((char *) from->addr);
+ hash = HashCode(converter, from);
if (from->size > 1) hash += ((char *) from->addr)[1];
for (p = cacheHashTable[hash & CACHEHASHMASK]; p; p = p->next) {
@@ -737,7 +738,7 @@ CallConverter(
LOCK_PROCESS;
/* Try to find cache entry for conversion */
- hash = ((long)(converter) >> 2) + from->size + *((char *) from->addr);
+ hash = HashCode(converter, from);
if (from->size > 1) hash += ((char *) from->addr)[1];
if (cP->cache_type != XtCacheNone) {