From 674d0457f0ca92368a8fb2869455ae8e8b401ae8 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 16 Mar 2012 19:33:45 -0700 Subject: [PATCH] Mark constant data as const The sticks it in the .rodata section, allowing it to be placed in rom. Signed-off-by: Keith Packard --- functions/_PDCLIB/digits.c | 4 ++-- includes/locale.h | 2 +- internals/_PDCLIB_int.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/functions/_PDCLIB/digits.c b/functions/_PDCLIB/digits.c index 940e962..64afb42 100644 --- a/functions/_PDCLIB/digits.c +++ b/functions/_PDCLIB/digits.c @@ -11,10 +11,10 @@ #include <_PDCLIB_int.h> #endif -char _PDCLIB_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; +const char _PDCLIB_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; /* For _PDCLIB/print.c only; obsolete with ctype.h */ -char _PDCLIB_Xdigits[] = "0123456789ABCDEF"; +const char _PDCLIB_Xdigits[] = "0123456789ABCDEF"; #ifdef TEST #include <_PDCLIB_test.h> diff --git a/includes/locale.h b/includes/locale.h index 82fc21b..b5a125d 100644 --- a/includes/locale.h +++ b/includes/locale.h @@ -66,7 +66,7 @@ struct lconv }; /* This is strictly internal, and visible here for technical reasons only. */ -extern struct lconv _PDCLIB_lconv; +extern const struct lconv _PDCLIB_lconv; /* First arguments to setlocale(). TODO: Beware, values might change before v0.6 is released. diff --git a/internals/_PDCLIB_int.h b/internals/_PDCLIB_int.h index a46c2dc..b510c52 100644 --- a/internals/_PDCLIB_int.h +++ b/internals/_PDCLIB_int.h @@ -360,8 +360,8 @@ const char * _PDCLIB_strtox_prelim( const char * p, char * sign, int * base ); _PDCLIB_uintmax_t _PDCLIB_strtox_main( const char ** p, unsigned int base, _PDCLIB_uintmax_t error, _PDCLIB_uintmax_t limval, int limdigit, char * sign ); /* Digits arrays used by various integer conversion functions */ -extern char _PDCLIB_digits[]; -extern char _PDCLIB_Xdigits[]; +extern const char _PDCLIB_digits[]; +extern const char _PDCLIB_Xdigits[]; /* The worker for all printf() type of functions. The pointer spec should point to the introducing '%' of a conversion specifier. The status structure is to -- 2.30.2