diff options
author | Anatol Belski <ab@php.net> | 2016-11-26 15:18:42 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-11-26 17:29:01 +0100 |
commit | b204b3abd19f86bd9217866189cdebcc6abc0d95 (patch) | |
tree | 324e3c86634583ef7d58bc0f3e19dfbdeb85773c /ext | |
parent | 1b7e014d1ce21b9eb6021111c1005d047b5b9a1b (diff) | |
download | php-git-b204b3abd19f86bd9217866189cdebcc6abc0d95.tar.gz |
further normalizations, uint vs uint32_t
fix merge mistake
yet one more replacement run
Diffstat (limited to 'ext')
40 files changed, 115 insertions, 115 deletions
diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c index b084aeda52..4be7ad6c8d 100644 --- a/ext/com_dotnet/com_olechar.c +++ b/ext/com_dotnet/com_olechar.c @@ -74,7 +74,7 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, size_t str PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, size_t *string_len, int codepage) { char *string; - uint length = 0; + uint32_t length = 0; BOOL ok; length = WideCharToMultiByte(codepage, 0, olestring, -1, NULL, 0, NULL, NULL); diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 2df564ada8..89c095505d 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -424,7 +424,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c } else { len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%s", mimetype_len ? mimetype_len : (int) strlen(mimetype), mimetype, get_output_encoding()); } - if (content_type && SUCCESS == sapi_add_header(content_type, (uint)len, 0)) { + if (content_type && SUCCESS == sapi_add_header(content_type, (uint32_t)len, 0)) { SG(sapi_headers).send_default_content_type = 0; php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL); } diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 6c1e4714e3..42cab88028 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -1643,9 +1643,9 @@ PHP_FUNCTION(ldap_delete) /* {{{ _ldap_str_equal_to_const */ -static int _ldap_str_equal_to_const(const char *str, uint str_len, const char *cstr) +static int _ldap_str_equal_to_const(const char *str, uint32_t str_len, const char *cstr) { - uint i; + uint32_t i; if (strlen(cstr) != str_len) return 0; @@ -1662,9 +1662,9 @@ static int _ldap_str_equal_to_const(const char *str, uint str_len, const char *c /* {{{ _ldap_strlen_max */ -static int _ldap_strlen_max(const char *str, uint max_len) +static int _ldap_strlen_max(const char *str, uint32_t max_len) { - uint i; + uint32_t i; for (i = 0; i < max_len; ++i) { if (str[i] == '\0') { @@ -1697,7 +1697,7 @@ PHP_FUNCTION(ldap_modify_batch) int i, j, k; int num_mods, num_modprops, num_modvals; LDAPMod **ldap_mods; - uint oper; + uint32_t oper; /* $mods = array( diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index bbd6d0666b..8db82aa83a 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -1332,7 +1332,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output) /* }}} */ /* {{{ static _php_mb_ini_mbstring_internal_encoding_set */ -int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length) +int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint32_t new_value_length) { const mbfl_encoding *encoding; diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h index 9021a3a454..ae8781578a 100644 --- a/ext/mbstring/mbstring.h +++ b/ext/mbstring/mbstring.h @@ -159,7 +159,7 @@ MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int MBSTRING_API int php_mb_check_encoding(const char *input, size_t length, const char *enc); /* internal use only */ -int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length); +int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint32_t new_value_length); ZEND_BEGIN_MODULE_GLOBALS(mbstring) char *internal_encoding_name; diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index fb522130d6..12f07948de 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -596,7 +596,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result) MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); - if ((uint)argc != mysql_stmt_field_count(stmt->stmt)) { + if ((uint32_t)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 || (uint)fieldnr >= mysql_num_fields(result)) { + if (fieldnr < 0 || (uint32_t)fieldnr >= mysql_num_fields(result)) { php_error_docref(NULL, E_WARNING, "Invalid field offset"); RETURN_FALSE; } @@ -2538,7 +2538,7 @@ PHP_FUNCTION(mysqli_stmt_store_result) #if MYSQL_VERSION_ID >= 50107 my_bool tmp=1; #else - uint tmp=1; + uint32_t tmp=1; #endif mysql_stmt_attr_set(stmt->stmt, STMT_ATTR_UPDATE_MAX_LENGTH, &tmp); break; diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c index 6b9e95ff7b..d79d7bde48 100644 --- a/ext/mysqli/mysqli_prop.c +++ b/ext/mysqli/mysqli_prop.c @@ -292,7 +292,7 @@ static zval *result_lengths_read(mysqli_object *obj, zval *retval) #else const zend_ulong *ret; #endif - uint field_count; + uint32_t field_count; CHECK_STATUS(MYSQLI_STATUS_VALID); p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; diff --git a/ext/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c index 2b3ddd0831..241c1cb5ba 100644 --- a/ext/mysqlnd/mysqlnd_charset.c +++ b/ext/mysqlnd/mysqlnd_charset.c @@ -410,7 +410,7 @@ static unsigned int check_mb_utf16(const char *start, const char *end) } -static uint mysqlnd_mbcharlen_utf16(unsigned int utf16) +static uint32_t mysqlnd_mbcharlen_utf16(unsigned int utf16) { return UTF16_HIGH_HEAD(utf16) ? 4 : 2; } diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c index 3a03d56975..a446c5e2dc 100644 --- a/ext/mysqlnd/mysqlnd_debug.c +++ b/ext/mysqlnd/mysqlnd_debug.c @@ -249,7 +249,7 @@ MYSQLND_METHOD(mysqlnd_debug, func_enter)(MYSQLND_DEBUG * self, if ((self->flags & MYSQLND_DEBUG_DUMP_TRACE) == 0 || self->file_name == NULL) { return FALSE; } - if ((uint) zend_stack_count(&self->call_stack) >= self->nest_level_limit) { + if ((uint32_t) zend_stack_count(&self->call_stack) >= self->nest_level_limit) { return FALSE; } @@ -320,7 +320,7 @@ MYSQLND_METHOD(mysqlnd_debug, func_leave)(MYSQLND_DEBUG * self, unsigned int lin if ((self->flags & MYSQLND_DEBUG_DUMP_TRACE) == 0 || self->file_name == NULL) { return PASS; } - if ((uint) zend_stack_count(&self->call_stack) >= self->nest_level_limit) { + if ((uint32_t) zend_stack_count(&self->call_stack) >= self->nest_level_limit) { return PASS; } @@ -349,7 +349,7 @@ MYSQLND_METHOD(mysqlnd_debug, func_leave)(MYSQLND_DEBUG * self, unsigned int lin struct st_mysqlnd_dbg_function_profile f_profile_stack = {0}; struct st_mysqlnd_dbg_function_profile * f_profile = NULL; uint64_t own_time = call_time - mine_non_own_time; - uint func_name_len = strlen(*func_name); + uint32_t func_name_len = strlen(*func_name); self->m->log_va(self, line, file, zend_stack_count(&self->call_stack) - 1, NULL, "<%s (total=%u own=%u in_calls=%u)", *func_name, (unsigned int) call_time, (unsigned int) own_time, (unsigned int) mine_non_own_time @@ -401,7 +401,7 @@ MYSQLND_METHOD(mysqlnd_debug, func_leave)(MYSQLND_DEBUG * self, unsigned int lin f_profile->calls = 1; zend_hash_str_add_mem(&self->function_profiles, *func_name, func_name_len, f_profile, sizeof(struct st_mysqlnd_dbg_function_profile)); } - if ((uint) zend_stack_count(&self->call_time_stack)) { + if ((uint32_t) zend_stack_count(&self->call_time_stack)) { uint64_t parent_non_own_time = 0; parent_non_own_time_ptr = zend_stack_top(&self->call_time_stack); diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index 513214d3fa..1d5e27b471 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -1400,7 +1400,7 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const c } DBG_INF_FMT("ret=%s row_count=%u warnings=%u server_status=%u", ret == PASS? "PASS":"FAIL", - (uint) set->row_count, + (uint32_t) set->row_count, UPSERT_STATUS_GET_WARNINGS(conn->upsert_status), UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status)); end: diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 8f936bb5e0..cdac09bcbd 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -363,8 +363,8 @@ static void accel_interned_strings_restore_for_php(void) #ifndef ZTS static void accel_interned_strings_restore_state(void) { - uint idx = ZCSG(interned_strings).nNumUsed; - uint nIndex; + uint32_t idx = ZCSG(interned_strings).nNumUsed; + uint32_t nIndex; Bucket *p; memset(ZCSG(interned_strings_saved_top), @@ -401,8 +401,8 @@ static zend_string *accel_find_interned_string(zend_string *str) { /* for now interned strings are supported only for non-ZTS build */ zend_ulong h; - uint nIndex; - uint idx; + uint32_t nIndex; + uint32_t idx; Bucket *arData, *p; if (IS_ACCEL_INTERNED(str)) { @@ -441,8 +441,8 @@ zend_string *accel_new_interned_string(zend_string *str) /* for now interned strings are supported only for non-ZTS build */ #ifndef ZTS zend_ulong h; - uint nIndex; - uint idx; + uint32_t nIndex; + uint32_t idx; Bucket *p; #ifdef HAVE_OPCACHE_FILE_CACHE @@ -512,7 +512,7 @@ zend_string *accel_new_interned_string(zend_string *str) /* Copy PHP interned strings from PHP process memory into the shared memory */ static void accel_use_shm_interned_strings(void) { - uint idx, j; + uint32_t idx, j; Bucket *p, *q; /* empty string */ @@ -1203,7 +1203,7 @@ static void zend_accel_add_key(char *key, unsigned int key_length, zend_accel_ha #ifdef HAVE_OPCACHE_FILE_CACHE static zend_persistent_script *cache_script_in_file_cache(zend_persistent_script *new_persistent_script, int *from_shared_memory) { - uint memory_used; + uint32_t memory_used; /* Check if script may be stored in shared memory */ if (!zend_accel_script_persistable(new_persistent_script)) { @@ -1261,7 +1261,7 @@ static zend_persistent_script *cache_script_in_file_cache(zend_persistent_script static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length, int *from_shared_memory) { zend_accel_hash_entry *bucket; - uint memory_used; + uint32_t memory_used; /* Check if script may be stored in shared memory */ if (!zend_accel_script_persistable(new_persistent_script)) { diff --git a/ext/opcache/zend_accelerator_hash.c b/ext/opcache/zend_accelerator_hash.c index 7ec64cec1f..a77c5078f0 100644 --- a/ext/opcache/zend_accelerator_hash.c +++ b/ext/opcache/zend_accelerator_hash.c @@ -25,9 +25,9 @@ #include "zend_shared_alloc.h" /* Generated on an Octa-ALPHA 300MHz CPU & 2.5GB RAM monster */ -static uint prime_numbers[] = +static uint32_t prime_numbers[] = {5, 11, 19, 53, 107, 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }; -static uint num_prime_numbers = sizeof(prime_numbers) / sizeof(uint); +static uint32_t num_prime_numbers = sizeof(prime_numbers) / sizeof(uint32_t); void zend_accel_hash_clean(zend_accel_hash *accel_hash) { @@ -38,7 +38,7 @@ void zend_accel_hash_clean(zend_accel_hash *accel_hash) void zend_accel_hash_init(zend_accel_hash *accel_hash, uint32_t hash_size) { - uint i; + uint32_t i; for (i=0; i<num_prime_numbers; i++) { if (hash_size <= prime_numbers[i]) { diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 6eace96398..6b88b0960d 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -543,7 +543,7 @@ int start_accel_module(void) Get the scripts which are accelerated by ZendAccelerator */ static int accelerator_get_scripts(zval *return_value) { - uint i; + uint32_t i; zval persistent_script_report; zend_accel_hash_entry *cache_entry; struct tm *ta; diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index 61c9c15d2b..a690b5dc1d 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -735,7 +735,7 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, #define ADLER32_DO8(buf, i) ADLER32_DO4(buf, i); ADLER32_DO4(buf, i + 4); #define ADLER32_DO16(buf) ADLER32_DO8(buf, 0); ADLER32_DO8(buf, 8); -unsigned int zend_adler32(unsigned int checksum, signed char *buf, uint len) +unsigned int zend_adler32(unsigned int checksum, signed char *buf, uint32_t len) { unsigned int s1 = checksum & 0xffff; unsigned int s2 = (checksum >> 16) & 0xffff; diff --git a/ext/opcache/zend_accelerator_util_funcs.h b/ext/opcache/zend_accelerator_util_funcs.h index 4cfd77d4ed..3aa4796f8b 100644 --- a/ext/opcache/zend_accelerator_util_funcs.h +++ b/ext/opcache/zend_accelerator_util_funcs.h @@ -37,7 +37,7 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, #define ADLER32_INIT 1 /* initial Adler-32 value */ -unsigned int zend_adler32(unsigned int checksum, signed char *buf, uint len); +unsigned int zend_adler32(unsigned int checksum, signed char *buf, uint32_t len); unsigned int zend_accel_script_checksum(zend_persistent_script *persistent_script); diff --git a/ext/opcache/zend_persist.h b/ext/opcache/zend_persist.h index a03689ee44..6359bc257c 100644 --- a/ext/opcache/zend_persist.h +++ b/ext/opcache/zend_persist.h @@ -23,7 +23,7 @@ #define ZEND_PERSIST_H int zend_accel_script_persistable(zend_persistent_script *script); -uint zend_accel_script_persist_calc(zend_persistent_script *script, char *key, unsigned int key_length); +uint32_t zend_accel_script_persist_calc(zend_persistent_script *script, char *key, unsigned int key_length); zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length); #endif /* ZEND_PERSIST_H */ diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index 84cd417204..d6d124fa16 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -53,7 +53,7 @@ static void zend_persist_zval_calc(zval *z); static void zend_hash_persist_calc(HashTable *ht, void (*pPersistElement)(zval *pElement)) { - uint idx; + uint32_t idx; Bucket *p; if (!(ht->u.flags & HASH_FLAG_INITIALIZED) || ht->nNumUsed == 0) { @@ -121,7 +121,7 @@ static void zend_persist_ast_calc(zend_ast *ast) static void zend_persist_zval_calc(zval *z) { zend_uchar flags; - uint size; + uint32_t size; switch (Z_TYPE_P(z)) { case IS_STRING: @@ -396,7 +396,7 @@ static void zend_accel_persist_class_table_calc(HashTable *class_table) zend_hash_persist_calc(class_table, zend_persist_class_entry_calc); } -uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length) +uint32_t zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length) { new_persistent_script->mem = NULL; new_persistent_script->size = 0; diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 308db6dc58..d8673cf050 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -7046,7 +7046,7 @@ PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array, l char *field_name; size_t num_fields; int pg_numrows, pg_row; - uint i; + uint32_t i; assert(Z_TYPE_P(ret_array) == IS_ARRAY); if ((pg_numrows = PQntuples(pg_result)) <= 0) { diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index d44b3be298..fdb36d178c 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -140,7 +140,7 @@ static int phar_dir_flush(php_stream *stream) /* {{{ */ * This is used to get a unique listing of virtual directories within a phar, * for iterating over opendir()ed phar directories. */ -static int phar_add_empty(HashTable *ht, char *arKey, uint nKeyLength) /* {{{ */ +static int phar_add_empty(HashTable *ht, char *arKey, uint32_t nKeyLength) /* {{{ */ { zval dummy; @@ -183,7 +183,7 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest) /* {{{ */ size_t dirlen = strlen(dir); char *entry, *found, *save; zend_string *str_key; - uint keylen; + uint32_t keylen; zend_ulong unused; ALLOC_HASHTABLE(data); @@ -204,8 +204,8 @@ static php_stream *phar_make_dirstream(char *dir, HashTable *manifest) /* {{{ */ } keylen = ZSTR_LEN(str_key); - if (keylen <= (uint)dirlen) { - if (keylen == 0 || keylen < (uint)dirlen || !strncmp(ZSTR_VAL(str_key), dir, dirlen)) { + if (keylen <= (uint32_t)dirlen) { + if (keylen == 0 || keylen < (uint32_t)dirlen || !strncmp(ZSTR_VAL(str_key), dir, dirlen)) { if (SUCCESS != zend_hash_move_forward(manifest)) { break; } @@ -309,7 +309,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, zend_ulong unused; phar_archive_data *phar; phar_entry_info *entry = NULL; - uint host_len; + uint32_t host_len; if ((resource = phar_parse_url(wrapper, path, mode, options)) == NULL) { php_stream_wrapper_log_error(wrapper, options, "phar url \"%s\" is unknown", path); @@ -385,7 +385,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, while (FAILURE != zend_hash_has_more_elements(&phar->manifest)) { if (HASH_KEY_NON_EXISTENT != zend_hash_get_current_key(&phar->manifest, &str_key, &unused)) { - if (ZSTR_LEN(str_key) > (uint)i_len && 0 == memcmp(ZSTR_VAL(str_key), internal_file, i_len)) { + if (ZSTR_LEN(str_key) > (uint32_t)i_len && 0 == memcmp(ZSTR_VAL(str_key), internal_file, i_len)) { /* directory found */ internal_file = estrndup(internal_file, i_len); @@ -415,7 +415,7 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo char *error, *arch, *entry2; int arch_len, entry_len; php_url *resource = NULL; - uint host_len; + uint32_t host_len; /* pre-readonly check, we need to know if this is a data phar */ if (FAILURE == phar_split_fname(url_from, strlen(url_from), &arch, &arch_len, &entry2, &entry_len, 2, 2)) { @@ -547,10 +547,10 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options char *error, *arch, *entry2; int arch_len, entry_len; php_url *resource = NULL; - uint host_len; + uint32_t host_len; zend_string *str_key; zend_ulong unused; - uint path_len; + uint32_t path_len; /* pre-readonly check, we need to know if this is a data phar */ if (FAILURE == phar_split_fname(url, strlen(url), &arch, &arch_len, &entry2, &entry_len, 2, 2)) { diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 81596423ff..94c591840f 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -103,7 +103,7 @@ static void phar_split_cache_list(void) /* {{{ */ char *key, *lasts, *end; char ds[2]; phar_archive_data *phar; - uint i = 0; + uint32_t i = 0; if (!PHAR_G(cache_list) || !(PHAR_G(cache_list)[0])) { return; @@ -1955,11 +1955,11 @@ woohoo: HASH_KEY_NON_EXISTENT != zend_hash_get_current_key(&(PHAR_G(phar_fname_map)), &str_key, &unused); zend_hash_move_forward(&(PHAR_G(phar_fname_map))) ) { - if (ZSTR_LEN(str_key) > (uint) filename_len) { + if (ZSTR_LEN(str_key) > (uint32_t) filename_len) { continue; } - if (!memcmp(filename, ZSTR_VAL(str_key), ZSTR_LEN(str_key)) && ((uint)filename_len == ZSTR_LEN(str_key) + if (!memcmp(filename, ZSTR_VAL(str_key), ZSTR_LEN(str_key)) && ((uint32_t)filename_len == ZSTR_LEN(str_key) || filename[ZSTR_LEN(str_key)] == '/' || filename[ZSTR_LEN(str_key)] == '\0')) { if (NULL == (pphar = zend_hash_get_current_data_ptr(&(PHAR_G(phar_fname_map))))) { break; @@ -1974,11 +1974,11 @@ woohoo: HASH_KEY_NON_EXISTENT != zend_hash_get_current_key(&cached_phars, &str_key, &unused); zend_hash_move_forward(&cached_phars) ) { - if (ZSTR_LEN(str_key) > (uint) filename_len) { + if (ZSTR_LEN(str_key) > (uint32_t) filename_len) { continue; } - if (!memcmp(filename, ZSTR_VAL(str_key), ZSTR_LEN(str_key)) && ((uint)filename_len == ZSTR_LEN(str_key) + if (!memcmp(filename, ZSTR_VAL(str_key), ZSTR_LEN(str_key)) && ((uint32_t)filename_len == ZSTR_LEN(str_key) || filename[ZSTR_LEN(str_key)] == '/' || filename[ZSTR_LEN(str_key)] == '\0')) { if (NULL == (pphar = zend_hash_get_current_data_ptr(&cached_phars))) { break; diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index cd562ea411..fa92f5bee6 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -250,7 +250,7 @@ typedef struct _phar_entry_info { char *link; /* symbolic link to another file */ char tar_type; /* position in the manifest */ - uint manifest_pos; + uint32_t manifest_pos; /* for stat */ unsigned short inode; @@ -300,7 +300,7 @@ struct _phar_archive_data { char *signature; zval metadata; int metadata_len; /* only used for cached manifests */ - uint phar_pos; + uint32_t phar_pos; /* if 1, then this alias was manually specified by the user and is not a permanent alias */ unsigned int is_temporary_alias:1; unsigned int is_modified:1; diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index ca9a031d36..457d6e593d 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -1411,7 +1411,7 @@ struct _phar_t { char *b; zval *ret; php_stream *fp; - uint l; + uint32_t l; int count; }; @@ -1420,7 +1420,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ zval *value; zend_bool close_fp = 1; struct _phar_t *p_obj = (struct _phar_t*) puser; - uint base_len = p_obj->l, str_key_len; + uint32_t str_key_len, base_len = p_obj->l; phar_entry_data *data; php_stream *fp; php_stat_len fname_len; @@ -1820,7 +1820,7 @@ PHP_METHOD(Phar, buildFromDirectory) pass.c = apply_reg ? Z_OBJCE(regexiter) : Z_OBJCE(iteriter); pass.p = phar_obj; pass.b = dir; - pass.l = (uint)dir_len; + pass.l = (uint32_t)dir_len; pass.count = 0; pass.ret = return_value; pass.fp = php_stream_fopen_tmpfile(); @@ -1908,7 +1908,7 @@ PHP_METHOD(Phar, buildFromIterator) pass.c = Z_OBJCE_P(obj); pass.p = phar_obj; pass.b = base; - pass.l = (uint)base_len; + pass.l = (uint32_t)base_len; pass.ret = return_value; pass.count = 0; pass.fp = php_stream_fopen_tmpfile(); @@ -2623,8 +2623,8 @@ PHP_METHOD(Phar, delete) zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); return; } - if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint) fname_len)) { - if (NULL != (entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint) fname_len))) { + if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint32_t) fname_len)) { + if (NULL != (entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint32_t) fname_len))) { if (entry->is_deleted) { /* entry is deleted, but has not been flushed to disk yet */ RETURN_TRUE; @@ -3463,14 +3463,14 @@ PHP_METHOD(Phar, copy) RETURN_FALSE; } - if (!zend_hash_str_exists(&phar_obj->archive->manifest, oldfile, (uint) oldfile_len) || NULL == (oldentry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, oldfile, (uint) oldfile_len)) || oldentry->is_deleted) { + if (!zend_hash_str_exists(&phar_obj->archive->manifest, oldfile, (uint32_t) oldfile_len) || NULL == (oldentry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, oldfile, (uint32_t) oldfile_len)) || oldentry->is_deleted) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "file \"%s\" cannot be copied to file \"%s\", file does not exist in %s", oldfile, newfile, phar_obj->archive->fname); RETURN_FALSE; } - if (zend_hash_str_exists(&phar_obj->archive->manifest, newfile, (uint) newfile_len)) { - if (NULL != (temp = zend_hash_str_find_ptr(&phar_obj->archive->manifest, newfile, (uint) newfile_len)) || !temp->is_deleted) { + if (zend_hash_str_exists(&phar_obj->archive->manifest, newfile, (uint32_t) newfile_len)) { + if (NULL != (temp = zend_hash_str_find_ptr(&phar_obj->archive->manifest, newfile, (uint32_t) newfile_len)) || !temp->is_deleted) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "file \"%s\" cannot be copied to file \"%s\", file must not already exist in phar %s", oldfile, newfile, phar_obj->archive->fname); RETURN_FALSE; @@ -3491,7 +3491,7 @@ PHP_METHOD(Phar, copy) return; } /* re-populate with copied-on-write entry */ - oldentry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, oldfile, (uint) oldfile_len); + oldentry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, oldfile, (uint32_t) oldfile_len); } memcpy((void *) &newentry, oldentry, sizeof(phar_entry_info)); @@ -3546,8 +3546,8 @@ PHP_METHOD(Phar, offsetExists) RETURN_FALSE; } - if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint) fname_len)) { - if (NULL != (entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint) fname_len))) { + if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint32_t) fname_len)) { + if (NULL != (entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint32_t) fname_len))) { if (entry->is_deleted) { /* entry is deleted, but has not been flushed to disk yet */ RETURN_FALSE; @@ -3560,7 +3560,7 @@ PHP_METHOD(Phar, offsetExists) } RETURN_TRUE; } else { - if (zend_hash_str_exists(&phar_obj->archive->virtual_dirs, fname, (uint) fname_len)) { + if (zend_hash_str_exists(&phar_obj->archive->virtual_dirs, fname, (uint32_t) fname_len)) { RETURN_TRUE; } RETURN_FALSE; @@ -3779,8 +3779,8 @@ PHP_METHOD(Phar, offsetUnset) RETURN_FALSE; } - if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint) fname_len)) { - if (NULL != (entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint) fname_len))) { + if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint32_t) fname_len)) { + if (NULL != (entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint32_t) fname_len))) { if (entry->is_deleted) { /* entry is deleted, but has not been flushed to disk yet */ return; @@ -3792,7 +3792,7 @@ PHP_METHOD(Phar, offsetUnset) return; } /* re-populate entry after copy on write */ - entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint) fname_len); + entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint32_t) fname_len); } entry->is_modified = 0; entry->is_deleted = 1; diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 27554c1785..774179149f 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -166,7 +166,7 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha php_url *resource = NULL; php_stream *fpf; zval *pzoption, *metadata; - uint host_len; + uint32_t host_len; if ((resource = phar_parse_url(wrapper, path, mode, options)) == NULL) { return NULL; @@ -556,7 +556,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f char *internal_file, *error; phar_archive_data *phar; phar_entry_info *entry; - uint host_len; + uint32_t host_len; int internal_file_len; if ((resource = phar_parse_url(wrapper, url, "r", flags|PHP_STREAM_URL_STAT_QUIET)) == NULL) { @@ -665,7 +665,7 @@ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int int internal_file_len; phar_entry_data *idata; phar_archive_data *pphar; - uint host_len; + uint32_t host_len; if ((resource = phar_parse_url(wrapper, url, "rb", options)) == NULL) { php_stream_wrapper_log_error(wrapper, options, "phar error: unlink failed"); @@ -738,7 +738,7 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from char *error; phar_archive_data *phar, *pfrom, *pto; phar_entry_info *entry; - uint host_len; + uint32_t host_len; int is_dir = 0; int is_modified = 0; @@ -882,8 +882,8 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from Bucket *b; zend_string *str_key; zend_string *new_str_key; - uint from_len = strlen(resource_from->path+1); - uint to_len = strlen(resource_to->path+1); + uint32_t from_len = strlen(resource_from->path+1); + uint32_t to_len = strlen(resource_to->path+1); ZEND_HASH_FOREACH_BUCKET(&phar->manifest, b) { str_key = b->key; diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 3a601913ac..f641399536 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -315,7 +315,7 @@ bail: if (((hdr->typeflag == '\0') || (hdr->typeflag == TAR_FILE)) && size > 0) { /* this is not good enough - seek succeeds even on truncated tars */ php_stream_seek(fp, 512, SEEK_CUR); - if ((uint)php_stream_tell(fp) > totalsize) { + if ((uint32_t)php_stream_tell(fp) > totalsize) { if (error) { spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname); } @@ -383,7 +383,7 @@ bail: /* this is not good enough - seek succeeds even on truncated tars */ php_stream_seek(fp, size, SEEK_CUR); - if ((uint)php_stream_tell(fp) > totalsize) { + if ((uint32_t)php_stream_tell(fp) > totalsize) { efree(entry.filename); if (error) { spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname); @@ -570,7 +570,7 @@ bail: next: /* this is not good enough - seek succeeds even on truncated tars */ php_stream_seek(fp, size, SEEK_CUR); - if ((uint)php_stream_tell(fp) > totalsize) { + if ((uint32_t)php_stream_tell(fp) > totalsize) { if (error) { spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname); } diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 48733def55..96f410f0e4 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -69,7 +69,7 @@ static void delete_service(void *service); static void delete_url(void *handle); static void delete_hashtable(void *hashtable); -static void soap_error_handler(int error_num, const char *error_filename, const uint error_lineno, const char *format, va_list args); +static void soap_error_handler(int error_num, const char *error_filename, const uint32_t error_lineno, const char *format, va_list args); #define SOAP_SERVER_BEGIN_CODE() \ zend_bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\ @@ -2126,7 +2126,7 @@ static void soap_server_fault(char* code, char* string, char *actor, zval* detai zend_bailout(); } -static void soap_error_handler(int error_num, const char *error_filename, const uint error_lineno, const char *format, va_list args) +static void soap_error_handler(int error_num, const char *error_filename, const uint32_t error_lineno, const char *format, va_list args) { zend_bool _old_in_compilation; zend_execute_data *_old_current_execute_data; diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c index 46286a468d..3162291b99 100644 --- a/ext/sockets/conversions.c +++ b/ext/sockets/conversions.c @@ -1194,7 +1194,7 @@ static void to_zval_read_iov(const char *msghdr_c, zval *zv, res_context *ctx) do_to_zval_err(ctx, "unexpectedly large value for iov_len: %lu", (unsigned long)iovlen); } - array_init_size(zv, (uint)iovlen); + array_init_size(zv, (uint32_t)iovlen); if ((recvmsg_ret = zend_hash_str_find_ptr(&ctx->params, KEY_RECVMSG_RET, sizeof(KEY_RECVMSG_RET) - 1)) == NULL) { do_to_zval_err(ctx, "recvmsg_ret not found in params. This is a bug"); @@ -1202,7 +1202,7 @@ static void to_zval_read_iov(const char *msghdr_c, zval *zv, res_context *ctx) } bytes_left = *recvmsg_ret; - for (i = 0; bytes_left > 0 && i < (uint)iovlen; i++) { + for (i = 0; bytes_left > 0 && i < (uint32_t)iovlen; i++) { zval elem; size_t len = MIN(msghdr->msg_iov[i].iov_len, (size_t)bytes_left); zend_string *buf = zend_string_alloc(len, 0); diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 3743718038..14ceee1fe0 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -2197,7 +2197,7 @@ static int spl_filesystem_file_is_empty_line(spl_filesystem_object *intern) /* { case IS_ARRAY: if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV) && zend_hash_num_elements(Z_ARRVAL(intern->u.file.current_zval)) == 1) { - uint idx = 0; + uint32_t idx = 0; zval *first; while (Z_ISUNDEF(Z_ARRVAL(intern->u.file.current_zval)->arData[idx].val)) { diff --git a/ext/standard/array.c b/ext/standard/array.c index 2c51149881..6098bdbbb8 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3766,7 +3766,7 @@ static void array_bucketindex_swap(void *p, void *q) /* {{{ */ PHP_FUNCTION(array_unique) { zval *array; - uint idx; + uint32_t idx; Bucket *p; struct bucketindex *arTmp, *cmpdata, *lastkept; unsigned int i; @@ -3862,7 +3862,7 @@ static int zval_user_compare(zval *a, zval *b) /* {{{ */ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_type) /* {{{ */ { - uint idx; + uint32_t idx; Bucket *p; int argc, i; zval *args; @@ -3963,7 +3963,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int zval *args = NULL; HashTable *hash; int arr_argc, i, c = 0; - uint idx; + uint32_t idx; Bucket **lists, *list, **ptrs, *p; uint32_t req_args; char *param_spec; @@ -4290,7 +4290,7 @@ PHP_FUNCTION(array_uintersect_uassoc) static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_type) /* {{{ */ { - uint idx; + uint32_t idx; Bucket *p; int argc, i; zval *args; @@ -4386,7 +4386,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ zval *args = NULL; HashTable *hash; int arr_argc, i, c; - uint idx; + uint32_t idx; Bucket **lists, *list, **ptrs, *p; uint32_t req_args; char *param_spec; @@ -4819,7 +4819,7 @@ PHP_FUNCTION(array_multisort) zval* args; zval** arrays; Bucket** indirect; - uint idx; + uint32_t idx; Bucket* p; HashTable* hash; int argc; diff --git a/ext/standard/assert.c b/ext/standard/assert.c index fe04f329e2..f05ff66f25 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -215,7 +215,7 @@ PHP_FUNCTION(assert) zval *args = safe_emalloc(!description ? 3 : 4, sizeof(zval), 0); zval retval; int i; - uint lineno = zend_get_executed_lineno(); + uint32_t lineno = zend_get_executed_lineno(); const char *filename = zend_get_executed_filename(); ZVAL_STRING(&args[0], SAFE_STRING(filename)); diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 9001d6dac3..a072ce7b2c 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -4633,7 +4633,7 @@ PHP_FUNCTION(get_cfg_var) return; } - retval = cfg_get_entry(varname, (uint)varname_len); + retval = cfg_get_entry(varname, (uint32_t)varname_len); if (retval) { if (Z_TYPE_P(retval) == IS_ARRAY) { @@ -5295,7 +5295,7 @@ PHP_FUNCTION(ini_get) return; } - str = zend_ini_string(varname, (uint)varname_len, 0); + str = zend_ini_string(varname, (uint32_t)varname_len, 0); if (!str) { RETURN_FALSE; diff --git a/ext/standard/dns.c b/ext/standard/dns.c index f92015eee9..6e194a8095 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -468,7 +468,7 @@ static u_char *php_parserr(u_char *cp, u_char *end, querybuf *answer, int type_t if (raw) { add_assoc_long(subarray, "type", type); - add_assoc_stringl(subarray, "data", (char*) cp, (uint) dlen); + add_assoc_stringl(subarray, "data", (char*) cp, (uint32_t) dlen); cp += dlen; return cp; } diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c index f28977ab6a..8808eecae4 100644 --- a/ext/standard/dns_win32.c +++ b/ext/standard/dns_win32.c @@ -164,7 +164,7 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw, if (raw) { add_assoc_long(subarray, "type", type); - add_assoc_stringl(subarray, "data", (char*) &pRec->Data, (uint) pRec->wDataLength); + add_assoc_stringl(subarray, "data", (char*) &pRec->Data, (uint32_t) pRec->wDataLength); return; } diff --git a/ext/standard/head.c b/ext/standard/head.c index eac9159ab9..b440b19226 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -46,7 +46,7 @@ PHP_FUNCTION(header) &len, &rep, &ctr.response_code) == FAILURE) return; - ctr.line_len = (uint)len; + ctr.line_len = (uint32_t)len; sapi_header_op(rep ? SAPI_HEADER_REPLACE:SAPI_HEADER_ADD, &ctr); } /* }}} */ @@ -62,7 +62,7 @@ PHP_FUNCTION(header_remove) &len) == FAILURE) return; - ctr.line_len = (uint)len; + ctr.line_len = (uint32_t)len; sapi_header_op(ZEND_NUM_ARGS() == 0 ? SAPI_HEADER_DELETE_ALL : SAPI_HEADER_DELETE, &ctr); } /* }}} */ @@ -174,7 +174,7 @@ PHPAPI int php_setcookie(zend_string *name, zend_string *value, time_t expires, } ctr.line = cookie; - ctr.line_len = (uint)strlen(cookie); + ctr.line_len = (uint32_t)strlen(cookie); result = sapi_header_op(SAPI_HEADER_ADD, &ctr); efree(cookie); diff --git a/ext/standard/info.c b/ext/standard/info.c index 38c537c119..221b85464a 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -188,7 +188,7 @@ static int _display_module_info_def(zval *el) /* {{{ */ /* {{{ php_print_gpcse_array */ -static void php_print_gpcse_array(char *name, uint name_length) +static void php_print_gpcse_array(char *name, uint32_t name_length) { zval *data, *tmp, tmp2; zend_string *string_key; diff --git a/ext/standard/mail.c b/ext/standard/mail.c index ad0110281e..fd05776787 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -413,7 +413,7 @@ void php_mail_log_to_syslog(char *message) { void php_mail_log_to_file(char *filename, char *message, size_t message_size) { /* Write 'message' to the given file. */ - uint flags = IGNORE_URL_WIN | REPORT_ERRORS | STREAM_DISABLE_OPEN_BASEDIR; + uint32_t flags = IGNORE_URL_WIN | REPORT_ERRORS | STREAM_DISABLE_OPEN_BASEDIR; php_stream *stream = php_stream_open_wrapper(filename, "a", flags, NULL); if (stream) { php_stream_write(stream, message, message_size); diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 2f178d9d99..b8294ed0e9 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -19,9 +19,9 @@ #if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__)) # define _BSD_SOURCE /* linux wants this when XOPEN mode is on */ -# define _BSD_COMPAT /* irix: uint */ +# define _BSD_COMPAT /* irix: uint32_t */ # define _XOPEN_SOURCE 500 /* turn on Unix98 */ -# define __EXTENSIONS__ 1 /* Solaris: uint */ +# define __EXTENSIONS__ 1 /* Solaris: uint32_t */ #endif #include "php.h" @@ -146,7 +146,7 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent zend_string_release(str); } ZEND_HASH_FOREACH_END(); - assert((uint)(p - env.envp) <= sizeenv); + assert((uint32_t)(p - env.envp) <= sizeenv); zend_hash_destroy(env_hash); FREE_HASHTABLE(env_hash); diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index f1dc6d27ae..100331e77e 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -1170,7 +1170,7 @@ static inline void php_url_scanner_session_handler_impl(char *output, size_t out if (ZSTR_LEN(url_state->url_app.s) != 0) { *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0), url_state); - if (sizeof(uint) < sizeof(size_t)) { + if (sizeof(uint32_t) < sizeof(size_t)) { if (len > UINT_MAX) len = UINT_MAX; } diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 7708306e3a..514aa6db82 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -618,7 +618,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil TidyBuffer buf; tidyBufInit(&buf); - tidyBufAttach(&buf, (byte *) ZSTR_VAL(data), (uint)ZSTR_LEN(data)); + tidyBufAttach(&buf, (byte *) ZSTR_VAL(data), (uint32_t)ZSTR_LEN(data)); if (tidyParseBuffer(doc, &buf) < 0) { php_error_docref(NULL, E_WARNING, "%s", errbuf->bp); @@ -1013,7 +1013,7 @@ static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options) return SUCCESS; } -static int php_tidy_parse_string(PHPTidyObj *obj, char *string, uint len, char *enc) +static int php_tidy_parse_string(PHPTidyObj *obj, char *string, uint32_t len, char *enc) { TidyBuffer buf; @@ -1179,7 +1179,7 @@ static int php_tidy_output_handler(void **nothing, php_output_context *output_co TIDY_SET_DEFAULT_CONFIG(doc); tidyBufInit(&inbuf); - tidyBufAttach(&inbuf, (byte *) output_context->in.data, (uint)output_context->in.used); + tidyBufAttach(&inbuf, (byte *) output_context->in.data, (uint32_t)output_context->in.used); if (0 <= tidyParseBuffer(doc, &inbuf) && 0 <= tidyCleanAndRepair(doc)) { tidyBufInit(&outbuf); @@ -1223,7 +1223,7 @@ static PHP_FUNCTION(tidy_parse_string) TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - if (php_tidy_parse_string(obj, ZSTR_VAL(input), (uint)ZSTR_LEN(input), enc) == FAILURE) { + if (php_tidy_parse_string(obj, ZSTR_VAL(input), (uint32_t)ZSTR_LEN(input), enc) == FAILURE) { zval_ptr_dtor(return_value); RETURN_FALSE; } @@ -1291,7 +1291,7 @@ static PHP_FUNCTION(tidy_parse_file) TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - if (php_tidy_parse_string(obj, ZSTR_VAL(contents), (uint)ZSTR_LEN(contents), enc) == FAILURE) { + if (php_tidy_parse_string(obj, ZSTR_VAL(contents), (uint32_t)ZSTR_LEN(contents), enc) == FAILURE) { zval_ptr_dtor(return_value); RETVAL_FALSE; } @@ -1609,7 +1609,7 @@ static TIDY_DOC_METHOD(__construct) TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - php_tidy_parse_string(obj, ZSTR_VAL(contents), (uint)ZSTR_LEN(contents), enc); + php_tidy_parse_string(obj, ZSTR_VAL(contents), (uint32_t)ZSTR_LEN(contents), enc); zend_string_release(contents); } @@ -1645,7 +1645,7 @@ static TIDY_DOC_METHOD(parseFile) TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - if (php_tidy_parse_string(obj, ZSTR_VAL(contents), (uint)ZSTR_LEN(contents), enc) == FAILURE) { + if (php_tidy_parse_string(obj, ZSTR_VAL(contents), (uint32_t)ZSTR_LEN(contents), enc) == FAILURE) { RETVAL_FALSE; } else { RETVAL_TRUE; @@ -1677,7 +1677,7 @@ static TIDY_DOC_METHOD(parseString) TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options); - if(php_tidy_parse_string(obj, ZSTR_VAL(input), (uint)ZSTR_LEN(input), enc) == SUCCESS) { + if(php_tidy_parse_string(obj, ZSTR_VAL(input), (uint32_t)ZSTR_LEN(input), enc) == SUCCESS) { RETURN_TRUE; } diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c index 782a1317ec..95e65230a8 100644 --- a/ext/xmlrpc/xmlrpc-epi-php.c +++ b/ext/xmlrpc/xmlrpc-epi-php.c @@ -328,7 +328,7 @@ static int add_string(zval* list, char* id, char* string) { else return add_next_index_string(list, string); } -static int add_stringl(zval* list, char* id, char* string, uint length) { +static int add_stringl(zval* list, char* id, char* string, uint32_t length) { if(id) return add_assoc_stringl(list, id, string, length); else return add_next_index_stringl(list, string, length); } diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 4685fb2486..af397001ef 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; - uint n; + uint32_t n; int ret; if (pattern_len >= MAXPATHLEN) { |