-Treat string literals as const char* instead of char*.
-
-PyICU had a lot of implicit conversions from string constant to char*,
-which could cause huge lists of compiler messages like this:
-
-warning: deprecated conversion from string constant to ‘char*’
-
-This patch attempts to fix as many of these as possible inside the
-PyICU codebase. Some cannot be fixed, because the cooresponding
-problem is in Python headers. This is known as Python issue #6952.
-
-2011-02-11 Martin von Gagern
-
-References:
-http://bugs.gentoo.org/237888
-http://bugs.python.org/issue6952
-
-Index: PyICU-1.1/common.cpp
-===================================================================
---- PyICU-1.1.orig/common.cpp
-+++ PyICU-1.1/common.cpp
-@@ -178,7 +178,8 @@ EXPORT PyObject *PyUnicode_FromUnicodeSt
- }
-
- EXPORT UnicodeString &PyString_AsUnicodeString(PyObject *object,
-- char *encoding, char *mode,
-+ const char *encoding,
-+ const char *mode,
- UnicodeString &string)
- {
- UErrorCode status = U_ZERO_ERROR;
-@@ -206,7 +207,7 @@ EXPORT UnicodeString &PyString_AsUnicode
-
- if (U_FAILURE(status))
- {
-- char *reasonName;
-+ const char *reasonName;
-
- switch (stop.reason) {
- case UCNV_UNASSIGNED:
-@@ -241,7 +242,8 @@ EXPORT UnicodeString &PyString_AsUnicode
- }
-
- EXPORT UnicodeString &PyObject_AsUnicodeString(PyObject *object,
-- char *encoding, char *mode,
-+ const char *encoding,
-+ const char *mode,
- UnicodeString &string)
- {
- if (PyUnicode_Check(object))
-@@ -672,7 +674,7 @@ static UBool *toUBoolArray(PyObject *arg
-
- #ifdef _MSC_VER
-
--int __parseArgs(PyObject *args, char *types, ...)
-+int __parseArgs(PyObject *args, const char *types, ...)
- {
- int count = ((PyTupleObject *)(args))->ob_size;
- va_list list;
-@@ -682,7 +684,7 @@ int __parseArgs(PyObject *args, char *ty
- return _parseArgs(((PyTupleObject *)(args))->ob_item, count, types, list);
- }
-
--int __parseArg(PyObject *arg, char *types, ...)
-+int __parseArg(PyObject *arg, const char *types, ...)
- {
- va_list list;
-
-@@ -692,14 +694,14 @@ int __parseArg(PyObject *arg, char *type
- }
-
-
--int _parseArgs(PyObject **args, int count, char *types, va_list list)
-+int _parseArgs(PyObject **args, int count, const char *types, va_list list)
- {
- if (count != strlen(types))
- return -1;
-
- #else
-
--int _parseArgs(PyObject **args, int count, char *types, ...)
-+int _parseArgs(PyObject **args, int count, const char *types, ...)
- {
- va_list list;
-
-@@ -1121,7 +1123,7 @@ int _parseArgs(PyObject **args, int coun
- return 0;
- }
-
--PyObject *PyErr_SetArgsError(PyObject *self, char *name, PyObject *args)
-+PyObject *PyErr_SetArgsError(PyObject *self, const char *name, PyObject *args)
- {
- if (!PyErr_Occurred())
- {
-@@ -1135,7 +1137,7 @@ PyObject *PyErr_SetArgsError(PyObject *s
- return NULL;
- }
-
--PyObject *PyErr_SetArgsError(PyTypeObject *type, char *name, PyObject *args)
-+PyObject *PyErr_SetArgsError(PyTypeObject *type, const char *name, PyObject *args)
- {
- if (!PyErr_Occurred())
- {
-Index: PyICU-1.1/common.h
-===================================================================
---- PyICU-1.1.orig/common.h
-+++ PyICU-1.1/common.h
-@@ -191,10 +191,12 @@ EXPORT PyObject *PyUnicode_FromUnicodeSt
- EXPORT PyObject *PyUnicode_FromUnicodeString(const UChar *chars, int size);
-
- EXPORT UnicodeString &PyString_AsUnicodeString(PyObject *object,
-- char *encoding, char *mode,
-+ const char *encoding,
-+ const char *mode,
- UnicodeString &string);
- EXPORT UnicodeString &PyObject_AsUnicodeString(PyObject *object,
-- char *encoding, char *mode,
-+ const char *encoding,
-+ const char *mode,
- UnicodeString &string);
- EXPORT UnicodeString &PyObject_AsUnicodeString(PyObject *object,
- UnicodeString &string);
-@@ -208,10 +210,10 @@ int abstract_init(PyObject *self, PyObje
- #define parseArgs __parseArgs
- #define parseArg __parseArg
-
--int __parseArgs(PyObject *args, char *types, ...);
--int __parseArg(PyObject *arg, char *types, ...);
-+int __parseArgs(PyObject *args, const char *types, ...);
-+int __parseArg(PyObject *arg, const char *types, ...);
-
--int _parseArgs(PyObject **args, int count, char *types, va_list list);
-+int _parseArgs(PyObject **args, int count, const char *types, va_list list);
-
- #else
-
-@@ -222,7 +224,7 @@ int _parseArgs(PyObject **args, int coun
- #define parseArg(arg, types, rest...) \
- _parseArgs(&(arg), 1, types, ##rest)
-
--int _parseArgs(PyObject **args, int count, char *types, ...);
-+int _parseArgs(PyObject **args, int count, const char *types, ...);
-
- #endif
-
-@@ -240,7 +242,7 @@ Formattable *toFormattableArray(PyObject
- UObject **pl2cpa(PyObject *arg, int *len, classid id, PyTypeObject *type);
- PyObject *cpa2pl(UObject **array, int len, PyObject *(*wrap)(UObject *, int));
-
--PyObject *PyErr_SetArgsError(PyObject *self, char *name, PyObject *args);
--PyObject *PyErr_SetArgsError(PyTypeObject *type, char *name, PyObject *args);
-+PyObject *PyErr_SetArgsError(PyObject *self, const char *name, PyObject *args);
-+PyObject *PyErr_SetArgsError(PyTypeObject *type, const char *name, PyObject *args);
-
- #endif /* _common_h */
-Index: PyICU-1.1/errors.cpp
-===================================================================
---- PyICU-1.1.orig/errors.cpp
-+++ PyICU-1.1/errors.cpp
-@@ -26,7 +26,7 @@
-
- #include "errors.h"
-
--static void _setMsg(PyObject *messages, UErrorCode code, char *msg)
-+static void _setMsg(PyObject *messages, UErrorCode code, const char *msg)
- {
- PyObject *pycode = PyInt_FromLong((long) code);
- PyObject *pymsg = PyString_FromString(msg);
-Index: PyICU-1.1/bases.cpp
-===================================================================
---- PyICU-1.1.orig/bases.cpp
-+++ PyICU-1.1/bases.cpp
-@@ -532,7 +532,7 @@ static int t_unicodestring_init(t_unicod
- {
- UnicodeString *u, _u;
- PyObject *obj;
-- char *encoding, *mode;
-+ const char *encoding, *mode;
- int32_t start, length;
- int i;
-