summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/harfbuzz-ng/src/hb-private.hh
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2014-03-18 13:16:26 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-03-20 15:55:39 +0100
commit3f0f86b0caed75241fa71c95a5d73bc0164348c5 (patch)
tree92b9fb00f2e9e90b0be2262093876d4f43b6cd13 /chromium/third_party/harfbuzz-ng/src/hb-private.hh
parente90d7c4b152c56919d963987e2503f9909a666d2 (diff)
Update to new stable branch 1750
This also includes an updated ninja and chromium dependencies needed on Windows. Change-Id: Icd597d80ed3fa4425933c9f1334c3c2e31291c42 Reviewed-by: Zoltan Arvai <zarvai@inf.u-szeged.hu> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'chromium/third_party/harfbuzz-ng/src/hb-private.hh')
-rw-r--r--chromium/third_party/harfbuzz-ng/src/hb-private.hh19
1 files changed, 15 insertions, 4 deletions
diff --git a/chromium/third_party/harfbuzz-ng/src/hb-private.hh b/chromium/third_party/harfbuzz-ng/src/hb-private.hh
index 8121640f01c..4b72260ed5c 100644
--- a/chromium/third_party/harfbuzz-ng/src/hb-private.hh
+++ b/chromium/third_party/harfbuzz-ng/src/hb-private.hh
@@ -79,6 +79,9 @@ static inline Type MIN (const Type &a, const Type &b) { return a < b ? a : b; }
template <typename Type>
static inline Type MAX (const Type &a, const Type &b) { return a > b ? a : b; }
+static inline unsigned int DIV_CEIL (const unsigned int a, unsigned int b)
+{ return (a + (b - 1)) / b; }
+
#undef ARRAY_LENGTH
template <typename Type, unsigned int n>
@@ -321,14 +324,22 @@ struct hb_prealloced_array_t
inline void pop (void)
{
len--;
- /* TODO: shrink array if needed */
+ }
+
+ inline void remove (unsigned int i)
+ {
+ if (unlikely (i >= len))
+ return;
+ memmove (static_cast<void *> (&array[i]),
+ static_cast<void *> (&array[i + 1]),
+ (len - i - 1) * sizeof (Type));
+ len--;
}
inline void shrink (unsigned int l)
{
if (l < len)
len = l;
- /* TODO: shrink array if needed */
}
template <typename T>
@@ -376,7 +387,7 @@ struct hb_prealloced_array_t
}
};
-#define HB_AUTO_ARRAY_PREALLOCED 64
+#define HB_AUTO_ARRAY_PREALLOCED 16
template <typename Type>
struct hb_auto_array_t : hb_prealloced_array_t <Type, HB_AUTO_ARRAY_PREALLOCED>
{
@@ -595,7 +606,7 @@ _hb_debug_msg_va (const char *what,
#define ULBAR "\342\225\257" /* U+256F BOX DRAWINGS LIGHT ARC UP AND LEFT */
#define LBAR "\342\225\264" /* U+2574 BOX DRAWINGS LIGHT LEFT */
static const char bars[] = VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR VBAR;
- fprintf (stderr, "%2d %s" VRBAR "%s",
+ fprintf (stderr, "%2u %s" VRBAR "%s",
level,
bars + sizeof (bars) - 1 - MIN ((unsigned int) sizeof (bars), (unsigned int) (sizeof (VBAR) - 1) * level),
level_dir ? (level_dir > 0 ? DLBAR : ULBAR) : LBAR);