Skip to content

Commit 7a94243

Browse files
committed
fix warnings
1 parent 960d103 commit 7a94243

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

ext/standard/dns.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ static u_char *php_parserr(u_char *cp, u_char *end, querybuf *answer, int type_t
457457
add_assoc_string(subarray, "host", name);
458458
add_assoc_string(subarray, "class", "IN");
459459
add_assoc_long(subarray, "ttl", ttl);
460+
(void) class;
460461

461462
if (raw) {
462463
add_assoc_long(subarray, "type", type);

ext/standard/ftp_fopen_wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
233233
}
234234

235235
#define PHP_FTP_CNTRL_CHK(val, val_len, err_msg) { \
236-
unsigned char *s = val, *e = s + val_len; \
236+
unsigned char *s = (unsigned char *) val, *e = (unsigned char *) s + val_len; \
237237
while (s < e) { \
238238
if (iscntrl(*s)) { \
239239
php_stream_wrapper_log_error(wrapper, options, err_msg, val); \

ext/standard/html.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ static inline void find_entity_for_char(
11871187
* at most two entries... */
11881188
for ( ; s <= e; s++) {
11891189
if (s->normal_entry.second_cp == next_char) {
1190-
*entity = s->normal_entry.entity;
1190+
*entity = (const unsigned char *) s->normal_entry.entity;
11911191
*entity_len = s->normal_entry.entity_len;
11921192
return;
11931193
}
@@ -1215,7 +1215,7 @@ static inline void find_entity_for_char_basic(
12151215
return;
12161216
}
12171217

1218-
*entity = table[k].data.ent.entity;
1218+
*entity = (const unsigned char *) table[k].data.ent.entity;
12191219
*entity_len = table[k].data.ent.entity_len;
12201220
}
12211221
/* }}} */
@@ -1400,7 +1400,7 @@ PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldle
14001400
ent_len = pos - (char*)&old[cursor];
14011401
} else { /* named entity */
14021402
/* check for vality of named entity */
1403-
const char *start = &old[cursor],
1403+
const char *start = (const char *) &old[cursor],
14041404
*next = start;
14051405
unsigned dummy1, dummy2;
14061406

ext/standard/http_fopen_wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
751751
if (!strncasecmp(http_header_line, "Location: ", 10)) {
752752
if (context && (tmpzval = php_stream_context_get_option(context, "http", "follow_location")) != NULL) {
753753
follow_location = zval_is_true(tmpzval);
754-
} else if (!(response_code >= 300 && response_code < 304 || 307 == response_code || 308 == response_code)) {
754+
} else if (!((response_code >= 300 && response_code < 304) || 307 == response_code || 308 == response_code)) {
755755
/* we shouldn't redirect automatically
756756
if follow_location isn't set and response_code not in (300, 301, 302, 303 and 307)
757757
see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.1

ext/standard/image.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ static unsigned short php_read2(php_stream * stream)
367367
unsigned char a[2];
368368

369369
/* return 0 if we couldn't read enough data */
370-
if((php_stream_read(stream, a, sizeof(a))) < sizeof(a)) return 0;
370+
if((php_stream_read(stream, (char *) a, sizeof(a))) < sizeof(a)) return 0;
371371

372372
return (((unsigned short)a[0]) << 8) + ((unsigned short)a[1]);
373373
}
@@ -604,7 +604,6 @@ static unsigned int php_read4(php_stream * stream)
604604
static struct gfxinfo *php_handle_jpc(php_stream * stream)
605605
{
606606
struct gfxinfo *result = NULL;
607-
unsigned short dummy_short;
608607
int highest_bit_depth, bit_depth;
609608
unsigned char first_marker_id;
610609
unsigned int i;
@@ -627,8 +626,8 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream)
627626

628627
result = (struct gfxinfo *)ecalloc(1, sizeof(struct gfxinfo));
629628

630-
dummy_short = php_read2(stream); /* Lsiz */
631-
dummy_short = php_read2(stream); /* Rsiz */
629+
php_read2(stream); /* Lsiz */
630+
php_read2(stream); /* Rsiz */
632631
result->width = php_read4(stream); /* Xsiz */
633632
result->height = php_read4(stream); /* Ysiz */
634633

@@ -647,7 +646,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream)
647646
#endif
648647

649648
result->channels = php_read2(stream); /* Csiz */
650-
if (result->channels == 0 && php_stream_eof(stream) || result->channels > 256) {
649+
if ((result->channels == 0 && php_stream_eof(stream)) || result->channels > 256) {
651650
efree(result);
652651
return NULL;
653652
}
@@ -831,7 +830,7 @@ static struct gfxinfo *php_handle_tiff (php_stream * stream, zval *info, int mot
831830
/* now we have the directory we can look how long it should be */
832831
ifd_size = dir_size;
833832
for(i=0;i<num_entries;i++) {
834-
dir_entry = ifd_data+2+i*12;
833+
dir_entry = (unsigned char *) ifd_data+2+i*12;
835834
entry_tag = php_ifd_get16u(dir_entry+0, motorola_intel);
836835
entry_type = php_ifd_get16u(dir_entry+2, motorola_intel);
837836
switch(entry_type) {
@@ -889,10 +888,10 @@ static struct gfxinfo *php_handle_iff(php_stream * stream)
889888
int size;
890889
short width, height, bits;
891890

892-
if (php_stream_read(stream, a, 8) != 8) {
891+
if (php_stream_read(stream, (char *) a, 8) != 8) {
893892
return NULL;
894893
}
895-
if (strncmp(a+4, "ILBM", 4) && strncmp(a+4, "PBM ", 4)) {
894+
if (strncmp((char *) a+4, "ILBM", 4) && strncmp((char *) a+4, "PBM ", 4)) {
896895
return NULL;
897896
}
898897

@@ -1088,7 +1087,7 @@ static struct gfxinfo *php_handle_ico(php_stream * stream)
10881087
unsigned char dim[16];
10891088
int num_icons = 0;
10901089

1091-
if (php_stream_read(stream, dim, 2) != 2)
1090+
if (php_stream_read(stream, (char *) dim, 2) != 2)
10921091
return NULL;
10931092

10941093
num_icons = (((unsigned int)dim[1]) << 8) + ((unsigned int) dim[0]);
@@ -1100,7 +1099,7 @@ static struct gfxinfo *php_handle_ico(php_stream * stream)
11001099

11011100
while (num_icons > 0)
11021101
{
1103-
if (php_stream_read(stream, dim, sizeof(dim)) != sizeof(dim))
1102+
if (php_stream_read(stream, (char *) dim, sizeof(dim)) != sizeof(dim))
11041103
break;
11051104

11061105
if ((((unsigned int)dim[7]) << 8) + ((unsigned int)dim[6]) >= result->bits)

ext/standard/iptc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ PHP_FUNCTION(iptcembed)
286286

287287
if (spool < 2) {
288288
// TODO: avoid reallocation ???
289-
RETVAL_STRINGL(spoolbuf, poi - spoolbuf);
289+
RETVAL_STRINGL((char *) spoolbuf, poi - spoolbuf);
290290
efree(spoolbuf);
291291
} else {
292292
RETURN_TRUE;
@@ -358,7 +358,7 @@ PHP_FUNCTION(iptcparse)
358358
element = zend_hash_str_update(Z_ARRVAL_P(return_value), key, strlen(key), &values);
359359
}
360360

361-
add_next_index_stringl(element, buffer+inx, len);
361+
add_next_index_stringl(element, (char *) buffer+inx, len);
362362
inx += len;
363363
tagsfound++;
364364
}

ext/standard/link.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ PHP_FUNCTION(linkinfo)
8686
{
8787
char *link;
8888
char *dirname;
89-
size_t link_len, dir_len;
89+
size_t link_len;
9090
zend_stat_t sb;
9191
int ret;
9292

@@ -95,7 +95,7 @@ PHP_FUNCTION(linkinfo)
9595
}
9696

9797
dirname = estrndup(link, link_len);
98-
dir_len = php_dirname(dirname, link_len);
98+
php_dirname(dirname, link_len);
9999

100100
if (php_check_open_basedir(dirname)) {
101101
efree(dirname);

ext/standard/metaphone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ char _codes[26] =
117117
/* Look two letters down. It makes sure you don't walk off the string. */
118118
#define After_Next_Letter (Next_Letter != '\0' ? toupper(word[w_idx+2]) \
119119
: '\0')
120-
#define Look_Ahead_Letter(n) (toupper(Lookahead(word+w_idx, n)))
120+
#define Look_Ahead_Letter(n) (toupper(Lookahead((char *) word+w_idx, n)))
121121

122122

123123
/* Allows us to safely look ahead an arbitrary # of letters */

0 commit comments

Comments
 (0)