Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src 1. {wctype, wctrans, mbstate}_t: switch MD to MI like other
details: https://anonhg.NetBSD.org/src/rev/922e03dc8146
branches: trunk
changeset: 753424:922e03dc8146
user: tnozaki <tnozaki%NetBSD.org@localhost>
date: Sat Mar 27 22:14:09 2010 +0000
description:
1. {wctype,wctrans,mbstate}_t: switch MD to MI like other
libc implementation (such as *BSD and glibc2).
2. don't typedef void * wc{type,trans}_t, suggested by soda@-san.
it may pass through compiler type check, it's harmful.
so i introduce dummy struct __tag_wc{type,trans}_t(iconv_t already does).
no ABI change was made.
diffstat:
include/wchar.h | 4 ++--
include/wctype.h | 4 ++--
lib/libc/locale/iswctype_mb.c | 8 ++++----
sys/arch/alpha/include/ansi.h | 14 +-------------
sys/arch/amd64/include/ansi.h | 14 +-------------
sys/arch/arm/include/ansi.h | 14 +-------------
sys/arch/hppa/include/ansi.h | 14 +-------------
sys/arch/i386/include/ansi.h | 14 +-------------
sys/arch/ia64/include/ansi.h | 13 +------------
sys/arch/m68k/include/ansi.h | 14 +-------------
sys/arch/mips/include/ansi.h | 14 +-------------
sys/arch/powerpc/include/ansi.h | 14 +-------------
sys/arch/sh3/include/ansi.h | 14 +-------------
sys/arch/sparc/include/ansi.h | 14 +-------------
sys/arch/sparc64/include/ansi.h | 14 +-------------
sys/arch/vax/include/ansi.h | 14 +-------------
sys/sys/ansi.h | 23 +++++++++++++++++++++--
17 files changed, 42 insertions(+), 178 deletions(-)
diffs (truncated from 466 to 300 lines):
diff -r cc20316a73a8 -r 922e03dc8146 include/wchar.h
--- a/include/wchar.h Sat Mar 27 20:17:31 2010 +0000
+++ b/include/wchar.h Sat Mar 27 22:14:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wchar.h,v 1.28 2009/11/15 22:21:03 christos Exp $ */
+/* $NetBSD: wchar.h,v 1.29 2010/03/27 22:14:09 tnozaki Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@@ -60,8 +60,8 @@
#include <sys/cdefs.h>
#include <sys/featuretest.h>
-#include <machine/ansi.h>
#include <machine/wchar_limits.h>
+#include <sys/ansi.h>
#include <sys/null.h>
#include <stdio.h> /* for FILE* */
diff -r cc20316a73a8 -r 922e03dc8146 include/wctype.h
--- a/include/wctype.h Sat Mar 27 20:17:31 2010 +0000
+++ b/include/wctype.h Sat Mar 27 22:14:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wctype.h,v 1.6 2005/02/03 04:39:32 perry Exp $ */
+/* $NetBSD: wctype.h,v 1.7 2010/03/27 22:14:09 tnozaki Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@@ -32,7 +32,7 @@
#define _WCTYPE_H_
#include <sys/cdefs.h>
-#include <machine/ansi.h>
+#include <sys/ansi.h>
#ifdef _BSD_WINT_T_
typedef _BSD_WINT_T_ wint_t;
diff -r cc20316a73a8 -r 922e03dc8146 lib/libc/locale/iswctype_mb.c
--- a/lib/libc/locale/iswctype_mb.c Sat Mar 27 20:17:31 2010 +0000
+++ b/lib/libc/locale/iswctype_mb.c Sat Mar 27 22:14:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iswctype_mb.c,v 1.5 2009/01/18 22:03:19 tnozaki Exp $ */
+/* $NetBSD: iswctype_mb.c,v 1.6 2010/03/27 22:14:09 tnozaki Exp $ */
/*-
* Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: iswctype_mb.c,v 1.5 2009/01/18 22:03:19 tnozaki Exp $");
+__RCSID("$NetBSD: iswctype_mb.c,v 1.6 2010/03/27 22:14:09 tnozaki Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -130,7 +130,7 @@
return 0;
}
rl = _RUNE_LOCALE();
- te = (_WCTypeEntry const *)charclass;
+ te = (_WCTypeEntry const *)(void *)charclass;
return _iswctype_priv(rl, wc, te);
}
@@ -145,7 +145,7 @@
return wc;
}
rl = _RUNE_LOCALE();
- te = (_WCTransEntry const *)charmap;
+ te = (_WCTransEntry const *)(void *)charmap;
return _towctrans_priv(rl, wc, te);
}
diff -r cc20316a73a8 -r 922e03dc8146 sys/arch/alpha/include/ansi.h
--- a/sys/arch/alpha/include/ansi.h Sat Mar 27 20:17:31 2010 +0000
+++ b/sys/arch/alpha/include/ansi.h Sat Mar 27 22:14:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ansi.h,v 1.22 2009/01/11 02:45:45 christos Exp $ */
+/* $NetBSD: ansi.h,v 1.23 2010/03/27 22:14:09 tnozaki Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -68,17 +68,5 @@
#define _BSD_USECONDS_T_ unsigned int /* useconds_t */
#define _BSD_WCHAR_T_ int /* wchar_t */
#define _BSD_WINT_T_ int /* wint_t */
-#define _BSD_WCTRANS_T_ void * /* wctrans_t */
-#define _BSD_WCTYPE_T_ void * /* wctype_t */
-
-/*
- * mbstate_t is an opaque object to keep conversion state, during multibyte
- * stream conversions. The content must not be referenced by user programs.
- */
-typedef union {
- __int64_t __mbstateL; /* for alignment */
- char __mbstate8[128];
-} __mbstate_t;
-#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
#endif /* _ANSI_H_ */
diff -r cc20316a73a8 -r 922e03dc8146 sys/arch/amd64/include/ansi.h
--- a/sys/arch/amd64/include/ansi.h Sat Mar 27 20:17:31 2010 +0000
+++ b/sys/arch/amd64/include/ansi.h Sat Mar 27 22:14:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ansi.h,v 1.8 2009/01/11 02:45:45 christos Exp $ */
+/* $NetBSD: ansi.h,v 1.9 2010/03/27 22:14:09 tnozaki Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -65,18 +65,6 @@
#define _BSD_USECONDS_T_ unsigned int /* useconds_t */
#define _BSD_WCHAR_T_ int /* wchar_t */
#define _BSD_WINT_T_ int /* wint_t */
-#define _BSD_WCTRANS_T_ void * /* wctrans_t */
-#define _BSD_WCTYPE_T_ void * /* wctype_t */
-
-/*
- * mbstate_t is an opaque object to keep conversion state, during multibyte
- * stream conversions. The content must not be referenced by user programs.
- */
-typedef union {
- __int64_t __mbstateL; /* for alignment */
- char __mbstate8[128];
-} __mbstate_t;
-#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
#else /* !__x86_64__ */
diff -r cc20316a73a8 -r 922e03dc8146 sys/arch/arm/include/ansi.h
--- a/sys/arch/arm/include/ansi.h Sat Mar 27 20:17:31 2010 +0000
+++ b/sys/arch/arm/include/ansi.h Sat Mar 27 22:14:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ansi.h,v 1.11 2009/01/11 02:45:45 christos Exp $ */
+/* $NetBSD: ansi.h,v 1.12 2010/03/27 22:14:09 tnozaki Exp $ */
/*
* Copyright (c) 1990, 1993
@@ -63,17 +63,5 @@
#define _BSD_USECONDS_T_ unsigned int /* useconds_t */
#define _BSD_WCHAR_T_ int /* wchar_t */
#define _BSD_WINT_T_ int /* wint_t */
-#define _BSD_WCTRANS_T_ void * /* wctrans_t */
-#define _BSD_WCTYPE_T_ void * /* wctype_t */
-
-/*
- * mbstate_t is an opaque object to keep conversion state, during multibyte
- * stream conversions. The content must not be referenced by user programs.
- */
-typedef union {
- __int64_t __mbstateL; /* for alignment */
- char __mbstate8[128];
-} __mbstate_t;
-#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
#endif /* _ANSI_H_ */
diff -r cc20316a73a8 -r 922e03dc8146 sys/arch/hppa/include/ansi.h
--- a/sys/arch/hppa/include/ansi.h Sat Mar 27 20:17:31 2010 +0000
+++ b/sys/arch/hppa/include/ansi.h Sat Mar 27 22:14:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ansi.h,v 1.11 2009/01/11 02:45:45 christos Exp $ */
+/* $NetBSD: ansi.h,v 1.12 2010/03/27 22:14:09 tnozaki Exp $ */
/* $OpenBSD: ansi.h,v 1.4 2000/02/22 17:29:12 millert Exp $ */
@@ -64,17 +64,5 @@
#define _BSD_USECONDS_T_ unsigned int /* useconds_t */
#define _BSD_WCHAR_T_ int /* wchar_t */
#define _BSD_WINT_T_ int /* wint_t */
-#define _BSD_WCTRANS_T_ void * /* wctrans_t */
-#define _BSD_WCTYPE_T_ void * /* wctype_t */
-
-/*
- * mbstate_t is an opaque object to keep conversion state, during multibyte
- * stream conversions. The content must not be referenced by user programs.
- */
-typedef union {
- double __mbstateL; /* for alignment */
- char __mbstate8[128];
-} __mbstate_t;
-#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
#endif /* _ANSI_H_ */
diff -r cc20316a73a8 -r 922e03dc8146 sys/arch/i386/include/ansi.h
--- a/sys/arch/i386/include/ansi.h Sat Mar 27 20:17:31 2010 +0000
+++ b/sys/arch/i386/include/ansi.h Sat Mar 27 22:14:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ansi.h,v 1.23 2009/01/11 02:45:45 christos Exp $ */
+/* $NetBSD: ansi.h,v 1.24 2010/03/27 22:14:09 tnozaki Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -63,17 +63,5 @@
#define _BSD_USECONDS_T_ unsigned int /* useconds_t */
#define _BSD_WCHAR_T_ int /* wchar_t */
#define _BSD_WINT_T_ int /* wint_t */
-#define _BSD_WCTRANS_T_ void * /* wctrans_t */
-#define _BSD_WCTYPE_T_ void * /* wctype_t */
-
-/*
- * mbstate_t is an opaque object to keep conversion state, during multibyte
- * stream conversions. The content must not be referenced by user programs.
- */
-typedef union {
- __int64_t __mbstateL; /* for alignment */
- char __mbstate8[128];
-} __mbstate_t;
-#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
#endif /* _I386_ANSI_H_ */
diff -r cc20316a73a8 -r 922e03dc8146 sys/arch/ia64/include/ansi.h
--- a/sys/arch/ia64/include/ansi.h Sat Mar 27 20:17:31 2010 +0000
+++ b/sys/arch/ia64/include/ansi.h Sat Mar 27 22:14:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ansi.h,v 1.6 2009/01/11 02:45:45 christos Exp $ */
+/* $NetBSD: ansi.h,v 1.7 2010/03/27 22:14:09 tnozaki Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -73,16 +73,5 @@
#define _BSD_USECONDS_T_ unsigned int /* useconds_t */
#define _BSD_WCHAR_T_ int /* wchar_t */
#define _BSD_WINT_T_ int /* wint_t */
-#define _BSD_WCTRANS_T_ void * /* wctrans_t */
-#define _BSD_WCTYPE_T_ void * /* wctype_t */
-/*
- * mbstate_t is an opaque object to keep conversion state, during multibyte
- * stream conversions. The content must not be referenced by user programs.
- */
-typedef union {
- __int64_t __mbstateL; /* for alignment */
- char __mbstate8[128];
-} __mbstate_t;
-#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
#endif /* _ANSI_H_ */
diff -r cc20316a73a8 -r 922e03dc8146 sys/arch/m68k/include/ansi.h
--- a/sys/arch/m68k/include/ansi.h Sat Mar 27 20:17:31 2010 +0000
+++ b/sys/arch/m68k/include/ansi.h Sat Mar 27 22:14:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ansi.h,v 1.21 2009/01/11 02:45:46 christos Exp $ */
+/* $NetBSD: ansi.h,v 1.22 2010/03/27 22:14:10 tnozaki Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -62,17 +62,5 @@
#define _BSD_USECONDS_T_ unsigned int /* useconds_t */
#define _BSD_WCHAR_T_ int /* wchar_t */
#define _BSD_WINT_T_ int /* wint_t */
-#define _BSD_WCTRANS_T_ void * /* wctrans_t */
-#define _BSD_WCTYPE_T_ void * /* wctype_t */
-
-/*
- * mbstate_t is an opaque object to keep conversion state, during multibyte
- * stream conversions. The content must not be referenced by user programs.
- */
-typedef union {
- __int64_t __mbstateL; /* for alignment */
- char __mbstate8[128];
-} __mbstate_t;
-#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
#endif /* _ANSI_H_ */
diff -r cc20316a73a8 -r 922e03dc8146 sys/arch/mips/include/ansi.h
--- a/sys/arch/mips/include/ansi.h Sat Mar 27 20:17:31 2010 +0000
+++ b/sys/arch/mips/include/ansi.h Sat Mar 27 22:14:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ansi.h,v 1.26 2009/12/14 20:42:12 matt Exp $ */
+/* $NetBSD: ansi.h,v 1.27 2010/03/27 22:14:10 tnozaki Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -68,17 +68,5 @@
#define _BSD_USECONDS_T_ unsigned int /* useconds_t */
#define _BSD_WCHAR_T_ int /* wchar_t */
#define _BSD_WINT_T_ int /* wint_t */
-#define _BSD_WCTRANS_T_ void * /* wctrans_t */
-#define _BSD_WCTYPE_T_ void * /* wctype_t */
-
-/*
- * mbstate_t is an opaque object to keep conversion state, during multibyte
- * stream conversions. The content must not be referenced by user programs.
- */
-typedef union {
- __int64_t __mbstateL; /* for alignment */
- char __mbstate8[128];
-} __mbstate_t;
-#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
#endif /* _ANSI_H_ */
diff -r cc20316a73a8 -r 922e03dc8146 sys/arch/powerpc/include/ansi.h
--- a/sys/arch/powerpc/include/ansi.h Sat Mar 27 20:17:31 2010 +0000
+++ b/sys/arch/powerpc/include/ansi.h Sat Mar 27 22:14:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ansi.h,v 1.27 2009/01/11 02:45:46 christos Exp $ */
+/* $NetBSD: ansi.h,v 1.28 2010/03/27 22:14:10 tnozaki Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -74,17 +74,5 @@
#endif
Home |
Main Index |
Thread Index |
Old Index