diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-04-17 07:57:25 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-04-17 09:17:35 -0700 |
commit | 3e46a2315f1a999f5811f57a60a2a55f95d8fbb0 (patch) | |
tree | 64e35b78bb77f3eba5148650fb7a98bbda7f14d6 /src/bidi.c | |
parent | 7f1dae114dffbf4bdec60e38ada4eb0673cfb4e2 (diff) | |
download | emacs-3e46a2315f1a999f5811f57a60a2a55f95d8fbb0.tar.gz |
Prefer inline functions in character.h
In character.h, replace macros with inline functions or enums
when this is easy. This improves maintainability and
on my platform (Fedora 31 x86-64, gcc -O2) improved CPU
performance very slightly (0.3%) on ‘make compile-always’.
* src/buffer.h (SANE_TAB_WIDTH, CHARACTER_WIDTH):
Move here from character.h, and make them inline functions.
Tune CHARACTER_WIDTH so that ASCII_CHAR_WIDTH is no longer needed.
(sanitize_tab_width, sanitize_char_width):
Move here from character.h.
* src/character.h (MAX_CHAR, MAX_UNICODE_CHAR, MAX_1_BYTE_CHAR)
(MAX_2_BYTE_CHAR, MAX_3_BYTE_CHAR, MAX_4_BYTE_CHAR)
(MAX_5_BYTE_CHAR, MIN_MULTIBYTE_LEADING_CODE)
(MAX_MULTIBYTE_LEADING_CODE, MAX_MULTIBYTE_LENGTH):
Now enum constants instead of macros.
* src/character.h (CHAR_BYTES): Redo to avoid conditional branches.
(CHAR_BYTE8_P, BYTE8_TO_CHAR, UNIBYTE_TO_CHAR, CHAR_TO_BYTE8)
(CHAR_TO_BYTE_SAFE, CHAR_BYTE8_HEAD_P, CHARACTERP)
(CHECK_CHARACTER, CHECK_CHARACTER_CAR, CHECK_CHARACTER_CDR)
(CHAR_PRINTABLE_P, CHAR_BYTES, CHAR_LEADING_CODE, BYTE8_STRING)
(LEADING_CODE_P, TRAILING_CODE_P, CHAR_HEAD_P)
(BYTES_BY_CHAR_HEAD):
Now inline functions instead of macros.
(ASCII_CHAR_WIDTH): Remove; no longer used.
* src/conf_post.h (ATTRIBUTE_PURE): New macro.
* src/lisp.h (char_table_ref): Use it, for better inlining.
* src/fns.c (base64_decode_1): Add now-necessary casts.
Diffstat (limited to 'src/bidi.c')
0 files changed, 0 insertions, 0 deletions