From 328694ac683ff932c47630cf9db645ce5d28b7f8 Mon Sep 17 00:00:00 2001 From: bailu Date: Mon, 4 Aug 2025 14:45:16 +0800 Subject: [PATCH] backport: Fix incompatible pointer types in pyaff.c Signed-off-by: liuqingtao (cherry picked from commit 78791908990da71abb74429c4cd71287f75bd269) --- ...ncompatible-pointer-types-in-pyaff.c.patch | 40 +++++++++++++++++++ afflib.spec | 8 +++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 Fix-53-incompatible-pointer-types-in-pyaff.c.patch diff --git a/Fix-53-incompatible-pointer-types-in-pyaff.c.patch b/Fix-53-incompatible-pointer-types-in-pyaff.c.patch new file mode 100644 index 0000000..b85c063 --- /dev/null +++ b/Fix-53-incompatible-pointer-types-in-pyaff.c.patch @@ -0,0 +1,40 @@ +From 01210f488410a23838c54fcc22297cf08ac7de66 Mon Sep 17 00:00:00 2001 +From: Phillip Hellewell +Date: Wed, 14 Feb 2024 00:43:56 -0700 +Subject: [PATCH] Fix #53: incompatible pointer types in pyaff.c + +--- + pyaff/afflib.pxd | 3 ++- + pyaff/pyaff.c | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/pyaff/afflib.pxd b/pyaff/afflib.pxd +index 850765c..b6cce11 100644 +--- a/pyaff/afflib.pxd ++++ b/pyaff/afflib.pxd +@@ -2,7 +2,8 @@ from libc.stdint cimport int64_t, uint32_t, uint64_t + from posix.fcntl cimport O_RDONLY + + cdef extern from "afflib/afflib.h": +- struct AFFILE ++ struct _AFFILE ++ ctypedef _AFFILE AFFILE + + enum: AF_MAX_NAME_LEN + +diff --git a/pyaff/pyaff.c b/pyaff/pyaff.c +index 99544f6..8ba33db 100644 +--- a/pyaff/pyaff.c ++++ b/pyaff/pyaff.c +@@ -1478,7 +1478,7 @@ struct __pyx_obj_5pyaff_affile; + */ + struct __pyx_obj_5pyaff_affile { + PyObject_HEAD +- struct AFFILE *af; ++ AFFILE *af; + int64_t size; + }; + +-- +2.27.0 + diff --git a/afflib.spec b/afflib.spec index 94c626b..104db3a 100644 --- a/afflib.spec +++ b/afflib.spec @@ -1,10 +1,13 @@ Name: afflib Version: 3.7.20 -Release: 1 +Release: 2 Summary: Library to support the Advanced Forensic Format License: LGPL-2.0 and LGPL-2.1 and GPL-2.0+ and Public Domain URL: https://github.com/sshock/AFFLIBv3 Source0: %{url}/archive/refs/tags/v%{version}.tar.gz + +Patch1: Fix-53-incompatible-pointer-types-in-pyaff.c.patch + BuildRequires: gcc-c++ libtool curl-devel expat-devel ncurses-devel BuildRequires: libtermcap-devel openssl-devel zlib-devel BuildRequires: python3 python3-devel python3-setuptools python3-Cython @@ -87,6 +90,9 @@ cd pyaff %{python3_sitearch}/pyaff* %changelog +* Mon Aug 04 2025 Liu Qingtao - 3.7.20-2 +- backport: Fix incompatible pointer types in pyaff.c + * Tue Oct 17 2023 chenyaqiang - 3.7.20-1 - update to 3.7.20 -- Gitee