aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2016-06-24 02:19:13 +0200
committerPaul Eggert2016-06-24 02:20:09 +0200
commit098347a9b4e16935fc2c9e08817896019e2f1879 (patch)
tree9d09260d096edefc5a98d6a0f5f130b999f1115a /src
parent90d0833f24be04e4b36aabda8cae1681ae768258 (diff)
downloademacs-098347a9b4e16935fc2c9e08817896019e2f1879.tar.gz
emacs-098347a9b4e16935fc2c9e08817896019e2f1879.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/dispextern.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index d0fc3b24df7..08dcd89709a 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1812,7 +1812,7 @@ struct face_cache
1812 bool_bf menu_face_changed_p : 1; 1812 bool_bf menu_face_changed_p : 1;
1813}; 1813};
1814 1814
1815/* Return a pointer to the cached face with ID on frame F. */ 1815/* Return a non-null pointer to the cached face with ID on frame F. */
1816 1816
1817#define FACE_FROM_ID(F, ID) \ 1817#define FACE_FROM_ID(F, ID) \
1818 (eassert (UNSIGNED_CMP (ID, <, FRAME_FACE_CACHE (F)->used)), \ 1818 (eassert (UNSIGNED_CMP (ID, <, FRAME_FACE_CACHE (F)->used)), \
@@ -1823,7 +1823,7 @@ struct face_cache
1823 1823
1824#define FACE_OPT_FROM_ID(F, ID) \ 1824#define FACE_OPT_FROM_ID(F, ID) \
1825 (UNSIGNED_CMP (ID, <, FRAME_FACE_CACHE (F)->used) \ 1825 (UNSIGNED_CMP (ID, <, FRAME_FACE_CACHE (F)->used) \
1826 ? FACE_FROM_ID (F, ID) \ 1826 ? FRAME_FACE_CACHE (F)->faces_by_id[ID] \
1827 : NULL) 1827 : NULL)
1828 1828
1829/* True if FACE is suitable for displaying ASCII characters. */ 1829/* True if FACE is suitable for displaying ASCII characters. */
@@ -3093,7 +3093,7 @@ struct image_cache
3093}; 3093};
3094 3094
3095 3095
3096/* A pointer to the image with id ID on frame F. */ 3096/* A non-null pointer to the image with id ID on frame F. */
3097 3097
3098#define IMAGE_FROM_ID(F, ID) \ 3098#define IMAGE_FROM_ID(F, ID) \
3099 (eassert (UNSIGNED_CMP (ID, <, FRAME_IMAGE_CACHE (F)->used)), \ 3099 (eassert (UNSIGNED_CMP (ID, <, FRAME_IMAGE_CACHE (F)->used)), \
@@ -3104,7 +3104,7 @@ struct image_cache
3104 3104
3105#define IMAGE_OPT_FROM_ID(F, ID) \ 3105#define IMAGE_OPT_FROM_ID(F, ID) \
3106 (UNSIGNED_CMP (ID, <, FRAME_IMAGE_CACHE (F)->used) \ 3106 (UNSIGNED_CMP (ID, <, FRAME_IMAGE_CACHE (F)->used) \
3107 ? IMAGE_FROM_ID (F, ID) \ 3107 ? FRAME_IMAGE_CACHE (F)->images[ID] \
3108 : NULL) 3108 : NULL)
3109 3109
3110/* Size of bucket vector of image caches. Should be prime. */ 3110/* Size of bucket vector of image caches. Should be prime. */