diff options
53 files changed, 202 insertions, 114 deletions
diff --git a/Zend/zend.c b/Zend/zend.c index 9b2c7e3477..d52f3b6b9b 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -174,7 +174,7 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, } } else { char key[25]; - snprintf(key, sizeof(key), "%ld", num_key); + snprintf(key, sizeof(key), ZEND_INT_FMT, num_key); ZEND_PUTS_EX(key); } ZEND_PUTS_EX("] => "); @@ -235,7 +235,7 @@ again: char buf[sizeof("Resource id #") + MAX_LENGTH_OF_ZEND_INT]; int len; - len = snprintf(buf, sizeof(buf), "Resource id #%ld", Z_RES_HANDLE_P(expr)); + len = snprintf(buf, sizeof(buf), "Resource id #" ZEND_INT_FMT, Z_RES_HANDLE_P(expr)); ZVAL_NEW_STR(expr_copy, STR_INIT(buf, len, 0)); } break; diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 35b3c8ac7a..348737bddc 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1747,7 +1747,7 @@ ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value TSRMLS_DC) result = zend_symtable_update(ht, STR_EMPTY_ALLOC(), value); break; case IS_RESOURCE: - zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_RES_HANDLE_P(key), Z_RES_HANDLE_P(key)); + zend_error(E_STRICT, "Resource ID#" ZEND_INT_FMT " used as offset, casting to integer (%pd)", Z_RES_HANDLE_P(key), Z_RES_HANDLE_P(key)); result = zend_hash_index_update(ht, Z_RES_HANDLE_P(key), value); break; case IS_FALSE: diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 6d5aa720fa..766cf7e210 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -461,7 +461,7 @@ static void _build_trace_args(zval *arg, zend_string **str_ptr TSRMLS_DC) /* {{{ case IS_RESOURCE: { zend_int_t lval = Z_RES_HANDLE_P(arg); char s_tmp[MAX_LENGTH_OF_ZEND_INT + 1]; - int l_tmp = zend_sprintf(s_tmp, "%ld", lval); /* SAFE */ + int l_tmp = zend_sprintf(s_tmp, ZEND_INT_FMT, lval); /* SAFE */ TRACE_APPEND_STR("Resource id #"); TRACE_APPEND_STRL(s_tmp, l_tmp); TRACE_APPEND_STR(", "); @@ -470,7 +470,7 @@ static void _build_trace_args(zval *arg, zend_string **str_ptr TSRMLS_DC) /* {{{ case IS_INT: { zend_int_t lval = Z_IVAL_P(arg); char s_tmp[MAX_LENGTH_OF_ZEND_INT + 1]; - int l_tmp = zend_sprintf(s_tmp, "%ld", lval); /* SAFE */ + int l_tmp = zend_sprintf(s_tmp, ZEND_INT_FMT, lval); /* SAFE */ TRACE_APPEND_STRL(s_tmp, l_tmp); TRACE_APPEND_STR(", "); break; @@ -519,7 +519,7 @@ static void _build_trace_string(zval *frame, zend_uint_t index, zend_string **st zend_string *str = *str_ptr; if (Z_TYPE_P(frame) != IS_ARRAY) { - zend_error(E_WARNING, "Expected array for frame %lu", index); + zend_error(E_WARNING, "Expected array for frame %pu", index); return; } diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 54397153c1..7371a6ac7c 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1095,7 +1095,7 @@ str_index: hval = zend_dval_to_ival(Z_DVAL_P(dim)); goto num_index; case IS_RESOURCE: - zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_RES_HANDLE_P(dim), Z_RES_HANDLE_P(dim)); + zend_error(E_STRICT, "Resource ID#%pd used as offset, casting to integer (%pd)", Z_RES_HANDLE_P(dim), Z_RES_HANDLE_P(dim)); hval = Z_RES_HANDLE_P(dim); goto num_index; case IS_FALSE: diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 6a81999495..423a9e614d 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -599,7 +599,7 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */ break; case IS_RESOURCE: { char buf[sizeof("Resource id #") + MAX_LENGTH_OF_ZEND_INT]; - int len = snprintf(buf, sizeof(buf), "Resource id #%ld", Z_RES_HANDLE_P(op)); + int len = snprintf(buf, sizeof(buf), "Resource id #" ZEND_INT_FMT, Z_RES_HANDLE_P(op)); ZVAL_NEW_STR(op, STR_INIT(buf, len, 0)); break; } @@ -879,7 +879,7 @@ try_again: char buf[sizeof("Resource id #") + MAX_LENGTH_OF_ZEND_INT]; int len; - len = snprintf(buf, sizeof(buf), "Resource id #%ld", Z_RES_HANDLE_P(op)); + len = snprintf(buf, sizeof(buf), "Resource id #" ZEND_INT_FMT, Z_RES_HANDLE_P(op)); return STR_INIT(buf, len, 0); } case IS_INT: { diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c index f32226bc84..75c1bd418b 100644 --- a/ext/bz2/bz2_filter.c +++ b/ext/bz2/bz2_filter.c @@ -382,7 +382,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi ZVAL_DUP(&tmp, tmpzval); convert_to_int(&tmp); if (Z_IVAL(tmp) < 1 || Z_IVAL(tmp) > 9) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%ld)", Z_IVAL_P(tmpzval)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%pd)", Z_IVAL_P(tmpzval)); } else { blockSize100k = Z_IVAL(tmp); } @@ -396,7 +396,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi convert_to_int(&tmp); if (Z_IVAL(tmp) < 0 || Z_IVAL(tmp) > 250) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%ld)", Z_IVAL(tmp)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%pd)", Z_IVAL(tmp)); } else { workFactor = Z_IVAL(tmp); } diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c index 35652a9ce6..56277b0dd9 100644 --- a/ext/calendar/calendar.c +++ b/ext/calendar/calendar.c @@ -311,7 +311,7 @@ PHP_FUNCTION(cal_info) if (cal != -1 && (cal < 0 || cal >= CAL_NUM_CALS)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %ld.", cal); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %pd.", cal); RETURN_FALSE; } diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 813f8663f0..2a32f8b592 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1436,7 +1436,7 @@ PHP_FUNCTION(strtotime) now = timelib_time_ctor(); initial_ts = emalloc(25); - snprintf(initial_ts, 24, "@%ld UTC", preset_ts); + snprintf(initial_ts, 24, "@" ZEND_INT_FMT " UTC", preset_ts); t = timelib_strtotime(initial_ts, strlen(initial_ts), NULL, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper); /* we ignore the error here, as this should never fail */ timelib_update_ts(t, tzi); now->tz_info = tzi; diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index e2030c621d..4c8e5bfe7e 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -176,7 +176,7 @@ zend_function_entry finfo_class_functions[] = { #define FINFO_SET_OPTION(magic, options) \ if (magic_setflags(magic, options) == -1) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to set option '%ld' %d:%s", \ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to set option '%pd' %d:%s", \ options, magic_errno(magic), magic_error(magic)); \ RETURN_FALSE; \ } @@ -339,7 +339,7 @@ PHP_FUNCTION(finfo_open) if (finfo->magic == NULL) { efree(finfo); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid mode '%ld'.", options); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid mode '%pd'.", options); FILEINFO_DESTROY_OBJECT(object); RETURN_FALSE; } diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index 330f6f09e0..5b0fea6db9 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -624,7 +624,7 @@ ftp_alloc(ftpbuf_t *ftp, const php_int_t size, zend_string **response) return 0; } - snprintf(buffer, sizeof(buffer) - 1, "%ld", size); + snprintf(buffer, sizeof(buffer) - 1, ZEND_INT_FMT, size); if (!ftp_putcmd(ftp, "ALLO", buffer)) { return 0; @@ -811,7 +811,7 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, ftp->data = data; if (resumepos > 0) { - snprintf(arg, sizeof(arg), "%ld", resumepos); + snprintf(arg, sizeof(arg), ZEND_INT_FMT, resumepos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } @@ -903,7 +903,7 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, p ftp->data = data; if (startpos > 0) { - snprintf(arg, sizeof(arg), "%ld", startpos); + snprintf(arg, sizeof(arg), ZEND_INT_FMT, startpos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } @@ -1729,7 +1729,7 @@ ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t typ } if (resumepos>0) { - snprintf(arg, sizeof(arg), "%ld", resumepos); + snprintf(arg, sizeof(arg), ZEND_INT_FMT, resumepos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } @@ -1843,7 +1843,7 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type goto bail; } if (startpos > 0) { - snprintf(arg, sizeof(arg), "%ld", startpos); + snprintf(arg, sizeof(arg), ZEND_INT_FMT, startpos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index cb4cd37a00..41b8e12861 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -1401,7 +1401,7 @@ PHP_FUNCTION(ftp_set_option) RETURN_TRUE; break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%ld'", option); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%pd'", option); RETURN_FALSE; break; } @@ -1430,7 +1430,7 @@ PHP_FUNCTION(ftp_get_option) RETURN_BOOL(ftp->autoseek); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%ld'", option); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%pd'", option); RETURN_FALSE; break; } diff --git a/ext/gd/gd.c b/ext/gd/gd.c index b6fff4a12f..11941a43b9 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -2848,14 +2848,14 @@ PHP_FUNCTION(imagecolorat) if (im->tpixels && gdImageBoundsSafe(im, x, y)) { RETURN_INT(gdImageTrueColorPixel(im, x, y)); } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%ld,%ld is out of bounds", x, y); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%pd,%pd is out of bounds", x, y); RETURN_FALSE; } } else { if (im->pixels && gdImageBoundsSafe(im, x, y)) { RETURN_INT(im->pixels[y][x]); } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%ld,%ld is out of bounds", x, y); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%pd,%pd is out of bounds", x, y); RETURN_FALSE; } } @@ -4135,12 +4135,12 @@ PHP_FUNCTION(imagepstext) /* Ensure that the provided colors are valid */ if (_fg < 0 || (!gdImageTrueColor(bg_img) && _fg > gdImageColorsTotal(bg_img))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Foreground color index %ld out of range", _fg); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Foreground color index %pd out of range", _fg); RETURN_FALSE; } if (_bg < 0 || (!gdImageTrueColor(bg_img) && _fg > gdImageColorsTotal(bg_img))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Background color index %ld out of range", _bg); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Background color index %pd out of range", _bg); RETURN_FALSE; } @@ -4174,7 +4174,7 @@ PHP_FUNCTION(imagepstext) T1_AASetLevel(T1_AA_HIGH); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value %ld as number of steps for antialiasing", aa_steps); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value %pd as number of steps for antialiasing", aa_steps); RETURN_FALSE; } diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 8a89451178..a8f49ad0ad 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -1005,7 +1005,7 @@ ZEND_FUNCTION(gmp_init) } if (base && (base < 2 || base > MAX_BASE)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %ld (should be between 2 and %d)", base, MAX_BASE); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d)", base, MAX_BASE); RETURN_FALSE; } @@ -1052,10 +1052,10 @@ ZEND_FUNCTION(gmp_strval) /* Although the maximum base in general in GMP >= 4.2 is 62, mpz_get_str() * is explicitly limited to -36 when dealing with negative bases. */ if ((base < 2 && base > -2) || base > MAX_BASE || base < -36) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %ld (should be between 2 and %d or -2 and -36)", base, MAX_BASE); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d or -2 and -36)", base, MAX_BASE); #else if (base < 2 || base > MAX_BASE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %ld (should be between 2 and %d)", base, MAX_BASE); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d)", base, MAX_BASE); #endif RETURN_FALSE; } diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index 95f49d94cb..868e3bc90d 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -154,7 +154,7 @@ static PHP_METHOD(UConverter, fromUCallback) { /* {{{ php_converter_check_limits */ static inline zend_bool php_converter_check_limits(php_converter_object *objval, php_int_t available, php_int_t needed TSRMLS_DC) { if (available < needed) { - php_converter_throw_failure(objval, U_BUFFER_OVERFLOW_ERROR TSRMLS_CC, "Buffer overrun %ld bytes needed, %ld available", needed, available); + php_converter_throw_failure(objval, U_BUFFER_OVERFLOW_ERROR TSRMLS_CC, "Buffer overrun %pd bytes needed, %pd available", needed, available); return 0; } return 1; @@ -748,7 +748,7 @@ static PHP_METHOD(UConverter, reasonText) { UCNV_REASON_CASE(CLOSE) UCNV_REASON_CASE(CLONE) default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown UConverterCallbackReason: %ld", reason); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown UConverterCallbackReason: %pd", reason); RETURN_FALSE; } } diff --git a/ext/intl/dateformat/dateformat_format.c b/ext/intl/dateformat/dateformat_format.c index 9ec012c570..38ec4101aa 100644 --- a/ext/intl/dateformat/dateformat_format.c +++ b/ext/intl/dateformat/dateformat_format.c @@ -79,7 +79,7 @@ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo, } else { if (Z_IVAL_P(ele_value) > INT32_MAX || Z_IVAL_P(ele_value) < INT32_MIN) { - spprintf(&message, 0, "datefmt_format: value %ld is out of " + spprintf(&message, 0, "datefmt_format: value %pd is out of " "bounds for a 32-bit integer in key '%s'", Z_IVAL_P(ele_value), key_name); intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC); diff --git a/ext/intl/formatter/formatter_format.c b/ext/intl/formatter/formatter_format.c index 3fe5d6abf1..8a8f251dcc 100644 --- a/ext/intl/formatter/formatter_format.c +++ b/ext/intl/formatter/formatter_format.c @@ -120,7 +120,7 @@ PHP_FUNCTION( numfmt_format ) break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported format type %ld", type); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported format type %pd", type); RETURN_FALSE; break; } diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c index 3d0c84dab6..b7cf36945b 100644 --- a/ext/intl/formatter/formatter_parse.c +++ b/ext/intl/formatter/formatter_parse.c @@ -97,7 +97,7 @@ PHP_FUNCTION( numfmt_parse ) RETVAL_DOUBLE(val_double); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported format type %ld", type); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported format type %pd", type); RETVAL_FALSE; break; } diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 9bfbaaa1ae..98600897ac 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -241,9 +241,9 @@ PHP_MINFO_FUNCTION(ldap) php_info_print_table_row(2, "RCS Version", "$Id$"); if (LDAPG(max_links) == -1) { - snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links)); + snprintf(tmp, 31, ZEND_INT_FMT "/unlimited", LDAPG(num_links)); } else { - snprintf(tmp, 31, "%ld/%ld", LDAPG(num_links), LDAPG(max_links)); + snprintf(tmp, 31, ZEND_INT_FMT "/" ZEND_INT_FMT, LDAPG(num_links), LDAPG(max_links)); } php_info_print_table_row(2, "Total Links", tmp); @@ -324,7 +324,7 @@ PHP_FUNCTION(ldap_connect) #endif if (LDAPG(max_links) != -1 && LDAPG(num_links) >= LDAPG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", LDAPG(num_links)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%pd)", LDAPG(num_links)); RETURN_FALSE; } diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c index 63670d5177..bb0ff70ca1 100644 --- a/ext/mbstring/mb_gpc.c +++ b/ext/mbstring/mb_gpc.c @@ -254,7 +254,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i } if (n > (PG(max_input_vars) * 2)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %pd. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars)); goto out; } diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index b0596c396a..1df53349a8 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -662,7 +662,7 @@ PHP_RSHUTDOWN_FUNCTION(mysql) if (MySG(trace_mode)) { if (MySG(result_allocated)){ - php_error_docref("function.mysql-free-result" TSRMLS_CC, E_WARNING, "%lu result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query()", MySG(result_allocated)); + php_error_docref("function.mysql-free-result" TSRMLS_CC, E_WARNING, "%pu result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query()", MySG(result_allocated)); } } @@ -686,9 +686,9 @@ PHP_MINFO_FUNCTION(mysql) php_info_print_table_start(); php_info_print_table_header(2, "MySQL Support", "enabled"); - snprintf(buf, sizeof(buf), "%ld", MySG(num_persistent)); + snprintf(buf, sizeof(buf), ZEND_INT_FMT, MySG(num_persistent)); php_info_print_table_row(2, "Active Persistent Links", buf); - snprintf(buf, sizeof(buf), "%ld", MySG(num_links)); + snprintf(buf, sizeof(buf), ZEND_INT_FMT, MySG(num_links)); php_info_print_table_row(2, "Active Links", buf); php_info_print_table_row(2, "Client API version", mysql_get_client_info()); #if !defined (PHP_WIN32) && !defined (NETWARE) && !defined(MYSQL_USE_MYSQLND) @@ -821,7 +821,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) #endif hashed_details = STR_ALLOC(sizeof("mysql____") + (host_and_port? strlen(host_and_port) : 0) + (user? strlen(user) : 0) + (passwd? strlen(passwd) : 0) + MAX_LENGTH_OF_ZEND_INT - 1, 0); - hashed_details->len = snprintf(hashed_details->val, hashed_details->len + 1, "mysql_%s_%s_%s_%ld", SAFE_STRING(host_and_port), SAFE_STRING(user), SAFE_STRING(passwd), client_flags); + hashed_details->len = snprintf(hashed_details->val, hashed_details->len + 1, "mysql_%s_%s_%s_" ZEND_INT_FMT, SAFE_STRING(host_and_port), SAFE_STRING(user), SAFE_STRING(passwd), client_flags); } /* We cannot use mysql_port anymore in windows, need to use @@ -862,13 +862,13 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) zval new_le; if (MySG(max_links) != -1 && MySG(num_links) >= MySG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MySG(num_links)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%pd)", MySG(num_links)); STR_RELEASE(hashed_details); MYSQL_DO_CONNECT_RETURN_FALSE(); } if (MySG(max_persistent) != -1 && MySG(num_persistent) >= MySG(max_persistent)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%ld)", MySG(num_persistent)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%pd)", MySG(num_persistent)); STR_RELEASE(hashed_details); MYSQL_DO_CONNECT_RETURN_FALSE(); } @@ -997,7 +997,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) } if (MySG(max_links) != -1 && MySG(num_links) >= MySG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MySG(num_links)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%pd)", MySG(num_links)); STR_RELEASE(hashed_details); MYSQL_DO_CONNECT_RETURN_FALSE(); } @@ -1947,7 +1947,7 @@ Q: String or long first? ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); if (row < 0 || row >= (int)mysql_num_rows(mysql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %ld on MySQL result index %ld", row, Z_RES_P(result)->handle); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %pd on MySQL result index %pd", row, Z_RES_P(result)->handle); RETURN_FALSE; } mysql_data_seek(mysql_result, row); @@ -1977,7 +1977,7 @@ Q: String or long first? i++; } if (!tmp_field) { /* no match found */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s%s%s not found in MySQL result index %ld", + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s%s%s not found in MySQL result index %pd", (table_name?table_name:""), (table_name?".":""), field_name, Z_RES_P(result)->handle); efree(field_name); if (table_name) { @@ -2281,7 +2281,7 @@ PHP_FUNCTION(mysql_data_seek) ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); if (offset < 0 || offset >= (int)mysql_num_rows(mysql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset %ld is invalid for MySQL result index %ld (or the query data is unbuffered)", offset, Z_RES_P(result)->handle); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset %pd is invalid for MySQL result index %pd (or the query data is unbuffered)", offset, Z_RES_P(result)->handle); RETURN_FALSE; } mysql_data_seek(mysql_result, offset); @@ -2454,7 +2454,7 @@ PHP_FUNCTION(mysql_field_seek) ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); if (offset < 0 || offset >= (int)mysql_num_fields(mysql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %ld is invalid for MySQL result index %ld", offset, Z_RES_P(result)->handle); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %pd is invalid for MySQL result index %pd", offset, Z_RES_P(result)->handle); RETURN_FALSE; } mysql_field_seek(mysql_result, offset); @@ -2486,7 +2486,7 @@ static void php_mysql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); if (field < 0 || field >= (int)mysql_num_fields(mysql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %ld is invalid for MySQL result index %ld", field, Z_RES_P(result)->handle); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %pd is invalid for MySQL result index %pd", field, Z_RES_P(result)->handle); RETURN_FALSE; } mysql_field_seek(mysql_result, field); diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 79d340b2a6..b270cf2748 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -976,11 +976,11 @@ PHP_MINFO_FUNCTION(mysqli) php_info_print_table_start(); php_info_print_table_header(2, "MysqlI Support", "enabled"); php_info_print_table_row(2, "Client API library version", mysql_get_client_info()); - snprintf(buf, sizeof(buf), "%ld", MyG(num_active_persistent)); + snprintf(buf, sizeof(buf), ZEND_INT_FMT, MyG(num_active_persistent)); php_info_print_table_row(2, "Active Persistent Links", buf); - snprintf(buf, sizeof(buf), "%ld", MyG(num_inactive_persistent)); + snprintf(buf, sizeof(buf), ZEND_INT_FMT, MyG(num_inactive_persistent)); php_info_print_table_row(2, "Inactive Persistent Links", buf); - snprintf(buf, sizeof(buf), "%ld", MyG(num_links)); + snprintf(buf, sizeof(buf), ZEND_INT_FMT, MyG(num_links)); php_info_print_table_row(2, "Active Links", buf); #if !defined(MYSQLI_USE_MYSQLND) php_info_print_table_row(2, "Client API header version", MYSQL_SERVER_VERSION); diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 82cb1baf26..6b010f0b16 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -200,7 +200,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne } } if (MyG(max_links) != -1 && MyG(num_links) >= MyG(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MyG(num_links)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%pd)", MyG(num_links)); goto err; } @@ -1086,7 +1086,7 @@ PHP_FUNCTION(mysqli_begin_transaction) } MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID); if (flags < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for parameter flags (%ld)", flags); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for parameter flags (%pd)", flags); err = TRUE; } if (!name_len) { diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c index 95747a7e3a..76bf1e256f 100644 --- a/ext/mysqlnd/php_mysqlnd.c +++ b/ext/mysqlnd/php_mysqlnd.c @@ -138,11 +138,11 @@ PHP_MINFO_FUNCTION(mysqlnd) #else "not supported"); #endif - snprintf(buf, sizeof(buf), "%pd", MYSQLND_G(net_cmd_buffer_size)); + snprintf(buf, sizeof(buf), ZEND_INT_FMT, MYSQLND_G(net_cmd_buffer_size)); php_info_print_table_row(2, "Command buffer size", buf); - snprintf(buf, sizeof(buf), "%pd", MYSQLND_G(net_read_buffer_size)); + snprintf(buf, sizeof(buf), ZEND_INT_FMT, MYSQLND_G(net_read_buffer_size)); php_info_print_table_row(2, "Read buffer size", buf); - snprintf(buf, sizeof(buf), "%pd", MYSQLND_G(net_read_timeout)); + snprintf(buf, sizeof(buf), ZEND_INT_FMT, MYSQLND_G(net_read_timeout)); php_info_print_table_row(2, "Read timeout", buf); php_info_print_table_row(2, "Collecting statistics", MYSQLND_G(collect_statistics)? "Yes":"No"); php_info_print_table_row(2, "Collecting memory statistics", MYSQLND_G(collect_memory_statistics)? "Yes":"No"); diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index d0c7138ab2..9747be9e0c 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -841,9 +841,9 @@ PHP_MINFO_FUNCTION(odbc) php_info_print_table_start(); php_info_print_table_header(2, "ODBC Support", "enabled"); - snprintf(buf, sizeof(buf), "%pd", ODBCG(num_persistent)); + snprintf(buf, sizeof(buf), ZEND_INT_FMT, ODBCG(num_persistent)); php_info_print_table_row(2, "Active Persistent Links", buf); - snprintf(buf, sizeof(buf), "%pd", ODBCG(num_links)); + snprintf(buf, sizeof(buf), ZEND_INT_FMT, ODBCG(num_links)); php_info_print_table_row(2, "Active Links", buf); php_info_print_table_row(2, "ODBC library", PHP_ODBC_TYPE); #ifndef PHP_WIN32 diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index c6720419fa..db6f985b77 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -407,11 +407,11 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS) char buf[32]; php_info_print_table_row(2, "Startup", "OK"); php_info_print_table_row(2, "Shared memory model", zend_accel_get_shared_model()); - snprintf(buf, sizeof(buf), ZEND_UINT_FMT, (zend_uint_t)ZCSG(hits)); + snprintf(buf, sizeof(buf), "%pd", (zend_uint_t)ZCSG(hits)); php_info_print_table_row(2, "Cache hits", buf); snprintf(buf, sizeof(buf), "%pd", ZSMMG(memory_exhausted)?ZCSG(misses):ZCSG(misses)-ZCSG(blacklist_misses)); php_info_print_table_row(2, "Cache misses", buf); - snprintf(buf, sizeof(buf), "%ld", ZCG(accel_directives).memory_consumption-zend_shared_alloc_get_free_memory()-ZSMMG(wasted_shared_memory)); + snprintf(buf, sizeof(buf), ZEND_INT_FMT, ZCG(accel_directives).memory_consumption-zend_shared_alloc_get_free_memory()-ZSMMG(wasted_shared_memory)); php_info_print_table_row(2, "Used memory", buf); snprintf(buf, sizeof(buf), "%pd", zend_shared_alloc_get_free_memory()); php_info_print_table_row(2, "Free memory", buf); diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 8402491f3c..8c85a38575 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2125,7 +2125,7 @@ static PHP_METHOD(PDOStatement, debugDumpParams) if (key) { php_stream_printf(out TSRMLS_CC, "Key: Name: [%d] %.*s\n", key->len, key->len, key->val); } else { - php_stream_printf(out TSRMLS_CC, "Key: Position #%ld:\n", num); + php_stream_printf(out TSRMLS_CC, "Key: Position #%pd:\n", num); } php_stream_printf(out TSRMLS_CC, "paramno=%ld\nname=[%d] \"%.*s\"\nis_param=%d\nparam_type=%d\n", diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 809ee34f7c..b79a098569 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -1204,13 +1204,13 @@ static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ /* support both full connection string & connection string + login and/or password */ if (dbh->username && dbh->password) { - spprintf(&conn_str, 0, "%s user=%s password=%s connect_timeout=%ld", dbh->data_source, dbh->username, tmp_pass, connect_timeout); + spprintf(&conn_str, 0, "%s user=%s password=%s connect_timeout=%pd", dbh->data_source, dbh->username, tmp_pass, connect_timeout); } else if (dbh->username) { - spprintf(&conn_str, 0, "%s user=%s connect_timeout=%ld", dbh->data_source, dbh->username, connect_timeout); + spprintf(&conn_str, 0, "%s user=%s connect_timeout=%pd", dbh->data_source, dbh->username, connect_timeout); } else if (dbh->password) { - spprintf(&conn_str, 0, "%s password=%s connect_timeout=%ld", dbh->data_source, tmp_pass, connect_timeout); + spprintf(&conn_str, 0, "%s password=%s connect_timeout=%pd", dbh->data_source, tmp_pass, connect_timeout); } else { - spprintf(&conn_str, 0, "%s connect_timeout=%ld", (char *) dbh->data_source, connect_timeout); + spprintf(&conn_str, 0, "%s connect_timeout=%pd", (char *) dbh->data_source, connect_timeout); } H->server = PQconnectdb(conn_str); diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index d1fc89d69e..5be85aea1c 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1254,9 +1254,9 @@ PHP_MINFO_FUNCTION(pgsql) php_info_print_table_row(2, "SSL support", "disabled"); #endif #endif /* HAVE_PG_CONFIG_H */ - snprintf(buf, sizeof(buf), "%pd", PGG(num_persistent)); + snprintf(buf, sizeof(buf), ZEND_INT_FMT, PGG(num_persistent)); php_info_print_table_row(2, "Active Persistent Links", buf); - snprintf(buf, sizeof(buf), "%pd", PGG(num_links)); + snprintf(buf, sizeof(buf), ZEND_INT_FMT, PGG(num_links)); php_info_print_table_row(2, "Active Links", buf); php_info_print_table_end(); @@ -3482,11 +3482,11 @@ PHP_FUNCTION(pg_lo_write) if (argc > 2) { if (z_len > str_len) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write more than buffer size %d. Tried to write %ld", str_len, z_len); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write more than buffer size %d. Tried to write %pd", str_len, z_len); RETURN_FALSE; } if (z_len < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Buffer size must be larger than 0, but %ld was specified", z_len); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Buffer size must be larger than 0, but %pd was specified", z_len); RETURN_FALSE; } len = z_len; @@ -5708,7 +5708,7 @@ static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC) /* {{{ php_pgsql_convert * check and convert array values (fieldname=>vlaue pair) for sql */ -PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, ulong opt TSRMLS_DC) +PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, php_uint_t opt TSRMLS_DC) { zend_string *field = NULL; php_uint_t num_idx = -1; @@ -6382,7 +6382,7 @@ PHP_FUNCTION(pg_convert) } /* }}} */ -static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, ulong opt TSRMLS_DC) /* {{{ */ +static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, php_uint_t opt TSRMLS_DC) /* {{{ */ { if (opt & PGSQL_DML_ASYNC) { if (PQsendQuery(pg_link, querystr->s->val)) { @@ -6641,7 +6641,7 @@ PHP_FUNCTION(pg_insert) } /* }}} */ -static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr, HashTable *ht, int where_cond, const char *pad, int pad_len, ulong opt TSRMLS_DC) /* {{{ */ +static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr, HashTable *ht, int where_cond, const char *pad, int pad_len, php_uint_t opt TSRMLS_DC) /* {{{ */ { char *tmp; char buf[256]; diff --git a/ext/session/php_session.h b/ext/session/php_session.h index 0e2eca9188..e553ca0e1a 100644 --- a/ext/session/php_session.h +++ b/ext/session/php_session.h @@ -262,7 +262,7 @@ PHPAPI void php_session_reset_id(TSRMLS_D); ZEND_HASH_FOREACH_KEY(_ht, num_key, key) { \ if (key == NULL) { \ php_error_docref(NULL TSRMLS_CC, E_NOTICE, \ - "Skipping numeric key %ld", num_key); \ + "Skipping numeric key %pd", num_key); \ continue; \ } \ if ((struc = php_get_session_var(key TSRMLS_CC))) { \ diff --git a/ext/session/session.c b/ext/session/session.c index 8632ba493c..d6ffe8b63b 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -305,7 +305,7 @@ PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */ } /* maximum 15+19+19+10 bytes */ - spprintf(&buf, 0, "%.15s%ld%ld%0.8F", remote_addr ? remote_addr : "", tv.tv_sec, (php_int_t)tv.tv_usec, php_combined_lcg(TSRMLS_C) * 10); + spprintf(&buf, 0, "%.15s%ld" ZEND_INT_FMT "%0.8F", remote_addr ? remote_addr : "", tv.tv_sec, (php_int_t)tv.tv_usec, php_combined_lcg(TSRMLS_C) * 10); switch (PS(hash_func)) { case PS_HASH_FUNC_MD5: @@ -1178,7 +1178,7 @@ CACHE_LIMITER_FUNC(public) /* {{{ */ strcpy_gmt(buf + sizeof(EXPIRES) - 1, &now); ADD_HEADER(buf); - snprintf(buf, sizeof(buf) , "Cache-Control: public, max-age=%ld", PS(cache_expire) * 60); /* SAFE */ + snprintf(buf, sizeof(buf) , "Cache-Control: public, max-age=" ZEND_INT_FMT, PS(cache_expire) * 60); /* SAFE */ ADD_HEADER(buf); last_modified(TSRMLS_C); @@ -1189,7 +1189,7 @@ CACHE_LIMITER_FUNC(private_no_expire) /* {{{ */ { char buf[MAX_STR + 1]; - snprintf(buf, sizeof(buf), "Cache-Control: private, max-age=%ld, pre-check=%ld", PS(cache_expire) * 60, PS(cache_expire) * 60); /* SAFE */ + snprintf(buf, sizeof(buf), "Cache-Control: private, max-age=" ZEND_INT_FMT ", pre-check=" ZEND_INT_FMT, PS(cache_expire) * 60, PS(cache_expire) * 60); /* SAFE */ ADD_HEADER(buf); last_modified(TSRMLS_C); diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 97b619d359..149d9989a4 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2901,7 +2901,7 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma ta = php_localtime_r(×tamp, &tmbuf); /*ta = php_gmtime_r(×tamp, &tmbuf);*/ if (!ta) { - soap_error1(E_ERROR, "Encoding: Invalid timestamp %ld", Z_IVAL_P(data)); + soap_error1(E_ERROR, "Encoding: Invalid timestamp %pd", Z_IVAL_P(data)); } buf = (char *) emalloc(buf_len); diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 0935ce36ad..21c62fa356 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -631,7 +631,7 @@ try_again: unsigned char hash[16]; PHP_MD5Init(&md5ctx); - snprintf(cnonce, sizeof(cnonce), "%ld", php_rand(TSRMLS_C)); + snprintf(cnonce, sizeof(cnonce), ZEND_INT_FMT, php_rand(TSRMLS_C)); PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, strlen(cnonce)); PHP_MD5Final(hash, &md5ctx); make_digest(cnonce, hash); diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 5af02c3ad4..f0bb2f1019 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -956,7 +956,7 @@ PHP_METHOD(SoapFault, __toString) zval_ptr_dtor(&fci.function_name); - str = strpprintf(0, "SoapFault exception: [%s] %s in %s:%ld\nStack trace:\n%s", + str = strpprintf(0, "SoapFault exception: [%s] %s in %s:%pd\nStack trace:\n%s", Z_STRVAL_P(faultcode), Z_STRVAL_P(faultstring), Z_STRVAL_P(file), Z_IVAL_P(line), Z_STRSIZE(trace) ? Z_STRVAL(trace) : "#0 {main}\n"); diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c index 7f616232b8..35cc544e1a 100644 --- a/ext/sockets/conversions.c +++ b/ext/sockets/conversions.c @@ -1260,7 +1260,7 @@ static void from_zval_write_ifindex(const zval *zv, char *uinteger, ser_context if (Z_TYPE_P(zv) == IS_INT) { if (Z_IVAL_P(zv) < 0 || Z_IVAL_P(zv) > UINT_MAX) { /* allow 0 (unspecified interface) */ do_from_zval_err(ctx, "the interface index cannot be negative or " - "larger than %u; given %ld", UINT_MAX, Z_IVAL_P(zv)); + "larger than %u; given %pd", UINT_MAX, Z_IVAL_P(zv)); } else { ret = (unsigned)Z_IVAL_P(zv); } diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c index 0fc3dbb2cf..9188825e53 100644 --- a/ext/sockets/multicast.c +++ b/ext/sockets/multicast.c @@ -93,7 +93,7 @@ static int php_get_if_index_from_zval(zval *val, unsigned *out TSRMLS_DC) if (Z_IVAL_P(val) < 0 || Z_IVAL_P(val) > UINT_MAX) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "the interface index cannot be negative or larger than %u;" - " given %ld", UINT_MAX, Z_IVAL_P(val)); + " given %pd", UINT_MAX, Z_IVAL_P(val)); ret = FAILURE; } else { *out = Z_IVAL_P(val); diff --git a/ext/sockets/sendrecvmsg.c b/ext/sockets/sendrecvmsg.c index 07740cdfe5..dc45cb7842 100644 --- a/ext/sockets/sendrecvmsg.c +++ b/ext/sockets/sendrecvmsg.c @@ -71,7 +71,7 @@ inline ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags) #define LONG_CHECK_VALID_INT(l) \ do { \ if ((l) < INT_MIN && (l) > INT_MAX) { \ - php_error_docref0(NULL TSRMLS_CC, E_WARNING, "The value %ld does not fit inside " \ + php_error_docref0(NULL TSRMLS_CC, E_WARNING, "The value %pd does not fit inside " \ "the boundaries of a native integer", (l)); \ return; \ } \ diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index de8cff4ab0..c4b31ecd00 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -2335,7 +2335,7 @@ SPL_METHOD(SplTempFileObject, __construct) intern->file_name = "php://memory"; intern->file_name_len = 12; } else if (ZEND_NUM_ARGS()) { - intern->file_name_len = slprintf(tmp_fname, sizeof(tmp_fname), "php://temp/maxmemory:%ld", max_memory); + intern->file_name_len = slprintf(tmp_fname, sizeof(tmp_fname), "php://temp/maxmemory:%pd", max_memory); intern->file_name = tmp_fname; } else { intern->file_name = "php://temp"; diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c index 18a2b9699e..26f6f5a651 100644 --- a/ext/spl/spl_observer.c +++ b/ext/spl/spl_observer.c @@ -906,7 +906,7 @@ SPL_METHOD(SplObjectStorage, unserialize) outexcept: PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Error at offset %ld of %d bytes", (php_int_t)((char*)p - buf), buf_len); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Error at offset %pd of %d bytes", (php_int_t)((char*)p - buf), buf_len); return; } /* }}} */ diff --git a/ext/standard/assert.c b/ext/standard/assert.c index 8f21a7735c..31421fc9d4 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -331,7 +331,7 @@ PHP_FUNCTION(assert_options) break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown value %ld", what); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown value %pd", what); break; } diff --git a/ext/standard/dir.c b/ext/standard/dir.c index bf79a391cf..5269b9827b 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -273,7 +273,7 @@ PHP_FUNCTION(closedir) FETCH_DIRP(); if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a valid Directory resource", dirp->res->handle); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle); RETURN_FALSE; } @@ -387,7 +387,7 @@ PHP_FUNCTION(rewinddir) FETCH_DIRP(); if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a valid Directory resource", dirp->res->handle); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle); RETURN_FALSE; } @@ -406,7 +406,7 @@ PHP_NAMED_FUNCTION(php_if_readdir) FETCH_DIRP(); if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a valid Directory resource", dirp->res->handle); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle); RETURN_FALSE; } diff --git a/ext/standard/file.c b/ext/standard/file.c index 1b599b84a0..835180ee48 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -558,7 +558,7 @@ PHP_FUNCTION(file_get_contents) } if (maxlen > INT_MAX) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "maxlen truncated from %ld to %d bytes", maxlen, INT_MAX); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX); maxlen = INT_MAX; } if ((contents = php_stream_copy_to_mem(stream, maxlen, 0)) != NULL) { @@ -651,7 +651,7 @@ PHP_FUNCTION(file_put_contents) if (Z_STRSIZE_P(data)) { numbytes = php_stream_write(stream, Z_STRVAL_P(data), Z_STRSIZE_P(data)); if (numbytes != Z_STRSIZE_P(data)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %ld of %zd bytes written, possibly out of free disk space", numbytes, Z_STRSIZE_P(data)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %pl of %zd bytes written, possibly out of free disk space", numbytes, Z_STRSIZE_P(data)); numbytes = -1; } } @@ -686,7 +686,7 @@ PHP_FUNCTION(file_put_contents) if (zend_std_cast_object_tostring(data, &out, IS_STRING TSRMLS_CC) == SUCCESS) { numbytes = php_stream_write(stream, Z_STRVAL(out), Z_STRSIZE(out)); if (numbytes != Z_STRSIZE(out)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %ld of %zd bytes written, possibly out of free disk space", numbytes, Z_STRSIZE(out)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %pd of %zd bytes written, possibly out of free disk space", numbytes, Z_STRSIZE(out)); numbytes = -1; } zval_dtor(&out); @@ -903,7 +903,7 @@ PHPAPI PHP_FUNCTION(fclose) PHP_STREAM_TO_ZVAL(stream, arg1); if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a valid stream resource", stream->res->handle); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid stream resource", stream->res->handle); RETURN_FALSE; } diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index ae7f28b7da..79665a4f99 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -531,10 +531,10 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa (tmpzval = php_stream_context_get_option(context, "ftp", "resume_pos")) != NULL && Z_TYPE_P(tmpzval) == IS_INT && Z_IVAL_P(tmpzval) > 0) { - php_stream_printf(stream TSRMLS_CC, "REST %ld\r\n", Z_IVAL_P(tmpzval)); + php_stream_printf(stream TSRMLS_CC, "REST %pd\r\n", Z_IVAL_P(tmpzval)); result = GET_FTP_RESULT(stream); if (result < 300 || result > 399) { - php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to resume from offset %ld", Z_IVAL_P(tmpzval)); + php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to resume from offset %pd", Z_IVAL_P(tmpzval)); goto errexit; } } diff --git a/ext/standard/http.c b/ext/standard/http.c index d5eb78e417..58c6d1d8f4 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -109,7 +109,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, char *ekey; int ekey_len; /* Is an integer key */ - ekey_len = spprintf(&ekey, 0, "%ld", idx); + ekey_len = spprintf(&ekey, 0, "%pd", idx); newprefix_len = key_prefix_len + num_prefix_len + ekey_len + key_suffix_len + 3 /* %5B */; newprefix = emalloc(newprefix_len + 1); p = newprefix; @@ -168,7 +168,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, if (num_prefix) { smart_str_appendl(formstr, num_prefix, num_prefix_len); } - ekey_len = spprintf(&ekey, 0, "%ld", idx); + ekey_len = spprintf(&ekey, 0, "%pd", idx); smart_str_appendl(formstr, ekey, ekey_len); efree(ekey); } @@ -190,7 +190,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, { char *ekey; int ekey_len; - ekey_len = spprintf(&ekey, 0, "%ld", Z_IVAL_P(zdata)); + ekey_len = spprintf(&ekey, 0, "%pd", Z_IVAL_P(zdata)); smart_str_appendl(formstr, ekey, ekey_len); efree(ekey); } diff --git a/ext/standard/info.c b/ext/standard/info.c index 07c183df8e..92ee07a925 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -219,7 +219,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC) php_info_print(string_key->val); } } else { - php_info_printf("%ld", num_key); + php_info_printf("%pd", num_key); } php_info_print("\"]"); if (!sapi_module.phpinfo_as_text) { diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 1bd2fa9016..0ce10bb02a 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -285,9 +285,9 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char f = php_basename(tmp, strlen(tmp), NULL, 0 TSRMLS_CC); if (headers != NULL) { - spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n%s", php_getuid(TSRMLS_C), f->val, headers); + spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_INT_FMT ":%s\n%s", php_getuid(TSRMLS_C), f->val, headers); } else { - spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s", php_getuid(TSRMLS_C), f->val); + spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_INT_FMT ":%s", php_getuid(TSRMLS_C), f->val); } STR_RELEASE(f); } diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 903b3a7be1..9e960f3d55 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -534,7 +534,7 @@ PHP_FUNCTION(proc_open) #else descriptors[ndesc].childend = dup(fd); if (descriptors[ndesc].childend < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to dup File-Handle for descriptor %ld - %s", nindex, strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to dup File-Handle for descriptor %pd - %s", nindex, strerror(errno)); goto exit_fail; } #endif diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index baa28a14b1..b02a1386c4 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -423,13 +423,13 @@ PHP_FUNCTION(stream_get_contents) if (seek_res != 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Failed to seek to position %ld in the stream", desiredpos); + "Failed to seek to position %pd in the stream", desiredpos); RETURN_FALSE; } } if (maxlen > INT_MAX) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "maxlen truncated from %ld to %d bytes", maxlen, INT_MAX); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX); maxlen = INT_MAX; } if ((contents = php_stream_copy_to_mem(stream, maxlen, 0))) { diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index 8ed49e6efc..fc865b64a7 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -1,4 +1,5 @@ /* Generated by re2c 0.13.5 */ +#line 1 "ext/standard/url_scanner_ex.re" /* +----------------------------------------------------------------------+ | PHP Version 5 | @@ -99,6 +100,7 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("url_rewriter.tags", "a=href,area=href,frame=src,form=,fieldset=", PHP_INI_ALL, OnUpdateTags, url_adapt_state_ex, php_basic_globals, basic_globals) PHP_INI_END() +#line 107 "ext/standard/url_scanner_ex.re" #define YYFILL(n) goto done @@ -117,6 +119,7 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st scan: +#line 123 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -162,13 +165,19 @@ scan: if (yych <= '9') goto yy6; if (yych >= ';') goto yy4; ++YYCURSOR; +#line 125 "ext/standard/url_scanner_ex.re" { smart_str_append(dest, url); return; } +#line 171 "ext/standard/url_scanner_ex.c" yy4: ++YYCURSOR; +#line 126 "ext/standard/url_scanner_ex.re" { sep = separator; goto scan; } +#line 176 "ext/standard/url_scanner_ex.c" yy6: ++YYCURSOR; +#line 127 "ext/standard/url_scanner_ex.re" { bash = p - 1; goto done; } +#line 181 "ext/standard/url_scanner_ex.c" yy8: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -176,8 +185,11 @@ yy8: if (yybm[0+yych] & 128) { goto yy8; } +#line 128 "ext/standard/url_scanner_ex.re" { goto scan; } +#line 191 "ext/standard/url_scanner_ex.c" } +#line 129 "ext/standard/url_scanner_ex.re" done: @@ -362,6 +374,7 @@ state_plain_begin: state_plain: start = YYCURSOR; +#line 378 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -404,7 +417,9 @@ state_plain: goto yy15; } ++YYCURSOR; +#line 313 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; } +#line 423 "ext/standard/url_scanner_ex.c" yy15: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -412,13 +427,17 @@ yy15: if (yybm[0+yych] & 128) { goto yy15; } +#line 314 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_plain; } +#line 433 "ext/standard/url_scanner_ex.c" } +#line 315 "ext/standard/url_scanner_ex.re" state_tag: start = YYCURSOR; +#line 441 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -469,10 +488,14 @@ yy20: yych = *YYCURSOR; goto yy25; yy21: +#line 320 "ext/standard/url_scanner_ex.re" { handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; } +#line 494 "ext/standard/url_scanner_ex.c" yy22: ++YYCURSOR; +#line 321 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_plain_begin; } +#line 499 "ext/standard/url_scanner_ex.c" yy24: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -483,6 +506,7 @@ yy25: } goto yy21; } +#line 322 "ext/standard/url_scanner_ex.re" state_next_arg_begin: @@ -491,6 +515,7 @@ state_next_arg_begin: state_next_arg: start = YYCURSOR; +#line 519 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -555,20 +580,28 @@ yy28: ++YYCURSOR; if ((yych = *YYCURSOR) == '>') goto yy39; yy29: +#line 333 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_plain_begin; } +#line 586 "ext/standard/url_scanner_ex.c" yy30: ++YYCURSOR; yy31: +#line 330 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } +#line 592 "ext/standard/url_scanner_ex.c" yy32: ++YYCURSOR; yych = *YYCURSOR; goto yy38; yy33: +#line 331 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_next_arg; } +#line 600 "ext/standard/url_scanner_ex.c" yy34: ++YYCURSOR; +#line 332 "ext/standard/url_scanner_ex.re" { --YYCURSOR; STATE = STATE_ARG; goto state_arg; } +#line 605 "ext/standard/url_scanner_ex.c" yy36: yych = *++YYCURSOR; goto yy29; @@ -586,11 +619,13 @@ yy39: yych = *YYCURSOR; goto yy31; } +#line 334 "ext/standard/url_scanner_ex.re" state_arg: start = YYCURSOR; +#line 629 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -638,10 +673,14 @@ yy42: yych = *YYCURSOR; goto yy47; yy43: +#line 339 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; } +#line 679 "ext/standard/url_scanner_ex.c" yy44: ++YYCURSOR; +#line 340 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; } +#line 684 "ext/standard/url_scanner_ex.c" yy46: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -652,11 +691,13 @@ yy47: } goto yy43; } +#line 341 "ext/standard/url_scanner_ex.re" state_before_val: start = YYCURSOR; +#line 701 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -703,13 +744,17 @@ yy50: if (yych == ' ') goto yy57; if (yych == '=') goto yy55; yy51: +#line 347 "ext/standard/url_scanner_ex.re" { --YYCURSOR; goto state_next_arg_begin; } +#line 750 "ext/standard/url_scanner_ex.c" yy52: ++YYCURSOR; yych = *YYCURSOR; goto yy56; yy53: +#line 346 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; } +#line 758 "ext/standard/url_scanner_ex.c" yy54: yych = *++YYCURSOR; goto yy51; @@ -731,12 +776,14 @@ yy57: YYCURSOR = YYMARKER; goto yy51; } +#line 348 "ext/standard/url_scanner_ex.re" state_val: start = YYCURSOR; +#line 787 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -797,7 +844,9 @@ state_val: yych = *(YYMARKER = ++YYCURSOR); if (yych != '>') goto yy76; yy63: +#line 357 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_next_arg_begin; } +#line 850 "ext/standard/url_scanner_ex.c" yy64: yych = *(YYMARKER = ++YYCURSOR); if (yych == '>') goto yy63; @@ -807,7 +856,9 @@ yy65: yych = *YYCURSOR; goto yy69; yy66: +#line 356 "ext/standard/url_scanner_ex.re" { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; } +#line 862 "ext/standard/url_scanner_ex.c" yy67: yych = *++YYCURSOR; goto yy63; @@ -834,7 +885,9 @@ yy72: goto yy63; yy73: ++YYCURSOR; +#line 355 "ext/standard/url_scanner_ex.re" { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } +#line 891 "ext/standard/url_scanner_ex.c" yy75: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -845,8 +898,11 @@ yy76: } if (yych >= '>') goto yy72; ++YYCURSOR; +#line 354 "ext/standard/url_scanner_ex.re" { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } +#line 904 "ext/standard/url_scanner_ex.c" } +#line 358 "ext/standard/url_scanner_ex.re" stop: diff --git a/ext/standard/var.c b/ext/standard/var.c index 2c94942b94..02c1cc4bd0 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -191,7 +191,7 @@ again: break; case IS_RESOURCE: { const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc) TSRMLS_CC); - php_printf("%sresource(%ld) of type (%s)\n", COMMON, Z_RES_P(struc)->handle, type_name ? type_name : "Unknown"); + php_printf("%sresource(%pd) of type (%s)\n", COMMON, Z_RES_P(struc)->handle, type_name ? type_name : "Unknown"); break; } case IS_REFERENCE: diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 810f3c8f8c..b4be2cc26d 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -1,4 +1,5 @@ /* Generated by re2c 0.13.5 */ +#line 1 "ext/standard/var_unserializer.re" /* +----------------------------------------------------------------------+ | PHP Version 5 | @@ -232,6 +233,7 @@ static zend_string *unserialize_str(const unsigned char **p, size_t len, size_t #define YYMARKER marker +#line 241 "ext/standard/var_unserializer.re" @@ -385,7 +387,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) (*p) += 2; if (datalen < 0 || (*p) + datalen >= max) { - zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (php_int_t)(max - (*p))); + zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %pd present", datalen, (php_int_t)(max - (*p))); return 0; } @@ -479,6 +481,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) start = cursor; +#line 485 "ext/standard/var_unserializer.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -538,7 +541,9 @@ yy2: yych = *(YYMARKER = ++YYCURSOR); if (yych == ':') goto yy95; yy3: +#line 826 "ext/standard/var_unserializer.re" { return 0; } +#line 547 "ext/standard/var_unserializer.c" yy4: yych = *(YYMARKER = ++YYCURSOR); if (yych == ':') goto yy89; @@ -581,11 +586,13 @@ yy13: goto yy3; yy14: ++YYCURSOR; +#line 820 "ext/standard/var_unserializer.re" { /* this is the case where we have less data than planned */ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data"); return 0; /* not sure if it should be 0 or 1 here? */ } +#line 596 "ext/standard/var_unserializer.c" yy16: yych = *++YYCURSOR; goto yy3; @@ -615,6 +622,7 @@ yy20: yych = *++YYCURSOR; if (yych != '"') goto yy18; ++YYCURSOR; +#line 681 "ext/standard/var_unserializer.re" { size_t len, len2, len3, maxlen; php_int_t elements; @@ -753,6 +761,7 @@ yy20: return object_common2(UNSERIALIZE_PASSTHRU, elements); } +#line 765 "ext/standard/var_unserializer.c" yy25: yych = *++YYCURSOR; if (yych <= ',') { @@ -777,6 +786,7 @@ yy27: yych = *++YYCURSOR; if (yych != '"') goto yy18; ++YYCURSOR; +#line 673 "ext/standard/var_unserializer.re" { //??? INIT_PZVAL(rval); @@ -784,6 +794,7 @@ yy27: return object_common2(UNSERIALIZE_PASSTHRU, object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR)); } +#line 798 "ext/standard/var_unserializer.c" yy32: yych = *++YYCURSOR; if (yych == '+') goto yy33; @@ -804,6 +815,7 @@ yy34: yych = *++YYCURSOR; if (yych != '{') goto yy18; ++YYCURSOR; +#line 652 "ext/standard/var_unserializer.re" { php_int_t elements = parse_iv(start + 2); /* use iv() not uiv() in order to check data range */ @@ -824,6 +836,7 @@ yy34: return finish_nested_data(UNSERIALIZE_PASSTHRU); } +#line 840 "ext/standard/var_unserializer.c" yy39: yych = *++YYCURSOR; if (yych == '+') goto yy40; @@ -844,6 +857,7 @@ yy41: yych = *++YYCURSOR; if (yych != '"') goto yy18; ++YYCURSOR; +#line 624 "ext/standard/var_unserializer.re" { size_t len, maxlen; zend_string *str; @@ -871,6 +885,7 @@ yy41: ZVAL_STR(rval, str); return 1; } +#line 889 "ext/standard/var_unserializer.c" yy46: yych = *++YYCURSOR; if (yych == '+') goto yy47; @@ -891,6 +906,7 @@ yy48: yych = *++YYCURSOR; if (yych != '"') goto yy18; ++YYCURSOR; +#line 597 "ext/standard/var_unserializer.re" { size_t len, maxlen; char *str; @@ -917,6 +933,7 @@ yy48: ZVAL_STRINGL(rval, str, len); return 1; } +#line 937 "ext/standard/var_unserializer.c" yy53: yych = *++YYCURSOR; if (yych <= '/') { @@ -1004,6 +1021,7 @@ yy61: } yy63: ++YYCURSOR; +#line 588 "ext/standard/var_unserializer.re" { #if SIZEOF_ZEND_INT == 4 use_double: @@ -1012,6 +1030,7 @@ use_double: ZVAL_DOUBLE(rval, zend_strtod((const char *)start + 2, NULL)); return 1; } +#line 1034 "ext/standard/var_unserializer.c" yy65: yych = *++YYCURSOR; if (yych <= ',') { @@ -1070,6 +1089,7 @@ yy73: yych = *++YYCURSOR; if (yych != ';') goto yy18; ++YYCURSOR; +#line 572 "ext/standard/var_unserializer.re" { *p = YYCURSOR; @@ -1085,6 +1105,7 @@ yy73: return 1; } +#line 1109 "ext/standard/var_unserializer.c" yy76: yych = *++YYCURSOR; if (yych == 'N') goto yy73; @@ -1111,6 +1132,7 @@ yy79: if (yych <= '9') goto yy79; if (yych != ';') goto yy18; ++YYCURSOR; +#line 546 "ext/standard/var_unserializer.re" { #if SIZEOF_ZEND_INT == 4 int digits = YYCURSOR - start - 3; @@ -1136,6 +1158,7 @@ yy79: ZVAL_INT(rval, parse_iv(start + 2)); return 1; } +#line 1162 "ext/standard/var_unserializer.c" yy83: yych = *++YYCURSOR; if (yych <= '/') goto yy18; @@ -1143,18 +1166,22 @@ yy83: yych = *++YYCURSOR; if (yych != ';') goto yy18; ++YYCURSOR; +#line 540 "ext/standard/var_unserializer.re" { *p = YYCURSOR; ZVAL_BOOL(rval, parse_iv(start + 2)); return 1; } +#line 1176 "ext/standard/var_unserializer.c" yy87: ++YYCURSOR; +#line 534 "ext/standard/var_unserializer.re" { *p = YYCURSOR; ZVAL_NULL(rval); return 1; } +#line 1185 "ext/standard/var_unserializer.c" yy89: yych = *++YYCURSOR; if (yych <= ',') { @@ -1177,6 +1204,7 @@ yy91: if (yych <= '9') goto yy91; if (yych != ';') goto yy18; ++YYCURSOR; +#line 511 "ext/standard/var_unserializer.re" { php_int_t id; @@ -1199,6 +1227,7 @@ yy91: return 1; } +#line 1231 "ext/standard/var_unserializer.c" yy95: yych = *++YYCURSOR; if (yych <= ',') { @@ -1221,6 +1250,7 @@ yy97: if (yych <= '9') goto yy97; if (yych != ';') goto yy18; ++YYCURSOR; +#line 489 "ext/standard/var_unserializer.re" { php_int_t id; @@ -1242,7 +1272,9 @@ yy97: return 1; } +#line 1276 "ext/standard/var_unserializer.c" } +#line 828 "ext/standard/var_unserializer.re" return 0; diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 40876563a8..57570ab7f9 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -391,7 +391,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) (*p) += 2; if (datalen < 0 || (*p) + datalen >= max) { - zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (php_int_t)(max - (*p))); + zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %pd present", datalen, (php_int_t)(max - (*p))); return 0; } diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c index 72a67740be..de8340de32 100644 --- a/ext/zlib/zlib_filter.c +++ b/ext/zlib/zlib_filter.c @@ -334,7 +334,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f ZVAL_DUP(&tmp, tmpzval); convert_to_int(&tmp); if (Z_IVAL(tmp) < -MAX_WBITS || Z_IVAL(tmp) > MAX_WBITS + 32) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", Z_IVAL(tmp)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%pd)", Z_IVAL(tmp)); } else { windowBits = Z_IVAL(tmp); } @@ -367,7 +367,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f /* Memory Level (1 - 9) */ if (Z_IVAL(tmp) < 1 || Z_IVAL(tmp) > MAX_MEM_LEVEL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for memory level. (%ld)", Z_IVAL(tmp)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for memory level. (%pd)", Z_IVAL(tmp)); } else { memLevel = Z_IVAL(tmp); } @@ -379,7 +379,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f /* log-2 base of history window (9 - 15) */ if (Z_IVAL(tmp) < -MAX_WBITS || Z_IVAL(tmp) > MAX_WBITS + 16) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", Z_IVAL(tmp)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%pd)", Z_IVAL(tmp)); } else { windowBits = Z_IVAL(tmp); } @@ -402,7 +402,7 @@ factory_setlevel: /* Set compression level within reason (-1 == default, 0 == none, 1-9 == least to most compression */ if (Z_IVAL(tmp) < -1 || Z_IVAL(tmp) > 9) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid compression level specified. (%ld)", Z_IVAL(tmp)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid compression level specified. (%pd)", Z_IVAL(tmp)); } else { level = Z_IVAL(tmp); } diff --git a/main/SAPI.c b/main/SAPI.c index 9d8a19dc6d..a3826b0e1b 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -269,7 +269,7 @@ SAPI_API int sapi_read_post_block(char *buffer, size_t buflen TSRMLS_DC) SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data) { if ((SG(post_max_size) > 0) && (SG(request_info).content_length > SG(post_max_size))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "POST Content-Length of %ld bytes exceeds the limit of %ld bytes", + php_error_docref(NULL TSRMLS_CC, E_WARNING, "POST Content-Length of %pd bytes exceeds the limit of %pd bytes", SG(request_info).content_length, SG(post_max_size)); return; } |