svn commit: r274428 - projects/arm64/sys/arm64/include
Bruce Evans
brde at optusnet.com.au
Thu Nov 13 00:37:25 UTC 2014
On Wed, 12 Nov 2014, Andrew Turner wrote:
> Log:
> Fix the values for __WCHAR_{MIN,MAX}
>
> Modified:
> projects/arm64/sys/arm64/include/_types.h
>
> Modified: projects/arm64/sys/arm64/include/_types.h
> ==============================================================================
> --- projects/arm64/sys/arm64/include/_types.h Wed Nov 12 12:46:57 2014 (r274427)
> +++ projects/arm64/sys/arm64/include/_types.h Wed Nov 12 13:19:18 2014 (r274428)
> @@ -94,8 +94,8 @@ typedef __uint64_t __vm_pindex_t;
> typedef __uint64_t __vm_size_t;
> typedef unsigned int ___wchar_t;
>
> -#define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */
> -#define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */
> +#define __WCHAR_MIN __UINT_MIN /* min value for a wchar_t */
> +#define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */
>
> /*
> * Unusual type definitions.
This looks bad.
3 underscores for ___wchar_t is execessive. All arches have this bug. It
is not even needed to give an extra level of obfuscation below __wchar_t,
since the usual spelling __wchar_t is never used.
UINT_MIN doesn't exist. The minimum for any unsigned type is 0, so there
is no need for a macro giving it. __UINT_MIN shouldn't exist either. It
doesn't exist for any other arch.
The comments on the limits are duplicated ad nauseum, except in the one
place where they might be useful -- they are duplicated for each arch
in the implementation-detail header <machine/_types.h>, but not in the
application header <wchar.h>.
(The application header has no comments useful to users at all. All
of its comments are for implementation details:
- First coptright comment
- Second copyright comment (not properly merged)
- 2 LONGLONG comments (markup for lint)
- One comment on an #endif.)
In <limits.h>, the spam is a little more uniform. Most definitions at the
top level have no comments. However, most definitions aren't at the top
level. Most of the STDC definitions are in the included file
<sys/limits.h>. This has the duplicated comments, except of course it
has no comments for nonstandard macros that need comments most (LONG_BIT,
WORD_BIT and MQ_PRIO_MAX; the placement of MQ_PRIO_MAX there is just a
bug -- all other POSIX limits are in either <limits.h> or <sys/syslimits.h>,
depending on whether they are implemented used in the kernel; MQ_PRIO_MAX
is also under a broken visibility ifdef that makes it visible to all
versions of POSIX).
Bruce
More information about the svn-src-projects
mailing list