Skip to content

Commit 2645663

Browse files
authored
ext/intl: GregorianCalendar using C++ upcasting operator. (#19216)
when fetching the internal ICU object also removing one useless cast.
1 parent 719419a commit 2645663

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/intl/calendar/calendar_class.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ U_CFUNC void calendar_object_construct(zval *object,
7171

7272
CALENDAR_METHOD_FETCH_OBJECT_NO_CHECK; //populate to from object
7373
assert(co->ucal == NULL);
74-
co->ucal = (Calendar*)calendar;
74+
co->ucal = calendar;
7575
}
7676

7777
/* {{{ clone handler for Calendar */

ext/intl/calendar/gregoriancalendar_methods.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ using icu::StringPiece;
4646
}
4747

4848
static inline GregorianCalendar *fetch_greg(Calendar_object *co) {
49-
return (GregorianCalendar*)co->ucal;
49+
return static_cast<GregorianCalendar *>(co->ucal);
5050
}
5151

5252
static bool set_gregorian_calendar_time_zone(GregorianCalendar *gcal, UErrorCode status)

0 commit comments

Comments
 (0)