[PATCH] ft-hb.c: fix -Wunused-but-set-variable in windows builds
Ozkan Sezer <[email protected]> Wed, 4 Jun 2025 09:56:02 +0300
| Newsgroups | gmane.comp.fonts.freetype.devel |
|---|---|
| Message-ID | <CAA2C=vBVAWpQ8nyb7jnK3o8OCt+VFCOC1Y+V5_=Tv=czWLTzjQ@mail.gmail.com> |
* src/autofit/ft-hb.c: move version_atleast NULL check out of ifdefs
Fixes -Wunused-but-set-variable warning in windows builds:
```
In file included from src/autofit/autofit.c:21:0:
src/autofit/ft-hb.c: In function 'ft_hb_funcs_init':
src/autofit/ft-hb.c:75:35: warning: variable 'version_atleast' set but
not used [-Wunused-but-set-variable]
ft_hb_version_atleast_func_t version_atleast = NULL;
^~~~~~~~~~~~~~~
```
--
O.S.
0001-ft-hb.c-fix-Wunused-but-set-variable-in-windows-buil.patch
(application/octet-stream, 1.3 KB)
From 51887f4a11682af6fcb1fd5b088dbf9d7876e248 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer <[email protected]> Date: Wed, 4 Jun 2025 08:55:04 +0300 Subject: [PATCH] ft-hb.c: fix -Wunused-but-set-variable in windows builds * src/autofit/ft-hb.c: move version_atleast NULL check out of ifdefs Fixes -Wunused-but-set-variable warning in windows builds: ``` In file included from src/autofit/autofit.c:21:0: src/autofit/ft-hb.c: In function 'ft_hb_funcs_init': src/autofit/ft-hb.c:75:35: warning: variable 'version_atleast' set but not used [-Wunused-but-set-variable] ft_hb_version_atleast_func_t version_atleast = NULL; ^~~~~~~~~~~~~~~ ``` --- src/autofit/ft-hb.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/autofit/ft-hb.c b/src/autofit/ft-hb.c index d91d07c..bcb4c93 100644 --- a/src/autofit/ft-hb.c +++ b/src/autofit/ft-hb.c @@ -120,12 +120,13 @@ if ( !lib ) goto Fail; version_atleast = DLSYM( lib, hb_version_atleast ); - if ( !version_atleast ) - goto Fail; } #endif /* !_WIN32 */ + if ( !version_atleast ) + goto Fail; + /* Load all symbols we use. */ #define HB_EXTERN( ret, name, args ) \ { \ -- 1.7.1