summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Wallner <mike@php.net>2015-01-30 22:19:23 +0100
committerMichael Wallner <mike@php.net>2015-01-30 22:19:23 +0100
commit7a94243402d95b227931004aa9d10a1b94aeaef8 (patch)
treea291ac7a8995531a7fd80ccd444acf7546880692
parent960d103d63f3e9e690853b0a07b82195d0f0cfbf (diff)
downloadphp-git-7a94243402d95b227931004aa9d10a1b94aeaef8.tar.gz
fix warnings
-rw-r--r--ext/standard/dns.c1
-rw-r--r--ext/standard/ftp_fopen_wrapper.c2
-rw-r--r--ext/standard/html.c6
-rw-r--r--ext/standard/http_fopen_wrapper.c2
-rw-r--r--ext/standard/image.c19
-rw-r--r--ext/standard/iptc.c4
-rw-r--r--ext/standard/link.c4
-rw-r--r--ext/standard/metaphone.c2
8 files changed, 20 insertions, 20 deletions
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index b5cfb1d3e4..6507aa46e9 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -457,6 +457,7 @@ static u_char *php_parserr(u_char *cp, u_char *end, querybuf *answer, int type_t
add_assoc_string(subarray, "host", name);
add_assoc_string(subarray, "class", "IN");
add_assoc_long(subarray, "ttl", ttl);
+ (void) class;
if (raw) {
add_assoc_long(subarray, "type", type);
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index 923ba6642e..1c83a9434c 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -233,7 +233,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
}
#define PHP_FTP_CNTRL_CHK(val, val_len, err_msg) { \
- unsigned char *s = val, *e = s + val_len; \
+ unsigned char *s = (unsigned char *) val, *e = (unsigned char *) s + val_len; \
while (s < e) { \
if (iscntrl(*s)) { \
php_stream_wrapper_log_error(wrapper, options, err_msg, val); \
diff --git a/ext/standard/html.c b/ext/standard/html.c
index 16abac0b08..c8e36b8d45 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -1187,7 +1187,7 @@ static inline void find_entity_for_char(
* at most two entries... */
for ( ; s <= e; s++) {
if (s->normal_entry.second_cp == next_char) {
- *entity = s->normal_entry.entity;
+ *entity = (const unsigned char *) s->normal_entry.entity;
*entity_len = s->normal_entry.entity_len;
return;
}
@@ -1215,7 +1215,7 @@ static inline void find_entity_for_char_basic(
return;
}
- *entity = table[k].data.ent.entity;
+ *entity = (const unsigned char *) table[k].data.ent.entity;
*entity_len = table[k].data.ent.entity_len;
}
/* }}} */
@@ -1400,7 +1400,7 @@ encode_amp:
ent_len = pos - (char*)&old[cursor];
} else { /* named entity */
/* check for vality of named entity */
- const char *start = &old[cursor],
+ const char *start = (const char *) &old[cursor],
*next = start;
unsigned dummy1, dummy2;
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 7c48c45bc0..454cd04d5b 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -751,7 +751,7 @@ finish:
if (!strncasecmp(http_header_line, "Location: ", 10)) {
if (context && (tmpzval = php_stream_context_get_option(context, "http", "follow_location")) != NULL) {
follow_location = zval_is_true(tmpzval);
- } else if (!(response_code >= 300 && response_code < 304 || 307 == response_code || 308 == response_code)) {
+ } else if (!((response_code >= 300 && response_code < 304) || 307 == response_code || 308 == response_code)) {
/* we shouldn't redirect automatically
if follow_location isn't set and response_code not in (300, 301, 302, 303 and 307)
see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.1
diff --git a/ext/standard/image.c b/ext/standard/image.c
index d5ab529071..e1fa27e41b 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -367,7 +367,7 @@ static unsigned short php_read2(php_stream * stream)
unsigned char a[2];
/* return 0 if we couldn't read enough data */
- if((php_stream_read(stream, a, sizeof(a))) < sizeof(a)) return 0;
+ if((php_stream_read(stream, (char *) a, sizeof(a))) < sizeof(a)) return 0;
return (((unsigned short)a[0]) << 8) + ((unsigned short)a[1]);
}
@@ -604,7 +604,6 @@ static unsigned int php_read4(php_stream * stream)
static struct gfxinfo *php_handle_jpc(php_stream * stream)
{
struct gfxinfo *result = NULL;
- unsigned short dummy_short;
int highest_bit_depth, bit_depth;
unsigned char first_marker_id;
unsigned int i;
@@ -627,8 +626,8 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream)
result = (struct gfxinfo *)ecalloc(1, sizeof(struct gfxinfo));
- dummy_short = php_read2(stream); /* Lsiz */
- dummy_short = php_read2(stream); /* Rsiz */
+ php_read2(stream); /* Lsiz */
+ php_read2(stream); /* Rsiz */
result->width = php_read4(stream); /* Xsiz */
result->height = php_read4(stream); /* Ysiz */
@@ -647,7 +646,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream)
#endif
result->channels = php_read2(stream); /* Csiz */
- if (result->channels == 0 && php_stream_eof(stream) || result->channels > 256) {
+ if ((result->channels == 0 && php_stream_eof(stream)) || result->channels > 256) {
efree(result);
return NULL;
}
@@ -831,7 +830,7 @@ static struct gfxinfo *php_handle_tiff (php_stream * stream, zval *info, int mot
/* now we have the directory we can look how long it should be */
ifd_size = dir_size;
for(i=0;i<num_entries;i++) {
- dir_entry = ifd_data+2+i*12;
+ dir_entry = (unsigned char *) ifd_data+2+i*12;
entry_tag = php_ifd_get16u(dir_entry+0, motorola_intel);
entry_type = php_ifd_get16u(dir_entry+2, motorola_intel);
switch(entry_type) {
@@ -889,10 +888,10 @@ static struct gfxinfo *php_handle_iff(php_stream * stream)
int size;
short width, height, bits;
- if (php_stream_read(stream, a, 8) != 8) {
+ if (php_stream_read(stream, (char *) a, 8) != 8) {
return NULL;
}
- if (strncmp(a+4, "ILBM", 4) && strncmp(a+4, "PBM ", 4)) {
+ if (strncmp((char *) a+4, "ILBM", 4) && strncmp((char *) a+4, "PBM ", 4)) {
return NULL;
}
@@ -1088,7 +1087,7 @@ static struct gfxinfo *php_handle_ico(php_stream * stream)
unsigned char dim[16];
int num_icons = 0;
- if (php_stream_read(stream, dim, 2) != 2)
+ if (php_stream_read(stream, (char *) dim, 2) != 2)
return NULL;
num_icons = (((unsigned int)dim[1]) << 8) + ((unsigned int) dim[0]);
@@ -1100,7 +1099,7 @@ static struct gfxinfo *php_handle_ico(php_stream * stream)
while (num_icons > 0)
{
- if (php_stream_read(stream, dim, sizeof(dim)) != sizeof(dim))
+ if (php_stream_read(stream, (char *) dim, sizeof(dim)) != sizeof(dim))
break;
if ((((unsigned int)dim[7]) << 8) + ((unsigned int)dim[6]) >= result->bits)
diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index 0e01acbe26..929d495023 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -286,7 +286,7 @@ PHP_FUNCTION(iptcembed)
if (spool < 2) {
// TODO: avoid reallocation ???
- RETVAL_STRINGL(spoolbuf, poi - spoolbuf);
+ RETVAL_STRINGL((char *) spoolbuf, poi - spoolbuf);
efree(spoolbuf);
} else {
RETURN_TRUE;
@@ -358,7 +358,7 @@ PHP_FUNCTION(iptcparse)
element = zend_hash_str_update(Z_ARRVAL_P(return_value), key, strlen(key), &values);
}
- add_next_index_stringl(element, buffer+inx, len);
+ add_next_index_stringl(element, (char *) buffer+inx, len);
inx += len;
tagsfound++;
}
diff --git a/ext/standard/link.c b/ext/standard/link.c
index a80e48f6a0..b7fe1ae495 100644
--- a/ext/standard/link.c
+++ b/ext/standard/link.c
@@ -86,7 +86,7 @@ PHP_FUNCTION(linkinfo)
{
char *link;
char *dirname;
- size_t link_len, dir_len;
+ size_t link_len;
zend_stat_t sb;
int ret;
@@ -95,7 +95,7 @@ PHP_FUNCTION(linkinfo)
}
dirname = estrndup(link, link_len);
- dir_len = php_dirname(dirname, link_len);
+ php_dirname(dirname, link_len);
if (php_check_open_basedir(dirname)) {
efree(dirname);
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c
index 59ef78baf6..cc94b0372f 100644
--- a/ext/standard/metaphone.c
+++ b/ext/standard/metaphone.c
@@ -117,7 +117,7 @@ char _codes[26] =
/* Look two letters down. It makes sure you don't walk off the string. */
#define After_Next_Letter (Next_Letter != '\0' ? toupper(word[w_idx+2]) \
: '\0')
-#define Look_Ahead_Letter(n) (toupper(Lookahead(word+w_idx, n)))
+#define Look_Ahead_Letter(n) (toupper(Lookahead((char *) word+w_idx, n)))
/* Allows us to safely look ahead an arbitrary # of letters */