From 9966950a0d1947422292fd70c3122456c01d06b1 Mon Sep 17 00:00:00 2001 From: yinyongkang Date: Fri, 19 Apr 2024 16:19:55 +0800 Subject: [PATCH] silence a -Wint-in-bool-context warning --- physfs.spec | 7 ++++- silence-a-Wint-in-bool-context-warning.patch | 31 ++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 silence-a-Wint-in-bool-context-warning.patch diff --git a/physfs.spec b/physfs.spec index e0143a0..e856d32 100644 --- a/physfs.spec +++ b/physfs.spec @@ -1,6 +1,6 @@ Name: physfs Version: 3.0.2 -Release: 1 +Release: 2 License: Zlib Summary: Provide abstract access to various archives URL: http://www.icculus.org/physfs/ @@ -8,6 +8,8 @@ Source0: http://www.icculus.org/physfs/downloads/physfs-%{version}.tar.bz BuildRequires: gcc-c++ doxygen readline-devel libtool cmake Provides: bundled(lzma-sdk457) +Patch0: silence-a-Wint-in-bool-context-warning.patch + %description PhysicsFS is a library to provide abstract access to various archives. It is intended for use in video games, and the design was somewhat inspired by Quake 3's file subsystem. @@ -63,6 +65,9 @@ touch -r LICENSE.txt docs/latex/* %changelog +* Fri Apr 19 2024 yinyongkang - 3.0.2-2 +- silence a -Wint-in-bool-context warning + * Wed Sep 20 2023 wulei - 3.0.2-1 - Update to 3.0.2 diff --git a/silence-a-Wint-in-bool-context-warning.patch b/silence-a-Wint-in-bool-context-warning.patch new file mode 100644 index 0000000..2838f00 --- /dev/null +++ b/silence-a-Wint-in-bool-context-warning.patch @@ -0,0 +1,31 @@ +From 7f270fb10183cfbe1e6b355da5f75d39f282a984 Mon Sep 17 00:00:00 2001 +From: yinyongkang +Date: Fri, 19 Apr 2024 16:11:28 +0800 +Subject: [PATCH] silence a -Wint-in-bool-context warning + +--- + src/physfs.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/physfs.c b/src/physfs.c +index fdb1405..5e7bc29 100644 +--- a/src/physfs.c ++++ b/src/physfs.c +@@ -920,12 +920,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 */ + +-- +2.41.0 +