Skip to content

Commit e146d45

Browse files
committed
Address review comments
1 parent 82a6abd commit e146d45

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

ext/intl/breakiterator/breakiterator_class.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ typedef struct {
4242
} BreakIterator_object;
4343

4444
static inline BreakIterator_object *php_intl_breakiterator_fetch_object(zend_object *obj) {
45-
return reinterpret_cast<BreakIterator_object *>(reinterpret_cast<char *>(obj) - XtOffsetOf(BreakIterator_object, zo));
45+
return (BreakIterator_object *)((char*)(obj) - XtOffsetOf(BreakIterator_object, zo));
4646
}
4747
#define Z_INTL_BREAKITERATOR_P(zv) php_intl_breakiterator_fetch_object(Z_OBJ_P(zv))
4848

ext/intl/breakiterator/breakiterator_iterators.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,16 +235,18 @@ void IntlIterator_from_BreakIterator_parts(zval *break_iter_zv,
235235
ii->iterator->funcs = &breakiterator_parts_it_funcs;
236236
ii->iterator->index = 0;
237237

238-
reinterpret_cast<zoi_with_current *>(ii->iterator)->destroy_it = _breakiterator_parts_destroy_it;
239-
ZVAL_OBJ_COPY(&reinterpret_cast<zoi_with_current *>(ii->iterator)->wrapping_obj, Z_OBJ_P(object));
240-
ZVAL_UNDEF(&reinterpret_cast<zoi_with_current *>(ii->iterator)->current);
238+
zoi_with_current *zend_iterator_with_current = reinterpret_cast<zoi_with_current *>(ii->iterator);
239+
zend_iterator_with_current->destroy_it = _breakiterator_parts_destroy_it;
240+
ZVAL_OBJ_COPY(&zend_iterator_with_current->wrapping_obj, Z_OBJ_P(object));
241+
ZVAL_UNDEF(&zend_iterator_with_current->current);
241242

242-
reinterpret_cast<zoi_break_iter_parts *>(ii->iterator)->bio = Z_INTL_BREAKITERATOR_P(break_iter_zv);
243+
zoi_break_iter_parts *zend_break_iterator_parts = reinterpret_cast<zoi_break_iter_parts *>(ii->iterator);
244+
zend_break_iterator_parts->bio = Z_INTL_BREAKITERATOR_P(break_iter_zv);
243245

244-
ZEND_ASSERT(reinterpret_cast<zoi_break_iter_parts *>(ii->iterator)->bio->biter != NULL);
246+
ZEND_ASSERT(zend_break_iterator_parts->bio->biter != NULL);
245247

246-
reinterpret_cast<zoi_break_iter_parts *>(ii->iterator)->key_type = key_type;
247-
reinterpret_cast<zoi_break_iter_parts *>(ii->iterator)->index_right = 0;
248+
zend_break_iterator_parts->key_type = key_type;
249+
zend_break_iterator_parts->index_right = 0;
248250
}
249251

250252
U_CFUNC PHP_METHOD(IntlPartsIterator, getBreakIterator)

ext/intl/breakiterator/codepointiterator_internal.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ UBool CodePointBreakIterator::operator==(const BreakIterator& that) const
8484
}
8585

8686
const CodePointBreakIterator& that2 =
87-
dynamic_cast<const CodePointBreakIterator&>(that);
87+
static_cast<const CodePointBreakIterator&>(that);
8888

8989
if (!utext_equals(this->fText, that2.fText)) {
9090
return false;
@@ -253,7 +253,6 @@ CodePointBreakIterator *CodePointBreakIterator::createBufferClone(
253253
if (U_ALIGNMENT_OFFSET(stackBuffer) != 0) {
254254
uint32_t offsetUp = static_cast<uint32_t>(U_ALIGNMENT_OFFSET_UP(buf));
255255
s -= offsetUp;
256-
// TODO buf pointer might be null?
257256
buf += offsetUp;
258257
}
259258

0 commit comments

Comments
 (0)