[HarfBuzz] harfbuzz: Branch 'master' - 2 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Sat Feb 10 18:46:17 UTC 2018


 configure.ac                |    6 ++----
 src/hb-open-type-private.hh |    4 ++--
 util/options.cc             |   12 ++++++++++--
 3 files changed, 14 insertions(+), 8 deletions(-)

New commits:
commit d0f3e7f59719bdb6a2105ee85a8f3ee799741dab
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Feb 10 12:45:28 2018 -0600

    [util] Use setlinebuf() if present
    
    To work around mysterious bug on OS X.
    
    Fixes https://github.com/harfbuzz/harfbuzz/issues/727

diff --git a/configure.ac b/configure.ac
index 12401f00..5a17cc1a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,7 +69,7 @@ GTK_DOC_CHECK([1.15],[--flavour no-tmpl])
 ])
 
 # Functions and headers
-AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l)
+AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l setlinebuf)
 AC_CHECK_HEADERS(unistd.h sys/mman.h xlocale.h)
 
 # Compiler flags
@@ -355,9 +355,7 @@ if $have_freetype; then
 	AC_DEFINE(HAVE_FREETYPE, 1, [Have FreeType 2 library])
 	save_libs=$LIBS
 	LIBS="$LIBS $FREETYPE_LIBS"
-	AC_CHECK_FUNCS(FT_Get_Var_Blend_Coordinates)
-	AC_CHECK_FUNCS(FT_Set_Var_Blend_Coordinates)
-	AC_CHECK_FUNCS(FT_Done_MM_Var)
+	AC_CHECK_FUNCS(FT_Get_Var_Blend_Coordinates FT_Set_Var_Blend_Coordinates FT_Done_MM_Var)
 	LIBS=$save_libs
 fi
 AM_CONDITIONAL(HAVE_FREETYPE, $have_freetype)
diff --git a/util/options.cc b/util/options.cc
index d9486f8a..6d8064b9 100644
--- a/util/options.cc
+++ b/util/options.cc
@@ -780,7 +780,11 @@ text_options_t::get_line (unsigned int *len)
     gs = g_string_new (nullptr);
   }
 
-  setvbuf(fp, NULL, _IOLBF, BUFSIZ); //setlinebuf (fp);
+#ifdef HAVE_SETLINEBUF
+  setlinebuf (fp);
+#else
+  setvbuf(fp, NULL, _IOLBF, BUFSIZ);
+#endif
 
   g_string_set_size (gs, 0);
   char buf[BUFSIZ];
@@ -819,7 +823,11 @@ output_options_t::get_file_handle (void)
     fail (false, "Cannot open output file `%s': %s",
 	  g_filename_display_name (output_file), strerror (errno));
 
-  setvbuf(fp, NULL, _IOLBF, BUFSIZ); //setlinebuf (fp);
+#ifdef HAVE_SETLINEBUF
+  setlinebuf (fp);
+#else
+  setvbuf(fp, NULL, _IOLBF, BUFSIZ);
+#endif
 
   return fp;
 }
commit ad575a5f47a51ee553710873ac2672479b76ba5e
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date:   Sat Feb 10 19:50:11 2018 +0330

    Fix cast warnings on clang (#768)

diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index be3ecb49..3a8f738b 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -508,7 +508,7 @@ struct Supplier
   inline const Type operator [] (unsigned int i) const
   {
     if (unlikely (i >= len)) return Type ();
-    return * (const Type *) ((const char *) head + stride * i);
+    return * (const Type *) (const void *) ((const char *) head + stride * i);
   }
 
   inline void advance (unsigned int count)
@@ -516,7 +516,7 @@ struct Supplier
     if (unlikely (count > len))
       count = len;
     len -= count;
-    head = (const Type *) ((const char *) head + stride * count);
+    head = (const Type *) (const void *) ((const char *) head + stride * count);
   }
 
   private:


More information about the HarfBuzz mailing list