silence a -Wint-in-bool-context warning:

In file included from /home/runner/work/physfs/physfs/src/physfs.c:12:
/home/runner/work/physfs/physfs/src/physfs.c: In function ‘openDirectory’:
/home/runner/work/physfs/physfs/src/physfs.c:929:40: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
  929 |     BAIL_IF(!retval, claimed ? errcode : PHYSFS_ERR_UNSUPPORTED, NULL);
      |                      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/physfs/physfs/src/physfs_internal.h:273:44: note: in definition of macro ‘BAIL_IF’
  273 | #define BAIL_IF(c, e, r) do { if (c) { if (e) PHYSFS_setErrorCode(e); return r; } } while (0)
      |                                            ^

Closes https://github.com/icculus/physfs/issues/44
This commit is contained in:
Ozkan Sezer 2022-06-15 20:56:28 +03:00
parent f0c7367b0f
commit fb0901b10f
1 changed files with 2 additions and 2 deletions

View File

@ -921,12 +921,12 @@ static DirHandle *openDirectory(PHYSFS_Io *io, const char *d, int forWriting)
retval = tryOpenDir(io, *i, d, forWriting, &claimed);
} /* else */
errcode = currentErrorCode();
errcode = claimed ? currentErrorCode() : PHYSFS_ERR_UNSUPPORTED;
if ((!retval) && (created_io))
io->destroy(io);
BAIL_IF(!retval, claimed ? errcode : PHYSFS_ERR_UNSUPPORTED, NULL);
BAIL_IF(!retval, errcode, NULL);
return retval;
} /* openDirectory */