-#define GLYPH_CACHEL(window, index) \
- Dynarr_atp (window->glyph_cachels, index)
-#define GLYPH_CACHEL_GLYPH(window, index) \
- Dynarr_atp (window->glyph_cachels, index)->glyph
-#define GLYPH_CACHEL_WIDTH(window, index) \
- Dynarr_atp (window->glyph_cachels, index)->width
-#define GLYPH_CACHEL_ASCENT(window, index) \
- Dynarr_atp (window->glyph_cachels, index)->ascent
-#define GLYPH_CACHEL_DESCENT(window, index) \
- Dynarr_atp (window->glyph_cachels, index)->descent
-
-void mark_glyph_cachels (glyph_cachel_dynarr *elements,
- void (*markobj) (Lisp_Object));
+#ifdef ERROR_CHECK_GLYPHS
+
+#include "window.h"
+
+INLINE_HEADER int
+GLYPH_CACHEL_WIDTH (struct window *window, int ind);
+INLINE_HEADER int
+GLYPH_CACHEL_WIDTH (struct window *window, int ind)
+{
+ int wid = Dynarr_atp (window->glyph_cachels, ind)->width;
+ assert (wid >= 0 && wid < 10000);
+ return wid;
+}
+INLINE_HEADER int
+GLYPH_CACHEL_ASCENT (struct window *window, int ind);
+INLINE_HEADER int
+GLYPH_CACHEL_ASCENT (struct window *window, int ind)
+{
+ int wid = Dynarr_atp (window->glyph_cachels, ind)->ascent;
+ assert (wid >= 0 && wid < 10000);
+ return wid;
+}
+INLINE_HEADER int
+GLYPH_CACHEL_DESCENT (struct window *window, int ind);
+INLINE_HEADER int
+GLYPH_CACHEL_DESCENT (struct window *window, int ind)
+{
+ int wid = Dynarr_atp (window->glyph_cachels, ind)->descent;
+ assert (wid >= 0 && wid < 10000);
+ return wid;
+}
+
+#else /* not ERROR_CHECK_GLYPHS */
+
+#define GLYPH_CACHEL_WIDTH(window, ind) \
+ Dynarr_atp (window->glyph_cachels, ind)->width
+#define GLYPH_CACHEL_ASCENT(window, ind) \
+ Dynarr_atp (window->glyph_cachels, ind)->ascent
+#define GLYPH_CACHEL_DESCENT(window, ind) \
+ Dynarr_atp (window->glyph_cachels, ind)->descent
+
+#endif /* not ERROR_CHECK_GLYPHS */
+
+#define GLYPH_CACHEL(window, ind) \
+ Dynarr_atp (window->glyph_cachels, ind)
+#define GLYPH_CACHEL_GLYPH(window, ind) \
+ Dynarr_atp (window->glyph_cachels, ind)->glyph
+#define GLYPH_CACHEL_DIRTYP(window, ind) \
+ Dynarr_atp (window->glyph_cachels, ind)->dirty
+
+void mark_glyph_cachels (glyph_cachel_dynarr *elements);