You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

307 lines
9.4 KiB

  1. From d8200e48857aeaf09f7127751efc5632ef7660a7 Mon Sep 17 00:00:00 2001
  2. From: Anatol Belski <ab@php.net>
  3. Date: Sun, 1 Apr 2018 01:03:40 +0200
  4. Subject: [PATCH] Simplify namespace access
  5. The icu namespace is an alias which resolves to the real namespace.
  6. ---
  7. ext/intl/breakiterator/breakiterator_class.cpp | 2 +-
  8. ext/intl/breakiterator/breakiterator_class.h | 2 +-
  9. ext/intl/breakiterator/breakiterator_methods.cpp | 4 ++--
  10. ext/intl/breakiterator/codepointiterator_internal.cpp | 2 +-
  11. ext/intl/breakiterator/codepointiterator_internal.h | 6 +++---
  12. ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp | 4 ++--
  13. ext/intl/calendar/calendar_class.cpp | 4 ++--
  14. ext/intl/calendar/calendar_class.h | 2 +-
  15. ext/intl/calendar/calendar_methods.cpp | 2 +-
  16. ext/intl/calendar/gregoriancalendar_methods.cpp | 8 ++++----
  17. ext/intl/common/common_date.cpp | 4 ++--
  18. ext/intl/common/common_date.h | 2 +-
  19. ext/intl/common/common_enum.h | 2 +-
  20. ext/intl/dateformat/dateformat_format_object.cpp | 10 +++++-----
  21. ext/intl/dateformat/dateformat_helpers.cpp | 2 +-
  22. ext/intl/dateformat/dateformat_helpers.h | 6 +++---
  23. ext/intl/intl_convertcpp.h | 2 +-
  24. ext/intl/msgformat/msgformat_helpers.cpp | 14 +++++++-------
  25. ext/intl/timezone/timezone_class.cpp | 2 +-
  26. ext/intl/timezone/timezone_class.h | 2 +-
  27. ext/intl/timezone/timezone_methods.cpp | 4 ++--
  28. 21 files changed, 43 insertions(+), 43 deletions(-)
  29. --- a/ext/intl/breakiterator/breakiterator_class.cpp
  30. +++ b/ext/intl/breakiterator/breakiterator_class.cpp
  31. @@ -38,7 +38,7 @@ extern "C" {
  32. }
  33. using PHP::CodePointBreakIterator;
  34. -using U_ICU_NAMESPACE::RuleBasedBreakIterator;
  35. +using icu::RuleBasedBreakIterator;
  36. /* {{{ Global variables */
  37. zend_class_entry *BreakIterator_ce_ptr;
  38. --- a/ext/intl/breakiterator/breakiterator_class.h
  39. +++ b/ext/intl/breakiterator/breakiterator_class.h
  40. @@ -27,7 +27,7 @@
  41. #ifndef USE_BREAKITERATOR_POINTER
  42. typedef void BreakIterator;
  43. #else
  44. -using U_ICU_NAMESPACE::BreakIterator;
  45. +using icu::BreakIterator;
  46. #endif
  47. typedef struct {
  48. --- a/ext/intl/breakiterator/breakiterator_methods.cpp
  49. +++ b/ext/intl/breakiterator/breakiterator_methods.cpp
  50. @@ -32,8 +32,8 @@ extern "C" {
  51. }
  52. using PHP::CodePointBreakIterator;
  53. -using U_ICU_NAMESPACE::BreakIterator;
  54. -using U_ICU_NAMESPACE::Locale;
  55. +using icu::BreakIterator;
  56. +using icu::Locale;
  57. U_CFUNC PHP_METHOD(BreakIterator, __construct)
  58. {
  59. --- a/ext/intl/breakiterator/codepointiterator_internal.cpp
  60. +++ b/ext/intl/breakiterator/codepointiterator_internal.cpp
  61. @@ -33,7 +33,7 @@ typedef union {
  62. using namespace PHP;
  63. -using U_ICU_NAMESPACE::UCharCharacterIterator;
  64. +using icu::UCharCharacterIterator;
  65. UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CodePointBreakIterator);
  66. --- a/ext/intl/breakiterator/codepointiterator_internal.h
  67. +++ b/ext/intl/breakiterator/codepointiterator_internal.h
  68. @@ -20,9 +20,9 @@
  69. #include <unicode/brkiter.h>
  70. #include <unicode/unistr.h>
  71. -using U_ICU_NAMESPACE::BreakIterator;
  72. -using U_ICU_NAMESPACE::CharacterIterator;
  73. -using U_ICU_NAMESPACE::UnicodeString;
  74. +using icu::BreakIterator;
  75. +using icu::CharacterIterator;
  76. +using icu::UnicodeString;
  77. namespace PHP {
  78. --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
  79. +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
  80. @@ -26,8 +26,8 @@ extern "C" {
  81. #include "../intl_convertcpp.h"
  82. #include "../intl_common.h"
  83. -using U_ICU_NAMESPACE::RuleBasedBreakIterator;
  84. -using U_ICU_NAMESPACE::Locale;
  85. +using icu::RuleBasedBreakIterator;
  86. +using icu::Locale;
  87. static inline RuleBasedBreakIterator *fetch_rbbi(BreakIterator_object *bio) {
  88. return (RuleBasedBreakIterator*)bio->biter;
  89. --- a/ext/intl/calendar/calendar_class.cpp
  90. +++ b/ext/intl/calendar/calendar_class.cpp
  91. @@ -34,8 +34,8 @@ extern "C" {
  92. #include <assert.h>
  93. }
  94. -using U_ICU_NAMESPACE::GregorianCalendar;
  95. -using U_ICU_NAMESPACE::Locale;
  96. +using icu::GregorianCalendar;
  97. +using icu::Locale;
  98. /* {{{ Global variables */
  99. zend_class_entry *Calendar_ce_ptr;
  100. --- a/ext/intl/calendar/calendar_class.h
  101. +++ b/ext/intl/calendar/calendar_class.h
  102. @@ -27,7 +27,7 @@
  103. #ifndef USE_CALENDAR_POINTER
  104. typedef void Calendar;
  105. #else
  106. -using U_ICU_NAMESPACE::Calendar;
  107. +using icu::Calendar;
  108. #endif
  109. typedef struct {
  110. --- a/ext/intl/calendar/calendar_methods.cpp
  111. +++ b/ext/intl/calendar/calendar_methods.cpp
  112. @@ -40,7 +40,7 @@ extern "C" {
  113. }
  114. #include "../common/common_enum.h"
  115. -using U_ICU_NAMESPACE::Locale;
  116. +using icu::Locale;
  117. U_CFUNC PHP_METHOD(IntlCalendar, __construct)
  118. {
  119. --- a/ext/intl/calendar/gregoriancalendar_methods.cpp
  120. +++ b/ext/intl/calendar/gregoriancalendar_methods.cpp
  121. @@ -36,10 +36,10 @@ extern "C" {
  122. #include "zend_exceptions.h"
  123. }
  124. -using U_ICU_NAMESPACE::GregorianCalendar;
  125. -using U_ICU_NAMESPACE::Locale;
  126. -using U_ICU_NAMESPACE::UnicodeString;
  127. -using U_ICU_NAMESPACE::StringPiece;
  128. +using icu::GregorianCalendar;
  129. +using icu::Locale;
  130. +using icu::UnicodeString;
  131. +using icu::StringPiece;
  132. static inline GregorianCalendar *fetch_greg(Calendar_object *co) {
  133. return (GregorianCalendar*)co->ucal;
  134. --- a/ext/intl/common/common_date.cpp
  135. +++ b/ext/intl/common/common_date.cpp
  136. @@ -25,8 +25,8 @@ extern "C" {
  137. #include <ext/date/php_date.h>
  138. }
  139. -using U_ICU_NAMESPACE::TimeZone;
  140. -using U_ICU_NAMESPACE::UnicodeString;
  141. +using icu::TimeZone;
  142. +using icu::UnicodeString;
  143. #include "zend_portability.h"
  144. --- a/ext/intl/common/common_date.h
  145. +++ b/ext/intl/common/common_date.h
  146. @@ -28,7 +28,7 @@ U_CDECL_END
  147. #include <unicode/timezone.h>
  148. -using U_ICU_NAMESPACE::TimeZone;
  149. +using icu::TimeZone;
  150. U_CFUNC TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func);
  151. U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
  152. --- a/ext/intl/common/common_enum.h
  153. +++ b/ext/intl/common/common_enum.h
  154. @@ -75,7 +75,7 @@ U_CFUNC zval *zoi_with_current_get_curre
  155. U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter);
  156. #ifdef __cplusplus
  157. -using U_ICU_NAMESPACE::StringEnumeration;
  158. +using icu::StringEnumeration;
  159. U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object);
  160. #endif
  161. --- a/ext/intl/dateformat/dateformat_format_object.cpp
  162. +++ b/ext/intl/dateformat/dateformat_format_object.cpp
  163. @@ -33,11 +33,11 @@ extern "C" {
  164. #include "../common/common_date.h"
  165. }
  166. -using U_ICU_NAMESPACE::Locale;
  167. -using U_ICU_NAMESPACE::DateFormat;
  168. -using U_ICU_NAMESPACE::GregorianCalendar;
  169. -using U_ICU_NAMESPACE::StringPiece;
  170. -using U_ICU_NAMESPACE::SimpleDateFormat;
  171. +using icu::Locale;
  172. +using icu::DateFormat;
  173. +using icu::GregorianCalendar;
  174. +using icu::StringPiece;
  175. +using icu::SimpleDateFormat;
  176. static const DateFormat::EStyle valid_styles[] = {
  177. DateFormat::kNone,
  178. --- a/ext/intl/dateformat/dateformat_helpers.cpp
  179. +++ b/ext/intl/dateformat/dateformat_helpers.cpp
  180. @@ -28,7 +28,7 @@ extern "C" {
  181. #include "../calendar/calendar_class.h"
  182. }
  183. -using U_ICU_NAMESPACE::GregorianCalendar;
  184. +using icu::GregorianCalendar;
  185. int datefmt_process_calendar_arg(zval* calendar_zv,
  186. Locale const& locale,
  187. --- a/ext/intl/dateformat/dateformat_helpers.h
  188. +++ b/ext/intl/dateformat/dateformat_helpers.h
  189. @@ -28,9 +28,9 @@ extern "C" {
  190. #include "../php_intl.h"
  191. }
  192. -using U_ICU_NAMESPACE::Locale;
  193. -using U_ICU_NAMESPACE::Calendar;
  194. -using U_ICU_NAMESPACE::DateFormat;
  195. +using icu::Locale;
  196. +using icu::Calendar;
  197. +using icu::DateFormat;
  198. int datefmt_process_calendar_arg(zval* calendar_zv,
  199. Locale const& locale,
  200. --- a/ext/intl/intl_convertcpp.h
  201. +++ b/ext/intl/intl_convertcpp.h
  202. @@ -26,7 +26,7 @@
  203. #include <unicode/unistr.h>
  204. #include <zend_types.h>
  205. -using U_ICU_NAMESPACE::UnicodeString;
  206. +using icu::UnicodeString;
  207. int intl_stringFromChar(UnicodeString &ret, char *str, size_t str_len, UErrorCode *status);
  208. --- a/ext/intl/msgformat/msgformat_helpers.cpp
  209. +++ b/ext/intl/msgformat/msgformat_helpers.cpp
  210. @@ -76,15 +76,15 @@ MessageFormatAdapter::getMessagePattern(
  211. #endif
  212. U_NAMESPACE_END
  213. -using U_ICU_NAMESPACE::Formattable;
  214. -using U_ICU_NAMESPACE::Format;
  215. -using U_ICU_NAMESPACE::DateFormat;
  216. -using U_ICU_NAMESPACE::MessageFormat;
  217. +using icu::Formattable;
  218. +using icu::Format;
  219. +using icu::DateFormat;
  220. +using icu::MessageFormat;
  221. #ifdef HAS_MESSAGE_PATTERN
  222. -using U_ICU_NAMESPACE::MessagePattern;
  223. +using icu::MessagePattern;
  224. #endif
  225. -using U_ICU_NAMESPACE::MessageFormatAdapter;
  226. -using U_ICU_NAMESPACE::FieldPosition;
  227. +using icu::MessageFormatAdapter;
  228. +using icu::FieldPosition;
  229. U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt)
  230. {
  231. --- a/ext/intl/timezone/timezone_class.cpp
  232. +++ b/ext/intl/timezone/timezone_class.cpp
  233. @@ -37,7 +37,7 @@ extern "C" {
  234. #include <ext/date/php_date.h>
  235. }
  236. -using U_ICU_NAMESPACE::Calendar;
  237. +using icu::Calendar;
  238. /* {{{ Global variables */
  239. U_CDECL_BEGIN
  240. --- a/ext/intl/timezone/timezone_class.h
  241. +++ b/ext/intl/timezone/timezone_class.h
  242. @@ -30,7 +30,7 @@
  243. #ifndef USE_TIMEZONE_POINTER
  244. typedef void TimeZone;
  245. #else
  246. -using U_ICU_NAMESPACE::TimeZone;
  247. +using icu::TimeZone;
  248. #endif
  249. typedef struct {
  250. --- a/ext/intl/timezone/timezone_methods.cpp
  251. +++ b/ext/intl/timezone/timezone_methods.cpp
  252. @@ -38,8 +38,8 @@ extern "C" {
  253. }
  254. #include "common/common_enum.h"
  255. -using U_ICU_NAMESPACE::Locale;
  256. -using U_ICU_NAMESPACE::Calendar;
  257. +using icu::Locale;
  258. +using icu::Calendar;
  259. U_CFUNC PHP_METHOD(IntlTimeZone, __construct)
  260. {