aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm <[email protected]>2008-02-27 22:48:44 +0000
committerKim F. Storm <[email protected]>2008-02-27 22:48:44 +0000
commit652df850a1ab6d8aeb3ab5461c75235d000cb67e (patch)
treeacd1a44d001094c6378bf12dcc5b745efebed56a /src
parentb6d898a2052fbad8a0e1d20251c2c082a5b52805 (diff)
(CHAR_GLYPH_SPACE_P): Simplify.
(GLYPH_FROM_CHAR_GLYPH): Replace macro by ... (SET_GLYPH_FROM_CHAR_GLYPH): ... this macro. Change users. (GLYPH_INVALID_P): New macro. (spec_glyph_lookup_face): Update prototype.
Diffstat (limited to 'src')
-rw-r--r--src/dispextern.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index 642bd97d6a..f592d8752a 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -418,7 +418,7 @@ struct glyph
/* Is GLYPH a space? */
#define CHAR_GLYPH_SPACE_P(GLYPH) \
- (GLYPH_FROM_CHAR_GLYPH ((GLYPH)) == SPACEGLYPH)
+ ((GLYPH).u.ch == SPACEGLYPH)
/* Are glyph slices of glyphs *X and *Y equal */
@@ -465,18 +465,25 @@ struct glyph
#define SET_CHAR_GLYPH_FROM_GLYPH(GLYPH, FROM) \
SET_CHAR_GLYPH ((GLYPH), \
- FAST_GLYPH_CHAR ((FROM)), \
- FAST_GLYPH_FACE ((FROM)), \
+ GLYPH_CHAR ((FROM)), \
+ GLYPH_FACE ((FROM)), \
0)
/* Construct a glyph code from a character glyph GLYPH. If the
character is multibyte, return -1 as we can't use glyph table for a
multibyte character. */
-#define GLYPH_FROM_CHAR_GLYPH(GLYPH) \
- ((GLYPH).u.ch < 256 \
- ? ((GLYPH).u.ch | ((GLYPH).face_id << CHARACTERBITS)) \
- : -1)
+#define SET_GLYPH_FROM_CHAR_GLYPH(G, GLYPH) \
+ do \
+ { \
+ if ((GLYPH).u.ch < 256) \
+ SET_GLYPH ((G), (GLYPH).u.ch, ((GLYPH).face_id)); \
+ else \
+ SET_GLYPH ((G), -1, 0); \
+ } \
+ while (0)
+
+#define GLYPH_INVALID_P(GLYPH) (GLYPH_CHAR (GLYPH) < 0)
/* Is GLYPH a padding glyph? */
@@ -3017,7 +3024,7 @@ void bitch_at_user P_ ((void));
void init_display P_ ((void));
void syms_of_display P_ ((void));
extern Lisp_Object Qredisplay_dont_pause;
-GLYPH spec_glyph_lookup_face P_ ((struct window *, GLYPH));
+void spec_glyph_lookup_face P_ ((struct window *, GLYPH *));
/* Defined in terminal.c */