Skip to content

Commit afb6ca2

Browse files
committed
Finish remaining replacement uint => uint32_t
Tthe core should be normalized now, no uints anymore
1 parent ce97ead commit afb6ca2

File tree

14 files changed

+41
-41
lines changed

14 files changed

+41
-41
lines changed

ext/mysqli/mysqli_nonapi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ PHP_FUNCTION(mysqli_get_charset)
969969
MY_MYSQL *mysql;
970970
zval *mysql_link;
971971
const char *name = NULL, *collation = NULL, *dir = NULL, *comment = NULL;
972-
uint minlength, maxlength, number, state;
972+
uint32_t minlength, maxlength, number, state;
973973
#if !defined(MYSQLI_USE_MYSQLND)
974974
MY_CHARSET_INFO cs;
975975
#else

ext/soap/soap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ zend_class_entry* soap_var_class_entry;
165165

166166
ZEND_DECLARE_MODULE_GLOBALS(soap)
167167

168-
static void (*old_error_handler)(int, const char *, const uint, const char*, va_list);
168+
static void (*old_error_handler)(int, const char *, const uint32_t, const char*, va_list);
169169

170170
#ifdef va_copy
171171
#define call_old_error_handler(error_num, error_filename, error_lineno, format, args) \

ext/sockets/conversions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ static void to_zval_read_iov(const char *msghdr_c, zval *zv, res_context *ctx)
11881188
size_t iovlen = msghdr->msg_iovlen;
11891189
ssize_t *recvmsg_ret,
11901190
bytes_left;
1191-
uint i;
1191+
uint32_t i;
11921192

