com php-src: Kill compiler warnings in ext/phar: ext/phar/phar.c ext/phar/phar_object.c ext/phar/zip.c
| From: | Kalle Sommer Nielsen | Date: | Thu, 24 Aug 2017 00:31:52 +0000 |
| Subject: | com php-src: Kill compiler warnings in ext/phar: ext/phar/phar.c ext/phar/phar_object.c ext/phar/zip.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99137@lists.php.net to get a copy of this message | ||
Commit: cf1d42e0015108323365f5253b0cbe4e1fbc3eea
Author: Kalle Sommer Nielsen <kalle@php.net> Thu, 24 Aug 2017 02:31:52 +0200
Parents: 4fbff82c1079f2c48c769c94f0d9269be7508a59
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cf1d42e0015108323365f5253b0cbe4e1fbc3eea
Log:
Kill compiler warnings in ext/phar
Changed paths:
M ext/phar/phar.c
M ext/phar/phar_object.c
M ext/phar/zip.c
Diff:
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 5ff239f..34ba5c6 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -2202,9 +2202,9 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int
*a
ext_len = 0;
#ifdef PHP_WIN32
- save = filename;
+ save = (char *)filename;
filename = estrndup(filename, filename_len);
- phar_unixify_path_separators(filename, filename_len);
+ phar_unixify_path_separators((char *)filename, filename_len);
#endif
if (phar_detect_phar_fname_ext(filename, filename_len, &ext_str, &ext_len, executable,
for_create, 0) == FAILURE) {
if (ext_len != -1) {
@@ -2218,7 +2218,7 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int
*a
}
#ifdef PHP_WIN32
- efree(filename);
+ efree((char *)filename);
#endif
return FAILURE;
}
@@ -2243,7 +2243,7 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int
*a
}
#ifdef PHP_WIN32
- efree(filename);
+ efree((char *)filename);
#endif
return SUCCESS;
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index af4ccba..4642324 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -67,7 +67,7 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char
if (NULL != (stuff = zend_hash_str_find(_SERVER, "PATH_INFO",
sizeof("PATH_INFO")-1))) {
path_info = Z_STRVAL_P(stuff);
code = Z_STRLEN_P(stuff);
- if (code > entry_len && !memcmp(path_info, entry, entry_len)) {
+ if (code > (size_t)entry_len && !memcmp(path_info, entry, entry_len)) {
ZVAL_STR(&temp, Z_STR_P(stuff));
ZVAL_STRINGL(stuff, path_info + entry_len, request_uri_len);
zend_hash_str_update(_SERVER, "PHAR_PATH_INFO", sizeof("PHAR_PATH_INFO")-1,
&temp);
diff --git a/ext/phar/zip.c b/ext/phar/zip.c
index 08417bc..573de4f 100644
--- a/ext/phar/zip.c
+++ b/ext/phar/zip.c
@@ -167,7 +167,7 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias,
{
phar_zip_dir_end locator;
char buf[sizeof(locator) + 65536];
- size_t size;
+ zend_off_t size;
uint16_t i;
phar_archive_data *mydata = NULL;
phar_entry_info entry = {0};
@@ -199,7 +199,7 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias,
}
while ((p=(char *) memchr(p + 1, 'P', (size_t) (size - (p + 1 - buf)))) != NULL) {
- if ((p - buf) + sizeof(locator) <= size && !memcmp(p + 1, "K\5\6", 3)) {
+ if ((p - buf) + sizeof(locator) <= (size_t)size && !memcmp(p + 1, "K\5\6",
3)) {
memcpy((void *)&locator, (void *) p, sizeof(locator));
if (PHAR_GET_16(locator.centraldisk) != 0 || PHAR_GET_16(locator.disknumber) != 0) {
/* split archives not handled */