[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 098347a: Clarify intent of FACE_FROM_ID and IMAGE_F
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 098347a: Clarify intent of FACE_FROM_ID and IMAGE_FROM_ID |
Date: |
Fri, 24 Jun 2016 00:20:15 +0000 (UTC) |
branch: master
commit 098347a9b4e16935fc2c9e08817896019e2f1879
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Clarify intent of FACE_FROM_ID and IMAGE_FROM_ID
* src/dispextern.h (FACE_OPT_FROM_ID): Don’t use FACE_FROM_ID,
since it is intended to be used only when it returns a non-null
pointer, and here the pointer might be null.
(IMAGE_OPT_FROM_ID): Don’t use IMAGE_FROM_ID, for similar reasons.
---
src/dispextern.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/dispextern.h b/src/dispextern.h
index d0fc3b2..08dcd89 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1812,7 +1812,7 @@ struct face_cache
bool_bf menu_face_changed_p : 1;
};
-/* Return a pointer to the cached face with ID on frame F. */
+/* Return a non-null pointer to the cached face with ID on frame F. */
#define FACE_FROM_ID(F, ID) \
(eassert (UNSIGNED_CMP (ID, <, FRAME_FACE_CACHE (F)->used)), \
@@ -1823,7 +1823,7 @@ struct face_cache
#define FACE_OPT_FROM_ID(F, ID) \
(UNSIGNED_CMP (ID, <, FRAME_FACE_CACHE (F)->used) \
- ? FACE_FROM_ID (F, ID) \
+ ? FRAME_FACE_CACHE (F)->faces_by_id[ID] \
: NULL)
/* True if FACE is suitable for displaying ASCII characters. */
@@ -3093,7 +3093,7 @@ struct image_cache
};
-/* A pointer to the image with id ID on frame F. */
+/* A non-null pointer to the image with id ID on frame F. */
#define IMAGE_FROM_ID(F, ID) \
(eassert (UNSIGNED_CMP (ID, <, FRAME_IMAGE_CACHE (F)->used)), \
@@ -3104,7 +3104,7 @@ struct image_cache
#define IMAGE_OPT_FROM_ID(F, ID) \
(UNSIGNED_CMP (ID, <, FRAME_IMAGE_CACHE (F)->used) \
- ? IMAGE_FROM_ID (F, ID) \
+ ? FRAME_IMAGE_CACHE (F)->images[ID] \
: NULL)
/* Size of bucket vector of image caches. Should be prime. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 098347a: Clarify intent of FACE_FROM_ID and IMAGE_FROM_ID,
Paul Eggert <=