Mark constant data as const
authorKeith Packard <keithp@keithp.com>
Sat, 17 Mar 2012 02:33:45 +0000 (19:33 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 17 Mar 2012 02:33:45 +0000 (19:33 -0700)
The sticks it in the .rodata section, allowing it to be placed in rom.

Signed-off-by: Keith Packard <keithp@keithp.com>
functions/_PDCLIB/digits.c
includes/locale.h
internals/_PDCLIB_int.h

index 940e962bd943f55e2d9469339621af72bbeba0e3..64afb421e0cd1d3520ebaee951edab1c46f47581 100644 (file)
 #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>
index 82fc21ba44da0c7438fa6ed653f4ff5ff1298f13..b5a125d820110549d1577b7c97539d15919af6c2 100644 (file)
@@ -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.
index a46c2dc6c7f93014a58cb85a3949e976891ce821..b510c52eb2d391d88ae1a4139bebefb8eb937c90 100644 (file)
@@ -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