]> granicus.if.org Git - php/commitdiff
Use true/false instead of TRUE/FALSE in intl
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 9 Nov 2020 13:44:11 +0000 (14:44 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 9 Nov 2020 13:44:11 +0000 (14:44 +0100)
And drop the U_DEFINE_TRUE_AND_FALSE flag.

build/php.m4
ext/intl/breakiterator/codepointiterator_internal.cpp
ext/intl/collator/collator_sort.c
ext/intl/dateformat/dateformat_attr.c
ext/intl/locale/locale_methods.c
ext/intl/normalizer/normalizer_normalize.c
ext/intl/timezone/timezone_class.cpp
ext/intl/timezone/timezone_methods.cpp

index 9868c046a63af700a352288ce2402a5c9dc57c83..16c5e25fbaab0cb17d378a6ccddc14ac57d5a74c 100644 (file)
@@ -1893,8 +1893,6 @@ AC_DEFUN([PHP_SETUP_ICU],[
   if test "$PKG_CONFIG icu-io --atleast-version=60"; then
     ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1"
   fi
-
-  ICU_CFLAGS="$ICU_CFLAGS -DU_DEFINE_FALSE_AND_TRUE=1"
 ])
 
 dnl
index 082c02d8b2d2d7211b15f75c21d457763c5e4c62..754e0b01d60195a68d7e8aab6d2e5832647f69a6 100644 (file)
@@ -56,7 +56,7 @@ CodePointBreakIterator& CodePointBreakIterator::operator=(const CodePointBreakIt
                return *this;
        }
 
-       this->fText = utext_clone(this->fText, that.fText, FALSE, TRUE, &uec);
+       this->fText = utext_clone(this->fText, that.fText, false, true, &uec);
 
        //don't bother copying the character iterator, getText() is deprecated
        clearCurrentCharIter();
@@ -76,17 +76,17 @@ CodePointBreakIterator::~CodePointBreakIterator()
 UBool CodePointBreakIterator::operator==(const BreakIterator& that) const
 {
        if (typeid(*this) != typeid(that)) {
-               return FALSE;
+               return false;
        }
 
        const CodePointBreakIterator& that2 =
                static_cast<const CodePointBreakIterator&>(that);
 
        if (!utext_equals(this->fText, that2.fText)) {
-               return FALSE;
+               return false;
        }
 
-       return TRUE;
+       return true;
 }
 
 CodePointBreakIterator* CodePointBreakIterator::clone(void) const
@@ -107,7 +107,7 @@ CharacterIterator& CodePointBreakIterator::getText(void) const
 
 UText *CodePointBreakIterator::getUText(UText *fillIn, UErrorCode &status) const
 {
-       return utext_clone(fillIn, this->fText, FALSE, TRUE, &status);
+       return utext_clone(fillIn, this->fText, false, true, &status);
 }
 
 void CodePointBreakIterator::setText(const UnicodeString &text)
@@ -126,7 +126,7 @@ void CodePointBreakIterator::setText(UText *text, UErrorCode &status)
                return;
        }
 
-       this->fText = utext_clone(this->fText, text, FALSE, TRUE, &status);
+       this->fText = utext_clone(this->fText, text, false, true, &status);
 
        clearCurrentCharIter();
 }
@@ -278,7 +278,7 @@ CodePointBreakIterator &CodePointBreakIterator::refreshInputText(UText *input, U
        }
 
        int64_t pos = utext_getNativeIndex(this->fText);
-       this->fText = utext_clone(this->fText, input, FALSE, TRUE, &status);
+       this->fText = utext_clone(this->fText, input, false, true, &status);
        if (U_FAILURE(status)) {
                return *this;
        }
index b2da7e16fe258b49916a8c2ee23692459e77633c..5989ef42b2e67ed0e19bb50e0e06e03b561d6b61 100644 (file)
@@ -312,7 +312,7 @@ static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS )
 /* {{{ Sort array using specified collator. */
 PHP_FUNCTION( collator_sort )
 {
-       collator_sort_internal( TRUE, INTERNAL_FUNCTION_PARAM_PASSTHRU );
+       collator_sort_internal( true, INTERNAL_FUNCTION_PARAM_PASSTHRU );
 }
 /* }}} */
 
@@ -495,7 +495,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
 /* {{{ Sort array using specified collator, maintaining index association. */
 PHP_FUNCTION( collator_asort )
 {
-       collator_sort_internal( FALSE, INTERNAL_FUNCTION_PARAM_PASSTHRU );
+       collator_sort_internal( false, INTERNAL_FUNCTION_PARAM_PASSTHRU );
 }
 /* }}} */
 
