summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-09-20 08:34:36 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-09-20 08:34:36 -0700
commit00382e8b9834e58203507d0461884671b78ebc01 (patch)
treecf28670199af0c1189cbcfbd14ffa49cbaaa0fba /src/buffer.h
parent2fd3a9f7491a59d427150fab0ad4df6ea12b3249 (diff)
downloademacs-00382e8b9834e58203507d0461884671b78ebc01.tar.gz
A simpler, centralized INLINE.
* lib-src/profile.c (INLINE): New macro. (SYSTIME_INLINE): Remove. * src/conf_post.h (INLINE): Define only if not already defined. This allows us to use a single INLINE, defined by one file per executable. * src/emacs.c (INLINE): Define it. Also, include category.h, charset.h, composite.h, dispextern.h, syntax.h, systime.h, so that their INLINE definitions are expanded properly for Emacs. * src/blockinput.h, src/keyboard.c (BLOCKINPUT_INLINE): * src/buffer.h, src/buffer.c (BUFFER_INLINE): * src/category.h, src/category.c (CATEGORY_INLINE): * src/character.h, src/character.c (CHARACTER_INLINE): * src/charset.h, src/charset.c (CHARSET_INLINE): * src/composite.h, src/composite.c (COMPOSITE_INLINE): * src/dispextern.h, src/dispnew.c (DISPEXTERN_INLINE): * src/frame.h, src/frame.c (FRAME_INLINE): * src/intervals.h, src/intervals.c (INTERVALS_INLINE): * src/keyboard.h, src/keyboard.c (KEYBOARD_INLINE): * src/lisp.h, src/alloc.c (LISP_INLINE): * src/process.h, src/process.c (PROCESS_INLINE): * src/syntax.h, src/syntax.c (SYNTAX_INLINE): * src/systime.h, src/sysdep.c (SYSTIME_INLINE): * src/termhooks.h, src/terminal.h (TERMHOOKS_INLINE): * src/window.h, src/window.c (WINDOW_INLINE): Remove. All uses replaced with INLINE.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h75
1 files changed, 36 insertions, 39 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 169a15c7d0f..a36c0d13c9e 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -22,9 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <time.h>
INLINE_HEADER_BEGIN
-#ifndef BUFFER_INLINE
-# define BUFFER_INLINE INLINE
-#endif
/* Accessing the parameters of the current buffer. */
@@ -875,97 +872,97 @@ struct buffer
/* Most code should use these functions to set Lisp fields in struct
buffer. */
-BUFFER_INLINE void
+INLINE void
bset_bidi_paragraph_direction (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (bidi_paragraph_direction) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_case_canon_table (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (case_canon_table) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_case_eqv_table (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (case_eqv_table) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_directory (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (directory) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_display_count (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (display_count) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_display_time (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (display_time) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_downcase_table (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (downcase_table) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_enable_multibyte_characters (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (enable_multibyte_characters) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_filename (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (filename) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_keymap (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (keymap) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_last_selected_window (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (last_selected_window) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_local_var_alist (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (local_var_alist) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_mark_active (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (mark_active) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_point_before_scroll (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (point_before_scroll) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_read_only (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (read_only) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_truncate_lines (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (truncate_lines) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_undo_list (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (undo_list) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_upcase_table (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (upcase_table) = val;
}
-BUFFER_INLINE void
+INLINE void
bset_width_table (struct buffer *b, Lisp_Object val)
{
b->INTERNAL_FIELD (width_table) = val;
@@ -1089,7 +1086,7 @@ extern void set_buffer_if_live (Lisp_Object);
windows than the selected one requires a select_window at some
time, and that increments windows_or_buffers_changed. */
-BUFFER_INLINE void
+INLINE void
set_buffer_internal (struct buffer *b)
{
if (current_buffer != b)
@@ -1099,7 +1096,7 @@ set_buffer_internal (struct buffer *b)
/* Arrange to go back to the original buffer after the next
call to unbind_to if the original buffer is still alive. */
-BUFFER_INLINE void
+INLINE void
record_unwind_current_buffer (void)
{
record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
@@ -1138,7 +1135,7 @@ extern Lisp_Object Qpriority, Qbefore_string, Qafter_string;
/* Get text properties of B. */
-BUFFER_INLINE INTERVAL
+INLINE INTERVAL
buffer_intervals (struct buffer *b)
{
eassert (b->text != NULL);
@@ -1147,7 +1144,7 @@ buffer_intervals (struct buffer *b)
/* Set text properties of B to I. */
-BUFFER_INLINE void
+INLINE void
set_buffer_intervals (struct buffer *b, INTERVAL i)
{
eassert (b->text != NULL);
@@ -1156,7 +1153,7 @@ set_buffer_intervals (struct buffer *b, INTERVAL i)
/* Non-zero if current buffer has overlays. */
-BUFFER_INLINE bool
+INLINE bool
buffer_has_overlays (void)
{
return current_buffer->overlays_before || current_buffer->overlays_after;
@@ -1176,7 +1173,7 @@ buffer_has_overlays (void)
the buffer to the next character after fetching this one. Instead,
use either FETCH_CHAR_ADVANCE or STRING_CHAR_AND_LENGTH. */
-BUFFER_INLINE int
+INLINE int
FETCH_MULTIBYTE_CHAR (ptrdiff_t pos)
{
unsigned char *p = ((pos >= GPT_BYTE ? GAP_SIZE : 0)
@@ -1188,7 +1185,7 @@ FETCH_MULTIBYTE_CHAR (ptrdiff_t pos)
If POS doesn't point the head of valid multi-byte form, only the byte at
POS is returned. No range checking. */
-BUFFER_INLINE int
+INLINE int
BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos)
{
unsigned char *p
@@ -1199,7 +1196,7 @@ BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos)
/* Return number of windows showing B. */
-BUFFER_INLINE int
+INLINE int
buffer_window_count (struct buffer *b)
{
if (b->base_buffer)
@@ -1306,13 +1303,13 @@ extern int last_per_buffer_idx;
/* Functions to get and set default value of the per-buffer
variable at offset OFFSET in the buffer structure. */
-BUFFER_INLINE Lisp_Object
+INLINE Lisp_Object
per_buffer_default (int offset)
{
return *(Lisp_Object *)(offset + (char *) &buffer_defaults);
}
-BUFFER_INLINE void
+INLINE void
set_per_buffer_default (int offset, Lisp_Object value)
{
*(Lisp_Object *)(offset + (char *) &buffer_defaults) = value;
@@ -1321,20 +1318,20 @@ set_per_buffer_default (int offset, Lisp_Object value)
/* Functions to get and set buffer-local value of the per-buffer
variable at offset OFFSET in the buffer structure. */
-BUFFER_INLINE Lisp_Object
+INLINE Lisp_Object
per_buffer_value (struct buffer *b, int offset)
{
return *(Lisp_Object *)(offset + (char *) b);
}
-BUFFER_INLINE void
+INLINE void
set_per_buffer_value (struct buffer *b, int offset, Lisp_Object value)
{
*(Lisp_Object *)(offset + (char *) b) = value;
}
/* Downcase a character C, or make no change if that cannot be done. */
-BUFFER_INLINE int
+INLINE int
downcase (int c)
{
Lisp_Object downcase_table = BVAR (current_buffer, downcase_table);
@@ -1343,10 +1340,10 @@ downcase (int c)
}
/* 1 if C is upper case. */
-BUFFER_INLINE bool uppercasep (int c) { return downcase (c) != c; }
+INLINE bool uppercasep (int c) { return downcase (c) != c; }
/* Upcase a character C known to be not upper case. */
-BUFFER_INLINE int
+INLINE int
upcase1 (int c)
{
Lisp_Object upcase_table = BVAR (current_buffer, upcase_table);
@@ -1355,13 +1352,13 @@ upcase1 (int c)
}
/* 1 if C is lower case. */
-BUFFER_INLINE bool
+INLINE bool
lowercasep (int c)
{
return !uppercasep (c) && upcase1 (c) != c;
}
/* Upcase a character C, or make no change if that cannot be done. */
-BUFFER_INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); }
+INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); }
INLINE_HEADER_END