aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorPaul Eggert2012-09-30 23:36:54 -0700
committerPaul Eggert2012-09-30 23:36:54 -0700
commitb0ab8123df78b7149d1f55b2ef0d3095c3f10628 (patch)
tree14d324cb46348dbf9a4568c7050d2776259c5358 /src/buffer.c
parent05584c31090df82f831f2998939fd423f036e86d (diff)
downloademacs-b0ab8123df78b7149d1f55b2ef0d3095c3f10628.tar.gz
emacs-b0ab8123df78b7149d1f55b2ef0d3095c3f10628.zip
Prefer plain 'static' to 'static inline'.
With static functions, modern compilers inline pretty well by themselves; advice from programmers often hurts as much as it helps. On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'), this change shrinks the text size of the Emacs executable by 1.1% without affecting CPU significantly in my benchmark. * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p) (live_float_p, live_misc_p, live_vector_p, live_buffer_p) (mark_maybe_object, mark_maybe_pointer, bounded_number): * buffer.c (bset_abbrev_mode, bset_abbrev_table) (bset_auto_fill_function, bset_auto_save_file_format) (bset_auto_save_file_name, bset_backed_up, bset_begv_marker) (bset_bidi_display_reordering, bset_buffer_file_coding_system) (bset_cache_long_line_scans, bset_case_fold_search) (bset_ctl_arrow, bset_cursor_in_non_selected_windows) (bset_cursor_type, bset_display_table, bset_extra_line_spacing) (bset_file_format, bset_file_truename, bset_fringe_cursor_alist) (bset_fringe_indicator_alist, bset_fringes_outside_margins) (bset_header_line_format, bset_indicate_buffer_boundaries) (bset_indicate_empty_lines, bset_invisibility_spec) (bset_left_fringe_width, bset_major_mode, bset_mark) (bset_minor_modes, bset_mode_line_format, bset_mode_name) (bset_name, bset_overwrite_mode, bset_pt_marker) (bset_right_fringe_width, bset_save_length) (bset_scroll_bar_width, bset_scroll_down_aggressively) (bset_scroll_up_aggressively, bset_selective_display) (bset_selective_display_ellipses, bset_vertical_scroll_bar_type) (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before) (set_buffer_overlays_after): * category.c (bset_category_table): * charset.c (read_hex): * coding.c (produce_composition, produce_charset) (handle_composition_annotation, handle_charset_annotation) (char_encodable_p): * dispnew.c (swap_glyph_pointers, copy_row_except_pointers) (assign_row, set_frame_matrix_frame, make_current) (add_row_entry): * eval.c (set_specpdl_symbol, set_specpdl_old_value): * fns.c (maybe_resize_hash_table): * frame.c (fset_buffer_predicate, fset_minibuffer_window): * gmalloc.c (register_heapinfo): * image.c (lookup_image_type): * intervals.c (set_interval_object, set_interval_left) (set_interval_right, copy_interval_parent, rotate_right) (rotate_left, balance_possible_root_interval): * keyboard.c (kset_echo_string, kset_kbd_queue) (kset_keyboard_translate_table, kset_last_prefix_arg) (kset_last_repeatable_command, kset_local_function_key_map) (kset_overriding_terminal_local_map, kset_real_last_command) (kset_system_key_syms, clear_event, set_prop): * lread.c (digit_to_number): * marker.c (attach_marker, live_buffer, set_marker_internal): * nsterm.m (ns_compute_glyph_string_overhangs): * process.c (pset_buffer, pset_command) (pset_decode_coding_system, pset_decoding_buf) (pset_encode_coding_system, pset_encoding_buf, pset_filter) (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel) (pset_status, pset_tty_name, pset_type, pset_write_queue): * syntax.c (bset_syntax_table, dec_bytepos): * terminal.c (tset_param_alist): * textprop.c (interval_has_some_properties) (interval_has_some_properties_list): * window.c (wset_combination_limit, wset_dedicated) (wset_display_table, wset_hchild, wset_left_fringe_width) (wset_left_margin_cols, wset_new_normal, wset_new_total) (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm) (wset_right_fringe_width, wset_right_margin_cols) (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild) (wset_vertical_scroll_bar_type, wset_window_parameters): * xdisp.c (wset_base_line_number, wset_base_line_pos) (wset_column_number_displayed, wset_region_showing) (window_box_edges, run_window_scroll_functions) (append_glyph_string_lists, prepend_glyph_string_lists) (append_glyph_string, set_glyph_string_background_width) (append_glyph, append_composite_glyph) (take_vertical_position_into_account): * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors) (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive) (lface_hash, lface_same_font_attributes_p, lookup_face): * xml.c (libxml2_loaded_p): * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc) (x_set_glyph_string_clipping, x_clear_glyph_string_rect): Now 'static', not 'static inline'. Fixes: debbugs:12541
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 356a308fce6..580ea671b43 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -150,222 +150,222 @@ static void modify_overlay (struct buffer *, ptrdiff_t, ptrdiff_t);
150static Lisp_Object buffer_lisp_local_variables (struct buffer *, bool); 150static Lisp_Object buffer_lisp_local_variables (struct buffer *, bool);
151 151
152/* These setters are used only in this file, so they can be private. */ 152/* These setters are used only in this file, so they can be private. */
153static inline void 153static void
154bset_abbrev_mode (struct buffer *b, Lisp_Object val) 154bset_abbrev_mode (struct buffer *b, Lisp_Object val)
155{ 155{
156 b->INTERNAL_FIELD (abbrev_mode) = val; 156 b->INTERNAL_FIELD (abbrev_mode) = val;
157} 157}
158static inline void 158static void
159bset_abbrev_table (struct buffer *b, Lisp_Object val) 159bset_abbrev_table (struct buffer *b, Lisp_Object val)
160{ 160{
161 b->INTERNAL_FIELD (abbrev_table) = val; 161 b->INTERNAL_FIELD (abbrev_table) = val;
162} 162}
163static inline void 163static void
164bset_auto_fill_function (struct buffer *b, Lisp_Object val) 164bset_auto_fill_function (struct buffer *b, Lisp_Object val)
165{ 165{
166 b->INTERNAL_FIELD (auto_fill_function) = val; 166 b->INTERNAL_FIELD (auto_fill_function) = val;
167} 167}
168static inline void 168static void
169bset_auto_save_file_format (struct buffer *b, Lisp_Object val) 169bset_auto_save_file_format (struct buffer *b, Lisp_Object val)
170{ 170{
171 b->INTERNAL_FIELD (auto_save_file_format) = val; 171 b->INTERNAL_FIELD (auto_save_file_format) = val;
172} 172}
173static inline void 173static void
174bset_auto_save_file_name (struct buffer *b, Lisp_Object val) 174bset_auto_save_file_name (struct buffer *b, Lisp_Object val)
175{ 175{
176 b->INTERNAL_FIELD (auto_save_file_name) = val; 176 b->INTERNAL_FIELD (auto_save_file_name) = val;
177} 177}
178static inline void 178static void
179bset_backed_up (struct buffer *b, Lisp_Object val) 179bset_backed_up (struct buffer *b, Lisp_Object val)
180{ 180{
181 b->INTERNAL_FIELD (backed_up) = val; 181 b->INTERNAL_FIELD (backed_up) = val;
182} 182}
183static inline void 183static void
184bset_begv_marker (struct buffer *b, Lisp_Object val) 184bset_begv_marker (struct buffer *b, Lisp_Object val)
185{ 185{
186 b->INTERNAL_FIELD (begv_marker) = val; 186 b->INTERNAL_FIELD (begv_marker) = val;
187} 187}
188static inline void 188static void
189bset_bidi_display_reordering (struct buffer *b, Lisp_Object val) 189bset_bidi_display_reordering (struct buffer *b, Lisp_Object val)
190{ 190{
191 b->INTERNAL_FIELD (bidi_display_reordering) = val; 191 b->INTERNAL_FIELD (bidi_display_reordering) = val;
192} 192}
193static inline void 193static void
194bset_buffer_file_coding_system (struct buffer *b, Lisp_Object val) 194bset_buffer_file_coding_system (struct buffer *b, Lisp_Object val)
195{ 195{
196 b->INTERNAL_FIELD (buffer_file_coding_system) = val; 196 b->INTERNAL_FIELD (buffer_file_coding_system) = val;
197} 197}
198static inline void 198static void
199bset_cache_long_line_scans (struct buffer *b, Lisp_Object val) 199bset_cache_long_line_scans (struct buffer *b, Lisp_Object val)
200{ 200{
201 b->INTERNAL_FIELD (cache_long_line_scans) = val; 201 b->INTERNAL_FIELD (cache_long_line_scans) = val;
202} 202}
203static inline void 203static void
204bset_case_fold_search (struct buffer *b, Lisp_Object val) 204bset_case_fold_search (struct buffer *b, Lisp_Object val)
205{ 205{
206 b->INTERNAL_FIELD (case_fold_search) = val; 206 b->INTERNAL_FIELD (case_fold_search) = val;
207} 207}
208static inline void 208static void
209bset_ctl_arrow (struct buffer *b, Lisp_Object val) 209bset_ctl_arrow (struct buffer *b, Lisp_Object val)
210{ 210{
211 b->INTERNAL_FIELD (ctl_arrow) = val; 211 b->INTERNAL_FIELD (ctl_arrow) = val;
212} 212}
213static inline void 213static void
214bset_cursor_in_non_selected_windows (struct buffer *b, Lisp_Object val) 214bset_cursor_in_non_selected_windows (struct buffer *b, Lisp_Object val)
215{ 215{
216 b->INTERNAL_FIELD (cursor_in_non_selected_windows) = val; 216 b->INTERNAL_FIELD (cursor_in_non_selected_windows) = val;
217} 217}
218static inline void 218static void
219bset_cursor_type (struct buffer *b, Lisp_Object val) 219bset_cursor_type (struct buffer *b, Lisp_Object val)
220{ 220{
221 b->INTERNAL_FIELD (cursor_type) = val; 221 b->INTERNAL_FIELD (cursor_type) = val;
222} 222}
223static inline void 223static void
224bset_display_table (struct buffer *b, Lisp_Object val) 224bset_display_table (struct buffer *b, Lisp_Object val)
225{ 225{
226 b->INTERNAL_FIELD (display_table) = val; 226 b->INTERNAL_FIELD (display_table) = val;
227} 227}
228static inline void 228static void
229bset_extra_line_spacing (struct buffer *b, Lisp_Object val) 229bset_extra_line_spacing (struct buffer *b, Lisp_Object val)
230{ 230{
231 b->INTERNAL_FIELD (extra_line_spacing) = val; 231 b->INTERNAL_FIELD (extra_line_spacing) = val;
232} 232}
233static inline void 233static void
234bset_file_format (struct buffer *b, Lisp_Object val) 234bset_file_format (struct buffer *b, Lisp_Object val)
235{ 235{
236 b->INTERNAL_FIELD (file_format) = val; 236 b->INTERNAL_FIELD (file_format) = val;
237} 237}
238static inline void 238static void
239bset_file_truename (struct buffer *b, Lisp_Object val) 239bset_file_truename (struct buffer *b, Lisp_Object val)
240{ 240{
241 b->INTERNAL_FIELD (file_truename) = val; 241 b->INTERNAL_FIELD (file_truename) = val;
242} 242}
243static inline void 243static void
244bset_fringe_cursor_alist (struct buffer *b, Lisp_Object val) 244bset_fringe_cursor_alist (struct buffer *b, Lisp_Object val)
245{ 245{
246 b->INTERNAL_FIELD (fringe_cursor_alist) = val; 246 b->INTERNAL_FIELD (fringe_cursor_alist) = val;
247} 247}
248static inline void 248static void
249bset_fringe_indicator_alist (struct buffer *b, Lisp_Object val) 249bset_fringe_indicator_alist (struct buffer *b, Lisp_Object val)
250{ 250{
251 b->INTERNAL_FIELD (fringe_indicator_alist) = val; 251 b->INTERNAL_FIELD (fringe_indicator_alist) = val;
252} 252}
253static inline void 253static void
254bset_fringes_outside_margins (struct buffer *b, Lisp_Object val) 254bset_fringes_outside_margins (struct buffer *b, Lisp_Object val)
255{ 255{
256 b->INTERNAL_FIELD (fringes_outside_margins) = val; 256 b->INTERNAL_FIELD (fringes_outside_margins) = val;
257} 257}
258static inline void 258static void
259bset_header_line_format (struct buffer *b, Lisp_Object val) 259bset_header_line_format (struct buffer *b, Lisp_Object val)
260{ 260{
261 b->INTERNAL_FIELD (header_line_format) = val; 261 b->INTERNAL_FIELD (header_line_format) = val;
262} 262}
263static inline void 263static void
264bset_indicate_buffer_boundaries (struct buffer *b, Lisp_Object val) 264bset_indicate_buffer_boundaries (struct buffer *b, Lisp_Object val)
265{ 265{
266 b->INTERNAL_FIELD (indicate_buffer_boundaries) = val; 266 b->INTERNAL_FIELD (indicate_buffer_boundaries) = val;
267} 267}
268static inline void 268static void
269bset_indicate_empty_lines (struct buffer *b, Lisp_Object val) 269bset_indicate_empty_lines (struct buffer *b, Lisp_Object val)
270{ 270{
271 b->INTERNAL_FIELD (indicate_empty_lines) = val; 271 b->INTERNAL_FIELD (indicate_empty_lines) = val;
272} 272}
273static inline void 273static void
274bset_invisibility_spec (struct buffer *b, Lisp_Object val) 274bset_invisibility_spec (struct buffer *b, Lisp_Object val)
275{ 275{
276 b->INTERNAL_FIELD (invisibility_spec) = val; 276 b->INTERNAL_FIELD (invisibility_spec) = val;
277} 277}
278static inline void 278static void
279bset_left_fringe_width (struct buffer *b, Lisp_Object val) 279bset_left_fringe_width (struct buffer *b, Lisp_Object val)
280{ 280{
281 b->INTERNAL_FIELD (left_fringe_width) = val; 281 b->INTERNAL_FIELD (left_fringe_width) = val;
282} 282}
283static inline void 283static void
284bset_major_mode (struct buffer *b, Lisp_Object val) 284bset_major_mode (struct buffer *b, Lisp_Object val)
285{ 285{
286 b->INTERNAL_FIELD (major_mode) = val; 286 b->INTERNAL_FIELD (major_mode) = val;
287} 287}
288static inline void 288static void
289bset_mark (struct buffer *b, Lisp_Object val) 289bset_mark (struct buffer *b, Lisp_Object val)
290{ 290{
291 b->INTERNAL_FIELD (mark) = val; 291 b->INTERNAL_FIELD (mark) = val;
292} 292}
293static inline void 293static void
294bset_minor_modes (struct buffer *b, Lisp_Object val) 294bset_minor_modes (struct buffer *b, Lisp_Object val)
295{ 295{
296 b->INTERNAL_FIELD (minor_modes) = val; 296 b->INTERNAL_FIELD (minor_modes) = val;
297} 297}
298static inline void 298static void
299bset_mode_line_format (struct buffer *b, Lisp_Object val) 299bset_mode_line_format (struct buffer *b, Lisp_Object val)
300{ 300{
301 b->INTERNAL_FIELD (mode_line_format) = val; 301 b->INTERNAL_FIELD (mode_line_format) = val;
302} 302}
303static inline void 303static void
304bset_mode_name (struct buffer *b, Lisp_Object val) 304bset_mode_name (struct buffer *b, Lisp_Object val)
305{ 305{
306 b->INTERNAL_FIELD (mode_name) = val; 306 b->INTERNAL_FIELD (mode_name) = val;
307} 307}
308static inline void 308static void
309bset_name (struct buffer *b, Lisp_Object val) 309bset_name (struct buffer *b, Lisp_Object val)
310{ 310{
311 b->INTERNAL_FIELD (name) = val; 311 b->INTERNAL_FIELD (name) = val;
312} 312}
313static inline void 313static void
314bset_overwrite_mode (struct buffer *b, Lisp_Object val) 314bset_overwrite_mode (struct buffer *b, Lisp_Object val)
315{ 315{
316 b->INTERNAL_FIELD (overwrite_mode) = val; 316 b->INTERNAL_FIELD (overwrite_mode) = val;
317} 317}
318static inline void 318static void
319bset_pt_marker (struct buffer *b, Lisp_Object val) 319bset_pt_marker (struct buffer *b, Lisp_Object val)
320{ 320{
321 b->INTERNAL_FIELD (pt_marker) = val; 321 b->INTERNAL_FIELD (pt_marker) = val;
322} 322}
323static inline void 323static void
324bset_right_fringe_width (struct buffer *b, Lisp_Object val) 324bset_right_fringe_width (struct buffer *b, Lisp_Object val)
325{ 325{
326 b->INTERNAL_FIELD (right_fringe_width) = val; 326 b->INTERNAL_FIELD (right_fringe_width) = val;
327} 327}
328static inline void 328static void
329bset_save_length (struct buffer *b, Lisp_Object val) 329bset_save_length (struct buffer *b, Lisp_Object val)
330{ 330{
331 b->INTERNAL_FIELD (save_length) = val; 331 b->INTERNAL_FIELD (save_length) = val;
332} 332}
333static inline void 333static void
334bset_scroll_bar_width (struct buffer *b, Lisp_Object val) 334bset_scroll_bar_width (struct buffer *b, Lisp_Object val)
335{ 335{
336 b->INTERNAL_FIELD (scroll_bar_width) = val; 336 b->INTERNAL_FIELD (scroll_bar_width) = val;
337} 337}
338static inline void 338static void
339bset_scroll_down_aggressively (struct buffer *b, Lisp_Object val) 339bset_scroll_down_aggressively (struct buffer *b, Lisp_Object val)
340{ 340{
341 b->INTERNAL_FIELD (scroll_down_aggressively) = val; 341 b->INTERNAL_FIELD (scroll_down_aggressively) = val;
342} 342}
343static inline void 343static void
344bset_scroll_up_aggressively (struct buffer *b, Lisp_Object val) 344bset_scroll_up_aggressively (struct buffer *b, Lisp_Object val)
345{ 345{
346 b->INTERNAL_FIELD (scroll_up_aggressively) = val; 346 b->INTERNAL_FIELD (scroll_up_aggressively) = val;
347} 347}
348static inline void 348static void
349bset_selective_display (struct buffer *b, Lisp_Object val) 349bset_selective_display (struct buffer *b, Lisp_Object val)
350{ 350{
351 b->INTERNAL_FIELD (selective_display) = val; 351 b->INTERNAL_FIELD (selective_display) = val;
352} 352}
353static inline void 353static void
354bset_selective_display_ellipses (struct buffer *b, Lisp_Object val) 354bset_selective_display_ellipses (struct buffer *b, Lisp_Object val)
355{ 355{
356 b->INTERNAL_FIELD (selective_display_ellipses) = val; 356 b->INTERNAL_FIELD (selective_display_ellipses) = val;
357} 357}
358static inline void 358static void
359bset_vertical_scroll_bar_type (struct buffer *b, Lisp_Object val) 359bset_vertical_scroll_bar_type (struct buffer *b, Lisp_Object val)
360{ 360{
361 b->INTERNAL_FIELD (vertical_scroll_bar_type) = val; 361 b->INTERNAL_FIELD (vertical_scroll_bar_type) = val;
362} 362}
363static inline void 363static void
364bset_word_wrap (struct buffer *b, Lisp_Object val) 364bset_word_wrap (struct buffer *b, Lisp_Object val)
365{ 365{
366 b->INTERNAL_FIELD (word_wrap) = val; 366 b->INTERNAL_FIELD (word_wrap) = val;
367} 367}
368static inline void 368static void
369bset_zv_marker (struct buffer *b, Lisp_Object val) 369bset_zv_marker (struct buffer *b, Lisp_Object val)
370{ 370{
371 b->INTERNAL_FIELD (zv_marker) = val; 371 b->INTERNAL_FIELD (zv_marker) = val;
@@ -651,13 +651,13 @@ copy_overlays (struct buffer *b, struct Lisp_Overlay *list)
651 651
652/* Set an appropriate overlay of B. */ 652/* Set an appropriate overlay of B. */
653 653
654static inline void 654static void
655set_buffer_overlays_before (struct buffer *b, struct Lisp_Overlay *o) 655set_buffer_overlays_before (struct buffer *b, struct Lisp_Overlay *o)
656{ 656{
657 b->overlays_before = o; 657 b->overlays_before = o;
658} 658}
659 659
660static inline void 660static void
661set_buffer_overlays_after (struct buffer *b, struct Lisp_Overlay *o) 661set_buffer_overlays_after (struct buffer *b, struct Lisp_Overlay *o)
662{ 662{
663 b->overlays_after = o; 663 b->overlays_after = o;