aboutsummaryrefslogtreecommitdiff
path: root/libXfont/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'libXfont/src/util')
-rw-r--r--libXfont/src/util/atom.c20
-rw-r--r--libXfont/src/util/miscutil.c2
2 files changed, 13 insertions, 9 deletions
diff --git a/libXfont/src/util/atom.c b/libXfont/src/util/atom.c
index c47cb5c80..37811f91e 100644
--- a/libXfont/src/util/atom.c
+++ b/libXfont/src/util/atom.c
@@ -118,19 +118,23 @@ ResizeHashTable (void)
static int
ResizeReverseMap (void)
{
- int ret = TRUE;
+ AtomListPtr *newMap;
+ int newMapSize;
+
if (reverseMapSize == 0)
- reverseMapSize = 1000;
+ newMapSize = 1000;
else
- reverseMapSize *= 2;
- reverseMap = realloc (reverseMap, reverseMapSize * sizeof (AtomListPtr));
- if (!reverseMap) {
+ newMapSize = reverseMapSize * 2;
+ newMap = realloc (reverseMap, newMapSize * sizeof (AtomListPtr));
+ if (newMap == NULL) {
fprintf(stderr, "ResizeReverseMap(): Error: Couldn't reallocate"
" reverseMap (%ld)\n",
- reverseMapSize * (unsigned long)sizeof(AtomListPtr));
- ret = FALSE;
+ newMapSize * (unsigned long)sizeof(AtomListPtr));
+ return FALSE;
}
- return ret;
+ reverseMap = newMap;
+ reverseMapSize = newMapSize;
+ return TRUE;
}
static int
diff --git a/libXfont/src/util/miscutil.c b/libXfont/src/util/miscutil.c
index 7173d3640..3d802d2f5 100644
--- a/libXfont/src/util/miscutil.c
+++ b/libXfont/src/util/miscutil.c
@@ -47,7 +47,7 @@ extern void BuiltinRegisterFpeFunctions(void);
#ifndef NO_WEAK_SYMBOLS
/* make sure everything initializes themselves at least once */
-weak long serverGeneration = 1;
+weak unsigned long serverGeneration = 1;
#endif
weak void