summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-08-06 18:34:47 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-08-06 18:36:57 -0400
commitca89182f510d3627526b3f5e7379ce5a89440354 (patch)
treeaa99be3b5f4a013eef769b013000d3f2cd81927a
parenteb3029af018c1e70a3bc387fee6a9fa7373d06c4 (diff)
downloadpango-ca89182f510d3627526b3f5e7379ce5a89440354.tar.gz
[HB] Fix various XXX issues
-rw-r--r--pango/opentype/hb-open-type-private.hh13
-rw-r--r--pango/opentype/hb-ot-layout-gdef-private.hh5
2 files changed, 12 insertions, 6 deletions
diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh
index 08dd0757..494a99db 100644
--- a/pango/opentype/hb-open-type-private.hh
+++ b/pango/opentype/hb-open-type-private.hh
@@ -298,9 +298,16 @@ _hb_sanitize_edit (hb_sanitize_context_t *context,
#define SANITIZE_OBJ(X) SANITIZE_MEM(&(X), sizeof (X))
#define SANITIZE_GET_SIZE() SANITIZE_SELF() && SANITIZE_MEM (this, this->get_size ())
-#define SANITIZE_MEM(B,L) HB_LIKELY (context->start <= CONST_CHARP(B) && CONST_CHARP(B) + (L) <= context->end) /* XXX overflow */
+/* TODO Optimize this if L is fixed (gcc magic) */
+#define SANITIZE_MEM(B,L) \
+ HB_LIKELY (context->start <= CONST_CHARP(B) && \
+ CONST_CHARP(B) < context->end && \
+ context->end - CONST_CHARP(B) < (L))
-#define NEUTER(Var, Val) (SANITIZE_OBJ (Var) && _hb_sanitize_edit (context, CONST_CHARP(&(Var)), sizeof (Var)) && ((Var) = (Val), true))
+#define NEUTER(Var, Val) \
+ (SANITIZE_OBJ (Var) && \
+ _hb_sanitize_edit (context, CONST_CHARP(&(Var)), sizeof (Var)) && \
+ ((Var) = (Val), true))
/* Template to sanitize an object. */
@@ -311,7 +318,7 @@ struct Sanitizer
hb_sanitize_context_t context;
bool sane;
- /* XXX is_sane() stuff */
+ /* TODO is_sane() stuff */
retry:
#if HB_DEBUG
diff --git a/pango/opentype/hb-ot-layout-gdef-private.hh b/pango/opentype/hb-ot-layout-gdef-private.hh
index b1b034ba..fcf85c25 100644
--- a/pango/opentype/hb-ot-layout-gdef-private.hh
+++ b/pango/opentype/hb-ot-layout-gdef-private.hh
@@ -99,7 +99,7 @@ struct CaretValueFormat1
private:
inline int get_caret_value (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id) const
{
- /* XXX vertical */
+ /* TODO vertical */
return context->font->x_scale * coordinate / 0x10000;
}
@@ -141,7 +141,7 @@ struct CaretValueFormat3
inline int get_caret_value (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id) const
{
- /* XXX vertical */
+ /* TODO vertical */
return context->font->x_scale * coordinate / 0x10000 +
((this+deviceTable).get_delta (context->font->x_ppem) << 6);
}
@@ -163,7 +163,6 @@ ASSERT_SIZE (CaretValueFormat3, 6);
struct CaretValue
{
- /* XXX we need access to a load-contour-point vfunc here */
int get_caret_value (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id) const
{
switch (u.format) {