diff options
Diffstat (limited to 'ext/intl/msgformat')
-rw-r--r-- | ext/intl/msgformat/msgformat.c | 1 | ||||
-rw-r--r-- | ext/intl/msgformat/msgformat_attr.c | 2 | ||||
-rw-r--r-- | ext/intl/msgformat/msgformat_format.c | 3 | ||||
-rw-r--r-- | ext/intl/msgformat/msgformat_helpers.cpp | 4 | ||||
-rw-r--r-- | ext/intl/msgformat/msgformat_parse.c | 3 |
5 files changed, 10 insertions, 3 deletions
diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c index e0919ec42b..d3f8416c03 100644 --- a/ext/intl/msgformat/msgformat.c +++ b/ext/intl/msgformat/msgformat.c @@ -23,6 +23,7 @@ #include "php_intl.h" #include "msgformat_class.h" +#include "msgformat_data.h" #include "intl_convert.h" /* {{{ */ diff --git a/ext/intl/msgformat/msgformat_attr.c b/ext/intl/msgformat/msgformat_attr.c index a20a7e411d..78eb727c61 100644 --- a/ext/intl/msgformat/msgformat_attr.c +++ b/ext/intl/msgformat/msgformat_attr.c @@ -21,11 +21,11 @@ #include "php_intl.h" #include "msgformat_class.h" #include "msgformat_attr.h" +#include "msgformat_data.h" #include "intl_convert.h" #include <unicode/ustring.h> - /* {{{ proto string MessageFormatter::getPattern( ) * Get formatter pattern. }}} */ /* {{{ proto string msgfmt_get_pattern( MessageFormatter $mf ) diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c index 5aa68e2735..959a4fd5a0 100644 --- a/ext/intl/msgformat/msgformat_format.c +++ b/ext/intl/msgformat/msgformat_format.c @@ -104,7 +104,7 @@ PHP_FUNCTION( msgfmt_format_message ) size_t pattern_len = 0; const char *slocale = NULL; size_t slocale_len = 0; - MessageFormatter_object mf = {0}; + MessageFormatter_object mf; MessageFormatter_object *mfo = &mf; /* Parse parameters. */ @@ -117,6 +117,7 @@ PHP_FUNCTION( msgfmt_format_message ) RETURN_FALSE; } + memset(mfo, 0, sizeof(*mfo)); msgformat_data_init(&mfo->mf_data); if(pattern && pattern_len) { diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index ed63105fa7..ce7899edd9 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -264,6 +264,10 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo, type = Formattable::kDouble; } else if (argType == UMSGPAT_ARG_TYPE_SELECT) { type = Formattable::kString; +#if U_ICU_VERSION_MAJOR_NUM >= 50 + } else if (argType == UMSGPAT_ARG_TYPE_SELECTORDINAL) { + type = Formattable::kDouble; +#endif } else { type = Formattable::kString; } diff --git a/ext/intl/msgformat/msgformat_parse.c b/ext/intl/msgformat/msgformat_parse.c index 4d63a0169a..349633912b 100644 --- a/ext/intl/msgformat/msgformat_parse.c +++ b/ext/intl/msgformat/msgformat_parse.c @@ -97,7 +97,7 @@ PHP_FUNCTION( msgfmt_parse_message ) size_t slocale_len = 0; char *source = NULL; size_t src_len = 0; - MessageFormatter_object mf = {0}; + MessageFormatter_object mf; MessageFormatter_object *mfo = &mf; /* Parse parameters. */ @@ -110,6 +110,7 @@ PHP_FUNCTION( msgfmt_parse_message ) RETURN_FALSE; } + memset(mfo, 0, sizeof(*mfo)); msgformat_data_init(&mfo->mf_data); if(pattern && pattern_len) { |