This is the mail archive of the
newlib-cvs@sourceware.org
mailing list for the newlib project.
[newlib-cygwin] Constify __locale_ctype_ptr and __locale_ctype_ptr_l
- From: Corinna Vinschen <corinna at sourceware dot org>
- To: newlib-cvs at sourceware dot org
- Date: 17 Aug 2016 07:40:37 -0000
- Subject: [newlib-cygwin] Constify __locale_ctype_ptr and __locale_ctype_ptr_l
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b0d341442c7cd63f3e1c49c76cb40e870c4d5b19
commit b0d341442c7cd63f3e1c49c76cb40e870c4d5b19
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Wed Aug 17 09:40:28 2016 +0200
Constify __locale_ctype_ptr and __locale_ctype_ptr_l
Remove _MB_CAPABLE-only _CONST in ctype.h
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
newlib/libc/include/ctype.h | 7 ++-----
newlib/libc/locale/locale.c | 6 +++---
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/newlib/libc/include/ctype.h b/newlib/libc/include/ctype.h
index d34b8e5..31577d1 100644
--- a/newlib/libc/include/ctype.h
+++ b/newlib/libc/include/ctype.h
@@ -66,10 +66,7 @@ extern int toascii_l (int __c, locale_t __l);
#define _X 0100
#define _B 0200
-#ifndef _MB_CAPABLE
-_CONST
-#endif
-char *__locale_ctype_ptr (void);
+const char *__locale_ctype_ptr (void);
# define __CTYPE_PTR (__locale_ctype_ptr ())
#ifndef __cplusplus
@@ -103,7 +100,7 @@ char *__locale_ctype_ptr (void);
#endif
#if __POSIX_VISIBLE >= 200809
-char *__locale_ctype_ptr_l (locale_t);
+const char *__locale_ctype_ptr_l (locale_t);
#define __ctype_lookup_l(__c,__l) ((__locale_ctype_ptr_l(__l)+sizeof(""[__c]))[(int)(__c)])
#define isalpha_l(__c,__l) (__ctype_lookup_l(__c,__l)&(_U|_L))
diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c
index 795e163..58c2849 100644
--- a/newlib/libc/locale/locale.c
+++ b/newlib/libc/locale/locale.c
@@ -982,8 +982,8 @@ _DEFUN_VOID (__locale_mb_cur_max)
#endif
}
-char *
-_DEFUN_VOID (__locale_ctype_ptr)
+const char *
+__locale_ctype_ptr (void)
{
/* Only check if the current thread/reent has a locale. ctype_ptr is unused
in __global_locale, rather the global variable __ctype_ptr__ is used. */
@@ -992,7 +992,7 @@ _DEFUN_VOID (__locale_ctype_ptr)
: __ctype_ptr__;
}
-char *
+const char *
__locale_ctype_ptr_l (struct __locale_t *locale)
{
extern char *__ctype_ptr__;