diff options
author | Dmitry Stogov <dmitry@zend.com> | 2016-06-22 00:40:50 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2016-06-22 00:40:50 +0300 |
commit | 323b2733f6b42d00dd86e77ac524d64f6ddc4e22 (patch) | |
tree | 49c72ac7d1e6077369f1de6a5d7a6d7847e51bf9 /ext | |
parent | 4ccbe03e445800d26aba5424a84e64e235f08ece (diff) | |
download | php-git-323b2733f6b42d00dd86e77ac524d64f6ddc4e22.tar.gz |
Fixed compilation warnings
Diffstat (limited to 'ext')
87 files changed, 851 insertions, 810 deletions
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index 359425437d..baa65b3878 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -323,7 +323,8 @@ static php_stream_wrapper_ops bzip2_stream_wops = { NULL, /* unlink */ NULL, /* rename */ NULL, /* mkdir */ - NULL /* rmdir */ + NULL, /* rmdir */ + NULL }; static php_stream_wrapper php_stream_bzip2_wrapper = { diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 072c23e48d..82e99864c2 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -167,7 +167,7 @@ static void _php_curl_close(zend_resource *rsrc); # define php_curl_ret(__ret) RETVAL_FALSE; return; #endif -static int php_curl_option_str(php_curl *ch, zend_long option, const char *str, const int len, zend_bool make_copy) +static int php_curl_option_str(php_curl *ch, zend_long option, const char *str, const size_t len, zend_bool make_copy) { CURLcode error = CURLE_OK; @@ -196,7 +196,7 @@ static int php_curl_option_str(php_curl *ch, zend_long option, const char *str, return error == CURLE_OK ? SUCCESS : FAILURE; } -static int php_curl_option_url(php_curl *ch, const char *url, const int len) /* {{{ */ +static int php_curl_option_url(php_curl *ch, const char *url, const size_t len) /* {{{ */ { /* Disable file:// if open_basedir are used */ if (PG(open_basedir) && *PG(open_basedir)) { diff --git a/ext/date/php_date.c b/ext/date/php_date.c index f494d6cfaf..fd8f9f8838 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1071,7 +1071,8 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d) static zend_string *date_format(char *format, size_t format_len, timelib_time *t, int localtime) { smart_str string = {0}; - int i, length = 0; + size_t i; + int length = 0; char buffer[97]; timelib_time_offset *offset = NULL; timelib_sll isoweek, isoyear; @@ -4217,7 +4218,8 @@ PHP_FUNCTION(date_interval_create_from_date_string) static zend_string *date_interval_format(char *format, size_t format_len, timelib_rel_time *t) { smart_str string = {0}; - int i, length, have_format_spec = 0; + size_t i; + int length, have_format_spec = 0; char buffer[33]; if (!format_len) { diff --git a/ext/dba/dba.c b/ext/dba/dba.c index fd4522b9d6..9e835b0ce9 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -363,7 +363,7 @@ static dba_handler handler[] = { #if DBA_TCADB DBA_HND(tcadb, DBA_LOCK_ALL) #endif - { NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } + { NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } }; #if DBA_FLATFILE diff --git a/ext/dom/comment.c b/ext/dom/comment.c index 983aa30cd0..c3f2c3666d 100644 --- a/ext/dom/comment.c +++ b/ext/dom/comment.c @@ -43,7 +43,7 @@ ZEND_END_ARG_INFO(); const zend_function_entry php_dom_comment_class_functions[] = { PHP_ME(domcomment, __construct, arginfo_dom_comment_construct, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} + PHP_FE_END }; /* {{{ proto void DOMComment::__construct([string value]); */ diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c index f070211852..2a55e487a1 100644 --- a/ext/dom/dom_iterators.c +++ b/ext/dom/dom_iterators.c @@ -249,6 +249,7 @@ zend_object_iterator_funcs php_dom_iterator_funcs = { php_dom_iterator_current_data, php_dom_iterator_current_key, php_dom_iterator_move_forward, + NULL, NULL }; diff --git a/ext/dom/domimplementationlist.c b/ext/dom/domimplementationlist.c index e43f7d14fa..0b23836af2 100644 --- a/ext/dom/domimplementationlist.c +++ b/ext/dom/domimplementationlist.c @@ -42,7 +42,7 @@ ZEND_END_ARG_INFO(); const zend_function_entry php_dom_domimplementationlist_class_functions[] = { PHP_FALIAS(item, dom_domimplementationlist_item, arginfo_dom_implementationlist_item) - {NULL, NULL, NULL} + PHP_FE_END }; /* {{{ attribute protos, not implemented yet */ diff --git a/ext/dom/node.c b/ext/dom/node.c index 4579b547d5..f5b017c9c7 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -856,7 +856,7 @@ int dom_node_text_content_write(dom_object *obj, zval *newval) str = zval_get_string(newval); /* we have to use xmlNodeAddContent() to get the same behavior as with xmlNewText() */ xmlNodeSetContent(nodep, (xmlChar *) ""); - xmlNodeAddContent(nodep, ZSTR_VAL(str)); + xmlNodeAddContent(nodep, (xmlChar *) ZSTR_VAL(str)); zend_string_release(str); return SUCCESS; diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 777694538b..e8c622418a 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -2703,7 +2703,8 @@ static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_fi * Process nested IFDs directories in Maker Note. */ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement) { - int de, i=0, section_index = SECTION_MAKERNOTE; + size_t i; + int de, section_index = SECTION_MAKERNOTE; int NumDirEntries, old_motorola_intel, offset_diff; const maker_note_type *maker_note; char *dir_start; @@ -3317,11 +3318,11 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo) } /* Read the length of the section. */ - if ((lh = php_stream_getc(ImageInfo->infile)) == EOF) { + if ((lh = php_stream_getc(ImageInfo->infile)) == (unsigned int)EOF) { EXIF_ERRLOG_CORRUPT(ImageInfo) return FALSE; } - if ((ll = php_stream_getc(ImageInfo->infile)) == EOF) { + if ((ll = php_stream_getc(ImageInfo->infile)) == (unsigned int)EOF) { EXIF_ERRLOG_CORRUPT(ImageInfo) return FALSE; } diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index 1473900999..d2455b4487 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -203,7 +203,7 @@ zend_function_entry fileinfo_functions[] = { PHP_FE(finfo_file, arginfo_finfo_file) PHP_FE(finfo_buffer, arginfo_finfo_buffer) PHP_FE(mime_content_type, arginfo_mime_content_type) - {NULL, NULL, NULL} + PHP_FE_END }; /* }}} */ diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 75550238e1..fce08a1917 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -517,7 +517,7 @@ void php_filter_validate_domain(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ { php_url *url; - int old_len = (int)Z_STRLEN_P(value); + size_t old_len = Z_STRLEN_P(value); php_filter_url(value, flags, option_array, charset); diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c index 0b11ecfc2a..ec9b607663 100644 --- a/ext/filter/sanitizing_filters.c +++ b/ext/filter/sanitizing_filters.c @@ -111,7 +111,8 @@ static void php_filter_encode_url(zval *value, const unsigned char* chars, const static void php_filter_strip(zval *value, zend_long flags) { unsigned char *str; - int i, c; + size_t i; + int c; zend_string *buf; /* Optimization for if no strip flags are set */ @@ -158,7 +159,8 @@ static void filter_map_update(filter_map *map, int flag, const unsigned char *al static void filter_map_apply(zval *value, filter_map *map) { unsigned char *str; - int i, c; + size_t i; + int c; zend_string *buf; str = (unsigned char *)Z_STRVAL_P(value); diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index b3548e70da..6a6caacaaf 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -866,7 +866,7 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, } while ((rcvd = my_recv(ftp, data->fd, data->buf, FTP_BUFSIZE))) { - if (rcvd == -1) { + if (rcvd == (size_t)-1) { goto bail; } @@ -1829,7 +1829,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path) lines = 0; lastch = 0; while ((rcvd = my_recv(ftp, data->fd, data->buf, FTP_BUFSIZE))) { - if (rcvd == -1 || rcvd > ((size_t)(-1))-size) { + if (rcvd == (size_t)-1 || rcvd > ((size_t)(-1))-size) { goto bail; } @@ -1958,7 +1958,7 @@ ftp_nb_continue_read(ftpbuf_t *ftp) lastch = ftp->lastch; if ((rcvd = my_recv(ftp, data->fd, data->buf, FTP_BUFSIZE))) { - if (rcvd == -1) { + if (rcvd == (size_t)-1) { goto bail; } diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 87b11b6dad..dd1293829f 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -208,7 +208,7 @@ static inline void php_hash_string_xor(unsigned char *out, const unsigned char * static inline void php_hash_hmac_prep_key(unsigned char *K, const php_hash_ops *ops, void *context, const unsigned char *key, const size_t key_len) { memset(K, 0, ops->block_size); - if (key_len > ops->block_size) { + if (key_len > (size_t)ops->block_size) { /* Reduce the key first */ ops->hash_init(context); ops->hash_update(context, key, key_len); @@ -367,7 +367,7 @@ PHP_FUNCTION(hash_init) memset(K, 0, ops->block_size); - if (key_len > ops->block_size) { + if (key_len > (size_t)ops->block_size) { /* Reduce the key first */ ops->hash_update(context, (unsigned char *) key, key_len); ops->hash_final((unsigned char *) K, context); @@ -729,7 +729,8 @@ PHP_FUNCTION(hash_equals) { zval *known_zval, *user_zval; char *known_str, *user_str; - int result = 0, j; + int result = 0; + size_t j; if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &known_zval, &user_zval) == FAILURE) { return; diff --git a/ext/hash/hash_sha3.c b/ext/hash/hash_sha3.c index aab17c1476..8f18fa1c27 100644 --- a/ext/hash/hash_sha3.c +++ b/ext/hash/hash_sha3.c @@ -153,9 +153,9 @@ static void PHP_SHA3_Init(PHP_SHA3_CTX* ctx, static void PHP_SHA3_Update(PHP_SHA3_CTX* ctx, const unsigned char* buf, unsigned int count, - int block_size) { + size_t block_size) { while (count > 0) { - int len = block_size - ctx->pos; + unsigned int len = block_size - ctx->pos; if (len > count) len = count; count -= len; while (len-- > 0) { diff --git a/ext/intl/collator/collator_is_numeric.c b/ext/intl/collator/collator_is_numeric.c index 4f6efbfa6d..e3535e7d4b 100644 --- a/ext/intl/collator/collator_is_numeric.c +++ b/ext/intl/collator/collator_is_numeric.c @@ -70,7 +70,7 @@ static double collator_u_strtod(const UChar *nptr, UChar **endptr) /* {{{ */ if (any) { char buf[64], *numbuf, *bufpos; - int length = u - nstart; + size_t length = u - nstart; double value; if (length < sizeof(buf)) { diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c index 1ad42d3660..7ad8f8fc8c 100644 --- a/ext/intl/collator/collator_sort.c +++ b/ext/intl/collator/collator_sort.c @@ -370,7 +370,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys ) char* sortKeyBuf = NULL; /* buffer to store sort keys */ uint32_t sortKeyBufSize = DEF_SORT_KEYS_BUF_SIZE; /* buffer size */ ptrdiff_t sortKeyBufOffset = 0; /* pos in buffer to store sort key */ - int32_t sortKeyLen = 0; /* the length of currently processing key */ + uint32_t sortKeyLen = 0; /* the length of currently processing key */ uint32_t bufLeft = 0; uint32_t bufIncrement = 0; diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index 94752d437b..ede61fc80a 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -997,7 +997,7 @@ static zend_function_entry php_converter_methods[] = { PHP_ME(UConverter, getAvailable, php_converter_getavailable_arginfo, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_ME(UConverter, getAliases, php_converter_getaliases_arginfo, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_ME(UConverter, getStandards, php_converter_getstandards_arginfo, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - { NULL, NULL, NULL } + PHP_FE_END }; /* {{{ Converter create/clone/destroy */ diff --git a/ext/intl/dateformat/dateformat_attr.c b/ext/intl/dateformat/dateformat_attr.c index dffb1b4523..d44b3d1789 100644 --- a/ext/intl/dateformat/dateformat_attr.c +++ b/ext/intl/dateformat/dateformat_attr.c @@ -86,7 +86,7 @@ PHP_FUNCTION( datefmt_get_timetype ) PHP_FUNCTION( datefmt_get_pattern ) { UChar value_buf[64]; - int length = USIZE( value_buf ); + uint32_t length = USIZE( value_buf ); UChar* value = value_buf; zend_bool is_pattern_localized =FALSE; diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c index 378ddf641a..2ba5e3089d 100644 --- a/ext/intl/dateformat/dateformat_parse.c +++ b/ext/intl/dateformat/dateformat_parse.c @@ -130,7 +130,7 @@ PHP_FUNCTION(datefmt_parse) char* text_to_parse = NULL; size_t text_len =0; zval* z_parse_pos = NULL; - int32_t parse_pos = -1; + zend_long parse_pos = -1; DATE_FORMAT_METHOD_INIT_VARS; @@ -147,8 +147,8 @@ PHP_FUNCTION(datefmt_parse) if (z_parse_pos) { ZVAL_DEREF(z_parse_pos); convert_to_long(z_parse_pos); - parse_pos = (int32_t)Z_LVAL_P(z_parse_pos); - if(parse_pos > text_len) { + parse_pos = Z_LVAL_P(z_parse_pos); + if((size_t)parse_pos > text_len) { RETURN_FALSE; } } @@ -169,7 +169,7 @@ PHP_FUNCTION(datefmt_localtime) char* text_to_parse = NULL; size_t text_len =0; zval* z_parse_pos = NULL; - int32_t parse_pos = -1; + zend_long parse_pos = -1; DATE_FORMAT_METHOD_INIT_VARS; @@ -186,8 +186,8 @@ PHP_FUNCTION(datefmt_localtime) if (z_parse_pos) { ZVAL_DEREF(z_parse_pos); convert_to_long(z_parse_pos); - parse_pos = (int32_t)Z_LVAL_P(z_parse_pos); - if(parse_pos > text_len) { + parse_pos = Z_LVAL_P(z_parse_pos); + if((size_t)parse_pos > text_len) { RETURN_FALSE; } } diff --git a/ext/intl/formatter/formatter_attr.c b/ext/intl/formatter/formatter_attr.c index 8e4a18be41..f5efda6119 100644 --- a/ext/intl/formatter/formatter_attr.c +++ b/ext/intl/formatter/formatter_attr.c @@ -252,7 +252,7 @@ PHP_FUNCTION( numfmt_get_symbol ) zend_long symbol; UChar value_buf[4]; UChar *value = value_buf; - int32_t length = USIZE(value_buf); + uint32_t length = USIZE(value_buf); FORMATTER_METHOD_INIT_VARS; /* Parse parameters. */ @@ -345,7 +345,7 @@ PHP_FUNCTION( numfmt_set_symbol ) PHP_FUNCTION( numfmt_get_pattern ) { UChar value_buf[64]; - int32_t length = USIZE( value_buf ); + uint32_t length = USIZE( value_buf ); UChar* value = value_buf; FORMATTER_METHOD_INIT_VARS; diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index 0735a7e822..5ff0a43bfd 100644 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c @@ -126,7 +126,7 @@ PHP_FUNCTION(grapheme_strpos) /* we checked that it will fit: */ offset = (int32_t) loffset; - noffset = offset >= 0 ? offset : haystack_len + offset; + noffset = offset >= 0 ? offset : (int32_t)haystack_len + offset; /* the offset is 'grapheme count offset' so it still might be invalid - we'll check it later */ @@ -200,7 +200,7 @@ PHP_FUNCTION(grapheme_stripos) is_ascii = ( grapheme_ascii_check((unsigned char*)haystack, haystack_len) >= 0 ); if ( is_ascii ) { - int32_t noffset = offset >= 0 ? offset : haystack_len + offset; + int32_t noffset = offset >= 0 ? offset : (int32_t)haystack_len + offset; needle_dup = estrndup(needle, needle_len); php_strtolower(needle_dup, needle_len); haystack_dup = estrndup(haystack, haystack_len); @@ -828,7 +828,7 @@ PHP_FUNCTION(grapheme_extract) RETURN_FALSE; } - if ( lstart > INT32_MAX || lstart < 0 || lstart >= str_len ) { + if ( lstart > INT32_MAX || lstart < 0 || (size_t)lstart >= str_len ) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: start not contained in string", 0 ); RETURN_FALSE; } diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c index b590631c72..042092ea59 100644 --- a/ext/intl/grapheme/grapheme_util.c +++ b/ext/intl/grapheme/grapheme_util.c @@ -345,7 +345,7 @@ grapheme_strrpos_ascii(char *haystack, size_t haystack_len, char *needle, size_t e = haystack + haystack_len - needle_len; } else { p = haystack; - if (needle_len > -offset) { + if (needle_len > (size_t)-offset) { e = haystack + haystack_len - needle_len; } else { e = haystack + haystack_len + offset; diff --git a/ext/intl/grapheme/grapheme_util.h b/ext/intl/grapheme/grapheme_util.h index 492b19bb7f..5b942d030e 100644 --- a/ext/intl/grapheme/grapheme_util.h +++ b/ext/intl/grapheme/grapheme_util.h @@ -34,8 +34,6 @@ int32_t grapheme_split_string(const UChar *text, int32_t text_length, int bounda int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len); -inline void *grapheme_memrchr_grapheme(const void *s, int c, int32_t n); - int32_t grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset); UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status ); diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index 857c14a005..bd60a3480c 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -1429,7 +1429,7 @@ static zend_string* lookup_loc_range(const char* loc_range, HashTable* hash_arr, char* cur_loc_range = NULL; zend_string* can_loc_range = NULL; - int saved_pos = 0; + size_t saved_pos = 0; zend_string* return_value = NULL; diff --git a/ext/intl/uchar/uchar.c b/ext/intl/uchar/uchar.c index 266c62821b..abb3e59671 100644 --- a/ext/intl/uchar/uchar.c +++ b/ext/intl/uchar/uchar.c @@ -11,7 +11,7 @@ static inline int convert_cp(UChar32* pcp, zval *zcp) { if (Z_TYPE_P(zcp) == IS_LONG) { cp = Z_LVAL_P(zcp); } else if (Z_TYPE_P(zcp) == IS_STRING) { - int i = 0; + size_t i = 0; U8_NEXT(Z_STRVAL_P(zcp), i, Z_STRLEN_P(zcp), cp); if (i != Z_STRLEN_P(zcp)) { intl_error_set_code(NULL, U_ILLEGAL_ARGUMENT_ERROR); diff --git a/ext/json/json_parser.tab.c b/ext/json/json_parser.tab.c index 862912c4ec..b4f426e07a 100644 --- a/ext/json/json_parser.tab.c +++ b/ext/json/json_parser.tab.c @@ -139,8 +139,8 @@ int json_yydebug = 1; /* In a future release of Bison, this section will be replaced by #include "json_parser.tab.h". */ -#ifndef YY_PHP_JSON_YY_HOME_JAKUB_PROG_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED -# define YY_PHP_JSON_YY_HOME_JAKUB_PROG_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED +#ifndef YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED +# define YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -201,7 +201,7 @@ typedef union YYSTYPE YYSTYPE; int php_json_yyparse (php_json_parser *parser); -#endif /* !YY_PHP_JSON_YY_HOME_JAKUB_PROG_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED */ +#endif /* !YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED */ /* Copy the second part of user declarations. */ diff --git a/ext/json/json_parser.tab.h b/ext/json/json_parser.tab.h index 56bc2c40c9..4349b70406 100644 --- a/ext/json/json_parser.tab.h +++ b/ext/json/json_parser.tab.h @@ -30,8 +30,8 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -#ifndef YY_PHP_JSON_YY_HOME_JAKUB_PROG_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED -# define YY_PHP_JSON_YY_HOME_JAKUB_PROG_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED +#ifndef YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED +# define YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -92,4 +92,4 @@ typedef union YYSTYPE YYSTYPE; int php_json_yyparse (php_json_parser *parser); -#endif /* !YY_PHP_JSON_YY_HOME_JAKUB_PROG_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED */ +#endif /* !YY_PHP_JSON_YY_HOME_DMITRY_PHP_PHP_MASTER_EXT_JSON_JSON_PARSER_TAB_H_INCLUDED */ diff --git a/ext/json/json_scanner.c b/ext/json/json_scanner.c index ee46a13198..cc9c0c6bb8 100644 --- a/ext/json/json_scanner.c +++ b/ext/json/json_scanner.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.14.3 */ +/* Generated by re2c 0.13.5 */ /* +----------------------------------------------------------------------+ | PHP Version 7 | @@ -147,46 +147,47 @@ yyc_JS: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; + yych = *YYCURSOR; if (yych <= ']') { if (yych <= '"') { if (yych <= '\f') { if (yych <= 0x08) { - if (yych >= 0x01) goto yy5; + if (yych >= 0x01) goto yy4; } else { - if (yych <= '\t') goto yy7; - if (yych <= '\n') goto yy9; - goto yy5; + if (yych <= '\t') goto yy6; + if (yych <= '\n') goto yy8; + goto yy4; } } else { if (yych <= 0x1F) { - if (yych <= '\r') goto yy10; - goto yy5; + if (yych <= '\r') goto yy9; + goto yy4; } else { - if (yych <= ' ') goto yy11; - if (yych <= '!') goto yy12; - goto yy14; + if (yych <= ' ') goto yy10; + if (yych <= '!') goto yy11; + goto yy13; } } } else { if (yych <= '0') { if (yych <= ',') { - if (yych <= '+') goto yy12; - goto yy16; + if (yych <= '+') goto yy11; + goto yy15; } else { - if (yych <= '-') goto yy18; - if (yych <= '/') goto yy12; - goto yy19; + if (yych <= '-') goto yy17; + if (yych <= '/') goto yy11; + goto yy18; } } else { if (yych <= 'Z') { - if (yych <= '9') goto yy21; - if (yych <= ':') goto yy22; - goto yy12; + if (yych <= '9') goto yy20; + if (yych <= ':') goto yy21; + goto yy11; } else { - if (yych <= '[') goto yy24; - if (yych <= '\\') goto yy12; - goto yy26; + if (yych <= '[') goto yy23; + if (yych <= '\\') goto yy11; + goto yy25; } } } @@ -194,41 +195,41 @@ yyc_JS: if (yych <= '}') { if (yych <= 's') { if (yych <= 'f') { - if (yych <= 'e') goto yy12; - goto yy28; + if (yych <= 'e') goto yy11; + goto yy27; } else { - if (yych == 'n') goto yy29; - goto yy12; + if (yych == 'n') goto yy28; + goto yy11; } } else { if (yych <= 'z') { - if (yych <= 't') goto yy30; - goto yy12; + if (yych <= 't') goto yy29; + goto yy11; } else { - if (yych <= '{') goto yy31; - if (yych <= '|') goto yy12; - goto yy33; + if (yych <= '{') goto yy30; + if (yych <= '|') goto yy11; + goto yy32; } } } else { if (yych <= 0xEC) { if (yych <= 0xC1) { - if (yych <= 0x7F) goto yy12; - goto yy35; + if (yych <= 0x7F) goto yy11; + goto yy34; } else { - if (yych <= 0xDF) goto yy37; - if (yych <= 0xE0) goto yy38; - goto yy39; + if (yych <= 0xDF) goto yy36; + if (yych <= 0xE0) goto yy37; + goto yy38; } } else { if (yych <= 0xF0) { - if (yych <= 0xED) goto yy40; - if (yych <= 0xEF) goto yy41; - goto yy42; + if (yych <= 0xED) goto yy39; + if (yych <= 0xEF) goto yy40; + goto yy41; } else { - if (yych <= 0xF3) goto yy43; - if (yych <= 0xF4) goto yy44; - goto yy35; + if (yych <= 0xF3) goto yy42; + if (yych <= 0xF4) goto yy43; + goto yy34; } } } @@ -242,36 +243,36 @@ yyc_JS: return PHP_JSON_T_ERROR; } } -yy5: +yy4: ++YYCURSOR; { s->errcode = PHP_JSON_ERROR_CTRL_CHAR; return PHP_JSON_T_ERROR; } -yy7: +yy6: ++YYCURSOR; yych = *YYCURSOR; - goto yy82; -yy8: + goto yy81; +yy7: { goto std; } +yy8: + yych = *++YYCURSOR; + goto yy7; yy9: yych = *++YYCURSOR; - goto yy8; + if (yych == '\n') goto yy82; + goto yy81; yy10: yych = *++YYCURSOR; - if (yych == '\n') goto yy83; - goto yy82; + goto yy81; yy11: - yych = *++YYCURSOR; - goto yy82; -yy12: ++YYCURSOR; -yy13: +yy12: { s->errcode = PHP_JSON_ERROR_SYNTAX; return PHP_JSON_T_ERROR; } -yy14: +yy13: ++YYCURSOR; { s->str_start = s->cursor; @@ -279,25 +280,25 @@ yy14: PHP_JSON_CONDITION_SET(STR_P1); PHP_JSON_CONDITION_GOTO(STR_P1); } -yy16: +yy15: ++YYCURSOR; { return ','; } -yy18: +yy17: yych = *++YYCURSOR; - if (yych <= '/') goto yy13; - if (yych <= '0') goto yy80; - if (yych <= '9') goto yy70; - goto yy13; -yy19: + if (yych <= '/') goto yy12; + if (yych <= '0') goto yy79; + if (yych <= '9') goto yy69; + goto yy12; +yy18: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { - if (yych == '.') goto yy72; + if (yych == '.') goto yy71; } else { - if (yych <= 'E') goto yy73; - if (yych == 'e') goto yy73; + if (yych <= 'E') goto yy72; + if (yych == 'e') goto yy72; } -yy20: +yy19: { zend_bool bigint = 0, negative = s->token[0] == '-'; size_t digits = (size_t) (s->cursor - s->token - negative); @@ -322,305 +323,305 @@ yy20: return PHP_JSON_T_DOUBLE; } } -yy21: +yy20: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - goto yy71; -yy22: + goto yy70; +yy21: ++YYCURSOR; { return ':'; } -yy24: +yy23: ++YYCURSOR; { return '['; } -yy26: +yy25: ++YYCURSOR; { return ']'; } +yy27: + yyaccept = 1; + yych = *(YYMARKER = ++YYCURSOR); + if (yych == 'a') goto yy64; + goto yy12; yy28: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'a') goto yy65; - goto yy13; + if (yych == 'u') goto yy60; + goto yy12; yy29: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'u') goto yy61; - goto yy13; + if (yych == 'r') goto yy56; + goto yy12; yy30: - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'r') goto yy57; - goto yy13; -yy31: ++YYCURSOR; { return '{'; } -yy33: +yy32: ++YYCURSOR; { return '}'; } -yy35: +yy34: ++YYCURSOR; -yy36: +yy35: { s->errcode = PHP_JSON_ERROR_UTF8; return PHP_JSON_T_ERROR; } -yy37: +yy36: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy36; - if (yych <= 0xBF) goto yy48; - goto yy36; + if (yych <= 0x7F) goto yy35; + if (yych <= 0xBF) goto yy47; + goto yy35; +yy37: + yyaccept = 2; + yych = *(YYMARKER = ++YYCURSOR); + if (yych <= 0x9F) goto yy35; + if (yych <= 0xBF) goto yy55; + goto yy35; yy38: yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x9F) goto yy36; - if (yych <= 0xBF) goto yy56; - goto yy36; + if (yych <= 0x7F) goto yy35; + if (yych <= 0xBF) goto yy54; + goto yy35; yy39: yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x7F) goto yy36; - if (yych <= 0xBF) goto yy55; - goto yy36; + if (yych <= 0x7F) goto yy35; + if (yych <= 0x9F) goto yy53; + goto yy35; yy40: yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x7F) goto yy36; - if (yych <= 0x9F) goto yy54; - goto yy36; + if (yych <= 0x7F) goto yy35; + if (yych <= 0xBF) goto yy52; + goto yy35; yy41: yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x7F) goto yy36; - if (yych <= 0xBF) goto yy53; - goto yy36; + if (yych <= 0x8F) goto yy35; + if (yych <= 0xBF) goto yy50; + goto yy35; yy42: yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x8F) goto yy36; - if (yych <= 0xBF) goto yy51; - goto yy36; + if (yych <= 0x7F) goto yy35; + if (yych <= 0xBF) goto yy48; + goto yy35; yy43: yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x7F) goto yy36; - if (yych <= 0xBF) goto yy49; - goto yy36; -yy44: - yyaccept = 2; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x7F) goto yy36; - if (yych >= 0x90) goto yy36; + if (yych <= 0x7F) goto yy35; + if (yych >= 0x90) goto yy35; yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy46; - if (yych <= 0xBF) goto yy47; -yy46: + if (yych <= 0x7F) goto yy45; + if (yych <= 0xBF) goto yy46; +yy45: YYCURSOR = YYMARKER; if (yyaccept <= 1) { - if (yyaccept == 0) { - goto yy20; + if (yyaccept <= 0) { + goto yy19; } else { - goto yy13; + goto yy12; } } else { - if (yyaccept == 2) { - goto yy36; + if (yyaccept <= 2) { + goto yy35; } else { - goto yy77; + goto yy76; } } +yy46: + yych = *++YYCURSOR; + if (yych <= 0x7F) goto yy45; + if (yych >= 0xC0) goto yy45; yy47: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy46; - if (yych >= 0xC0) goto yy46; + goto yy12; yy48: yych = *++YYCURSOR; - goto yy13; -yy49: + if (yych <= 0x7F) goto yy45; + if (yych >= 0xC0) goto yy45; yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy46; - if (yych >= 0xC0) goto yy46; + if (yych <= 0x7F) goto yy45; + if (yych <= 0xBF) goto yy47; + goto yy45; +yy50: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy46; - if (yych <= 0xBF) goto yy48; - goto yy46; -yy51: + if (yych <= 0x7F) goto yy45; + if (yych >= 0xC0) goto yy45; yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy46; - if (yych >= 0xC0) goto yy46; + if (yych <= 0x7F) goto yy45; + if (yych <= 0xBF) goto yy47; + goto yy45; +yy52: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy46; - if (yych <= 0xBF) goto yy48; - goto yy46; + if (yych <= 0x7F) goto yy45; + if (yych <= 0xBF) goto yy47; + goto yy45; yy53: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy46; - if (yych <= 0xBF) goto yy48; - goto yy46; + if (yych <= 0x7F) goto yy45; + if (yych <= 0xBF) goto yy47; + goto yy45; yy54: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy46; - if (yych <= 0xBF) goto yy48; - goto yy46; + if (yych <= 0x7F) goto yy45; + if (yych <= 0xBF) goto yy47; + goto yy45; yy55: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy46; - if (yych <= 0xBF) goto yy48; - goto yy46; + if (yych <= 0x7F) goto yy45; + if (yych <= 0xBF) goto yy47; + goto yy45; yy56: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy46; - if (yych <= 0xBF) goto yy48; - goto yy46; -yy57: + if (yych != 'u') goto yy45; yych = *++YYCURSOR; - if (yych != 'u') goto yy46; - yych = *++YYCURSOR; - if (yych != 'e') goto yy46; + if (yych != 'e') goto yy45; ++YYCURSOR; { ZVAL_TRUE(&s->value); return PHP_JSON_T_TRUE; } -yy61: +yy60: yych = *++YYCURSOR; - if (yych != 'l') goto yy46; + if (yych != 'l') goto yy45; yych = *++YYCURSOR; - if (yych != 'l') goto yy46; + if (yych != 'l') goto yy45; ++YYCURSOR; { ZVAL_NULL(&s->value); return PHP_JSON_T_NUL; } -yy65: +yy64: yych = *++YYCURSOR; - if (yych != 'l') goto yy46; + if (yych != 'l') goto yy45; yych = *++YYCURSOR; - if (yych != 's') goto yy46; + if (yych != 's') goto yy45; yych = *++YYCURSOR; - if (yych != 'e') goto yy46; + if (yych != 'e') goto yy45; ++YYCURSOR; { ZVAL_FALSE(&s->value); return PHP_JSON_T_FALSE; } -yy70: +yy69: yyaccept = 0; YYMARKER = ++YYCURSOR; yych = *YYCURSOR; -yy71: +yy70: if (yybm[0+yych] & 64) { - goto yy70; + goto yy69; } if (yych <= 'D') { - if (yych != '.') goto yy20; + if (yych != '.') goto yy19; } else { - if (yych <= 'E') goto yy73; - if (yych == 'e') goto yy73; - goto yy20; + if (yych <= 'E') goto yy72; + if (yych == 'e') goto yy72; + goto yy19; } -yy72: +yy71: yych = *++YYCURSOR; - if (yych <= '/') goto yy46; - if (yych <= '9') goto yy78; - goto yy46; -yy73: + if (yych <= '/') goto yy45; + if (yych <= '9') goto yy77; + goto yy45; +yy72: yych = *++YYCURSOR; if (yych <= ',') { - if (yych != '+') goto yy46; + if (yych != '+') goto yy45; } else { - if (yych <= '-') goto yy74; - if (yych <= '/') goto yy46; - if (yych <= '9') goto yy75; - goto yy46; + if (yych <= '-') goto yy73; + if (yych <= '/') goto yy45; + if (yych <= '9') goto yy74; + goto yy45; } -yy74: +yy73: yych = *++YYCURSOR; - if (yych <= '/') goto yy46; - if (yych >= ':') goto yy46; -yy75: + if (yych <= '/') goto yy45; + if (yych >= ':') goto yy45; +yy74: ++YYCURSOR; yych = *YYCURSOR; - if (yych <= '/') goto yy77; - if (yych <= '9') goto yy75; -yy77: + if (yych <= '/') goto yy76; + if (yych <= '9') goto yy74; +yy76: { ZVAL_DOUBLE(&s->value, zend_strtod((char *) s->token, NULL)); return PHP_JSON_T_DOUBLE; } -yy78: +yy77: yyaccept = 3; YYMARKER = ++YYCURSOR; yych = *YYCURSOR; if (yych <= 'D') { - if (yych <= '/') goto yy77; - if (yych <= '9') goto yy78; - goto yy77; + if (yych <= '/') goto yy76; + if (yych <= '9') goto yy77; + goto yy76; } else { - if (yych <= 'E') goto yy73; - if (yych == 'e') goto yy73; - goto yy77; + if (yych <= 'E') goto yy72; + if (yych == 'e') goto yy72; + goto yy76; } -yy80: +yy79: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { - if (yych == '.') goto yy72; - goto yy20; + if (yych == '.') goto yy71; + goto yy19; } else { - if (yych <= 'E') goto yy73; - if (yych == 'e') goto yy73; - goto yy20; + if (yych <= 'E') goto yy72; + if (yych == 'e') goto yy72; + goto yy19; } -yy81: +yy80: ++YYCURSOR; yych = *YYCURSOR; -yy82: +yy81: if (yybm[0+yych] & 128) { - goto yy81; + goto yy80; } - goto yy8; -yy83: + goto yy7; +yy82: ++YYCURSOR; yych = *YYCURSOR; - goto yy8; + goto yy7; } /* *********************************** */ yyc_STR_P1: yych = *YYCURSOR; if (yych <= 0xDF) { if (yych <= '[') { - if (yych <= 0x1F) goto yy86; - if (yych == '"') goto yy90; - goto yy88; + if (yych <= 0x1F) goto yy85; + if (yych == '"') goto yy89; + goto yy87; } else { - if (yych <= '\\') goto yy92; - if (yych <= 0x7F) goto yy88; - if (yych <= 0xC1) goto yy94; - goto yy96; + if (yych <= '\\') goto yy91; + if (yych <= 0x7F) goto yy87; + if (yych <= 0xC1) goto yy93; + goto yy95; } } else { if (yych <= 0xEF) { - if (yych <= 0xE0) goto yy97; - if (yych <= 0xEC) goto yy98; - if (yych <= 0xED) goto yy99; - goto yy100; + if (yych <= 0xE0) goto yy96; + if (yych <= 0xEC) goto yy97; + if (yych <= 0xED) goto yy98; + goto yy99; } else { - if (yych <= 0xF0) goto yy101; - if (yych <= 0xF3) goto yy102; - if (yych <= 0xF4) goto yy103; - goto yy94; + if (yych <= 0xF0) goto yy100; + if (yych <= 0xF3) goto yy101; + if (yych <= 0xF4) goto yy102; + goto yy93; } } -yy86: +yy85: ++YYCURSOR; { s->errcode = PHP_JSON_ERROR_CTRL_CHAR; return PHP_JSON_T_ERROR; } -yy88: +yy87: ++YYCURSOR; -yy89: +yy88: { PHP_JSON_CONDITION_GOTO(STR_P1); } -yy90: +yy89: ++YYCURSOR; { zend_string *str; @@ -644,392 +645,392 @@ yy90: return PHP_JSON_T_STRING; } } -yy92: +yy91: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'e') { if (yych <= '/') { - if (yych == '"') goto yy116; - if (yych >= '/') goto yy116; + if (yych == '"') goto yy115; + if (yych >= '/') goto yy115; } else { if (yych <= '\\') { - if (yych >= '\\') goto yy116; + if (yych >= '\\') goto yy115; } else { - if (yych == 'b') goto yy116; + if (yych == 'b') goto yy115; } } } else { if (yych <= 'q') { - if (yych <= 'f') goto yy116; - if (yych == 'n') goto yy116; + if (yych <= 'f') goto yy115; + if (yych == 'n') goto yy115; } else { if (yych <= 's') { - if (yych <= 'r') goto yy116; + if (yych <= 'r') goto yy115; } else { - if (yych <= 't') goto yy116; - if (yych <= 'u') goto yy118; + if (yych <= 't') goto yy115; + if (yych <= 'u') goto yy117; } } } -yy93: +yy92: { s->errcode = PHP_JSON_ERROR_SYNTAX; return PHP_JSON_T_ERROR; } -yy94: +yy93: ++YYCURSOR; -yy95: +yy94: { s->errcode = PHP_JSON_ERROR_UTF8; return PHP_JSON_T_ERROR; } -yy96: +yy95: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy95; - if (yych <= 0xBF) goto yy107; - goto yy95; + if (yych <= 0x7F) goto yy94; + if (yych <= 0xBF) goto yy106; + goto yy94; +yy96: + yyaccept = 1; + yych = *(YYMARKER = ++YYCURSOR); + if (yych <= 0x9F) goto yy94; + if (yych <= 0xBF) goto yy114; + goto yy94; yy97: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x9F) goto yy95; - if (yych <= 0xBF) goto yy115; - goto yy95; + if (yych <= 0x7F) goto yy94; + if (yych <= 0xBF) goto yy113; + goto yy94; yy98: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x7F) goto yy95; - if (yych <= 0xBF) goto yy114; - goto yy95; + if (yych <= 0x7F) goto yy94; + if (yych <= 0x9F) goto yy112; + goto yy94; yy99: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x7F) goto yy95; - if (yych <= 0x9F) goto yy113; - goto yy95; + if (yych <= 0x7F) goto yy94; + if (yych <= 0xBF) goto yy111; + goto yy94; yy100: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x7F) goto yy95; - if (yych <= 0xBF) goto yy112; - goto yy95; + if (yych <= 0x8F) goto yy94; + if (yych <= 0xBF) goto yy109; + goto yy94; yy101: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x8F) goto yy95; - if (yych <= 0xBF) goto yy110; - goto yy95; + if (yych <= 0x7F) goto yy94; + if (yych <= 0xBF) goto yy107; + goto yy94; yy102: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x7F) goto yy95; - if (yych <= 0xBF) goto yy108; - goto yy95; -yy103: - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x7F) goto yy95; - if (yych >= 0x90) goto yy95; + if (yych <= 0x7F) goto yy94; + if (yych >= 0x90) goto yy94; yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy105; - if (yych <= 0xBF) goto yy106; -yy105: + if (yych <= 0x7F) goto yy104; + if (yych <= 0xBF) goto yy105; +yy104: YYCURSOR = YYMARKER; if (yyaccept <= 1) { - if (yyaccept == 0) { - goto yy93; + if (yyaccept <= 0) { + goto yy92; } else { - goto yy95; + goto yy94; } } else { - goto yy127; + goto yy126; } +yy105: + yych = *++YYCURSOR; + if (yych <= 0x7F) goto yy104; + if (yych >= 0xC0) goto yy104; yy106: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy105; - if (yych >= 0xC0) goto yy105; + goto yy88; yy107: yych = *++YYCURSOR; - goto yy89; -yy108: + if (yych <= 0x7F) goto yy104; + if (yych >= 0xC0) goto yy104; yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy105; - if (yych >= 0xC0) goto yy105; + if (yych <= 0x7F) goto yy104; + if (yych <= 0xBF) goto yy106; + goto yy104; +yy109: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy105; - if (yych <= 0xBF) goto yy107; - goto yy105; -yy110: + if (yych <= 0x7F) goto yy104; + if (yych >= 0xC0) goto yy104; yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy105; - if (yych >= 0xC0) goto yy105; + if (yych <= 0x7F) goto yy104; + if (yych <= 0xBF) goto yy106; + goto yy104; +yy111: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy105; - if (yych <= 0xBF) goto yy107; - goto yy105; + if (yych <= 0x7F) goto yy104; + if (yych <= 0xBF) goto yy106; + goto yy104; yy112: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy105; - if (yych <= 0xBF) goto yy107; - goto yy105; + if (yych <= 0x7F) goto yy104; + if (yych <= 0xBF) goto yy106; + goto yy104; yy113: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy105; - if (yych <= 0xBF) goto yy107; - goto yy105; + if (yych <= 0x7F) goto yy104; + if (yych <= 0xBF) goto yy106; + goto yy104; yy114: yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy105; - if (yych <= 0xBF) goto yy107; - goto yy105; + if (yych <= 0x7F) goto yy104; + if (yych <= 0xBF) goto yy106; + goto yy104; yy115: - yych = *++YYCURSOR; - if (yych <= 0x7F) goto yy105; - if (yych <= 0xBF) goto yy107; - goto yy105; -yy116: ++YYCURSOR; { s->str_esc++; PHP_JSON_CONDITION_GOTO(STR_P1); } -yy118: +yy117: yych = *++YYCURSOR; if (yych <= 'D') { if (yych <= '9') { - if (yych <= '/') goto yy105; - if (yych >= '1') goto yy120; + if (yych <= '/') goto yy104; + if (yych >= '1') goto yy119; } else { - if (yych <= '@') goto yy105; - if (yych <= 'C') goto yy120; - goto yy121; + if (yych <= '@') goto yy104; + if (yych <= 'C') goto yy119; + goto yy120; } } else { if (yych <= 'c') { - if (yych <= 'F') goto yy120; - if (yych <= '`') goto yy105; - goto yy120; + if (yych <= 'F') goto yy119; + if (yych <= '`') goto yy104; + goto yy119; } else { - if (yych <= 'd') goto yy121; - if (yych <= 'f') goto yy120; - goto yy105; + if (yych <= 'd') goto yy120; + if (yych <= 'f') goto yy119; + goto yy104; } } yych = *++YYCURSOR; if (yych <= '9') { - if (yych <= '/') goto yy105; - if (yych <= '0') goto yy140; - if (yych <= '7') goto yy141; - goto yy122; + if (yych <= '/') goto yy104; + if (yych <= '0') goto yy139; + if (yych <= '7') goto yy140; + goto yy121; } else { if (yych <= 'F') { - if (yych <= '@') goto yy105; - goto yy122; + if (yych <= '@') goto yy104; + goto yy121; } else { - if (yych <= '`') goto yy105; - if (yych <= 'f') goto yy122; - goto yy105; + if (yych <= '`') goto yy104; + if (yych <= 'f') goto yy121; + goto yy104; } } -yy120: +yy119: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy105; - if (yych <= '9') goto yy122; - goto yy105; + if (yych <= '/') goto yy104; + if (yych <= '9') goto yy121; + goto yy104; } else { - if (yych <= 'F') goto yy122; - if (yych <= '`') goto yy105; - if (yych <= 'f') goto yy122; - goto yy105; + if (yych <= 'F') goto yy121; + if (yych <= '`') goto yy104; + if (yych <= 'f') goto yy121; + goto yy104; } -yy121: +yy120: yych = *++YYCURSOR; if (yych <= 'B') { if (yych <= '7') { - if (yych <= '/') goto yy105; + if (yych <= '/') goto yy104; } else { - if (yych <= '9') goto yy123; - if (yych <= '@') goto yy105; - goto yy123; + if (yych <= '9') goto yy122; + if (yych <= '@') goto yy104; + goto yy122; } } else { if (yych <= '`') { - if (yych <= 'F') goto yy124; - goto yy105; + if (yych <= 'F') goto yy123; + goto yy104; } else { - if (yych <= 'b') goto yy123; - if (yych <= 'f') goto yy124; - goto yy105; + if (yych <= 'b') goto yy122; + if (yych <= 'f') goto yy123; + goto yy104; } } +yy121: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy104; + if (yych <= '9') goto yy136; + goto yy104; + } else { + if (yych <= 'F') goto yy136; + if (yych <= '`') goto yy104; + if (yych <= 'f') goto yy136; + goto yy104; + } yy122: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy105; - if (yych <= '9') goto yy137; - goto yy105; + if (yych <= '/') goto yy104; + if (yych <= '9') goto yy127; + goto yy104; } else { - if (yych <= 'F') goto yy137; - if (yych <= '`') goto yy105; - if (yych <= 'f') goto yy137; - goto yy105; + if (yych <= 'F') goto yy127; + if (yych <= '`') goto yy104; + if (yych <= 'f') goto yy127; + goto yy104; } yy123: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy105; - if (yych <= '9') goto yy128; - goto yy105; + if (yych <= '/') goto yy104; + if (yych >= ':') goto yy104; } else { - if (yych <= 'F') goto yy128; - if (yych <= '`') goto yy105; - if (yych <= 'f') goto yy128; - goto yy105; + if (yych <= 'F') goto yy124; + if (yych <= '`') goto yy104; + if (yych >= 'g') goto yy104; } yy124: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy105; - if (yych >= ':') goto yy105; + if (yych <= '/') goto yy104; + if (yych >= ':') goto yy104; } else { if (yych <= 'F') goto yy125; - if (yych <= '`') goto yy105; - if (yych >= 'g') goto yy105; + if (yych <= '`') goto yy104; + if (yych >= 'g') goto yy104; } yy125: - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych <= '/') goto yy105; - if (yych >= ':') goto yy105; - } else { - if (yych <= 'F') goto yy126; - if (yych <= '`') goto yy105; - if (yych >= 'g') goto yy105; - } -yy126: ++YYCURSOR; -yy127: +yy126: { s->errcode = PHP_JSON_ERROR_UTF16; return PHP_JSON_T_ERROR; } -yy128: +yy127: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy105; - if (yych >= ':') goto yy105; + if (yych <= '/') goto yy104; + if (yych >= ':') goto yy104; } else { - if (yych <= 'F') goto yy129; - if (yych <= '`') goto yy105; - if (yych >= 'g') goto yy105; + if (yych <= 'F') goto yy128; + if (yych <= '`') goto yy104; + if (yych >= 'g') goto yy104; } -yy129: +yy128: yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); - if (yych != '\\') goto yy127; + if (yych != '\\') goto yy126; yych = *++YYCURSOR; - if (yych != 'u') goto yy105; + if (yych != 'u') goto yy104; yych = *++YYCURSOR; - if (yych == 'D') goto yy132; - if (yych != 'd') goto yy105; -yy132: + if (yych == 'D') goto yy131; + if (yych != 'd') goto yy104; +yy131: yych = *++YYCURSOR; - if (yych <= 'B') goto yy105; - if (yych <= 'F') goto yy133; - if (yych <= 'b') goto yy105; - if (yych >= 'g') goto yy105; -yy133: + if (yych <= 'B') goto yy104; + if (yych <= 'F') goto yy132; + if (yych <= 'b') goto yy104; + if (yych >= 'g') goto yy104; +yy132: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy105; - if (yych >= ':') goto yy105; + if (yych <= '/') goto yy104; + if (yych >= ':') goto yy104; } else { - if (yych <= 'F') goto yy134; - if (yych <= '`') goto yy105; - if (yych >= 'g') goto yy105; + if (yych <= 'F') goto yy133; + if (yych <= '`') goto yy104; + if (yych >= 'g') goto yy104; } -yy134: +yy133: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy105; - if (yych >= ':') goto yy105; + if (yych <= '/') goto yy104; + if (yych >= ':') goto yy104; } else { - if (yych <= 'F') goto yy135; - if (yych <= '`') goto yy105; - if (yych >= 'g') goto yy105; + if (yych <= 'F') goto yy134; + if (yych <= '`') goto yy104; + if (yych >= 'g') goto yy104; } -yy135: +yy134: ++YYCURSOR; { s->str_esc += 8; PHP_JSON_CONDITION_GOTO(STR_P1); } -yy137: +yy136: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy105; - if (yych >= ':') goto yy105; + if (yych <= '/') goto yy104; + if (yych >= ':') goto yy104; } else { - if (yych <= 'F') goto yy138; - if (yych <= '`') goto yy105; - if (yych >= 'g') goto yy105; + if (yych <= 'F') goto yy137; + if (yych <= '`') goto yy104; + if (yych >= 'g') goto yy104; } -yy138: +yy137: ++YYCURSOR; { s->str_esc += 3; PHP_JSON_CONDITION_GOTO(STR_P1); } -yy140: +yy139: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy105; - if (yych <= '7') goto yy145; - if (yych <= '9') goto yy142; - goto yy105; + if (yych <= '/') goto yy104; + if (yych <= '7') goto yy144; + if (yych <= '9') goto yy141; + goto yy104; } else { - if (yych <= 'F') goto yy142; - if (yych <= '`') goto yy105; - if (yych <= 'f') goto yy142; - goto yy105; + if (yych <= 'F') goto yy141; + if (yych <= '`') goto yy104; + if (yych <= 'f') goto yy141; + goto yy104; } -yy141: +yy140: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy105; - if (yych >= ':') goto yy105; + if (yych <= '/') goto yy104; + if (yych >= ':') goto yy104; } else { - if (yych <= 'F') goto yy142; - if (yych <= '`') goto yy105; - if (yych >= 'g') goto yy105; + if (yych <= 'F') goto yy141; + if (yych <= '`') goto yy104; + if (yych >= 'g') goto yy104; } -yy142: +yy141: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy105; - if (yych >= ':') goto yy105; + if (yych <= '/') goto yy104; + if (yych >= ':') goto yy104; } else { - if (yych <= 'F') goto yy143; - if (yych <= '`') goto yy105; - if (yych >= 'g') goto yy105; + if (yych <= 'F') goto yy142; + if (yych <= '`') goto yy104; + if (yych >= 'g') goto yy104; } -yy143: +yy142: ++YYCURSOR; { s->str_esc += 4; PHP_JSON_CONDITION_GOTO(STR_P1); } -yy145: +yy144: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy105; - if (yych >= ':') goto yy105; + if (yych <= '/') goto yy104; + if (yych >= ':') goto yy104; } else { - if (yych <= 'F') goto yy146; - if (yych <= '`') goto yy105; - if (yych >= 'g') goto yy105; + if (yych <= 'F') goto yy145; + if (yych <= '`') goto yy104; + if (yych >= 'g') goto yy104; } -yy146: +yy145: ++YYCURSOR; { s->str_esc += 5; @@ -1038,22 +1039,22 @@ yy146: /* *********************************** */ yyc_STR_P2: yych = *YYCURSOR; - if (yych == '"') goto yy152; - if (yych == '\\') goto yy154; + if (yych == '"') goto yy151; + if (yych == '\\') goto yy153; ++YYCURSOR; { PHP_JSON_CONDITION_GOTO(STR_P2); } -yy152: +yy151: ++YYCURSOR; YYSETCONDITION(yycJS); { PHP_JSON_SCANNER_COPY_ESC(); return PHP_JSON_T_STRING; } -yy154: +yy153: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych == 'u') goto yy156; -yy155: + if (yych == 'u') goto yy155; +yy154: { char esc; PHP_JSON_SCANNER_COPY_ESC(); @@ -1087,103 +1088,103 @@ yy155: s->str_start = s->cursor; PHP_JSON_CONDITION_GOTO(STR_P2); } -yy156: +yy155: yych = *++YYCURSOR; if (yych <= 'D') { if (yych <= '9') { - if (yych <= '/') goto yy157; - if (yych <= '0') goto yy158; - goto yy159; + if (yych <= '/') goto yy156; + if (yych <= '0') goto yy157; + goto yy158; } else { - if (yych <= '@') goto yy157; - if (yych <= 'C') goto yy159; - goto yy160; + if (yych <= '@') goto yy156; + if (yych <= 'C') goto yy158; + goto yy159; } } else { if (yych <= 'c') { - if (yych <= 'F') goto yy159; - if (yych >= 'a') goto yy159; + if (yych <= 'F') goto yy158; + if (yych >= 'a') goto yy158; } else { - if (yych <= 'd') goto yy160; - if (yych <= 'f') goto yy159; + if (yych <= 'd') goto yy159; + if (yych <= 'f') goto yy158; } } -yy157: +yy156: YYCURSOR = YYMARKER; - goto yy155; -yy158: + goto yy154; +yy157: yych = *++YYCURSOR; if (yych <= '9') { - if (yych <= '/') goto yy157; - if (yych <= '0') goto yy175; - if (yych <= '7') goto yy176; - goto yy162; + if (yych <= '/') goto yy156; + if (yych <= '0') goto yy174; + if (yych <= '7') goto yy175; + goto yy161; } else { if (yych <= 'F') { - if (yych <= '@') goto yy157; - goto yy162; + if (yych <= '@') goto yy156; + goto yy161; } else { - if (yych <= '`') goto yy157; - if (yych <= 'f') goto yy162; - goto yy157; + if (yych <= '`') goto yy156; + if (yych <= 'f') goto yy161; + goto yy156; } } +yy158: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy156; + if (yych <= '9') goto yy161; + goto yy156; + } else { + if (yych <= 'F') goto yy161; + if (yych <= '`') goto yy156; + if (yych <= 'f') goto yy161; + goto yy156; + } yy159: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy157; - if (yych <= '9') goto yy162; - goto yy157; + if (yych <= '/') goto yy156; + if (yych <= '7') goto yy161; + if (yych >= ':') goto yy156; } else { - if (yych <= 'F') goto yy162; - if (yych <= '`') goto yy157; - if (yych <= 'f') goto yy162; - goto yy157; + if (yych <= 'B') goto yy160; + if (yych <= '`') goto yy156; + if (yych >= 'c') goto yy156; } yy160: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy157; - if (yych <= '7') goto yy162; - if (yych >= ':') goto yy157; + if (yych <= '/') goto yy156; + if (yych <= '9') goto yy165; + goto yy156; } else { - if (yych <= 'B') goto yy161; - if (yych <= '`') goto yy157; - if (yych >= 'c') goto yy157; + if (yych <= 'F') goto yy165; + if (yych <= '`') goto yy156; + if (yych <= 'f') goto yy165; + goto yy156; } yy161: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy157; - if (yych <= '9') goto yy166; - goto yy157; + if (yych <= '/') goto yy156; + if (yych >= ':') goto yy156; } else { - if (yych <= 'F') goto yy166; - if (yych <= '`') goto yy157; - if (yych <= 'f') goto yy166; - goto yy157; + if (yych <= 'F') goto yy162; + if (yych <= '`') goto yy156; + if (yych >= 'g') goto yy156; } yy162: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy157; - if (yych >= ':') goto yy157; + if (yych <= '/') goto yy156; + if (yych >= ':') goto yy156; } else { if (yych <= 'F') goto yy163; - if (yych <= '`') goto yy157; - if (yych >= 'g') goto yy157; + if (yych <= '`') goto yy156; + if (yych >= 'g') goto yy156; } yy163: - yych = *++YYCURSOR; - if (yych <= '@') { - if (yych <= '/') goto yy157; - if (yych >= ':') goto yy157; - } else { - if (yych <= 'F') goto yy164; - if (yych <= '`') goto yy157; - if (yych >= 'g') goto yy157; - } -yy164: ++YYCURSOR; { int utf16 = php_json_ucs2_to_int(s, 4); @@ -1194,51 +1195,51 @@ yy164: s->str_start = s->cursor; PHP_JSON_CONDITION_GOTO(STR_P2); } -yy166: +yy165: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy157; - if (yych >= ':') goto yy157; + if (yych <= '/') goto yy156; + if (yych >= ':') goto yy156; } else { - if (yych <= 'F') goto yy167; - if (yych <= '`') goto yy157; - if (yych >= 'g') goto yy157; + if (yych <= 'F') goto yy166; + if (yych <= '`') goto yy156; + if (yych >= 'g') goto yy156; } -yy167: +yy166: yych = *++YYCURSOR; - if (yych != '\\') goto yy157; + if (yych != '\\') goto yy156; yych = *++YYCURSOR; - if (yych != 'u') goto yy157; + if (yych != 'u') goto yy156; yych = *++YYCURSOR; - if (yych == 'D') goto yy170; - if (yych != 'd') goto yy157; -yy170: + if (yych == 'D') goto yy169; + if (yych != 'd') goto yy156; +yy169: yych = *++YYCURSOR; - if (yych <= 'B') goto yy157; - if (yych <= 'F') goto yy171; - if (yych <= 'b') goto yy157; - if (yych >= 'g') goto yy157; -yy171: + if (yych <= 'B') goto yy156; + if (yych <= 'F') goto yy170; + if (yych <= 'b') goto yy156; + if (yych >= 'g') goto yy156; +yy170: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy157; - if (yych >= ':') goto yy157; + if (yych <= '/') goto yy156; + if (yych >= ':') goto yy156; } else { - if (yych <= 'F') goto yy172; - if (yych <= '`') goto yy157; - if (yych >= 'g') goto yy157; + if (yych <= 'F') goto yy171; + if (yych <= '`') goto yy156; + if (yych >= 'g') goto yy156; } -yy172: +yy171: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy157; - if (yych >= ':') goto yy157; + if (yych <= '/') goto yy156; + if (yych >= ':') goto yy156; } else { - if (yych <= 'F') goto yy173; - if (yych <= '`') goto yy157; - if (yych >= 'g') goto yy157; + if (yych <= 'F') goto yy172; + if (yych <= '`') goto yy156; + if (yych >= 'g') goto yy156; } -yy173: +yy172: ++YYCURSOR; { int utf32, utf16_hi, utf16_lo; @@ -1253,40 +1254,40 @@ yy173: s->str_start = s->cursor; PHP_JSON_CONDITION_GOTO(STR_P2); } -yy175: +yy174: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy157; - if (yych <= '7') goto yy180; - if (yych <= '9') goto yy177; - goto yy157; + if (yych <= '/') goto yy156; + if (yych <= '7') goto yy179; + if (yych <= '9') goto yy176; + goto yy156; } else { - if (yych <= 'F') goto yy177; - if (yych <= '`') goto yy157; - if (yych <= 'f') goto yy177; - goto yy157; + if (yych <= 'F') goto yy176; + if (yych <= '`') goto yy156; + if (yych <= 'f') goto yy176; + goto yy156; } -yy176: +yy175: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy157; - if (yych >= ':') goto yy157; + if (yych <= '/') goto yy156; + if (yych >= ':') goto yy156; } else { - if (yych <= 'F') goto yy177; - if (yych <= '`') goto yy157; - if (yych >= 'g') goto yy157; + if (yych <= 'F') goto yy176; + if (yych <= '`') goto yy156; + if (yych >= 'g') goto yy156; } -yy177: +yy176: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy157; - if (yych >= ':') goto yy157; + if (yych <= '/') goto yy156; + if (yych >= ':') goto yy156; } else { - if (yych <= 'F') goto yy178; - if (yych <= '`') goto yy157; - if (yych >= 'g') goto yy157; + if (yych <= 'F') goto yy177; + if (yych <= '`') goto yy156; + if (yych >= 'g') goto yy156; } -yy178: +yy177: ++YYCURSOR; { int utf16 = php_json_ucs2_to_int(s, 3); @@ -1296,17 +1297,17 @@ yy178: s->str_start = s->cursor; PHP_JSON_CONDITION_GOTO(STR_P2); } -yy180: +yy179: yych = *++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy157; - if (yych >= ':') goto yy157; + if (yych <= '/') goto yy156; + if (yych >= ':') goto yy156; } else { - if (yych <= 'F') goto yy181; - if (yych <= '`') goto yy157; - if (yych >= 'g') goto yy157; + if (yych <= 'F') goto yy180; + if (yych <= '`') goto yy156; + if (yych >= 'g') goto yy156; } -yy181: +yy180: ++YYCURSOR; { int utf16 = php_json_ucs2_to_int(s, 2); diff --git a/ext/json/php_json_parser.h b/ext/json/php_json_parser.h index f817a2da70..afead526c2 100644 --- a/ext/json/php_json_parser.h +++ b/ext/json/php_json_parser.h @@ -55,7 +55,7 @@ typedef struct _php_json_parser_methods { struct _php_json_parser { php_json_scanner scanner; zval *return_value; - unsigned int depth; + int depth; int max_depth; php_json_parser_methods methods; }; diff --git a/ext/json/php_json_scanner_defs.h b/ext/json/php_json_scanner_defs.h index a75e766a65..b3867433a7 100644 --- a/ext/json/php_json_scanner_defs.h +++ b/ext/json/php_json_scanner_defs.h @@ -1,4 +1,4 @@ -/* Generated by re2c 0.14.3 */ +/* Generated by re2c 0.13.5 */ enum YYCONDTYPE { yycJS, diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 501552f86a..6e0910c257 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -1601,7 +1601,7 @@ PHP_FUNCTION(ldap_delete) */ static int _ldap_str_equal_to_const(const char *str, uint str_len, const char *cstr) { - int i; + uint i; if (strlen(cstr) != str_len) return 0; @@ -1620,7 +1620,7 @@ static int _ldap_str_equal_to_const(const char *str, uint str_len, const char *c */ static int _ldap_strlen_max(const char *str, uint max_len) { - int i; + uint i; for (i = 0; i < max_len; ++i) { if (str[i] == '\0') { @@ -1696,7 +1696,7 @@ PHP_FUNCTION(ldap_modify_batch) zend_ulong tmpUlong; /* make sure the DN contains no NUL bytes */ - if (_ldap_strlen_max(dn, dn_len) != dn_len) { + if ((size_t)_ldap_strlen_max(dn, dn_len) != dn_len) { php_error_docref(NULL, E_WARNING, "DN must not contain NUL bytes"); RETURN_FALSE; } @@ -1755,7 +1755,7 @@ PHP_FUNCTION(ldap_modify_batch) RETURN_FALSE; } - if (Z_STRLEN_P(modinfo) != _ldap_strlen_max(Z_STRVAL_P(modinfo), Z_STRLEN_P(modinfo))) { + if (Z_STRLEN_P(modinfo) != (size_t)_ldap_strlen_max(Z_STRVAL_P(modinfo), Z_STRLEN_P(modinfo))) { php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must not contain NUL bytes"); RETURN_FALSE; } @@ -2715,7 +2715,7 @@ PHP_FUNCTION(ldap_set_rebind_proc) static zend_string* php_ldap_do_escape(const zend_bool *map, const char *value, size_t valuelen) { char hex[] = "0123456789abcdef"; - int i, p = 0; + size_t i, p = 0; size_t len = 0; zend_string *ret; diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 6c0884ea38..a5646ae590 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -687,8 +687,8 @@ static sapi_post_entry mbstr_post_entries[] = { static int php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_encoding ***return_list, size_t *return_size, int persistent) { - int size, bauto, ret = SUCCESS; - size_t n; + int bauto, ret = SUCCESS; + size_t n, size; char *p, *p1, *p2, *endp, *tmpstr; const mbfl_encoding **entry, **list; diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 1018540b68..00ae75afaf 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -748,7 +748,7 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase) for (i = 0; i < regs->num_regs; i++) { beg = regs->beg[i]; end = regs->end[i]; - if (beg >= 0 && beg < end && end <= string_len) { + if (beg >= 0 && beg < end && (size_t)end <= string_len) { add_index_stringl(array, i, (char *)&str[beg], end - beg); } else { add_index_bool(array, i, 0); @@ -807,7 +807,8 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp smart_str out_buf = {0}; smart_str eval_buf = {0}; smart_str *pbuf; - int i, err, eval, n; + size_t i; + int err, eval, n; OnigUChar *pos; OnigUChar *string_lim; char *description = NULL; @@ -926,7 +927,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp n = p[1] - '0'; } if (n >= 0 && n < regs->num_regs) { - if (regs->beg[n] >= 0 && regs->beg[n] < regs->end[n] && regs->end[n] <= string_len) { + if (regs->beg[n] >= 0 && regs->beg[n] < regs->end[n] && (size_t)regs->end[n] <= string_len) { smart_str_appendl(pbuf, string + regs->beg[n], regs->end[n] - regs->beg[n]); } p += 2; @@ -1100,7 +1101,7 @@ PHP_FUNCTION(mb_split) beg = regs->beg[0], end = regs->end[0]; /* add it to the array */ if ((pos - (OnigUChar *)string) < end) { - if (beg < string_len && beg >= (chunk_pos - (OnigUChar *)string)) { + if ((size_t)beg < string_len && beg >= (chunk_pos - (OnigUChar *)string)) { add_next_index_stringl(return_value, (char *)chunk_pos, ((OnigUChar *)(string + beg) - chunk_pos)); --count; } else { diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index fb5c638c97..656a77c8bb 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -563,7 +563,7 @@ PHP_FUNCTION(mcrypt_generic_init) iv_s = emalloc(iv_size + 1); memset(iv_s, 0, iv_size + 1); - if (key_len > max_key_size) { + if (key_len > (size_t)max_key_size) { php_error_docref(NULL, E_WARNING, "Key size too large; supplied length: %zd, max: %d", key_len, max_key_size); key_size = max_key_size; } else { @@ -571,9 +571,9 @@ PHP_FUNCTION(mcrypt_generic_init) } memcpy(key_s, key, key_len); - if (iv_len != iv_size) { + if (iv_len != (size_t)iv_size) { php_error_docref(NULL, E_WARNING, "Iv size incorrect; supplied length: %zd, needed: %d", iv_len, iv_size); - if (iv_len > iv_size) { + if (iv_len > (size_t)iv_size) { iv_len = iv_size; } } @@ -1387,7 +1387,7 @@ PHP_FUNCTION(mcrypt_create_iv) } } - while (read_bytes < size) { + while ((zend_long)read_bytes < size) { n = read(*fd, iv + read_bytes, size - read_bytes); if (n <= 0) { break; diff --git a/ext/mcrypt/mcrypt_filter.c b/ext/mcrypt/mcrypt_filter.c index 03f1548fc3..03d7c5315f 100644 --- a/ext/mcrypt/mcrypt_filter.c +++ b/ext/mcrypt/mcrypt_filter.c @@ -226,7 +226,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval } iv = emalloc(iv_len + 1); - if (iv_len <= Z_STRLEN_P(tmpzval)) { + if ((size_t)iv_len <= Z_STRLEN_P(tmpzval)) { memcpy(iv, Z_STRVAL_P(tmpzval), iv_len); } else { memcpy(iv, Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval)); diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index f9c5dbc764..7b403dff08 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -354,7 +354,7 @@ PHP_FUNCTION(mysqli_stmt_bind_param) RETURN_FALSE; } - if (types_len != argc - start) { + if (types_len != (size_t)(argc - start)) { /* number of bind variables doesn't match number of elements in type definition string */ php_error_docref(NULL, E_WARNING, "Number of elements in type definition string doesn't match number of bind variables"); RETURN_FALSE; @@ -596,7 +596,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result) MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); - if (argc != mysql_stmt_field_count(stmt->stmt)) { + if ((uint)argc != mysql_stmt_field_count(stmt->stmt)) { php_error_docref(NULL, E_WARNING, "Number of bind variables doesn't match number of fields in prepared statement"); RETURN_FALSE; } @@ -1330,7 +1330,7 @@ PHP_FUNCTION(mysqli_field_seek) } MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); - if (fieldnr < 0 || fieldnr >= mysql_num_fields(result)) { + if (fieldnr < 0 || (uint)fieldnr >= mysql_num_fields(result)) { php_error_docref(NULL, E_WARNING, "Invalid field offset"); RETURN_FALSE; } diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c index a161911341..69db138575 100644 --- a/ext/mysqli/mysqli_driver.c +++ b/ext/mysqli/mysqli_driver.c @@ -150,7 +150,7 @@ const zend_function_entry mysqli_driver_methods[] = { PHP_FALIAS(embedded_server_start, mysqli_embedded_server_start, NULL) PHP_FALIAS(embedded_server_end, mysqli_embedded_server_end, NULL) #endif - {NULL, NULL, NULL} + PHP_FE_END }; /* }}} */ diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c index ba3eebb19a..f533102d6e 100644 --- a/ext/mysqli/mysqli_exception.c +++ b/ext/mysqli/mysqli_exception.c @@ -32,7 +32,7 @@ /* {{{ mysqli_exception_methods[] */ const zend_function_entry mysqli_exception_methods[] = { - {NULL, NULL, NULL} + PHP_FE_END }; /* }}} */ diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c index abc23f0699..fe273ee6e2 100644 --- a/ext/mysqli/mysqli_fe.c +++ b/ext/mysqli/mysqli_fe.c @@ -579,7 +579,7 @@ const zend_function_entry mysqli_link_methods[] = { PHP_FALIAS(thread_safe, mysqli_thread_safe, arginfo_mysqli_no_params) PHP_FALIAS(use_result, mysqli_use_result, arginfo_mysqli_no_params) PHP_FALIAS(refresh,mysqli_refresh, arginfo_class_mysqli_refresh) - {NULL, NULL, NULL} + PHP_FE_END }; /* }}} */ @@ -604,7 +604,7 @@ const zend_function_entry mysqli_result_methods[] = { PHP_FALIAS(fetch_row, mysqli_fetch_row, arginfo_mysqli_no_params) PHP_FALIAS(field_seek, mysqli_field_seek, arginfo_class_mysqli_result_and_fieldnr) PHP_FALIAS(free_result, mysqli_free_result, arginfo_mysqli_no_params) - {NULL, NULL, NULL} + PHP_FE_END }; /* }}} */ @@ -637,7 +637,7 @@ const zend_function_entry mysqli_stmt_methods[] = { #if defined(MYSQLI_USE_MYSQLND) PHP_FALIAS(get_result, mysqli_stmt_get_result, arginfo_mysqli_no_params) #endif - {NULL, NULL, NULL} + PHP_FE_END }; /* }}} */ diff --git a/ext/mysqli/mysqli_result_iterator.c b/ext/mysqli/mysqli_result_iterator.c index 0a33bb4f67..d3f62260e6 100644 --- a/ext/mysqli/mysqli_result_iterator.c +++ b/ext/mysqli/mysqli_result_iterator.c @@ -153,6 +153,7 @@ zend_object_iterator_funcs php_mysqli_result_iterator_funcs = { php_mysqli_result_iterator_current_key, php_mysqli_result_iterator_move_forward, php_mysqli_result_iterator_rewind, + NULL }; /* }}} */ diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c index d789627e7f..063ed56c2d 100644 --- a/ext/mysqli/mysqli_warning.c +++ b/ext/mysqli/mysqli_warning.c @@ -315,7 +315,7 @@ PHP_METHOD(mysqli_warning, __construct) const zend_function_entry mysqli_warning_methods[] = { PHP_ME(mysqli_warning, __construct, NULL, ZEND_ACC_PROTECTED) PHP_ME(mysqli_warning, next, NULL, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} + PHP_FE_END }; /* }}} */ diff --git a/ext/mysqlnd/mysqlnd_debug.h b/ext/mysqlnd/mysqlnd_debug.h index c9eced8af3..0597c8501d 100644 --- a/ext/mysqlnd/mysqlnd_debug.h +++ b/ext/mysqlnd/mysqlnd_debug.h @@ -130,8 +130,9 @@ PHPAPI MYSQLND_DEBUG * mysqlnd_debug_init(const char * skip_functions[]); if ((dbg_obj2)) { \ dbg_skip_trace |= !(dbg_obj2)->m->func_enter((dbg_obj2), __LINE__, __FILE__, func_name, strlen(func_name)); \ } \ - if (dbg_skip_trace) \ + if (dbg_skip_trace) { \ /* EMPTY */ ; /* shut compiler's mouth */ \ + } \ do { \ if (((dbg_obj1) && (dbg_obj1)->flags & MYSQLND_DEBUG_PROFILE_CALLS) || \ ((dbg_obj2) && (dbg_obj2)->flags & MYSQLND_DEBUG_PROFILE_CALLS)) \ diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.h b/ext/mysqlnd/mysqlnd_wireprotocol.h index 337143fb9f..3dc17053cf 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.h +++ b/ext/mysqlnd/mysqlnd_wireprotocol.h @@ -300,7 +300,7 @@ zend_ulong php_mysqlnd_net_field_length(const zend_uchar **packet); zend_uchar * php_mysqlnd_net_store_length(zend_uchar *packet, const uint64_t length); size_t php_mysqlnd_net_store_length_size(uint64_t length); -PHPAPI const extern char * const mysqlnd_empty_string; +PHPAPI extern const char * const mysqlnd_empty_string; enum_func_status php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields, unsigned int field_count, const MYSQLND_FIELD * fields_metadata, diff --git a/ext/odbc/birdstep.c b/ext/odbc/birdstep.c index 9ece945f4f..f12545b933 100644 --- a/ext/odbc/birdstep.c +++ b/ext/odbc/birdstep.c @@ -136,7 +136,7 @@ const zend_function_entry birdstep_functions[] = { PHP_FALIAS(velocis_fieldnum, birdstep_fieldnum, arginfo_birdstep_fieldnum) PHP_FALIAS(velocis_fieldname, birdstep_fieldname, arginfo_birdstep_fieldname) /* End temporary aliases */ - {NULL, NULL, NULL} + PHP_FE_END }; zend_module_entry birdstep_module_entry = { diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 72efb44f61..32c27c326f 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -775,7 +775,7 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */ return (time_t)-1; } - if (ASN1_STRING_length(timestr) != strlen((const char*)ASN1_STRING_data(timestr))) { + if ((size_t)ASN1_STRING_length(timestr) != strlen((const char*)ASN1_STRING_data(timestr))) { php_error_docref(NULL, E_WARNING, "illegal length in timestamp"); return (time_t)-1; } @@ -2901,13 +2901,13 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z /* Finally apply defaults from config file */ for(i = 0; i < sk_CONF_VALUE_num(dn_sk); i++) { - int len; + size_t len; char buffer[200 + 1]; /*200 + \0 !*/ v = sk_CONF_VALUE_value(dn_sk, i); type = v->name; - len = (int)strlen(type); + len = strlen(type); if (len < sizeof("_default")) { continue; } @@ -5463,7 +5463,7 @@ PHP_FUNCTION(openssl_open) "Cipher algorithm requires an IV to be supplied as a sixth parameter"); RETURN_FALSE; } - if (cipher_iv_len != iv_len) { + if ((size_t)cipher_iv_len != iv_len) { php_error_docref(NULL, E_WARNING, "IV length is invalid"); RETURN_FALSE; } diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 6f542323d2..349828bdc4 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -413,7 +413,7 @@ static zend_bool matches_san_list(X509 *peer, const char *subject_name) /* {{{ * if (san->type == GEN_DNS) { ASN1_STRING_to_UTF8(&cert_name, san->d.dNSName); - if (ASN1_STRING_length(san->d.dNSName) != strlen((const char*)cert_name)) { + if ((size_t)ASN1_STRING_length(san->d.dNSName) != strlen((const char*)cert_name)) { OPENSSL_free(cert_name); /* prevent null-byte poisoning*/ continue; @@ -465,7 +465,7 @@ static zend_bool matches_common_name(X509 *peer, const char *subject_name) /* {{ if (cert_name_len == -1) { php_error_docref(NULL, E_WARNING, "Unable to locate peer certificate CN"); - } else if (cert_name_len != strlen(buf)) { + } else if ((size_t)cert_name_len != strlen(buf)) { php_error_docref(NULL, E_WARNING, "Peer certificate CN=`%.*s' is malformed", cert_name_len, buf); } else if (matches_wildcard_name(subject_name, buf)) { is_match = 1; @@ -579,7 +579,7 @@ static int passwd_callback(char *buf, int num, int verify, void *data) /* {{{ */ GET_VER_OPT_STRING("passphrase", passphrase); if (passphrase) { - if (Z_STRLEN_P(val) < num - 1) { + if (Z_STRLEN_P(val) < (size_t)num - 1) { memcpy(buf, Z_STRVAL_P(val), Z_STRLEN_P(val)+1); return (int)Z_STRLEN_P(val); } diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c index c6b9ebdcdc..20f71491be 100644 --- a/ext/pdo/pdo.c +++ b/ext/pdo/pdo.c @@ -190,7 +190,8 @@ pdo_driver_t *pdo_find_driver(const char *name, int namelen) /* {{{ */ PDO_API int php_pdo_parse_data_source(const char *data_source, zend_ulong data_source_len, struct pdo_data_src_parser *parsed, int nparams) /* {{{ */ { - int i, j; + zend_ulong i; + int j; int valstart = -1; int semi = -1; int optstart = 0; diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index ffb1b6ef03..c988a575fb 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -1246,7 +1246,7 @@ const zend_function_entry pdo_dbh_functions[] = /* {{{ */ { PHP_ME(PDO, __wakeup, arginfo_pdo__void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(PDO, __sleep, arginfo_pdo__void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(PDO, getAvailableDrivers, arginfo_pdo__void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - {NULL, NULL, NULL} + PHP_FE_END }; /* }}} */ @@ -1309,7 +1309,7 @@ int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind) func.arg_info = (zend_internal_arg_info*)funcs->arg_info + 1; func.num_args = funcs->num_args; - if (info->required_num_args == -1) { + if (info->required_num_args == (uint32_t)-1) { func.required_num_args = funcs->num_args; } else { func.required_num_args = info->required_num_args; diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c index 0095c3d8dc..573d5865a0 100644 --- a/ext/pdo/pdo_sql_parser.c +++ b/ext/pdo/pdo_sql_parser.c @@ -400,7 +400,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, size_t inquery_len Scanner s; char *ptr, *newbuffer; int t; - int bindno = 0; + uint32_t bindno = 0; int ret = 0; size_t newbuffer_len; HashTable *params; diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re index 3279b47056..20b9976850 100644 --- a/ext/pdo/pdo_sql_parser.re +++ b/ext/pdo/pdo_sql_parser.re @@ -86,7 +86,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, size_t inquery_len Scanner s; char *ptr, *newbuffer; int t; - int bindno = 0; + uint32_t bindno = 0; int ret = 0; size_t newbuffer_len; HashTable *params; diff --git a/ext/pdo/pdo_sqlstate.c b/ext/pdo/pdo_sqlstate.c index 24ed49b414..c40f8c1835 100644 --- a/ext/pdo/pdo_sqlstate.c +++ b/ext/pdo/pdo_sqlstate.c @@ -311,7 +311,7 @@ void pdo_sqlstate_fini_error_table(void) int pdo_sqlstate_init_error_table(void) { - int i; + size_t i; const struct pdo_sqlstate_info *info; zend_hash_init(&err_hash, sizeof(err_initializer)/sizeof(err_initializer[0]), NULL, NULL, 1); diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index bd8a054718..2d57f9c8d4 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -551,7 +551,7 @@ static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *typ col = &stmt->columns[colno]; type = PDO_PARAM_TYPE(col->param_type); - new_type = type_override ? PDO_PARAM_TYPE(*type_override) : type; + new_type = type_override ? (int)PDO_PARAM_TYPE(*type_override) : type; value = NULL; value_len = 0; @@ -1537,10 +1537,11 @@ static PHP_METHOD(PDOStatement, fetchAll) static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int is_param) /* {{{ */ { - struct pdo_bound_param_data param = {{{0}}}; + struct pdo_bound_param_data param; zend_long param_type = PDO_PARAM_STR; zval *parameter, *driver_params = NULL; + memset(¶m, 0, sizeof(param)); param.paramno = -1; if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), @@ -1580,11 +1581,12 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, bind an input parameter to the value of a PHP variable. $paramno is the 1-based position of the placeholder in the SQL statement (but can be the parameter name for drivers that support named placeholders). It should be called prior to execute(). */ static PHP_METHOD(PDOStatement, bindValue) { - struct pdo_bound_param_data param = {{{0}}}; + struct pdo_bound_param_data param; zend_long param_type = PDO_PARAM_STR; zval *parameter; PHP_STMT_GET_OBJ; + memset(¶m, 0, sizeof(param)); param.paramno = -1; if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), @@ -2177,7 +2179,7 @@ const zend_function_entry pdo_dbstmt_functions[] = { PHP_ME(PDOStatement, debugDumpParams, arginfo_pdostatement__void, ZEND_ACC_PUBLIC) PHP_ME(PDOStatement, __wakeup, arginfo_pdostatement__void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(PDOStatement, __sleep, arginfo_pdostatement__void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - {NULL, NULL, NULL} + PHP_FE_END }; /* {{{ overloaded handlers for PDOStatement class */ @@ -2448,6 +2450,7 @@ static zend_object_iterator_funcs pdo_stmt_iter_funcs = { pdo_stmt_iter_get_data, pdo_stmt_iter_get_key, pdo_stmt_iter_move_forwards, + NULL, NULL }; @@ -2480,7 +2483,7 @@ zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int /* {{{ overloaded handlers for PDORow class (used by PDO_FETCH_LAZY) */ const zend_function_entry pdo_row_functions[] = { - {NULL, NULL, NULL} + PHP_FE_END }; static zval *row_prop_read(zval *object, zval *member, int type, void **cache_slot, zval *rv) @@ -2679,6 +2682,11 @@ zend_object_handlers pdo_row_object_handlers = { row_get_classname, row_compare, NULL, /* cast */ + NULL, + NULL, + NULL, + NULL, + NULL, NULL }; diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 1b1d1abbea..de898262d4 100644 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -523,7 +523,10 @@ static struct pdo_dbh_methods mysql_methods = { pdo_mysql_last_insert_id, pdo_mysql_fetch_error_func, pdo_mysql_get_attribute, - pdo_mysql_check_liveness + pdo_mysql_check_liveness, + NULL, + NULL, + NULL }; /* }}} */ @@ -537,7 +540,8 @@ static struct pdo_dbh_methods mysql_methods = { static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) { pdo_mysql_db_handle *H; - int i, ret = 0; + size_t i; + int ret = 0; char *host = NULL, *unix_socket = NULL; unsigned int port = 3306; char *dbname; diff --git a/ext/pdo_pgsql/pdo_pgsql.c b/ext/pdo_pgsql/pdo_pgsql.c index 1661fbe2d6..82dcb94b88 100644 --- a/ext/pdo_pgsql/pdo_pgsql.c +++ b/ext/pdo_pgsql/pdo_pgsql.c @@ -41,7 +41,7 @@ /* {{{ pdo_pgsql_functions[] */ const zend_function_entry pdo_pgsql_functions[] = { - {NULL, NULL, NULL} + PHP_FE_END }; /* }}} */ diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index a8229fe88e..5a970371c0 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -813,7 +813,7 @@ static PHP_METHOD(PDO, pgsqlCopyToFile) if (ret == -1) { break; /* done */ } else if (ret > 0) { - if (php_stream_write(stream, csv, ret) != ret) { + if (php_stream_write(stream, csv, ret) != (size_t)ret) { pdo_pgsql_error_msg(dbh, PGRES_FATAL_ERROR, "Unable to write to file"); PQfreemem(csv); php_stream_close(stream); diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index 4e729aab0e..22fb8a46b9 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -727,7 +727,8 @@ static struct pdo_dbh_methods sqlite_methods = { pdo_sqlite_get_attribute, NULL, /* check_liveness: not needed */ get_driver_methods, - pdo_sqlite_request_shutdown + pdo_sqlite_request_shutdown, + NULL }; static char *make_filename_safe(const char *filename) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index b567c3c8a5..c4dfe2ed9d 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -3333,7 +3333,7 @@ PHP_FUNCTION(pg_lo_unlink) } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "rl", &pgsql_link, &oid_long) == SUCCESS) { - if (oid_long <= InvalidOid) { + if (oid_long <= (zend_long)InvalidOid) { php_error_docref(NULL, E_NOTICE, "Invalid OID specified"); RETURN_FALSE; } @@ -3353,7 +3353,7 @@ PHP_FUNCTION(pg_lo_unlink) } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "l", &oid_long) == SUCCESS) { - if (oid_long <= InvalidOid) { + if (oid_long <= (zend_long)InvalidOid) { php_error_docref(NULL, E_NOTICE, "Invalid OID is specified"); RETURN_FALSE; } @@ -3407,7 +3407,7 @@ PHP_FUNCTION(pg_lo_open) } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "rls", &pgsql_link, &oid_long, &mode_string, &mode_strlen) == SUCCESS) { - if (oid_long <= InvalidOid) { + if (oid_long <= (zend_long)InvalidOid) { php_error_docref(NULL, E_NOTICE, "Invalid OID specified"); RETURN_FALSE; } @@ -3427,7 +3427,7 @@ PHP_FUNCTION(pg_lo_open) } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "ls", &oid_long, &mode_string, &mode_strlen) == SUCCESS) { - if (oid_long <= InvalidOid) { + if (oid_long <= (zend_long)InvalidOid) { php_error_docref(NULL, E_NOTICE, "Invalid OID specified"); RETURN_FALSE; } @@ -3599,7 +3599,7 @@ PHP_FUNCTION(pg_lo_write) RETURN_FALSE; } - if ((nbytes = lo_write((PGconn *)pgsql->conn, pgsql->lofd, str, len)) == -1) { + if ((nbytes = lo_write((PGconn *)pgsql->conn, pgsql->lofd, str, len)) == (size_t)-1) { RETURN_FALSE; } @@ -3738,7 +3738,7 @@ PHP_FUNCTION(pg_lo_export) /* allow string to handle large OID value correctly */ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "rlp", &pgsql_link, &oid_long, &file_out, &name_len) == SUCCESS) { - if (oid_long <= InvalidOid) { + if (oid_long <= (zend_long)InvalidOid) { php_error_docref(NULL, E_NOTICE, "Invalid OID specified"); RETURN_FALSE; } @@ -3757,7 +3757,7 @@ PHP_FUNCTION(pg_lo_export) } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "lp", &oid_long, &file_out, &name_len) == SUCCESS) { - if (oid_long <= InvalidOid) { + if (oid_long <= (zend_long)InvalidOid) { php_error_docref(NULL, E_NOTICE, "Invalid OID specified"); RETURN_FALSE; } @@ -3789,7 +3789,7 @@ PHP_FUNCTION(pg_lo_export) else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "lpr", &oid_long, &file_out, &name_len, &pgsql_link) == SUCCESS) { php_error_docref(NULL, E_NOTICE, "Old API is used"); - if (oid_long <= InvalidOid) { + if (oid_long <= (zend_long)InvalidOid) { php_error_docref(NULL, E_NOTICE, "Invalid OID specified"); RETURN_FALSE; } diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index 33dfffc3c0..871929bcc2 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -180,7 +180,7 @@ static int phar_compare_dir_name(const void *a, const void *b) /* {{{ */ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest) /* {{{ */ { HashTable *data; - int dirlen = strlen(dir); + size_t dirlen = strlen(dir); char *entry, *found, *save; zend_string *str_key; uint keylen; diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 2b65a54ed9..66da7c81c9 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -3473,7 +3473,7 @@ void phar_request_initialize(void) /* {{{ */ PHP_RSHUTDOWN_FUNCTION(phar) /* {{{ */ { - int i; + uint32_t i; PHAR_G(request_ends) = 1; diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index a287dc996b..941cd4cebd 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -1315,7 +1315,7 @@ PHP_METHOD(Phar, unlinkArchive) zname_len = strlen(zname); if (zname_len > 7 && !memcmp(zname, "phar://", 7) && SUCCESS == phar_split_fname(zname, zname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) { - if (arch_len == fname_len && !memcmp(arch, fname, arch_len)) { + if ((size_t)arch_len == fname_len && !memcmp(arch, fname, arch_len)) { zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%s\" cannot be unlinked from within itself", fname); efree(arch); efree(entry); @@ -2655,7 +2655,7 @@ PHP_METHOD(Phar, setAlias) } if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &alias, &alias_len) == SUCCESS) { - if (alias_len == phar_obj->archive->alias_len && memcmp(phar_obj->archive->alias, alias, alias_len) == 0) { + if (alias_len == (size_t)phar_obj->archive->alias_len && memcmp(phar_obj->archive->alias, alias, alias_len) == 0) { RETURN_TRUE; } if (alias_len && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len))) { @@ -3551,7 +3551,7 @@ static void phar_add_file(phar_archive_data **pphar, char *filename, int filenam phar_entry_data *data; php_stream *contents_file; - if (filename_len >= sizeof(".phar")-1 && !memcmp(filename, ".phar", sizeof(".phar")-1) && (filename[5] == '/' || filename[5] == '\\' || filename[5] == '\0')) { + if (filename_len >= (int)sizeof(".phar")-1 && !memcmp(filename, ".phar", sizeof(".phar")-1) && (filename[5] == '/' || filename[5] == '\\' || filename[5] == '\0')) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot create any files in magic \".phar\" directory"); return; } diff --git a/ext/phar/stream.c b/ext/phar/stream.c index e68c04b0ec..5706c20952 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -45,6 +45,7 @@ php_stream_wrapper_ops phar_stream_wops = { phar_wrapper_rename, /* rename */ phar_wrapper_mkdir, /* create directory */ phar_wrapper_rmdir, /* remove directory */ + NULL }; php_stream_wrapper php_stream_phar_wrapper = { diff --git a/ext/phar/util.c b/ext/phar/util.c index 39ecf399ae..eed6a10d39 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -178,7 +178,7 @@ int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len, return FAILURE; } - if (path_len >= sizeof(".phar")-1 && !memcmp(path, ".phar", sizeof(".phar")-1)) { + if (path_len >= (int)sizeof(".phar")-1 && !memcmp(path, ".phar", sizeof(".phar")-1)) { /* no creating magic phar files by mounting them */ return FAILURE; } @@ -1225,7 +1225,7 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, in *error = NULL; } - if (security && path_len >= sizeof(".phar")-1 && !memcmp(path, ".phar", sizeof(".phar")-1)) { + if (security && path_len >= (int)sizeof(".phar")-1 && !memcmp(path, ".phar", sizeof(".phar")-1)) { if (error) { spprintf(error, 4096, "phar error: cannot directly access magic \".phar\" directory or files within it"); } @@ -1403,7 +1403,7 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t ZVAL_EMPTY_STRING(&zp[0]); } - if (end != Z_STRLEN(zp[0])) { + if ((size_t)end != Z_STRLEN(zp[0])) { zval_dtor(&zp[0]); zval_dtor(&zp[1]); zval_dtor(&zp[2]); @@ -1563,7 +1563,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t sig_type, EVP_VerifyInit(&md_ctx, mdtype); read_len = end_of_phar; - if (read_len > sizeof(buf)) { + if ((size_t)read_len > sizeof(buf)) { read_size = sizeof(buf); } else { read_size = (int)read_len; @@ -1605,7 +1605,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t sig_type, PHP_SHA512Init(&context); read_len = end_of_phar; - if (read_len > sizeof(buf)) { + if ((size_t)read_len > sizeof(buf)) { read_size = sizeof(buf); } else { read_size = (int)read_len; @@ -1638,7 +1638,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t sig_type, PHP_SHA256Init(&context); read_len = end_of_phar; - if (read_len > sizeof(buf)) { + if ((size_t)read_len > sizeof(buf)) { read_size = sizeof(buf); } else { read_size = (int)read_len; @@ -1679,7 +1679,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t sig_type, PHP_SHA1Init(&context); read_len = end_of_phar; - if (read_len > sizeof(buf)) { + if ((size_t)read_len > sizeof(buf)) { read_size = sizeof(buf); } else { read_size = (int)read_len; @@ -1712,7 +1712,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, uint32_t sig_type, PHP_MD5Init(&context); read_len = end_of_phar; - if (read_len > sizeof(buf)) { + if ((size_t)read_len > sizeof(buf)) { read_size = sizeof(buf); } else { read_size = (int)read_len; diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 30c52c0479..427b894288 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -167,7 +167,7 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, { phar_zip_dir_end locator; char buf[sizeof(locator) + 65536]; - zend_long size; + size_t size; uint16_t i; phar_archive_data *mydata = NULL; phar_entry_info entry = {0}; @@ -395,10 +395,9 @@ foundit: if (entry.filename_len == sizeof(".phar/signature.bin")-1 && !strncmp(entry.filename, ".phar/signature.bin", sizeof(".phar/signature.bin")-1)) { size_t read; php_stream *sigfile; - zend_off_t now; char *sig; - now = php_stream_tell(fp); + php_stream_tell(fp); pefree(entry.filename, entry.is_persistent); sigfile = php_stream_fopen_tmpfile(); if (!sigfile) { @@ -1110,14 +1109,14 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas char *signature, sigbuf[8]; phar_entry_info entry = {0}; php_stream *newfile; - zend_off_t tell, st; + zend_off_t tell; newfile = php_stream_fopen_tmpfile(); if (newfile == NULL) { spprintf(pass->error, 0, "phar error: unable to create temporary file for the signature file"); return FAILURE; } - st = tell = php_stream_tell(pass->filefp); + tell = php_stream_tell(pass->filefp); /* copy the local files, central directory, and the zip comment to generate the hash */ php_stream_seek(pass->filefp, 0, SEEK_SET); php_stream_copy_to_stream_ex(pass->filefp, newfile, tell, NULL); diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c index 2cce2292f4..567629bba3 100644 --- a/ext/readline/readline_cli.c +++ b/ext/readline/readline_cli.c @@ -592,8 +592,9 @@ static int readline_shell_run(void) /* {{{ */ if (PG(auto_prepend_file) && PG(auto_prepend_file)[0]) { zend_file_handle *prepend_file_p; - zend_file_handle prepend_file = {{0}}; + zend_file_handle prepend_file; + memset(&prepend_file, 0, sizeof(prepend_file)); prepend_file.filename = PG(auto_prepend_file); prepend_file.opened_path = NULL; prepend_file.free_filename = 0; diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 13003cae84..1eaa9d17b0 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -657,7 +657,7 @@ static zend_op* _get_recv_op(zend_op_array *op_array, uint32_t offset) ++offset; while (op < end) { if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT - || op->opcode == ZEND_RECV_VARIADIC) && op->op1.num == (zend_long)offset) + || op->opcode == ZEND_RECV_VARIADIC) && op->op1.num == offset) { return op; } diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index b380cfe86b..a1650e092d 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -222,7 +222,7 @@ static void ps_files_open(ps_files *data, const char *key) static int ps_files_write(ps_files *data, zend_string *key, zend_string *val) { - zend_long n = 0; + size_t n = 0; /* PS(id) may be changed by calling session_regenerate_id(). Re-initialization should be tried here. ps_files_open() checks @@ -262,7 +262,7 @@ static int ps_files_write(ps_files *data, zend_string *key, zend_string *val) #endif if (n != ZSTR_LEN(val)) { - if (n == -1) { + if (n == (size_t)-1) { php_error_docref(NULL, E_WARNING, "write failed: %s (%d)", strerror(errno), errno); } else { php_error_docref(NULL, E_WARNING, "write wrote less bytes than requested"); diff --git a/ext/session/session.c b/ext/session/session.c index 6fd0ee2f37..50ae0f8849 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -2597,7 +2597,7 @@ static const zend_function_entry php_session_iface_functions[] = { PHP_ABSTRACT_ME(SessionHandlerInterface, write, arginfo_session_class_write) PHP_ABSTRACT_ME(SessionHandlerInterface, destroy, arginfo_session_class_destroy) PHP_ABSTRACT_ME(SessionHandlerInterface, gc, arginfo_session_class_gc) - { NULL, NULL, NULL } + PHP_FE_END }; /* }}} */ @@ -2605,7 +2605,7 @@ static const zend_function_entry php_session_iface_functions[] = { */ static const zend_function_entry php_session_id_iface_functions[] = { PHP_ABSTRACT_ME(SessionIdInterface, create_sid, arginfo_session_class_create_sid) - { NULL, NULL, NULL } + PHP_FE_END }; /* }}} */ @@ -2614,7 +2614,7 @@ static const zend_function_entry php_session_id_iface_functions[] = { static const zend_function_entry php_session_update_timestamp_iface_functions[] = { PHP_ABSTRACT_ME(SessionUpdateTimestampHandlerInterface, validateId, arginfo_session_class_validateId) PHP_ABSTRACT_ME(SessionUpdateTimestampHandlerInterface, updateTimestamp, arginfo_session_class_updateTimestamp) - { NULL, NULL, NULL } + PHP_FE_END }; /* }}} */ @@ -2628,7 +2628,7 @@ static const zend_function_entry php_session_class_functions[] = { PHP_ME(SessionHandler, destroy, arginfo_session_class_destroy, ZEND_ACC_PUBLIC) PHP_ME(SessionHandler, gc, arginfo_session_class_gc, ZEND_ACC_PUBLIC) PHP_ME(SessionHandler, create_sid, arginfo_session_class_create_sid, ZEND_ACC_PUBLIC) - { NULL, NULL, NULL } + PHP_FE_END }; /* }}} */ diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index fc4d059aa1..5c163b6d41 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -2032,7 +2032,9 @@ static zend_object_handlers sxe_object_handlers = { /* {{{ */ sxe_count_elements, sxe_get_debug_info, NULL, - sxe_get_gc + sxe_get_gc, + NULL, + NULL }; /* }}} */ @@ -2334,6 +2336,7 @@ zend_object_iterator_funcs php_sxe_iterator_funcs = { /* {{{ */ php_sxe_iterator_current_key, php_sxe_iterator_move_forward, php_sxe_iterator_rewind, + NULL }; /* }}} */ diff --git a/ext/simplexml/sxe.c b/ext/simplexml/sxe.c index 49a72a81e6..89fd554a1a 100644 --- a/ext/simplexml/sxe.c +++ b/ext/simplexml/sxe.c @@ -189,7 +189,7 @@ static const zend_function_entry funcs_SimpleXMLIterator[] = { PHP_ME(ce_SimpleXMLIterator, next, arginfo_simplexmliterator__void, ZEND_ACC_PUBLIC) PHP_ME(ce_SimpleXMLIterator, hasChildren, arginfo_simplexmliterator__void, ZEND_ACC_PUBLIC) PHP_ME(ce_SimpleXMLIterator, getChildren, arginfo_simplexmliterator__void, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} + PHP_FE_END }; /* }}} */ diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 6080444cf8..7f80b58bd5 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -141,94 +141,94 @@ static void set_ns_and_type(xmlNodePtr node, encodeTypePtr type); } encode defaultEncoding[] = { - {{UNKNOWN_TYPE, NULL, NULL, NULL}, guess_zval_convert, guess_xml_convert}, - - {{IS_NULL, "nil", XSI_NAMESPACE, NULL}, to_zval_null, to_xml_null}, - {{IS_STRING, XSD_STRING_STRING, XSD_NAMESPACE, NULL}, to_zval_string, to_xml_string}, - {{IS_LONG, XSD_INT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{IS_DOUBLE, XSD_FLOAT_STRING, XSD_NAMESPACE, NULL}, to_zval_double, to_xml_double}, - {{IS_FALSE, XSD_BOOLEAN_STRING, XSD_NAMESPACE, NULL}, to_zval_bool, to_xml_bool}, - {{IS_TRUE, XSD_BOOLEAN_STRING, XSD_NAMESPACE, NULL}, to_zval_bool, to_xml_bool}, - {{IS_CONSTANT, XSD_STRING_STRING, XSD_NAMESPACE, NULL}, to_zval_string, to_xml_string}, - {{IS_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_1_ENC_NAMESPACE, NULL}, to_zval_array, guess_array_map}, - {{IS_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_1_ENC_NAMESPACE, NULL}, to_zval_object, to_xml_object}, - {{IS_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_2_ENC_NAMESPACE, NULL}, to_zval_array, guess_array_map}, - {{IS_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_2_ENC_NAMESPACE, NULL}, to_zval_object, to_xml_object}, - - {{XSD_STRING, XSD_STRING_STRING, XSD_NAMESPACE, NULL}, to_zval_string, to_xml_string}, - {{XSD_BOOLEAN, XSD_BOOLEAN_STRING, XSD_NAMESPACE, NULL}, to_zval_bool, to_xml_bool}, - {{XSD_DECIMAL, XSD_DECIMAL_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_FLOAT, XSD_FLOAT_STRING, XSD_NAMESPACE, NULL}, to_zval_double, to_xml_double}, - {{XSD_DOUBLE, XSD_DOUBLE_STRING, XSD_NAMESPACE, NULL}, to_zval_double, to_xml_double}, - - {{XSD_DATETIME, XSD_DATETIME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_datetime}, - {{XSD_TIME, XSD_TIME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_time}, - {{XSD_DATE, XSD_DATE_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_date}, - {{XSD_GYEARMONTH, XSD_GYEARMONTH_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gyearmonth}, - {{XSD_GYEAR, XSD_GYEAR_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gyear}, - {{XSD_GMONTHDAY, XSD_GMONTHDAY_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gmonthday}, - {{XSD_GDAY, XSD_GDAY_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gday}, - {{XSD_GMONTH, XSD_GMONTH_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_gmonth}, - {{XSD_DURATION, XSD_DURATION_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_duration}, - - {{XSD_HEXBINARY, XSD_HEXBINARY_STRING, XSD_NAMESPACE, NULL}, to_zval_hexbin, to_xml_hexbin}, - {{XSD_BASE64BINARY, XSD_BASE64BINARY_STRING, XSD_NAMESPACE, NULL}, to_zval_base64, to_xml_base64}, - - {{XSD_LONG, XSD_LONG_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_INT, XSD_INT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_SHORT, XSD_SHORT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_BYTE, XSD_BYTE_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_NONPOSITIVEINTEGER, XSD_NONPOSITIVEINTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_POSITIVEINTEGER, XSD_POSITIVEINTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_NONNEGATIVEINTEGER, XSD_NONNEGATIVEINTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_NEGATIVEINTEGER, XSD_NEGATIVEINTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_UNSIGNEDBYTE, XSD_UNSIGNEDBYTE_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_UNSIGNEDSHORT, XSD_UNSIGNEDSHORT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_UNSIGNEDINT, XSD_UNSIGNEDINT_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_UNSIGNEDLONG, XSD_UNSIGNEDLONG_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_INTEGER, XSD_INTEGER_STRING, XSD_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - - {{XSD_ANYTYPE, XSD_ANYTYPE_STRING, XSD_NAMESPACE, NULL}, guess_zval_convert, guess_xml_convert}, - {{XSD_UR_TYPE, XSD_UR_TYPE_STRING, XSD_NAMESPACE, NULL}, guess_zval_convert, guess_xml_convert}, - {{XSD_ANYURI, XSD_ANYURI_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_QNAME, XSD_QNAME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_NOTATION, XSD_NOTATION_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_NORMALIZEDSTRING, XSD_NORMALIZEDSTRING_STRING, XSD_NAMESPACE, NULL}, to_zval_stringr, to_xml_string}, - {{XSD_TOKEN, XSD_TOKEN_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_LANGUAGE, XSD_LANGUAGE_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_NMTOKEN, XSD_NMTOKEN_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_NMTOKENS, XSD_NMTOKENS_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_list1}, - {{XSD_NAME, XSD_NAME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_NCNAME, XSD_NCNAME_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_ID, XSD_ID_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_IDREF, XSD_IDREF_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_IDREFS, XSD_IDREFS_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_list1}, - {{XSD_ENTITY, XSD_ENTITY_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_ENTITIES, XSD_ENTITIES_STRING, XSD_NAMESPACE, NULL}, to_zval_stringc, to_xml_list1}, - - {{APACHE_MAP, APACHE_MAP_STRING, APACHE_NAMESPACE, NULL}, to_zval_map, to_xml_map}, - - {{SOAP_ENC_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_1_ENC_NAMESPACE, NULL}, to_zval_object, to_xml_object}, - {{SOAP_ENC_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_1_ENC_NAMESPACE, NULL}, to_zval_array, to_xml_array}, - {{SOAP_ENC_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_2_ENC_NAMESPACE, NULL}, to_zval_object, to_xml_object}, - {{SOAP_ENC_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_2_ENC_NAMESPACE, NULL}, to_zval_array, to_xml_array}, + {{UNKNOWN_TYPE, NULL, NULL, NULL, NULL}, guess_zval_convert, guess_xml_convert}, + + {{IS_NULL, "nil", XSI_NAMESPACE, NULL, NULL}, to_zval_null, to_xml_null}, + {{IS_STRING, XSD_STRING_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_string, to_xml_string}, + {{IS_LONG, XSD_INT_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{IS_DOUBLE, XSD_FLOAT_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_double, to_xml_double}, + {{IS_FALSE, XSD_BOOLEAN_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_bool, to_xml_bool}, + {{IS_TRUE, XSD_BOOLEAN_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_bool, to_xml_bool}, + {{IS_CONSTANT, XSD_STRING_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_string, to_xml_string}, + {{IS_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_1_ENC_NAMESPACE, NULL, NULL}, to_zval_array, guess_array_map}, + {{IS_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_1_ENC_NAMESPACE, NULL, NULL}, to_zval_object, to_xml_object}, + {{IS_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_2_ENC_NAMESPACE, NULL, NULL}, to_zval_array, guess_array_map}, + {{IS_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_2_ENC_NAMESPACE, NULL, NULL}, to_zval_object, to_xml_object}, + + {{XSD_STRING, XSD_STRING_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_string, to_xml_string}, + {{XSD_BOOLEAN, XSD_BOOLEAN_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_bool, to_xml_bool}, + {{XSD_DECIMAL, XSD_DECIMAL_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_string}, + {{XSD_FLOAT, XSD_FLOAT_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_double, to_xml_double}, + {{XSD_DOUBLE, XSD_DOUBLE_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_double, to_xml_double}, + + {{XSD_DATETIME, XSD_DATETIME_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_datetime}, + {{XSD_TIME, XSD_TIME_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_time}, + {{XSD_DATE, XSD_DATE_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_date}, + {{XSD_GYEARMONTH, XSD_GYEARMONTH_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_gyearmonth}, + {{XSD_GYEAR, XSD_GYEAR_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_gyear}, + {{XSD_GMONTHDAY, XSD_GMONTHDAY_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_gmonthday}, + {{XSD_GDAY, XSD_GDAY_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_gday}, + {{XSD_GMONTH, XSD_GMONTH_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_gmonth}, + {{XSD_DURATION, XSD_DURATION_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_duration}, + + {{XSD_HEXBINARY, XSD_HEXBINARY_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_hexbin, to_xml_hexbin}, + {{XSD_BASE64BINARY, XSD_BASE64BINARY_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_base64, to_xml_base64}, + + {{XSD_LONG, XSD_LONG_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_INT, XSD_INT_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_SHORT, XSD_SHORT_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_BYTE, XSD_BYTE_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_NONPOSITIVEINTEGER, XSD_NONPOSITIVEINTEGER_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_POSITIVEINTEGER, XSD_POSITIVEINTEGER_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_NONNEGATIVEINTEGER, XSD_NONNEGATIVEINTEGER_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_NEGATIVEINTEGER, XSD_NEGATIVEINTEGER_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_UNSIGNEDBYTE, XSD_UNSIGNEDBYTE_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_UNSIGNEDSHORT, XSD_UNSIGNEDSHORT_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_UNSIGNEDINT, XSD_UNSIGNEDINT_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_UNSIGNEDLONG, XSD_UNSIGNEDLONG_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_INTEGER, XSD_INTEGER_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + + {{XSD_ANYTYPE, XSD_ANYTYPE_STRING, XSD_NAMESPACE, NULL, NULL}, guess_zval_convert, guess_xml_convert}, + {{XSD_UR_TYPE, XSD_UR_TYPE_STRING, XSD_NAMESPACE, NULL, NULL}, guess_zval_convert, guess_xml_convert}, + {{XSD_ANYURI, XSD_ANYURI_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_string}, + {{XSD_QNAME, XSD_QNAME_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_string}, + {{XSD_NOTATION, XSD_NOTATION_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_string}, + {{XSD_NORMALIZEDSTRING, XSD_NORMALIZEDSTRING_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringr, to_xml_string}, + {{XSD_TOKEN, XSD_TOKEN_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_string}, + {{XSD_LANGUAGE, XSD_LANGUAGE_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_string}, + {{XSD_NMTOKEN, XSD_NMTOKEN_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_string}, + {{XSD_NMTOKENS, XSD_NMTOKENS_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_list1}, + {{XSD_NAME, XSD_NAME_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_string}, + {{XSD_NCNAME, XSD_NCNAME_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_string}, + {{XSD_ID, XSD_ID_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_string}, + {{XSD_IDREF, XSD_IDREF_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_string}, + {{XSD_IDREFS, XSD_IDREFS_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_list1}, + {{XSD_ENTITY, XSD_ENTITY_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_string}, + {{XSD_ENTITIES, XSD_ENTITIES_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_list1}, + + {{APACHE_MAP, APACHE_MAP_STRING, APACHE_NAMESPACE, NULL, NULL}, to_zval_map, to_xml_map}, + + {{SOAP_ENC_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_1_ENC_NAMESPACE, NULL, NULL}, to_zval_object, to_xml_object}, + {{SOAP_ENC_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_1_ENC_NAMESPACE, NULL, NULL}, to_zval_array, to_xml_array}, + {{SOAP_ENC_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_2_ENC_NAMESPACE, NULL, NULL}, to_zval_object, to_xml_object}, + {{SOAP_ENC_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_2_ENC_NAMESPACE, NULL, NULL}, to_zval_array, to_xml_array}, /* support some of the 1999 data types */ - {{XSD_STRING, XSD_STRING_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_string, to_xml_string}, - {{XSD_BOOLEAN, XSD_BOOLEAN_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_bool, to_xml_bool}, - {{XSD_DECIMAL, XSD_DECIMAL_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_FLOAT, XSD_FLOAT_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_double, to_xml_double}, - {{XSD_DOUBLE, XSD_DOUBLE_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_double, to_xml_double}, + {{XSD_STRING, XSD_STRING_STRING, XSD_1999_NAMESPACE, NULL, NULL}, to_zval_string, to_xml_string}, + {{XSD_BOOLEAN, XSD_BOOLEAN_STRING, XSD_1999_NAMESPACE, NULL, NULL}, to_zval_bool, to_xml_bool}, + {{XSD_DECIMAL, XSD_DECIMAL_STRING, XSD_1999_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_string}, + {{XSD_FLOAT, XSD_FLOAT_STRING, XSD_1999_NAMESPACE, NULL, NULL}, to_zval_double, to_xml_double}, + {{XSD_DOUBLE, XSD_DOUBLE_STRING, XSD_1999_NAMESPACE, NULL, NULL}, to_zval_double, to_xml_double}, - {{XSD_LONG, XSD_LONG_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_INT, XSD_INT_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_SHORT, XSD_SHORT_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_BYTE, XSD_BYTE_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_long, to_xml_long}, - {{XSD_1999_TIMEINSTANT, XSD_1999_TIMEINSTANT_STRING, XSD_1999_NAMESPACE, NULL}, to_zval_stringc, to_xml_string}, + {{XSD_LONG, XSD_LONG_STRING, XSD_1999_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_INT, XSD_INT_STRING, XSD_1999_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_SHORT, XSD_SHORT_STRING, XSD_1999_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_BYTE, XSD_BYTE_STRING, XSD_1999_NAMESPACE, NULL, NULL}, to_zval_long, to_xml_long}, + {{XSD_1999_TIMEINSTANT, XSD_1999_TIMEINSTANT_STRING, XSD_1999_NAMESPACE, NULL, NULL}, to_zval_stringc, to_xml_string}, - {{XSD_ANYXML, "<anyXML>", "<anyXML>", NULL}, to_zval_any, to_xml_any}, + {{XSD_ANYXML, "<anyXML>", "<anyXML>", NULL, NULL}, to_zval_any, to_xml_any}, - {{END_KNOWN_TYPES, NULL, NULL, NULL}, guess_zval_convert, guess_xml_convert} + {{END_KNOWN_TYPES, NULL, NULL, NULL, NULL}, guess_zval_convert, guess_xml_convert} }; int numDefaultEncodings = sizeof(defaultEncoding)/sizeof(encode); @@ -784,7 +784,7 @@ static zval *to_zval_base64(zval *ret, encodeTypePtr type, xmlNodePtr data) static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data) { zend_string *str; - int i, j; + size_t i, j; unsigned char c; ZVAL_NULL(ret); @@ -945,7 +945,7 @@ static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNo xmlNodePtr ret, text; unsigned char *str; zval tmp; - int i, j; + size_t i, j; ret = xmlNewNode(NULL, BAD_CAST("BOGUS")); xmlAddChild(parent, ret); @@ -2427,7 +2427,7 @@ iterator_done: smart_str_0(&array_type); set_ns_prop(xmlParam, SOAP_1_1_ENC_NAMESPACE, "arrayType", ZSTR_VAL(array_type.s)); } else { - int i = 0; + size_t i = 0; while (i < ZSTR_LEN(array_size.s)) { if (ZSTR_VAL(array_size.s)[i] == ',') {ZSTR_VAL(array_size.s)[i] = ' ';} ++i; @@ -3478,7 +3478,7 @@ static int is_map(zval *array) { zend_ulong index; zend_string *key; - int i = 0; + zend_ulong i = 0; ZEND_HASH_FOREACH_KEY(Z_ARRVAL_P(array), index, key) { if (key || index != i) { diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 26221962d6..ee8514b11e 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -336,7 +336,7 @@ int make_http_soap_request(zval *this_ptr, zend_string *request; smart_str soap_headers = {0}; smart_str soap_headers_z = {0}; - int err; + size_t err; php_url *phpurl = NULL; php_stream *stream; zval *trace, *tmp; @@ -980,10 +980,10 @@ try_again: sempos = strstr(options, ";"); if (strstr(options,"path=") == options) { eqpos = options + sizeof("path=")-1; - add_index_stringl(&zcookie, 1, eqpos, sempos?(sempos-eqpos):strlen(eqpos)); + add_index_stringl(&zcookie, 1, eqpos, sempos?(size_t)(sempos-eqpos):strlen(eqpos)); } else if (strstr(options,"domain=") == options) { eqpos = options + sizeof("domain=")-1; - add_index_stringl(&zcookie, 2, eqpos, sempos?(sempos-eqpos):strlen(eqpos)); + add_index_stringl(&zcookie, 2, eqpos, sempos?(size_t)(sempos-eqpos):strlen(eqpos)); } else if (strstr(options,"secure") == options) { add_index_bool(&zcookie, 3, 1); } diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index b35049b0bb..3b9188a71c 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -1160,7 +1160,8 @@ zend_object_iterator_funcs spl_array_it_funcs = { spl_array_it_get_current_data, spl_array_it_get_current_key, spl_array_it_move_forward, - spl_array_it_rewind + spl_array_it_rewind, + NULL }; zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */ @@ -1376,7 +1377,7 @@ SPL_METHOD(Array, seek) zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Seek position " ZEND_LONG_FMT " is out of range", opos); } /* }}} */ -int static spl_array_object_count_elements_helper(spl_array_object *intern, zend_long *count) /* {{{ */ +static int spl_array_object_count_elements_helper(spl_array_object *intern, zend_long *count) /* {{{ */ { HashTable *aht = spl_array_get_hash_table(intern); HashPosition pos, *pos_ptr; diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 1a0a1a3540..094a4bc367 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -676,7 +676,8 @@ void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, zend_long cto { spl_filesystem_object *intern; char *path; - size_t parsed, len; + int parsed; + size_t len; zend_long flags; zend_error_handling error_handling; @@ -1608,7 +1609,8 @@ zend_object_iterator_funcs spl_filesystem_dir_it_funcs = { spl_filesystem_dir_it_current_data, spl_filesystem_dir_it_current_key, spl_filesystem_dir_it_move_forward, - spl_filesystem_dir_it_rewind + spl_filesystem_dir_it_rewind, + NULL }; /* }}} */ @@ -1806,7 +1808,8 @@ zend_object_iterator_funcs spl_filesystem_tree_it_funcs = { spl_filesystem_tree_it_current_data, spl_filesystem_tree_it_current_key, spl_filesystem_tree_it_move_forward, - spl_filesystem_tree_it_rewind + spl_filesystem_tree_it_rewind, + NULL }; /* }}} */ diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index 7662493cfe..f8408b7ce9 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -1291,7 +1291,8 @@ zend_object_iterator_funcs spl_dllist_it_funcs = { spl_dllist_it_get_current_data, spl_dllist_it_get_current_key, spl_dllist_it_move_forward, - spl_dllist_it_rewind + spl_dllist_it_rewind, + NULL }; /* }}} */ zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */ diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index e04abf77ea..1910012b8d 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -1018,7 +1018,8 @@ zend_object_iterator_funcs spl_fixedarray_it_funcs = { spl_fixedarray_it_get_current_data, spl_fixedarray_it_get_current_key, spl_fixedarray_it_move_forward, - spl_fixedarray_it_rewind + spl_fixedarray_it_rewind, + NULL }; zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */ diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index 2e014a1863..a654ce59d9 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -1069,7 +1069,8 @@ zend_object_iterator_funcs spl_heap_it_funcs = { spl_heap_it_get_current_data, spl_heap_it_get_current_key, spl_heap_it_move_forward, - spl_heap_it_rewind + spl_heap_it_rewind, + NULL }; zend_object_iterator_funcs spl_pqueue_it_funcs = { @@ -1078,7 +1079,8 @@ zend_object_iterator_funcs spl_pqueue_it_funcs = { spl_pqueue_it_get_current_data, spl_heap_it_get_current_key, spl_heap_it_move_forward, - spl_heap_it_rewind + spl_heap_it_rewind, + NULL }; zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */ @@ -1153,11 +1155,11 @@ ZEND_END_ARG_INFO() static const zend_function_entry spl_funcs_SplMinHeap[] = { SPL_ME(SplMinHeap, compare, arginfo_heap_compare, ZEND_ACC_PROTECTED) - {NULL, NULL, NULL} + PHP_FE_END }; static const zend_function_entry spl_funcs_SplMaxHeap[] = { SPL_ME(SplMaxHeap, compare, arginfo_heap_compare, ZEND_ACC_PROTECTED) - {NULL, NULL, NULL} + PHP_FE_END }; static const zend_function_entry spl_funcs_SplPriorityQueue[] = { @@ -1176,7 +1178,7 @@ static const zend_function_entry spl_funcs_SplPriorityQueue[] = { SPL_ME(SplHeap, valid, arginfo_splheap_void, ZEND_ACC_PUBLIC) SPL_ME(SplHeap, recoverFromCorruption, arginfo_splheap_void, ZEND_ACC_PUBLIC) SPL_ME(SplHeap, isCorrupted, arginfo_splheap_void, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} + PHP_FE_END }; static const zend_function_entry spl_funcs_SplHeap[] = { @@ -1193,7 +1195,7 @@ static const zend_function_entry spl_funcs_SplHeap[] = { SPL_ME(SplHeap, recoverFromCorruption, arginfo_splheap_void, ZEND_ACC_PUBLIC) SPL_ME(SplHeap, isCorrupted, arginfo_splheap_void, ZEND_ACC_PUBLIC) ZEND_FENTRY(compare, NULL, NULL, ZEND_ACC_PROTECTED|ZEND_ACC_ABSTRACT) - {NULL, NULL, NULL} + PHP_FE_END }; /* }}} */ diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 537ea0098b..3d610e9bd7 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -466,7 +466,8 @@ zend_object_iterator_funcs spl_recursive_it_iterator_funcs = { spl_recursive_it_get_current_data, spl_recursive_it_get_current_key, spl_recursive_it_move_forward, - spl_recursive_it_rewind + spl_recursive_it_rewind, + NULL }; static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_base, zend_class_entry *ce_inner, recursive_it_it_type rit_type) diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c index 2f95ecc7b9..4ad0c6d15e 100644 --- a/ext/spl/spl_observer.c +++ b/ext/spl/spl_observer.c @@ -51,7 +51,7 @@ ZEND_END_ARG_INFO(); static const zend_function_entry spl_funcs_SplObserver[] = { SPL_ABSTRACT_ME(SplObserver, update, arginfo_SplObserver_update) - {NULL, NULL, NULL} + PHP_FE_END }; ZEND_BEGIN_ARG_INFO(arginfo_SplSubject_attach, 0) @@ -69,7 +69,7 @@ static const zend_function_entry spl_funcs_SplSubject[] = { SPL_ABSTRACT_ME(SplSubject, attach, arginfo_SplSubject_attach) SPL_ABSTRACT_ME(SplSubject, detach, arginfo_SplSubject_attach) SPL_ABSTRACT_ME(SplSubject, notify, arginfo_SplSubject_void) - {NULL, NULL, NULL} + PHP_FE_END }; PHPAPI zend_class_entry *spl_ce_SplObserver; @@ -924,7 +924,7 @@ static const zend_function_entry spl_funcs_SplObjectStorage[] = { SPL_MA(SplObjectStorage, offsetSet, SplObjectStorage, attach, arginfo_attach, 0) SPL_MA(SplObjectStorage, offsetUnset, SplObjectStorage, detach, arginfo_offsetGet, 0) SPL_ME(SplObjectStorage, offsetGet, arginfo_offsetGet, 0) - {NULL, NULL, NULL} + PHP_FE_END }; typedef enum { @@ -1233,7 +1233,7 @@ static const zend_function_entry spl_funcs_MultipleIterator[] = { SPL_ME(MultipleIterator, key, arginfo_splobject_void, 0) SPL_ME(MultipleIterator, current, arginfo_splobject_void, 0) SPL_ME(MultipleIterator, next, arginfo_splobject_void, 0) - {NULL, NULL, NULL} + PHP_FE_END }; /* {{{ PHP_MINIT_FUNCTION(spl_observer) */ diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index d7f7722959..df0c87576d 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -1169,7 +1169,8 @@ static php_stream_ops php_stream_sqlite3_ops = { "SQLite3", php_sqlite3_stream_seek, php_sqlite3_stream_cast, - php_sqlite3_stream_stat + php_sqlite3_stream_stat, + NULL }; /* {{{ proto resource SQLite3::openBlob(string table, string column, int rowid [, string dbname]) diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 34ba7431f5..8e0766127d 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -110,7 +110,7 @@ static const zend_function_entry php_dir_class_functions[] = { PHP_FALIAS(close, closedir, arginfo_dir) PHP_FALIAS(rewind, rewinddir, arginfo_dir) PHP_NAMED_FE(read, php_if_readdir, arginfo_dir) - {NULL, NULL, NULL} + PHP_FE_END }; diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index be7e82555a..e53d9aa0ea 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -568,7 +568,7 @@ static const zend_function_entry xmlwriter_class_functions[] = { #endif PHP_ME_MAPPING(outputMemory, xmlwriter_output_memory, arginfo_xmlwriter_method_output_memory, 0) PHP_ME_MAPPING(flush, xmlwriter_flush, arginfo_xmlwriter_method_flush, 0) - {NULL, NULL, NULL} + PHP_FE_END }; /* }}} */ @@ -695,7 +695,8 @@ static void php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_rea xmlwriter_object *intern; xmlTextWriterPtr ptr; char *name; - size_t name_len, retval; + size_t name_len; + int retval; zval *self = getThis(); @@ -1581,7 +1582,8 @@ static PHP_FUNCTION(xmlwriter_start_dtd_entity) xmlwriter_object *intern; xmlTextWriterPtr ptr; char *name; - size_t name_len, retval; + size_t name_len; + int retval; zend_bool isparm; zval *self = getThis(); diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index 5339812253..8021792b71 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -100,7 +100,7 @@ const zend_function_entry php_xsl_xsltprocessor_class_functions[] = { PHP_FALIAS(setProfiling, xsl_xsltprocessor_set_profiling, arginfo_xsl_xsltprocessor_set_profiling) PHP_FALIAS(setSecurityPrefs, xsl_xsltprocessor_set_security_prefs, arginfo_xsl_xsltprocessor_set_security_prefs) PHP_FALIAS(getSecurityPrefs, xsl_xsltprocessor_get_security_prefs, arginfo_xsl_xsltprocessor_get_security_prefs) - {NULL, NULL, NULL} + PHP_FE_END }; /* {{{ php_xsl_xslt_string_to_xpathexpr() @@ -138,7 +138,6 @@ static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params) zval *value; char *xpath_expr; zend_string *string_key; - zend_ulong num_key; char **params = NULL; int i = 0; @@ -146,7 +145,7 @@ static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params) params = (char **)safe_emalloc((2 * zend_hash_num_elements(parht) + 1), sizeof(char *), 0); memset((char *)params, 0, parsize); - ZEND_HASH_FOREACH_KEY_VAL(parht, num_key, string_key, value) { + ZEND_HASH_FOREACH_STR_KEY_VAL(parht, string_key, value) { if (string_key == NULL) { php_error_docref(NULL, E_WARNING, "Invalid argument or parameter array"); efree(params); @@ -266,10 +265,10 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t nsparent = node->_private; curns = xmlNewNs(NULL, node->name, NULL); if (node->children) { - curns->prefix = xmlStrdup((char *)node->children); + curns->prefix = xmlStrdup((xmlChar *)node->children); } if (node->children) { - node = xmlNewDocNode(node->doc, NULL, (char *) node->children, node->name); + node = xmlNewDocNode(node->doc, NULL, (xmlChar *) node->children, node->name); } else { node = xmlNewDocNode(node->doc, NULL, (const xmlChar *) "xmlns", node->name); } diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 73f31bbcd8..9bb4b524de 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -499,7 +499,7 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v char *result; #endif glob_t globbuf; - int n; + uint n; int ret; if (pattern_len >= MAXPATHLEN) { @@ -3003,7 +3003,7 @@ static const zend_function_entry zip_class_functions[] = { ZIPARCHIVE_ME(getExternalAttributesIndex, arginfo_ziparchive_getextattrindex, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(setCompressionName, arginfo_ziparchive_setcompname, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(setCompressionIndex, arginfo_ziparchive_setcompindex, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} + PHP_FE_END }; /* }}} */ diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c index a088985198..3d5b002086 100644 --- a/ext/zip/zip_stream.c +++ b/ext/zip/zip_stream.c @@ -347,7 +347,8 @@ static php_stream_wrapper_ops zip_stream_wops = { NULL, /* unlink */ NULL, /* rename */ NULL, /* mkdir */ - NULL /* rmdir */ + NULL, /* rmdir */ + NULL }; php_stream_wrapper php_stream_zip_wrapper = { diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index af54d77181..a067e43d36 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -761,7 +761,7 @@ static zend_bool zlib_create_dictionary_string(HashTable *options, char **dict, switch (Z_TYPE_P(option_buffer)) { case IS_STRING: { zend_string *str = Z_STR_P(option_buffer); - int i; + size_t i; zend_bool last_null = 1; for (i = 0; i < ZSTR_LEN(str); i++) { @@ -794,7 +794,7 @@ static zend_bool zlib_create_dictionary_string(HashTable *options, char **dict, zend_string **end, **ptr = strings - 1; ZEND_HASH_FOREACH_VAL(dictionary, cur) { - int i; + size_t i; *++ptr = zval_get_string(cur); if (!*ptr || ZSTR_LEN(*ptr) == 0) { diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c index 4c67db6e39..a818525c70 100644 --- a/ext/zlib/zlib_fopen_wrapper.c +++ b/ext/zlib/zlib_fopen_wrapper.c @@ -172,7 +172,8 @@ static php_stream_wrapper_ops gzip_stream_wops = { NULL, /* unlink */ NULL, /* rename */ NULL, /* mkdir */ - NULL /* rmdir */ + NULL, /* rmdir */ + NULL }; php_stream_wrapper php_stream_gzip_wrapper = { |