+++ /dev/null
-Make PyICU compile against ICU 4.8RC1.
-
-Fixes https://bugzilla.osafoundation.org/show_bug.cgi?id=13022
-
-Based on 'svn diff -c 177 http://svn.osafoundation.org/pyicu/trunk'
-but removed patch for CHANGES file, as that wouldn't apply out of
-order.
-
-Index: format.cpp
-===================================================================
---- format.cpp (revision 176)
-+++ format.cpp (revision 177)
-@@ -31,6 +31,10 @@
- #include "dateformat.h"
- #include "numberformat.h"
-
-+#if U_ICU_VERSION_HEX >= 0x04080000
-+ DECLARE_CONSTANTS_TYPE(UTimeUnitFormatStyle);
-+#endif
-+
- /* FieldPosition */
-
- class t_fieldposition : public _wrapper {
-@@ -728,7 +732,11 @@
- static int t_timeunitformat_init(t_timeunitformat *self,
- PyObject *args, PyObject *kwds)
- {
-+#if U_ICU_VERSION_HEX >= 0x04080000
-+ UTimeUnitFormatStyle style;
-+#else
- TimeUnitFormat::EStyle style;
-+#endif
- Locale *locale;
-
- switch (PyTuple_Size(args)) {
-@@ -1659,8 +1667,13 @@
-
- INSTALL_STATIC_INT(FieldPosition, DONT_CARE);
-
--#if U_ICU_VERSION_HEX >= 0x04020000
-+#if U_ICU_VERSION_HEX >= 0x04020000 && U_ICU_VERSION_HEX < 0x04080000
- INSTALL_STATIC_INT(TimeUnitFormat, kFull);
- INSTALL_STATIC_INT(TimeUnitFormat, kAbbreviate);
- #endif
-+#if U_ICU_VERSION_HEX >= 0x04080000
-+ INSTALL_CONSTANTS_TYPE(UTimeUnitFormatStyle, m);
-+ INSTALL_ENUM(UTimeUnitFormatStyle, "FULL", UTMUTFMT_FULL_STYLE);
-+ INSTALL_ENUM(UTimeUnitFormatStyle, "ABBREVIATED", UTMUTFMT_ABBREVIATED_STYLE);
-+#endif
- }
-Index: numberformat.cpp
-===================================================================
---- numberformat.cpp (revision 176)
-+++ numberformat.cpp (revision 177)
-@@ -30,6 +30,10 @@
- #include "numberformat.h"
- #include "macros.h"
-
-+#if U_ICU_VERSION_HEX >= 0x04080000
-+ DECLARE_CONSTANTS_TYPE(UCurrencySpacing);
-+#endif
-+
- /* DecimalFormatSymbols */
-
- class t_decimalformatsymbols : public _wrapper {
-@@ -494,7 +498,11 @@
-
- static PyObject *t_decimalformatsymbols_getPatternForCurrencySpacing(t_decimalformatsymbols *self, PyObject *args)
- {
-+#if U_ICU_VERSION_HEX >= 0x04080000
-+ UCurrencySpacing type;
-+#else
- DecimalFormatSymbols::ECurrencySpacing type;
-+#endif
- UBool beforeCurrency;
-
- if (!parseArgs(args, "ib", &type, &beforeCurrency))
-@@ -510,7 +518,11 @@
- static PyObject *t_decimalformatsymbols_setPatternForCurrencySpacing(t_decimalformatsymbols *self, PyObject *args)
- {
- UnicodeString *u, _u;
-+#if U_ICU_VERSION_HEX >= 0x04080000
-+ UCurrencySpacing type;
-+#else
- DecimalFormatSymbols::ECurrencySpacing type;
-+#endif
- UBool beforeCurrency;
-
- if (!parseArgs(args, "ibS", &type, &beforeCurrency, &u, &_u))
-@@ -2278,12 +2290,18 @@
- INSTALL_STATIC_INT(DecimalFormatSymbols, kNaNSymbol);
- INSTALL_STATIC_INT(DecimalFormatSymbols, kSignificantDigitSymbol);
-
--#if U_ICU_VERSION_HEX >= 0x04020000
-+#if U_ICU_VERSION_HEX >= 0x04020000 && U_ICU_VERSION_HEX < 0x04080000
- INSTALL_STATIC_INT(DecimalFormatSymbols, kCurrencyMatch);
- INSTALL_STATIC_INT(DecimalFormatSymbols, kSurroundingMatch);
- INSTALL_STATIC_INT(DecimalFormatSymbols, kInsert);
- INSTALL_STATIC_INT(DecimalFormatSymbols, kCurrencySpacingCount);
- #endif
-+#if U_ICU_VERSION_HEX >= 0x04080000
-+ INSTALL_CONSTANTS_TYPE(UCurrencySpacing, m);
-+ INSTALL_ENUM(UCurrencySpacing, "MATCH", UNUM_CURRENCY_MATCH);
-+ INSTALL_ENUM(UCurrencySpacing, "SURROUNDING_MATCH", UNUM_CURRENCY_SURROUNDING_MATCH);
-+ INSTALL_ENUM(UCurrencySpacing, "INSERT", UNUM_CURRENCY_INSERT);
-+#endif
-
- INSTALL_STATIC_INT(NumberFormat, kIntegerField);
- INSTALL_STATIC_INT(NumberFormat, kFractionField);
+++ /dev/null
-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;
-