aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/localedef/collate.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-08-25 20:14:50 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-08-25 20:14:50 +0000
commit23a32822d2a98273412f5b7d5e4b0ea925d637a0 (patch)
tree420361e546af3d9b54e3a1573b672510b15062e4 /usr.bin/localedef/collate.c
parentb2aba19690dbcc11ce291d1725e7424f5df0f524 (diff)
parent8c8e84871058eafdfe69639ee3fab58c55165f49 (diff)
downloadsrc-23a32822d2a98273412f5b7d5e4b0ea925d637a0.tar.gz
src-23a32822d2a98273412f5b7d5e4b0ea925d637a0.zip
Merge from HEAD
Notes
Notes: svn path=/projects/collation/; revision=287142
Diffstat (limited to 'usr.bin/localedef/collate.c')
-rw-r--r--usr.bin/localedef/collate.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/localedef/collate.c b/usr.bin/localedef/collate.c
index 257a1679df86..1b88cf800bd1 100644
--- a/usr.bin/localedef/collate.c
+++ b/usr.bin/localedef/collate.c
@@ -1090,13 +1090,20 @@ wsncpy(wchar_t *s1, const wchar_t *s2, size_t n)
return (os1);
}
+#define RB_COUNT(x, name, head, cnt) do { \
+ (cnt) = 0; \
+ RB_FOREACH(x, name, (head)) { \
+ (cnt)++; \
+ } \
+} while (0)
+
#define RB_NUMNODES(type, name, head, cnt) do { \
type *t; \
cnt = 0; \
RB_FOREACH(t, name, head) { \
cnt++; \
} \
-} while (0);
+} while (0)
void
dump_collate(void)
@@ -1196,7 +1203,8 @@ dump_collate(void)
*/
for (i = 0; i < NUM_WT; i++) {
collate_subst_t *st = NULL;
- RB_NUMNODES(subst_t, substs, &substs[i], n);
+ subst_t *temp;
+ RB_COUNT(temp, substs, &substs[i], n);
collinfo.subst_count[i] = n;
if ((st = calloc(sizeof (collate_subst_t) * n, 1)) == NULL) {
fprintf(stderr, "out of memory");