summaryrefslogtreecommitdiff
path: root/src/dispextern.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-04-11 18:35:35 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-04-11 19:00:27 -0700
commit43282a6772630275259dbc7560913c07f72eb06e (patch)
treeab213ea3904d25fb0142817765c501d7add95c0d /src/dispextern.h
parent7abfb6475716e3002c30d10ead0c309b4fed6992 (diff)
downloademacs-43282a6772630275259dbc7560913c07f72eb06e.tar.gz
Remove UNSIGNED_CMP
I added this macro in 2011 to fix some signedness comparison bugs. However, it’s a weird macro and the bugs can be fixed in a more-straightforward way. This helps performance slightly (0.5%) on my platform (Fedora 31 x86-64, GCC 9.3.1 with -O2). * src/casefiddle.c (do_casify_natnum): Use simple comparison instead of UNSIGNED_CMP. * src/character.h (CHAR_VALID_P, SINGLE_BYTE_CHAR_P, CHAR_STRING): * src/composite.h (COMPOSITION_ENCODE_RULE_VALID): * src/lisp.h (ASCII_CHAR_P): Now an inline function, and uses simple comparison instead of UNSIGNED_CMP. * src/dispextern.h (FACE_FROM_ID, FACE_FROM_ID_OR_NULL) (IMAGE_FROM_ID, IMAGE_OPT_FROM_ID): Move these to ... * src/frame.h (FACE_FROM_ID, FACE_FROM_ID_OR_NULL) (IMAGE_FROM_ID, IMAGE_OPT_FROM_ID): ... here, and make them inline functions that no longer use UNSIGNED_CMP. * src/keyboard.c (read_char): UNSIGNED_CMP is not needed here since XFIXNAT always returns a nonnegative value. * src/lisp.h (UNSIGNED_CMP): Remove; no longer used.
Diffstat (limited to 'src/dispextern.h')
-rw-r--r--src/dispextern.h29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index 555946f84cb..ae994d7f9bc 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1855,20 +1855,6 @@ struct face_cache
bool_bf menu_face_changed_p : 1;
};
-/* 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)), \
- FRAME_FACE_CACHE (F)->faces_by_id[ID])
-
-/* Return a pointer to the face with ID on frame F, or null if such a
- face doesn't exist. */
-
-#define FACE_FROM_ID_OR_NULL(F, ID) \
- (UNSIGNED_CMP (ID, <, FRAME_FACE_CACHE (F)->used) \
- ? FRAME_FACE_CACHE (F)->faces_by_id[ID] \
- : NULL)
-
#define FACE_EXTENSIBLE_P(F) \
(!NILP (F->lface[LFACE_EXTEND_INDEX]))
@@ -3163,21 +3149,6 @@ struct image_cache
ptrdiff_t refcount;
};
-
-/* 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)), \
- FRAME_IMAGE_CACHE (F)->images[ID])
-
-/* Value is a pointer to the image with id ID on frame F, or null if
- no image with that id exists. */
-
-#define IMAGE_OPT_FROM_ID(F, ID) \
- (UNSIGNED_CMP (ID, <, FRAME_IMAGE_CACHE (F)->used) \
- ? FRAME_IMAGE_CACHE (F)->images[ID] \
- : NULL)
-
/* Size of bucket vector of image caches. Should be prime. */
#define IMAGE_CACHE_BUCKETS_SIZE 1001