From d6040f178121e25478673ba0668acb7e54a299b8 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 1 Oct 2000 18:47:09 +0000 Subject: Update. 2000-09-30 Bruno Haible * tests-mbwc/tst_wcscmp.c (tst_wcscmp): Take the sign of ret. * tests-mbwc/dat_wcscmp.c (tst_wcscmp_loc): Don't expect precise return values. Only the sign matters. --- locale/programs/ld-ctype.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'locale') diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c index 644bfbf..1d10cec 100644 --- a/locale/programs/ld-ctype.c +++ b/locale/programs/ld-ctype.c @@ -3364,8 +3364,11 @@ struct wctype_table static inline void wctype_table_init (struct wctype_table *t) { + t->level1 = NULL; t->level1_alloc = t->level1_size = 0; + t->level2 = NULL; t->level2_alloc = t->level2_size = 0; + t->level3 = NULL; t->level3_alloc = t->level3_size = 0; } @@ -3413,10 +3416,8 @@ wctype_table_add (struct wctype_table *t, uint32_t wc) size_t alloc = 2 * t->level1_alloc; if (alloc <= index1) alloc = index1 + 1; - t->level1 = (t->level1_alloc > 0 - ? (uint32_t *) xrealloc ((char *) t->level1, - alloc * sizeof (uint32_t)) - : (uint32_t *) xmalloc (alloc * sizeof (uint32_t))); + t->level1 = (uint32_t *) xrealloc ((char *) t->level1, + alloc * sizeof (uint32_t)); t->level1_alloc = alloc; } while (index1 >= t->level1_size) @@ -3428,10 +3429,8 @@ wctype_table_add (struct wctype_table *t, uint32_t wc) if (t->level2_size == t->level2_alloc) { size_t alloc = 2 * t->level2_alloc + 1; - t->level2 = (t->level2_alloc > 0 - ? (uint32_t *) xrealloc ((char *) t->level2, - (alloc << t->q) * sizeof (uint32_t)) - : (uint32_t *) xmalloc ((alloc << t->q) * sizeof (uint32_t))); + t->level2 = (uint32_t *) xrealloc ((char *) t->level2, + (alloc << t->q) * sizeof (uint32_t)); t->level2_alloc = alloc; } i1 = t->level2_size << t->q; @@ -3448,10 +3447,8 @@ wctype_table_add (struct wctype_table *t, uint32_t wc) if (t->level3_size == t->level3_alloc) { size_t alloc = 2 * t->level3_alloc + 1; - t->level3 = (t->level3_alloc > 0 - ? (uint32_t *) xrealloc ((char *) t->level3, - (alloc << t->p) * sizeof (uint32_t)) - : (uint32_t *) xmalloc ((alloc << t->p) * sizeof (uint32_t))); + t->level3 = (uint32_t *) xrealloc ((char *) t->level3, + (alloc << t->p) * sizeof (uint32_t)); t->level3_alloc = alloc; } i1 = t->level3_size << t->p; -- cgit v1.1