aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.h
diff options
context:
space:
mode:
authorPaul Eggert2012-08-02 00:31:34 -0700
committerPaul Eggert2012-08-02 00:31:34 -0700
commitf162bcc31c3d7d168da47ca2f007f58e11a36948 (patch)
treeeef19d0a840bd99304751fef539ba100134c91b9 /src/buffer.h
parent8922df07b2f370debf70424f778073e1ca32e5e3 (diff)
downloademacs-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.h21
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
24INLINE_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
964static inline int 969BUFFER_INLINE int
965FETCH_MULTIBYTE_CHAR (ptrdiff_t pos) 970FETCH_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
976static inline int 981BUFFER_INLINE int
977BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos) 982BUF_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. */
1093static inline int 1098BUFFER_INLINE int
1094downcase (int c) 1099downcase (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. */
1102static inline int uppercasep (int c) { return downcase (c) != c; } 1107BUFFER_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. */
1105static inline int 1110BUFFER_INLINE int
1106upcase1 (int c) 1111upcase1 (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. */
1114static inline int lowercasep (int c) 1119BUFFER_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. */
1118static inline int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); } 1123BUFFER_INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); }
1124
1125INLINE_HEADER_END