]> granicus.if.org Git - php/commitdiff
Finish remaining replacement uint => uint32_t
authorAnatol Belski <ab@php.net>
Thu, 22 Dec 2016 13:32:02 +0000 (14:32 +0100)
committerAnatol Belski <ab@php.net>
Thu, 22 Dec 2016 13:32:02 +0000 (14:32 +0100)
Tthe core should be normalized now, no uints anymore

14 files changed:
ext/mysqli/mysqli_nonapi.c
ext/soap/soap.c
ext/sockets/conversions.c
main/streams/filter.c
sapi/cli/php_cli_server.c
sapi/fpm/fpm/fpm_main.c
sapi/fpm/fpm/fpm_php_trace.c
sapi/litespeed/lsapi_main.c
sapi/phpdbg/phpdbg_bp.c
sapi/phpdbg/phpdbg_bp.h
sapi/phpdbg/phpdbg_list.c
sapi/phpdbg/phpdbg_list.h
sapi/phpdbg/phpdbg_prompt.c
win32/select.c

index e3efca25c6fbdb3068198037796e4c95b0d9a6c7..645967fecfa8f1aa0356b46eb27a58b4ee843b8c 100644 (file)
@@ -969,7 +969,7 @@ PHP_FUNCTION(mysqli_get_charset)
        MY_MYSQL                                *mysql;
        zval                                    *mysql_link;
        const char                              *name = NULL, *collation = NULL, *dir = NULL, *comment = NULL;
-       uint                                    minlength, maxlength, number, state;
+       uint32_t                                minlength, maxlength, number, state;
 #if !defined(MYSQLI_USE_MYSQLND)
        MY_CHARSET_INFO                 cs;
 #else
index 96f410f0e4cd81a459e454b52294a76fd31d8afb..c1a357681a1b10e7d96cb0e9c4a1492df446c038 100644 (file)
@@ -165,7 +165,7 @@ zend_class_entry* soap_var_class_entry;
 
 ZEND_DECLARE_MODULE_GLOBALS(soap)
 
-static void (*old_error_handler)(int, const char *, const uint, const char*, va_list);
+static void (*old_error_handler)(int, const char *, const uint32_t, const char*, va_list);
 
 #ifdef va_copy
 #define call_old_error_handler(error_num, error_filename, error_lineno, format, args) \
index 3162291b998ae3b642a75a76ce0a1160c9ca525f..093b6c5d72d7b9947570ae5e259e41d74f9db114 100644 (file)
@@ -1188,7 +1188,7 @@ static void to_zval_read_iov(const char *msghdr_c, zval *zv, res_context *ctx)
        size_t                          iovlen = msghdr->msg_iovlen;
        ssize_t                         *recvmsg_ret,
                                                bytes_left;
