Skip to content

Commit b6a93c3

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Use true/false instead of TRUE/FALSE in intl
2 parents 5143b4d + 975735c commit b6a93c3

File tree

8 files changed

+18
-20
lines changed

8 files changed

+18
-20
lines changed

build/php.m4

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,8 +1893,6 @@ AC_DEFUN([PHP_SETUP_ICU],[
18931893
if test "$PKG_CONFIG icu-io --atleast-version=60"; then
18941894
ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1"
18951895
fi
1896-
1897-
ICU_CFLAGS="$ICU_CFLAGS -DU_DEFINE_FALSE_AND_TRUE=1"
18981896
])
18991897

19001898
dnl

ext/intl/breakiterator/codepointiterator_internal.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ CodePointBreakIterator& CodePointBreakIterator::operator=(const CodePointBreakIt
5656
return *this;
5757
}
5858

59-
this->fText = utext_clone(this->fText, that.fText, FALSE, TRUE, &uec);
59+
this->fText = utext_clone(this->fText, that.fText, false, true, &uec);
6060

6161
//don't bother copying the character iterator, getText() is deprecated
6262
clearCurrentCharIter();
@@ -76,17 +76,17 @@ CodePointBreakIterator::~CodePointBreakIterator()
7676
UBool CodePointBreakIterator::operator==(const BreakIterator& that) const
7777
{
7878
if (typeid(*this) != typeid(that)) {
79-
return FALSE;
79+
return false;
8080
}
8181

8282
const CodePointBreakIterator& that2 =
8383
static_cast<const CodePointBreakIterator&>(that);
8484

8585
if (!utext_equals(this->fText, that2.fText)) {
86-
return FALSE;
86+
return false;
8787
}
8888

89-
return TRUE;
89+
return true;
9090
}
9191

9292
CodePointBreakIterator* CodePointBreakIterator::clone(void) const
@@ -107,7 +107,7 @@ CharacterIterator& CodePointBreakIterator::getText(void) const
107107

108108
UText *CodePointBreakIterator::getUText(UText *fillIn, UErrorCode &status) const
109109
{
110-
return utext_clone(fillIn, this->fText, FALSE, TRUE, &status);
110+
return utext_clone(fillIn, this->fText, false, true, &status);
111111
}
112112

113113
void CodePointBreakIterator::setText(const UnicodeString &text)
@@ -126,7 +126,7 @@ void CodePointBreakIterator::setText(UText *text, UErrorCode &status)
126126
return;
127127
}
128128

129-
this->fText = utext_clone(this->fText, text, FALSE, TRUE, &status);
129+
this->fText = utext_clone(this->fText, text, false, true, &status);
130130

131131
clearCurrentCharIter();
132132
}
@@ -278,7 +278,7 @@ CodePointBreakIterator &CodePointBreakIterator::refreshInputText(UText *input, U
278278
}
279279

280280
int64_t pos = utext_getNativeIndex(this->fText);
281-
this->fText = utext_clone(this->fText, input, FALSE, TRUE, &status);
281+
this->fText = utext_clone(this->fText, input, false, true, &status);
282282
if (U_FAILURE(status)) {
283283
return *this;
284284
}

ext/intl/collator/collator_sort.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS )
312312
/* {{{ Sort array using specified collator. */
313313
PHP_FUNCTION( collator_sort )
314314
{
315-
collator_sort_internal( TRUE, INTERNAL_FUNCTION_PARAM_PASSTHRU );
315+
collator_sort_internal( true, INTERNAL_FUNCTION_PARAM_PASSTHRU );
316316
}
317317
/* }}} */
318318

@@ -495,7 +495,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
495495
/* {{{ Sort array using specified collator, maintaining index association. */
496496
PHP_FUNCTION( collator_asort )
497497
{
498-
collator_sort_internal( FALSE, INTERNAL_FUNCTION_PARAM_PASSTHRU );
498+
collator_sort_internal( false, INTERNAL_FUNCTION_PARAM_PASSTHRU );
499499
}
500500
/* }}} */
501501

