Module Name:    src
Committed By:   perseant
Date:           Tue Jan 23 03:12:11 UTC 2018

Modified Files:
        src/lib/libc/citrus [perseant-stdc-iso10646]: citrus_ctype.h
            citrus_none.c
        src/tests/lib/libc/locale [perseant-stdc-iso10646]: t_toupper.c

Log Message:
Make the tests pass once more when __STDC_ISO_10646__ is not defined.


To generate a diff of this commit:
cvs rdiff -u -r1.3.22.2 -r1.3.22.3 src/lib/libc/citrus/citrus_ctype.h
cvs rdiff -u -r1.22.2.2 -r1.22.2.3 src/lib/libc/citrus/citrus_none.c
cvs rdiff -u -r1.1 -r1.1.4.1 src/tests/lib/libc/locale/t_toupper.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_ctype.h
diff -u src/lib/libc/citrus/citrus_ctype.h:1.3.22.2 src/lib/libc/citrus/citrus_ctype.h:1.3.22.3
--- src/lib/libc/citrus/citrus_ctype.h:1.3.22.2	Mon Jul 31 04:23:35 2017
+++ src/lib/libc/citrus/citrus_ctype.h	Tue Jan 23 03:12:11 2018
@@ -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 @@ _citrus_ctype_kt2ucs(_citrus_ctype_t cc,
 }
 #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;

Index: src/lib/libc/citrus/citrus_none.c
diff -u src/lib/libc/citrus/citrus_none.c:1.22.2.2 src/lib/libc/citrus/citrus_none.c:1.22.2.3
--- src/lib/libc/citrus/citrus_none.c:1.22.2.2	Fri Jul 21 20:22:29 2017
+++ src/lib/libc/citrus/citrus_none.c	Tue Jan 23 03:12:11 2018
@@ -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 @@ _citrus_NONE_ctype_ucs2kt(void * __restr
 			  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 @@ _citrus_NONE_ctype_ucs2kt(void * __restr
 	else
 		*ktp = WEOF;
 	return 0;
+#endif /* __STDC_ISO_10646__ */
 }
 
 static int
@@ -522,6 +527,10 @@ _citrus_NONE_ctype_kt2ucs(void * __restr
 			  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 @@ _citrus_NONE_ctype_kt2ucs(void * __restr
 
 	*up = ((struct _NONE_Info *)cl)->forward[kt];
 	return 0;
+#endif /* __STDC_ISO_10646__ */
 }
 
 /* ---------------------------------------------------------------------- */

Index: src/tests/lib/libc/locale/t_toupper.c
diff -u src/tests/lib/libc/locale/t_toupper.c:1.1 src/tests/lib/libc/locale/t_toupper.c:1.1.4.1
--- src/tests/lib/libc/locale/t_toupper.c:1.1	Tue May 30 02:11:03 2017
+++ src/tests/lib/libc/locale/t_toupper.c	Tue Jan 23 03:12:11 2018
@@ -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 @@ h_swapcase(const struct test *t, int upp
 	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",

Reply via email to