-       uint                            i;
+       uint32_t                        i;
 
        if (iovlen > UINT_MAX) {
                do_to_zval_err(ctx, "unexpectedly large value for iov_len: %lu",
index 71b06aa7c890bc93dcc9a76bfc16288474fd6f73..7123a680ae80faa6799d012703488edcec8e24fc 100644 (file)
@@ -358,7 +358,7 @@ PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_strea
                php_stream_bucket_append(brig_inp, bucket);
                status = filter->fops->filter(stream, filter, brig_inp, brig_outp, &consumed, PSFS_FLAG_NORMAL);
 
-               if (stream->readpos + consumed > (uint)stream->writepos) {
+               if (stream->readpos + consumed > (uint32_t)stream->writepos) {
                        /* No behaving filter should cause this. */
                        status = PSFS_ERR_FATAL;
                }
index 0853db99bb8c02993cdb20437d9b99c7bc3bc266..ac4dcb8b9acb5011c95b2bfb544222019daf31f0 100644 (file)
@@ -410,7 +410,7 @@ static void add_response_header(sapi_header_struct *h, zval *return_value) /* {{
                                do {
                                        p++;
                                } while (*p == ' ' || *p == '\t');
-                               add_assoc_stringl_ex(return_value, s, (uint)len, p, h->header_len - (p - h->header));
+                               add_assoc_stringl_ex(return_value, s, (uint32_t)len, p, h->header_len - (p - h->header));
                                free_alloca(s, use_heap);
                        }
                }
@@ -604,7 +604,7 @@ static int sapi_cli_server_register_entry_cb(char **entry, int num_args, va_list
        zval *track_vars_array = va_arg(args, zval *);
        if (hash_key->key) {
                char *real_key, *key;
-               uint i;
+               uint32_t i;
                key = estrndup(ZSTR_VAL(hash_key->key), ZSTR_LEN(hash_key->key));
                for(i=0; i<ZSTR_LEN(hash_key->key); i++) {
                        if (key[i] == '-') {
@@ -1458,7 +1458,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
        }
 #ifdef PHP_WIN32
        {
-               uint i = 0;
+               uint32_t i = 0;
                for (;i<request->vpath_len;i++) {
                        if (request->vpath[i] == '\\') {
                                request->vpath[i] = '/';
index 676811359c0e848198a730b0e7da62255f47bf2f..2ed2d34f879154b57a90e0a7105589801f3a820d 100644 (file)
@@ -280,7 +280,7 @@ static void print_extensions(void) /* {{{ */
 #define STDOUT_FILENO 1
 #endif
 
-static inline size_t sapi_cgibin_single_write(const char *str, uint str_length) /* {{{ */
+static inline size_t sapi_cgibin_single_write(const char *str, uint32_t str_length) /* {{{ */
 {
        ssize_t ret;
 
@@ -310,7 +310,7 @@ static inline size_t sapi_cgibin_single_write(const char *str, uint str_length)
 static size_t sapi_cgibin_ub_write(const char *str, size_t str_length) /* {{{ */
 {
        const char *ptr = str;
-       uint remaining = str_length;
+       uint32_t remaining = str_length;
        size_t ret;
 
        while (remaining > 0) {
@@ -473,7 +473,7 @@ void fcgi_log(int type, const char *fmt, ...)
 
 static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes) /* {{{ */
 {
-       uint read_bytes = 0;
+       uint32_t read_bytes = 0;
        int tmp_read_bytes;
        size_t remaining = SG(request_info).content_length - SG(read_post_bytes);
 
@@ -745,7 +745,7 @@ static int sapi_cgi_activate(void) /* {{{ */
 {
        fcgi_request *request = (fcgi_request*) SG(server_context);
        char *path, *doc_root, *server_name;
-       uint path_len, doc_root_len, server_name_len;
+       uint32_t path_len, doc_root_len, server_name_len;
 
        /* PATH_TRANSLATED should be defined at this stage but better safe than sorry :) */
        if (!SG(request_info).path_translated) {
index e6482b63806e8c44e86a4d9e043a86c73892f0c4..b02d5277f40be06d90149f22c7e59bc8411ed55d 100644 (file)
@@ -80,7 +80,7 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog) /* {{{ *
                long function_name;
                long file_name;
                long prev;
-               uint lineno = 0;
+               uint32_t lineno = 0;
 
                if (0 > fpm_trace_get_long(execute_data + offsetof(zend_execute_data, func), &l)) {
                        return -1;
index 730070fd387ac6341782a8b8af2e09b6ce5d1d3b..588a14518ac50867208000cbafec7ccd41393517 100644 (file)
@@ -687,7 +687,7 @@ static void walk_down_the_path(char* path_start,
 
 typedef struct {
     char *path;
-    uint path_len;
+    uint32_t path_len;
     char *doc_root;
     user_config_cache_entry *entry;
 } _lsapi_activate_user_ini_ctx;
@@ -816,7 +816,7 @@ static int lsapi_activate_user_ini_walk_down_the_path(_lsapi_activate_user_ini_c
                                                       void* next)
 {
     time_t request_time = sapi_get_request_time();
-    uint path_len, docroot_len;
+    uint32_t path_len, docroot_len;
     int rc = SUCCESS;
     fn_activate_user_ini_chain_t *fn_next = next;
 
index c7e36d6da9f00b1bb3d225964cfa3ad3d089ce4f..fd5589c0d1372367e4b58e5e17b939d38809abee 100644 (file)
@@ -324,7 +324,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, size_t path_len, lo
        zend_string_release(path_str);
 } /* }}} */
 
-PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht) /* {{{ */
+PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint32_t filelen, zend_string *cur, HashTable *fileht) /* {{{ */
 {
        phpdbg_debug("file: %s, filelen: %u, cur: %s, curlen %u, pos: %c, memcmp: %d\n", file, filelen, ZSTR_VAL(cur), ZSTR_LEN(cur), filelen > ZSTR_LEN(cur) ? file[filelen - ZSTR_LEN(cur) - 1] : '?', filelen > ZSTR_LEN(cur) ? memcmp(file + filelen - ZSTR_LEN(cur), ZSTR_VAL(cur), ZSTR_LEN(cur)) : 0);
 
@@ -373,7 +373,7 @@ PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uin
 PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file) /* {{{ */
 {
        HashTable *fileht;
-       uint filelen = strlen(file);
+       uint32_t filelen = strlen(file);
        zend_string *cur;
 
        phpdbg_debug("was compiled: %s\n", file);
index 7daafe48c1a197ecb5b2bbe528394e161a305d2b..4a1f6434bca71d4521e11daf5434d409f3f84573 100644 (file)
@@ -121,7 +121,7 @@ typedef struct _phpdbg_breakcond_t {
 PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array);
 PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array);
 PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break);
-PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht);
+PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint32_t filelen, zend_string *cur, HashTable *fileht);
 PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file); /* }}} */
 
 /* {{{ Breakpoint Creation API */
index a1138b4517f2f02cae4febfa877d3a2cb247054f..2219198cfe4db7eb8e38c90f2d7f2129b3579acf 100644 (file)
@@ -129,9 +129,9 @@ PHPDBG_LIST(class) /* {{{ */
        return SUCCESS;
 } /* }}} */
 
