Skip to content

Commit 159cd69

Browse files
committed
Fixed compiler warnings in main/
1 parent a12f6d9 commit 159cd69

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

main/SAPI.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,6 @@ static void sapi_header_add_op(sapi_header_op_enum op, sapi_header_struct *sapi_
570570

571571
SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
572572
{
573-
int retval;
574573
sapi_header_struct sapi_header;
575574
char *colon_offset;
576575
long myuid = 0L;

main/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ void php_request_shutdown(void *dummy)
16211621
zend_bool send_buffer = SG(request_info).headers_only ? 0 : 1;
16221622

16231623
if (CG(unclean_shutdown) && PG(last_error_type) == E_ERROR &&
1624-
PG(memory_limit) < zend_memory_usage(1 TSRMLS_CC)
1624+
(size_t)PG(memory_limit) < zend_memory_usage(1 TSRMLS_CC)
16251625
) {
16261626
send_buffer = 0;
16271627
}

main/rfc1867.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
769769
int fd = -1;
770770
zend_llist header;
771771
void *event_extra_data = NULL;
772-
int llen = 0;
772+
unsigned int llen = 0;
773773
int upload_cnt = INI_INT("max_file_uploads");
774774

775775
if (SG(post_max_size) > 0 && SG(request_info).content_length > SG(post_max_size)) {
@@ -1066,12 +1066,12 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
10661066
}
10671067
}
10681068

1069-
if (PG(upload_max_filesize) > 0 && (total_bytes+blen) > PG(upload_max_filesize)) {
1069+
if (PG(upload_max_filesize) > 0 && (long)(total_bytes+blen) > PG(upload_max_filesize)) {
10701070
#if DEBUG_FILE_UPLOAD
10711071
sapi_module.sapi_error(E_NOTICE, "upload_max_filesize of %ld bytes exceeded - file [%s=%s] not saved", PG(upload_max_filesize), param, filename);
10721072
#endif
10731073
cancel_upload = UPLOAD_ERROR_A;
1074-
} else if (max_file_size && ((total_bytes+blen) > max_file_size)) {
1074+
} else if (max_file_size && ((long)(total_bytes+blen) > max_file_size)) {
10751075
#if DEBUG_FILE_UPLOAD
10761076
sapi_module.sapi_error(E_NOTICE, "MAX_FILE_SIZE of %ld bytes exceeded - file [%s=%s] not saved", max_file_size, param, filename);
10771077
#endif

main/snprintf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ static void strx_printv(int *ccp, char *buf, size_t len, const char *format, va_
12201220

12211221
PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) /* {{{ */
12221222
{
1223-
int cc;
1223+
unsigned int cc;
12241224
va_list ap;
12251225

12261226
va_start(ap, format);
@@ -1236,7 +1236,7 @@ PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) /* {{{
12361236

12371237
PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list ap) /* {{{ */
12381238
{
1239-
int cc;
1239+
unsigned int cc;
12401240

12411241
strx_printv(&cc, buf, len, format, ap);
12421242
if (cc >= len) {

main/streams/glob_wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static size_t php_glob_stream_read(php_stream *stream, char *buf, size_t count T
144144

145145
/* avoid problems if someone mis-uses the stream */
146146
if (count == sizeof(php_stream_dirent) && pglob) {
147-
if (pglob->index < pglob->glob.gl_pathc) {
147+
if (pglob->index < (size_t)pglob->glob.gl_pathc) {
148148
php_glob_stream_path_split(pglob, pglob->glob.gl_pathv[pglob->index++], pglob->flags & GLOB_APPEND, &path TSRMLS_CC);
149149
PHP_STRLCPY(ent->d_name, path, sizeof(ent->d_name), strlen(path));
150150
return sizeof(php_stream_dirent);

0 commit comments

Comments
 (0)