freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] merged CFF and Type1 hinting code now in master


From: Ewald Hew
Subject: Re: [ft-devel] merged CFF and Type1 hinting code now in master
Date: Tue, 26 Sep 2017 00:25:07 +0800

> Not sure if it's caused by the merge, but it gives a warning with gcc 7.2.0:
>
> ---
> In file included from
> /home/nsivov/devel/freetype/freetype2/src/psaux/psaux.c:35:0:
> /home/nsivov/devel/freetype/freetype2/src/psaux/pshints.c: In function
> ‘cf2_hintmap_dump’:
> /home/nsivov/devel/freetype/freetype2/src/psaux/pshints.c:312:17: warning:
> unused variable ‘hint’ [-Wunused-variable]
>        CF2_Hint  hint = &hintmap->edge[i];
>                  ^~~~
> ---

Yes, it is caused by the tracing procedure I added to debug the
initial hintmap issue. All this does is use FT_TRACE to print out some
tables, so if debug mode isn't turned on, the `hint' variable's not
being used.

The following patch should fix it:

>From ca8de3f50731167a8a096a5a8afb7b171fa3f640 Mon Sep 17 00:00:00 2001
From: Ewald Hew <address@hidden>
Date: Tue, 26 Sep 2017 00:16:26 +0800
Subject: [PATCH] Fix compiler warning.

---
 src/psaux/pshints.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/psaux/pshints.c b/src/psaux/pshints.c
index cf40bc0..c8ad4e0 100644
--- a/src/psaux/pshints.c
+++ b/src/psaux/pshints.c
@@ -302,6 +302,7 @@
   static void
   cf2_hintmap_dump( CF2_HintMap  hintmap )
   {
+#ifdef FT_DEBUG_LEVEL_TRACE
     CF2_UInt  i;


@@ -321,6 +322,9 @@
                   ( cf2_hint_isLocked( hint ) ? "L" : ""),
                   ( cf2_hint_isSynthetic( hint ) ? "S" : "" ) ));
     }
+#else
+    FT_UNUSED( hintmap );
+#endif
   }


-- 
2.1.4

Ewald

Attachment: 0001-Fix-compiler-warning.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]