-void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highlight) /* {{{ */
+void phpdbg_list_file(zend_string *filename, uint32_t count, int offset, uint32_t highlight) /* {{{ */
 {
-       uint line, lastline;
+       uint32_t line, lastline;
        phpdbg_file_source *data;
 
        if (!(data = zend_hash_find_ptr(&PHPDBG_G(file_sources), filename))) {
@@ -153,8 +153,8 @@ void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highli
        phpdbg_xml("<list %r file=\"%s\">", ZSTR_VAL(filename));
 
        for (line = offset; line < lastline;) {
-               uint linestart = data->line[line++];
-               uint linelen = data->line[line] - linestart;
+               uint32_t linestart = data->line[line++];
+               uint32_t linelen = data->line[line] - linestart;
                char *buffer = data->buf + linestart;
 
                if (!highlight) {
@@ -237,7 +237,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
        zend_file_handle fake;
        zend_op_array *ret;
        char *filename;
-       uint line;
+       uint32_t line;
        char *bufptr, *endptr;
 
        if (zend_stream_fixup(file, &bufptr, &data.len) == FAILURE) {
@@ -261,11 +261,11 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
        fake.filename = filename;
        fake.opened_path = file->opened_path;
 
-       *(dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint) * data.len)) = data;
+       *(dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint32_t) * data.len)) = data;
 
        for (line = 0, bufptr = data.buf - 1, endptr = data.buf + data.len; ++bufptr < endptr;) {
                if (*bufptr == '\n') {
-                       dataptr->line[++line] = (uint)(bufptr - data.buf) + 1;
+                       dataptr->line[++line] = (uint32_t)(bufptr - data.buf) + 1;
                }
        }
        dataptr->lines = ++line;
@@ -283,7 +283,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
                return NULL;
        }
 
-       dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint) * line);
+       dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint32_t) * line);
        zend_hash_add_ptr(&PHPDBG_G(file_sources), ret->filename, dataptr);
        phpdbg_resolve_pending_file_break(ZSTR_VAL(ret->filename));
 
@@ -335,20 +335,20 @@ zend_op_array *phpdbg_compile_string(zval *source_string, char *filename) {
        zend_string *fake_name;
        zend_op_array *op_array;
        phpdbg_file_source *dataptr;
-       uint line;
+       uint32_t line;
        char *bufptr, *endptr;
 
        if (PHPDBG_G(flags) & PHPDBG_IN_EVAL) {
                return PHPDBG_G(compile_string)(source_string, filename);
        }
 
-       dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint) * Z_STRLEN_P(source_string));
+       dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint32_t) * Z_STRLEN_P(source_string));
        dataptr->buf = estrndup(Z_STRVAL_P(source_string), Z_STRLEN_P(source_string));
        dataptr->len = Z_STRLEN_P(source_string);
        dataptr->line[0] = 0;
        for (line = 0, bufptr = dataptr->buf - 1, endptr = dataptr->buf + dataptr->len; ++bufptr < endptr;) {
                if (*bufptr == '\n') {
-                       dataptr->line[++line] = (uint)(bufptr - dataptr->buf) + 1;
+                       dataptr->line[++line] = (uint32_t)(bufptr - dataptr->buf) + 1;
                }
        }
        dataptr->lines = ++line;
