!5 修复编译告警

From: @yinyongkang 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
This commit is contained in:
openeuler-ci-bot 2024-05-20 09:27:44 +00:00 committed by Gitee
commit 084d262265
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 37 additions and 1 deletions

View File

@ -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 <yinyongkang@kylinos.cn> - 3.0.2-2
- silence a -Wint-in-bool-context warning
* Wed Sep 20 2023 wulei <wu_lei@hoperun.com> - 3.0.2-1
- Update to 3.0.2

View File

@ -0,0 +1,31 @@
From 7f270fb10183cfbe1e6b355da5f75d39f282a984 Mon Sep 17 00:00:00 2001
From: yinyongkang <yinyongkang@kylinos.cn>
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