Fix C compatibility issues
Related to: <https://fedoraproject.org/wiki/Changes/PortingToModernC> <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
parent
5347a6876c
commit
25087f03f5
21
adobe-afdko-c99-1.patch
Normal file
21
adobe-afdko-c99-1.patch
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
Upstream, this is part of this commit:
|
||||||
|
|
||||||
|
commit 26761e9616f8a52aa14e7041ac9cbb0e139a1d83
|
||||||
|
Author: Skef Iterum <iterumllc@skef.org>
|
||||||
|
Date: Thu May 13 05:33:44 2021 -0700
|
||||||
|
|
||||||
|
Antlr 4 feature file parser and CMake build system
|
||||||
|
|
||||||
|
diff --git a/c/makeotf/makeotf_lib/source/hotconv/STAT.c b/c/makeotf/makeotf_lib/source/hotconv/STAT.c
|
||||||
|
index a93cb6571ad14fab..7d31230cf87bd941 100644
|
||||||
|
--- a/c/makeotf/makeotf_lib/source/hotconv/STAT.c
|
||||||
|
+++ b/c/makeotf/makeotf_lib/source/hotconv/STAT.c
|
||||||
|
@@ -301,7 +301,7 @@ void STATAddDesignAxis(hotCtx g, Tag tag, uint16_t nameID, uint16_t ordering) {
|
||||||
|
|
||||||
|
// Currently registered tags are 'wght', 'wdth', 'opsz', 'ital', 'slnt'
|
||||||
|
char tagString[4] = {TAG_ARG(tag)};
|
||||||
|
- const uint32_t *regTags[5] = {
|
||||||
|
+ const uint32_t regTags[5] = {
|
||||||
|
TAG('i', 't', 'a', 'l'),
|
||||||
|
TAG('o', 'p', 's', 'z'),
|
||||||
|
TAG('s', 'l', 'n', 't'),
|
37
adobe-afdko-c99-2.patch
Normal file
37
adobe-afdko-c99-2.patch
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
Author: Sergei Trofimovich <slyich@gmail.com>
|
||||||
|
Date: Wed Dec 6 20:41:57 2023 +0000
|
||||||
|
|
||||||
|
c/shared/source/t1write/t1write.c: fix u8/u16 type mismatch on dereference (gcc-14)
|
||||||
|
|
||||||
|
Upcoming `gcc-14` enabled a few warnings into errors, like
|
||||||
|
`-Wincompatible-pointer-types`. This caused `afdko` build to fail as:
|
||||||
|
|
||||||
|
/build/afdko/c/shared/source/t1write/t1write.c: In function ‘saveCstr’:
|
||||||
|
/build/afdko/c/shared/source/t1write/t1write.c:348:28: error: passing argument 3 of ‘writeTmp’ from incompatible pointer type [-Wincompatible-pointer-types]
|
||||||
|
348 | if (writeTmp(h, 1, &info->iFD))
|
||||||
|
| ^~~~~~~~~~
|
||||||
|
| |
|
||||||
|
| uint16_t * {aka short unsigned int *}
|
||||||
|
|
||||||
|
The code attempts to use only one byte of 16-bit value. The code very
|
||||||
|
likely is broken on a big-endian system.
|
||||||
|
|
||||||
|
The change explicitly truncates 16-bit value down to 8 bit value to
|
||||||
|
retain existing behaviour on both BE and LE systems.
|
||||||
|
|
||||||
|
Submitted upstream: <https://github.com/adobe-type-tools/afdko/pull/1730>
|
||||||
|
|
||||||
|
diff --git a/c/public/lib/source/t1write/t1write.c b/c/public/lib/source/t1write/t1write.c
|
||||||
|
index e16387408a953c07..b2e4c0df27d36e56 100644
|
||||||
|
--- a/c/public/lib/source/t1write/t1write.c
|
||||||
|
+++ b/c/public/lib/source/t1write/t1write.c
|
||||||
|
@@ -345,7 +345,8 @@ static int saveCstr(t1wCtx h, abfGlyphInfo *info,
|
||||||
|
if (info != NULL && info->flags & ABF_GLYPH_CID &&
|
||||||
|
!(h->arg.flags & T1W_TYPE_HOST)) {
|
||||||
|
/* CID-keyed incremental download; write fd index */
|
||||||
|
- if (writeTmp(h, 1, &info->iFD))
|
||||||
|
+ unsigned char c = info->iFD;
|
||||||
|
+ if (writeTmp(h, 1, &c))
|
||||||
|
return 1;
|
||||||
|
cstr->length++;
|
||||||
|
}
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: adobe-afdko
|
Name: adobe-afdko
|
||||||
Version: 3.6.1
|
Version: 3.6.1
|
||||||
Release: 6%{?dist}
|
Release: 7%{?dist}
|
||||||
Summary: Adobe Font Development Kit for OpenType
|
Summary: Adobe Font Development Kit for OpenType
|
||||||
# ExternalAntlr4Cpp.cmake is BSD-3-clause
|
# ExternalAntlr4Cpp.cmake is BSD-3-clause
|
||||||
# c/makeotf/makeotf_lib/build/hotpccts/pccts/* is ANTLR-PD
|
# c/makeotf/makeotf_lib/build/hotpccts/pccts/* is ANTLR-PD
|
||||||
@ -11,6 +11,8 @@ Summary: Adobe Font Development Kit for OpenType
|
|||||||
License: Apache-2.0 AND BSD-3-clause AND ANTLR-PD AND Python-2.0.1
|
License: Apache-2.0 AND BSD-3-clause AND ANTLR-PD AND Python-2.0.1
|
||||||
URL: https://github.com/adobe-type-tools/afdko
|
URL: https://github.com/adobe-type-tools/afdko
|
||||||
Source0: https://github.com/adobe-type-tools/%{archivename}/releases/download/%{version}/%{archivename}-%{version}.tar.gz
|
Source0: https://github.com/adobe-type-tools/%{archivename}/releases/download/%{version}/%{archivename}-%{version}.tar.gz
|
||||||
|
Patch0: adobe-afdko-c99-1.patch
|
||||||
|
Patch1: adobe-afdko-c99-2.patch
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
|
|
||||||
@ -20,7 +22,7 @@ The AFDKO is a set of tools for building OpenType font files
|
|||||||
from PostScript and TrueType font data.
|
from PostScript and TrueType font data.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{archivename}-%{version}
|
%autosetup -p1 -n %{archivename}-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%set_build_flags
|
%set_build_flags
|
||||||
@ -40,6 +42,9 @@ find ./ -type f -executable -exec install -p -m 0755 "{}" \
|
|||||||
%{_bindir}/*
|
%{_bindir}/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Jan 05 2024 Florian Weimer <fweimer@redhat.com> - 3.6.1-7
|
||||||
|
- Fix C compatibility issues
|
||||||
|
|
||||||
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.1-6
|
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.1-6
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user