diff options
| author | Paul Eggert | 2012-08-02 00:31:34 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-08-02 00:31:34 -0700 |
| commit | f162bcc31c3d7d168da47ca2f007f58e11a36948 (patch) | |
| tree | eef19d0a840bd99304751fef539ba100134c91b9 /src/buffer.h | |
| parent | 8922df07b2f370debf70424f778073e1ca32e5e3 (diff) | |
| download | emacs-f162bcc31c3d7d168da47ca2f007f58e11a36948.tar.gz emacs-f162bcc31c3d7d168da47ca2f007f58e11a36948.zip | |
Use C99-style 'extern inline' if available.
* lib-src/profile.c (SYSTIME_INLINE): Define.
* nt/config.nt: Sync with autogen/config.in.
(_GL_INLINE, _GL_EXTERN_INLINE, _GL_INLINE_HEADER_BEGIN)
(_GL_INLINE_HEADER_END): New macros.
* src/buffer.h (BUFFER_INLINE):
* src/category.h (CATEGORY_INLINE):
* src/character.h (CHARACTER_INLINE):
* src/charset.h (CHARSET_INLINE):
* src/composite.h (COMPOSITE_INLINE):
* src/dispextern.h (DISPEXTERN_INLINE):
* src/lisp.h (LISP_INLINE):
* src/systime.h (SYSTIME_INLINE):
New macro, replacing 'static inline' in this header.
* src/buffer.h, src/category.h, src/character.h, src/charset.h:
* src/composite.h, src/dispextern.h, lisp.h, systime.h:
Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
* src/alloc.c (LISP_INLINE):
* src/buffer.c (BUFFER_INLINE):
* src/category.c (CATEGORY_INLINE):
* src/character.c (CHARACTER_INLINE):
* src/charset.c (CHARSET_INLINE):
* src/composite.c (COMPOSITE_INLINE):
* src/dispnew.c (DISPEXTERN_INLINE):
* src/sysdep.c (SYSTIME_INLINE):
Define to EXTERN_INLINE, so that the corresponding functions
are compiled into code.
* src/conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
(INLINE_HEADER_END): New macros.
* src/lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
since it's used in non-static inline functions now.
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/buffer.h b/src/buffer.h index cf571e06b53..b13aab8443e 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -21,6 +21,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 21 | #include <sys/types.h> /* for off_t, time_t */ | 21 | #include <sys/types.h> /* for off_t, time_t */ |
| 22 | #include "systime.h" /* for EMACS_TIME */ | 22 | #include "systime.h" /* for EMACS_TIME */ |
| 23 | 23 | ||
| 24 | INLINE_HEADER_BEGIN | ||
| 25 | #ifndef BUFFER_INLINE | ||
| 26 | # define BUFFER_INLINE INLINE | ||
| 27 | #endif | ||
| 28 | |||
| 24 | /* Accessing the parameters of the current buffer. */ | 29 | /* Accessing the parameters of the current buffer. */ |
| 25 | 30 | ||
| 26 | /* These macros come in pairs, one for the char position | 31 | /* These macros come in pairs, one for the char position |
| @@ -961,7 +966,7 @@ extern Lisp_Object Qfirst_change_hook; | |||
| 961 | the buffer to the next character after fetching this one. Instead, | 966 | the buffer to the next character after fetching this one. Instead, |
| 962 | use either FETCH_CHAR_ADVANCE or STRING_CHAR_AND_LENGTH. */ | 967 | use either FETCH_CHAR_ADVANCE or STRING_CHAR_AND_LENGTH. */ |
| 963 | 968 | ||
| 964 | static inline int | 969 | BUFFER_INLINE int |
| 965 | FETCH_MULTIBYTE_CHAR (ptrdiff_t pos) | 970 | FETCH_MULTIBYTE_CHAR (ptrdiff_t pos) |
| 966 | { | 971 | { |
| 967 | unsigned char *p = ((pos >= GPT_BYTE ? GAP_SIZE : 0) | 972 | unsigned char *p = ((pos >= GPT_BYTE ? GAP_SIZE : 0) |
| @@ -973,7 +978,7 @@ FETCH_MULTIBYTE_CHAR (ptrdiff_t pos) | |||
| 973 | If POS doesn't point the head of valid multi-byte form, only the byte at | 978 | If POS doesn't point the head of valid multi-byte form, only the byte at |
| 974 | POS is returned. No range checking. */ | 979 | POS is returned. No range checking. */ |
| 975 | 980 | ||
| 976 | static inline int | 981 | BUFFER_INLINE int |
| 977 | BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos) | 982 | BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos) |
| 978 | { | 983 | { |
| 979 | unsigned char *p | 984 | unsigned char *p |
| @@ -1090,7 +1095,7 @@ extern int last_per_buffer_idx; | |||
| 1090 | (*(Lisp_Object *)((OFFSET) + (char *) (BUFFER))) | 1095 | (*(Lisp_Object *)((OFFSET) + (char *) (BUFFER))) |
| 1091 | 1096 | ||
| 1092 | /* Downcase a character C, or make no change if that cannot be done. */ | 1097 | /* Downcase a character C, or make no change if that cannot be done. */ |
| 1093 | static inline int | 1098 | BUFFER_INLINE int |
| 1094 | downcase (int c) | 1099 | downcase (int c) |
| 1095 | { | 1100 | { |
| 1096 | Lisp_Object downcase_table = BVAR (current_buffer, downcase_table); | 1101 | Lisp_Object downcase_table = BVAR (current_buffer, downcase_table); |
| @@ -1099,10 +1104,10 @@ downcase (int c) | |||
| 1099 | } | 1104 | } |
| 1100 | 1105 | ||
| 1101 | /* 1 if C is upper case. */ | 1106 | /* 1 if C is upper case. */ |
| 1102 | static inline int uppercasep (int c) { return downcase (c) != c; } | 1107 | BUFFER_INLINE int uppercasep (int c) { return downcase (c) != c; } |
| 1103 | 1108 | ||
| 1104 | /* Upcase a character C known to be not upper case. */ | 1109 | /* Upcase a character C known to be not upper case. */ |
| 1105 | static inline int | 1110 | BUFFER_INLINE int |
| 1106 | upcase1 (int c) | 1111 | upcase1 (int c) |
| 1107 | { | 1112 | { |
| 1108 | Lisp_Object upcase_table = BVAR (current_buffer, upcase_table); | 1113 | Lisp_Object upcase_table = BVAR (current_buffer, upcase_table); |
| @@ -1111,8 +1116,10 @@ upcase1 (int c) | |||
| 1111 | } | 1116 | } |
| 1112 | 1117 | ||
| 1113 | /* 1 if C is lower case. */ | 1118 | /* 1 if C is lower case. */ |
| 1114 | static inline int lowercasep (int c) | 1119 | BUFFER_INLINE int lowercasep (int c) |
| 1115 | { return !uppercasep (c) && upcase1 (c) != c; } | 1120 | { return !uppercasep (c) && upcase1 (c) != c; } |
| 1116 | 1121 | ||
| 1117 | /* Upcase a character C, or make no change if that cannot be done. */ | 1122 | /* Upcase a character C, or make no change if that cannot be done. */ |
| 1118 | static inline int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); } | 1123 | BUFFER_INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); } |
| 1124 | |||
| 1125 | INLINE_HEADER_END | ||