Index: third_party/harfbuzz-ng/src/hb-private.hh |
diff --git a/third_party/harfbuzz-ng/src/hb-private.hh b/third_party/harfbuzz-ng/src/hb-private.hh |
index d9b0860b7bad58a5466be81d01047597a1da980c..c92cdec5164d775c4ad638fbee05d8db6bf0db3e 100644 |
--- a/third_party/harfbuzz-ng/src/hb-private.hh |
+++ b/third_party/harfbuzz-ng/src/hb-private.hh |
@@ -539,47 +539,6 @@ struct hb_lockable_set_t |
}; |
- |
- |
-/* Big-endian handling */ |
- |
-static inline uint16_t hb_be_uint16 (const uint16_t v) |
-{ |
- const uint8_t *V = (const uint8_t *) &v; |
- return (V[0] << 8) | V[1]; |
-} |
- |
-static inline uint16_t hb_uint16_swap (const uint16_t v) |
-{ |
- return (v >> 8) | (v << 8); |
-} |
- |
-static inline uint32_t hb_uint32_swap (const uint32_t v) |
-{ |
- return (hb_uint16_swap (v) << 16) | hb_uint16_swap (v >> 16); |
-} |
- |
-/* Note, of the following macros, uint16_get is the one called many many times. |
- * If there is any optimizations to be done, it's in that macro. However, I |
- * already confirmed that on my T400 ThinkPad at least, using bswap_16(), which |
- * results in a single ror instruction, does NOT speed this up. In fact, it |
- * resulted in a minor slowdown. At any rate, note that v may not be correctly |
- * aligned, so I think the current implementation is optimal. |
- */ |
- |
-#define hb_be_uint16_put(v,V) HB_STMT_START { v[0] = (V>>8); v[1] = (V); } HB_STMT_END |
-#define hb_be_uint16_get(v) (uint16_t) ((v[0] << 8) + v[1]) |
-#define hb_be_uint16_eq(a,b) (a[0] == b[0] && a[1] == b[1]) |
- |
-#define hb_be_uint32_put(v,V) HB_STMT_START { v[0] = (V>>24); v[1] = (V>>16); v[2] = (V>>8); v[3] = (V); } HB_STMT_END |
-#define hb_be_uint32_get(v) (uint32_t) ((v[0] << 24) + (v[1] << 16) + (v[2] << 8) + v[3]) |
-#define hb_be_uint32_eq(a,b) (a[0] == b[0] && a[1] == b[1] && a[2] == b[2] && a[3] == b[3]) |
- |
-#define hb_be_uint24_put(v,V) HB_STMT_START { v[0] = (V>>16); v[1] = (V>>8); v[2] = (V); } HB_STMT_END |
-#define hb_be_uint24_get(v) (uint32_t) ((v[0] << 16) + (v[1] << 8) + v[2]) |
-#define hb_be_uint24_eq(a,b) (a[0] == b[0] && a[1] == b[1] && a[2] == b[2]) |
- |
- |
/* ASCII tag/character handling */ |
static inline bool ISALPHA (unsigned char c) |
@@ -756,7 +715,9 @@ _hb_debug_msg<0> (const char *what HB_UNUSED, |
*/ |
template <typename T> |
-struct hb_printer_t {}; |
+struct hb_printer_t { |
+ const char *print (const T&) { return "something"; } |
+}; |
template <> |
struct hb_printer_t<bool> { |
@@ -889,7 +850,7 @@ hb_in_ranges (T u, T lo1, T hi1, T lo2, T hi2, T lo3, T hi3) |
#define FLAG_RANGE(x,y) (ASSERT_STATIC_EXPR_ZERO ((x) < (y)) + FLAG(y+1) - FLAG(x)) |
-template <typename T, typename T2> inline void |
+template <typename T, typename T2> static inline void |
hb_bubble_sort (T *array, unsigned int len, int(*compar)(const T *, const T *), T2 *array2) |
{ |
if (unlikely (!len)) |
@@ -922,7 +883,7 @@ hb_bubble_sort (T *array, unsigned int len, int(*compar)(const T *, const T *), |
} while (k); |
} |
-template <typename T> inline void |
+template <typename T> static inline void |
hb_bubble_sort (T *array, unsigned int len, int(*compar)(const T *, const T *)) |
{ |
hb_bubble_sort (array, len, compar, (int *) NULL); |
@@ -951,12 +912,12 @@ hb_codepoint_parse (const char *s, unsigned int len, int base, hb_codepoint_t *o |
struct hb_options_t |
{ |
- int initialized : 1; |
- int uniscribe_bug_compatible : 1; |
+ unsigned int initialized : 1; |
+ unsigned int uniscribe_bug_compatible : 1; |
}; |
union hb_options_union_t { |
- int i; |
+ unsigned int i; |
hb_options_t opts; |
}; |
ASSERT_STATIC (sizeof (int) == sizeof (hb_options_union_t)); |