Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/perseant-stdc-iso10646]: src Make the tests pass once more when __STDC_I...
details: https://anonhg.NetBSD.org/src/rev/28f8e42e0462
branches: perseant-stdc-iso10646
changeset: 850686:28f8e42e0462
user: perseant <perseant%NetBSD.org@localhost>
date: Tue Jan 23 03:12:11 2018 +0000
description:
Make the tests pass once more when __STDC_ISO_10646__ is not defined.
diffstat:
lib/libc/citrus/citrus_ctype.h | 6 +++---
lib/libc/citrus/citrus_none.c | 14 ++++++++++++--
tests/lib/libc/locale/t_toupper.c | 5 +++--
3 files changed, 18 insertions(+), 7 deletions(-)
diffs (102 lines):
diff -r 0cb6544a8f7e -r 28f8e42e0462 lib/libc/citrus/citrus_ctype.h
--- a/lib/libc/citrus/citrus_ctype.h Sun Jan 21 19:35:10 2018 +0000
+++ b/lib/libc/citrus/citrus_ctype.h Tue Jan 23 03:12:11 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_ctype.h,v 1.3.22.2 2017/07/31 04:23:35 perseant Exp $ */
+/* $NetBSD: citrus_ctype.h,v 1.3.22.3 2018/01/23 03:12:11 perseant Exp $ */
/*-
* Copyright (c)2002 Citrus Project,
@@ -206,8 +206,8 @@
}
#else
/* Define away the calls to these functions */
-#define _citrus_ctype_ucs2kt(cl, ktp, wc) do {} while (0)
-#define _citrus_ctype_kt2ucs(cl, up, kt) do {} while (0)
+#define _citrus_ctype_ucs2kt(cl, ktp, wc) do { *ktp = wc; } while (0)
+#define _citrus_ctype_kt2ucs(cl, up, kt) do { *up = kt; } while (0)
#endif
extern _citrus_ctype_rec_t _citrus_ctype_default;
diff -r 0cb6544a8f7e -r 28f8e42e0462 lib/libc/citrus/citrus_none.c
--- a/lib/libc/citrus/citrus_none.c Sun Jan 21 19:35:10 2018 +0000
+++ b/lib/libc/citrus/citrus_none.c Tue Jan 23 03:12:11 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_none.c,v 1.22.2.2 2017/07/21 20:22:29 perseant Exp $ */
+/* $NetBSD: citrus_none.c,v 1.22.2.3 2018/01/23 03:12:11 perseant Exp $ */
/*-
* Copyright (c)2002 Citrus Project,
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_none.c,v 1.22.2.2 2017/07/21 20:22:29 perseant Exp $");
+__RCSID("$NetBSD: citrus_none.c,v 1.22.2.3 2018/01/23 03:12:11 perseant Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
@@ -493,6 +493,10 @@
wchar_kuten_t * __restrict ktp,
wchar_ucs4_t wc)
{
+#ifndef __STDC_ISO_10646__
+ *ktp = wc;
+ return 0;
+#else /* __STDC_ISO_10646__ */
struct _NONE_Info *nip = (struct _NONE_Info *)cl;
struct unicode2kuten_lookup *uk = NULL;
@@ -514,6 +518,7 @@
else
*ktp = WEOF;
return 0;
+#endif /* __STDC_ISO_10646__ */
}
static int
@@ -522,6 +527,10 @@
wchar_ucs4_t * __restrict up,
wchar_kuten_t kt)
{
+#ifndef __STDC_ISO_10646__
+ *up = kt;
+ return 0;
+#else /* __STDC_ISO_10646__ */
if (cl == NULL) {
*up = kt;
return 0;
@@ -529,6 +538,7 @@
*up = ((struct _NONE_Info *)cl)->forward[kt];
return 0;
+#endif /* __STDC_ISO_10646__ */
}
/* ---------------------------------------------------------------------- */
diff -r 0cb6544a8f7e -r 28f8e42e0462 tests/lib/libc/locale/t_toupper.c
--- a/tests/lib/libc/locale/t_toupper.c Sun Jan 21 19:35:10 2018 +0000
+++ b/tests/lib/libc/locale/t_toupper.c Tue Jan 23 03:12:11 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_toupper.c,v 1.1 2017/05/30 02:11:03 perseant Exp $ */
+/* $NetBSD: t_toupper.c,v 1.1.4.1 2018/01/23 03:12:11 perseant Exp $ */
/*-
* Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2017\
The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_toupper.c,v 1.1 2017/05/30 02:11:03 perseant Exp $");
+__RCSID("$NetBSD: t_toupper.c,v 1.1.4.1 2018/01/23 03:12:11 perseant Exp $");
#include <locale.h>
#include <stdio.h>
@@ -71,6 +71,7 @@
ATF_REQUIRE_STREQ(setlocale(LC_ALL, "C"), "C");
printf("Trying locale %s...\n", t->locale);
ATF_REQUIRE(setlocale(LC_CTYPE, t->locale) != NULL);
+ printf("Using locale: %s\n", setlocale(LC_ALL, NULL));
for (i = 0; i < strlen(t->lower); i++) {
printf("Comparing char %d, lower %2.2x, with upper %2.2x\n",
Home |
Main Index |
Thread Index |
Old Index