11931193
if (iovlen > UINT_MAX) {
11941194
do_to_zval_err(ctx, "unexpectedly large value for iov_len: %lu",

main/streams/filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ PHPAPI int php_stream_filter_append_ex(php_stream_filter_chain *chain, php_strea
358358
php_stream_bucket_append(brig_inp, bucket);
359359
status = filter->fops->filter(stream, filter, brig_inp, brig_outp, &consumed, PSFS_FLAG_NORMAL);
360360

361-
if (stream->readpos + consumed > (uint)stream->writepos) {
361+
if (stream->readpos + consumed > (uint32_t)stream->writepos) {
362362
/* No behaving filter should cause this. */
363363
status = PSFS_ERR_FATAL;
364364
}

sapi/cli/php_cli_server.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ static void add_response_header(sapi_header_struct *h, zval *return_value) /* {{
410410
do {
411411
p++;
412412
} while (*p == ' ' || *p == '\t');
413-
add_assoc_stringl_ex(return_value, s, (uint)len, p, h->header_len - (p - h->header));
413+
add_assoc_stringl_ex(return_value, s, (uint32_t)len, p, h->header_len - (p - h->header));
414414
free_alloca(s, use_heap);
415415
}
416416
}
@@ -604,7 +604,7 @@ static int sapi_cli_server_register_entry_cb(char **entry, int num_args, va_list
604604
zval *track_vars_array = va_arg(args, zval *);
605605
if (hash_key->key) {
606606
char *real_key, *key;
607-
uint i;
607+
uint32_t i;
608608
key = estrndup(ZSTR_VAL(hash_key->key), ZSTR_LEN(hash_key->key));
609609
for(i=0; i<ZSTR_LEN(hash_key->key); i++) {
610610
if (key[i] == '-') {
@@ -1458,7 +1458,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
14581458
}
14591459
#ifdef PHP_WIN32
14601460
{
1461-
uint i = 0;
1461+
uint32_t i = 0;
14621462
for (;i<request->vpath_len;i++) {
14631463
if (request->vpath[i] == '\\') {
14641464
request->vpath[i] = '/';

sapi/fpm/fpm/fpm_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ static void print_extensions(void) /* {{{ */
280280
#define STDOUT_FILENO 1
281281
#endif
282282

283-
static inline size_t sapi_cgibin_single_write(const char *str, uint str_length) /* {{{ */
283+
static inline size_t sapi_cgibin_single_write(const char *str, uint32_t str_length) /* {{{ */
284284
{
285285
ssize_t ret;
286286

@@ -310,7 +310,7 @@ static inline size_t sapi_cgibin_single_write(const char *str, uint str_length)
310310
static size_t sapi_cgibin_ub_write(const char *str, size_t str_length) /* {{{ */
311311
{
312312
const char *ptr = str;
313-
uint remaining = str_length;
313+
uint32_t remaining = str_length;
314314
size_t ret;
315315

316316
while (remaining > 0) {
@@ -473,7 +473,7 @@ void fcgi_log(int type, const char *fmt, ...)
473473

474474
static size_t sapi_cgi_read_post(char *buffer, size_t count_bytes) /* {{{ */
475475
{
476-
uint read_bytes = 0;
476+
uint32_t read_bytes = 0;
477477
int tmp_read_bytes;
478478
size_t remaining = SG(request_info).content_length - SG(read_post_bytes);
479479

@@ -745,7 +745,7 @@ static int sapi_cgi_activate(void) /* {{{ */
745745
{
746746
fcgi_request *request = (fcgi_request*) SG(server_context);
747747
char *path, *doc_root, *server_name;
748-
uint path_len, doc_root_len, server_name_len;
748+
uint32_t path_len, doc_root_len, server_name_len;
749749

750750
/* PATH_TRANSLATED should be defined at this stage but better safe than sorry :) */
751751
if (!SG(request_info).path_translated) {

sapi/fpm/fpm/fpm_php_trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog) /* {{{ *
8080
long function_name;
8181
long file_name;
8282
long prev;
83-
uint lineno = 0;
83+
uint32_t lineno = 0;
8484

8585
if (0 > fpm_trace_get_long(execute_data + offsetof(zend_execute_data, func), &l)) {
8686
return -1;

sapi/litespeed/lsapi_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ static void walk_down_the_path(char* path_start,
687687

688688
typedef struct {
689689
char *path;
690-
uint path_len;
690+
uint32_t path_len;
691691
char *doc_root;
692692
user_config_cache_entry *entry;
693693
} _lsapi_activate_user_ini_ctx;
@@ -816,7 +816,7 @@ static int lsapi_activate_user_ini_walk_down_the_path(_lsapi_activate_user_ini_c
816816
void* next)
817817
{
818818
time_t request_time = sapi_get_request_time();
819-
uint path_len, docroot_len;
819+
uint32_t path_len, docroot_len;
820820
int rc = SUCCESS;
821821
fn_activate_user_ini_chain_t *fn_next = next;
822822

sapi/phpdbg/phpdbg_bp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, size_t path_len, lo
324324
zend_string_release(path_str);
325325
} /* }}} */
326326

327-
PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht) /* {{{ */
327+
PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint32_t filelen, zend_string *cur, HashTable *fileht) /* {{{ */
328328
{
329329
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);
330330

@@ -373,7 +373,7 @@ PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uin
373373
PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file) /* {{{ */
374374
{
375375
HashTable *fileht;
376-
uint filelen = strlen(file);
376+
uint32_t filelen = strlen(file);
377377
zend_string *cur;
378378

379379
phpdbg_debug("was compiled: %s\n", file);

sapi/phpdbg/phpdbg_bp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ typedef struct _phpdbg_breakcond_t {
121121
PHPDBG_API void phpdbg_resolve_op_array_breaks(zend_op_array *op_array);
122122
PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_op_array *op_array);
123123
PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break);
124-
PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint filelen, zend_string *cur, HashTable *fileht);
124+
PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uint32_t filelen, zend_string *cur, HashTable *fileht);
125125
PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file); /* }}} */
126126

127127
/* {{{ Breakpoint Creation API */

sapi/phpdbg/phpdbg_list.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ PHPDBG_LIST(class) /* {{{ */
129129
return SUCCESS;
130130
} /* }}} */
131131

132-
void phpdbg_list_file(zend_string *filename, uint count, int offset, uint highlight) /* {{{ */
132+
void phpdbg_list_file(zend_string *filename, uint32_t count, int offset, uint32_t highlight) /* {{{ */
133133
{
134-
uint line, lastline;
134+
uint32_t line, lastline;
135135
phpdbg_file_source *data;
136136

137137
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
153153
phpdbg_xml("<list %r file=\"%s\">", ZSTR_VAL(filename));
154154

155155
for (line = offset; line < lastline;) {
156-
uint linestart = data->line[line++];
157-
uint linelen = data->line[line] - linestart;
156+
uint32_t linestart = data->line[line++];
157+
uint32_t linelen = data->line[line] - linestart;
158158
char *buffer = data->buf + linestart;
159159

160160
if (!highlight) {
@@ -237,7 +237,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
237237
zend_file_handle fake;
238238
zend_op_array *ret;
239239
char *filename;
240-
uint line;
240+
uint32_t line;
241241
char *bufptr, *endptr;
242242

243243
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) {
261261
fake.filename = filename;
262262
fake.opened_path = file->opened_path;
263263

264-
*(dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint) * data.len)) = data;
264+
*(dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint32_t) * data.len)) = data;
265265

266266
for (line = 0, bufptr = data.buf - 1, endptr = data.buf + data.len; ++bufptr < endptr;) {
267267
if (*bufptr == '\n') {
268-
dataptr->line[++line] = (uint)(bufptr - data.buf) + 1;
268+
dataptr->line[++line] = (uint32_t)(bufptr - data.buf) + 1;
269269
}
270270
}
271271
dataptr->lines = ++line;
@@ -283,7 +283,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
283283
return NULL;
284284
}
285285

286-
dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint) * line);
286+
dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint32_t) * line);
287287
zend_hash_add_ptr(&PHPDBG_G(file_sources), ret->filename, dataptr);
288288
phpdbg_resolve_pending_file_break(ZSTR_VAL(ret->filename));
289289

