mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
Fixed compiler warnings
This commit is contained in:
parent
da7f42de38
commit
4cb47bd3bd
@ -3005,7 +3005,6 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn)
|
||||
{
|
||||
static const size_t nm = sizeof(*map->nmagic) * MAGIC_SETS;
|
||||
static const size_t m = sizeof(**map->magic);
|
||||
int fd = -1;
|
||||
size_t len;
|
||||
char *dbname;
|
||||
int rv = -1;
|
||||
|
@ -61,7 +61,6 @@ extern public void convert_libmagic_pattern(zval *pattern, char *val, int len, i
|
||||
protected int
|
||||
file_printf(struct magic_set *ms, const char *fmt, ...)
|
||||
{
|
||||
int rv;
|
||||
va_list ap;
|
||||
int len;
|
||||
char *buf = NULL, *newstr;
|
||||
@ -283,7 +282,9 @@ simple:
|
||||
if (file_printf(ms, "%s", code_mime) == -1)
|
||||
rv = -1;
|
||||
}
|
||||
#if PHP_FILEINFO_UNCOMPRESS
|
||||
done_encoding:
|
||||
#endif
|
||||
free(u8buf);
|
||||
if (rv)
|
||||
return rv;
|
||||
@ -438,7 +439,7 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
|
||||
(void)setlocale(LC_CTYPE, "C");
|
||||
|
||||
opts |= PCRE_MULTILINE;
|
||||
convert_libmagic_pattern(&patt, pat, strlen(pat), opts);
|
||||
convert_libmagic_pattern(&patt, (char*)pat, strlen(pat), opts);
|
||||
if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt))) == NULL) {
|
||||
zval_ptr_dtor(&patt);
|
||||
rep_cnt = -1;
|
||||
|
@ -2040,7 +2040,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
|
||||
/* Need to fetch global match which equals pmatch[0] */
|
||||
zval *pzval;
|
||||
HashTable *ht = Z_ARRVAL(subpats);
|
||||
if ((pzval = zend_hash_index_find(ht, 0)) != NULL) {
|
||||
if ((pzval = zend_hash_index_find(ht, 0)) != NULL && Z_TYPE_P(pzval) == IS_ARRAY) {
|
||||
/* If everything goes according to the master plan
|
||||
tmpcopy now contains two elements:
|
||||
0 = the match
|
||||
|
Loading…
Reference in New Issue
Block a user