index 7f67afe5b3ca638c27854346b1de88cef515769f..2d2dbdfb6ccc41f634b057690b71fddae0e7b5ad 100644 (file)
@@ -69,7 +69,7 @@ PHP_FUNCTION( datefmt_get_pattern )
        UChar  value_buf[64];
        uint32_t    length = USIZE( value_buf );
        UChar* value  = value_buf;
-       zend_bool   is_pattern_localized =FALSE;
+       zend_bool   is_pattern_localized = false;
 
        DATE_FORMAT_METHOD_INIT_VARS;
 
@@ -106,7 +106,7 @@ PHP_FUNCTION( datefmt_set_pattern )
        size_t      value_len = 0;
        int32_t     slength = 0;
        UChar*      svalue  = NULL;
-       zend_bool   is_pattern_localized =FALSE;
+       zend_bool   is_pattern_localized = false;
 
 
        DATE_FORMAT_METHOD_INIT_VARS;
@@ -184,7 +184,7 @@ PHP_FUNCTION( datefmt_is_lenient )
 /* {{{ Set formatter lenient. */
 PHP_FUNCTION( datefmt_set_lenient )
 {
-       zend_bool isLenient  = FALSE;
+       zend_bool isLenient = false;
 
        DATE_FORMAT_METHOD_INIT_VARS;
 
index 466dafadaceda73a1ea844efb60c7f4b48619f73..9357475f55150c1a4946d89441e1f4308fb95387 100644 (file)
@@ -83,14 +83,14 @@ static const char * const   LOC_PREFERRED_GRANDFATHERED[]  = {
        NULL
 };
 
-/*returns TRUE if a is an ID separator FALSE otherwise*/
+/* returns true if a is an ID separator, false otherwise */
 #define isIDSeparator(a) (a == '_' || a == '-')
 #define isKeywordSeparator(a) (a == '@' )
 #define isEndOfTag(a) (a == '\0' )
 
 #define isPrefixLetter(a) ((a=='x')||(a=='X')||(a=='i')||(a=='I'))
 
-/*returns TRUE if one of the special prefixes is here (s=string)
+/*returns true if one of the special prefixes is here (s=string)
   'x-' or 'i-' */
 #define isIDPrefix(s) (isPrefixLetter(s[0])&&isIDSeparator(s[1]))
 #define isKeywordPrefix(s) ( isKeywordSeparator(s[0]) )
index 5eca379c9905b46664886176141be35c7102c28e..edeeea7f4be17e6ea7144baa37fa5280d3b3a987 100644 (file)
@@ -69,7 +69,7 @@ static UBool intl_is_normalized(zend_long form, const UChar *uinput, int32_t uin
        const UNormalizer2 *norm = intl_get_normalizer(form, err);
 
        if(U_FAILURE(*err)) {
-               return FALSE;
+               return false;
        }
 
        return unorm2_isNormalized(norm, uinput, uinput_len, err);
@@ -226,7 +226,7 @@ PHP_FUNCTION( normalizer_is_normalized )
        int             uinput_len = 0;
        UErrorCode      status = U_ZERO_ERROR;
 
-       UBool           uret = FALSE;
+       UBool           uret = false;
 
        intl_error_reset( NULL );
 
index 63d5b057467fd6c952bbc2b32405d21e5c3ba04b..f5749fd621de8ce716bdb693988128550ca6bf5f 100644 (file)
@@ -327,7 +327,7 @@ static HashTable *TimeZone_get_debug_info(zend_object *object, int *is_temp)
 
        int32_t rawOffset, dstOffset;
        UDate now = Calendar::getNow();
-       tz->getOffset(now, FALSE, rawOffset, dstOffset, uec);
+       tz->getOffset(now, false, rawOffset, dstOffset, uec);
        if (U_FAILURE(uec)) {
                return debug_info;
        }
index 6516bb6ff79e85622cf8a4bddb8c94dacdc14254..3a2d28ada6febf403a9bd506c2147b1a568cd34b 100644 (file)
@@ -89,7 +89,7 @@ U_CFUNC PHP_FUNCTION(intltz_from_date_time_zone)
                RETURN_NULL();
        }
 
-       tz = timezone_convert_datetimezone(tzobj->type, tzobj, FALSE, NULL,
+       tz = timezone_convert_datetimezone(tzobj->type, tzobj, false, NULL,
                "intltz_from_date_time_zone");
        if (tz == NULL) {
                RETURN_NULL();