@@ -335,20 +335,20 @@ zend_op_array *phpdbg_compile_string(zval *source_string, char *filename) {
335335
zend_string *fake_name;
336336
zend_op_array *op_array;
337337
phpdbg_file_source *dataptr;
338-
uint line;
338+
uint32_t line;
339339
char *bufptr, *endptr;
340340

341341
if (PHPDBG_G(flags) & PHPDBG_IN_EVAL) {
342342
return PHPDBG_G(compile_string)(source_string, filename);
343343
}
344344

345-
dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint) * Z_STRLEN_P(source_string));
345+
dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint32_t) * Z_STRLEN_P(source_string));
346346
dataptr->buf = estrndup(Z_STRVAL_P(source_string), Z_STRLEN_P(source_string));
347347
dataptr->len = Z_STRLEN_P(source_string);
348348
dataptr->line[0] = 0;
349349
for (line = 0, bufptr = dataptr->buf - 1, endptr = dataptr->buf + dataptr->len; ++bufptr < endptr;) {
350350
if (*bufptr == '\n') {
351-
dataptr->line[++line] = (uint)(bufptr - dataptr->buf) + 1;
351+
dataptr->line[++line] = (uint32_t)(bufptr - dataptr->buf) + 1;
352352
}
353353
}
354354
dataptr->lines = ++line;
@@ -364,7 +364,7 @@ zend_op_array *phpdbg_compile_string(zval *source_string, char *filename) {
364364

365365
fake_name = strpprintf(0, "%s%c%p", filename, 0, op_array->opcodes);
366366

367-
dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint) * line);
367+
dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint32_t) * line);
368368
zend_hash_add_ptr(&PHPDBG_G(file_sources), fake_name, dataptr);
369369

370370
zend_string_release(fake_name);

sapi/phpdbg/phpdbg_list.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ PHPDBG_LIST(func);
3434

3535
void phpdbg_list_function_byname(const char *, size_t);
3636
void phpdbg_list_function(const zend_function *);
37-
void phpdbg_list_file(zend_string *, uint, int, uint);
37+
void phpdbg_list_file(zend_string *, uint32_t, int, uint32_t);
3838

3939
extern const phpdbg_command_t phpdbg_list_commands[];
4040

@@ -48,8 +48,8 @@ typedef struct {
4848
void *map;
4949
#endif
5050
zend_op_array op_array;
51-
uint lines;
52-
uint line[1];
51+
uint32_t lines;
52+
uint32_t line[1];
5353
} phpdbg_file_source;
5454

5555
#endif /* PHPDBG_LIST_H */

sapi/phpdbg/phpdbg_prompt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,11 +608,11 @@ int phpdbg_compile(void) /* {{{ */
608608
zend_hash_del(&PHPDBG_G(file_sources), PHPDBG_G(ops)->filename);
609609
PHPDBG_G(file_sources).pDestructor = dtor;
610610

611-
data = erealloc(data, sizeof(phpdbg_file_source) + sizeof(uint) * ++data->lines);
612-
memmove(data->line + 1, data->line, sizeof(uint) * data->lines);
611+
data = erealloc(data, sizeof(phpdbg_file_source) + sizeof(uint32_t) * ++data->lines);
612+
memmove(data->line + 1, data->line, sizeof(uint32_t) * data->lines);
613613
data->line[0] = 0;
614614
data->buf = erealloc(data->buf, data->len + start_line_len);
615-
memmove(data->buf + start_line_len, data->buf, data->len * sizeof(uint));
615+
memmove(data->buf + start_line_len, data->buf, data->len * sizeof(uint32_t));
616616
memcpy(data->buf, start_line, start_line_len);
617617
efree(start_line);
618618
data->len += start_line_len;

win32/select.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru
6767
if (handles[n_handles] == INVALID_HANDLE_VALUE) {
6868
/* socket */
6969
if (SAFE_FD_ISSET(i, rfds)) {
70-
FD_SET((uint)i, &sock_read);
70+
FD_SET((uint32_t)i, &sock_read);
7171
}
7272
if (SAFE_FD_ISSET(i, wfds)) {
73-
FD_SET((uint)i, &sock_write);
73+
FD_SET((uint32_t)i, &sock_write);
7474
}
7575
if (SAFE_FD_ISSET(i, efds)) {
76-
FD_SET((uint)i, &sock_except);
76+
FD_SET((uint32_t)i, &sock_except);
7777
}
7878
if (i > sock_max_fd) {
7979
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
136136
for (i = 0; i < n_handles; i++) {
137137
if (WAIT_OBJECT_0 == WaitForSingleObject(handles[i], 0)) {
138138
if (SAFE_FD_ISSET(handle_slot_to_fd[i], rfds)) {
139-
FD_SET((uint)handle_slot_to_fd[i], &aread);
139+
FD_SET((uint32_t)handle_slot_to_fd[i], &aread);
140140
}
141141
if (SAFE_FD_ISSET(handle_slot_to_fd[i], wfds)) {
142-
FD_SET((uint)handle_slot_to_fd[i], &awrite);
142+
FD_SET((uint32_t)handle_slot_to_fd[i], &awrite);
143143
}
144144
if (SAFE_FD_ISSET(handle_slot_to_fd[i], efds)) {
145-
FD_SET((uint)handle_slot_to_fd[i], &aexcept);
145+
FD_SET((uint32_t)handle_slot_to_fd[i], &aexcept);
146146
}
147147
retcode++;
148148
}

0 commit comments

Comments
 (0)