configure.ac | 6 ++++++ src/Makefile.am | 2 +- src/check-c-linkage-decls.sh | 10 +++++++++- src/check-internal-symbols.sh | 8 +++++++- src/hb-common.h | 2 ++ src/hb-fallback-shape-private.hh | 6 ------ src/hb-ft.cc | 4 ++-- src/hb-ot-shape-complex-indic-machine.rl | 4 ---- src/hb-private.hh | 2 +- 9 files changed, 28 insertions(+), 16 deletions(-)
New commits: commit 11c4ad439ef2b39a840f397a693b1ba643f52c21 Author: Behdad Esfahbod <[email protected]> Date: Fri Jul 13 11:29:31 2012 -0400 Add -Wcast-align diff --git a/configure.ac b/configure.ac index acfc2ea..cbabf83 100644 --- a/configure.ac +++ b/configure.ac @@ -69,6 +69,9 @@ if test "x$GCC" = "xyes"; then # Hide inline methods CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" + # Assorted warnings + CXXFLAGS="$CXXFLAGS -Wcast-align" + case "$host" in arm-*-*) # Request byte alignment on arm diff --git a/src/Makefile.am b/src/Makefile.am index f7cf593..b981346 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,7 +8,7 @@ DISTCLEANFILES = MAINTAINERCLEANFILES = DISTCHECK_CONFIGURE_FLAGS = --enable-introspection -# The following warning options are useful for debugging: -Wpadded -Wcast-align +# The following warning options are useful for debugging: -Wpadded #AM_CXXFLAGS = lib_LTLIBRARIES = libharfbuzz.la commit a98d0ab18624501ee60551304f2715361ac643da Author: Behdad Esfahbod <[email protected]> Date: Fri Jul 13 10:19:10 2012 -0400 Make sure HB_BEGIN_DECLS / HB_END_DECLS is only used in public headers So we can use them to switch default visibility to internal if desired, and use these to make only declared symbols public. diff --git a/src/check-c-linkage-decls.sh b/src/check-c-linkage-decls.sh index e7c95ab..44cdfa0 100755 --- a/src/check-c-linkage-decls.sh +++ b/src/check-c-linkage-decls.sh @@ -7,12 +7,20 @@ test -z "$srcdir" && srcdir=. stat=0 test "x$HBHEADERS" = x && HBHEADERS=`find . -maxdepth 1 -name 'hb*.h'` +test "x$HBSOURCES" = x && HBSOURCES=`find . -maxdepth 1 -name 'hb*.h'` for x in $HBHEADERS; do test -f $srcdir/$x && x=$srcdir/$x if ! grep -q HB_BEGIN_DECLS "$x" || ! grep -q HB_END_DECLS "$x"; then - echo "Ouch, file $x does not HB_BEGIN_DECLS / HB_END_DECLS" + echo "Ouch, file $x does not have HB_BEGIN_DECLS / HB_END_DECLS, but it should" + stat=1 + fi +done +for x in $HBSOURCES; do + test -f $srcdir/$x && x=$srcdir/$x + if grep -q HB_BEGIN_DECLS "$x" || grep -q HB_END_DECLS "$x"; then + echo "Ouch, file $x has HB_BEGIN_DECLS / HB_END_DECLS, but it shouldn't" stat=1 fi done diff --git a/src/hb-fallback-shape-private.hh b/src/hb-fallback-shape-private.hh index 159456d..0ef155c 100644 --- a/src/hb-fallback-shape-private.hh +++ b/src/hb-fallback-shape-private.hh @@ -32,16 +32,10 @@ #include "hb-shape.h" -HB_BEGIN_DECLS - - HB_INTERNAL hb_bool_t _hb_fallback_shape (hb_font_t *font, hb_buffer_t *buffer, const hb_feature_t *features, unsigned int num_features); - -HB_END_DECLS - #endif /* HB_FALLBACK_SHAPE_PRIVATE_HH */ diff --git a/src/hb-ot-shape-complex-indic-machine.rl b/src/hb-ot-shape-complex-indic-machine.rl index 93ca29a..7dcbb06 100644 --- a/src/hb-ot-shape-complex-indic-machine.rl +++ b/src/hb-ot-shape-complex-indic-machine.rl @@ -29,8 +29,6 @@ #include "hb-private.hh" -HB_BEGIN_DECLS - %%{ machine indic_syllable_machine; alphtype unsigned char; @@ -110,6 +108,4 @@ find_syllables (const hb_ot_map_t *map, hb_buffer_t *buffer, hb_mask_t *mask_arr }%% } -HB_END_DECLS - #endif /* HB_OT_SHAPE_COMPLEX_INDIC_MACHINE_HH */ commit 5c5bc96216c9ad58243eb3ed27b253e237f08ebe Author: Behdad Esfahbod <[email protected]> Date: Fri Jul 13 10:15:37 2012 -0400 Allow overriding HB_BEGIN_DECLS / HB_END_DECLS diff --git a/src/hb-common.h b/src/hb-common.h index 78bc43c..1728db7 100644 --- a/src/hb-common.h +++ b/src/hb-common.h @@ -33,6 +33,7 @@ #ifndef HB_COMMON_H #define HB_COMMON_H +#ifndef HB_BEGIN_DECLS # ifdef __cplusplus # define HB_BEGIN_DECLS extern "C" { # define HB_END_DECLS } @@ -40,6 +41,7 @@ # define HB_BEGIN_DECLS # define HB_END_DECLS # endif /* !__cplusplus */ +#endif HB_BEGIN_DECLS commit ec5f5f0f8a1d5b3ff98452175bb4450a59897620 Author: Behdad Esfahbod <[email protected]> Date: Fri Jul 13 10:00:42 2012 -0400 Don't export inline methods diff --git a/configure.ac b/configure.ac index 0e2bbf6..acfc2ea 100644 --- a/configure.ac +++ b/configure.ac @@ -66,6 +66,9 @@ if test "x$GCC" = "xyes"; then # Make sure we don't link to libstdc++ CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions" + # Hide inline methods + CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" + case "$host" in arm-*-*) # Request byte alignment on arm commit 50a4e78b530563917eb606ff3b96dcc9eed5b3ee Author: Behdad Esfahbod <[email protected]> Date: Fri Jul 13 09:48:39 2012 -0400 Check for exported weak symbols Ouch, all our C++ inline functions are being exported (weakly) already. Fix coming. diff --git a/src/check-internal-symbols.sh b/src/check-internal-symbols.sh index ba6a45d..729b086 100755 --- a/src/check-internal-symbols.sh +++ b/src/check-internal-symbols.sh @@ -14,12 +14,18 @@ else exit 77 fi +if which c++filt 2>/dev/null >/dev/null; then + cplusplusfilt=c++filt +else + cplusplusfilt=cat +fi + tested=false for suffix in so; do so=.libs/libharfbuzz.$suffix if test -f "$so"; then echo "Checking that we are not exposing internal symbols" - if nm $so | grep ' T ' | grep -v ' T _fini\>\| T _init\>\| T hb_'; then + if nm $so | grep ' [TW] ' | $cplusplusfilt | grep -v ' T _fini\>\| T _init\>\| T hb_'; then echo "Ouch, internal symbols exposed" stat=1 fi commit b5aeb95afeb13a66177caada9f5d5ad4cddbd35f Author: Behdad Esfahbod <[email protected]> Date: Fri Jul 13 09:45:54 2012 -0400 Make hb_in_range() static diff --git a/src/hb-private.hh b/src/hb-private.hh index 70b87c9..29cd68c 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -718,7 +718,7 @@ struct hb_auto_trace_t<0> { * Checks for lo <= u <= hi but with an optimization if lo and hi * are only different in a contiguous set of lower-most bits. */ -template <typename T> inline bool +template <typename T> static inline bool hb_in_range (T u, T lo, T hi) { if ( ((lo^hi) & lo) == 0 && commit 271c8f89075607c689938b4f5e60323d9a1acd70 Author: Behdad Esfahbod <[email protected]> Date: Fri Jul 13 09:32:30 2012 -0400 Minor diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 90937ca..3717269 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -233,7 +233,7 @@ hb_ft_get_glyph_contour_point (hb_font_t *font HB_UNUSED, } static hb_bool_t -hb_ft_get_glyph_name (hb_font_t *font, +hb_ft_get_glyph_name (hb_font_t *font HB_UNUSED, void *font_data, hb_codepoint_t glyph, char *name, unsigned int size, @@ -249,7 +249,7 @@ hb_ft_get_glyph_name (hb_font_t *font, } static hb_bool_t -hb_ft_get_glyph_from_name (hb_font_t *font, +hb_ft_get_glyph_from_name (hb_font_t *font HB_UNUSED, void *font_data, const char *name, int len, /* -1 means nul-terminated */ hb_codepoint_t *glyph, _______________________________________________ HarfBuzz mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/harfbuzz
