Skip to content

Use new Fast ZPP macros for string|int param in intl/UChar #5512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented May 2, 2020

No description provided.

UChar32 start, UChar32 limit,
UCharCategory type) {
UChar32 start, UChar32 limit,
UCharCategory type) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really related to your change, but please get rid of the alignment here, it doesn't work with tabs.

foobar(
    foo, bar)
// instead of
foobar(foo,
       bar)

zend_long int_codepoint; \
ZEND_PARSE_PARAMETERS_START(1, 1) \
Z_PARAM_STR_OR_LONG(string_codepoint, int_codepoint) \
ZEND_PARSE_PARAMETERS_END(); \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid code-size increase, let's move this common parameter parsing code into a function. Maybe something like

static zend_never_inline int parse_code_point_param(UChar32 *cp) {
    zend_string *string_codepoint;
    zend_long int_codepoint;
    ZEND_PARSE_PARAMETERS_START(1, 1)
        Z_PARAM_STR_OR_LONG(string_codepoint, int_codepoint)
    ZEND_PARSE_PARAMETERS_END_EX(return FAILURE);
    return convert_cp(cp, string_codepoint, int_codepoint);
}

Will also simplify the code in places.

@Girgias Girgias force-pushed the intl-uchar-string-int-zpp branch from 60964ac to 8c9cdf6 Compare May 6, 2020 17:01
@php-pulls php-pulls closed this in 1f05966 May 13, 2020
@Girgias Girgias deleted the intl-uchar-string-int-zpp branch May 13, 2020 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants