#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. */
hb_sanitize_context_t context;
bool sane;
- /* XXX is_sane() stuff */
+ /* TODO is_sane() stuff */
retry:
#if HB_DEBUG
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;
}
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);
}
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) {