@@ -364,7 +364,7 @@ zend_op_array *phpdbg_compile_string(zval *source_string, char *filename) {
 
        fake_name = strpprintf(0, "%s%c%p", filename, 0, op_array->opcodes);
 
-       dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint) * line);
+       dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint32_t) * line);
        zend_hash_add_ptr(&PHPDBG_G(file_sources), fake_name, dataptr);
 
        zend_string_release(fake_name);
index 9adb69b6c91f828c9026eb5c1c4e1f04ccaf60f1..2768a42dddfff2de35be2893bc7c9652be295cb8 100644 (file)
@@ -34,7 +34,7 @@ PHPDBG_LIST(func);
 
 void phpdbg_list_function_byname(const char *, size_t);
 void phpdbg_list_function(const zend_function *);
-void phpdbg_list_file(zend_string *, uint, int, uint);
+void phpdbg_list_file(zend_string *, uint32_t, int, uint32_t);
 
 extern const phpdbg_command_t phpdbg_list_commands[];
 
@@ -48,8 +48,8 @@ typedef struct {
        void *map;
 #endif
        zend_op_array op_array;
-       uint lines;
-       uint line[1];
+       uint32_t lines;
+       uint32_t line[1];
 } phpdbg_file_source;
 
 #endif /* PHPDBG_LIST_H */
index ce8945ac6ad53bb7034c8543068c3031e5086549..a96563352d1a0ce961a9d99f7615970332b10191 100644 (file)
@@ -608,11 +608,11 @@ int phpdbg_compile(void) /* {{{ */
                        zend_hash_del(&PHPDBG_G(file_sources), PHPDBG_G(ops)->filename);
                        PHPDBG_G(file_sources).pDestructor = dtor;
 
-                       data = erealloc(data, sizeof(phpdbg_file_source) + sizeof(uint) * ++data->lines);
-                       memmove(data->line + 1, data->line, sizeof(uint) * data->lines);
+                       data = erealloc(data, sizeof(phpdbg_file_source) + sizeof(uint32_t) * ++data->lines);
+                       memmove(data->line + 1, data->line, sizeof(uint32_t) * data->lines);
                        data->line[0] = 0;
                        data->buf = erealloc(data->buf, data->len + start_line_len);
-                       memmove(data->buf + start_line_len, data->buf, data->len * sizeof(uint));
+                       memmove(data->buf + start_line_len, data->buf, data->len * sizeof(uint32_t));
                        memcpy(data->buf, start_line, start_line_len);
                        efree(start_line);
                        data->len += start_line_len;
index 8ab964fe03a40b5377d3d2b2c0c0134d169f568c..28534caaf635d3ca175590c744d9f1dec160293c 100644 (file)
@@ -67,13 +67,13 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru
                        if (handles[n_handles] == INVALID_HANDLE_VALUE) {
                                /* socket */
                                if (SAFE_FD_ISSET(i, rfds)) {
-                                       FD_SET((uint)i, &sock_read);
+                                       FD_SET((uint32_t)i, &sock_read);
                                }
                                if (SAFE_FD_ISSET(i, wfds)) {
-                                       FD_SET((uint)i, &sock_write);
+                                       FD_SET((uint32_t)i, &sock_write);
                                }
                                if (SAFE_FD_ISSET(i, efds)) {
-                                       FD_SET((uint)i, &sock_except);
+                                       FD_SET((uint32_t)i, &sock_except);
                                }
                                if (i > sock_max_fd) {
                                        sock_max_fd = i;
@@ -136,13 +136,13 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru
                                for (i = 0; i < n_handles; i++) {
                                        if (WAIT_OBJECT_0 == WaitForSingleObject(handles[i], 0)) {
                                                if (SAFE_FD_ISSET(handle_slot_to_fd[i], rfds)) {
-                                                       FD_SET((uint)handle_slot_to_fd[i], &aread);
+                                                       FD_SET((uint32_t)handle_slot_to_fd[i], &aread);
                                                }
                                                if (SAFE_FD_ISSET(handle_slot_to_fd[i], wfds)) {
-                                                       FD_SET((uint)handle_slot_to_fd[i], &awrite);
+                                                       FD_SET((uint32_t)handle_slot_to_fd[i], &awrite);
                                                }
                                                if (SAFE_FD_ISSET(handle_slot_to_fd[i], efds)) {
-                                                       FD_SET((uint)handle_slot_to_fd[i], &aexcept);
+                                                       FD_SET((uint32_t)handle_slot_to_fd[i], &aexcept);
                                                }
                                                retcode++;
                                        }