1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 18:23:26 +02:00

do correct casting

This commit is contained in:
Stefan Esser
2002-12-24 23:28:05 +00:00
parent 2e6e0f87dc
commit e900f8c97b
+3 -3
View File
@@ -274,7 +274,7 @@ PHP_MINIT_FUNCTION(mime_magic)
PHP_MSHUTDOWN_FUNCTION(mime_magic)
{
UNREGISTER_INI_ENTRIES();
if (mime_global.magic != NULL && (int)mime_global.magic != -1) {
if (mime_global.magic != NULL && mime_global.magic != (struct magic *) -1) {
struct magic *iter = mime_global.magic;
while (iter != NULL) {
struct magic *iter_next = iter->next;
@@ -312,7 +312,7 @@ PHP_FUNCTION(mime_content_type)
return;
}
if ((int) conf->magic == -1) {
if (conf->magic == (struct magic *)-1) {
php_error(E_ERROR, MODNAME " could not be initialized, magic file %s is not avaliable", conf->magicfile);
RETURN_FALSE;
}
@@ -358,7 +358,7 @@ static int apprentice(void)
fname = conf->magicfile; /* todo cwd? */
f = fopen(fname, "rb");
if (f == NULL) {
*(int *)&conf->magic = -1;
conf->magic = (struct magic *)-1;
return -1;
}