ext/intl/dateformat/dateformat_attr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ PHP_FUNCTION( datefmt_get_pattern )
6969
UChar value_buf[64];
7070
uint32_t length = USIZE( value_buf );
7171
UChar* value = value_buf;
72-
zend_bool is_pattern_localized =FALSE;
72+
zend_bool is_pattern_localized = false;
7373

7474
DATE_FORMAT_METHOD_INIT_VARS;
7575

@@ -106,7 +106,7 @@ PHP_FUNCTION( datefmt_set_pattern )
106106
size_t value_len = 0;
107107
int32_t slength = 0;
108108
UChar* svalue = NULL;
109-
zend_bool is_pattern_localized =FALSE;
109+
zend_bool is_pattern_localized = false;
110110

111111

112112
DATE_FORMAT_METHOD_INIT_VARS;
@@ -184,7 +184,7 @@ PHP_FUNCTION( datefmt_is_lenient )
184184
/* {{{ Set formatter lenient. */
185185
PHP_FUNCTION( datefmt_set_lenient )
186186
{
187-
zend_bool isLenient = FALSE;
187+
zend_bool isLenient = false;
188188

189189
DATE_FORMAT_METHOD_INIT_VARS;
190190

ext/intl/locale/locale_methods.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ static const char * const LOC_PREFERRED_GRANDFATHERED[] = {
8383
NULL
8484
};
8585

86-
/*returns TRUE if a is an ID separator FALSE otherwise*/
86+
/* returns true if a is an ID separator, false otherwise */
8787
#define isIDSeparator(a) (a == '_' || a == '-')
8888
#define isKeywordSeparator(a) (a == '@' )
8989
#define isEndOfTag(a) (a == '\0' )
9090

9191
#define isPrefixLetter(a) ((a=='x')||(a=='X')||(a=='i')||(a=='I'))
9292

93-
/*returns TRUE if one of the special prefixes is here (s=string)
93+
/*returns true if one of the special prefixes is here (s=string)
9494
'x-' or 'i-' */
9595
#define isIDPrefix(s) (isPrefixLetter(s[0])&&isIDSeparator(s[1]))
9696
#define isKeywordPrefix(s) ( isKeywordSeparator(s[0]) )

ext/intl/normalizer/normalizer_normalize.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static UBool intl_is_normalized(zend_long form, const UChar *uinput, int32_t uin
6969
const UNormalizer2 *norm = intl_get_normalizer(form, err);
7070

7171
if(U_FAILURE(*err)) {
72-
return FALSE;
72+
return false;
7373
}
7474

7575
return unorm2_isNormalized(norm, uinput, uinput_len, err);
@@ -226,7 +226,7 @@ PHP_FUNCTION( normalizer_is_normalized )
226226
int uinput_len = 0;
227227
UErrorCode status = U_ZERO_ERROR;
228228

229-
UBool uret = FALSE;
229+
UBool uret = false;
230230

231231
intl_error_reset( NULL );
232232

ext/intl/timezone/timezone_class.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ static HashTable *TimeZone_get_debug_info(zend_object *object, int *is_temp)
327327

328328
int32_t rawOffset, dstOffset;
329329
UDate now = Calendar::getNow();
330-
tz->getOffset(now, FALSE, rawOffset, dstOffset, uec);
330+
tz->getOffset(now, false, rawOffset, dstOffset, uec);
331331
if (U_FAILURE(uec)) {
332332
return debug_info;
333333
}

ext/intl/timezone/timezone_methods.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ U_CFUNC PHP_FUNCTION(intltz_from_date_time_zone)
8989
RETURN_NULL();
9090
}
9191

92-
tz = timezone_convert_datetimezone(tzobj->type, tzobj, FALSE, NULL,
92+
tz = timezone_convert_datetimezone(tzobj->type, tzobj, false, NULL,
9393
"intltz_from_date_time_zone");
9494
if (tz == NULL) {
9595
RETURN_NULL();

0 commit comments

Comments
 (0)