summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog.trunk1409
-rw-r--r--src/Makefile.in36
-rw-r--r--src/alloc.c548
-rw-r--r--src/atimer.c62
-rw-r--r--src/atimer.h27
-rw-r--r--src/autodeps.mk2
-rw-r--r--src/bidi.c9
-rw-r--r--src/blockinput.h3
-rw-r--r--src/buffer.c378
-rw-r--r--src/buffer.h48
-rw-r--r--src/bytecode.c16
-rw-r--r--src/callint.c38
-rw-r--r--src/callproc.c118
-rw-r--r--src/casefiddle.c51
-rw-r--r--src/casetab.c41
-rw-r--r--src/category.c65
-rw-r--r--src/category.h4
-rw-r--r--src/ccl.c43
-rw-r--r--src/ccl.h8
-rw-r--r--src/character.c116
-rw-r--r--src/character.h50
-rw-r--r--src/charset.c189
-rw-r--r--src/charset.h18
-rw-r--r--src/chartab.c127
-rw-r--r--src/cm.c16
-rw-r--r--src/cm.h14
-rw-r--r--src/cmds.c94
-rw-r--r--src/coding.c614
-rw-r--r--src/coding.h68
-rw-r--r--src/composite.c109
-rw-r--r--src/composite.h54
-rw-r--r--src/config.in134
-rw-r--r--src/data.c392
-rw-r--r--src/dbusbind.c117
-rw-r--r--src/dired.c76
-rw-r--r--src/dispextern.h670
-rw-r--r--src/dispnew.c613
-rw-r--r--src/disptab.h6
-rw-r--r--src/doc.c55
-rw-r--r--src/doprnt.c59
-rw-r--r--src/dosfns.c36
-rw-r--r--src/dosfns.h4
-rw-r--r--src/editfns.c407
-rw-r--r--src/emacs.c135
-rw-r--r--src/eval.c487
-rw-r--r--src/fileio.c280
-rw-r--r--src/filelock.c59
-rw-r--r--src/filemode.c30
-rw-r--r--src/floatfns.c168
-rw-r--r--src/fns.c547
-rw-r--r--src/font.c603
-rw-r--r--src/font.h223
-rw-r--r--src/fontset.c153
-rw-r--r--src/fontset.h30
-rw-r--r--src/frame.c376
-rw-r--r--src/frame.h88
-rw-r--r--src/fringe.c358
-rw-r--r--src/ftfont.c184
-rw-r--r--src/ftxfont.c68
-rw-r--r--src/getloadavg.c2
-rw-r--r--src/gmalloc.c20
-rw-r--r--src/gtkutil.c817
-rw-r--r--src/gtkutil.h164
-rw-r--r--src/image.c868
-rw-r--r--src/indent.c75
-rw-r--r--src/indent.h28
-rw-r--r--src/insdel.c78
-rw-r--r--src/intervals.c166
-rw-r--r--src/intervals.h122
-rw-r--r--src/keyboard.c770
-rw-r--r--src/keyboard.h97
-rw-r--r--src/keymap.c318
-rw-r--r--src/keymap.h24
-rw-r--r--src/lisp.h943
-rw-r--r--src/lread.c378
-rw-r--r--src/m/alpha.h18
-rw-r--r--src/m/ia64.h2
-rw-r--r--src/m/ibmrs6000.h1
-rw-r--r--src/m/intel386.h4
-rw-r--r--src/m/iris4d.h2
-rw-r--r--src/m/m68k.h1
-rw-r--r--src/m/macppc.h4
-rw-r--r--src/m/mips.h3
-rw-r--r--src/m/template.h5
-rw-r--r--src/macros.c33
-rw-r--r--src/macros.h6
-rw-r--r--src/makefile.w32-in1
-rw-r--r--src/marker.c72
-rw-r--r--src/md5.c30
-rw-r--r--src/md5.h20
-rw-r--r--src/mem-limits.h45
-rw-r--r--src/menu.c85
-rw-r--r--src/menu.h20
-rw-r--r--src/minibuf.c156
-rw-r--r--src/mktime.c8
-rw-r--r--src/msdos.c295
-rw-r--r--src/msdos.h21
-rw-r--r--src/nsfns.m177
-rw-r--r--src/nsfont.m12
-rw-r--r--src/nsimage.m8
-rw-r--r--src/nsmenu.m23
-rw-r--r--src/nsselect.m24
-rw-r--r--src/nsterm.h6
-rw-r--r--src/nsterm.m35
-rw-r--r--src/prefix-args.c84
-rw-r--r--src/print.c138
-rw-r--r--src/process.c1541
-rw-r--r--src/process.h4
-rw-r--r--src/puresize.h2
-rw-r--r--src/ralloc.c94
-rw-r--r--src/regex.c171
-rw-r--r--src/region-cache.c59
-rw-r--r--src/region-cache.h32
-rw-r--r--src/s/aix4-2.h4
-rw-r--r--src/s/darwin.h6
-rw-r--r--src/s/freebsd.h7
-rw-r--r--src/s/hpux10-20.h5
-rw-r--r--src/s/irix6-5.h2
-rw-r--r--src/s/ms-w32.h18
-rw-r--r--src/s/msdos.h11
-rw-r--r--src/s/sol2-10.h2
-rw-r--r--src/s/sol2-6.h4
-rw-r--r--src/s/template.h3
-rw-r--r--src/s/usg5-4.h8
-rw-r--r--src/scroll.c129
-rw-r--r--src/search.c227
-rw-r--r--src/sound.c179
-rw-r--r--src/strftime.c28
-rw-r--r--src/syntax.c160
-rw-r--r--src/syntax.h6
-rw-r--r--src/sysdep.c383
-rw-r--r--src/syssignal.h15
-rw-r--r--src/systime.h6
-rw-r--r--src/term.c195
-rw-r--r--src/termcap.c116
-rw-r--r--src/termhooks.h86
-rw-r--r--src/terminal.c39
-rw-r--r--src/terminfo.c7
-rw-r--r--src/textprop.c147
-rw-r--r--src/tparam.c73
-rw-r--r--src/undo.c33
-rw-r--r--src/unexaix.c15
-rw-r--r--src/unexalpha.c16
-rw-r--r--src/unexec.c17
-rw-r--r--src/unexelf.c17
-rw-r--r--src/unexmacosx.c2
-rw-r--r--src/vm-limit.c80
-rw-r--r--src/w16select.c42
-rw-r--r--src/w32.c191
-rw-r--r--src/w32console.c65
-rw-r--r--src/w32fns.c485
-rw-r--r--src/w32font.c256
-rw-r--r--src/w32font.h40
-rw-r--r--src/w32heap.c2
-rw-r--r--src/w32inevt.c6
-rw-r--r--src/w32menu.c80
-rw-r--r--src/w32proc.c82
-rw-r--r--src/w32reg.c12
-rw-r--r--src/w32select.c57
-rw-r--r--src/w32term.c654
-rw-r--r--src/w32term.h10
-rw-r--r--src/w32uniscribe.c67
-rw-r--r--src/w32xfns.c37
-rw-r--r--src/widget.c97
-rw-r--r--src/widget.h4
-rw-r--r--src/window.c622
-rw-r--r--src/window.h66
-rw-r--r--src/xdisp.c1626
-rw-r--r--src/xfaces.c686
-rw-r--r--src/xfns.c567
-rw-r--r--src/xfont.c91
-rw-r--r--src/xftfont.c107
-rw-r--r--src/xgselect.c10
-rw-r--r--src/xgselect.h12
-rw-r--r--src/xmenu.c245
-rw-r--r--src/xrdb.c63
-rw-r--r--src/xselect.c315
-rw-r--r--src/xsettings.c78
-rw-r--r--src/xsettings.h10
-rw-r--r--src/xsmfns.c130
-rw-r--r--src/xterm.c1050
-rw-r--r--src/xterm.h292
182 files changed, 12064 insertions, 16984 deletions
diff --git a/src/ChangeLog.trunk b/src/ChangeLog.trunk
index 9e115942d39..6a0475f5741 100644
--- a/src/ChangeLog.trunk
+++ b/src/ChangeLog.trunk
@@ -1,3 +1,1384 @@
+2010-07-23 Juanma Barranquero <lekktu@gmail.com>
+
+ * menu.c (cleanup_popup_menu): Set inside "#ifdef HAVE_NS";
+ it is called only from NS code.
+
+ * w32term.c (my_set_focus): #ifdef away; it is called only from
+ "#ifdef 0" code.
+
+ * w32fns.c (x_edge_detection):
+ * xfaces.c (may_use_scalable_font_p):
+ Remove obsolete static declarations.
+
+2010-07-20 Juanma Barranquero <lekktu@gmail.com>
+
+ * alloc.c (emacs_blocked_free, emacs_blocked_malloc)
+ (emacs_blocked_realloc, uninterrupt_malloc):
+ * fringe.c (w32_reset_fringes):
+ * image.c (convert_mono_to_color_image, lookup_rgb_color)
+ (init_color_table, XPutPixel, jpeg_resync_to_restart_wrapper):
+ * sound.c (be2hs, do_play_sound):
+ * vm-limit.c (get_lim_data, ret_lim_data):
+ * w32term.c (x_free_frame_resources):
+ * xfaces.c (x_create_gc, x_free_gc):
+ Convert definitions to standard C.
+
+2010-07-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * eval.c (Feval, Ffuncall): Use the new names.
+
+ * lisp.h (struct Lisp_Subr): Rename `am' to aMANY and add aUNEVALLED.
+ (DEFUN): Add braces around the union initialisation and use ## to
+ specify the right union alternative and avoid a cast.
+
+2010-07-18 Juanma Barranquero <lekktu@gmail.com>
+
+ * makefile.w32-in ($(BLD)/keyboard.$(O)): Update dependencies.
+
+2010-07-17 Chong Yidong <cyd@stupidchicken.com>
+
+ * frame.c (make_initial_frame): Use set_menu_bar_lines (Bug#6660).
+
+2010-07-17 Jan Djärv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (xg_event_is_for_menubar): Also check that event window
+ is related to the menu bar (Bug#6499).
+ (xg_frame_resized): GTK_IS_MAPPED => gtk_widget_get_mapped, for Gtk 3.0.
+
+2010-07-16 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xterm.h (x_menubar_window_to_frame): Second parameter is XEvent*.
+
+ * xterm.c (handle_one_xevent): Pass event to x_menubar_window_to_frame.
+
+ * xmenu.c (x_activate_menubar): Revert previous fix for Bug#6499,
+ i.e. don't put back ButtonRelease (Bug#6608).
+
+ * xfns.c (x_menubar_window_to_frame): Take XEvent as second parameter
+ instead of Window. Call xg_event_is_for_menubar when
+ USE_GTK (Bug#6499).
+
+ * gtkutil.h (xg_event_is_for_menubar): Declare.
+
+ * gtkutil.c (xg_event_is_for_menubar): New function (Bug#6499).
+
+2010-07-16 Eli Zaretskii <eliz@gnu.org>
+
+ * w32fns.c (x_set_foreground_color): Fix setting the cursor color
+ when it's the same as the old foreground. (Bug#6609)
+
+2010-07-16 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xmenu.c (free_frame_menubar): Only call x_set_window_size if
+ widget is non-null (Bug#6645).
+
+2010-07-15 Andreas Schwab <schwab@linux-m68k.org>
+
+ * xterm.c (x_fully_uncatch_errors, x_trace_wire, x_check_font):
+ Convert old-style definition.
+
+ * xmenu.c (create_and_show_popup_menu, xmenu_show): Fix type of
+ timestamp argument.
+
+2010-07-15 Eli Zaretskii <eliz@gnu.org>
+
+ * fringe.c (update_window_fringes): Restore mistakenly reverted
+ code from 2010-04-17T12:33:05Z!eliz@gnu.org merged in 2010-04-20T13:31:28Z!eliz@gnu.org.
+
+2010-07-14 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xterm.c (xm_scroll_callback, x_process_timeouts): K&R => prototype.
+ (SET_SAVED_KEY_EVENT): Remove (not used).
+ (SET_SAVED_MENU_EVENT): Rename to SET_SAVED_BUTTON_EVENT and
+ remove size parameter.
+ (handle_one_xevent): Check popup_activated () for menu for Xt also.
+ Remove #ifdef USE_GTK around finish = X_EVENT_DROP.
+ Remove #ifdef USE_MOTIF code that did SET_SAVED_BUTTON_EVENT for
+ ButtonRelease.
+ (x_set_window_size_1): scroll_bar_actual_width is always
+ SCROLL_BAR_COLS * COLUMN_WIDTH for the purpose of frame sizing.
+
+ * xdisp.c (pending_menu_activation): Remove extern declaration.
+ (prepare_menu_bars): Remove setting of pending_menu_activation.
+
+ * xmenu.c (pending_menu_activation): Remove.
+ (x_activate_menubar): Set popup_activated_flag for Xt also.
+ Remove setting of pending_menu_activation.
+ (set_frame_menubar): Remove check of pending_menu_activation.
+ Declare menubar_size before code. Correct spelling in comment.
+
+2010-07-14 Kenichi Handa <handa@m17n.org>
+
+ * font.c (font_open_entity): Cancel previous change.
+ (Ffont_get): Don't check FONT_ENTITY_INDEX of a font-object.
+
+2010-07-13 Eli Zaretskii <eliz@gnu.org>
+
+ Remove subprocesses #ifdefs.
+ * process.c <inhibit_sentinels>: Move to the common part.
+ (Fwaiting_for_user_input_p): Move to the common part; return nil
+ if async subprocesses aren't supported.
+ * sysdep.c (wait_for_termination) [!MSDOS]: Don't compile on
+ MS-DOS. Remove "#ifdef subprocesses".
+ (sys_subshell, sys_select): Remove "#ifdef subprocesses".
+ (gettimeofday): Remove "#ifdef subprocesses".
+ (wait_without_blocking): Remove function.
+ (flush_pending_output, child_setup_tty): Don't compile on MS-DOS.
+ Remove "#ifdef subprocesses".
+ (child_setup_tty): Use WINDOWSNT instead of DOS_NT, since not
+ compiled on MS-DOS.
+ * callproc.c (Fcall_process) [!MSDOS]: Don't call
+ wait_for_termination on MS-DOS.
+ * emacs.c (shut_down_emacs): Remove "#ifndef subprocesses" from
+ initialization of inhibit_sentinels.
+ * keyboard.c (record_asynch_buffer_change): Remove "#ifdef
+ subprocesses" conditional.
+ * callproc.c (Fcall_process) [!subprocesses]: Don't call
+ wait_for_termination, since `buffer' cannot be an integer when
+ async subprocesses are not supported
+ * xdisp.c (decode_mode_spec): Use `MSDOS' instead of `subprocesses'
+ for ifdefing away the call to Fprocess_status.
+
+ * process.c (add_keyboard_wait_descriptor) [!subprocesses]: Ifdef
+ away the entire body of the function.
+
+2010-07-13 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove subprocesses #ifdefs from term.c.
+ * process.c (add_keyboard_wait_descriptor)
+ (delete_keyboard_wait_descriptor): Move to common section, do
+ nothing when subprocesses is not defined.
+ * term.c (Fsuspend_tty, Fresume_tty, init_tty):
+ Remove subprocesses #ifdefs.
+
+ Convert maybe_fatal to standard C.
+ * lisp.h (verror): Declare.
+ * eval.c (verror): New function containing the code from ...
+ (error): ... this. Call verror.
+ * term.c (vfatal): New function containing the code from ...
+ (fatal): ... this. Call vfatal.
+ (maybe_fatal): Convert to standard C, use variable number of
+ arguments. Declare as non-return.
+ (init_tty): Fix maybe_fatal call.
+
+2010-07-12 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * xterm.c (x_scroll_bar_set_handle, x_scroll_bar_expose)
+ (_scroll_bar_note_movement): Convert definitions to standard C.
+ * xmenu.c (menu_help_callback, pop_down_menu, xmenu_show):
+ * xfns.c (hack_wm_protocols, x_window, x_window): Likewise.
+
+2010-07-12 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * xterm.c (x_frame_of_widget, x_alloc_nearest_color_for_widget)
+ (x_alloc_lighter_color_for_widget, cvt_string_to_pixel)
+ (cvt_pixel_dtor, x_window_to_menu_bar, xt_action_hook)
+ (xaw_jump_callback, xaw_scroll_callback)
+ (x_create_toolkit_scroll_bar, x_set_toolkit_scroll_bar_thumb)
+ (x_wm_set_size_hint, x_activate_timeout_atimer): Convert
+ definitions to standard C.
+ * xmenu.c (menubar_id_to_frame, popup_get_selection)
+ (popup_activate_callback, popup_deactivate_callback)
+ (menu_highlight_callback, menubar_selection_callback)
+ (apply_systemfont_to_dialog, apply_systemfont_to_menu)
+ (free_frame_menubar, popup_selection_callback, as)
+ (create_and_show_popup_menu, dialog_selection_callback)
+ (create_and_show_dialog):
+ * xfns.c (hack_wm_protocols, x_window):
+ * xfaces.c (x_update_menu_appearance):
+ * widget.c (get_default_char_pixel_size, pixel_to_char_size)
+ (char_to_pixel_size, round_size_to_char, get_wm_shell)
+ (set_frame_size, update_wm_hints, setup_frame_gcs)
+ (update_various_frame_slots, update_from_various_frame_slots)
+ (EmacsFrameInitialize, EmacsFrameRealize, EmacsFrameResize)
+ (EmacsFrameSetValues, EmacsFrameQueryGeometry)
+ (EmacsFrameSetCharSize, widget_store_internal_border): Likewise.
+
+2010-07-12 Andreas Schwab <schwab@linux-m68k.org>
+
+ * dbusbind.c (xd_initialize): Don't compare boolean with a constant.
+
+2010-07-12 Eli Zaretskii <eliz@gnu.org>
+
+ * process.c (setup_process_coding_systems): Move to the part
+ shared by non-subprocesses systems, and make its body empty when
+ subprocesses is not defined.
+ (close_process_descs): Move to the part shared by non-subprocesses
+ systems.
+ (wait_reading_process_output) [!subprocesses]: Convert arg list to
+ ANSI C.
+
+2010-07-12 Andreas Schwab <schwab@linux-m68k.org>
+
+ * editfns.c (transpose_markers): Convert old-style definition.
+ * emacs.c (abort, shut_down_emacs, fixup_locale)
+ (synchronize_system_time_locale)
+ (synchronize_system_messages_locale, syms_of_emacs): Likewise.
+ * floatfns.c (extract_float, matherr, init_floatfns)
+ (syms_of_floatfns): Likewise.
+ * fns.c (make_hash_table): Likewise.
+ * ftfont.c (ftfont_get_otf, ftfont_otf_features)
+ (ftfont_otf_capability, ftfont_get_glyph_id, ftfont_get_metrics)
+ (ftfont_drive_otf, ftfont_shape_by_flt, ftfont_shape)
+ (ftfont_variation_glyphs): Likewise.
+ * gtkutil.c (xg_create_widget, xg_modify_menubar_widgets): Likewise.
+ * keymap.c (describe_map_tree, describe_map, describe_vector): Likewise.
+ * lread.c (read_filtered_event): Likewise.
+ * minibuf.c (read_minibuf_noninteractive, read_minibuf): Likewise.
+ * process.c (wait_reading_process_output): Likewise.
+ * scroll.c (do_line_insertion_deletion_costs): Likewise.
+ * search.c (search_buffer, boyer_moore): Likewise.
+ * syntax.c (scan_sexps_forward): Likewise.
+ * xdisp.c (try_scrolling): Likewise.
+ * xfaces.c (face_at_buffer_position, face_for_overlay_string)
+ (face_at_string_position): Likewise.
+ * xfns.c (x_default_scroll_bar_color_parameter): Likewise.
+ * xselect.c (x_get_window_property, receive_incremental_selection)
+ (x_get_window_property_as_lisp_data, lisp_data_to_selection_data):
+ Likewise.
+ * xterm.c (x_draw_relief_rect, x_draw_box_rect): Likewise.
+
+2010-07-12 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * callproc.c (child_setup): Remove subprocesses conditional.
+ Remove code dealing with SET_EMACS_PRIORITY, unused.
+
+ * buffer.c (Fset_buffer_multibyte): Remove subprocesses conditional.
+ * process.c (close_process_descs): Use DOS_NT instead of WINDOWSNT.
+
+ * emacs.c (__do_global_ctors, __do_global_ctors_aux)
+ (__do_global_dtors, __main): Use void in definition.
+ (main): Remove code dealing with SET_EMACS_PRIORITY, unused.
+ Remove SYMS_MACHINE code, unused. Remove SYMS_SYSTEM, inline
+ the only users from ...
+ * s/ms-w32.h (SYMS_SYSTEM): ... here and ...
+ * s/msdos.h (SYMS_SYSTEM): ... here. Remove.
+ (HAVE_VOLATILE): Remove, unused.
+
+ Convert more function definitions to standard C.
+ * xdisp.c (window_box_edges, handle_single_display_spec)
+ (display_string): Convert definition to standard C.
+ * scroll.c (do_direct_scrolling, scrolling_1):
+ * dispnew.c (allocate_matrices_for_frame_redisplay)
+ (mirrored_line_dance):
+ * coding.c (code_convert_string):
+ * charset.c (map_charset_chars):
+ * ccl.c (Fccl_program_p, Fccl_execute, Fccl_execute_on_string)
+ (Fregister_ccl_program, Fregister_code_conversion_map):
+ * keyboard.c (kbd_buffer_nr_stored): Likewise.
+ (head_table): Make static and const.
+
+2010-07-12 Andreas Schwab <schwab@linux-m68k.org>
+
+ * Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS)
+ (PROFILING_LDFLAGS): Set from substitution.
+ (ALL_CFLAGS): Add C_WARNINGS_SWITCH and PROFILING_CFLAGS, put
+ CFLAGS last.
+
+2010-07-12 Kenichi Handa <handa@m17n.org>
+
+ * Makefile.in (lisp): Change hebrew.el to hebrew.elc.
+ (shortlisp): Likewise.
+
+ * font.h (enum font_property_index): New member FONT_ENTITY_INDEX.
+
+ * font.c (font_open_entity): Record ENTITY in FONT_OBJECT's slot
+ of FONT_ENTITY_INDEX.
+ (Ffont_get): If KEY is :otf and the font-object doesn't have the
+ property, get the property value dynamically.
+ (Ffont_put): Accept font-entity and font-object too.
+ (Ffont_get_glyhphs): Renamed from Fget_font_glyphs. Arguments and
+ return value changed.
+ (syms_of_font): Adjusted for the above change.
+
+2010-07-11 Andreas Schwab <schwab@linux-m68k.org>
+
+ * blockinput.h: Remove obsolete comment.
+
+ * lisp.h: Include <stddef.h>.
+ (OFFSETOF): Don't define.
+ (VECSIZE): Use offsetof instead of OFFSETOF.
+ (PSEUDOVECSIZE): Likewise.
+ * process.c (conv_sockaddr_to_lisp): Likewise.
+ * alloc.c: Don't include <stddef.h>.
+ * buffer.h (PER_BUFFER_VAR_OFFSET): Use offsetof.
+
+ * process.c: Remove obsolete comment.
+
+2010-07-11 Chong Yidong <cyd@stupidchicken.com>
+
+ * xfaces.c (Vface_remapping_alist): Doc fix (Bug#6091).
+
+2010-07-11 Andreas Schwab <schwab@linux-m68k.org>
+
+ * callint.c (Fcall_interactively): Use strchr, strrchr instead of
+ index, rindex.
+ * doc.c (get_doc_string, Fsnarf_documentation): Likewise.
+ * editfns.c (Fuser_full_name, Fformat): Likewise.
+ * emacs.c (argmatch, sort_args, decode_env_path): Likewise.
+ * fileio.c (Ffile_symlink_p): Likewise.
+ * filelock.c (current_lock_owner): Likewise.
+ * font.c (font_parse_name, font_parse_family_registry): Likewise.
+ * fontset.c (fontset_pattern_regexp): Likewise.
+ * lread.c (read1): Likewise.
+ * sysdep.c (init_system_name): Likewise.
+ * xfns.c (select_visual): Likewise.
+ * s/hpux10-20.h (index, rindex): Don't define.
+ * s/ms-w32.h (index): Likewise.
+ * s/usg5-4.h: Likewise.
+
+ * callproc.c (relocate_fd): Use F_DUPFD if defined.
+
+ * alloc.c (pending_malloc_warning, malloc_warning): Add const.
+ * callproc.c (relocate_fd, getenv_internal_1, getenv_internal)
+ (egetenv): Likewise.
+ * doprnt.c (doprnt): Likewise.
+ * editfns.c (set_time_zone_rule, format2): Likewise.
+ * emacs.c (decode_env_path): Likewise.
+ * eval.c (signal_error, error): Likewise.
+ * insdel.c (replace_range_2): Likewise.
+ * keyboard.c (cmd_error_internal): Likewise.
+ * lread.c (isfloat_string, make_symbol, dir_warning): Likewise.
+ * print.c (write_string, write_string_1, print_error_message):
+ Likewise.
+ * vm-limit.c (warn_function, memory_warnings): Likewise.
+ * xdisp.c (message1, message1_nolog, message_with_string)
+ (vmessage, message, message_nolog): Likewise.
+ * emacs.c: Remove duplicate declaration.
+ * keyboard.h: Likewise.
+ * lisp.h: Update prototypes.
+
+ * eval.c: Fix indentation problem.
+
+ * keyboard.c: Include "process.h"
+
+ * eval.c: Remove obsolete noinline declaration.
+ * fns.c: Likewise.
+
+2010-07-11 Ken Raeburn <raeburn@raeburn.org>
+
+ * doprnt.c (doprnt): Take a va_list argument instead of count and
+ pointer.
+ * eval.c (error): Change to a standard-C variadic function.
+ * xdisp.c (vmessage): Renamed from message, made static, and
+ changed to take a va_list argument.
+ (message): New variadic wrapper.
+ (message_nolog): Now a variadic function, calling vmessage.
+ * lisp.h: Include stdarg.h for va_list.
+ (doprnt, error, message, message_nolog): Decls updated.
+
+2010-07-11 Eli Zaretskii <eliz@gnu.org>
+
+ * process.c (syms_of_process) <delete-exited-processes>: Define
+ even if !subprocesses.
+ (delete_exited_processes): Ditto.
+
+ * msdos.c (syms_of_msdos) <delete-exited-processes>: Remove DEFVAR.
+ (delete_exited_processes): Don't define.
+
+2010-07-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * frame.c (make_frame): Initialize menu_bar_lines and
+ tool_bar_lines members.
+ (make_initial_frame, make_terminal_frame): Initialize
+ menu_bar_lines using value of menu-bar-mode.
+
+ * msdos.c (IT_set_frame_parameters): Don't set menu-bar-lines.
+
+2010-07-10 Eli Zaretskii <eliz@gnu.org>
+
+ * process.c: Reshuffle #include's. Condition some of the global
+ and static variables on `subprocesses'.
+ (hold_keyboard_input, unhold_keyboard_input, kbd_on_hold_p):
+ Leave only one implementation.
+ (Fget_buffer_process, Fprocess_inherit_coding_system_flag)
+ (kill_buffer_processes, Flist_system_processes)
+ (Fprocess_attributes, init_process, syms_of_process): Unify the
+ implementations for with subprocesses and without them.
+
+2010-07-09 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xmenu.c (set_frame_menubar): Must realize menubar_widget to get the
+ correct size for Motif.
+ (free_frame_menubar): Call x_set_window_size to update frame size.
+
+ * xfns.c (x_window): Set borderWidth to 0 for pane and
+ EmacsFrame. Frame size calculation is wrong otherwise.
+
+2010-07-09 Michael Albinus <michael.albinus@gmx.de>
+
+ * dbusbind.c (xd_initialize): Add new argument RAISE_ERROR, which
+ allows to suppress errors when polling in Emacs' main loop.
+ (Fdbus_init_bus, Fdbus_get_unique_name, Fdbus_call_method)
+ (Fdbus_call_method_asynchronously, Fdbus_method_return_internal)
+ (Fdbus_method_error_internal, Fdbus_send_signal)
+ (xd_get_dispatch_status, xd_read_message, Fdbus_register_signal)
+ (Fdbus_register_method): Use it. (Bug#6579)
+
+2010-07-08 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * alloc.c: Convert DEFUNs to standard C.
+ * buffer.c:
+ * bytecode.c:
+ * callint.c:
+ * callproc.c:
+ * casefiddle.c:
+ * casetab.c:
+ * category.c:
+ * character.c:
+ * charset.c:
+ * chartab.c:
+ * cmds.c:
+ * coding.c:
+ * composite.c:
+ * data.c:
+ * dbusbind.c:
+ * dired.c:
+ * dispnew.c:
+ * doc.c:
+ * dosfns.c:
+ * editfns.c:
+ * emacs.c:
+ * eval.c:
+ * fileio.c:
+ * filelock.c:
+ * floatfns.c:
+ * fns.c:
+ * font.c:
+ * fontset.c:
+ * frame.c:
+ * fringe.c:
+ * image.c:
+ * indent.c:
+ * insdel.c:
+ * keyboard.c:
+ * keymap.c:
+ * lread.c:
+ * macros.c:
+ * marker.c:
+ * menu.c:
+ * minibuf.c:
+ * msdos.c:
+ * nsfns.m:
+ * nsmenu.m:
+ * nsselect.m:
+ * print.c:
+ * process.c:
+ * search.c:
+ * sound.c:
+ * syntax.c:
+ * term.c:
+ * terminal.c:
+ * textprop.c:
+ * undo.c:
+ * w16select.c:
+ * w32console.c:
+ * w32fns.c:
+ * w32font.c:
+ * w32menu.c:
+ * w32proc.c:
+ * w32select.c:
+ * window.c:
+ * xdisp.c:
+ * xfaces.c:
+ * xfns.c:
+ * xmenu.c:
+ * xselect.c:
+ * xsettings.c:
+ * xsmfns.c: Likewise.
+
+2010-07-08 Eli Zaretskii <eliz@gnu.org>
+
+ * process.c (kbd_is_on_hold, hold_keyboard_input)
+ (unhold_keyboard_input, kbd_on_hold_p) [!subprocesses]: Define.
+
+2010-07-08 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
+ (create_and_show_dialog): Don't call apply_systemfont_to_(menu|dialog)
+ unless USE_LUCID.
+
+2010-07-08 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * xdisp.c (store_mode_line_noprop_char): Remove K&R alternative
+ declaration.
+
+ Clean up include guards.
+ * tparam.c: Remove include guards for config.h, string.h and code
+ that assumes #ifndef emacs.
+ * termcap.c:
+ * unexalpha.c:
+ * sysdep.c:
+ * filemode.c:
+ * filelock.c:
+ * bidi.c: Likewise.
+
+ Remove prefix-args.c
+ * prefix-args.c: Remove file.
+ * autodeps.mk (ALLOBJS): Remove reference to prefix-args.
+ * Makefile.in (temacs${EXEEXT}): Remove references to
+ PRE_EDIT_LDFLAGS and POST_EDIT_LDFLAGS.
+ (mostlyclean): Remove reference to prefix-args.
+ (prefix-args): Remove.
+
+ Simplify cstart_of_data, start_of_code and related code.
+ * mem-limits.h: Remove !emacs and _LIBC conditional code.
+ (start_of_data): Merge into start_of_data function.
+ * sysdep.c (start_of_text): Remove. Move simplified versions of
+ it in the only users: unexaix.c and unexec.c.
+ (read_input_waiting): Remove local declaration of quit_char.
+ (start, etext): Remove declarations.
+ (start_of_data): Merge with the version in mem-limits.h and move
+ to vm-limits.c.
+ * vm-limit.c (start_of_data): Merged and simplified version of the
+ code formerly in mem-limits.h and sysdep.c.
+ * unexec.c (start): New declaration, moved from sysdep.c.
+ (start_of_text): Simplified version of the code formerly in sysdep.c.
+ * unexaix.c (start_of_text): Simplified version of the code
+ formerly in sysdep.c.
+ * m/alpha.h (HAVE_TEXT_START): Remove.
+ (TEXT_START): Move ...
+ * unexalpha.c (TEXT_START): ... here.
+ * s/hpux10-20.h (TEXT_START): Remove.
+ * s/darwin.h (TEXT_START):
+ * m/mips.h (TEXT_START):
+ * m/macppc.h (HAVE_TEXT_START):
+ * m/m68k.h (TEXT_START):
+ * m/iris4d.h (TEXT_START):
+ * m/intel386.h (TEXT_START):
+ * m/ibmrs6000.h (TEXT_START):
+ * m/ia64.h (HAVE_TEXT_START):
+ * s/msdos.h (TEXT_START): Likewise.
+
+2010-07-07 Andreas Schwab <schwab@linux-m68k.org>
+
+ * alloc.c (overrun_check_malloc, overrun_check_realloc)
+ (overrun_check_free, xstrdup, allocate_string)
+ (allocate_string_data, compact_small_strings, Fmake_string)
+ (make_unibyte_string, make_multibyte_string)
+ (make_string_from_bytes, make_specified_string, make_float)
+ (Fcons, allocate_terminal, allocate_frame, make_pure_string)
+ (Fgarbage_collect): Replace bcopy, safe_bcopy, bzero, bcmp by
+ memcpy, memmove, memset, memcmp.
+ * atimer.c (start_atimer, set_alarm): Likewise.
+ * buffer.c (clone_per_buffer_values, report_overlay_modification)
+ (mmap_realloc, init_buffer_once): Likewise.
+ * callint.c (Fcall_interactively): Likewise.
+ * callproc.c (Fcall_process, Fcall_process_region, child_setup)
+ (getenv_internal_1): Likewise.
+ * casefiddle.c (casify_object): Likewise.
+ * ccl.c (ccl_driver): Likewise.
+ * character.c (str_as_multibyte, str_to_multibyte): Likewise.
+ * charset.c (load_charset_map_from_file)
+ (load_charset_map_from_file, load_charset_map_from_vector)
+ (Fdefine_charset_internal): Likewise.
+ * cm.c (Wcm_clear): Likewise.
+ * coding.c (decode_eol, decode_coding_object)
+ (Fset_coding_system_priority, make_subsidiaries): Likewise.
+ * data.c (Faset): Likewise.
+ * dired.c (directory_files_internal, file_name_completion_stat):
+ Likewise.
+ * dispnew.c (new_glyph_matrix, adjust_glyph_matrix)
+ (clear_glyph_row, copy_row_except_pointers)
+ (copy_glyph_row_contents, new_glyph_pool, realloc_glyph_pool)
+ (save_current_matrix, restore_current_matrix)
+ (build_frame_matrix_from_leaf_window, mirrored_line_dance)
+ (mirror_line_dance, scrolling_window): Likewise.
+ * doc.c (Fsnarf_documentation, Fsubstitute_command_keys):
+ Likewise.
+ * doprnt.c (doprnt): Likewise.
+ * editfns.c (Fuser_full_name, make_buffer_string_both)
+ (Fmessage_box, Fformat, Ftranspose_regions): Likewise.
+ * emacs.c (sort_args): Likewise.
+ * eval.c (Fapply, Ffuncall): Likewise.
+ * fileio.c (Ffile_name_directory, make_temp_name)
+ (Fexpand_file_name, search_embedded_absfilename)
+ (Fsubstitute_in_file_name, Ffile_symlink_p, Finsert_file_contents)
+ (auto_save_error): Likewise.
+ * fns.c (Fstring_equal, Fcopy_sequence, concat)
+ (string_to_multibyte, Fstring_as_unibyte, Fstring_as_multibyte)
+ (internal_equal, Fclear_string, larger_vector, copy_hash_table)
+ (Fmake_hash_table): Likewise.
+ * fringe.c (Fdefine_fringe_bitmap): Likewise.
+ * ftfont.c (ftfont_text_extents): Likewise.
+ * getloadavg.c (getloadavg): Likewise.
+ * image.c (define_image_type, make_image, make_image_cache)
+ (x_create_x_image_and_pixmap, xbm_image_p)
+ (w32_create_pixmap_from_bitmap_data, xbm_load, xpm_lookup_color)
+ (xpm_image_p, x_create_bitmap_from_xpm_data, xpm_load)
+ (init_color_table, x_build_heuristic_mask, pbm_image_p, pbm_load)
+ (png_image_p, png_read_from_memory, png_load, jpeg_image_p)
+ (tiff_image_p, tiff_read_from_memory, gif_image_p)
+ (gif_read_from_memory, gif_load, svg_image_p, gs_image_p):
+ Likewise.
+ * indent.c (scan_for_column, compute_motion): Likewise.
+ * insdel.c (gap_left, gap_right, make_gap_smaller, copy_text)
+ (insert_1_both, insert_from_gap, replace_range_2): Likewise.
+ * intervals.c (reproduce_tree, reproduce_tree_obj): Likewise.
+ * keyboard.c (echo_char, save_getcjmp, restore_getcjmp)
+ (kbd_buffer_store_event_hold, apply_modifiers_uncached)
+ (store_user_signal_events, menu_bar_items, tool_bar_items)
+ (process_tool_bar_item, append_tool_bar_item)
+ (read_char_minibuf_menu_prompt, read_key_sequence)
+ (Fread_key_sequence, Fread_key_sequence_vector, Frecent_keys):
+ Likewise.
+ * keymap.c (current_minor_maps, Fdescribe_buffer_bindings):
+ Likewise.
+ * lisp.h (STRING_COPYIN): Likewise.
+ * lread.c (Fload, read1, oblookup): Likewise.
+ * msdos.c (Frecent_doskeys): Likewise.
+ * nsfns.m (Fx_create_frame): Likewise.
+ * nsfont.m (nsfont_open, nsfont_text_extents, ns_glyph_metrics):
+ Likewise.
+ * nsimage.m (EmacsImage-initFromSkipXBM:width:height:)
+ (EmacsImage-initForXPMWithDepth:width:height:flip:length:):
+ Likewise.
+ * nsmenu.m (ns_update_menubar): Likewise.
+ * nsterm.m (ns_draw_fringe_bitmap, ns_term_init): Likewise.
+ * print.c (print_unwind, printchar, strout, print_string)
+ (print_error_message): Likewise.
+ * process.c (conv_lisp_to_sockaddr, set_socket_option)
+ (Fmake_network_process, Fnetwork_interface_list)
+ (Fnetwork_interface_info, read_process_output, Fprocess_send_eof)
+ (init_process): Likewise.
+ * ralloc.c (resize_bloc, r_alloc_sbrk, r_alloc_init): Likewise.
+ * regex.c (init_syntax_once, regex_compile, re_compile_fastmap):
+ Likewise.
+ * scroll.c (do_scrolling, do_direct_scrolling)
+ (scrolling_max_lines_saved): Likewise.
+ * search.c (search_buffer, wordify, Freplace_match): Likewise.
+ * sound.c (wav_init, au_init, Fplay_sound_internal): Likewise.
+ * syntax.c (skip_chars, skip_syntaxes): Likewise.
+ * sysdep.c (child_setup_tty, sys_subshell, emacs_get_tty)
+ (emacs_set_tty): Likewise.
+ * term.c (encode_terminal_code, calculate_costs)
+ (produce_special_glyphs, create_tty_output, init_tty, delete_tty):
+ Likewise.
+ * termcap.c (tgetst1, gobble_line): Likewise.
+ * termhooks.h (EVENT_INIT): Likewise.
+ * tparam.c (tparam1): Likewise.
+ * unexalpha.c (unexec): Likewise.
+ * unexec.c (write_segment): Likewise.
+ * unexmacosx.c (unexec_write_zero): Likewise.
+ * w32fns.c (w32_wnd_proc, Fx_create_frame, x_create_tip_frame)
+ (Fx_file_dialog, Fsystem_move_file_to_trash): Likewise.
+ * w32font.c (w32font_list_family, w32font_text_extents)
+ (w32font_list_internal, w32font_match_internal)
+ (w32font_open_internal, compute_metrics, Fx_select_font):
+ Likewise.
+ * w32menu.c (set_frame_menubar, add_menu_item)
+ (w32_menu_display_help, w32_free_submenu_strings): Likewise.
+ * w32term.c (XCreateGC, w32_initialize_display_info): Likewise.
+ * w32uniscribe.c (uniscribe_list_family): Likewise.
+ * w32xfns.c (get_next_msg, post_msg, prepend_msg): Likewise.
+ * window.c (make_window, replace_window, set_window_buffer)
+ (Fsplit_window): Likewise.
+ * xdisp.c (init_iterator, RECORD_OVERLAY_STRING, reseat_to_string)
+ (add_to_log, message3, x_consider_frame_title)
+ (append_space_for_newline, extend_face_to_end_of_line)
+ (decode_mode_spec_coding, init_glyph_string): Likewise.
+ * xfaces.c (x_create_gc, get_lface_attributes_no_remap)
+ (Finternal_copy_lisp_face, Finternal_merge_in_global_face)
+ (face_attr_equal_p, make_realized_face, make_face_cache)
+ (free_realized_faces, lookup_named_face, smaller_face)
+ (face_with_height, lookup_derived_face)
+ (x_supports_face_attributes_p, Finternal_set_font_selection_order)
+ (Finternal_set_font_selection_order, realize_default_face)
+ (compute_char_face, face_at_buffer_position)
+ (face_for_overlay_string, face_at_string_position, merge_faces):
+ Likewise.
+ * xfns.c (xic_create_fontsetname, Fx_create_frame)
+ (Fx_window_property, x_create_tip_frame)
+ (Fx_backspace_delete_keys_p): Likewise.
+ * xfont.c (xfont_list, xfont_match, xfont_list_family)
+ (xfont_text_extents): Likewise.
+ * xmenu.c (set_frame_menubar, xmenu_show): Likewise.
+ * xrdb.c (magic_file_p, x_get_resource): Likewise.
+ * xselect.c (x_queue_event, x_get_window_property)
+ (receive_incremental_selection): Likewise.
+ * xsmfns.c (x_session_check_input): Likewise.
+ * xterm.c (x_send_scroll_bar_event, SET_SAVED_MENU_EVENT)
+ (handle_one_xevent, x_check_errors, xim_initialize, x_term_init):
+ Likewise.
+ * character.h (BCOPY_SHORT): Removed.
+ * config.in: Regenerate.
+ * dispnew.c (safe_bcopy): Only define as dummy if PROFILING.
+ * emacs.c (main) [PROFILING]: Don't declare
+ dump_opcode_frequencies.
+ * lisp.h (safe_bcopy): Remove declaration.
+ (memset) [!HAVE_MEMSET]: Declare.
+ (memcpy) [!HAVE_MEMCPY]: Likewise.
+ (memmove) [!HAVE_MEMMOVE]: Likewise.
+ (memcmp) [!HAVE_MEMCMP]: Likewise.
+ * s/ms-w32.h (bzero, bcopy, bcmp, GAP_USE_BCOPY)
+ (BCOPY_UPWARD_SAFE, BCOPY_DOWNWARD_SAFE, HAVE_BCOPY, HAVE_BCMP):
+ Don't define.
+ (HAVE_MEMCMP, HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET): Define.
+ * s/msdos.h (GAP_USE_BCOPY, BCOPY_UPWARD_SAFE)
+ (BCOPY_DOWNWARD_SAFE): Don't define.
+ * sysdep.c (memset) [!HAVE_MEMSET]: Define.
+ (memcpy) [!HAVE_MEMCPY]: Define.
+ (memmove) [!HAVE_MEMMOVE]: Define.
+ (memcmp) [!HAVE_MEMCMP]: Define.
+
+2010-07-07 Jan Djärv <jan.h.d@swipnet.se>
+
+ * process.c (kbd_is_on_hold): New variable.
+ (hold_keyboard_input, unhold_keyboard_input, kbd_on_hold_p):
+ New functions.
+ (wait_reading_process_output): If kbd_on_hold_p returns non-zero,
+ select on empty input mask.
+ (init_process): Initialize kbd_is_on_hold to 0.
+
+ * process.h (hold_keyboard_input, unhold_keyboard_input)
+ (kbd_on_hold_p): Declare.
+
+ * keyboard.c (input_available_signal): Declare.
+ (kbd_buffer_nr_stored): New function.
+ (kbd_buffer_store_event_hold): If kbd_buffer_nr_stored returns
+ more than KBD_BUFFER_SIZE/2, stop reding input (Bug#6571).
+ (kbd_buffer_get_event): If input is suspended and kbd_buffer_nr_stored
+ returns less than KBD_BUFFER_SIZE/4, resume reding input (Bug#6571).
+ (tty_read_avail_input): If input is on hold, return.
+ Don't read more that free slots in kbd_buffer (Bug#6571).
+
+2010-07-07 Eli Zaretskii <eliz@gnu.org>
+
+ * msdos.h:
+ * msdos.c:
+ * dosfns.c:
+ * w16select.c: Convert function definitions to ANSI C.
+
+ * msdos.h (ctrl_break_func, install_ctrl_break_check):
+ Remove unused prototypes.
+
+2010-07-07 Juanma Barranquero <lekktu@gmail.com>
+
+ * coding.c, sysdep.c: Convert some more functions to standard C.
+
+2010-07-07 Juanma Barranquero <lekktu@gmail.com>
+
+ * coding.c (decode_coding_gap, encode_coding_gap, decode_coding_object)
+ (encode_coding_object): Use SPECPDL_INDEX.
+ (syms_of_coding): Use DOS_NT.
+
+2010-07-07 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * intervals.h (interval): Use EMACS_UINT instead of unsigned EMACS_INT.
+
+ Make the function member of Lisp_Subr use standard C prototypes.
+ * lisp.h (struct Lisp_Subr): Use a union for the function member.
+ (DECL_ALIGN): Add a cast for the function.
+ * eval.c (Feval, Ffuncall): Use the proper type for each type
+ function call.
+
+2010-07-06 Chong Yidong <cyd@stupidchicken.com>
+
+ * fringe.c (draw_fringe_bitmap_1): Use lookup_named_face to get
+ fringe face id, so face-remapping-alist works (Bug#6091).
+
+2010-07-06 Juanma Barranquero <lekktu@gmail.com>
+
+ * w32.c, w32console.c, w32fns.c, w32font.c, w32heap.c, w32inevt.c
+ * w32menu.c, w32proc.c, w32reg.c, w32select.c, w32term.c
+ * w32uniscribe.c, w32xfns.c: Convert function definitions to standard C.
+
+2010-07-06 Andreas Schwab <schwab@linux-m68k.org>
+
+ * xterm.c (x_get_keysym_name): Change type of parameter to int.
+ * lisp.h: Declare x_get_keysym_name.
+ * keyboard.c (modify_event_symbol): Don't declare
+ x_get_keysym_name here.
+
+2010-07-06 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * ecrt0.c: Revert conversion to standard C.
+
+2010-07-05 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * vm-limit.c (memory_warnings):
+ * keyboard.c (modify_event_symbol):
+ * floatfns.c (rounding_driver, ceiling2, floor2, truncate2)
+ (round2, emacs_rint):
+ * process.c (send_process, old_sigpipe): Convert function
+ definitions and declarations to standard C.
+
+2010-07-05 Juanma Barranquero <lekktu@gmail.com>
+
+ * buffer.c, cm.c, eval.c, keyboard.c, process.c, term.c, vm-limit.c,
+ * xdisp.c: Convert function definitions to standard C.
+
+ * cm.c (cmputc): Arg C is now int, not char.
+ * process.c (Fmake_network_process): Cast sockaddr_in* to sockaddr*.
+
+2010-07-05 James Cloos <cloos@jhcloos.com>
+
+ * xterm.h (Xatom_net_wm_name, Xatom_net_wm_icon_name): New.
+
+ * xterm.c (x_term_init): Intern the _NET_WM_NAME and
+ _NET_WM_ICON_NAME atoms.
+
+ * xfns.c (x_set_name_internal): Set the EWMH _NET_WM_NAME
+ and _NET_WM_ICON_NAME properties, too, matching what is
+ done in the Gtk+ case.
+
+2010-07-05 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xterm.c (XTring_bell, XTset_terminal_window): Fix wrong prototype.
+
+ * xsmfns.c (SSDATA): New macro.
+ (smc_save_yourself_CB, x_session_initialize): Use SSDATA for strings
+ passed to strlen/strcpy/strcat.
+ (create_client_leader_window): Surround with #ifndef USE_GTK. Cast
+ 7:th arg to XChangeProperty to (unsigned char *)
+
+ * xsettings.c (something_changedCB, parse_settings)
+ (apply_xft_settings): Reformat prototype.
+ (something_changedCB, init_gconf): Remove unused variable i.
+ (read_settings): Remove unused variable long_len.
+
+ * gtkutil.c (xg_get_pixbuf_from_pix_and_mask)
+ (xg_get_image_for_pixmap, create_dialog)
+ (xg_get_file_with_selection, xg_get_file_name, update_cl_data)
+ (menuitem_highlight_callback, make_menu_item)
+ (xg_create_one_menuitem, create_menus, xg_update_menu_item)
+ (xg_create_scroll_bar, xg_update_scrollbar_pos)
+ (xg_set_toolkit_scroll_bar_thumb, xg_tool_bar_button_cb)
+ (xg_tool_bar_proxy_help_callback, xg_tool_bar_detach_callback)
+ (xg_tool_bar_attach_callback, xg_tool_bar_help_callback)
+ (xg_tool_bar_item_expose_callback): Reformat prototype.
+ (xg_update_menubar): GList *group => GSList *group.
+ (xg_modify_menubar_widgets): Initialize witem to 0, check witem != 0
+ before use.
+ (update_frame_tool_bar): 4:th param to xg_get_image_for_pixmap changed
+ to GTK_IMAGE (wimage).
+
+2010-07-05 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * atimer.c: Use "" instead of <> for local includes for
+ consistency with the rest of the code.
+
+ * xsmfns.c (smc_save_yourself_CB, smc_error_handler):
+ * xrdb.c (get_system_name):
+ * window.c (shrink_windows):
+ * syntax.c (forw_comment):
+ * scroll.c (calculate_scrolling, calculate_direct_scrolling)
+ (ins_del_costs):
+ * mem-limits.h (start_of_data):
+ * lread.c (readevalloop):
+ * gtkutil.c (xg_dialog_response_cb, xg_get_file_with_chooser)
+ (xg_get_file_with_selection, xg_update_menubar, xg_update_submenu):
+ * frame.c (x_get_focus_frame):
+ * floatfns.c (fmod_float):
+ * fileio.c (choose_write_coding_system):
+ * emacs.c (fatal_error_signal, init_cmdargs, argmatch)
+ (malloc_initialize_hook, sort_args, synchronize_locale):
+ * doprnt.c (doprnt):
+ * dired.c (compile_pattern):
+ * data.c (fmod_float):
+ * chartab.c (map_sub_char_table, map_sub_char_table_for_charset)
+ (map_char_table_for_charset):
+ * charset.c (define_charset_internal):
+ * alloc.c (Fgarbage_collect): Convert declarations or definitions
+ to standard C.
+
+2010-07-04 Tetsurou Okazaki <okazaki@be.to> (tiny change)
+ Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * lread.c (read1): Fix up last change to not mess up `c'.
+
+2010-07-04 Juanma Barranquero <lekktu@gmail.com>
+
+ * strftime.c: Revert conversion to standard C (2010-07-04T07:50:25Z!dann@ics.uci.edu).
+
+2010-07-04 Juanma Barranquero <lekktu@gmail.com>
+
+ Fix prototypes.
+
+ * atimer.c (start_atimer): Use EMACS_TIME, not struct timeval.
+ * dired.c (file_name_completion_stat): Use DIRENTRY, not struct dirent.
+ * fileio.c (read_non_regular, read_non_regular_quit): Add Lisp_Object
+ arg, as required by internal_condition_case_1.
+ * print.c (strout): Use const char* for arg PTR.
+ * regex.c (bcmp_translate): Use RE_TRANSLATE_TYPE, not Lisp_Object.
+ (analyse_first): Fix "const const".
+ * sysdep.c (set_file_times): Use EMACS_TIME, not struct timeval.
+ * unexelf.c (round_up, find_section): Use ElfW macro for arguments.
+ * xgselect.c (xg_select): Use SELECT_TYPE, EMACS_TIME.
+
+2010-07-04 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * alloc.c: Convert function definitions to standard C.
+ * atimer.c:
+ * bidi.c:
+ * bytecode.c:
+ * callint.c:
+ * callproc.c:
+ * casefiddle.c:
+ * casetab.c:
+ * category.c:
+ * ccl.c:
+ * character.c:
+ * charset.c:
+ * chartab.c:
+ * cmds.c:
+ * coding.c:
+ * composite.c:
+ * data.c:
+ * dbusbind.c:
+ * dired.c:
+ * dispnew.c:
+ * doc.c:
+ * doprnt.c:
+ * ecrt0.c:
+ * editfns.c:
+ * fileio.c:
+ * filelock.c:
+ * filemode.c:
+ * fns.c:
+ * font.c:
+ * fontset.c:
+ * frame.c:
+ * fringe.c:
+ * ftfont.c:
+ * ftxfont.c:
+ * gtkutil.c:
+ * indent.c:
+ * insdel.c:
+ * intervals.c:
+ * keymap.c:
+ * lread.c:
+ * macros.c:
+ * marker.c:
+ * md5.c:
+ * menu.c:
+ * minibuf.c:
+ * prefix-args.c:
+ * print.c:
+ * ralloc.c:
+ * regex.c:
+ * region-cache.c:
+ * scroll.c:
+ * search.c:
+ * sound.c:
+ * strftime.c:
+ * syntax.c:
+ * sysdep.c:
+ * termcap.c:
+ * terminal.c:
+ * terminfo.c:
+ * textprop.c:
+ * tparam.c:
+ * undo.c:
+ * unexelf.c:
+ * window.c:
+ * xfaces.c:
+ * xfns.c:
+ * xfont.c:
+ * xftfont.c:
+ * xgselect.c:
+ * xmenu.c:
+ * xrdb.c:
+ * xselect.c:
+ * xsettings.c:
+ * xsmfns.c:
+ * xterm.c: Likewise.
+
+2010-07-03 Eli Zaretskii <eliz@gnu.org>
+
+ * msdos.c (IT_set_frame_parameters): Fix setting of colors in
+ frames other than the initial one. Fix reversal of colors when
+ `reverse' is specified in the frame parameters. Call
+ update_face_from_frame_parameter instead of
+ internal-set-lisp-face-attribute. Initialize screen colors from
+ initial_screen_colors[] when f->default_face_done_p is zero,
+ instead of depending on being called with default-frame-alist as
+ the alist argument.
+
+ * xfaces.c (update_face_from_frame_parameter): Move out of
+ HAVE_WINDOW_SYSTEM portion. Condition window-system only parts
+ with HAVE_WINDOW_SYSTEM.
+
+ * msdos.c (IT_set_frame_parameters): Set menu-bar-lines according
+ to menu-bar-mode, if not set in the frame parameters or in
+ default-frame-alist.
+
+ * w32console.c (sys_tputs): Adjust argument list to prototype in
+ term.c.
+
+2010-07-03 Juanma Barranquero <lekktu@gmail.com>
+
+ * lisp.h (memory_warnings): Fix prototype.
+
+ * cm.h (evalcost): Fix prototype.
+
+ * cm.c (evalcost): Fix arg type.
+
+2010-07-02 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * term.c (term_clear_mouse_face, Fidentity):
+ * syssignal.h (signal_handler_t):
+ * lisp.h (memory_warnings):
+ * coding.h (preferred_coding_system):
+ * cm.h (evalcost):
+ * blockinput.h (reinvoke_input_signal): Convert to standard C prototypes.
+
+2010-07-02 Eli Zaretskii <eliz@gnu.org>
+
+ * dosfns.h (msdos_stdcolor_idx, msdos_stdcolor_name): Remove P_
+ from prototypes.
+
+ * msdos.h (load_pixmap): Don't define away.
+
+2010-07-02 Jan Djärv <jan.h.d@swipnet.se>
+
+ * lisp.h:
+ * atimer.h: Remove define for P_.
+
+ * alloc.c: Remove __P and P_ from .c and .m files.
+ * atimer.c:
+ * buffer.c:
+ * callint.c:
+ * category.c:
+ * charset.c:
+ * chartab.c:
+ * cm.c:
+ * coding.c:
+ * composite.c:
+ * data.c:
+ * dired.c:
+ * dispnew.c:
+ * doc.c:
+ * editfns.c:
+ * emacs.c:
+ * eval.c:
+ * fileio.c:
+ * filelock.c:
+ * fns.c:
+ * font.c:
+ * fontset.c:
+ * frame.c:
+ * ftfont.c:
+ * ftxfont.c:
+ * gmalloc.c:
+ * gtkutil.c:
+ * image.c:
+ * indent.c:
+ * intervals.c:
+ * keyboard.c:
+ * keymap.c:
+ * lread.c:
+ * marker.c:
+ * menu.c:
+ * minibuf.c:
+ * print.c:
+ * process.c:
+ * scroll.c:
+ * search.c:
+ * sound.c:
+ * strftime.c:
+ * syntax.c:
+ * sysdep.c:
+ * term.c:
+ * terminal.c:
+ * textprop.c:
+ * unexalpha.c:
+ * w32console.c:
+ * w32fns.c:
+ * w32font.c:
+ * w32menu.c:
+ * w32term.c:
+ * w32uniscribe.c:
+ * window.c:
+ * xdisp.c:
+ * xfaces.c:
+ * xfns.c:
+ * xfont.c:
+ * xftfont.c:
+ * xmenu.c:
+ * xselect.c:
+ * xterm.c: Likewise.
+
+ Remove P_ and __P macros.
+ * atimer.h: Remove P_ and __P macros.
+ * buffer.h:
+ * category.h:
+ * ccl.h:
+ * character.h:
+ * charset.h:
+ * cm.h:
+ * coding.h:
+ * composite.h:
+ * dispextern.h:
+ * disptab.h:
+ * dosfns.h:
+ * font.h:
+ * fontset.h:
+ * frame.h:
+ * gtkutil.h:
+ * indent.h:
+ * intervals.h:
+ * keyboard.h:
+ * keymap.h:
+ * lisp.h:
+ * macros.h:
+ * md5.h:
+ * menu.h:
+ * msdos.h:
+ * nsterm.h:
+ * puresize.h:
+ * region-cache.h:
+ * syntax.h:
+ * syssignal.h:
+ * systime.h:
+ * termhooks.h:
+ * w32font.h:
+ * w32term.h:
+ * widget.h:
+ * window.h:
+ * xgselect.h:
+ * xsettings.h:
+ * xterm.h: Likewise.
+
+2010-07-02 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * lisp.h: Document that USE_LISP_UNION_TYPE is now enabled using autoconf.
+
+ Cleanup old code.
+ * dired.c (BSD4_3): Remove all uses, redundant with BSD4_2.
+ * syssignal.h: Remove code for Lynx, not supported anymore.
+ * vm-limit.c: Remove unused code the depends on emacs not being
+ defined and NO_LIM_DATA being defined.
+ * mem-limits.h: Remove dead code.
+
+2010-07-01 Jan Djärv <jan.h.d@swipnet.se>
+
+ * window.c (Fwindow_absolute_pixel_edges): Doc fix.
+
+ * window.c (calc_absolute_offset, Fwindow_absolute_pixel_edges)
+ (Fwindow_inside_absolute_pixel_edges): New functions (bug#5721).
+
+ * nsfns.m (compute_tip_xy): Do not convert coordinates from frame
+ parameters, they are already absolute.
+
+ * nsterm.m (x_set_window_size, initFrameFromEmacs):
+ Rename FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT.
+
+ * nsterm.h (FRAME_NS_TOOLBAR_HEIGHT): Rename to FRAME_TOOLBAR_HEIGHT.
+
+ * nsmenu.m (update_frame_tool_bar, free_frame_tool_bar):
+ Update FRAME_TOOLBAR_HEIGHT.
+
+ * nsmenu.m (free_frame_tool_bar, update_frame_tool_bar):
+ Add BLOCK/UNBLOCK_INPUT so asserts don't trigger.
+
+2010-06-30 Chong Yidong <cyd@stupidchicken.com>
+
+ * frame.c (get_future_frame_param, Fmake_terminal_frame): Don't
+ check default-frame-alist.
+
+2010-06-30 Andreas Schwab <schwab@linux-m68k.org>
+
+ * process.c (create_process): Avoid using invalid file descriptors.
+
+ * callproc.c (child_setup): Avoid closing a file descriptor twice.
+
+2010-06-30 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
+ Improve documentation. Return font regardless of use_system_font.
+ (syms_of_xsettings): Improve documentation for font-use-system-font.
+
+2010-07-10 Chong Yidong <cyd@stupidchicken.com>
+
+ * xfaces.c (realize_face): Garbage the frame if a face is removed
+ (Bug#6593).
+
+2010-07-05 Andreas Schwab <schwab@linux-m68k.org>
+
+ * keyboard.c: Remove duplicate <setjmp.h>.
+ (read_key_sequence): Remove volatile qualifiers.
+
+2010-07-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * dispextern.h (FRINGE_HEIGHT_BITS): New define.
+ (struct glyph_row): New members left_fringe_offset and
+ right_fringe_offset.
+
+ * xterm.c (x_draw_fringe_bitmap): Don't clip bottom aligned bitmap
+ specially.
+ * w32term.c (w32_draw_fringe_bitmap): Likewise.
+ * nsterm.m (ns_draw_fringe_bitmap): Likewise.
+
+ * fringe.c (draw_fringe_bitmap_1): Don't clip bitmap here.
+ Take account of bitmap offset.
+ (draw_window_fringes): Take account of window vscroll.
+ (update_window_fringes): Likewise. Extend top-aligned top indicator
+ or bottom-aligned bottom indicator to adjacent rows if it doesn't fit
+ in one row. Don't set redraw_fringe_bitmaps_p outside row comparison.
+ Set left_fringe_offset and right_fringe_offset (Bug#5634, Bug#6325).
+
+2010-07-04 Juanma Barranquero <lekktu@gmail.com>
+
+ * w32fns.c (Qtooltip): Declare.
+ Suggested by Andy Moreton <andrewjmoreton@gmail.com>.
+
+2010-07-03 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xmenu.c (x_activate_menubar): Send Press/Release for Gtk+ to avoid
+ grab on just Press (Bug#6499).
+
+2010-07-02 Chong Yidong <cyd@stupidchicken.com>
+
+ * frame.c (Qtooltip): New var.
+ (delete_frame): Use it. Fix faulty if statement. Don't update
+ mode line for tooltip frames. Suggested by Martin Rudalics.
+
+ * xfns.c (x_create_tip_frame):
+ * w32fns.c (x_create_tip_frame): Use it.
+
+2010-06-17 Naohiro Aota <naota@elisp.net> (tiny change)
+
+ * xftfont.c (xftfont_open): Check font width one by one also when
+ spacing is dual.
+
+ * ftfont.c (ftfont_open): Ditto.
+
+2010-06-30 Glenn Morris <rgm@gnu.org>
+
+ * s/sol2-6.h (INHIBIT_X11R6_XIM): Remove, handled by configure now.
+
+ * Makefile.in (CANNOT_DUMP): Update for configure name change.
+
+ * s/freebsd.h (USE_MMAP_FOR_BUFFERS):
+ * s/irix6-5.h (USE_MMAP_FOR_BUFFERS):
+ * s/darwin.h (SYSTEM_MALLOC):
+ * s/sol2-10.h (SYSTEM_MALLOC): Move to configure.
+
+2010-06-29 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsfns.m: extern declare Vmenu_bar_mode, Vtool_bar_mode.
+ (ns_get_screen): Don't assign integer to f.
+ (Fx_display_color_cells): Declarations before statements.
+
+2010-06-28 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xfns.c (x_default_font_parameter): Remove got_from_system
+ (Bug#6526).
+
+ * xterm.h (gtk_widget_get_window, gtk_widget_get_mapped)
+ (gtk_adjustment_get_page_size, gtk_adjustment_get_upper): New
+ defines based on what configure finds.
+
+ * xterm.c (XTflash): Use gtk_widget_get_window.
+ (xg_scroll_callback): Use gtk_adjustment_get_upper and
+ gtk_adjustment_get_page_size.
+ (handle_one_xevent): Use gtk_widget_get_mapped.
+ (x_term_init): Remove HAVE_GTK_MULTIDISPLAY and associated error
+ messages.
+
+ * xmenu.c (create_and_show_popup_menu): Call gtk_widget_get_mapped.
+
+ * gtkutil.h: Replace HAVE_GTK_FILE_BOTH with
+ HAVE_GTK_FILE_SELECTION_NEW.
+
+ * gtkutil.c (xg_display_open, xg_display_close): Remove
+ HAVE_GTK_MULTIDISPLAY, it is always defined.
+ (xg_display_open): Return type is void.
+ (gtk_widget_set_has_window)
+ (gtk_dialog_get_action_area, gtk_dialog_get_content_area)
+ (gtk_widget_get_sensitive, gtk_adjustment_set_page_size)
+ (gtk_adjustment_set_page_increment)
+ (gtk_adjustment_get_step_increment): #define these if not found
+ by configure.
+ (remove_submenu): New define based on Gtk+ version.
+ (xg_set_cursor, xg_frame_resized, xg_event_is_for_scrollbar): Use
+ gtk_widget_get_window.
+ (xg_frame_resized, xg_update_frame_menubar): Use gtk_widget_get_mapped.
+ (xg_create_frame_widgets): Use gtk_widget_set_has_window.
+ (create_dialog): Use gtk_dialog_get_action_area and
+ gtk_dialog_get_content_area.
+ (xg_uses_old_file_dialog, xg_get_file_name): Remove HAVE_GTK_FILE_BOTH
+ and HAVE_GTK_FILE_CHOOSER_DIALOG_NEW. File chooser is always
+ available, so checking for HAVE_GTK_FILE_SELECTION_NEW is enough.
+ (xg_update_menubar, xg_update_submenu, xg_show_toolbar_item): Use
+ g_object_ref and g_object_unref.
+ (xg_update_menu_item, xg_tool_bar_menu_proxy): Use
+ gtk_widget_get_sensitive.
+ (xg_update_submenu): Use remove_submenu.
+ (xg_update_scrollbar_pos): Don't use GtkFixedChild, use child
+ properties instead to get old x and y position.
+ (xg_set_toolkit_scroll_bar_thumb): Use gtk_adjustment_get_page_size,
+ gtk_adjustment_get_step_increment, gtk_adjustment_set_page_size,
+ gtk_adjustment_set_step_increment and gtk_adjustment_set_page_increment.
+ (xg_get_tool_bar_widgets): New function.
+ (xg_tool_bar_menu_proxy, xg_show_toolbar_item)
+ (update_frame_tool_bar): Call xg_get_tool_bar_widgets.
+ (toolbar_set_orientation): New #define based on if configure
+ finds gtk_orientable_set_orientation.
+ (xg_create_tool_bar): Call toolbar_set_orientation.
+ (xg_make_tool_item, xg_show_toolbar_item): Call gtk_box_pack_start
+ instead of gtk_box_pack_start_defaults.
+
+2010-06-28 Chong Yidong <cyd@stupidchicken.com>
+
+ * cmds.c (Fdelete_backward_char): Move into Lisp.
+
+2010-06-27 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * s/freebsd.h (BSD4_2): Remove redundant definition.
+ bsd-common.h defines it already.
+
+2010-06-27 Chong Yidong <cyd@stupidchicken.com>
+
+ * xfns.c (Fx_create_frame): Don't consult X resouces when setting
+ menu-bar-lines and tool-bar-lines. Use menu-bar-mode and
+ tool-bar-mode, which are now set using these X resources at
+ startup, to determine the defaults (Bug#2249).
+
+ * w32fns.c (Fx_create_frame):
+ * nsfns.m (Fx_create_frame): Likewise.
+
+ * frame.c (Vmenu_bar_mode, Vtool_bar_mode): New vars.
+
+2010-06-24 Juanma Barranquero <lekktu@gmail.com>
+
+ * gtkutil.c (xg_update_scrollbar_pos):
+ Avoid C99 mid-block variable declaration.
+
+2010-06-22 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xterm.c (x_scroll_bar_create): Remove call to xg_show_scroll_bar.
+
+ * gtkutil.h (xg_show_scroll_bar): Remove.
+
+ * gtkutil.c (xg_update_scrollbar_pos): Show/hide scroll bar as needed
+ if height is less than scroll bar min size.
+ (xg_show_scroll_bar): Remove, show moved to xg_update_scrollbar_pos.
+
+ * xfns.c (x_default_font_parameter): Try to open font from system
+ before using it (bug#6478). Rename got_from_gconf to got_from_system.
+
+2010-06-22 Keith Packard <keithp@keithp.com> (tiny change)
+
+ * font.c (font_parse_fcname): Allow . for sizes like 7.5 (bug#6437).
+
+2010-06-20 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (try_scrolling): When scroll-conservatively is set to
+ most-positive-fixnum, be extra accurate when scrolling window
+ start, to avoid missing the cursor line.
+
+2010-06-19 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (try_scrolling): Compute the limit for searching point
+ in forward scroll from scroll_max, instead of an arbitrary limit
+ of 10 screen lines. See
+ http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00766.html
+ and
+ http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00773.html
+ for details.
+
2010-06-16 Glenn Morris <rgm@gnu.org>
* editfns.c (Fbyte_to_string): Pacify compiler.
@@ -35,6 +1416,30 @@
* m/ibms390x.h: Rather than duplicating ibms390.h, just include it.
+2010-06-26 Andreas Schwab <schwab@linux-m68k.org>
+
+ * alloc.c (Fmake_byte_code): Don't access undefined argument
+ (Bug#6517).
+
+2010-06-25 Chong Yidong <cyd@stupidchicken.com>
+
+ * xdisp.c (next_element_from_image): Ensure that after-strings are
+ read the next time we hit handle_stop (Bug#1336).
+
+2010-06-23 Andreas Schwab <schwab@linux-m68k.org>
+
+ * lread.c (read1): Signal error if #s is not followed by paren.
+
+2010-06-19 Chong Yidong <cyd@stupidchicken.com>
+
+ * image.c (free_image): Mark frame as garbaged (Bug#6426).
+
+ * keymap.c (Fdefine_key): Doc fix (Bug#6460).
+
+2010-06-15 Glenn Morris <rgm@gnu.org>
+
+ * editfns.c (Fbyte_to_string): Pacify compiler.
+
2010-06-09 Stefan Monnier <monnier@iro.umontreal.ca>
* dbusbind.c (xd_append_arg): Don't "make-unibyte" the string.
@@ -126,8 +1531,8 @@
2010-06-03 Andreas Schwab <schwab@linux-m68k.org>
- * process.c (conv_lisp_to_sockaddr): Fix conversion of IPv4
- address. (Bug#6346)
+ * process.c (conv_lisp_to_sockaddr): Fix conversion of IPv4 address.
+ (Bug#6346)
2010-06-03 Juanma Barranquero <lekktu@gmail.com>
diff --git a/src/Makefile.in b/src/Makefile.in
index b2fec7eb085..a8d400c7c39 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -63,6 +63,13 @@ OTHER_FILES = @OTHER_FILES@
CRT_DIR=@CRT_DIR@
+## Flags to pass for profiling builds
+PROFILING_CFLAGS = @PROFILING_CFLAGS@
+PROFILING_LDFLAGS = @PROFILING_LDFLAGS@
+
+## Flags to pass to the compiler to enable build warnings
+C_WARNINGS_SWITCH = @C_WARNINGS_SWITCH@
+
## Machine-specific CFLAGS.
C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
## System-specific CFLAGS.
@@ -107,7 +114,7 @@ LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
## Flags to pass to ld only for temacs.
TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_TEMACS)
-## $LDFLAGS, or empty if NS_IMPL_GNUSTEP (for some reason).
+## $LDFLAGS $PROFILING_LDFLAGS, or empty if NS_IMPL_GNUSTEP (for some reason).
TEMACS_LDFLAGS2 = @TEMACS_LDFLAGS2@
## Some systems define this to request special libraries.
@@ -283,7 +290,7 @@ START_FILES = @START_FILES@
UNEXEC_OBJ = @UNEXEC_OBJ@
-CANNOT_DUMP=@cannot_dump@
+CANNOT_DUMP=@CANNOT_DUMP@
DEPDIR=deps
## -MMD -MF ${DEPDIR}/$*.d if AUTO_DEPEND; else empty.
@@ -309,8 +316,9 @@ MKDEPDIR=@MKDEPDIR@
ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} \
${C_SWITCH_MACHINE} ${C_SWITCH_SYSTEM} ${C_SWITCH_X_SITE} \
${C_SWITCH_X_SYSTEM} ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} \
- ${GCONF_CFLAGS} ${CFLAGS} ${FREETYPE_CFLAGS} ${FONTCONFIG_CFLAGS} \
- ${LIBOTF_CFLAGS} ${M17N_FLT_CFLAGS} ${DEPFLAGS}
+ ${GCONF_CFLAGS} ${FREETYPE_CFLAGS} ${FONTCONFIG_CFLAGS} \
+ ${LIBOTF_CFLAGS} ${M17N_FLT_CFLAGS} ${DEPFLAGS} ${PROFILING_CFLAGS} \
+ ${C_WARNINGS_SWITCH} ${CFLAGS}
ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
.SUFFIXES: .m
@@ -426,7 +434,7 @@ lisp= \
${lispsource}language/slovak.el \
${lispsource}language/romanian.el \
${lispsource}language/greek.el \
- ${lispsource}language/hebrew.el \
+ ${lispsource}language/hebrew.elc \
${lispsource}language/japanese.el \
${lispsource}language/korean.el \
${lispsource}language/lao.el \
@@ -517,7 +525,7 @@ shortlisp= \
../lisp/language/slovak.el \
../lisp/language/romanian.el \
../lisp/language/greek.el \
- ../lisp/language/hebrew.el \
+ ../lisp/language/hebrew.elc \
../lisp/language/japanese.el \
../lisp/language/korean.el \
../lisp/language/lao.el \
@@ -628,20 +636,10 @@ buildobj.h: Makefile
echo "#define BUILDOBJ \"${obj} ${otherobj} " "\"" > buildobj.h
-## We cannot define variables for PRE_EDIT and POST_EDIT.
-## If !ORDINARY_LINK && !LINKER && GCC, they add a
-## `./prefix-args -Xlinker ... ` wrapper, otherwise they are empty.
-## One alternative to this approach would be to always call prefix-args,
-## and have it DTRT in all cases, by testing the above defines.
-temacs${EXEEXT}: $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} prefix-args${EXEEXT}
- $(LD) @PRE_EDIT_LDFLAGS@ ${TEMACS_LDFLAGS} @POST_EDIT_LDFLAGS@ \
- ${TEMACS_LDFLAGS2} \
+temacs${EXEEXT}: $(START_FILES) stamp-oldxmenu ${obj} ${otherobj}
+ $(LD) ${TEMACS_LDFLAGS} ${TEMACS_LDFLAGS2} \
-o temacs ${START_FILES} ${obj} ${otherobj} ${LIBES}
-prefix-args${EXEEXT}: prefix-args.o $(config_h)
- $(CC) $(LDFLAGS) prefix-args.o -o prefix-args
-
-
## The following oldxmenu-related rules are only (possibly) used if
## HAVE_X11 && !USE_GTK, but there is no harm in always defining them
## (provided we take a little care that OLDXMENU is never empty).
@@ -688,7 +686,7 @@ doc.o: buildobj.h
mostlyclean:
- rm -f temacs${EXEEXT} prefix-args${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a
+ rm -f temacs${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a
rm -f ../etc/DOC
rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT}
rm -f buildobj.h
diff --git a/src/alloc.c b/src/alloc.c
index a23c688043c..7c8081f03df 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -23,10 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <limits.h> /* For CHAR_BIT. */
#include <setjmp.h>
-#ifdef STDC_HEADERS
-#include <stddef.h> /* For offsetof, used by PSEUDOVECSIZE. */
-#endif
-
#ifdef ALLOC_DEBUG
#undef INLINE
#endif
@@ -298,7 +294,7 @@ static EMACS_INT pure_bytes_used_non_lisp;
/* If nonzero, this is a warning delivered by malloc and not yet
displayed. */
-char *pending_malloc_warning;
+const char *pending_malloc_warning;
/* Pre-computed signal argument for use when memory is exhausted. */
@@ -329,23 +325,23 @@ Lisp_Object Vpost_gc_hook, Qpost_gc_hook;
Lisp_Object Vgc_elapsed; /* accumulated elapsed time in GC */
EMACS_INT gcs_done; /* accumulated GCs */
-static void mark_buffer P_ ((Lisp_Object));
-static void mark_terminals P_ ((void));
-extern void mark_kboards P_ ((void));
-extern void mark_ttys P_ ((void));
-extern void mark_backtrace P_ ((void));
-static void gc_sweep P_ ((void));
-static void mark_glyph_matrix P_ ((struct glyph_matrix *));
-static void mark_face_cache P_ ((struct face_cache *));
+static void mark_buffer (Lisp_Object);
+static void mark_terminals (void);
+extern void mark_kboards (void);
+extern void mark_ttys (void);
+extern void mark_backtrace (void);
+static void gc_sweep (void);
+static void mark_glyph_matrix (struct glyph_matrix *);
+static void mark_face_cache (struct face_cache *);
#ifdef HAVE_WINDOW_SYSTEM
-extern void mark_fringe_data P_ ((void));
+extern void mark_fringe_data (void);
#endif /* HAVE_WINDOW_SYSTEM */
-static struct Lisp_String *allocate_string P_ ((void));
-static void compact_small_strings P_ ((void));
-static void free_large_strings P_ ((void));
-static void sweep_strings P_ ((void));
+static struct Lisp_String *allocate_string (void);
+static void compact_small_strings (void);
+static void free_large_strings (void);
+static void sweep_strings (void);
extern int message_enable_multibyte;
@@ -369,9 +365,9 @@ enum mem_type
MEM_TYPE_VECTORLIKE
};
-static POINTER_TYPE *lisp_align_malloc P_ ((size_t, enum mem_type));
-static POINTER_TYPE *lisp_malloc P_ ((size_t, enum mem_type));
-void refill_memory_reserve ();
+static POINTER_TYPE *lisp_align_malloc (size_t, enum mem_type);
+static POINTER_TYPE *lisp_malloc (size_t, enum mem_type);
+void refill_memory_reserve (void);
#if GC_MARK_STACK || defined GC_MALLOC_CHECK
@@ -452,31 +448,31 @@ static void *min_heap_address, *max_heap_address;
static struct mem_node mem_z;
#define MEM_NIL &mem_z
-static POINTER_TYPE *lisp_malloc P_ ((size_t, enum mem_type));
-static struct Lisp_Vector *allocate_vectorlike P_ ((EMACS_INT));
-static void lisp_free P_ ((POINTER_TYPE *));
-static void mark_stack P_ ((void));
-static int live_vector_p P_ ((struct mem_node *, void *));
-static int live_buffer_p P_ ((struct mem_node *, void *));
-static int live_string_p P_ ((struct mem_node *, void *));
-static int live_cons_p P_ ((struct mem_node *, void *));
-static int live_symbol_p P_ ((struct mem_node *, void *));
-static int live_float_p P_ ((struct mem_node *, void *));
-static int live_misc_p P_ ((struct mem_node *, void *));
-static void mark_maybe_object P_ ((Lisp_Object));
-static void mark_memory P_ ((void *, void *, int));
-static void mem_init P_ ((void));
-static struct mem_node *mem_insert P_ ((void *, void *, enum mem_type));
-static void mem_insert_fixup P_ ((struct mem_node *));
-static void mem_rotate_left P_ ((struct mem_node *));
-static void mem_rotate_right P_ ((struct mem_node *));
-static void mem_delete P_ ((struct mem_node *));
-static void mem_delete_fixup P_ ((struct mem_node *));
-static INLINE struct mem_node *mem_find P_ ((void *));
+static POINTER_TYPE *lisp_malloc (size_t, enum mem_type);
+static struct Lisp_Vector *allocate_vectorlike (EMACS_INT);
+static void lisp_free (POINTER_TYPE *);
+static void mark_stack (void);
+static int live_vector_p (struct mem_node *, void *);
+static int live_buffer_p (struct mem_node *, void *);
+static int live_string_p (struct mem_node *, void *);
+static int live_cons_p (struct mem_node *, void *);
+static int live_symbol_p (struct mem_node *, void *);
+static int live_float_p (struct mem_node *, void *);
+static int live_misc_p (struct mem_node *, void *);
+static void mark_maybe_object (Lisp_Object);
+static void mark_memory (void *, void *, int);
+static void mem_init (void);
+static struct mem_node *mem_insert (void *, void *, enum mem_type);
+static void mem_insert_fixup (struct mem_node *);
+static void mem_rotate_left (struct mem_node *);
+static void mem_rotate_right (struct mem_node *);
+static void mem_delete (struct mem_node *);
+static void mem_delete_fixup (struct mem_node *);
+static INLINE struct mem_node *mem_find (void *);
#if GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS
-static void check_gcpros P_ ((void));
+static void check_gcpros (void);
#endif
#endif /* GC_MARK_STACK || GC_MALLOC_CHECK */
@@ -495,7 +491,7 @@ static Lisp_Object *staticvec[NSTATICS] = {&Vpurify_flag};
static int staticidx = 0;
-static POINTER_TYPE *pure_alloc P_ ((size_t, int));
+static POINTER_TYPE *pure_alloc (size_t, int);
/* Value is SZ rounded up to the next multiple of ALIGNMENT.
@@ -514,8 +510,7 @@ static POINTER_TYPE *pure_alloc P_ ((size_t, int));
/* Function malloc calls this if it finds we are near exhausting storage. */
void
-malloc_warning (str)
- char *str;
+malloc_warning (const char *str)
{
pending_malloc_warning = str;
}
@@ -524,7 +519,7 @@ malloc_warning (str)
/* Display an already-pending malloc warning. */
void
-display_malloc_warning ()
+display_malloc_warning (void)
{
call3 (intern ("display-warning"),
intern ("alloc"),
@@ -543,7 +538,7 @@ display_malloc_warning ()
/* Called if we can't allocate relocatable space for a buffer. */
void
-buffer_memory_full ()
+buffer_memory_full (void)
{
/* If buffers use the relocating allocator, no need to free
spare_memory, because we may have plenty of malloc space left
@@ -637,10 +632,12 @@ overrun_check_malloc (size)
val = (unsigned char *) malloc (size + overhead);
if (val && check_depth == 1)
{
- bcopy (xmalloc_overrun_check_header, val, XMALLOC_OVERRUN_CHECK_SIZE - 4);
+ memcpy (val, xmalloc_overrun_check_header,
+ XMALLOC_OVERRUN_CHECK_SIZE - 4);
val += XMALLOC_OVERRUN_CHECK_SIZE;
XMALLOC_PUT_SIZE(val, size);
- bcopy (xmalloc_overrun_check_trailer, val + size, XMALLOC_OVERRUN_CHECK_SIZE);
+ memcpy (val + size, xmalloc_overrun_check_trailer,
+ XMALLOC_OVERRUN_CHECK_SIZE);
}
--check_depth;
return (POINTER_TYPE *)val;
@@ -660,28 +657,29 @@ overrun_check_realloc (block, size)
if (val
&& check_depth == 1
- && bcmp (xmalloc_overrun_check_header,
- val - XMALLOC_OVERRUN_CHECK_SIZE,
- XMALLOC_OVERRUN_CHECK_SIZE - 4) == 0)
+ && memcmp (xmalloc_overrun_check_header,
+ val - XMALLOC_OVERRUN_CHECK_SIZE,
+ XMALLOC_OVERRUN_CHECK_SIZE - 4) == 0)
{
size_t osize = XMALLOC_GET_SIZE (val);
- if (bcmp (xmalloc_overrun_check_trailer,
- val + osize,
- XMALLOC_OVERRUN_CHECK_SIZE))
+ if (memcmp (xmalloc_overrun_check_trailer, val + osize,
+ XMALLOC_OVERRUN_CHECK_SIZE))
abort ();
- bzero (val + osize, XMALLOC_OVERRUN_CHECK_SIZE);
+ memset (val + osize, 0, XMALLOC_OVERRUN_CHECK_SIZE);
val -= XMALLOC_OVERRUN_CHECK_SIZE;
- bzero (val, XMALLOC_OVERRUN_CHECK_SIZE);
+ memset (val, 0, XMALLOC_OVERRUN_CHECK_SIZE);
}
val = (unsigned char *) realloc ((POINTER_TYPE *)val, size + overhead);
if (val && check_depth == 1)
{
- bcopy (xmalloc_overrun_check_header, val, XMALLOC_OVERRUN_CHECK_SIZE - 4);
+ memcpy (val, xmalloc_overrun_check_header,
+ XMALLOC_OVERRUN_CHECK_SIZE - 4);
val += XMALLOC_OVERRUN_CHECK_SIZE;
XMALLOC_PUT_SIZE(val, size);
- bcopy (xmalloc_overrun_check_trailer, val + size, XMALLOC_OVERRUN_CHECK_SIZE);
+ memcpy (val + size, xmalloc_overrun_check_trailer,
+ XMALLOC_OVERRUN_CHECK_SIZE);
}
--check_depth;
return (POINTER_TYPE *)val;
@@ -698,22 +696,21 @@ overrun_check_free (block)
++check_depth;
if (val
&& check_depth == 1
- && bcmp (xmalloc_overrun_check_header,
- val - XMALLOC_OVERRUN_CHECK_SIZE,
- XMALLOC_OVERRUN_CHECK_SIZE - 4) == 0)
+ && memcmp (xmalloc_overrun_check_header,
+ val - XMALLOC_OVERRUN_CHECK_SIZE,
+ XMALLOC_OVERRUN_CHECK_SIZE - 4) == 0)
{
size_t osize = XMALLOC_GET_SIZE (val);
- if (bcmp (xmalloc_overrun_check_trailer,
- val + osize,
- XMALLOC_OVERRUN_CHECK_SIZE))
+ if (memcmp (xmalloc_overrun_check_trailer, val + osize,
+ XMALLOC_OVERRUN_CHECK_SIZE))
abort ();
#ifdef XMALLOC_CLEAR_FREE_MEMORY
val -= XMALLOC_OVERRUN_CHECK_SIZE;
memset (val, 0xff, osize + XMALLOC_OVERRUN_CHECK_SIZE*2);
#else
- bzero (val + osize, XMALLOC_OVERRUN_CHECK_SIZE);
+ memset (val + osize, 0, XMALLOC_OVERRUN_CHECK_SIZE);
val -= XMALLOC_OVERRUN_CHECK_SIZE;
- bzero (val, XMALLOC_OVERRUN_CHECK_SIZE);
+ memset (val, 0, XMALLOC_OVERRUN_CHECK_SIZE);
#endif
}
@@ -742,8 +739,7 @@ overrun_check_free (block)
/* Like malloc but check for no memory and block interrupt input.. */
POINTER_TYPE *
-xmalloc (size)
- size_t size;
+xmalloc (size_t size)
{
register POINTER_TYPE *val;
@@ -760,9 +756,7 @@ xmalloc (size)
/* Like realloc but check for no memory and block interrupt input.. */
POINTER_TYPE *
-xrealloc (block, size)
- POINTER_TYPE *block;
- size_t size;
+xrealloc (POINTER_TYPE *block, size_t size)
{
register POINTER_TYPE *val;
@@ -783,8 +777,7 @@ xrealloc (block, size)
/* Like free but block interrupt input. */
void
-xfree (block)
- POINTER_TYPE *block;
+xfree (POINTER_TYPE *block)
{
if (!block)
return;
@@ -800,12 +793,11 @@ xfree (block)
/* Like strdup, but uses xmalloc. */
char *
-xstrdup (s)
- const char *s;
+xstrdup (const char *s)
{
size_t len = strlen (s) + 1;
char *p = (char *) xmalloc (len);
- bcopy (s, p, len);
+ memcpy (p, s, len);
return p;
}
@@ -813,8 +805,7 @@ xstrdup (s)
/* Unwind for SAFE_ALLOCA */
Lisp_Object
-safe_alloca_unwind (arg)
- Lisp_Object arg;
+safe_alloca_unwind (Lisp_Object arg)
{
register struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
@@ -835,9 +826,7 @@ static void *lisp_malloc_loser;
#endif
static POINTER_TYPE *
-lisp_malloc (nbytes, type)
- size_t nbytes;
- enum mem_type type;
+lisp_malloc (size_t nbytes, enum mem_type type)
{
register void *val;
@@ -881,8 +870,7 @@ lisp_malloc (nbytes, type)
call to lisp_malloc. */
static void
-lisp_free (block)
- POINTER_TYPE *block;
+lisp_free (POINTER_TYPE *block)
{
MALLOC_BLOCK_INPUT;
free (block);
@@ -981,9 +969,7 @@ static struct ablock *free_ablock;
Alignment is on a multiple of BLOCK_ALIGN and `nbytes' has to be
smaller or equal to BLOCK_BYTES. */
static POINTER_TYPE *
-lisp_align_malloc (nbytes, type)
- size_t nbytes;
- enum mem_type type;
+lisp_align_malloc (size_t nbytes, enum mem_type type)
{
void *base, *val;
struct ablocks *abase;
@@ -1090,8 +1076,7 @@ lisp_align_malloc (nbytes, type)
}
static void
-lisp_align_free (block)
- POINTER_TYPE *block;
+lisp_align_free (POINTER_TYPE *block)
{
struct ablock *ablock = block;
struct ablocks *abase = ABLOCK_ABASE (ablock);
@@ -1136,7 +1121,7 @@ lisp_align_free (block)
a call to lisp_malloc. */
struct buffer *
-allocate_buffer ()
+allocate_buffer (void)
{
struct buffer *b
= (struct buffer *) lisp_malloc (sizeof (struct buffer),
@@ -1164,21 +1149,19 @@ allocate_buffer ()
there's no need to block input around malloc. */
#ifndef DOUG_LEA_MALLOC
-extern void * (*__malloc_hook) P_ ((size_t, const void *));
-extern void * (*__realloc_hook) P_ ((void *, size_t, const void *));
-extern void (*__free_hook) P_ ((void *, const void *));
+extern void * (*__malloc_hook) (size_t, const void *);
+extern void * (*__realloc_hook) (void *, size_t, const void *);
+extern void (*__free_hook) (void *, const void *);
/* Else declared in malloc.h, perhaps with an extra arg. */
#endif /* DOUG_LEA_MALLOC */
-static void * (*old_malloc_hook) P_ ((size_t, const void *));
-static void * (*old_realloc_hook) P_ ((void *, size_t, const void*));
-static void (*old_free_hook) P_ ((void*, const void*));
+static void * (*old_malloc_hook) (size_t, const void *);
+static void * (*old_realloc_hook) (void *, size_t, const void*);
+static void (*old_free_hook) (void*, const void*);
/* This function is used as the hook for free to call. */
static void
-emacs_blocked_free (ptr, ptr2)
- void *ptr;
- const void *ptr2;
+emacs_blocked_free (void *ptr, const void *ptr2)
{
BLOCK_INPUT_ALLOC;
@@ -1226,9 +1209,7 @@ emacs_blocked_free (ptr, ptr2)
/* This function is the malloc hook that Emacs uses. */
static void *
-emacs_blocked_malloc (size, ptr)
- size_t size;
- const void *ptr;
+emacs_blocked_malloc (size_t size, const void *ptr)
{
void *value;
@@ -1275,10 +1256,7 @@ emacs_blocked_malloc (size, ptr)
/* This function is the realloc hook that Emacs uses. */
static void *
-emacs_blocked_realloc (ptr, size, ptr2)
- void *ptr;
- size_t size;
- const void *ptr2;
+emacs_blocked_realloc (void *ptr, size_t size, const void *ptr2)
{
void *value;
@@ -1352,7 +1330,7 @@ reset_malloc_hooks ()
/* Called from main to set up malloc to use our hooks. */
void
-uninterrupt_malloc ()
+uninterrupt_malloc (void)
{
#ifdef HAVE_GTK_AND_PTHREAD
#ifdef DOUG_LEA_MALLOC
@@ -1434,7 +1412,7 @@ static int n_interval_blocks;
/* Initialize interval allocation. */
static void
-init_intervals ()
+init_intervals (void)
{
interval_block = NULL;
interval_block_index = INTERVAL_BLOCK_SIZE;
@@ -1446,7 +1424,7 @@ init_intervals ()
/* Return a new interval. */
INTERVAL
-make_interval ()
+make_interval (void)
{
INTERVAL val;
@@ -1489,9 +1467,7 @@ make_interval ()
/* Mark Lisp objects in interval I. */
static void
-mark_interval (i, dummy)
- register INTERVAL i;
- Lisp_Object dummy;
+mark_interval (register INTERVAL i, Lisp_Object dummy)
{
eassert (!i->gcmarkbit); /* Intervals are never shared. */
i->gcmarkbit = 1;
@@ -1503,8 +1479,7 @@ mark_interval (i, dummy)
use the macro MARK_INTERVAL_TREE instead. */
static void
-mark_interval_tree (tree)
- register INTERVAL tree;
+mark_interval_tree (register INTERVAL tree)
{
/* No need to test if this tree has been marked already; this
function is always called through the MARK_INTERVAL_TREE macro,
@@ -1751,7 +1726,7 @@ static char string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] =
/* Initialize string allocation. Called from init_alloc_once. */
static void
-init_strings ()
+init_strings (void)
{
total_strings = total_free_strings = total_string_size = 0;
oldest_sblock = current_sblock = large_sblocks = NULL;
@@ -1767,8 +1742,8 @@ init_strings ()
static int check_string_bytes_count;
-static void check_string_bytes P_ ((int));
-static void check_sblock P_ ((struct sblock *));
+static void check_string_bytes (int);
+static void check_sblock (struct sblock *);
#define CHECK_STRING_BYTES(S) STRING_BYTES (S)
@@ -1873,7 +1848,7 @@ check_string_free_list ()
/* Return a new Lisp_String. */
static struct Lisp_String *
-allocate_string ()
+allocate_string (void)
{
struct Lisp_String *s;
@@ -1889,7 +1864,7 @@ allocate_string ()
int i;
b = (struct string_block *) lisp_malloc (sizeof *b, MEM_TYPE_STRING);
- bzero (b, sizeof *b);
+ memset (b, 0, sizeof *b);
b->next = string_blocks;
string_blocks = b;
++n_string_blocks;
@@ -1913,7 +1888,7 @@ allocate_string ()
MALLOC_UNBLOCK_INPUT;
/* Probably not strictly necessary, but play it safe. */
- bzero (s, sizeof *s);
+ memset (s, 0, sizeof *s);
--total_free_strings;
++total_strings;
@@ -1944,9 +1919,7 @@ allocate_string ()
S->data if it was initially non-null. */
void
-allocate_string_data (s, nchars, nbytes)
- struct Lisp_String *s;
- int nchars, nbytes;
+allocate_string_data (struct Lisp_String *s, int nchars, int nbytes)
{
struct sdata *data, *old_data;
struct sblock *b;
@@ -2023,8 +1996,7 @@ allocate_string_data (s, nchars, nbytes)
s->size_byte = nbytes;
s->data[nbytes] = '\0';
#ifdef GC_CHECK_STRING_OVERRUN
- bcopy (string_overrun_cookie, (char *) data + needed,
- GC_STRING_OVERRUN_COOKIE_SIZE);
+ memcpy (data + needed, string_overrun_cookie, GC_STRING_OVERRUN_COOKIE_SIZE);
#endif
/* If S had already data assigned, mark that as free by setting its
@@ -2043,7 +2015,7 @@ allocate_string_data (s, nchars, nbytes)
/* Sweep and compact strings. */
static void
-sweep_strings ()
+sweep_strings (void)
{
struct string_block *b, *next;
struct string_block *live_blocks = NULL;
@@ -2143,7 +2115,7 @@ sweep_strings ()
/* Free dead large strings. */
static void
-free_large_strings ()
+free_large_strings (void)
{
struct sblock *b, *next;
struct sblock *live_blocks = NULL;
@@ -2169,7 +2141,7 @@ free_large_strings ()
data of live strings after compaction. */
static void
-compact_small_strings ()
+compact_small_strings (void)
{
struct sblock *b, *tb, *next;
struct sdata *from, *to, *end, *tb_end;
@@ -2215,9 +2187,9 @@ compact_small_strings ()
from_end = (struct sdata *) ((char *) from + nbytes + GC_STRING_EXTRA);
#ifdef GC_CHECK_STRING_OVERRUN
- if (bcmp (string_overrun_cookie,
- ((char *) from_end) - GC_STRING_OVERRUN_COOKIE_SIZE,
- GC_STRING_OVERRUN_COOKIE_SIZE))
+ if (memcmp (string_overrun_cookie,
+ (char *) from_end - GC_STRING_OVERRUN_COOKIE_SIZE,
+ GC_STRING_OVERRUN_COOKIE_SIZE))
abort ();
#endif
@@ -2239,7 +2211,7 @@ compact_small_strings ()
if (from != to)
{
xassert (tb != b || to <= from);
- safe_bcopy ((char *) from, (char *) to, nbytes + GC_STRING_EXTRA);
+ memmove (to, from, nbytes + GC_STRING_EXTRA);
to->string->data = SDATA_DATA (to);
}
@@ -2267,8 +2239,7 @@ DEFUN ("make-string", Fmake_string, Smake_string, 2, 2, 0,
doc: /* Return a newly created string of length LENGTH, with INIT in each element.
LENGTH must be an integer.
INIT must be an integer that represents a character. */)
- (length, init)
- Lisp_Object length, init;
+ (Lisp_Object length, Lisp_Object init)
{
register Lisp_Object val;
register unsigned char *p, *end;
@@ -2298,7 +2269,7 @@ INIT must be an integer that represents a character. */)
end = p + nbytes;
while (p != end)
{
- bcopy (str, p, len);
+ memcpy (p, str, len);
p += len;
}
}
@@ -2311,8 +2282,7 @@ INIT must be an integer that represents a character. */)
DEFUN ("make-bool-vector", Fmake_bool_vector, Smake_bool_vector, 2, 2, 0,
doc: /* Return a new bool-vector of length LENGTH, using INIT for each element.
LENGTH must be a number. INIT matters only in whether it is t or nil. */)
- (length, init)
- Lisp_Object length, init;
+ (Lisp_Object length, Lisp_Object init)
{
register Lisp_Object val;
struct Lisp_Bool_Vector *p;
@@ -2357,9 +2327,7 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */)
multibyte, depending on the contents. */
Lisp_Object
-make_string (contents, nbytes)
- const char *contents;
- int nbytes;
+make_string (const char *contents, int nbytes)
{
register Lisp_Object val;
int nchars, multibyte_nbytes;
@@ -2378,13 +2346,11 @@ make_string (contents, nbytes)
/* Make an unibyte string from LENGTH bytes at CONTENTS. */
Lisp_Object
-make_unibyte_string (contents, length)
- const char *contents;
- int length;
+make_unibyte_string (const char *contents, int length)
{
register Lisp_Object val;
val = make_uninit_string (length);
- bcopy (contents, SDATA (val), length);
+ memcpy (SDATA (val), contents, length);
STRING_SET_UNIBYTE (val);
return val;
}
@@ -2394,13 +2360,11 @@ make_unibyte_string (contents, length)
bytes at CONTENTS. */
Lisp_Object
-make_multibyte_string (contents, nchars, nbytes)
- const char *contents;
- int nchars, nbytes;
+make_multibyte_string (const char *contents, int nchars, int nbytes)
{
register Lisp_Object val;
val = make_uninit_multibyte_string (nchars, nbytes);
- bcopy (contents, SDATA (val), nbytes);
+ memcpy (SDATA (val), contents, nbytes);
return val;
}
@@ -2409,13 +2373,11 @@ make_multibyte_string (contents, nchars, nbytes)
CONTENTS. It is a multibyte string if NBYTES != NCHARS. */
Lisp_Object
-make_string_from_bytes (contents, nchars, nbytes)
- const char *contents;
- int nchars, nbytes;
+make_string_from_bytes (const char *contents, int nchars, int nbytes)
{
register Lisp_Object val;
val = make_uninit_multibyte_string (nchars, nbytes);
- bcopy (contents, SDATA (val), nbytes);
+ memcpy (SDATA (val), contents, nbytes);
if (SBYTES (val) == SCHARS (val))
STRING_SET_UNIBYTE (val);
return val;
@@ -2428,10 +2390,7 @@ make_string_from_bytes (contents, nchars, nbytes)
characters by itself. */
Lisp_Object
-make_specified_string (contents, nchars, nbytes, multibyte)
- const char *contents;
- int nchars, nbytes;
- int multibyte;
+make_specified_string (const char *contents, int nchars, int nbytes, int multibyte)
{
register Lisp_Object val;
@@ -2443,7 +2402,7 @@ make_specified_string (contents, nchars, nbytes, multibyte)
nchars = nbytes;
}
val = make_uninit_multibyte_string (nchars, nbytes);
- bcopy (contents, SDATA (val), nbytes);
+ memcpy (SDATA (val), contents, nbytes);
if (!multibyte)
STRING_SET_UNIBYTE (val);
return val;
@@ -2454,8 +2413,7 @@ make_specified_string (contents, nchars, nbytes, multibyte)
data warrants. */
Lisp_Object
-build_string (str)
- const char *str;
+build_string (const char *str)
{
return make_string (str, strlen (str));
}
@@ -2465,8 +2423,7 @@ build_string (str)
occupying LENGTH bytes. */
Lisp_Object
-make_uninit_string (length)
- int length;
+make_uninit_string (int length)
{
Lisp_Object val;
@@ -2482,8 +2439,7 @@ make_uninit_string (length)
which occupy NBYTES bytes. */
Lisp_Object
-make_uninit_multibyte_string (nchars, nbytes)
- int nchars, nbytes;
+make_uninit_multibyte_string (int nchars, int nbytes)
{
Lisp_Object string;
struct Lisp_String *s;
@@ -2573,7 +2529,7 @@ struct Lisp_Float *float_free_list;
/* Initialize float allocation. */
static void
-init_float ()
+init_float (void)
{
float_block = NULL;
float_block_index = FLOAT_BLOCK_SIZE; /* Force alloc of new float_block. */
@@ -2585,8 +2541,7 @@ init_float ()
/* Explicitly free a float cell by putting it on the free-list. */
static void
-free_float (ptr)
- struct Lisp_Float *ptr;
+free_float (struct Lisp_Float *ptr)
{
ptr->u.chain = float_free_list;
float_free_list = ptr;
@@ -2596,8 +2551,7 @@ free_float (ptr)
/* Return a new float object with value FLOAT_VALUE. */
Lisp_Object
-make_float (float_value)
- double float_value;
+make_float (double float_value)
{
register Lisp_Object val;
@@ -2621,7 +2575,7 @@ make_float (float_value)
new = (struct float_block *) lisp_align_malloc (sizeof *new,
MEM_TYPE_FLOAT);
new->next = float_block;
- bzero ((char *) new->gcmarkbits, sizeof new->gcmarkbits);
+ memset (new->gcmarkbits, 0, sizeof new->gcmarkbits);
float_block = new;
float_block_index = 0;
n_float_blocks++;
@@ -2697,7 +2651,7 @@ static int n_cons_blocks;
/* Initialize cons allocation. */
static void
-init_cons ()
+init_cons (void)
{
cons_block = NULL;
cons_block_index = CONS_BLOCK_SIZE; /* Force alloc of new cons_block. */
@@ -2709,8 +2663,7 @@ init_cons ()
/* Explicitly free a cons cell by putting it on the free-list. */
void
-free_cons (ptr)
- struct Lisp_Cons *ptr;
+free_cons (struct Lisp_Cons *ptr)
{
ptr->u.chain = cons_free_list;
#if GC_MARK_STACK
@@ -2721,8 +2674,7 @@ free_cons (ptr)
DEFUN ("cons", Fcons, Scons, 2, 2, 0,
doc: /* Create a new cons, give it CAR and CDR as components, and return it. */)
- (car, cdr)
- Lisp_Object car, cdr;
+ (Lisp_Object car, Lisp_Object cdr)
{
register Lisp_Object val;
@@ -2744,7 +2696,7 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0,
register struct cons_block *new;
new = (struct cons_block *) lisp_align_malloc (sizeof *new,
MEM_TYPE_CONS);
- bzero ((char *) new->gcmarkbits, sizeof new->gcmarkbits);
+ memset (new->gcmarkbits, 0, sizeof new->gcmarkbits);
new->next = cons_block;
cons_block = new;
cons_block_index = 0;
@@ -2766,7 +2718,7 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0,
/* Get an error now if there's any junk in the cons free list. */
void
-check_cons_list ()
+check_cons_list (void)
{
#ifdef GC_CHECK_CONS_LIST
struct Lisp_Cons *tail = cons_free_list;
@@ -2779,39 +2731,34 @@ check_cons_list ()
/* Make a list of 1, 2, 3, 4 or 5 specified objects. */
Lisp_Object
-list1 (arg1)
- Lisp_Object arg1;
+list1 (Lisp_Object arg1)
{
return Fcons (arg1, Qnil);
}
Lisp_Object
-list2 (arg1, arg2)
- Lisp_Object arg1, arg2;
+list2 (Lisp_Object arg1, Lisp_Object arg2)
{
return Fcons (arg1, Fcons (arg2, Qnil));
}
Lisp_Object
-list3 (arg1, arg2, arg3)
- Lisp_Object arg1, arg2, arg3;
+list3 (Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3)
{
return Fcons (arg1, Fcons (arg2, Fcons (arg3, Qnil)));
}
Lisp_Object
-list4 (arg1, arg2, arg3, arg4)
- Lisp_Object arg1, arg2, arg3, arg4;
+list4 (Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, Lisp_Object arg4)
{
return Fcons (arg1, Fcons (arg2, Fcons (arg3, Fcons (arg4, Qnil))));
}
Lisp_Object
-list5 (arg1, arg2, arg3, arg4, arg5)
- Lisp_Object arg1, arg2, arg3, arg4, arg5;
+list5 (Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, Lisp_Object arg4, Lisp_Object arg5)
{
return Fcons (arg1, Fcons (arg2, Fcons (arg3, Fcons (arg4,
Fcons (arg5, Qnil)))));
@@ -2822,9 +2769,7 @@ DEFUN ("list", Flist, Slist, 0, MANY, 0,
doc: /* Return a newly created list with specified arguments as elements.
Any number of arguments, even zero arguments, are allowed.
usage: (list &rest OBJECTS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
register Lisp_Object val;
val = Qnil;
@@ -2840,8 +2785,7 @@ usage: (list &rest OBJECTS) */)
DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0,
doc: /* Return a newly created list of length LENGTH, with each element being INIT. */)
- (length, init)
- register Lisp_Object length, init;
+ (register Lisp_Object length, Lisp_Object init)
{
register Lisp_Object val;
register int size;
@@ -2904,8 +2848,7 @@ static int n_vectors;
with room for LEN Lisp_Objects. */
static struct Lisp_Vector *
-allocate_vectorlike (len)
- EMACS_INT len;
+allocate_vectorlike (EMACS_INT len)
{
struct Lisp_Vector *p;
size_t nbytes;
@@ -2946,8 +2889,7 @@ allocate_vectorlike (len)
/* Allocate a vector with NSLOTS slots. */
struct Lisp_Vector *
-allocate_vector (nslots)
- EMACS_INT nslots;
+allocate_vector (EMACS_INT nslots)
{
struct Lisp_Vector *v = allocate_vectorlike (nslots);
v->size = nslots;
@@ -2958,9 +2900,7 @@ allocate_vector (nslots)
/* Allocate other vector-like structures. */
struct Lisp_Vector *
-allocate_pseudovector (memlen, lisplen, tag)
- int memlen, lisplen;
- EMACS_INT tag;
+allocate_pseudovector (int memlen, int lisplen, EMACS_INT tag)
{
struct Lisp_Vector *v = allocate_vectorlike (memlen);
EMACS_INT i;
@@ -2982,38 +2922,38 @@ allocate_hash_table (void)
struct window *
-allocate_window ()
+allocate_window (void)
{
return ALLOCATE_PSEUDOVECTOR(struct window, current_matrix, PVEC_WINDOW);
}
struct terminal *
-allocate_terminal ()
+allocate_terminal (void)
{
struct terminal *t = ALLOCATE_PSEUDOVECTOR (struct terminal,
next_terminal, PVEC_TERMINAL);
/* Zero out the non-GC'd fields. FIXME: This should be made unnecessary. */
- bzero (&(t->next_terminal),
- ((char*)(t+1)) - ((char*)&(t->next_terminal)));
+ memset (&t->next_terminal, 0,
+ (char*) (t + 1) - (char*) &t->next_terminal);
return t;
}
struct frame *
-allocate_frame ()
+allocate_frame (void)
{
struct frame *f = ALLOCATE_PSEUDOVECTOR (struct frame,
face_cache, PVEC_FRAME);
/* Zero out the non-GC'd fields. FIXME: This should be made unnecessary. */
- bzero (&(f->face_cache),
- ((char*)(f+1)) - ((char*)&(f->face_cache)));
+ memset (&f->face_cache, 0,
+ (char *) (f + 1) - (char *) &f->face_cache);
return f;
}
struct Lisp_Process *
-allocate_process ()
+allocate_process (void)
{
return ALLOCATE_PSEUDOVECTOR (struct Lisp_Process, pid, PVEC_PROCESS);
}
@@ -3022,8 +2962,7 @@ allocate_process ()
DEFUN ("make-vector", Fmake_vector, Smake_vector, 2, 2, 0,
doc: /* Return a newly created vector of length LENGTH, with each element being INIT.
See also the function `vector'. */)
- (length, init)
- register Lisp_Object length, init;
+ (register Lisp_Object length, Lisp_Object init)
{
Lisp_Object vector;
register EMACS_INT sizei;
@@ -3079,9 +3018,7 @@ DEFUN ("vector", Fvector, Svector, 0, MANY, 0,
doc: /* Return a newly created vector with specified arguments as elements.
Any number of arguments, even zero arguments, are allowed.
usage: (vector &rest OBJECTS) */)
- (nargs, args)
- register int nargs;
- Lisp_Object *args;
+ (register int nargs, Lisp_Object *args)
{
register Lisp_Object len, val;
register int index;
@@ -3126,9 +3063,7 @@ stack size, (optional) doc string, and (optional) interactive spec.
The first four arguments are required; at most six have any
significance.
usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INTERACTIVE-SPEC &rest ELEMENTS) */)
- (nargs, args)
- register int nargs;
- Lisp_Object *args;
+ (register int nargs, Lisp_Object *args)
{
register Lisp_Object len, val;
register int index;
@@ -3144,7 +3079,7 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT
else
val = Fmake_vector (len, Qnil);
- if (STRINGP (args[1]) && STRING_MULTIBYTE (args[1]))
+ if (nargs > 1 && STRINGP (args[1]) && STRING_MULTIBYTE (args[1]))
/* BYTECODE-STRING must have been produced by Emacs 20.2 or the
earlier because they produced a raw 8-bit string for byte-code
and now such a byte-code string is loaded as multibyte while
@@ -3202,7 +3137,7 @@ static int n_symbol_blocks;
/* Initialize symbol allocation. */
static void
-init_symbol ()
+init_symbol (void)
{
symbol_block = NULL;
symbol_block_index = SYMBOL_BLOCK_SIZE;
@@ -3214,8 +3149,7 @@ init_symbol ()
DEFUN ("make-symbol", Fmake_symbol, Smake_symbol, 1, 1, 0,
doc: /* Return a newly allocated uninterned symbol whose name is NAME.
Its value and function definition are void, and its property list is nil. */)
- (name)
- Lisp_Object name;
+ (Lisp_Object name)
{
register Lisp_Object val;
register struct Lisp_Symbol *p;
@@ -3294,7 +3228,7 @@ static union Lisp_Misc *marker_free_list;
static int n_marker_blocks;
static void
-init_marker ()
+init_marker (void)
{
marker_block = NULL;
marker_block_index = MARKER_BLOCK_SIZE;
@@ -3305,7 +3239,7 @@ init_marker ()
/* Return a newly allocated Lisp_Misc object, with no substructure. */
Lisp_Object
-allocate_misc ()
+allocate_misc (void)
{
Lisp_Object val;
@@ -3347,8 +3281,7 @@ allocate_misc ()
/* Free a Lisp_Misc object */
void
-free_misc (misc)
- Lisp_Object misc;
+free_misc (Lisp_Object misc)
{
XMISCTYPE (misc) = Lisp_Misc_Free;
XMISC (misc)->u_free.chain = marker_free_list;
@@ -3362,9 +3295,7 @@ free_misc (misc)
The unwind function can get the C values back using XSAVE_VALUE. */
Lisp_Object
-make_save_value (pointer, integer)
- void *pointer;
- int integer;
+make_save_value (void *pointer, int integer)
{
register Lisp_Object val;
register struct Lisp_Save_Value *p;
@@ -3380,7 +3311,7 @@ make_save_value (pointer, integer)
DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0,
doc: /* Return a newly allocated marker which does not point at any place. */)
- ()
+ (void)
{
register Lisp_Object val;
register struct Lisp_Marker *p;
@@ -3399,8 +3330,7 @@ DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0,
/* Put MARKER back on the free list after using it temporarily. */
void
-free_marker (marker)
- Lisp_Object marker;
+free_marker (Lisp_Object marker)
{
unchain_marker (XMARKER (marker));
free_misc (marker);
@@ -3414,9 +3344,7 @@ free_marker (marker)
Any number of arguments, even zero arguments, are allowed. */
Lisp_Object
-make_event_array (nargs, args)
- register int nargs;
- Lisp_Object *args;
+make_event_array (register int nargs, Lisp_Object *args)
{
int i;
@@ -3456,7 +3384,7 @@ make_event_array (nargs, args)
/* Called if malloc returns zero. */
void
-memory_full ()
+memory_full (void)
{
int i;
@@ -3496,7 +3424,7 @@ memory_full ()
and also directly from this file, in case we're not using ralloc.c. */
void
-refill_memory_reserve ()
+refill_memory_reserve (void)
{
#ifndef SYSTEM_MALLOC
if (spare_memory[0] == 0)
@@ -3544,7 +3472,7 @@ refill_memory_reserve ()
/* Initialize this part of alloc.c. */
static void
-mem_init ()
+mem_init (void)
{
mem_z.left = mem_z.right = MEM_NIL;
mem_z.parent = NULL;
@@ -3558,8 +3486,7 @@ mem_init ()
MEM_NIL if there is no node in the tree containing START. */
static INLINE struct mem_node *
-mem_find (start)
- void *start;
+mem_find (void *start)
{
struct mem_node *p;
@@ -3582,9 +3509,7 @@ mem_find (start)
pointer to the node that was inserted. */
static struct mem_node *
-mem_insert (start, end, type)
- void *start, *end;
- enum mem_type type;
+mem_insert (void *start, void *end, enum mem_type type)
{
struct mem_node *c, *parent, *x;
@@ -3656,8 +3581,7 @@ mem_insert (start, end, type)
balance the tree, after node X has been inserted; X is always red. */
static void
-mem_insert_fixup (x)
- struct mem_node *x;
+mem_insert_fixup (struct mem_node *x)
{
while (x != mem_root && x->parent->color == MEM_RED)
{
@@ -3735,8 +3659,7 @@ mem_insert_fixup (x)
b c a b */
static void
-mem_rotate_left (x)
- struct mem_node *x;
+mem_rotate_left (struct mem_node *x)
{
struct mem_node *y;
@@ -3775,8 +3698,7 @@ mem_rotate_left (x)
a b b c */
static void
-mem_rotate_right (x)
- struct mem_node *x;
+mem_rotate_right (struct mem_node *x)
{
struct mem_node *y = x->left;
@@ -3805,8 +3727,7 @@ mem_rotate_right (x)
/* Delete node Z from the tree. If Z is null or MEM_NIL, do nothing. */
static void
-mem_delete (z)
- struct mem_node *z;
+mem_delete (struct mem_node *z)
{
struct mem_node *x, *y;
@@ -3860,8 +3781,7 @@ mem_delete (z)
deletion. */
static void
-mem_delete_fixup (x)
- struct mem_node *x;
+mem_delete_fixup (struct mem_node *x)
{
while (x != mem_root && x->color == MEM_BLACK)
{
@@ -3942,9 +3862,7 @@ mem_delete_fixup (x)
the heap. M is a pointer to the mem_block for P. */
static INLINE int
-live_string_p (m, p)
- struct mem_node *m;
- void *p;
+live_string_p (struct mem_node *m, void *p)
{
if (m->type == MEM_TYPE_STRING)
{
@@ -3967,9 +3885,7 @@ live_string_p (m, p)
the heap. M is a pointer to the mem_block for P. */
static INLINE int
-live_cons_p (m, p)
- struct mem_node *m;
- void *p;
+live_cons_p (struct mem_node *m, void *p)
{
if (m->type == MEM_TYPE_CONS)
{
@@ -3995,9 +3911,7 @@ live_cons_p (m, p)
the heap. M is a pointer to the mem_block for P. */
static INLINE int
-live_symbol_p (m, p)
- struct mem_node *m;
- void *p;
+live_symbol_p (struct mem_node *m, void *p)
{
if (m->type == MEM_TYPE_SYMBOL)
{
@@ -4023,9 +3937,7 @@ live_symbol_p (m, p)
the heap. M is a pointer to the mem_block for P. */
static INLINE int
-live_float_p (m, p)
- struct mem_node *m;
- void *p;
+live_float_p (struct mem_node *m, void *p)
{
if (m->type == MEM_TYPE_FLOAT)
{
@@ -4049,9 +3961,7 @@ live_float_p (m, p)
the heap. M is a pointer to the mem_block for P. */
static INLINE int
-live_misc_p (m, p)
- struct mem_node *m;
- void *p;
+live_misc_p (struct mem_node *m, void *p)
{
if (m->type == MEM_TYPE_MISC)
{
@@ -4077,9 +3987,7 @@ live_misc_p (m, p)
M is a pointer to the mem_block for P. */
static INLINE int
-live_vector_p (m, p)
- struct mem_node *m;
- void *p;
+live_vector_p (struct mem_node *m, void *p)
{
return (p == m->start && m->type == MEM_TYPE_VECTORLIKE);
}
@@ -4089,9 +3997,7 @@ live_vector_p (m, p)
pointer to the mem_block for P. */
static INLINE int
-live_buffer_p (m, p)
- struct mem_node *m;
- void *p;
+live_buffer_p (struct mem_node *m, void *p)
{
/* P must point to the start of the block, and the buffer
must not have been killed. */
@@ -4134,7 +4040,7 @@ static double avg_live;
DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "",
doc: /* Show information about live and zombie objects. */)
- ()
+ (void)
{
Lisp_Object args[8], zombie_list = Qnil;
int i;
@@ -4157,8 +4063,7 @@ DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "",
/* Mark OBJ if we can prove it's a Lisp_Object. */
static INLINE void
-mark_maybe_object (obj)
- Lisp_Object obj;
+mark_maybe_object (Lisp_Object obj)
{
void *po = (void *) XPNTR (obj);
struct mem_node *m = mem_find (po);
@@ -4221,8 +4126,7 @@ mark_maybe_object (obj)
marked. */
static INLINE void
-mark_maybe_pointer (p)
- void *p;
+mark_maybe_pointer (void *p)
{
struct mem_node *m;
@@ -4302,9 +4206,7 @@ mark_maybe_pointer (p)
or END+OFFSET..START. */
static void
-mark_memory (start, end, offset)
- void *start, *end;
- int offset;
+mark_memory (void *start, void *end, int offset)
{
Lisp_Object *p;
void **pp;
@@ -4520,7 +4422,7 @@ dump_zombies ()
equally on the stack. */
static void
-mark_stack ()
+mark_stack (void)
{
int i;
/* jmp_buf may not be aligned enough on darwin-ppc64 */
@@ -4595,8 +4497,7 @@ mark_stack ()
/* Determine whether it is safe to access memory at address P. */
static int
-valid_pointer_p (p)
- void *p;
+valid_pointer_p (void *p)
{
#ifdef WINDOWSNT
return w32_valid_pointer_p (p, 16);
@@ -4627,8 +4528,7 @@ valid_pointer_p (p)
so it should only be used in code for manual debugging. */
int
-valid_lisp_object_p (obj)
- Lisp_Object obj;
+valid_lisp_object_p (Lisp_Object obj)
{
void *p;
#if GC_MARK_STACK
@@ -4706,9 +4606,7 @@ valid_lisp_object_p (obj)
allocated. TYPE < 0 means it's not used for a Lisp object. */
static POINTER_TYPE *
-pure_alloc (size, type)
- size_t size;
- int type;
+pure_alloc (size_t size, int type)
{
POINTER_TYPE *result;
#ifdef USE_LSB_TAG
@@ -4762,7 +4660,7 @@ pure_alloc (size, type)
/* Print a warning if PURESIZE is too small. */
void
-check_pure_size ()
+check_pure_size (void)
{
if (pure_bytes_used_before_overflow)
message ("emacs:0:Pure Lisp storage overflow (approx. %d bytes needed)",
@@ -4775,9 +4673,7 @@ check_pure_size ()
address. Return NULL if not found. */
static char *
-find_string_data_in_pure (data, nbytes)
- const char *data;
- int nbytes;
+find_string_data_in_pure (const char *data, int nbytes)
{
int i, skip, bm_skip[256], last_char_skip, infinity, start, start_max;
const unsigned char *p;
@@ -4846,10 +4742,7 @@ find_string_data_in_pure (data, nbytes)
string; then the string is not protected from gc. */
Lisp_Object
-make_pure_string (data, nchars, nbytes, multibyte)
- const char *data;
- int nchars, nbytes;
- int multibyte;
+make_pure_string (const char *data, int nchars, int nbytes, int multibyte)
{
Lisp_Object string;
struct Lisp_String *s;
@@ -4859,7 +4752,7 @@ make_pure_string (data, nchars, nbytes, multibyte)
if (s->data == NULL)
{
s->data = (unsigned char *) pure_alloc (nbytes + 1, -1);
- bcopy (data, s->data, nbytes);
+ memcpy (s->data, data, nbytes);
s->data[nbytes] = '\0';
}
s->size = nchars;
@@ -4892,8 +4785,7 @@ make_pure_c_string (const char *data)
of CAR as car and CDR as cdr. */
Lisp_Object
-pure_cons (car, cdr)
- Lisp_Object car, cdr;
+pure_cons (Lisp_Object car, Lisp_Object cdr)
{
register Lisp_Object new;
struct Lisp_Cons *p;
@@ -4909,8 +4801,7 @@ pure_cons (car, cdr)
/* Value is a float object with value NUM allocated from pure space. */
static Lisp_Object
-make_pure_float (num)
- double num;
+make_pure_float (double num)
{
register Lisp_Object new;
struct Lisp_Float *p;
@@ -4926,8 +4817,7 @@ make_pure_float (num)
pure space. */
Lisp_Object
-make_pure_vector (len)
- EMACS_INT len;
+make_pure_vector (EMACS_INT len)
{
Lisp_Object new;
struct Lisp_Vector *p;
@@ -4944,8 +4834,7 @@ DEFUN ("purecopy", Fpurecopy, Spurecopy, 1, 1, 0,
doc: /* Make a copy of object OBJ in pure storage.
Recursively copies contents of vectors and cons cells.
Does not copy symbols. Copies strings without text properties. */)
- (obj)
- register Lisp_Object obj;
+ (register Lisp_Object obj)
{
if (NILP (Vpurify_flag))
return obj;
@@ -5010,8 +4899,7 @@ Does not copy symbols. Copies strings without text properties. */)
VARADDRESS. */
void
-staticpro (varaddress)
- Lisp_Object *varaddress;
+staticpro (Lisp_Object *varaddress)
{
staticvec[staticidx++] = varaddress;
if (staticidx >= NSTATICS)
@@ -5026,7 +4914,7 @@ staticpro (varaddress)
/* Temporarily prevent garbage collection. */
int
-inhibit_garbage_collection ()
+inhibit_garbage_collection (void)
{
int count = SPECPDL_INDEX ();
int nbits = min (VALBITS, BITS_PER_INT);
@@ -5047,7 +4935,7 @@ Garbage collection happens automatically if you cons more than
(USED-STRINGS . FREE-STRINGS))
However, if there was overflow in pure space, `garbage-collect'
returns nil, because real GC can't be done. */)
- ()
+ (void)
{
register struct specbinding *bind;
struct catchtag *catch;
@@ -5130,9 +5018,9 @@ returns nil, because real GC can't be done. */)
if (stack_copy)
{
if ((EMACS_INT) (&stack_top_variable - stack_bottom) > 0)
- bcopy (stack_bottom, stack_copy, i);
+ memcpy (stack_copy, stack_bottom, i);
else
- bcopy (&stack_top_variable, stack_copy, i);
+ memcpy (stack_copy, &stack_top_variable, i);
}
}
}
@@ -5165,7 +5053,7 @@ returns nil, because real GC can't be done. */)
#ifdef USE_GTK
{
- extern void xg_mark_data ();
+ extern void xg_mark_data (void);
xg_mark_data ();
}
#endif
@@ -5358,8 +5246,7 @@ returns nil, because real GC can't be done. */)
only interesting objects referenced from glyphs are strings. */
static void
-mark_glyph_matrix (matrix)
- struct glyph_matrix *matrix;
+mark_glyph_matrix (struct glyph_matrix *matrix)
{
struct glyph_row *row = matrix->rows;
struct glyph_row *end = row + matrix->nrows;
@@ -5385,8 +5272,7 @@ mark_glyph_matrix (matrix)
/* Mark Lisp faces in the face cache C. */
static void
-mark_face_cache (c)
- struct face_cache *c;
+mark_face_cache (struct face_cache *c)
{
if (c)
{
@@ -5421,8 +5307,7 @@ int last_marked_index;
static int mark_object_loop_halt;
static void
-mark_vectorlike (ptr)
- struct Lisp_Vector *ptr;
+mark_vectorlike (struct Lisp_Vector *ptr)
{
register EMACS_INT size = ptr->size;
register int i;
@@ -5445,8 +5330,7 @@ mark_vectorlike (ptr)
symbols. */
static void
-mark_char_table (ptr)
- struct Lisp_Vector *ptr;
+mark_char_table (struct Lisp_Vector *ptr)
{
register EMACS_INT size = ptr->size & PSEUDOVECTOR_SIZE_MASK;
register int i;
@@ -5470,8 +5354,7 @@ mark_char_table (ptr)
}
void
-mark_object (arg)
- Lisp_Object arg;
+mark_object (Lisp_Object arg)
{
register Lisp_Object obj = arg;
#ifdef GC_CHECK_MARKED_OBJECTS
@@ -5780,8 +5663,7 @@ mark_object (arg)
/* Mark the pointers in a buffer structure. */
static void
-mark_buffer (buf)
- Lisp_Object buf;
+mark_buffer (Lisp_Object buf)
{
register struct buffer *buffer = XBUFFER (buf);
register Lisp_Object *ptr, tmp;
@@ -5848,8 +5730,7 @@ mark_terminals (void)
either marked or does not need to be marked to survive. */
int
-survives_gc_p (obj)
- Lisp_Object obj;
+survives_gc_p (Lisp_Object obj)
{
int survives_p;
@@ -5895,7 +5776,7 @@ survives_gc_p (obj)
/* Sweep: find all structures not marked, and free them. */
static void
-gc_sweep ()
+gc_sweep (void)
{
/* Remove or mark entries in weak hash tables.
This must be done before any object is unmarked. */
@@ -6271,7 +6152,7 @@ DEFUN ("memory-limit", Fmemory_limit, Smemory_limit, 0, 0, 0,
doc: /* Return the address of the last byte Emacs has allocated, divided by 1024.
This may be helpful in debugging Emacs's memory usage.
We divide the value by 1024 to make sure it fits in a Lisp integer. */)
- ()
+ (void)
{
Lisp_Object end;
@@ -6293,7 +6174,7 @@ objects consed.
MISCS include overlays, markers, and some internal types.
Frames, windows, buffers, and subprocesses count as vectors
(but the contents of a buffer's text do not count here). */)
- ()
+ (void)
{
Lisp_Object consed[8];
@@ -6312,10 +6193,7 @@ Frames, windows, buffers, and subprocesses count as vectors
int suppress_checking;
void
-die (msg, file, line)
- const char *msg;
- const char *file;
- int line;
+die (const char *msg, const char *file, int line)
{
fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n",
file, line, msg);
@@ -6325,7 +6203,7 @@ die (msg, file, line)
/* Initialization */
void
-init_alloc_once ()
+init_alloc_once (void)
{
/* Used to do Vpurify_flag = Qt here, but Qt isn't set up yet! */
purebeg = PUREBEG;
@@ -6380,7 +6258,7 @@ init_alloc_once ()
}
void
-init_alloc ()
+init_alloc (void)
{
gcprolist = 0;
byte_stack_list = 0;
@@ -6394,7 +6272,7 @@ init_alloc ()
}
void
-syms_of_alloc ()
+syms_of_alloc (void)
{
DEFVAR_INT ("gc-cons-threshold", &gc_cons_threshold,
doc: /* *Number of bytes of consing between garbage collections.
diff --git a/src/atimer.c b/src/atimer.c
index 556272d7918..9fd9dee835e 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -21,11 +21,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <signal.h>
#include <stdio.h>
#include <setjmp.h>
-#include <lisp.h>
-#include <syssignal.h>
-#include <systime.h>
-#include <blockinput.h>
-#include <atimer.h>
+#include "lisp.h"
+#include "syssignal.h"
+#include "systime.h"
+#include "blockinput.h"
+#include "atimer.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -64,11 +64,11 @@ int pending_atimers;
/* Function prototypes. */
-static void set_alarm P_ ((void));
-static void schedule_atimer P_ ((struct atimer *));
-static struct atimer *append_atimer_lists P_ ((struct atimer *,
- struct atimer *));
-SIGTYPE alarm_signal_handler ();
+static void set_alarm (void);
+static void schedule_atimer (struct atimer *);
+static struct atimer *append_atimer_lists (struct atimer *,
+ struct atimer *);
+SIGTYPE alarm_signal_handler (int signo);
/* Start a new atimer of type TYPE. TIME specifies when the timer is
@@ -90,11 +90,8 @@ SIGTYPE alarm_signal_handler ();
to cancel_atimer; don't free it yourself. */
struct atimer *
-start_atimer (type, time, fn, client_data)
- enum atimer_type type;
- EMACS_TIME time;
- atimer_callback fn;
- void *client_data;
+start_atimer (enum atimer_type type, EMACS_TIME time, atimer_callback fn,
+ void *client_data)
{
struct atimer *t;
@@ -119,7 +116,7 @@ start_atimer (type, time, fn, client_data)
t = (struct atimer *) xmalloc (sizeof *t);
/* Fill the atimer structure. */
- bzero (t, sizeof *t);
+ memset (t, 0, sizeof *t);
t->type = type;
t->fn = fn;
t->client_data = client_data;
@@ -159,8 +156,7 @@ start_atimer (type, time, fn, client_data)
/* Cancel and free atimer TIMER. */
void
-cancel_atimer (timer)
- struct atimer *timer;
+cancel_atimer (struct atimer *timer)
{
int i;
@@ -199,8 +195,7 @@ cancel_atimer (timer)
result list. */
static struct atimer *
-append_atimer_lists (list1, list2)
- struct atimer *list1, *list2;
+append_atimer_lists (struct atimer *list1, struct atimer *list2)
{
if (list1 == NULL)
return list2;
@@ -221,8 +216,7 @@ append_atimer_lists (list1, list2)
/* Stop all timers except timer T. T null means stop all timers. */
void
-stop_other_atimers (t)
- struct atimer *t;
+stop_other_atimers (struct atimer *t)
{
BLOCK_ATIMERS;
@@ -257,7 +251,7 @@ stop_other_atimers (t)
stop_other_atimers. */
void
-run_all_atimers ()
+run_all_atimers (void)
{
if (stopped_atimers)
{
@@ -283,8 +277,7 @@ run_all_atimers ()
/* A version of run_all_timers suitable for a record_unwind_protect. */
Lisp_Object
-unwind_stop_other_atimers (dummy)
- Lisp_Object dummy;
+unwind_stop_other_atimers (Lisp_Object dummy)
{
run_all_atimers ();
return Qnil;
@@ -294,7 +287,7 @@ unwind_stop_other_atimers (dummy)
/* Arrange for a SIGALRM to arrive when the next timer is ripe. */
static void
-set_alarm ()
+set_alarm (void)
{
if (atimers)
{
@@ -315,7 +308,7 @@ set_alarm ()
EMACS_SET_USECS (time, 1000);
}
- bzero (&it, sizeof it);
+ memset (&it, 0, sizeof it);
it.it_value = time;
setitimer (ITIMER_REAL, &it, 0);
#else /* not HAVE_SETITIMER */
@@ -330,8 +323,7 @@ set_alarm ()
already. */
static void
-schedule_atimer (t)
- struct atimer *t;
+schedule_atimer (struct atimer *t)
{
struct atimer *a = atimers, *prev = NULL;
@@ -349,7 +341,7 @@ schedule_atimer (t)
}
static void
-run_timers ()
+run_timers (void)
{
EMACS_TIME now;
@@ -401,8 +393,7 @@ run_timers ()
SIGALRM. */
SIGTYPE
-alarm_signal_handler (signo)
- int signo;
+alarm_signal_handler (int signo)
{
#ifndef SYNC_INPUT
SIGNAL_THREAD_CHECK (signo);
@@ -420,7 +411,7 @@ alarm_signal_handler (signo)
/* Call alarm_signal_handler for pending timers. */
void
-do_pending_atimers ()
+do_pending_atimers (void)
{
if (pending_atimers)
{
@@ -435,8 +426,7 @@ do_pending_atimers ()
some systems like HPUX (see process.c). */
void
-turn_on_atimers (on)
- int on;
+turn_on_atimers (int on)
{
if (on)
{
@@ -449,7 +439,7 @@ turn_on_atimers (on)
void
-init_atimer ()
+init_atimer (void)
{
free_atimers = stopped_atimers = atimers = NULL;
pending_atimers = 0;
diff --git a/src/atimer.h b/src/atimer.h
index fd354caf54d..c2245d30e6b 100644
--- a/src/atimer.h
+++ b/src/atimer.h
@@ -20,13 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef EMACS_ATIMER_H
#define EMACS_ATIMER_H
-/* Declare the prototype for a general external function. */
-#if defined (PROTOTYPES) || defined (WINDOWSNT)
-#define P_(proto) proto
-#else
-#define P_(proto) ()
-#endif
-
#include "systime.h" /* for EMACS_TIME */
/* Forward declaration. */
@@ -49,7 +42,7 @@ enum atimer_type
/* Type of timer callback functions. */
-typedef void (* atimer_callback) P_ ((struct atimer *timer));
+typedef void (* atimer_callback) (struct atimer *timer);
/* Structure describing an asynchronous timer. */
@@ -77,15 +70,15 @@ struct atimer
/* Function prototypes. */
-struct atimer *start_atimer P_ ((enum atimer_type, EMACS_TIME,
- atimer_callback, void *));
-void cancel_atimer P_ ((struct atimer *));
-void do_pending_atimers P_ ((void));
-void init_atimer P_ ((void));
-void turn_on_atimers P_ ((int));
-void stop_other_atimers P_ ((struct atimer *));
-void run_all_atimers P_ ((void));
-Lisp_Object unwind_stop_other_atimers P_ ((Lisp_Object));
+struct atimer *start_atimer (enum atimer_type, EMACS_TIME,
+ atimer_callback, void *);
+void cancel_atimer (struct atimer *);
+void do_pending_atimers (void);
+void init_atimer (void);
+void turn_on_atimers (int);
+void stop_other_atimers (struct atimer *);
+void run_all_atimers (void);
+Lisp_Object unwind_stop_other_atimers (Lisp_Object);
#endif /* EMACS_ATIMER_H */
diff --git a/src/autodeps.mk b/src/autodeps.mk
index c3cc91e22a7..fb0e21366c7 100644
--- a/src/autodeps.mk
+++ b/src/autodeps.mk
@@ -2,5 +2,5 @@
## This is inserted in src/Makefile if AUTO_DEPEND=yes.
-ALLOBJS=$(START_FILES) ${obj} ${otherobj} prefix-args.o
+ALLOBJS=$(START_FILES) ${obj} ${otherobj}
-include $(ALLOBJS:%.o=${DEPDIR}/%.d)
diff --git a/src/bidi.c b/src/bidi.c
index bca32cf110e..e17676ea6d7 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -49,16 +49,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
rule X9 and to its modifications decribed in the "Implementation
Notes" section of UAX#9, under "Retaining Format Codes". */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
-
-#ifdef HAVE_STRING_H
#include <string.h>
-#endif
-
#include <setjmp.h>
#include "lisp.h"
@@ -106,7 +99,7 @@ static Lisp_Object paragraph_start_re, paragraph_separate_re;
static Lisp_Object Qparagraph_start, Qparagraph_separate;
static void
-bidi_initialize ()
+bidi_initialize (void)
{
#include "biditype.h"
diff --git a/src/blockinput.h b/src/blockinput.h
index 890adcbcd86..7ba6fc264fd 100644
--- a/src/blockinput.h
+++ b/src/blockinput.h
@@ -122,8 +122,7 @@ extern int pending_atimers;
#define INPUT_BLOCKED_P (interrupt_input_blocked > 0)
/* Defined in keyboard.c */
-/* Don't use a prototype here; it causes trouble in some files. */
-extern void reinvoke_input_signal ();
+extern void reinvoke_input_signal (void);
#endif /* EMACS_BLOCKINPUT_H */
diff --git a/src/buffer.c b/src/buffer.c
index e907c295e8d..bfef1c369ef 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -106,13 +106,13 @@ static char buffer_permanent_local_flags[MAX_PER_BUFFER_VARS];
int last_per_buffer_idx;
EXFUN (Fset_buffer, 1);
-void set_buffer_internal P_ ((struct buffer *b));
-void set_buffer_internal_1 P_ ((struct buffer *b));
-static void call_overlay_mod_hooks P_ ((Lisp_Object list, Lisp_Object overlay,
- int after, Lisp_Object arg1,
- Lisp_Object arg2, Lisp_Object arg3));
-static void swap_out_buffer_local_variables P_ ((struct buffer *b));
-static void reset_buffer_local_variables P_ ((struct buffer *b, int permanent_too));
+void set_buffer_internal (struct buffer *b);
+void set_buffer_internal_1 (struct buffer *b);
+static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay,
+ int after, Lisp_Object arg1,
+ Lisp_Object arg2, Lisp_Object arg3);
+static void swap_out_buffer_local_variables (struct buffer *b);
+static void reset_buffer_local_variables (struct buffer *b, int permanent_too);
/* Alist of all buffer names vs the buffers. */
/* This used to be a variable, but is no longer,
@@ -168,20 +168,19 @@ Lisp_Object Qmodification_hooks;
Lisp_Object Qinsert_in_front_hooks;
Lisp_Object Qinsert_behind_hooks;
-static void alloc_buffer_text P_ ((struct buffer *, size_t));
-static void free_buffer_text P_ ((struct buffer *b));
-static struct Lisp_Overlay * copy_overlays P_ ((struct buffer *, struct Lisp_Overlay *));
-static void modify_overlay P_ ((struct buffer *, EMACS_INT, EMACS_INT));
-static Lisp_Object buffer_lisp_local_variables P_ ((struct buffer *));
+static void alloc_buffer_text (struct buffer *, size_t);
+static void free_buffer_text (struct buffer *b);
+static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay *);
+static void modify_overlay (struct buffer *, EMACS_INT, EMACS_INT);
+static Lisp_Object buffer_lisp_local_variables (struct buffer *);
-extern char * emacs_strerror P_ ((int));
+extern char * emacs_strerror (int);
/* For debugging; temporary. See set_buffer_internal. */
/* Lisp_Object Qlisp_mode, Vcheck_symbol; */
void
-nsberror (spec)
- Lisp_Object spec;
+nsberror (Lisp_Object spec)
{
if (STRINGP (spec))
error ("No buffer named %s", SDATA (spec));
@@ -191,8 +190,7 @@ nsberror (spec)
DEFUN ("buffer-live-p", Fbuffer_live_p, Sbuffer_live_p, 1, 1, 0,
doc: /* Return non-nil if OBJECT is a buffer which has not been killed.
Value is nil if OBJECT is not a buffer or if it has been killed. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
return ((BUFFERP (object) && ! NILP (XBUFFER (object)->name))
? Qt : Qnil);
@@ -203,8 +201,7 @@ DEFUN ("buffer-list", Fbuffer_list, Sbuffer_list, 0, 1, 0,
If the optional arg FRAME is a frame, we return the buffer list
in the proper order for that frame: the buffers in FRAME's `buffer-list'
frame parameter come first, followed by the rest of the buffers. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
Lisp_Object general;
general = Fmapcar (Qcdr, Vbuffer_alist);
@@ -248,9 +245,7 @@ frame parameter come first, followed by the rest of the buffers. */)
and don't ever QUIT. */
static Lisp_Object
-assoc_ignore_text_properties (key, list)
- register Lisp_Object key;
- Lisp_Object list;
+assoc_ignore_text_properties (register Lisp_Object key, Lisp_Object list)
{
register Lisp_Object tail;
for (tail = list; CONSP (tail); tail = XCDR (tail))
@@ -269,8 +264,7 @@ DEFUN ("get-buffer", Fget_buffer, Sget_buffer, 1, 1, 0,
BUFFER-OR-NAME must be either a string or a buffer. If BUFFER-OR-NAME
is a string and there is no buffer with that name, return nil. If
BUFFER-OR-NAME is a buffer, return it as given. */)
- (buffer_or_name)
- register Lisp_Object buffer_or_name;
+ (register Lisp_Object buffer_or_name)
{
if (BUFFERP (buffer_or_name))
return buffer_or_name;
@@ -284,8 +278,7 @@ DEFUN ("get-file-buffer", Fget_file_buffer, Sget_file_buffer, 1, 1, 0,
The buffer's `buffer-file-name' must match exactly the expansion of FILENAME.
If there is no such live buffer, return nil.
See also `find-buffer-visiting'. */)
- (filename)
- register Lisp_Object filename;
+ (register Lisp_Object filename)
{
register Lisp_Object tail, buf, tem;
Lisp_Object handler;
@@ -312,8 +305,7 @@ See also `find-buffer-visiting'. */)
}
Lisp_Object
-get_truename_buffer (filename)
- register Lisp_Object filename;
+get_truename_buffer (register Lisp_Object filename)
{
register Lisp_Object tail, buf, tem;
@@ -341,8 +333,7 @@ buffer does not keep undo information.
If BUFFER-OR-NAME is a buffer instead of a string, return it as given,
even if it is dead. The return value is never nil. */)
- (buffer_or_name)
- register Lisp_Object buffer_or_name;
+ (register Lisp_Object buffer_or_name)
{
register Lisp_Object buffer, name;
register struct buffer *b;
@@ -437,9 +428,7 @@ even if it is dead. The return value is never nil. */)
LIST, but for buffer B. */
static struct Lisp_Overlay *
-copy_overlays (b, list)
- struct buffer *b;
- struct Lisp_Overlay *list;
+copy_overlays (struct buffer *b, struct Lisp_Overlay *list)
{
Lisp_Object buffer;
struct Lisp_Overlay *result = NULL, *tail = NULL;
@@ -489,8 +478,7 @@ copy_overlays (b, list)
copied. */
static void
-clone_per_buffer_values (from, to)
- struct buffer *from, *to;
+clone_per_buffer_values (struct buffer *from, struct buffer *to)
{
Lisp_Object to_buffer;
int offset;
@@ -521,7 +509,7 @@ clone_per_buffer_values (from, to)
PER_BUFFER_VALUE (to, offset) = obj;
}
- bcopy (from->local_flags, to->local_flags, sizeof to->local_flags);
+ memcpy (to->local_flags, from->local_flags, sizeof to->local_flags);
to->overlays_before = copy_overlays (to, from->overlays_before);
to->overlays_after = copy_overlays (to, from->overlays_after);
@@ -540,8 +528,7 @@ NAME should be a string which is not the name of an existing buffer.
Optional argument CLONE non-nil means preserve BASE-BUFFER's state,
such as major and minor modes, in the indirect buffer.
CLONE nil means the indirect buffer's state is reset to default values. */)
- (base_buffer, name, clone)
- Lisp_Object base_buffer, name, clone;
+ (Lisp_Object base_buffer, Lisp_Object name, Lisp_Object clone)
{
Lisp_Object buf, tem;
struct buffer *b;
@@ -658,8 +645,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
}
void
-delete_all_overlays (b)
- struct buffer *b;
+delete_all_overlays (struct buffer *b)
{
Lisp_Object overlay;
@@ -689,8 +675,7 @@ delete_all_overlays (b)
claims it doesn't belong to it. */
void
-reset_buffer (b)
- register struct buffer *b;
+reset_buffer (register struct buffer *b)
{
b->filename = Qnil;
b->file_truename = Qnil;
@@ -734,9 +719,7 @@ reset_buffer (b)
we preserve those. */
static void
-reset_buffer_local_variables (b, permanent_too)
- register struct buffer *b;
- int permanent_too;
+reset_buffer_local_variables (register struct buffer *b, int permanent_too)
{
register int offset;
int i;
@@ -840,8 +823,7 @@ Otherwise modify name by appending `<NUMBER>', incrementing NUMBER
\(starting at 2) until an unused name is found, and then return that name.
Optional second argument IGNORE specifies a name that is okay to use (if
it is in the sequence to be tried) even if a buffer with that name exists. */)
- (name, ignore)
- register Lisp_Object name, ignore;
+ (register Lisp_Object name, Lisp_Object ignore)
{
register Lisp_Object gentemp, tem;
int count;
@@ -875,8 +857,7 @@ DEFUN ("buffer-name", Fbuffer_name, Sbuffer_name, 0, 1, 0,
doc: /* Return the name of BUFFER, as a string.
BUFFER defaults to the current buffer.
Return nil if BUFFER has been killed. */)
- (buffer)
- register Lisp_Object buffer;
+ (register Lisp_Object buffer)
{
if (NILP (buffer))
return current_buffer->name;
@@ -887,8 +868,7 @@ Return nil if BUFFER has been killed. */)
DEFUN ("buffer-file-name", Fbuffer_file_name, Sbuffer_file_name, 0, 1, 0,
doc: /* Return name of file BUFFER is visiting, or nil if none.
No argument or nil as argument means use the current buffer. */)
- (buffer)
- register Lisp_Object buffer;
+ (register Lisp_Object buffer)
{
if (NILP (buffer))
return current_buffer->filename;
@@ -901,8 +881,7 @@ DEFUN ("buffer-base-buffer", Fbuffer_base_buffer, Sbuffer_base_buffer,
doc: /* Return the base buffer of indirect buffer BUFFER.
If BUFFER is not indirect, return nil.
BUFFER defaults to the current buffer. */)
- (buffer)
- register Lisp_Object buffer;
+ (register Lisp_Object buffer)
{
struct buffer *base;
Lisp_Object base_buffer;
@@ -926,9 +905,7 @@ DEFUN ("buffer-local-value", Fbuffer_local_value,
doc: /* Return the value of VARIABLE in BUFFER.
If VARIABLE does not have a buffer-local binding in BUFFER, the value
is the default binding of the variable. */)
- (variable, buffer)
- register Lisp_Object variable;
- register Lisp_Object buffer;
+ (register Lisp_Object variable, register Lisp_Object buffer)
{
register struct buffer *buf;
register Lisp_Object result;
@@ -993,8 +970,7 @@ is the default binding of the variable. */)
in special slots in the buffer object. */
static Lisp_Object
-buffer_lisp_local_variables (buf)
- struct buffer *buf;
+buffer_lisp_local_variables (struct buffer *buf)
{
Lisp_Object result = Qnil;
register Lisp_Object tail;
@@ -1027,8 +1003,7 @@ Most elements look like (SYMBOL . VALUE), describing one variable.
For a symbol that is locally unbound, just the symbol appears in the value.
Note that storing new VALUEs in these elements doesn't change the variables.
No argument or nil as argument means use current buffer as BUFFER. */)
- (buffer)
- register Lisp_Object buffer;
+ (register Lisp_Object buffer)
{
register struct buffer *buf;
register Lisp_Object result;
@@ -1070,8 +1045,7 @@ DEFUN ("buffer-modified-p", Fbuffer_modified_p, Sbuffer_modified_p,
0, 1, 0,
doc: /* Return t if BUFFER was modified since its file was last read or saved.
No argument or nil as argument means use current buffer as BUFFER. */)
- (buffer)
- register Lisp_Object buffer;
+ (register Lisp_Object buffer)
{
register struct buffer *buf;
if (NILP (buffer))
@@ -1089,8 +1063,7 @@ DEFUN ("set-buffer-modified-p", Fset_buffer_modified_p, Sset_buffer_modified_p,
1, 1, 0,
doc: /* Mark current buffer as modified or unmodified according to FLAG.
A non-nil FLAG means mark the buffer modified. */)
- (flag)
- register Lisp_Object flag;
+ (register Lisp_Object flag)
{
register int already;
register Lisp_Object fn;
@@ -1159,8 +1132,7 @@ DEFUN ("restore-buffer-modified-p", Frestore_buffer_modified_p,
doc: /* Like `set-buffer-modified-p', with a difference concerning redisplay.
It is not ensured that mode lines will be updated to show the modified
state of the current buffer. Use with care. */)
- (flag)
- Lisp_Object flag;
+ (Lisp_Object flag)
{
#ifdef CLASH_DETECTION
Lisp_Object fn;
@@ -1190,8 +1162,7 @@ DEFUN ("buffer-modified-tick", Fbuffer_modified_tick, Sbuffer_modified_tick,
Each buffer has a tick counter which is incremented each time the
text in that buffer is changed. It wraps around occasionally.
No argument or nil as argument means use current buffer as BUFFER. */)
- (buffer)
- register Lisp_Object buffer;
+ (register Lisp_Object buffer)
{
register struct buffer *buf;
if (NILP (buffer))
@@ -1215,8 +1186,7 @@ values returned by two individual calls of `buffer-chars-modified-tick',
you can tell whether a character change occurred in that buffer in
between these calls. No argument or nil as argument means use current
buffer as BUFFER. */)
- (buffer)
- register Lisp_Object buffer;
+ (register Lisp_Object buffer)
{
register struct buffer *buf;
if (NILP (buffer))
@@ -1242,8 +1212,7 @@ If UNIQUE is non-nil, come up with a new name using
Interactively, you can set UNIQUE with a prefix argument.
We return the name we actually gave the buffer.
This does not change the name of the visited file (if any). */)
- (newname, unique)
- register Lisp_Object newname, unique;
+ (register Lisp_Object newname, Lisp_Object unique)
{
register Lisp_Object tem, buf;
@@ -1290,10 +1259,9 @@ If the optional third argument FRAME is non-nil, use that frame's
buffer list instead of the selected frame's buffer list.
If no other buffer exists, the buffer `*scratch*' is returned.
If BUFFER is omitted or nil, some interesting buffer is returned. */)
- (buffer, visible_ok, frame)
- register Lisp_Object buffer, visible_ok, frame;
+ (register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame)
{
- Lisp_Object Fset_buffer_major_mode ();
+ Lisp_Object Fset_buffer_major_mode (Lisp_Object buffer);
register Lisp_Object tail, buf, notsogood, tem, pred, add_ons;
notsogood = Qnil;
@@ -1362,8 +1330,7 @@ DEFUN ("buffer-enable-undo", Fbuffer_enable_undo, Sbuffer_enable_undo,
0, 1, "",
doc: /* Start keeping undo information for buffer BUFFER.
No argument or nil as argument means do this for the current buffer. */)
- (buffer)
- register Lisp_Object buffer;
+ (register Lisp_Object buffer)
{
Lisp_Object real_buffer;
@@ -1404,8 +1371,7 @@ is running.
Any processes that have this buffer as the `process-buffer' are killed
with SIGHUP. */)
- (buffer_or_name)
- Lisp_Object buffer_or_name;
+ (Lisp_Object buffer_or_name)
{
Lisp_Object buffer;
register struct buffer *b;
@@ -1618,8 +1584,7 @@ with SIGHUP. */)
means that other_buffer is more likely to choose a relevant buffer. */
void
-record_buffer (buf)
- Lisp_Object buf;
+record_buffer (Lisp_Object buf)
{
register Lisp_Object link, prev;
Lisp_Object frame;
@@ -1695,8 +1660,7 @@ For the *scratch* buffer, use `initial-major-mode', otherwise choose a mode
according to `default-major-mode'.
Use this function before selecting the buffer, since it may need to inspect
the current buffer's major mode. */)
- (buffer)
- Lisp_Object buffer;
+ (Lisp_Object buffer)
{
int count;
Lisp_Object function;
@@ -1734,8 +1698,7 @@ the current buffer's major mode. */)
If NORECORD is non-nil, don't call record_buffer. */
Lisp_Object
-switch_to_buffer_1 (buffer_or_name, norecord)
- Lisp_Object buffer_or_name, norecord;
+switch_to_buffer_1 (Lisp_Object buffer_or_name, Lisp_Object norecord)
{
register Lisp_Object buffer;
@@ -1784,8 +1747,7 @@ its buffer, use `pop-to-buffer' for displaying the buffer.
WARNING: This is NOT the way to work on another buffer temporarily
within a Lisp program! Use `set-buffer' instead. That avoids
messing with the window-buffer correspondences. */)
- (buffer_or_name, norecord)
- Lisp_Object buffer_or_name, norecord;
+ (Lisp_Object buffer_or_name, Lisp_Object norecord)
{
if (EQ (buffer_or_name, Fwindow_buffer (selected_window)))
{
@@ -1814,7 +1776,7 @@ messing with the window-buffer correspondences. */)
DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0,
doc: /* Return the current buffer as a Lisp object. */)
- ()
+ (void)
{
register Lisp_Object buf;
XSETBUFFER (buf, current_buffer);
@@ -1831,8 +1793,7 @@ DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0,
time, and that increments windows_or_buffers_changed. */
void
-set_buffer_internal (b)
- register struct buffer *b;
+set_buffer_internal (register struct buffer *b)
{
if (current_buffer != b)
set_buffer_internal_1 (b);
@@ -1842,8 +1803,7 @@ set_buffer_internal (b)
This is used by redisplay. */
void
-set_buffer_internal_1 (b)
- register struct buffer *b;
+set_buffer_internal_1 (register struct buffer *b)
{
register struct buffer *old_buf;
register Lisp_Object tail;
@@ -1939,8 +1899,7 @@ set_buffer_internal_1 (b)
This avoids certain things that don't need to be done within redisplay. */
void
-set_buffer_temp (b)
- struct buffer *b;
+set_buffer_temp (struct buffer *b)
{
register struct buffer *old_buf;
@@ -2003,8 +1962,7 @@ also `save-excursion' when you want to make a buffer current
temporarily. This function does not display the buffer, so its effect
ends when the current command terminates. Use `switch-to-buffer' or
`pop-to-buffer' to switch buffers permanently. */)
- (buffer_or_name)
- register Lisp_Object buffer_or_name;
+ (register Lisp_Object buffer_or_name)
{
register Lisp_Object buffer;
buffer = Fget_buffer (buffer_or_name);
@@ -2019,8 +1977,7 @@ ends when the current command terminates. Use `switch-to-buffer' or
/* Set the current buffer to BUFFER provided it is alive. */
Lisp_Object
-set_buffer_if_live (buffer)
- Lisp_Object buffer;
+set_buffer_if_live (Lisp_Object buffer)
{
if (! NILP (XBUFFER (buffer)->name))
Fset_buffer (buffer);
@@ -2030,7 +1987,7 @@ set_buffer_if_live (buffer)
DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only,
Sbarf_if_buffer_read_only, 0, 0, 0,
doc: /* Signal a `buffer-read-only' error if the current buffer is read-only. */)
- ()
+ (void)
{
if (!NILP (current_buffer->read_only)
&& NILP (Vinhibit_read_only))
@@ -2050,8 +2007,7 @@ from the selected window if it is displayed there. If the selected
window is dedicated to its buffer, delete that window if there are other
windows on the same frame. If the selected window is the only window on
its frame, iconify that frame. */)
- (buffer_or_name)
- register Lisp_Object buffer_or_name;
+ (register Lisp_Object buffer_or_name)
{
Lisp_Object buffer;
@@ -2105,7 +2061,7 @@ DEFUN ("erase-buffer", Ferase_buffer, Serase_buffer, 0, 0, "*",
doc: /* Delete the entire contents of the current buffer.
Any narrowing restriction in effect (see `narrow-to-region') is removed,
so the buffer is truly empty after this. */)
- ()
+ (void)
{
Fwiden ();
@@ -2120,8 +2076,7 @@ so the buffer is truly empty after this. */)
}
void
-validate_region (b, e)
- register Lisp_Object *b, *e;
+validate_region (register Lisp_Object *b, register Lisp_Object *e)
{
CHECK_NUMBER_COERCE_MARKER (*b);
CHECK_NUMBER_COERCE_MARKER (*e);
@@ -2141,8 +2096,7 @@ validate_region (b, e)
and return the adjusted position. */
static int
-advance_to_char_boundary (byte_pos)
- int byte_pos;
+advance_to_char_boundary (int byte_pos)
{
int c;
@@ -2175,14 +2129,13 @@ advance_to_char_boundary (byte_pos)
}
#ifdef REL_ALLOC
-extern void r_alloc_reset_variable P_ ((POINTER_TYPE *, POINTER_TYPE *));
+extern void r_alloc_reset_variable (POINTER_TYPE *, POINTER_TYPE *);
#endif /* REL_ALLOC */
DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
1, 1, 0,
doc: /* Swap the text between current buffer and BUFFER. */)
- (buffer)
- Lisp_Object buffer;
+ (Lisp_Object buffer)
{
struct buffer *other_buffer;
CHECK_BUFFER (buffer);
@@ -2320,8 +2273,7 @@ If FLAG is `to', this makes the buffer a multibyte buffer by changing
all eight-bit bytes to eight-bit characters.
If the multibyte flag was really changed, undo information of the
current buffer is cleared. */)
- (flag)
- Lisp_Object flag;
+ (Lisp_Object flag)
{
struct Lisp_Marker *tail, *markers;
struct buffer *other;
@@ -2588,7 +2540,6 @@ current buffer is cleared. */)
if (!modified_p && !NILP (Fbuffer_modified_p (Qnil)))
Fset_buffer_modified_p (Qnil);
-#ifdef subprocesses
/* Update coding systems of this buffer's process (if any). */
{
Lisp_Object process;
@@ -2597,7 +2548,6 @@ current buffer is cleared. */)
if (PROCESSP (process))
setup_process_coding_systems (process);
}
-#endif /* subprocesses */
return flag;
}
@@ -2619,7 +2569,7 @@ a non-nil `permanent-local' property are not eliminated by this function.
The first thing this function does is run
the normal hook `change-major-mode-hook'. */)
- ()
+ (void)
{
if (!NILP (Vrun_hooks))
call1 (Vrun_hooks, Qchange_major_mode_hook);
@@ -2644,8 +2594,7 @@ the normal hook `change-major-mode-hook'. */)
for their current values. */
static void
-swap_out_buffer_local_variables (b)
- struct buffer *b;
+swap_out_buffer_local_variables (struct buffer *b)
{
Lisp_Object oalist, alist, buffer;
@@ -2690,14 +2639,8 @@ swap_out_buffer_local_variables (b)
default (BEGV or ZV). */
int
-overlays_at (pos, extend, vec_ptr, len_ptr, next_ptr, prev_ptr, change_req)
- EMACS_INT pos;
- int extend;
- Lisp_Object **vec_ptr;
- int *len_ptr;
- EMACS_INT *next_ptr;
- EMACS_INT *prev_ptr;
- int change_req;
+overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, int *len_ptr,
+ EMACS_INT *next_ptr, EMACS_INT *prev_ptr, int change_req)
{
Lisp_Object overlay, start, end;
struct Lisp_Overlay *tail;
@@ -2835,13 +2778,8 @@ overlays_at (pos, extend, vec_ptr, len_ptr, next_ptr, prev_ptr, change_req)
But we still return the total number of overlays. */
static int
-overlays_in (beg, end, extend, vec_ptr, len_ptr, next_ptr, prev_ptr)
- int beg, end;
- int extend;
- Lisp_Object **vec_ptr;
- int *len_ptr;
- int *next_ptr;
- int *prev_ptr;
+overlays_in (int beg, int end, int extend, Lisp_Object **vec_ptr, int *len_ptr,
+ int *next_ptr, int *prev_ptr)
{
Lisp_Object overlay, ostart, oend;
struct Lisp_Overlay *tail;
@@ -2962,8 +2900,7 @@ overlays_in (beg, end, extend, vec_ptr, len_ptr, next_ptr, prev_ptr)
`mouse-face' property overlapping OVERLAY. */
int
-mouse_face_overlay_overlaps (overlay)
- Lisp_Object overlay;
+mouse_face_overlay_overlaps (Lisp_Object overlay)
{
int start = OVERLAY_POSITION (OVERLAY_START (overlay));
int end = OVERLAY_POSITION (OVERLAY_END (overlay));
@@ -2992,8 +2929,7 @@ mouse_face_overlay_overlaps (overlay)
/* Fast function to just test if we're at an overlay boundary. */
int
-overlay_touches_p (pos)
- int pos;
+overlay_touches_p (int pos)
{
Lisp_Object overlay;
struct Lisp_Overlay *tail;
@@ -3038,8 +2974,7 @@ struct sortvec
};
static int
-compare_overlays (v1, v2)
- const void *v1, *v2;
+compare_overlays (const void *v1, const void *v2)
{
const struct sortvec *s1 = (const struct sortvec *) v1;
const struct sortvec *s2 = (const struct sortvec *) v2;
@@ -3056,10 +2991,7 @@ compare_overlays (v1, v2)
The return value is the new size; this may be smaller than the original
size if some of the overlays were invalid or were window-specific. */
int
-sort_overlays (overlay_vec, noverlays, w)
- Lisp_Object *overlay_vec;
- int noverlays;
- struct window *w;
+sort_overlays (Lisp_Object *overlay_vec, int noverlays, struct window *w)
{
int i, j;
struct sortvec *sortvec;
@@ -3139,8 +3071,7 @@ static int overlay_str_len;
/* A comparison function suitable for passing to qsort. */
static int
-cmp_for_strings (as1, as2)
- char *as1, *as2;
+cmp_for_strings (const void *as1, const void *as2)
{
struct sortstr *s1 = (struct sortstr *)as1;
struct sortstr *s2 = (struct sortstr *)as2;
@@ -3152,10 +3083,7 @@ cmp_for_strings (as1, as2)
}
static void
-record_overlay_string (ssl, str, str2, pri, size)
- struct sortstrlist *ssl;
- Lisp_Object str, str2, pri;
- int size;
+record_overlay_string (struct sortstrlist *ssl, Lisp_Object str, Lisp_Object str2, Lisp_Object pri, int size)
{
int nbytes;
@@ -3211,10 +3139,7 @@ record_overlay_string (ssl, str, str2, pri, size)
subsequent calls. */
int
-overlay_strings (pos, w, pstr)
- EMACS_INT pos;
- struct window *w;
- unsigned char **pstr;
+overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr)
{
Lisp_Object overlay, window, str;
struct Lisp_Overlay *ov;
@@ -3337,9 +3262,7 @@ overlay_strings (pos, w, pstr)
/* Shift overlays in BUF's overlay lists, to center the lists at POS. */
void
-recenter_overlay_lists (buf, pos)
- struct buffer *buf;
- EMACS_INT pos;
+recenter_overlay_lists (struct buffer *buf, EMACS_INT pos)
{
Lisp_Object overlay, beg, end;
struct Lisp_Overlay *prev, *tail, *next;
@@ -3488,9 +3411,7 @@ recenter_overlay_lists (buf, pos)
}
void
-adjust_overlays_for_insert (pos, length)
- EMACS_INT pos;
- EMACS_INT length;
+adjust_overlays_for_insert (EMACS_INT pos, EMACS_INT length)
{
/* After an insertion, the lists are still sorted properly,
but we may need to update the value of the overlay center. */
@@ -3499,9 +3420,7 @@ adjust_overlays_for_insert (pos, length)
}
void
-adjust_overlays_for_delete (pos, length)
- EMACS_INT pos;
- EMACS_INT length;
+adjust_overlays_for_delete (EMACS_INT pos, EMACS_INT length)
{
if (current_buffer->overlay_center < pos)
/* The deletion was to our right. No change needed; the before- and
@@ -3526,8 +3445,7 @@ adjust_overlays_for_delete (pos, length)
Such an overlay might even have negative size at this point.
If so, we'll make the overlay empty. */
void
-fix_start_end_in_overlays (start, end)
- register int start, end;
+fix_start_end_in_overlays (register int start, register int end)
{
Lisp_Object overlay;
struct Lisp_Overlay *before_list, *after_list;
@@ -3673,9 +3591,7 @@ fix_start_end_in_overlays (start, end)
was at PREV, and now is at POS. */
void
-fix_overlays_before (bp, prev, pos)
- struct buffer *bp;
- EMACS_INT prev, pos;
+fix_overlays_before (struct buffer *bp, EMACS_INT prev, EMACS_INT pos)
{
/* If parent is nil, replace overlays_before; otherwise, parent->next. */
struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair;
@@ -3754,8 +3670,7 @@ fix_overlays_before (bp, prev, pos)
DEFUN ("overlayp", Foverlayp, Soverlayp, 1, 1, 0,
doc: /* Return t if OBJECT is an overlay. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
return (OVERLAYP (object) ? Qt : Qnil);
}
@@ -3770,9 +3685,7 @@ for the front of the overlay advance when text is inserted there
The fifth arg REAR-ADVANCE, if non-nil, makes the marker
for the rear of the overlay advance when text is inserted there
\(which means the text *is* included in the overlay). */)
- (beg, end, buffer, front_advance, rear_advance)
- Lisp_Object beg, end, buffer;
- Lisp_Object front_advance, rear_advance;
+ (Lisp_Object beg, Lisp_Object end, Lisp_Object buffer, Lisp_Object front_advance, Lisp_Object rear_advance)
{
Lisp_Object overlay;
struct buffer *b;
@@ -3841,9 +3754,7 @@ for the rear of the overlay advance when text is inserted there
/* Mark a section of BUF as needing redisplay because of overlays changes. */
static void
-modify_overlay (buf, start, end)
- struct buffer *buf;
- EMACS_INT start, end;
+modify_overlay (struct buffer *buf, EMACS_INT start, EMACS_INT end)
{
if (start > end)
{
@@ -3870,11 +3781,10 @@ modify_overlay (buf, start, end)
}
-Lisp_Object Fdelete_overlay ();
+Lisp_Object Fdelete_overlay (Lisp_Object overlay);
static struct Lisp_Overlay *
-unchain_overlay (list, overlay)
- struct Lisp_Overlay *list, *overlay;
+unchain_overlay (struct Lisp_Overlay *list, struct Lisp_Overlay *overlay)
{
struct Lisp_Overlay *tmp, *prev;
for (tmp = list, prev = NULL; tmp; prev = tmp, tmp = tmp->next)
@@ -3895,8 +3805,7 @@ DEFUN ("move-overlay", Fmove_overlay, Smove_overlay, 3, 4, 0,
If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now.
If BUFFER is omitted, and OVERLAY is in no buffer, put it in the current
buffer. */)
- (overlay, beg, end, buffer)
- Lisp_Object overlay, beg, end, buffer;
+ (Lisp_Object overlay, Lisp_Object beg, Lisp_Object end, Lisp_Object buffer)
{
struct buffer *b, *ob;
Lisp_Object obuffer;
@@ -4005,8 +3914,7 @@ buffer. */)
DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0,
doc: /* Delete the overlay OVERLAY from its buffer. */)
- (overlay)
- Lisp_Object overlay;
+ (Lisp_Object overlay)
{
Lisp_Object buffer;
struct buffer *b;
@@ -4046,8 +3954,7 @@ DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0,
DEFUN ("overlay-start", Foverlay_start, Soverlay_start, 1, 1, 0,
doc: /* Return the position at which OVERLAY starts. */)
- (overlay)
- Lisp_Object overlay;
+ (Lisp_Object overlay)
{
CHECK_OVERLAY (overlay);
@@ -4056,8 +3963,7 @@ DEFUN ("overlay-start", Foverlay_start, Soverlay_start, 1, 1, 0,
DEFUN ("overlay-end", Foverlay_end, Soverlay_end, 1, 1, 0,
doc: /* Return the position at which OVERLAY ends. */)
- (overlay)
- Lisp_Object overlay;
+ (Lisp_Object overlay)
{
CHECK_OVERLAY (overlay);
@@ -4067,8 +3973,7 @@ DEFUN ("overlay-end", Foverlay_end, Soverlay_end, 1, 1, 0,
DEFUN ("overlay-buffer", Foverlay_buffer, Soverlay_buffer, 1, 1, 0,
doc: /* Return the buffer OVERLAY belongs to.
Return nil if OVERLAY has been deleted. */)
- (overlay)
- Lisp_Object overlay;
+ (Lisp_Object overlay)
{
CHECK_OVERLAY (overlay);
@@ -4079,8 +3984,7 @@ DEFUN ("overlay-properties", Foverlay_properties, Soverlay_properties, 1, 1, 0,
doc: /* Return a list of the properties on OVERLAY.
This is a copy of OVERLAY's plist; modifying its conses has no effect on
OVERLAY. */)
- (overlay)
- Lisp_Object overlay;
+ (Lisp_Object overlay)
{
CHECK_OVERLAY (overlay);
@@ -4090,8 +3994,7 @@ OVERLAY. */)
DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0,
doc: /* Return a list of the overlays that contain the character at POS. */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
int noverlays;
Lisp_Object *overlay_vec;
@@ -4123,8 +4026,7 @@ and also contained within the specified region.
Empty overlays are included in the result if they are located at BEG,
between BEG and END, or at END provided END denotes the position at the
end of the buffer. */)
- (beg, end)
- Lisp_Object beg, end;
+ (Lisp_Object beg, Lisp_Object end)
{
int noverlays;
Lisp_Object *overlay_vec;
@@ -4154,8 +4056,7 @@ DEFUN ("next-overlay-change", Fnext_overlay_change, Snext_overlay_change,
doc: /* Return the next position after POS where an overlay starts or ends.
If there are no overlay boundaries from POS to (point-max),
the value is (point-max). */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
int noverlays;
EMACS_INT endpos;
@@ -4196,8 +4097,7 @@ DEFUN ("previous-overlay-change", Fprevious_overlay_change,
doc: /* Return the previous position before POS where an overlay starts or ends.
If there are no overlay boundaries from (point-min) to POS,
the value is (point-min). */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
int noverlays;
EMACS_INT prevpos;
@@ -4233,7 +4133,7 @@ the cdr has all the overlays after the overlay center.
Recentering overlays moves overlays between these lists.
The lists you get are copies, so that changing them has no effect.
However, the overlays you get are the real objects that the buffer uses. */)
- ()
+ (void)
{
struct Lisp_Overlay *ol;
Lisp_Object before = Qnil, after = Qnil, tmp;
@@ -4254,8 +4154,7 @@ DEFUN ("overlay-recenter", Foverlay_recenter, Soverlay_recenter, 1, 1, 0,
doc: /* Recenter the overlays of the current buffer around position POS.
That makes overlay lookup faster for positions near POS (but perhaps slower
for positions far away from POS). */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
CHECK_NUMBER_COERCE_MARKER (pos);
@@ -4265,8 +4164,7 @@ for positions far away from POS). */)
DEFUN ("overlay-get", Foverlay_get, Soverlay_get, 2, 2, 0,
doc: /* Get the property of overlay OVERLAY with property name PROP. */)
- (overlay, prop)
- Lisp_Object overlay, prop;
+ (Lisp_Object overlay, Lisp_Object prop)
{
CHECK_OVERLAY (overlay);
return lookup_char_property (XOVERLAY (overlay)->plist, prop, 0);
@@ -4274,8 +4172,7 @@ DEFUN ("overlay-get", Foverlay_get, Soverlay_get, 2, 2, 0,
DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0,
doc: /* Set one property of overlay OVERLAY: give property PROP value VALUE. */)
- (overlay, prop, value)
- Lisp_Object overlay, prop, value;
+ (Lisp_Object overlay, Lisp_Object prop, Lisp_Object value)
{
Lisp_Object tail, buffer;
int changed;
@@ -4333,8 +4230,7 @@ static int last_overlay_modification_hooks_used;
to the end of last_overlay_modification_hooks. */
static void
-add_overlay_mod_hooklist (functionlist, overlay)
- Lisp_Object functionlist, overlay;
+add_overlay_mod_hooklist (Lisp_Object functionlist, Lisp_Object overlay)
{
int oldsize = XVECTOR (last_overlay_modification_hooks)->size;
@@ -4362,10 +4258,8 @@ add_overlay_mod_hooklist (functionlist, overlay)
and the length of deleted or replaced old text. */
void
-report_overlay_modification (start, end, after, arg1, arg2, arg3)
- Lisp_Object start, end;
- int after;
- Lisp_Object arg1, arg2, arg3;
+report_overlay_modification (Lisp_Object start, Lisp_Object end, int after,
+ Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3)
{
Lisp_Object prop, overlay;
struct Lisp_Overlay *tail;
@@ -4473,8 +4367,8 @@ report_overlay_modification (start, end, after, arg1, arg2, arg3)
Lisp_Object *copy = (Lisp_Object *) alloca (size * sizeof (Lisp_Object));
int i;
- bcopy (XVECTOR (last_overlay_modification_hooks)->contents,
- copy, size * sizeof (Lisp_Object));
+ memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents,
+ size * sizeof (Lisp_Object));
gcpro1.var = copy;
gcpro1.nvars = size;
@@ -4490,10 +4384,8 @@ report_overlay_modification (start, end, after, arg1, arg2, arg3)
}
static void
-call_overlay_mod_hooks (list, overlay, after, arg1, arg2, arg3)
- Lisp_Object list, overlay;
- int after;
- Lisp_Object arg1, arg2, arg3;
+call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, int after,
+ Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3)
{
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
@@ -4513,8 +4405,7 @@ call_overlay_mod_hooks (list, overlay, after, arg1, arg2, arg3)
/* Delete any zero-sized overlays at position POS, if the `evaporate'
property is set. */
void
-evaporate_overlays (pos)
- EMACS_INT pos;
+evaporate_overlays (EMACS_INT pos)
{
Lisp_Object overlay, hit_list;
struct Lisp_Overlay *tail;
@@ -4552,9 +4443,7 @@ evaporate_overlays (pos)
in the slot with offset OFFSET. */
void
-buffer_slot_type_mismatch (newval, type)
- Lisp_Object newval;
- int type;
+buffer_slot_type_mismatch (Lisp_Object newval, int type)
{
Lisp_Object predicate;
@@ -4693,13 +4582,13 @@ static int mmap_initialized_p;
/* Function prototypes. */
-static int mmap_free_1 P_ ((struct mmap_region *));
-static int mmap_enlarge P_ ((struct mmap_region *, int));
-static struct mmap_region *mmap_find P_ ((POINTER_TYPE *, POINTER_TYPE *));
-static POINTER_TYPE *mmap_alloc P_ ((POINTER_TYPE **, size_t));
-static POINTER_TYPE *mmap_realloc P_ ((POINTER_TYPE **, size_t));
-static void mmap_free P_ ((POINTER_TYPE **ptr));
-static void mmap_init P_ ((void));
+static int mmap_free_1 (struct mmap_region *);
+static int mmap_enlarge (struct mmap_region *, int);
+static struct mmap_region *mmap_find (POINTER_TYPE *, POINTER_TYPE *);
+static POINTER_TYPE *mmap_alloc (POINTER_TYPE **, size_t);
+static POINTER_TYPE *mmap_realloc (POINTER_TYPE **, size_t);
+static void mmap_free (POINTER_TYPE **ptr);
+static void mmap_init (void);
/* Return a region overlapping address range START...END, or null if
@@ -4942,7 +4831,7 @@ mmap_realloc (var, nbytes)
}
else if (mmap_alloc (var, nbytes))
{
- bcopy (old_ptr, *var, r->nbytes_specified);
+ memcpy (*var, old_ptr, r->nbytes_specified);
mmap_free_1 (MMAP_REGION (old_ptr));
result = *var;
r = MMAP_REGION (result);
@@ -5032,18 +4921,16 @@ mmap_init ()
***********************************************************************/
#ifdef REL_ALLOC
-extern POINTER_TYPE *r_alloc P_ ((POINTER_TYPE **, size_t));
-extern POINTER_TYPE *r_re_alloc P_ ((POINTER_TYPE **, size_t));
-extern void r_alloc_free P_ ((POINTER_TYPE **ptr));
+extern POINTER_TYPE *r_alloc (POINTER_TYPE **, size_t);
+extern POINTER_TYPE *r_re_alloc (POINTER_TYPE **, size_t);
+extern void r_alloc_free (POINTER_TYPE **ptr);
#endif /* REL_ALLOC */
/* Allocate NBYTES bytes for buffer B's text buffer. */
static void
-alloc_buffer_text (b, nbytes)
- struct buffer *b;
- size_t nbytes;
+alloc_buffer_text (struct buffer *b, size_t nbytes)
{
POINTER_TYPE *p;
@@ -5098,8 +4985,7 @@ enlarge_buffer_text (struct buffer *b, EMACS_INT delta)
/* Free buffer B's text buffer. */
static void
-free_buffer_text (b)
- struct buffer *b;
+free_buffer_text (struct buffer *b)
{
BLOCK_INPUT;
@@ -5122,11 +5008,11 @@ free_buffer_text (b)
***********************************************************************/
void
-init_buffer_once ()
+init_buffer_once (void)
{
int idx;
- bzero (buffer_permanent_local_flags, sizeof buffer_permanent_local_flags);
+ memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags);
/* Make sure all markable slots in buffer_defaults
are initialized reasonably, so mark_buffer won't choke. */
@@ -5214,7 +5100,7 @@ init_buffer_once ()
if (sizeof (EMACS_INT) != sizeof (Lisp_Object)) abort ();
/* 0 means not a lisp var, -1 means always local, else mask */
- bzero (&buffer_local_flags, sizeof buffer_local_flags);
+ memset (&buffer_local_flags, 0, sizeof buffer_local_flags);
XSETINT (buffer_local_flags.filename, -1);
XSETINT (buffer_local_flags.directory, -1);
XSETINT (buffer_local_flags.backed_up, -1);
@@ -5318,7 +5204,7 @@ init_buffer_once ()
}
void
-init_buffer ()
+init_buffer (void)
{
char *pwd;
Lisp_Object temp;
@@ -5402,12 +5288,8 @@ init_buffer ()
} while (0)
static void
-defvar_per_buffer (bo_fwd, namestring, address, type, doc)
- struct Lisp_Buffer_Objfwd *bo_fwd;
- char *namestring;
- Lisp_Object *address;
- Lisp_Object type;
- char *doc;
+defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, char *namestring,
+ Lisp_Object *address, Lisp_Object type, char *doc)
{
struct Lisp_Symbol *sym;
int offset;
@@ -5436,7 +5318,7 @@ defvar_per_buffer (bo_fwd, namestring, address, type, doc)
/* initialize the buffer routines */
void
-syms_of_buffer ()
+syms_of_buffer (void)
{
staticpro (&last_overlay_modification_hooks);
last_overlay_modification_hooks
@@ -6339,7 +6221,7 @@ The function `kill-all-local-variables' runs this before doing anything else. *
}
void
-keys_of_buffer ()
+keys_of_buffer (void)
{
initial_define_key (control_x_map, 'b', "switch-to-buffer");
initial_define_key (control_x_map, 'k', "kill-buffer");
diff --git a/src/buffer.h b/src/buffer.h
index d03152abd85..339e7d9bb6d 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -225,12 +225,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define BUF_TEMP_SET_PT(buffer, position) \
(temp_set_point ((buffer), (position)))
-extern void set_point P_ ((EMACS_INT));
-extern INLINE void temp_set_point P_ ((struct buffer *, EMACS_INT));
-extern void set_point_both P_ ((EMACS_INT, EMACS_INT));
-extern INLINE void temp_set_point_both P_ ((struct buffer *,
- EMACS_INT, EMACS_INT));
-extern void enlarge_buffer_text P_ ((struct buffer *, EMACS_INT));
+extern void set_point (EMACS_INT);
+extern INLINE void temp_set_point (struct buffer *, EMACS_INT);
+extern void set_point_both (EMACS_INT, EMACS_INT);
+extern INLINE void temp_set_point_both (struct buffer *,
+ EMACS_INT, EMACS_INT);
+extern void enlarge_buffer_text (struct buffer *, EMACS_INT);
/* Macros for setting the BEGV, ZV or PT of a given buffer.
@@ -857,23 +857,23 @@ extern struct buffer buffer_local_flags;
extern struct buffer buffer_local_symbols;
-extern void delete_all_overlays P_ ((struct buffer *));
-extern void reset_buffer P_ ((struct buffer *));
-extern void evaporate_overlays P_ ((EMACS_INT));
-extern int overlays_at P_ ((EMACS_INT pos, int extend, Lisp_Object **vec_ptr,
- int *len_ptr, EMACS_INT *next_ptr,
- EMACS_INT *prev_ptr, int change_req));
-extern int sort_overlays P_ ((Lisp_Object *, int, struct window *));
-extern void recenter_overlay_lists P_ ((struct buffer *, EMACS_INT));
-extern int overlay_strings P_ ((EMACS_INT, struct window *, unsigned char **));
-extern void validate_region P_ ((Lisp_Object *, Lisp_Object *));
-extern void set_buffer_internal P_ ((struct buffer *));
-extern void set_buffer_internal_1 P_ ((struct buffer *));
-extern void set_buffer_temp P_ ((struct buffer *));
-extern void record_buffer P_ ((Lisp_Object));
-extern void buffer_slot_type_mismatch P_ ((Lisp_Object, int)) NO_RETURN;
-extern void fix_overlays_before P_ ((struct buffer *, EMACS_INT, EMACS_INT));
-extern void mmap_set_vars P_ ((int));
+extern void delete_all_overlays (struct buffer *);
+extern void reset_buffer (struct buffer *);
+extern void evaporate_overlays (EMACS_INT);
+extern int overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr,
+ int *len_ptr, EMACS_INT *next_ptr,
+ EMACS_INT *prev_ptr, int change_req);
+extern int sort_overlays (Lisp_Object *, int, struct window *);
+extern void recenter_overlay_lists (struct buffer *, EMACS_INT);
+extern int overlay_strings (EMACS_INT, struct window *, unsigned char **);
+extern void validate_region (Lisp_Object *, Lisp_Object *);
+extern void set_buffer_internal (struct buffer *);
+extern void set_buffer_internal_1 (struct buffer *);
+extern void set_buffer_temp (struct buffer *);
+extern void record_buffer (Lisp_Object);
+extern void buffer_slot_type_mismatch (Lisp_Object, int) NO_RETURN;
+extern void fix_overlays_before (struct buffer *, EMACS_INT, EMACS_INT);
+extern void mmap_set_vars (int);
/* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements.
If NEXTP is non-NULL, return next overlay there.
@@ -954,7 +954,7 @@ extern int last_per_buffer_idx;
from the start of a buffer structure. */
#define PER_BUFFER_VAR_OFFSET(VAR) \
- ((char *) &((struct buffer *)0)->VAR - (char *) ((struct buffer *)0))
+ offsetof (struct buffer, VAR)
/* Return the index of buffer-local variable VAR. Each per-buffer
variable has an index > 0 associated with it, except when it always
diff --git a/src/bytecode.c b/src/bytecode.c
index 192d397c45f..d94b19b2d07 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -281,7 +281,7 @@ struct byte_stack *byte_stack_list;
/* Mark objects on byte_stack_list. Called during GC. */
void
-mark_byte_stack ()
+mark_byte_stack (void)
{
struct byte_stack *stack;
Lisp_Object *obj;
@@ -310,7 +310,7 @@ mark_byte_stack ()
counters. Called when GC has completed. */
void
-unmark_byte_stack ()
+unmark_byte_stack (void)
{
struct byte_stack *stack;
@@ -418,9 +418,7 @@ according to which any remaining arguments are pushed on the stack
before executing BYTESTR.
usage: (byte-code BYTESTR VECTOR MAXDEP &optional ARGS-TEMPLATE &rest ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
Lisp_Object args_tmpl = nargs >= 4 ? args[3] : Qnil;
int pnargs = nargs >= 4 ? nargs - 4 : 0;
@@ -437,10 +435,8 @@ usage: (byte-code BYTESTR VECTOR MAXDEP &optional ARGS-TEMPLATE &rest ARGS) */)
executing BYTESTR. */
Lisp_Object
-exec_byte_code (bytestr, vector, maxdepth, args_template, nargs, args)
- Lisp_Object bytestr, vector, maxdepth, args_template;
- int nargs;
- Lisp_Object *args;
+exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
+ Lisp_Object args_template, int nargs, Lisp_Object *args)
{
int count = SPECPDL_INDEX ();
#ifdef BYTE_CODE_METER
@@ -1794,7 +1790,7 @@ exec_byte_code (bytestr, vector, maxdepth, args_template, nargs, args)
}
void
-syms_of_bytecode ()
+syms_of_bytecode (void)
{
Qbytecode = intern_c_string ("byte-code");
staticpro (&Qbytecode);
diff --git a/src/callint.c b/src/callint.c
index a45f8a372b8..fa0be112bea 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -29,10 +29,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "window.h"
#include "keymap.h"
-#ifdef HAVE_INDEX
-extern char *index P_ ((const char *, int));
-#endif
-
extern Lisp_Object Qcursor_in_echo_area;
extern Lisp_Object Qfile_directory_p;
extern Lisp_Object Qonly;
@@ -131,8 +127,7 @@ If the string begins with `^' and `shift-select-mode' is non-nil,
You may use `@', `*', and `^' together. They are processed in the
order that they appear, before reading any arguments.
usage: (interactive &optional ARGS) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
return Qnil;
}
@@ -140,8 +135,7 @@ usage: (interactive &optional ARGS) */)
/* Quotify EXP: if EXP is constant, return it.
If EXP is not constant, return (quote EXP). */
Lisp_Object
-quotify_arg (exp)
- register Lisp_Object exp;
+quotify_arg (register Lisp_Object exp)
{
if (!INTEGERP (exp) && !STRINGP (exp)
&& !NILP (exp) && !EQ (exp, Qt))
@@ -152,8 +146,7 @@ quotify_arg (exp)
/* Modify EXP by quotifying each element (except the first). */
Lisp_Object
-quotify_args (exp)
- Lisp_Object exp;
+quotify_args (Lisp_Object exp)
{
register Lisp_Object tail;
Lisp_Object next;
@@ -169,8 +162,7 @@ char *callint_argfuns[]
= {"", "point", "mark", "region-beginning", "region-end"};
static void
-check_mark (for_region)
- int for_region;
+check_mark (int for_region)
{
Lisp_Object tem;
tem = Fmarker_buffer (current_buffer->mark);
@@ -191,8 +183,7 @@ check_mark (for_region)
of VALUES to do its job. */
static void
-fix_command (input, values)
- Lisp_Object input, values;
+fix_command (Lisp_Object input, Lisp_Object values)
{
if (CONSP (input))
{
@@ -267,8 +258,7 @@ Optional third arg KEYS, if given, specifies the sequence of events to
supply, as a vector, if the command inquires which events were used to
invoke it. If KEYS is omitted or nil, the return value of
`this-command-keys-vector' is used. */)
- (function, record_flag, keys)
- Lisp_Object function, record_flag, keys;
+ (Lisp_Object function, Lisp_Object record_flag, Lisp_Object keys)
{
Lisp_Object *args, *visargs;
Lisp_Object specs;
@@ -352,8 +342,7 @@ invoke it. If KEYS is omitted or nil, the return value of
/* Make a copy of string so that if a GC relocates specs,
`string' will still be valid. */
string = (unsigned char *) alloca (SBYTES (specs) + 1);
- bcopy (SDATA (specs), string,
- SBYTES (specs) + 1);
+ memcpy (string, SDATA (specs), SBYTES (specs) + 1);
}
else
{
@@ -476,7 +465,7 @@ invoke it. If KEYS is omitted or nil, the return value of
j += 2;
else
j++;
- tem = (unsigned char *) index (tem, '\n');
+ tem = (unsigned char *) strchr (tem, '\n');
if (tem)
++tem;
else
@@ -507,11 +496,11 @@ invoke it. If KEYS is omitted or nil, the return value of
{
strncpy (prompt1, tem + 1, sizeof prompt1 - 1);
prompt1[sizeof prompt1 - 1] = 0;
- tem1 = (char *) index (prompt1, '\n');
+ tem1 = strchr (prompt1, '\n');
if (tem1) *tem1 = 0;
visargs[0] = build_string (prompt1);
- if (index (prompt1, '%'))
+ if (strchr (prompt1, '%'))
callint_message = Fformat (i, visargs);
else
callint_message = visargs[0];
@@ -816,7 +805,7 @@ invoke it. If KEYS is omitted or nil, the return value of
if (NILP (visargs[i]) && STRINGP (args[i]))
visargs[i] = args[i];
- tem = (unsigned char *) index (tem, '\n');
+ tem = (unsigned char *) strchr (tem, '\n');
if (tem) tem++;
else tem = (unsigned char *) "";
}
@@ -877,8 +866,7 @@ DEFUN ("prefix-numeric-value", Fprefix_numeric_value, Sprefix_numeric_value,
doc: /* Return numeric meaning of raw prefix argument RAW.
A raw prefix argument is what you get from `(interactive "P")'.
Its numeric meaning is what you would get from `(interactive "p")'. */)
- (raw)
- Lisp_Object raw;
+ (Lisp_Object raw)
{
Lisp_Object val;
@@ -897,7 +885,7 @@ Its numeric meaning is what you would get from `(interactive "p")'. */)
}
void
-syms_of_callint ()
+syms_of_callint (void)
{
point_marker = Fmake_marker ();
staticpro (&point_marker);
diff --git a/src/callproc.c b/src/callproc.c
index 82a5ebb90da..4286ab1ae29 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -137,8 +137,7 @@ static int call_process_exited;
EXFUN (Fgetenv_internal, 2);
static Lisp_Object
-call_process_kill (fdpid)
- Lisp_Object fdpid;
+call_process_kill (Lisp_Object fdpid)
{
emacs_close (XFASTINT (Fcar (fdpid)));
EMACS_KILLPG (XFASTINT (Fcdr (fdpid)), SIGKILL);
@@ -147,8 +146,7 @@ call_process_kill (fdpid)
}
Lisp_Object
-call_process_cleanup (arg)
- Lisp_Object arg;
+call_process_cleanup (Lisp_Object arg)
{
Lisp_Object fdpid = Fcdr (arg);
#if defined (MSDOS)
@@ -217,9 +215,7 @@ and returns a numeric exit status or a signal description string.
If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.
usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
Lisp_Object infile, buffer, current_dir, path;
int display_p;
@@ -616,12 +612,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
{
if (fd[0] >= 0)
emacs_close (fd[0]);
-#ifndef subprocesses
- /* If Emacs has been built with asynchronous subprocess support,
- we don't need to do this, I think because it will then have
- the facilities for handling SIGCHLD. */
- wait_without_blocking ();
-#endif /* subprocesses */
return Qnil;
}
@@ -777,10 +767,8 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
PT_BYTE + process_coding.produced);
carryover = process_coding.carryover_bytes;
if (carryover > 0)
- /* As CARRYOVER should not be that large, we had
- better avoid overhead of bcopy. */
- BCOPY_SHORT (process_coding.carryover, buf,
- process_coding.carryover_bytes);
+ memcpy (buf, process_coding.carryover,
+ process_coding.carryover_bytes);
}
}
@@ -817,8 +805,10 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
make_number (total_read));
}
+#ifndef MSDOS
/* Wait for it to terminate, unless it already has. */
wait_for_termination (pid);
+#endif
immediate_quit = 0;
@@ -848,8 +838,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
}
static Lisp_Object
-delete_temp_file (name)
- Lisp_Object name;
+delete_temp_file (Lisp_Object name)
{
/* Suppress jka-compr handling, etc. */
int count = SPECPDL_INDEX ();
@@ -882,9 +871,7 @@ and returns a numeric exit status or a signal description string.
If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.
usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
struct gcpro gcpro1;
Lisp_Object filename_string;
@@ -919,7 +906,7 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir);
tempfile = (char *) alloca (SBYTES (pattern) + 1);
- bcopy (SDATA (pattern), tempfile, SBYTES (pattern) + 1);
+ memcpy (tempfile, SDATA (pattern), SBYTES (pattern) + 1);
coding_systems = Qt;
#ifdef HAVE_MKSTEMP
@@ -997,7 +984,7 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
RETURN_UNGCPRO (unbind_to (count, Fcall_process (nargs, args)));
}
-static int relocate_fd ();
+static int relocate_fd (int fd, int minfd);
static char **
add_env (char **env, char **new_env, char *string)
@@ -1052,11 +1039,7 @@ add_env (char **env, char **new_env, char *string)
executable directory by the parent. */
int
-child_setup (in, out, err, new_argv, set_pgrp, current_dir)
- int in, out, err;
- register char **new_argv;
- int set_pgrp;
- Lisp_Object current_dir;
+child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, Lisp_Object current_dir)
{
char **env;
char *pwd_var;
@@ -1067,19 +1050,9 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
int pid = getpid ();
-#ifdef SET_EMACS_PRIORITY
- {
- extern EMACS_INT emacs_priority;
-
- if (emacs_priority < 0)
- nice (- emacs_priority);
- }
-#endif
-
-#ifdef subprocesses
/* Close Emacs's descriptors that this process should not have. */
close_process_descs ();
-#endif
+
/* DOS_NT isn't in a vfork, so if we are in the middle of load-file,
we will lose if we call close_load_descs here. */
#ifndef DOS_NT
@@ -1106,8 +1079,8 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
pwd_var = (char *) alloca (i + 6);
#endif
temp = pwd_var + 4;
- bcopy ("PWD=", pwd_var, 4);
- bcopy (SDATA (current_dir), temp, i);
+ memcpy (pwd_var, "PWD=", 4);
+ memcpy (temp, SDATA (current_dir), i);
if (!IS_DIRECTORY_SEP (temp[i - 1])) temp[i++] = DIRECTORY_SEP;
temp[i] = 0;
@@ -1244,8 +1217,10 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
dup2 (out, 1);
dup2 (err, 2);
emacs_close (in);
- emacs_close (out);
- emacs_close (err);
+ if (out != in)
+ emacs_close (out);
+ if (err != in && err != out)
+ emacs_close (err);
#endif /* not MSDOS */
#endif /* not WINDOWSNT */
@@ -1293,39 +1268,40 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
/* Move the file descriptor FD so that its number is not less than MINFD.
If the file descriptor is moved at all, the original is freed. */
static int
-relocate_fd (fd, minfd)
- int fd, minfd;
+relocate_fd (int fd, int minfd)
{
if (fd >= minfd)
return fd;
else
{
- int new = dup (fd);
+ int new;
+#ifdef F_DUPFD
+ new = fcntl (fd, F_DUPFD, minfd);
+#else
+ new = dup (fd);
+ if (new != -1)
+ /* Note that we hold the original FD open while we recurse,
+ to guarantee we'll get a new FD if we need it. */
+ new = relocate_fd (new, minfd);
+#endif
if (new == -1)
{
- char *message1 = "Error while setting up child: ";
- char *errmessage = strerror (errno);
- char *message2 = "\n";
+ const char *message1 = "Error while setting up child: ";
+ const char *errmessage = strerror (errno);
+ const char *message2 = "\n";
emacs_write (2, message1, strlen (message1));
emacs_write (2, errmessage, strlen (errmessage));
emacs_write (2, message2, strlen (message2));
_exit (1);
}
- /* Note that we hold the original FD open while we recurse,
- to guarantee we'll get a new FD if we need it. */
- new = relocate_fd (new, minfd);
emacs_close (fd);
return new;
}
}
static int
-getenv_internal_1 (var, varlen, value, valuelen, env)
- char *var;
- int varlen;
- char **value;
- int *valuelen;
- Lisp_Object env;
+getenv_internal_1 (const char *var, int varlen, char **value, int *valuelen,
+ Lisp_Object env)
{
for (; CONSP (env); env = XCDR (env))
{
@@ -1336,7 +1312,7 @@ getenv_internal_1 (var, varlen, value, valuelen, env)
/* NT environment variables are case insensitive. */
&& ! strnicmp (SDATA (entry), var, varlen)
#else /* not WINDOWSNT */
- && ! bcmp (SDATA (entry), var, varlen)
+ && ! memcmp (SDATA (entry), var, varlen)
#endif /* not WINDOWSNT */
)
{
@@ -1359,12 +1335,8 @@ getenv_internal_1 (var, varlen, value, valuelen, env)
}
static int
-getenv_internal (var, varlen, value, valuelen, frame)
- char *var;
- int varlen;
- char **value;
- int *valuelen;
- Lisp_Object frame;
+getenv_internal (const char *var, int varlen, char **value, int *valuelen,
+ Lisp_Object frame)
{
/* Try to find VAR in Vprocess_environment first. */
if (getenv_internal_1 (var, varlen, value, valuelen,
@@ -1401,8 +1373,7 @@ This function searches `process-environment' for VARIABLE.
If optional parameter ENV is a list, then search this list instead of
`process-environment', and return t when encountering a negative entry
\(an entry for a variable with no value). */)
- (variable, env)
- Lisp_Object variable, env;
+ (Lisp_Object variable, Lisp_Object env)
{
char *value;
int valuelen;
@@ -1426,8 +1397,7 @@ If optional parameter ENV is a list, then search this list instead of
/* A version of getenv that consults the Lisp environment lists,
easily callable from C. */
char *
-egetenv (var)
- char *var;
+egetenv (const char *var)
{
char *value;
int valuelen;
@@ -1442,7 +1412,7 @@ egetenv (var)
/* This is run before init_cmdargs. */
void
-init_callproc_1 ()
+init_callproc_1 (void)
{
char *data_dir = egetenv ("EMACSDATA");
char *doc_dir = egetenv ("EMACSDOC");
@@ -1464,7 +1434,7 @@ init_callproc_1 ()
/* This is run after init_cmdargs, when Vinstallation_directory is valid. */
void
-init_callproc ()
+init_callproc (void)
{
char *data_dir = egetenv ("EMACSDATA");
@@ -1553,7 +1523,7 @@ init_callproc ()
}
void
-set_initial_environment ()
+set_initial_environment (void)
{
register char **envp;
#ifndef CANNOT_DUMP
@@ -1573,7 +1543,7 @@ set_initial_environment ()
}
void
-syms_of_callproc ()
+syms_of_callproc (void)
{
#ifdef DOS_NT
Qbuffer_file_type = intern ("buffer-file-type");
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 30bb457b17d..9545cf697a8 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -33,9 +33,7 @@ enum case_action {CASE_UP, CASE_DOWN, CASE_CAPITALIZE, CASE_CAPITALIZE_UP};
Lisp_Object Qidentity;
Lisp_Object
-casify_object (flag, obj)
- enum case_action flag;
- Lisp_Object obj;
+casify_object (enum case_action flag, Lisp_Object obj)
{
register int c, c1;
register int inword = flag == CASE_DOWN;
@@ -130,7 +128,7 @@ casify_object (flag, obj)
unsigned char *old_dst = dst;
o_size += o_size; /* Probably overkill, but extremely rare. */
SAFE_ALLOCA (dst, void *, o_size);
- bcopy (old_dst, dst, o - old_dst);
+ memcpy (dst, old_dst, o - old_dst);
o = dst + (o - old_dst);
}
c = STRING_CHAR_AND_LENGTH (SDATA (obj) + i_byte, len);
@@ -155,8 +153,7 @@ DEFUN ("upcase", Fupcase, Supcase, 1, 1, 0,
The argument may be a character or string. The result has the same type.
The argument object is not altered--the value is a copy.
See also `capitalize', `downcase' and `upcase-initials'. */)
- (obj)
- Lisp_Object obj;
+ (Lisp_Object obj)
{
return casify_object (CASE_UP, obj);
}
@@ -165,8 +162,7 @@ DEFUN ("downcase", Fdowncase, Sdowncase, 1, 1, 0,
doc: /* Convert argument to lower case and return that.
The argument may be a character or string. The result has the same type.
The argument object is not altered--the value is a copy. */)
- (obj)
- Lisp_Object obj;
+ (Lisp_Object obj)
{
return casify_object (CASE_DOWN, obj);
}
@@ -177,8 +173,7 @@ This means that each word's first character is upper case
and the rest is lower case.
The argument may be a character or string. The result has the same type.
The argument object is not altered--the value is a copy. */)
- (obj)
- Lisp_Object obj;
+ (Lisp_Object obj)
{
return casify_object (CASE_CAPITALIZE, obj);
}
@@ -190,8 +185,7 @@ DEFUN ("upcase-initials", Fupcase_initials, Supcase_initials, 1, 1, 0,
Do not change the other letters of each word.
The argument may be a character or string. The result has the same type.
The argument object is not altered--the value is a copy. */)
- (obj)
- Lisp_Object obj;
+ (Lisp_Object obj)
{
return casify_object (CASE_CAPITALIZE_UP, obj);
}
@@ -200,9 +194,7 @@ The argument object is not altered--the value is a copy. */)
b and e specify range of buffer to operate on. */
void
-casify_region (flag, b, e)
- enum case_action flag;
- Lisp_Object b, e;
+casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e)
{
register int c;
register int inword = flag == CASE_DOWN;
@@ -310,8 +302,7 @@ These arguments specify the starting and ending character numbers of
the region to operate on. When used as a command, the text between
point and the mark is operated on.
See also `capitalize-region'. */)
- (beg, end)
- Lisp_Object beg, end;
+ (Lisp_Object beg, Lisp_Object end)
{
casify_region (CASE_UP, beg, end);
return Qnil;
@@ -322,8 +313,7 @@ DEFUN ("downcase-region", Fdowncase_region, Sdowncase_region, 2, 2, "r",
These arguments specify the starting and ending character numbers of
the region to operate on. When used as a command, the text between
point and the mark is operated on. */)
- (beg, end)
- Lisp_Object beg, end;
+ (Lisp_Object beg, Lisp_Object end)
{
casify_region (CASE_DOWN, beg, end);
return Qnil;
@@ -335,8 +325,7 @@ Capitalized form means each word's first character is upper case
and the rest of it is lower case.
In programs, give two arguments, the starting and ending
character positions to operate on. */)
- (beg, end)
- Lisp_Object beg, end;
+ (Lisp_Object beg, Lisp_Object end)
{
casify_region (CASE_CAPITALIZE, beg, end);
return Qnil;
@@ -350,17 +339,14 @@ DEFUN ("upcase-initials-region", Fupcase_initials_region,
Subsequent letters of each word are not changed.
In programs, give two arguments, the starting and ending
character positions to operate on. */)
- (beg, end)
- Lisp_Object beg, end;
+ (Lisp_Object beg, Lisp_Object end)
{
casify_region (CASE_CAPITALIZE_UP, beg, end);
return Qnil;
}
static Lisp_Object
-operate_on_word (arg, newpoint)
- Lisp_Object arg;
- EMACS_INT *newpoint;
+operate_on_word (Lisp_Object arg, EMACS_INT *newpoint)
{
Lisp_Object val;
int farend;
@@ -382,8 +368,7 @@ DEFUN ("upcase-word", Fupcase_word, Supcase_word, 1, 1, "p",
doc: /* Convert following word (or ARG words) to upper case, moving over.
With negative argument, convert previous words but do not move.
See also `capitalize-word'. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
Lisp_Object beg, end;
EMACS_INT newpoint;
@@ -397,8 +382,7 @@ See also `capitalize-word'. */)
DEFUN ("downcase-word", Fdowncase_word, Sdowncase_word, 1, 1, "p",
doc: /* Convert following word (or ARG words) to lower case, moving over.
With negative argument, convert previous words but do not move. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
Lisp_Object beg, end;
EMACS_INT newpoint;
@@ -414,8 +398,7 @@ DEFUN ("capitalize-word", Fcapitalize_word, Scapitalize_word, 1, 1, "p",
This gives the word(s) a first character in upper case
and the rest lower case.
With negative argument, capitalize previous words but do not move. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
Lisp_Object beg, end;
EMACS_INT newpoint;
@@ -427,7 +410,7 @@ With negative argument, capitalize previous words but do not move. */)
}
void
-syms_of_casefiddle ()
+syms_of_casefiddle (void)
{
Qidentity = intern_c_string ("identity");
staticpro (&Qidentity);
@@ -445,7 +428,7 @@ syms_of_casefiddle ()
}
void
-keys_of_casefiddle ()
+keys_of_casefiddle (void)
{
initial_define_key (control_x_map, Ctl('U'), "upcase-region");
Fput (intern ("upcase-region"), Qdisabled, Qt);
diff --git a/src/casetab.c b/src/casetab.c
index e0a9ec49157..eed6e22087f 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -34,15 +34,14 @@ Lisp_Object Vascii_canon_table, Vascii_eqv_table;
int case_temp1;
Lisp_Object case_temp2;
-static void set_canon ();
-static void set_identity ();
-static void shuffle ();
+static void set_canon (Lisp_Object case_table, Lisp_Object range, Lisp_Object elt);
+static void set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt);
+static void shuffle (Lisp_Object table, Lisp_Object c, Lisp_Object elt);
DEFUN ("case-table-p", Fcase_table_p, Scase_table_p, 1, 1, 0,
doc: /* Return t if OBJECT is a case table.
See `set-case-table' for more information on these data structures. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
Lisp_Object up, canon, eqv;
@@ -63,8 +62,7 @@ See `set-case-table' for more information on these data structures. */)
}
static Lisp_Object
-check_case_table (obj)
- Lisp_Object obj;
+check_case_table (Lisp_Object obj)
{
CHECK_TYPE (!NILP (Fcase_table_p (obj)), Qcase_table_p, obj);
return (obj);
@@ -72,7 +70,7 @@ check_case_table (obj)
DEFUN ("current-case-table", Fcurrent_case_table, Scurrent_case_table, 0, 0, 0,
doc: /* Return the case table of the current buffer. */)
- ()
+ (void)
{
return current_buffer->downcase_table;
}
@@ -80,12 +78,12 @@ DEFUN ("current-case-table", Fcurrent_case_table, Scurrent_case_table, 0, 0, 0,
DEFUN ("standard-case-table", Fstandard_case_table, Sstandard_case_table, 0, 0, 0,
doc: /* Return the standard case table.
This is the one used for new buffers. */)
- ()
+ (void)
{
return Vascii_downcase_table;
}
-static Lisp_Object set_case_table ();
+static Lisp_Object set_case_table (Lisp_Object table, int standard);
DEFUN ("set-case-table", Fset_case_table, Sset_case_table, 1, 1, 0,
doc: /* Select a new case table for the current buffer.
@@ -104,8 +102,7 @@ CANONICALIZE maps each character to a canonical equivalent;
EQUIVALENCES is a map that cyclicly permutes each equivalence class
(of characters with the same canonical equivalent); it may be nil,
in which case it is deduced from CANONICALIZE. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
return set_case_table (table, 0);
}
@@ -113,16 +110,13 @@ EQUIVALENCES is a map that cyclicly permutes each equivalence class
DEFUN ("set-standard-case-table", Fset_standard_case_table, Sset_standard_case_table, 1, 1, 0,
doc: /* Select a new standard case table for new buffers.
See `set-case-table' for more info on case tables. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
return set_case_table (table, 1);
}
static Lisp_Object
-set_case_table (table, standard)
- Lisp_Object table;
- int standard;
+set_case_table (Lisp_Object table, int standard)
{
Lisp_Object up, canon, eqv;
@@ -184,8 +178,7 @@ set_case_table (table, standard)
CASE_TABLE. */
static void
-set_canon (case_table, range, elt)
- Lisp_Object case_table, range, elt;
+set_canon (Lisp_Object case_table, Lisp_Object range, Lisp_Object elt)
{
Lisp_Object up = XCHAR_TABLE (case_table)->extras[0];
Lisp_Object canon = XCHAR_TABLE (case_table)->extras[1];
@@ -200,8 +193,7 @@ set_canon (case_table, range, elt)
character. This is called in map_char_table. */
static void
-set_identity (table, c, elt)
- Lisp_Object table, c, elt;
+set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt)
{
if (NATNUMP (elt))
{
@@ -225,8 +217,7 @@ set_identity (table, c, elt)
operated. */
static void
-shuffle (table, c, elt)
- Lisp_Object table, c, elt;
+shuffle (Lisp_Object table, Lisp_Object c, Lisp_Object elt)
{
if (NATNUMP (elt))
{
@@ -250,7 +241,7 @@ shuffle (table, c, elt)
}
void
-init_casetab_once ()
+init_casetab_once (void)
{
register int i;
Lisp_Object down, up;
@@ -296,7 +287,7 @@ init_casetab_once ()
}
void
-syms_of_casetab ()
+syms_of_casetab (void)
{
Qcase_table_p = intern_c_string ("case-table-p");
staticpro (&Qcase_table_p);
diff --git a/src/category.c b/src/category.c
index b56d62b6b80..5c38f351d01 100644
--- a/src/category.c
+++ b/src/category.c
@@ -59,11 +59,10 @@ Lisp_Object _temp_category_set;
/* Category set staff. */
-static Lisp_Object hash_get_category_set P_ ((Lisp_Object, Lisp_Object));
+static Lisp_Object hash_get_category_set (Lisp_Object, Lisp_Object);
static Lisp_Object
-hash_get_category_set (table, category_set)
- Lisp_Object table, category_set;
+hash_get_category_set (Lisp_Object table, Lisp_Object category_set)
{
Lisp_Object val;
struct Lisp_Hash_Table *h;
@@ -90,8 +89,7 @@ DEFUN ("make-category-set", Fmake_category_set, Smake_category_set, 1, 1, 0,
CATEGORIES is a string of category mnemonics.
The value is a bool-vector which has t at the indices corresponding to
those categories. */)
- (categories)
- Lisp_Object categories;
+ (Lisp_Object categories)
{
Lisp_Object val;
int len;
@@ -117,7 +115,7 @@ those categories. */)
/* Category staff. */
-Lisp_Object check_category_table ();
+Lisp_Object check_category_table (Lisp_Object table);
DEFUN ("define-category", Fdefine_category, Sdefine_category, 2, 3, 0,
doc: /* Define CATEGORY as a category which is described by DOCSTRING.
@@ -127,8 +125,7 @@ should be a terse text (preferably less than 16 characters),
and the rest lines should be the full description.
The category is defined only in category table TABLE, which defaults to
the current buffer's category table. */)
- (category, docstring, table)
- Lisp_Object category, docstring, table;
+ (Lisp_Object category, Lisp_Object docstring, Lisp_Object table)
{
CHECK_CATEGORY (category);
CHECK_STRING (docstring);
@@ -147,8 +144,7 @@ DEFUN ("category-docstring", Fcategory_docstring, Scategory_docstring, 1, 2, 0,
doc: /* Return the documentation string of CATEGORY, as defined in TABLE.
TABLE should be a category table and defaults to the current buffer's
category table. */)
- (category, table)
- Lisp_Object category, table;
+ (Lisp_Object category, Lisp_Object table)
{
CHECK_CATEGORY (category);
table = check_category_table (table);
@@ -162,8 +158,7 @@ DEFUN ("get-unused-category", Fget_unused_category, Sget_unused_category,
If no category remains available, return nil.
The optional argument TABLE specifies which category table to modify;
it defaults to the current buffer's category table. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
int i;
@@ -181,8 +176,7 @@ it defaults to the current buffer's category table. */)
DEFUN ("category-table-p", Fcategory_table_p, Scategory_table_p, 1, 1, 0,
doc: /* Return t if ARG is a category table. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
if (CHAR_TABLE_P (arg)
&& EQ (XCHAR_TABLE (arg)->purpose, Qcategory_table))
@@ -196,8 +190,7 @@ DEFUN ("category-table-p", Fcategory_table_p, Scategory_table_p, 1, 1, 0,
wrong-type-argument. */
Lisp_Object
-check_category_table (table)
- Lisp_Object table;
+check_category_table (Lisp_Object table)
{
if (NILP (table))
return current_buffer->category_table;
@@ -208,7 +201,7 @@ check_category_table (table)
DEFUN ("category-table", Fcategory_table, Scategory_table, 0, 0, 0,
doc: /* Return the current category table.
This is the one specified by the current buffer. */)
- ()
+ (void)
{
return current_buffer->category_table;
}
@@ -217,15 +210,14 @@ DEFUN ("standard-category-table", Fstandard_category_table,
Sstandard_category_table, 0, 0, 0,
doc: /* Return the standard category table.
This is the one used for new buffers. */)
- ()
+ (void)
{
return Vstandard_category_table;
}
static void
-copy_category_entry (table, c, val)
- Lisp_Object table, c, val;
+copy_category_entry (Lisp_Object table, Lisp_Object c, Lisp_Object val)
{
val = Fcopy_sequence (val);
if (CONSP (c))
@@ -240,8 +232,7 @@ copy_category_entry (table, c, val)
binding TABLE to a sub char table. */
Lisp_Object
-copy_category_table (table)
- Lisp_Object table;
+copy_category_table (Lisp_Object table)
{
table = copy_char_table (table);
@@ -259,8 +250,7 @@ DEFUN ("copy-category-table", Fcopy_category_table, Scopy_category_table,
0, 1, 0,
doc: /* Construct a new category table and return it.
It is a copy of the TABLE, which defaults to the standard category table. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
if (!NILP (table))
check_category_table (table);
@@ -273,7 +263,7 @@ It is a copy of the TABLE, which defaults to the standard category table. */)
DEFUN ("make-category-table", Fmake_category_table, Smake_category_table,
0, 0, 0,
doc: /* Construct a new and empty category table and return it. */)
- ()
+ (void)
{
Lisp_Object val;
int i;
@@ -290,8 +280,7 @@ DEFUN ("make-category-table", Fmake_category_table, Smake_category_table,
DEFUN ("set-category-table", Fset_category_table, Sset_category_table, 1, 1, 0,
doc: /* Specify TABLE as the category table for the current buffer.
Return TABLE. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
int idx;
table = check_category_table (table);
@@ -304,8 +293,7 @@ Return TABLE. */)
Lisp_Object
-char_category_set (c)
- int c;
+char_category_set (int c)
{
return CHAR_TABLE_REF (current_buffer->category_table, c);
}
@@ -313,8 +301,7 @@ char_category_set (c)
DEFUN ("char-category-set", Fchar_category_set, Schar_category_set, 1, 1, 0,
doc: /* Return the category set of CHAR.
usage: (char-category-set CHAR) */)
- (ch)
- Lisp_Object ch;
+ (Lisp_Object ch)
{
CHECK_NUMBER (ch);
return CATEGORY_SET (XFASTINT (ch));
@@ -326,8 +313,7 @@ DEFUN ("category-set-mnemonics", Fcategory_set_mnemonics,
CATEGORY-SET is a bool-vector, and the categories \"in\" it are those
that are indexes where t occurs in the bool-vector.
The return value is a string containing those same categories. */)
- (category_set)
- Lisp_Object category_set;
+ (Lisp_Object category_set)
{
int i, j;
char str[96];
@@ -344,8 +330,7 @@ The return value is a string containing those same categories. */)
}
void
-set_category_set (category_set, category, val)
- Lisp_Object category_set, category, val;
+set_category_set (Lisp_Object category_set, Lisp_Object category, Lisp_Object val)
{
do {
int idx = XINT (category) / 8;
@@ -367,8 +352,7 @@ CHARACTER can be either a single character or a cons representing the
lower and upper ends of an inclusive character range to modify.
If optional fourth argument RESET is non-nil,
then delete CATEGORY from the category set instead of adding it. */)
- (character, category, table, reset)
- Lisp_Object character, category, table, reset;
+ (Lisp_Object character, Lisp_Object category, Lisp_Object table, Lisp_Object reset)
{
Lisp_Object set_value; /* Actual value to be set in category sets. */
Lisp_Object category_set;
@@ -420,8 +404,7 @@ then delete CATEGORY from the category set instead of adding it. */)
directly. */
int
-word_boundary_p (c1, c2)
- int c1, c2;
+word_boundary_p (int c1, int c2)
{
Lisp_Object category_set1, category_set2;
Lisp_Object tail;
@@ -466,7 +449,7 @@ word_boundary_p (c1, c2)
void
-init_category_once ()
+init_category_once (void)
{
/* This has to be done here, before we call Fmake_char_table. */
Qcategory_table = intern_c_string ("category-table");
@@ -489,7 +472,7 @@ init_category_once ()
}
void
-syms_of_category ()
+syms_of_category (void)
{
Qcategoryp = intern_c_string ("categoryp");
staticpro (&Qcategoryp);
diff --git a/src/category.h b/src/category.h
index b0fca6c7155..e636e32827d 100644
--- a/src/category.h
+++ b/src/category.h
@@ -113,8 +113,8 @@ extern Lisp_Object _temp_category_set;
(!(SINGLE_BYTE_CHAR_P (c1) && SINGLE_BYTE_CHAR_P (c2)) \
&& word_boundary_p (c1, c2))
-extern int word_boundary_p P_ ((int, int));
-extern void set_category_set P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
+extern int word_boundary_p (int, int);
+extern void set_category_set (Lisp_Object, Lisp_Object, Lisp_Object);
/* arch-tag: 309dfe83-c3e2-4d22-8e81-faae5aece0ff
(do not change this comment) */
diff --git a/src/ccl.c b/src/ccl.c
index c33df9e56de..b5a4f26197c 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -862,11 +862,7 @@ struct ccl_prog_stack
static struct ccl_prog_stack ccl_prog_stack_struct[256];
void
-ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
- struct ccl_program *ccl;
- int *source, *destination;
- int src_size, dst_size;
- Lisp_Object charset_list;
+ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size, int dst_size, Lisp_Object charset_list)
{
register int *reg = ccl->reg;
register int ic = ccl->ic;
@@ -1719,7 +1715,7 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
msglen = strlen (msg);
if (dst + msglen <= (dst_bytes ? dst_end : src))
{
- bcopy (msg, dst, msglen);
+ memcpy (dst, msg, msglen);
dst += msglen;
}
@@ -1732,7 +1728,7 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
msglen = strlen (msg);
if (dst + msglen > (dst_bytes ? dst_end : src))
break;
- bcopy (msg, dst, msglen);
+ memcpy (dst, msg, msglen);
dst += msglen;
}
goto ccl_finish;
@@ -1765,7 +1761,7 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
int i = src_end - src;
if (dst_bytes && (dst_end - dst) < i)
i = dst_end - dst;
- bcopy (src, dst, i);
+ memcpy (dst, src, i);
src += i;
dst += i;
#else
@@ -1795,8 +1791,7 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list)
or nil if CCL contains invalid data. */
static Lisp_Object
-resolve_symbol_ccl_program (ccl)
- Lisp_Object ccl;
+resolve_symbol_ccl_program (Lisp_Object ccl)
{
int i, veclen, unresolved = 0;
Lisp_Object result, contents, val;
@@ -1867,9 +1862,7 @@ resolve_symbol_ccl_program (ccl)
symbols, return Qnil. */
static Lisp_Object
-ccl_get_compiled_code (ccl_prog, idx)
- Lisp_Object ccl_prog;
- int *idx;
+ccl_get_compiled_code (Lisp_Object ccl_prog, int *idx)
{
Lisp_Object val, slot;
@@ -1910,9 +1903,7 @@ ccl_get_compiled_code (ccl_prog, idx)
If CCL_PROG is nil, we just reset the structure pointed by CCL. */
int
-setup_ccl_program (ccl, ccl_prog)
- struct ccl_program *ccl;
- Lisp_Object ccl_prog;
+setup_ccl_program (struct ccl_program *ccl, Lisp_Object ccl_prog)
{
int i;
@@ -1953,8 +1944,7 @@ setup_ccl_program (ccl, ccl_prog)
/* Check if CCL is updated or not. If not, re-setup members of CCL. */
int
-check_ccl_update (ccl)
- struct ccl_program *ccl;
+check_ccl_update (struct ccl_program *ccl)
{
Lisp_Object slot, ccl_prog;
@@ -1978,8 +1968,7 @@ check_ccl_update (ccl)
DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0,
doc: /* Return t if OBJECT is a CCL program name or a compiled CCL program code.
See the documentation of `define-ccl-program' for the detail of CCL program. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
Lisp_Object val;
@@ -2013,8 +2002,7 @@ the corresponding register after the execution.
See the documentation of `define-ccl-program' for a definition of CCL
programs. */)
- (ccl_prog, reg)
- Lisp_Object ccl_prog, reg;
+ (Lisp_Object ccl_prog, Lisp_Object reg)
{
struct ccl_program ccl;
int i;
@@ -2068,8 +2056,7 @@ is a unibyte string. By default it is a multibyte string.
See the documentation of `define-ccl-program' for the detail of CCL program.
usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBYTE-P) */)
- (ccl_prog, status, str, contin, unibyte_p)
- Lisp_Object ccl_prog, status, str, contin, unibyte_p;
+ (Lisp_Object ccl_prog, Lisp_Object status, Lisp_Object str, Lisp_Object contin, Lisp_Object unibyte_p)
{
Lisp_Object val;
struct ccl_program ccl;
@@ -2199,8 +2186,7 @@ DEFUN ("register-ccl-program", Fregister_ccl_program, Sregister_ccl_program,
CCL-PROG should be a compiled CCL program (vector), or nil.
If it is nil, just reserve NAME as a CCL program name.
Return index number of the registered CCL program. */)
- (name, ccl_prog)
- Lisp_Object name, ccl_prog;
+ (Lisp_Object name, Lisp_Object ccl_prog)
{
int len = ASIZE (Vccl_program_table);
int idx;
@@ -2275,8 +2261,7 @@ DEFUN ("register-code-conversion-map", Fregister_code_conversion_map,
2, 2, 0,
doc: /* Register SYMBOL as code conversion map MAP.
Return index number of the registered map. */)
- (symbol, map)
- Lisp_Object symbol, map;
+ (Lisp_Object symbol, Lisp_Object map)
{
int len = ASIZE (Vcode_conversion_map_vector);
int i;
@@ -2315,7 +2300,7 @@ Return index number of the registered map. */)
void
-syms_of_ccl ()
+syms_of_ccl (void)
{
staticpro (&Vccl_program_table);
Vccl_program_table = Fmake_vector (make_number (32), Qnil);
diff --git a/src/ccl.h b/src/ccl.h
index 54fc576c7e0..e4414ddf65c 100644
--- a/src/ccl.h
+++ b/src/ccl.h
@@ -97,13 +97,13 @@ extern Lisp_Object Vfont_ccl_encoder_alist;
/* Setup fields of the structure pointed by CCL appropriately for the
execution of ccl program CCL_PROG (symbol or vector). */
-extern int setup_ccl_program P_ ((struct ccl_program *, Lisp_Object));
+extern int setup_ccl_program (struct ccl_program *, Lisp_Object);
/* Check if CCL is updated or not. If not, re-setup members of CCL. */
-extern int check_ccl_update P_ ((struct ccl_program *));
+extern int check_ccl_update (struct ccl_program *);
-extern void ccl_driver P_ ((struct ccl_program *, int *, int *, int, int,
- Lisp_Object));
+extern void ccl_driver (struct ccl_program *, int *, int *, int, int,
+ Lisp_Object);
/* Vector of CCL program names vs corresponding program data. */
extern Lisp_Object Vccl_program_table;
diff --git a/src/character.c b/src/character.c
index 7cd1eedcef4..470157b36ed 100644
--- a/src/character.c
+++ b/src/character.c
@@ -93,8 +93,7 @@ Lisp_Object Vunicode_category_table;
character code if possible. Return the resulting code. */
int
-char_resolve_modifier_mask (c)
- int c;
+char_resolve_modifier_mask (int c)
{
/* A non-ASCII character can't reflect modifier bits to the code. */
if (! ASCII_CHAR_P ((c & ~CHAR_MODIFIER_MASK)))
@@ -143,9 +142,7 @@ char_resolve_modifier_mask (c)
handle them appropriately. */
int
-char_string (c, p)
- unsigned c;
- unsigned char *p;
+char_string (unsigned int c, unsigned char *p)
{
int bytes;
@@ -199,10 +196,7 @@ char_string (c, p)
character) of the multibyte form. */
int
-string_char (p, advanced, len)
- const unsigned char *p;
- const unsigned char **advanced;
- int *len;
+string_char (const unsigned char *p, const unsigned char **advanced, int *len)
{
int c;
const unsigned char *saved_p = p;
@@ -245,9 +239,7 @@ string_char (p, advanced, len)
case, translace C by all tables. */
int
-translate_char (table, c)
- Lisp_Object table;
- int c;
+translate_char (Lisp_Object table, int c)
{
if (CHAR_TABLE_P (table))
{
@@ -272,9 +264,7 @@ translate_char (table, c)
future. */
int
-multibyte_char_to_unibyte (c, rev_tbl)
- int c;
- Lisp_Object rev_tbl;
+multibyte_char_to_unibyte (int c, Lisp_Object rev_tbl)
{
if (c < 0x80)
return c;
@@ -287,8 +277,7 @@ multibyte_char_to_unibyte (c, rev_tbl)
by charset_unibyte. */
int
-multibyte_char_to_unibyte_safe (c)
- int c;
+multibyte_char_to_unibyte_safe (int c)
{
if (c < 0x80)
return c;
@@ -299,15 +288,14 @@ multibyte_char_to_unibyte_safe (c)
DEFUN ("characterp", Fcharacterp, Scharacterp, 1, 2, 0,
doc: /* Return non-nil if OBJECT is a character. */)
- (object, ignore)
- Lisp_Object object, ignore;
+ (Lisp_Object object, Lisp_Object ignore)
{
return (CHARACTERP (object) ? Qt : Qnil);
}
DEFUN ("max-char", Fmax_char, Smax_char, 0, 0, 0,
doc: /* Return the character of the maximum code. */)
- ()
+ (void)
{
return make_number (MAX_CHAR);
}
@@ -315,8 +303,7 @@ DEFUN ("max-char", Fmax_char, Smax_char, 0, 0, 0,
DEFUN ("unibyte-char-to-multibyte", Funibyte_char_to_multibyte,
Sunibyte_char_to_multibyte, 1, 1, 0,
doc: /* Convert the byte CH to multibyte character. */)
- (ch)
- Lisp_Object ch;
+ (Lisp_Object ch)
{
int c;
@@ -332,8 +319,7 @@ DEFUN ("multibyte-char-to-unibyte", Fmultibyte_char_to_unibyte,
Smultibyte_char_to_unibyte, 1, 1, 0,
doc: /* Convert the multibyte character CH to a byte.
If the multibyte character does not represent a byte, return -1. */)
- (ch)
- Lisp_Object ch;
+ (Lisp_Object ch)
{
int cm;
@@ -354,8 +340,7 @@ DEFUN ("char-bytes", Fchar_bytes, Schar_bytes, 1, 1, 0,
doc: /* Return 1 regardless of the argument CHAR.
This is now an obsolete function. We keep it just for backward compatibility.
usage: (char-bytes CHAR) */)
- (ch)
- Lisp_Object ch;
+ (Lisp_Object ch)
{
CHECK_CHARACTER (ch);
return make_number (1);
@@ -366,8 +351,7 @@ DEFUN ("char-width", Fchar_width, Schar_width, 1, 1, 0,
The width is measured by how many columns it occupies on the screen.
Tab is taken to occupy `tab-width' columns.
usage: (char-width CHAR) */)
- (ch)
- Lisp_Object ch;
+ (Lisp_Object ch)
{
Lisp_Object disp;
int c, width;
@@ -446,9 +430,7 @@ c_string_width (const unsigned char *str, int len, int precision, int *nchars, i
occupies on the screen. */
int
-strwidth (str, len)
- unsigned char *str;
- int len;
+strwidth (unsigned char *str, int len)
{
return c_string_width (str, len, -1, NULL, NULL);
}
@@ -461,9 +443,7 @@ strwidth (str, len)
in *NCHARS and *NBYTES respectively. */
int
-lisp_string_width (string, precision, nchars, nbytes)
- Lisp_Object string;
- int precision, *nchars, *nbytes;
+lisp_string_width (Lisp_Object string, int precision, int *nchars, int *nbytes)
{
int len = SCHARS (string);
/* This set multibyte to 0 even if STRING is multibyte when it
@@ -542,8 +522,7 @@ only the base leading-code is considered; the validity of
the following bytes is not checked. Tabs in STRING are always
taken to occupy `tab-width' columns.
usage: (string-width STRING) */)
- (str)
- Lisp_Object str;
+ (Lisp_Object str)
{
Lisp_Object val;
@@ -556,8 +535,7 @@ DEFUN ("char-direction", Fchar_direction, Schar_direction, 1, 1, 0,
doc: /* Return the direction of CHAR.
The returned value is 0 for left-to-right and 1 for right-to-left.
usage: (char-direction CHAR) */)
- (ch)
- Lisp_Object ch;
+ (Lisp_Object ch)
{
int c;
@@ -573,9 +551,7 @@ usage: (char-direction CHAR) */)
nil, we treat each byte as a character. */
EMACS_INT
-chars_in_text (ptr, nbytes)
- const unsigned char *ptr;
- EMACS_INT nbytes;
+chars_in_text (const unsigned char *ptr, EMACS_INT nbytes)
{
/* current_buffer is null at early stages of Emacs initialization. */
if (current_buffer == 0
@@ -591,9 +567,7 @@ chars_in_text (ptr, nbytes)
ignores enable-multibyte-characters. */
EMACS_INT
-multibyte_chars_in_text (ptr, nbytes)
- const unsigned char *ptr;
- EMACS_INT nbytes;
+multibyte_chars_in_text (const unsigned char *ptr, EMACS_INT nbytes)
{
const unsigned char *endp = ptr + nbytes;
int chars = 0;
@@ -618,9 +592,7 @@ multibyte_chars_in_text (ptr, nbytes)
represented by 2-byte in a multibyte text. */
void
-parse_str_as_multibyte (str, len, nchars, nbytes)
- const unsigned char *str;
- int len, *nchars, *nbytes;
+parse_str_as_multibyte (const unsigned char *str, int len, int *nchars, int *nbytes)
{
const unsigned char *endp = str + len;
int n, chars = 0, bytes = 0;
@@ -662,9 +634,7 @@ parse_str_as_multibyte (str, len, nchars, nbytes)
resulting text. */
int
-str_as_multibyte (str, len, nbytes, nchars)
- unsigned char *str;
- int len, nbytes, *nchars;
+str_as_multibyte (unsigned char *str, int len, int nbytes, int *nchars)
{
unsigned char *p = str, *endp = str + nbytes;
unsigned char *to;
@@ -691,7 +661,7 @@ str_as_multibyte (str, len, nbytes, nchars)
to = p;
nbytes = endp - p;
endp = str + len;
- safe_bcopy ((char *) p, (char *) (endp - nbytes), nbytes);
+ memmove (endp - nbytes, p, nbytes);
p = endp - nbytes;
if (nbytes >= MAX_MULTIBYTE_LENGTH)
@@ -740,9 +710,7 @@ str_as_multibyte (str, len, nbytes, nchars)
`str_to_multibyte'. */
int
-parse_str_to_multibyte (str, len)
- unsigned char *str;
- int len;
+parse_str_to_multibyte (unsigned char *str, int len)
{
unsigned char *endp = str + len;
int bytes;
@@ -760,9 +728,7 @@ parse_str_to_multibyte (str, len)
enough. */
int
-str_to_multibyte (str, len, bytes)
- unsigned char *str;
- int len, bytes;
+str_to_multibyte (unsigned char *str, int len, int bytes)
{
unsigned char *p = str, *endp = str + bytes;
unsigned char *to;
@@ -773,7 +739,7 @@ str_to_multibyte (str, len, bytes)
to = p;
bytes = endp - p;
endp = str + len;
- safe_bcopy ((char *) p, (char *) (endp - bytes), bytes);
+ memmove (endp - bytes, p, bytes);
p = endp - bytes;
while (p < endp)
{
@@ -791,9 +757,7 @@ str_to_multibyte (str, len, bytes)
unibyte. */
int
-str_as_unibyte (str, bytes)
- unsigned char *str;
- int bytes;
+str_as_unibyte (unsigned char *str, int bytes)
{
const unsigned char *p = str, *endp = str + bytes;
unsigned char *to;
@@ -835,11 +799,7 @@ str_as_unibyte (str, bytes)
Note: Currently the arg ACCEPT_LATIN_1 is not used. */
EMACS_INT
-str_to_unibyte (src, dst, chars, accept_latin_1)
- const unsigned char *src;
- unsigned char *dst;
- EMACS_INT chars;
- int accept_latin_1;
+str_to_unibyte (const unsigned char *src, unsigned char *dst, EMACS_INT chars, int accept_latin_1)
{
EMACS_INT i;
@@ -859,8 +819,7 @@ str_to_unibyte (src, dst, chars, accept_latin_1)
int
-string_count_byte8 (string)
- Lisp_Object string;
+string_count_byte8 (Lisp_Object string)
{
int multibyte = STRING_MULTIBYTE (string);
int nbytes = SBYTES (string);
@@ -890,8 +849,7 @@ string_count_byte8 (string)
Lisp_Object
-string_escape_byte8 (string)
- Lisp_Object string;
+string_escape_byte8 (Lisp_Object string)
{
int nchars = SCHARS (string);
int nbytes = SBYTES (string);
@@ -957,9 +915,7 @@ DEFUN ("string", Fstring, Sstring, 0, MANY, 0,
doc: /*
Concatenate all the argument characters and make the result a string.
usage: (string &rest CHARACTERS) */)
- (n, args)
- int n;
- Lisp_Object *args;
+ (int n, Lisp_Object *args)
{
int i, c;
unsigned char *buf, *p;
@@ -984,9 +940,7 @@ usage: (string &rest CHARACTERS) */)
DEFUN ("unibyte-string", Funibyte_string, Sunibyte_string, 0, MANY, 0,
doc: /* Concatenate all the argument bytes and make the result a unibyte string.
usage: (unibyte-string &rest BYTES) */)
- (n, args)
- int n;
- Lisp_Object *args;
+ (int n, Lisp_Object *args)
{
int i, c;
unsigned char *buf, *p;
@@ -1016,8 +970,7 @@ DEFUN ("char-resolve-modifiers", Fchar_resolve_modifiers,
The value is a character with modifiers resolved into the character
code. Unresolved modifiers are kept in the value.
usage: (char-resolve-modifiers CHAR) */)
- (character)
- Lisp_Object character;
+ (Lisp_Object character)
{
int c;
@@ -1036,8 +989,7 @@ non-nil, is an index of a target character in the string.
If the current buffer (or STRING) is multibyte, and the target
character is not ASCII nor 8-bit character, an error is signalled. */)
- (position, string)
- Lisp_Object position, string;
+ (Lisp_Object position, Lisp_Object string)
{
int c;
EMACS_INT pos;
@@ -1088,14 +1040,14 @@ character is not ASCII nor 8-bit character, an error is signalled. */)
void
-init_character_once ()
+init_character_once (void)
{
}
#ifdef emacs
void
-syms_of_character ()
+syms_of_character (void)
{
DEFSYM (Qcharacterp, "characterp");
DEFSYM (Qauto_fill_chars, "auto-fill-chars");
diff --git a/src/character.h b/src/character.h
index 429435e28d0..b32dabba12e 100644
--- a/src/character.h
+++ b/src/character.h
@@ -596,24 +596,24 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
: 0)
-extern int char_resolve_modifier_mask P_ ((int));
-extern int char_string P_ ((unsigned, unsigned char *));
-extern int string_char P_ ((const unsigned char *,
- const unsigned char **, int *));
-
-extern int translate_char P_ ((Lisp_Object, int c));
-extern int char_printable_p P_ ((int c));
-extern void parse_str_as_multibyte P_ ((const unsigned char *, int, int *,
- int *));
-extern int parse_str_to_multibyte P_ ((unsigned char *, int));
-extern int str_as_multibyte P_ ((unsigned char *, int, int, int *));
-extern int str_to_multibyte P_ ((unsigned char *, int, int));
-extern int str_as_unibyte P_ ((unsigned char *, int));
-extern EMACS_INT str_to_unibyte P_ ((const unsigned char *, unsigned char *,
- EMACS_INT, int));
-extern int strwidth P_ ((unsigned char *, int));
-extern int c_string_width P_ ((const unsigned char *, int, int, int *, int *));
-extern int lisp_string_width P_ ((Lisp_Object, int, int *, int *));
+extern int char_resolve_modifier_mask (int);
+extern int char_string (unsigned, unsigned char *);
+extern int string_char (const unsigned char *,
+ const unsigned char **, int *);
+
+extern int translate_char (Lisp_Object, int c);
+extern int char_printable_p (int c);
+extern void parse_str_as_multibyte (const unsigned char *, int, int *,
+ int *);
+extern int parse_str_to_multibyte (unsigned char *, int);
+extern int str_as_multibyte (unsigned char *, int, int, int *);
+extern int str_to_multibyte (unsigned char *, int, int);
+extern int str_as_unibyte (unsigned char *, int);
+extern EMACS_INT str_to_unibyte (const unsigned char *, unsigned char *,
+ EMACS_INT, int);
+extern int strwidth (unsigned char *, int);
+extern int c_string_width (const unsigned char *, int, int, int *, int *);
+extern int lisp_string_width (Lisp_Object, int, int *, int *);
extern Lisp_Object Vprintable_chars;
@@ -624,7 +624,7 @@ extern Lisp_Object Vchar_direction_table;
extern Lisp_Object Vchar_unify_table;
extern Lisp_Object Vunicode_category_table;
-extern Lisp_Object string_escape_byte8 P_ ((Lisp_Object));
+extern Lisp_Object string_escape_byte8 (Lisp_Object);
/* Return a translation table of id number ID. */
#define GET_TRANSLATION_TABLE(id) \
@@ -636,18 +636,6 @@ extern Lisp_Object Vauto_fill_chars;
extern Lisp_Object Vchar_script_table;
extern Lisp_Object Vscript_representative_chars;
-/* Copy LEN bytes from FROM to TO. This macro should be used only
- when a caller knows that LEN is short and the obvious copy loop is
- faster than calling bcopy which has some overhead. Copying a
- multibyte sequence of a character is the typical case. */
-
-#define BCOPY_SHORT(from, to, len) \
- do { \
- int i = len; \
- unsigned char *from_p = from, *to_p = to; \
- while (i--) *to_p++ = *from_p++; \
- } while (0)
-
#define DEFSYM(sym, name) \
do { (sym) = intern_c_string ((name)); staticpro (&(sym)); } while (0)
diff --git a/src/charset.c b/src/charset.c
index f83fa994536..84df00da63a 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -129,10 +129,10 @@ Lisp_Object Vcurrent_iso639_language;
/* Defined in chartab.c */
extern void
-map_char_table_for_charset P_ ((void (*c_function) (Lisp_Object, Lisp_Object),
- Lisp_Object function, Lisp_Object table,
- Lisp_Object arg, struct charset *charset,
- unsigned from, unsigned to));
+map_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
+ Lisp_Object function, Lisp_Object table,
+ Lisp_Object arg, struct charset *charset,
+ unsigned from, unsigned to);
#define CODE_POINT_TO_INDEX(charset, code) \
((charset)->code_linear_p \
@@ -267,11 +267,7 @@ struct charset_map_entries
*/
static void
-load_charset_map (charset, entries, n_entries, control_flag)
- struct charset *charset;
- struct charset_map_entries *entries;
- int n_entries;
- int control_flag;
+load_charset_map (struct charset *charset, struct charset_map_entries *entries, int n_entries, int control_flag)
{
Lisp_Object vec, table;
unsigned max_code = CHARSET_MAX_CODE (charset);
@@ -440,9 +436,7 @@ load_charset_map (charset, entries, n_entries, control_flag)
paying attention to comment charcter '#'. */
static INLINE unsigned
-read_hex (fp, eof)
- FILE *fp;
- int *eof;
+read_hex (FILE *fp, int *eof)
{
int c;
unsigned n;
@@ -497,13 +491,10 @@ extern Lisp_Object Qfile_name_handler_alist;
Note that this function uses `openp' to open MAPFILE but ignores
`file-name-handler-alist' to avoid running any Lisp code. */
-extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object));
+extern void add_to_log (char *, Lisp_Object, Lisp_Object);
static void
-load_charset_map_from_file (charset, mapfile, control_flag)
- struct charset *charset;
- Lisp_Object mapfile;
- int control_flag;
+load_charset_map_from_file (struct charset *charset, Lisp_Object mapfile, int control_flag)
{
unsigned min_code = CHARSET_MIN_CODE (charset);
unsigned max_code = CHARSET_MAX_CODE (charset);
@@ -531,7 +522,7 @@ load_charset_map_from_file (charset, mapfile, control_flag)
SAFE_ALLOCA (head, struct charset_map_entries *,
sizeof (struct charset_map_entries));
entries = head;
- bzero (entries, sizeof (struct charset_map_entries));
+ memset (entries, 0, sizeof (struct charset_map_entries));
n_entries = 0;
eof = 0;
@@ -558,7 +549,7 @@ load_charset_map_from_file (charset, mapfile, control_flag)
SAFE_ALLOCA (entries->next, struct charset_map_entries *,
sizeof (struct charset_map_entries));
entries = entries->next;
- bzero (entries, sizeof (struct charset_map_entries));
+ memset (entries, 0, sizeof (struct charset_map_entries));
}
idx = n_entries % 0x10000;
entries->entry[idx].from = from;
@@ -573,10 +564,7 @@ load_charset_map_from_file (charset, mapfile, control_flag)
}
static void
-load_charset_map_from_vector (charset, vec, control_flag)
- struct charset *charset;
- Lisp_Object vec;
- int control_flag;
+load_charset_map_from_vector (struct charset *charset, Lisp_Object vec, int control_flag)
{
unsigned min_code = CHARSET_MIN_CODE (charset);
unsigned max_code = CHARSET_MAX_CODE (charset);
@@ -597,7 +585,7 @@ load_charset_map_from_vector (charset, vec, control_flag)
SAFE_ALLOCA (head, struct charset_map_entries *,
sizeof (struct charset_map_entries));
entries = head;
- bzero (entries, sizeof (struct charset_map_entries));
+ memset (entries, 0, sizeof (struct charset_map_entries));
n_entries = 0;
for (i = 0; i < len; i += 2)
@@ -634,7 +622,7 @@ load_charset_map_from_vector (charset, vec, control_flag)
SAFE_ALLOCA (entries->next, struct charset_map_entries *,
sizeof (struct charset_map_entries));
entries = entries->next;
- bzero (entries, sizeof (struct charset_map_entries));
+ memset (entries, 0, sizeof (struct charset_map_entries));
}
idx = n_entries % 0x10000;
entries->entry[idx].from = from;
@@ -652,9 +640,7 @@ load_charset_map_from_vector (charset, vec, control_flag)
map it is (see the comment of load_charset_map for the detail). */
static void
-load_charset (charset, control_flag)
- struct charset *charset;
- int control_flag;
+load_charset (struct charset *charset, int control_flag)
{
Lisp_Object map;
@@ -677,22 +663,18 @@ load_charset (charset, control_flag)
DEFUN ("charsetp", Fcharsetp, Scharsetp, 1, 1, 0,
doc: /* Return non-nil if and only if OBJECT is a charset.*/)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
return (CHARSETP (object) ? Qt : Qnil);
}
-void map_charset_for_dump P_ ((void (*c_function) (Lisp_Object, Lisp_Object),
- Lisp_Object function, Lisp_Object arg,
- unsigned from, unsigned to));
+void map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object),
+ Lisp_Object function, Lisp_Object arg,
+ unsigned from, unsigned to);
void
-map_charset_for_dump (c_function, function, arg, from, to)
- void (*c_function) (Lisp_Object, Lisp_Object);
- Lisp_Object function, arg;
- unsigned from, to;
+map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object), Lisp_Object function, Lisp_Object arg, unsigned int from, unsigned int to)
{
int from_idx = CODE_POINT_TO_INDEX (temp_charset_work->current, from);
int to_idx = CODE_POINT_TO_INDEX (temp_charset_work->current, to);
@@ -748,12 +730,8 @@ map_charset_for_dump (c_function, function, arg, from, to)
}
void
-map_charset_chars (c_function, function, arg,
- charset, from, to)
- void (*c_function) P_ ((Lisp_Object, Lisp_Object));
- Lisp_Object function, arg;
- struct charset *charset;
- unsigned from, to;
+map_charset_chars (void (*c_function)(Lisp_Object, Lisp_Object), Lisp_Object function,
+ Lisp_Object arg, struct charset *charset, unsigned from, unsigned to)
{
Lisp_Object range;
int partial;
@@ -847,8 +825,7 @@ characters contained in CHARSET.
The optional 4th and 5th arguments FROM-CODE and TO-CODE specify the
range of code points (in CHARSET) of target characters. */)
- (function, charset, arg, from_code, to_code)
- Lisp_Object function, charset, arg, from_code, to_code;
+ (Lisp_Object function, Lisp_Object charset, Lisp_Object arg, Lisp_Object from_code, Lisp_Object to_code)
{
struct charset *cs;
unsigned from, to;
@@ -886,9 +863,7 @@ DEFUN ("define-charset-internal", Fdefine_charset_internal,
Sdefine_charset_internal, charset_arg_max, MANY, 0,
doc: /* For internal use only.
usage: (define-charset-internal ...) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
/* Charset attr vector. */
Lisp_Object attrs;
@@ -952,7 +927,7 @@ usage: (define-charset-internal ...) */)
if (! charset.code_linear_p)
{
charset.code_space_mask = (unsigned char *) xmalloc (256);
- bzero (charset.code_space_mask, 256);
+ memset (charset.code_space_mask, 0, 256);
for (i = 0; i < 4; i++)
for (j = charset.code_space[i * 4]; j <= charset.code_space[i * 4 + 1];
j++)
@@ -1075,7 +1050,7 @@ usage: (define-charset-internal ...) */)
charset.unified_p = 0;
- bzero (charset.fast_map, sizeof (charset.fast_map));
+ memset (charset.fast_map, 0, sizeof (charset.fast_map));
if (! NILP (args[charset_arg_code_offset]))
{
@@ -1208,8 +1183,8 @@ usage: (define-charset-internal ...) */)
struct charset *new_table
= (struct charset *) xmalloc (sizeof (struct charset)
* (charset_table_size + 16));
- bcopy (charset_table, new_table,
- sizeof (struct charset) * charset_table_size);
+ memcpy (new_table, charset_table,
+ sizeof (struct charset) * charset_table_size);
charset_table_size += 16;
charset_table = new_table;
}
@@ -1299,17 +1274,13 @@ usage: (define-charset-internal ...) */)
charset. */
static int
-define_charset_internal (name, dimension, code_space, min_code, max_code,
- iso_final, iso_revision, emacs_mule_id,
- ascii_compatible, supplementary,
- code_offset)
- Lisp_Object name;
- int dimension;
- unsigned char *code_space;
- unsigned min_code, max_code;
- int iso_final, iso_revision, emacs_mule_id;
- int ascii_compatible, supplementary;
- int code_offset;
+define_charset_internal (Lisp_Object name,
+ int dimension,
+ unsigned char *code_space,
+ unsigned min_code, unsigned max_code,
+ int iso_final, int iso_revision, int emacs_mule_id,
+ int ascii_compatible, int supplementary,
+ int code_offset)
{
Lisp_Object args[charset_arg_max];
Lisp_Object plist[14];
@@ -1363,8 +1334,7 @@ define_charset_internal (name, dimension, code_space, min_code, max_code,
DEFUN ("define-charset-alias", Fdefine_charset_alias,
Sdefine_charset_alias, 2, 2, 0,
doc: /* Define ALIAS as an alias for charset CHARSET. */)
- (alias, charset)
- Lisp_Object alias, charset;
+ (Lisp_Object alias, Lisp_Object charset)
{
Lisp_Object attr;
@@ -1377,8 +1347,7 @@ DEFUN ("define-charset-alias", Fdefine_charset_alias,
DEFUN ("charset-plist", Fcharset_plist, Scharset_plist, 1, 1, 0,
doc: /* Return the property list of CHARSET. */)
- (charset)
- Lisp_Object charset;
+ (Lisp_Object charset)
{
Lisp_Object attrs;
@@ -1389,8 +1358,7 @@ DEFUN ("charset-plist", Fcharset_plist, Scharset_plist, 1, 1, 0,
DEFUN ("set-charset-plist", Fset_charset_plist, Sset_charset_plist, 2, 2, 0,
doc: /* Set CHARSET's property list to PLIST. */)
- (charset, plist)
- Lisp_Object charset, plist;
+ (Lisp_Object charset, Lisp_Object plist)
{
Lisp_Object attrs;
@@ -1410,8 +1378,7 @@ the same meaning as the `:unify-map' attribute in the function
`define-charset' (which see).
Optional third argument DEUNIFY, if non-nil, means to de-unify CHARSET. */)
- (charset, unify_map, deunify)
- Lisp_Object charset, unify_map, deunify;
+ (Lisp_Object charset, Lisp_Object unify_map, Lisp_Object deunify)
{
int id;
struct charset *cs;
@@ -1466,8 +1433,7 @@ CHARS is the number of characters in a dimension: 94 or 96.
This final char is for private use, thus the range is `0' (48) .. `?' (63).
If there's no unused final char for the specified kind of charset,
return nil. */)
- (dimension, chars)
- Lisp_Object dimension, chars;
+ (Lisp_Object dimension, Lisp_Object chars)
{
int final_char;
@@ -1484,8 +1450,7 @@ return nil. */)
}
static void
-check_iso_charset_parameter (dimension, chars, final_char)
- Lisp_Object dimension, chars, final_char;
+check_iso_charset_parameter (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char)
{
CHECK_NATNUM (dimension);
CHECK_NATNUM (chars);
@@ -1507,8 +1472,7 @@ DEFUN ("declare-equiv-charset", Fdeclare_equiv_charset, Sdeclare_equiv_charset,
On decoding by an ISO-2022 base coding system, when a charset
specified by DIMENSION, CHARS, and FINAL-CHAR is designated, behave as
if CHARSET is designated instead. */)
- (dimension, chars, final_char, charset)
- Lisp_Object dimension, chars, final_char, charset;
+ (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char, Lisp_Object charset)
{
int id;
int chars_flag;
@@ -1535,8 +1499,7 @@ if CHARSET is designated instead. */)
*/
int
-string_xstring_p (string)
- Lisp_Object string;
+string_xstring_p (Lisp_Object string)
{
const unsigned char *p = SDATA (string);
const unsigned char *endp = p + SBYTES (string);
@@ -1563,11 +1526,7 @@ string_xstring_p (string)
It may lookup a translation table TABLE if supplied. */
static void
-find_charsets_in_text (ptr, nchars, nbytes, charsets, table, multibyte)
- const unsigned char *ptr;
- EMACS_INT nchars, nbytes;
- Lisp_Object charsets, table;
- int multibyte;
+find_charsets_in_text (const unsigned char *ptr, EMACS_INT nchars, EMACS_INT nbytes, Lisp_Object charsets, Lisp_Object table, int multibyte)
{
const unsigned char *pend = ptr + nbytes;
@@ -1611,8 +1570,7 @@ Optional arg TABLE if non-nil is a translation table to look up.
If the current buffer is unibyte, the returned list may contain
only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
- (beg, end, table)
- Lisp_Object beg, end, table;
+ (Lisp_Object beg, Lisp_Object end, Lisp_Object table)
{
Lisp_Object charsets;
EMACS_INT from, from_byte, to, stop, stop_byte;
@@ -1663,8 +1621,7 @@ Optional arg TABLE if non-nil is a translation table to look up.
If STR is unibyte, the returned list may contain
only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
- (str, table)
- Lisp_Object str, table;
+ (Lisp_Object str, Lisp_Object table)
{
Lisp_Object charsets;
int i;
@@ -1689,9 +1646,7 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
value of Vchar_unify_table for C; i.e. it is nil, an integer, or a
charset symbol. */
int
-maybe_unify_char (c, val)
- int c;
- Lisp_Object val;
+maybe_unify_char (int c, Lisp_Object val)
{
struct charset *charset;
@@ -1724,9 +1679,7 @@ maybe_unify_char (c, val)
CHARSET. */
int
-decode_char (charset, code)
- struct charset *charset;
- unsigned code;
+decode_char (struct charset *charset, unsigned int code)
{
int c, char_index;
enum charset_method method = CHARSET_METHOD (charset);
@@ -1805,9 +1758,7 @@ Lisp_Object charset_work;
use CHARSET's strict_max_char instead of max_char. */
unsigned
-encode_char (charset, c)
- struct charset *charset;
- int c;
+encode_char (struct charset *charset, int c)
{
unsigned code;
enum charset_method method = CHARSET_METHOD (charset);
@@ -1921,8 +1872,7 @@ CODE-POINT may be a cons (HIGHER-16-BIT-VALUE . LOWER-16-BIT-VALUE).
Optional argument RESTRICTION specifies a way to map the pair of CCS
and CODE-POINT to a character. Currently not supported and just ignored. */)
- (charset, code_point, restriction)
- Lisp_Object charset, code_point, restriction;
+ (Lisp_Object charset, Lisp_Object code_point, Lisp_Object restriction)
{
int c, id;
unsigned code;
@@ -1952,8 +1902,7 @@ Return nil if CHARSET doesn't include CH.
Optional argument RESTRICTION specifies a way to map CH to a
code-point in CCS. Currently not supported and just ignored. */)
- (ch, charset, restriction)
- Lisp_Object ch, charset, restriction;
+ (Lisp_Object ch, Lisp_Object charset, Lisp_Object restriction)
{
int id;
unsigned code;
@@ -1978,8 +1927,7 @@ DEFUN ("make-char", Fmake_char, Smake_char, 1, 5, 0,
CODE1 through CODE4 are optional, but if you don't supply sufficient
position codes, it is assumed that the minimum code in each dimension
is specified. */)
- (charset, code1, code2, code3, code4)
- Lisp_Object charset, code1, code2, code3, code4;
+ (Lisp_Object charset, Lisp_Object code1, Lisp_Object code2, Lisp_Object code3, Lisp_Object code4)
{
int id, dimension;
struct charset *charsetp;
@@ -2057,10 +2005,7 @@ is specified. */)
Vcharset_ordered_list. */
struct charset *
-char_charset (c, charset_list, code_return)
- int c;
- Lisp_Object charset_list;
- unsigned *code_return;
+char_charset (int c, Lisp_Object charset_list, unsigned int *code_return)
{
int maybe_null = 0;
@@ -2098,8 +2043,7 @@ DEFUN ("split-char", Fsplit_char, Ssplit_char, 1, 1, 0,
The charset is decided by the current priority order of charsets.
A position-code is a byte value of each dimension of the code-point of
CH in the charset. */)
- (ch)
- Lisp_Object ch;
+ (Lisp_Object ch)
{
struct charset *charset;
int c, dimension;
@@ -2129,8 +2073,7 @@ DEFUN ("char-charset", Fchar_charset, Schar_charset, 1, 2, 0,
If optional 2nd arg RESTRICTION is non-nil, it is a list of charsets
from which to find the charset. It may also be a coding system. In
that case, find the charset from what supported by that coding system. */)
- (ch, restriction)
- Lisp_Object ch, restriction;
+ (Lisp_Object ch, Lisp_Object restriction)
{
struct charset *charset;
@@ -2168,8 +2111,7 @@ DEFUN ("charset-after", Fcharset_after, Scharset_after, 0, 1, 0,
Return charset of a character in the current buffer at position POS.
If POS is nil, it defauls to the current point.
If POS is out of range, the value is nil. */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
Lisp_Object ch;
struct charset *charset;
@@ -2191,8 +2133,7 @@ by their DIMENSION, CHARS, and FINAL-CHAR,
whereas Emacs distinguishes them by charset symbol.
See the documentation of the function `charset-info' for the meanings of
DIMENSION, CHARS, and FINAL-CHAR. */)
- (dimension, chars, final_char)
- Lisp_Object dimension, chars, final_char;
+ (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char)
{
int id;
int chars_flag;
@@ -2211,7 +2152,7 @@ DEFUN ("clear-charset-maps", Fclear_charset_maps, Sclear_charset_maps,
Internal use only.
Clear temporary charset mapping tables.
It should be called only from temacs invoked for dumping. */)
- ()
+ (void)
{
if (temp_charset_work)
{
@@ -2229,8 +2170,7 @@ DEFUN ("charset-priority-list", Fcharset_priority_list,
Scharset_priority_list, 0, 1, 0,
doc: /* Return the list of charsets ordered by priority.
HIGHESTP non-nil means just return the highest priority one. */)
- (highestp)
- Lisp_Object highestp;
+ (Lisp_Object highestp)
{
Lisp_Object val = Qnil, list = Vcharset_ordered_list;
@@ -2249,9 +2189,7 @@ DEFUN ("set-charset-priority", Fset_charset_priority, Sset_charset_priority,
1, MANY, 0,
doc: /* Assign higher priority to the charsets given as arguments.
usage: (set-charset-priority &rest charsets) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
Lisp_Object new_head, old_list, arglist[2];
Lisp_Object list_2022, list_emacs_mule;
@@ -2303,8 +2241,7 @@ DEFUN ("charset-id-internal", Fcharset_id_internal, Scharset_id_internal,
0, 1, 0,
doc: /* Internal use only.
Return charset identification number of CHARSET. */)
- (charset)
- Lisp_Object charset;
+ (Lisp_Object charset)
{
int id;
@@ -2314,7 +2251,7 @@ Return charset identification number of CHARSET. */)
void
-init_charset ()
+init_charset (void)
{
Lisp_Object tempdir;
tempdir = Fexpand_file_name (build_string ("charsets"), Vdata_directory);
@@ -2332,7 +2269,7 @@ Please check your installation!\n",
void
-init_charset_once ()
+init_charset_once (void)
{
int i, j, k;
@@ -2353,7 +2290,7 @@ init_charset_once ()
#ifdef emacs
void
-syms_of_charset ()
+syms_of_charset (void)
{
DEFSYM (Qcharsetp, "charsetp");
diff --git a/src/charset.h b/src/charset.h
index 718859929df..095dcefe15b 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -534,17 +534,17 @@ extern int charset_ksc5601;
extern int charset_unibyte;
-extern struct charset *char_charset P_ ((int, Lisp_Object, unsigned *));
-extern Lisp_Object charset_attributes P_ ((int));
+extern struct charset *char_charset (int, Lisp_Object, unsigned *);
+extern Lisp_Object charset_attributes (int);
-extern int maybe_unify_char P_ ((int, Lisp_Object));
-extern int decode_char P_ ((struct charset *, unsigned));
-extern unsigned encode_char P_ ((struct charset *, int));
-extern int string_xstring_p P_ ((Lisp_Object));
+extern int maybe_unify_char (int, Lisp_Object);
+extern int decode_char (struct charset *, unsigned);
+extern unsigned encode_char (struct charset *, int);
+extern int string_xstring_p (Lisp_Object);
-extern void map_charset_chars P_ ((void (*) (Lisp_Object, Lisp_Object),
- Lisp_Object, Lisp_Object,
- struct charset *, unsigned, unsigned));
+extern void map_charset_chars (void (*) (Lisp_Object, Lisp_Object),
+ Lisp_Object, Lisp_Object,
+ struct charset *, unsigned, unsigned);
EXFUN (Funify_charset, 3);
diff --git a/src/chartab.c b/src/chartab.c
index 2b547184b21..fddd8a3d406 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -62,8 +62,7 @@ PURPOSE should be a symbol. If it has a `char-table-extra-slots'
property, the property's value should be an integer between 0 and 10
that specifies how many extra slots the char-table has. Otherwise,
the char-table has no extra slot. */)
- (purpose, init)
- register Lisp_Object purpose, init;
+ (register Lisp_Object purpose, Lisp_Object init)
{
Lisp_Object vector;
Lisp_Object n;
@@ -92,9 +91,7 @@ the char-table has no extra slot. */)
}
static Lisp_Object
-make_sub_char_table (depth, min_char, defalt)
- int depth, min_char;
- Lisp_Object defalt;
+make_sub_char_table (int depth, int min_char, Lisp_Object defalt)
{
Lisp_Object table;
int size = VECSIZE (struct Lisp_Sub_Char_Table) - 1 + chartab_size[depth];
@@ -108,8 +105,7 @@ make_sub_char_table (depth, min_char, defalt)
}
static Lisp_Object
-char_table_ascii (table)
- Lisp_Object table;
+char_table_ascii (Lisp_Object table)
{
Lisp_Object sub;
@@ -123,8 +119,7 @@ char_table_ascii (table)
}
Lisp_Object
-copy_sub_char_table (table)
- Lisp_Object table;
+copy_sub_char_table (Lisp_Object table)
{
Lisp_Object copy;
int depth = XINT (XSUB_CHAR_TABLE (table)->depth);
@@ -148,8 +143,7 @@ copy_sub_char_table (table)
Lisp_Object
-copy_char_table (table)
- Lisp_Object table;
+copy_char_table (Lisp_Object table)
{
Lisp_Object copy;
int size = XCHAR_TABLE (table)->size & PSEUDOVECTOR_SIZE_MASK;
@@ -175,9 +169,7 @@ copy_char_table (table)
}
Lisp_Object
-sub_char_table_ref (table, c)
- Lisp_Object table;
- int c;
+sub_char_table_ref (Lisp_Object table, int c)
{
struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
int depth = XINT (tbl->depth);
@@ -191,9 +183,7 @@ sub_char_table_ref (table, c)
}
Lisp_Object
-char_table_ref (table, c)
- Lisp_Object table;
- int c;
+char_table_ref (Lisp_Object table, int c)
{
struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
Lisp_Object val;
@@ -220,11 +210,7 @@ char_table_ref (table, c)
}
static Lisp_Object
-sub_char_table_ref_and_range (table, c, from, to, defalt)
- Lisp_Object table;
- int c;
- int *from, *to;
- Lisp_Object defalt;
+sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, Lisp_Object defalt)
{
struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
int depth = XINT (tbl->depth);
@@ -286,10 +272,7 @@ sub_char_table_ref_and_range (table, c, from, to, defalt)
1) are different from that of C. */
Lisp_Object
-char_table_ref_and_range (table, c, from, to)
- Lisp_Object table;
- int c;
- int *from, *to;
+char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to)
{
struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
int index = CHARTAB_IDX (c, 0, 0), idx;
@@ -363,10 +346,7 @@ char_table_ref_and_range (table, c, from, to)
static void
-sub_char_table_set (table, c, val)
- Lisp_Object table;
- int c;
- Lisp_Object val;
+sub_char_table_set (Lisp_Object table, int c, Lisp_Object val)
{
struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
int depth = XINT ((tbl)->depth);
@@ -390,10 +370,7 @@ sub_char_table_set (table, c, val)
}
Lisp_Object
-char_table_set (table, c, val)
- Lisp_Object table;
- int c;
- Lisp_Object val;
+char_table_set (Lisp_Object table, int c, Lisp_Object val)
{
struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
@@ -421,12 +398,7 @@ char_table_set (table, c, val)
}
static void
-sub_char_table_set_range (table, depth, min_char, from, to, val)
- Lisp_Object *table;
- int depth;
- int min_char;
- int from, to;
- Lisp_Object val;
+sub_char_table_set_range (Lisp_Object *table, int depth, int min_char, int from, int to, Lisp_Object val)
{
int max_char = min_char + chartab_chars[depth] - 1;
@@ -454,10 +426,7 @@ sub_char_table_set_range (table, depth, min_char, from, to, val)
Lisp_Object
-char_table_set_range (table, from, to, val)
- Lisp_Object table;
- int from, to;
- Lisp_Object val;
+char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val)
{
struct Lisp_Char_Table *tbl = XCHAR_TABLE (table);
Lisp_Object *contents = tbl->contents;
@@ -482,8 +451,7 @@ DEFUN ("char-table-subtype", Fchar_table_subtype, Schar_table_subtype,
1, 1, 0,
doc: /*
Return the subtype of char-table CHAR-TABLE. The value is a symbol. */)
- (char_table)
- Lisp_Object char_table;
+ (Lisp_Object char_table)
{
CHECK_CHAR_TABLE (char_table);
@@ -497,8 +465,7 @@ The value is either nil or another char-table.
If CHAR-TABLE holds nil for a given character,
then the actual applicable value is inherited from the parent char-table
\(or from its parents, if necessary). */)
- (char_table)
- Lisp_Object char_table;
+ (Lisp_Object char_table)
{
CHECK_CHAR_TABLE (char_table);
@@ -509,8 +476,7 @@ DEFUN ("set-char-table-parent", Fset_char_table_parent, Sset_char_table_parent,
2, 2, 0,
doc: /* Set the parent char-table of CHAR-TABLE to PARENT.
Return PARENT. PARENT must be either nil or another char-table. */)
- (char_table, parent)
- Lisp_Object char_table, parent;
+ (Lisp_Object char_table, Lisp_Object parent)
{
Lisp_Object temp;
@@ -533,8 +499,7 @@ Return PARENT. PARENT must be either nil or another char-table. */)
DEFUN ("char-table-extra-slot", Fchar_table_extra_slot, Schar_table_extra_slot,
2, 2, 0,
doc: /* Return the value of CHAR-TABLE's extra-slot number N. */)
- (char_table, n)
- Lisp_Object char_table, n;
+ (Lisp_Object char_table, Lisp_Object n)
{
CHECK_CHAR_TABLE (char_table);
CHECK_NUMBER (n);
@@ -549,8 +514,7 @@ DEFUN ("set-char-table-extra-slot", Fset_char_table_extra_slot,
Sset_char_table_extra_slot,
3, 3, 0,
doc: /* Set CHAR-TABLE's extra-slot number N to VALUE. */)
- (char_table, n, value)
- Lisp_Object char_table, n, value;
+ (Lisp_Object char_table, Lisp_Object n, Lisp_Object value)
{
CHECK_CHAR_TABLE (char_table);
CHECK_NUMBER (n);
@@ -566,8 +530,7 @@ DEFUN ("char-table-range", Fchar_table_range, Schar_table_range,
doc: /* Return the value in CHAR-TABLE for a range of characters RANGE.
RANGE should be nil (for the default value),
a cons of character codes (for characters in the range), or a character code. */)
- (char_table, range)
- Lisp_Object char_table, range;
+ (Lisp_Object char_table, Lisp_Object range)
{
Lisp_Object val;
CHECK_CHAR_TABLE (char_table);
@@ -597,8 +560,7 @@ DEFUN ("set-char-table-range", Fset_char_table_range, Sset_char_table_range,
RANGE should be t (for all characters), nil (for the default value),
a cons of character codes (for characters in the range),
or a character code. Return VALUE. */)
- (char_table, range, value)
- Lisp_Object char_table, range, value;
+ (Lisp_Object char_table, Lisp_Object range, Lisp_Object value)
{
CHECK_CHAR_TABLE (char_table);
if (EQ (range, Qt))
@@ -630,8 +592,7 @@ DEFUN ("set-char-table-default", Fset_char_table_default,
Sset_char_table_default, 3, 3, 0,
doc: /*
This function is obsolete and has no effect. */)
- (char_table, ch, value)
- Lisp_Object char_table, ch, value;
+ (Lisp_Object char_table, Lisp_Object ch, Lisp_Object value)
{
return Qnil;
}
@@ -640,9 +601,7 @@ This function is obsolete and has no effect. */)
integer. If the element is not a character, return CH itself. */
int
-char_table_translate (table, ch)
- Lisp_Object table;
- int ch;
+char_table_translate (Lisp_Object table, int ch)
{
Lisp_Object value;
value = Faref (table, make_number (ch));
@@ -652,8 +611,7 @@ char_table_translate (table, ch)
}
static Lisp_Object
-optimize_sub_char_table (table, test)
- Lisp_Object table, test;
+optimize_sub_char_table (Lisp_Object table, Lisp_Object test)
{
struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
int depth = XINT (tbl->depth);
@@ -686,8 +644,7 @@ DEFUN ("optimize-char-table", Foptimize_char_table, Soptimize_char_table,
doc: /* Optimize CHAR-TABLE.
TEST is the comparison function used to decide whether two entries are
equivalent and can be merged. It defaults to `equal'. */)
- (char_table, test)
- Lisp_Object char_table, test;
+ (Lisp_Object char_table, Lisp_Object test)
{
Lisp_Object elt;
int i;
@@ -723,10 +680,9 @@ equivalent and can be merged. It defaults to `equal'. */)
following characters in TABLE have the same value. */
static Lisp_Object
-map_sub_char_table (c_function, function, table, arg, val, range,
- default_val, parent)
- void (*c_function) P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
- Lisp_Object function, table, arg, val, range, default_val, parent;
+map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object),
+ Lisp_Object function, Lisp_Object table, Lisp_Object arg, Lisp_Object val,
+ Lisp_Object range, Lisp_Object default_val, Lisp_Object parent)
{
/* Pointer to the elements of TABLE. */
Lisp_Object *contents;
@@ -840,9 +796,7 @@ map_sub_char_table (c_function, function, table, arg, val, range,
ARG is passed to C_FUNCTION when that is called. */
void
-map_char_table (c_function, function, table, arg)
- void (*c_function) P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
- Lisp_Object function, table, arg;
+map_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), Lisp_Object function, Lisp_Object table, Lisp_Object arg)
{
Lisp_Object range, val;
struct gcpro gcpro1, gcpro2, gcpro3;
@@ -902,8 +856,7 @@ Call FUNCTION for each character in CHAR-TABLE that has non-nil value.
FUNCTION is called with two arguments--a key and a value.
The key is a character code or a cons of character codes specifying a
range of characters that have the same value. */)
- (function, char_table)
- Lisp_Object function, char_table;
+ (Lisp_Object function, Lisp_Object char_table)
{
CHECK_CHAR_TABLE (char_table);
@@ -913,12 +866,10 @@ range of characters that have the same value. */)
static void
-map_sub_char_table_for_charset (c_function, function, table, arg, range,
- charset, from, to)
- void (*c_function) P_ ((Lisp_Object, Lisp_Object));
- Lisp_Object function, table, arg, range;
- struct charset *charset;
- unsigned from, to;
+map_sub_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
+ Lisp_Object function, Lisp_Object table, Lisp_Object arg,
+ Lisp_Object range, struct charset *charset,
+ unsigned from, unsigned to)
{
struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
int depth = XINT (tbl->depth);
@@ -1000,12 +951,10 @@ map_sub_char_table_for_charset (c_function, function, table, arg, range,
map_charset_chars. */
void
-map_char_table_for_charset (c_function, function, table, arg,
- charset, from, to)
- void (*c_function) P_ ((Lisp_Object, Lisp_Object));
- Lisp_Object function, table, arg;
- struct charset *charset;
- unsigned from, to;
+map_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
+ Lisp_Object function, Lisp_Object table, Lisp_Object arg,
+ struct charset *charset,
+ unsigned from, unsigned to)
{
Lisp_Object range;
int c, i;
@@ -1049,7 +998,7 @@ map_char_table_for_charset (c_function, function, table, arg,
void
-syms_of_chartab ()
+syms_of_chartab (void)
{
defsubr (&Smake_char_table);
defsubr (&Schar_table_parent);
diff --git a/src/cm.c b/src/cm.c
index 73d3791074e..dac6ece7b2d 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -33,8 +33,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* For now, don't try to include termcap.h. On some systems,
configure finds a non-standard termcap.h that the main build
won't find. */
-extern void tputs P_ ((const char *, int, int (*)(int)));
-extern char *tgoto P_ ((const char *, int, int));
+extern void tputs (const char *, int, int (*)(int));
+extern char *tgoto (const char *, int, int);
#define BIG 9999 /* 9999 good on VAXen. For 16 bit machines
use about 2000.... */
@@ -45,8 +45,7 @@ int cost; /* sums up costs */
/* ARGSUSED */
int
-evalcost (c)
- char c;
+evalcost (int c)
{
cost++;
return c;
@@ -56,8 +55,7 @@ evalcost (c)
struct tty_display_info *current_tty;
int
-cmputc (c)
- char c;
+cmputc (int c)
{
if (current_tty->termscript)
putc (c & 0177, current_tty->termscript);
@@ -326,9 +324,7 @@ losecursor ()
#define USECR 3
void
-cmgoto (tty, row, col)
- struct tty_display_info *tty;
- int row, col;
+cmgoto (struct tty_display_info *tty, int row, int col)
{
int homecost,
crcost,
@@ -434,7 +430,7 @@ cmgoto (tty, row, col)
void
Wcm_clear (struct tty_display_info *tty)
{
- bzero (tty->Wcm, sizeof (struct cm));
+ memset (tty->Wcm, 0, sizeof (struct cm));
UP = 0;
BC = 0;
}
diff --git a/src/cm.h b/src/cm.h
index 4364a39962e..0ede5e0cc98 100644
--- a/src/cm.h
+++ b/src/cm.h
@@ -158,17 +158,17 @@ extern char PC; /* Pad character */
#define losecursor(tty) (curX(tty) = -1, curY(tty) = -1)
extern int cost;
-extern int evalcost ();
+extern int evalcost (int c);
#define emacs_tputs(tty, str, affcnt, putc) (current_tty = (tty), tputs (str, affcnt, putc))
extern struct tty_display_info *current_tty;
-extern void cmcheckmagic P_ ((struct tty_display_info *));
-extern int cmputc P_ ((int));
-extern void cmcostinit P_ ((struct tty_display_info *));
-extern void cmgoto P_ ((struct tty_display_info *, int, int));
-extern void Wcm_clear P_ ((struct tty_display_info *));
-extern int Wcm_init P_ ((struct tty_display_info *));
+extern void cmcheckmagic (struct tty_display_info *);
+extern int cmputc (int);
+extern void cmcostinit (struct tty_display_info *);
+extern void cmgoto (struct tty_display_info *, int, int);
+extern void Wcm_clear (struct tty_display_info *);
+extern int Wcm_init (struct tty_display_info *);
/* arch-tag: acc1535a-7136-49d6-b22d-9bc85702251b
(do not change this comment) */
diff --git a/src/cmds.c b/src/cmds.c
index ba89c532be8..81f975a9885 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -48,8 +48,7 @@ extern Lisp_Object Vtranslation_table_for_input;
DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0,
doc: /* Return buffer position N characters after (before if N negative) point. */)
- (n)
- Lisp_Object n;
+ (Lisp_Object n)
{
CHECK_NUMBER (n);
@@ -63,8 +62,7 @@ On reaching end or beginning of buffer, stop and signal error.
Depending on the bidirectional context, the movement may be to the
right or to the left on the screen. This is in contrast with
\\[right-char], which see. */)
- (n)
- Lisp_Object n;
+ (Lisp_Object n)
{
if (NILP (n))
XSETFASTINT (n, 1);
@@ -103,8 +101,7 @@ On attempt to pass beginning or end of buffer, stop and signal error.
Depending on the bidirectional context, the movement may be to the
right or to the left on the screen. This is in contrast with
\\[left-char], which see. */)
- (n)
- Lisp_Object n;
+ (Lisp_Object n)
{
if (NILP (n))
XSETFASTINT (n, 1);
@@ -123,8 +120,7 @@ Returns the count of lines left to move. If moving forward,
that is N - number of lines moved; if backward, N + number moved.
With positive N, a non-empty line at the end counts as one line
successfully moved (for the return value). */)
- (n)
- Lisp_Object n;
+ (Lisp_Object n)
{
int opoint = PT, opoint_byte = PT_BYTE;
int pos, pos_byte;
@@ -173,8 +169,7 @@ does not move. To ignore field boundaries bind
`inhibit-field-text-motion' to t, or use the `forward-line' function
instead. For instance, `(forward-line 0)' does the same thing as
`(beginning-of-line)', except that it ignores field boundaries. */)
- (n)
- Lisp_Object n;
+ (Lisp_Object n)
{
if (NILP (n))
XSETFASTINT (n, 1);
@@ -197,8 +192,7 @@ point to a different line than the original, unconstrained result. If
N is nil or 1, and a rear-sticky field ends at point, the point does
not move. To ignore field boundaries bind `inhibit-field-text-motion'
to t. */)
- (n)
- Lisp_Object n;
+ (Lisp_Object n)
{
int newpos;
@@ -240,9 +234,10 @@ DEFUN ("delete-char", Fdelete_char, Sdelete_char, 1, 2, "p\nP",
doc: /* Delete the following N characters (previous if N is negative).
Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).
Interactively, N is the prefix arg, and KILLFLAG is set if
-N was explicitly specified. */)
- (n, killflag)
- Lisp_Object n, killflag;
+N was explicitly specified.
+
+The command `delete-forward' is preferable for interactive use. */)
+ (Lisp_Object n, Lisp_Object killflag)
{
int pos;
@@ -273,60 +268,6 @@ N was explicitly specified. */)
return Qnil;
}
-DEFUN ("delete-backward-char", Fdelete_backward_char, Sdelete_backward_char,
- 1, 2, "p\nP",
- doc: /* Delete the previous N characters (following if N is negative).
-Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).
-Interactively, N is the prefix arg, and KILLFLAG is set if
-N was explicitly specified.
-This is meant for interactive use only; from Lisp, better use `delete-char'
-with a negated argument. */)
- (n, killflag)
- Lisp_Object n, killflag;
-{
- Lisp_Object value;
- int deleted_special = 0;
- int pos, pos_byte, i;
-
- CHECK_NUMBER (n);
-
- /* See if we are about to delete a tab or newline backwards. */
- pos = PT;
- pos_byte = PT_BYTE;
- for (i = 0; i < XINT (n) && pos_byte > BEGV_BYTE; i++)
- {
- int c;
-
- DEC_BOTH (pos, pos_byte);
- c = FETCH_BYTE (pos_byte);
- if (c == '\t' || c == '\n')
- {
- deleted_special = 1;
- break;
- }
- }
-
- /* In overwrite mode, back over columns while clearing them out,
- unless at end of line. */
- if (XINT (n) > 0
- && ! NILP (current_buffer->overwrite_mode)
- && ! deleted_special
- && ! (PT == ZV || FETCH_BYTE (PT_BYTE) == '\n'))
- {
- int column = (int) current_column (); /* iftc */
-
- value = Fdelete_char (make_number (-XINT (n)), killflag);
- i = column - (int) current_column (); /* iftc */
- Finsert_char (make_number (' '), make_number (i), Qnil);
- /* Whitespace chars are ASCII chars, so we can simply subtract. */
- SET_PT_BOTH (PT - i, PT_BYTE - i);
- }
- else
- value = Fdelete_char (make_number (-XINT (n)), killflag);
-
- return value;
-}
-
static int nonundocount;
/* Note that there's code in command_loop_1 which typically avoids
@@ -338,8 +279,7 @@ Before insertion, `expand-abbrev' is executed if the inserted character does
not have word syntax and the previous character in the buffer does.
After insertion, the value of `auto-fill-function' is called if the
`auto-fill-chars' table has a non-nil value for the inserted character. */)
- (n)
- Lisp_Object n;
+ (Lisp_Object n)
{
int remove_boundary = 1;
CHECK_NUMBER (n);
@@ -408,9 +348,7 @@ After insertion, the value of `auto-fill-function' is called if the
static Lisp_Object Qexpand_abbrev;
int
-internal_self_insert (c, noautofill)
- int c;
- int noautofill;
+internal_self_insert (int c, int noautofill)
{
int hairy = 0;
Lisp_Object tem;
@@ -598,7 +536,7 @@ internal_self_insert (c, noautofill)
/* module initialization */
void
-syms_of_cmds ()
+syms_of_cmds (void)
{
Qkill_backward_chars = intern_c_string ("kill-backward-chars");
staticpro (&Qkill_backward_chars);
@@ -635,13 +573,11 @@ More precisely, a char with closeparen syntax is self-inserted. */);
defsubr (&Send_of_line);
defsubr (&Sdelete_char);
- defsubr (&Sdelete_backward_char);
-
defsubr (&Sself_insert_command);
}
void
-keys_of_cmds ()
+keys_of_cmds (void)
{
int n;
@@ -658,10 +594,8 @@ keys_of_cmds ()
initial_define_key (global_map, Ctl ('A'), "beginning-of-line");
initial_define_key (global_map, Ctl ('B'), "backward-char");
- initial_define_key (global_map, Ctl ('D'), "delete-char");
initial_define_key (global_map, Ctl ('E'), "end-of-line");
initial_define_key (global_map, Ctl ('F'), "forward-char");
- initial_define_key (global_map, 0177, "delete-backward-char");
}
/* arch-tag: 022ba3cd-67f9-4978-9c5d-7d2b18d8644e
diff --git a/src/coding.c b/src/coding.c
index 6435fa1ddb1..dcd31fe9f28 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -154,9 +154,8 @@ STRUCT CODING_SYSTEM
#if 0
static int
-detect_coding_XXX (coding, detect_info)
- struct coding_system *coding;
- struct coding_detection_info *detect_info;
+detect_coding_XXX (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -203,8 +202,7 @@ detect_coding_XXX (coding, detect_info)
#if 0
static void
-decode_coding_XXXX (coding)
- struct coding_system *coding;
+decode_coding_XXXX (struct coding_system *coding)
{
const unsigned char *src = coding->source + coding->consumed;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -261,8 +259,7 @@ decode_coding_XXXX (coding)
Below is a template of these functions. */
#if 0
static void
-encode_coding_XXX (coding)
- struct coding_system *coding;
+encode_coding_XXX (struct coding_system *coding)
{
int multibytep = coding->dst_multibyte;
int *charbuf = coding->charbuf;
@@ -896,80 +893,80 @@ static struct coding_system coding_categories[coding_category_max];
/* Prototypes for static functions. */
-static void record_conversion_result P_ ((struct coding_system *coding,
- enum coding_result_code result));
-static int detect_coding_utf_8 P_ ((struct coding_system *,
- struct coding_detection_info *info));
-static void decode_coding_utf_8 P_ ((struct coding_system *));
-static int encode_coding_utf_8 P_ ((struct coding_system *));
-
-static int detect_coding_utf_16 P_ ((struct coding_system *,
- struct coding_detection_info *info));
-static void decode_coding_utf_16 P_ ((struct coding_system *));
-static int encode_coding_utf_16 P_ ((struct coding_system *));
-
-static int detect_coding_iso_2022 P_ ((struct coding_system *,
- struct coding_detection_info *info));
-static void decode_coding_iso_2022 P_ ((struct coding_system *));
-static int encode_coding_iso_2022 P_ ((struct coding_system *));
-
-static int detect_coding_emacs_mule P_ ((struct coding_system *,
- struct coding_detection_info *info));
-static void decode_coding_emacs_mule P_ ((struct coding_system *));
-static int encode_coding_emacs_mule P_ ((struct coding_system *));
-
-static int detect_coding_sjis P_ ((struct coding_system *,
- struct coding_detection_info *info));
-static void decode_coding_sjis P_ ((struct coding_system *));
-static int encode_coding_sjis P_ ((struct coding_system *));
-
-static int detect_coding_big5 P_ ((struct coding_system *,
- struct coding_detection_info *info));
-static void decode_coding_big5 P_ ((struct coding_system *));
-static int encode_coding_big5 P_ ((struct coding_system *));
-
-static int detect_coding_ccl P_ ((struct coding_system *,
- struct coding_detection_info *info));
-static void decode_coding_ccl P_ ((struct coding_system *));
-static int encode_coding_ccl P_ ((struct coding_system *));
-
-static void decode_coding_raw_text P_ ((struct coding_system *));
-static int encode_coding_raw_text P_ ((struct coding_system *));
-
-static void coding_set_source P_ ((struct coding_system *));
-static void coding_set_destination P_ ((struct coding_system *));
-static void coding_alloc_by_realloc P_ ((struct coding_system *, EMACS_INT));
-static void coding_alloc_by_making_gap P_ ((struct coding_system *,
- EMACS_INT, EMACS_INT));
-static unsigned char *alloc_destination P_ ((struct coding_system *,
- EMACS_INT, unsigned char *));
-static void setup_iso_safe_charsets P_ ((Lisp_Object));
-static unsigned char *encode_designation_at_bol P_ ((struct coding_system *,
- int *, int *,
- unsigned char *));
-static int detect_eol P_ ((const unsigned char *,
- EMACS_INT, enum coding_category));
-static Lisp_Object adjust_coding_eol_type P_ ((struct coding_system *, int));
-static void decode_eol P_ ((struct coding_system *));
-static Lisp_Object get_translation_table P_ ((Lisp_Object, int, int *));
-static Lisp_Object get_translation P_ ((Lisp_Object, int *, int *));
-static int produce_chars P_ ((struct coding_system *, Lisp_Object, int));
-static INLINE void produce_charset P_ ((struct coding_system *, int *,
- EMACS_INT));
-static void produce_annotation P_ ((struct coding_system *, EMACS_INT));
-static int decode_coding P_ ((struct coding_system *));
-static INLINE int *handle_composition_annotation P_ ((EMACS_INT, EMACS_INT,
- struct coding_system *,
- int *, EMACS_INT *));
-static INLINE int *handle_charset_annotation P_ ((EMACS_INT, EMACS_INT,
- struct coding_system *,
- int *, EMACS_INT *));
-static void consume_chars P_ ((struct coding_system *, Lisp_Object, int));
-static int encode_coding P_ ((struct coding_system *));
-static Lisp_Object make_conversion_work_buffer P_ ((int));
-static Lisp_Object code_conversion_restore P_ ((Lisp_Object));
-static INLINE int char_encodable_p P_ ((int, Lisp_Object));
-static Lisp_Object make_subsidiaries P_ ((Lisp_Object));
+static void record_conversion_result (struct coding_system *coding,
+ enum coding_result_code result);
+static int detect_coding_utf_8 (struct coding_system *,
+ struct coding_detection_info *info);
+static void decode_coding_utf_8 (struct coding_system *);
+static int encode_coding_utf_8 (struct coding_system *);
+
+static int detect_coding_utf_16 (struct coding_system *,
+ struct coding_detection_info *info);
+static void decode_coding_utf_16 (struct coding_system *);
+static int encode_coding_utf_16 (struct coding_system *);
+
+static int detect_coding_iso_2022 (struct coding_system *,
+ struct coding_detection_info *info);
+static void decode_coding_iso_2022 (struct coding_system *);
+static int encode_coding_iso_2022 (struct coding_system *);
+
+static int detect_coding_emacs_mule (struct coding_system *,
+ struct coding_detection_info *info);
+static void decode_coding_emacs_mule (struct coding_system *);
+static int encode_coding_emacs_mule (struct coding_system *);
+
+static int detect_coding_sjis (struct coding_system *,
+ struct coding_detection_info *info);
+static void decode_coding_sjis (struct coding_system *);
+static int encode_coding_sjis (struct coding_system *);
+
+static int detect_coding_big5 (struct coding_system *,
+ struct coding_detection_info *info);
+static void decode_coding_big5 (struct coding_system *);
+static int encode_coding_big5 (struct coding_system *);
+
+static int detect_coding_ccl (struct coding_system *,
+ struct coding_detection_info *info);
+static void decode_coding_ccl (struct coding_system *);
+static int encode_coding_ccl (struct coding_system *);
+
+static void decode_coding_raw_text (struct coding_system *);
+static int encode_coding_raw_text (struct coding_system *);
+
+static void coding_set_source (struct coding_system *);
+static void coding_set_destination (struct coding_system *);
+static void coding_alloc_by_realloc (struct coding_system *, EMACS_INT);
+static void coding_alloc_by_making_gap (struct coding_system *,
+ EMACS_INT, EMACS_INT);
+static unsigned char *alloc_destination (struct coding_system *,
+ EMACS_INT, unsigned char *);
+static void setup_iso_safe_charsets (Lisp_Object);
+static unsigned char *encode_designation_at_bol (struct coding_system *,
+ int *, int *,
+ unsigned char *);
+static int detect_eol (const unsigned char *,
+ EMACS_INT, enum coding_category);
+static Lisp_Object adjust_coding_eol_type (struct coding_system *, int);
+static void decode_eol (struct coding_system *);
+static Lisp_Object get_translation_table (Lisp_Object, int, int *);
+static Lisp_Object get_translation (Lisp_Object, int *, int *);
+static int produce_chars (struct coding_system *, Lisp_Object, int);
+static INLINE void produce_charset (struct coding_system *, int *,
+ EMACS_INT);
+static void produce_annotation (struct coding_system *, EMACS_INT);
+static int decode_coding (struct coding_system *);
+static INLINE int *handle_composition_annotation (EMACS_INT, EMACS_INT,
+ struct coding_system *,
+ int *, EMACS_INT *);
+static INLINE int *handle_charset_annotation (EMACS_INT, EMACS_INT,
+ struct coding_system *,
+ int *, EMACS_INT *);
+static void consume_chars (struct coding_system *, Lisp_Object, int);
+static int encode_coding (struct coding_system *);
+static Lisp_Object make_conversion_work_buffer (int);
+static Lisp_Object code_conversion_restore (Lisp_Object);
+static INLINE int char_encodable_p (int, Lisp_Object);
+static Lisp_Object make_subsidiaries (Lisp_Object);
static void
record_conversion_result (struct coding_system *coding,
@@ -1106,8 +1103,7 @@ record_conversion_result (struct coding_system *coding,
static void
-coding_set_source (coding)
- struct coding_system *coding;
+coding_set_source (struct coding_system *coding)
{
if (BUFFERP (coding->src_object))
{
@@ -1129,8 +1125,7 @@ coding_set_source (coding)
}
static void
-coding_set_destination (coding)
- struct coding_system *coding;
+coding_set_destination (struct coding_system *coding)
{
if (BUFFERP (coding->dst_object))
{
@@ -1159,9 +1154,7 @@ coding_set_destination (coding)
static void
-coding_alloc_by_realloc (coding, bytes)
- struct coding_system *coding;
- EMACS_INT bytes;
+coding_alloc_by_realloc (struct coding_system *coding, EMACS_INT bytes)
{
coding->destination = (unsigned char *) xrealloc (coding->destination,
coding->dst_bytes + bytes);
@@ -1169,9 +1162,8 @@ coding_alloc_by_realloc (coding, bytes)
}
static void
-coding_alloc_by_making_gap (coding, gap_head_used, bytes)
- struct coding_system *coding;
- EMACS_INT gap_head_used, bytes;
+coding_alloc_by_making_gap (struct coding_system *coding,
+ EMACS_INT gap_head_used, EMACS_INT bytes)
{
if (EQ (coding->src_object, coding->dst_object))
{
@@ -1200,10 +1192,8 @@ coding_alloc_by_making_gap (coding, gap_head_used, bytes)
static unsigned char *
-alloc_destination (coding, nbytes, dst)
- struct coding_system *coding;
- EMACS_INT nbytes;
- unsigned char *dst;
+alloc_destination (struct coding_system *coding, EMACS_INT nbytes,
+ unsigned char *dst)
{
EMACS_INT offset = dst - coding->destination;
@@ -1301,9 +1291,8 @@ alloc_destination (coding, nbytes, dst)
#define UTF_8_BOM_3 0xBF
static int
-detect_coding_utf_8 (coding, detect_info)
- struct coding_system *coding;
- struct coding_detection_info *detect_info;
+detect_coding_utf_8 (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -1386,8 +1375,7 @@ detect_coding_utf_8 (coding, detect_info)
static void
-decode_coding_utf_8 (coding)
- struct coding_system *coding;
+decode_coding_utf_8 (struct coding_system *coding)
{
const unsigned char *src = coding->source + coding->consumed;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -1435,8 +1423,6 @@ decode_coding_utf_8 (coding)
}
CODING_UTF_8_BOM (coding) = utf_without_bom;
-
-
while (1)
{
int c, c1, c2, c3, c4, c5;
@@ -1459,7 +1445,7 @@ decode_coding_utf_8 (coding)
{
c = - c1;
}
- else if (UTF_8_1_OCTET_P(c1))
+ else if (UTF_8_1_OCTET_P (c1))
{
if (eol_crlf && c1 == '\r')
ONE_MORE_BYTE (byte_after_cr);
@@ -1543,8 +1529,7 @@ decode_coding_utf_8 (coding)
static int
-encode_coding_utf_8 (coding)
- struct coding_system *coding;
+encode_coding_utf_8 (struct coding_system *coding)
{
int multibytep = coding->dst_multibyte;
int *charbuf = coding->charbuf;
@@ -1623,9 +1608,8 @@ encode_coding_utf_8 (coding)
static int
-detect_coding_utf_16 (coding, detect_info)
- struct coding_system *coding;
- struct coding_detection_info *detect_info;
+detect_coding_utf_16 (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base = src;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -1708,8 +1692,7 @@ detect_coding_utf_16 (coding, detect_info)
}
static void
-decode_coding_utf_16 (coding)
- struct coding_system *coding;
+decode_coding_utf_16 (struct coding_system *coding)
{
const unsigned char *src = coding->source + coding->consumed;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -1837,8 +1820,7 @@ decode_coding_utf_16 (coding)
}
static int
-encode_coding_utf_16 (coding)
- struct coding_system *coding;
+encode_coding_utf_16 (struct coding_system *coding)
{
int multibytep = coding->dst_multibyte;
int *charbuf = coding->charbuf;
@@ -1979,9 +1961,8 @@ char emacs_mule_bytes[256];
else return 0. */
static int
-detect_coding_emacs_mule (coding, detect_info)
- struct coding_system *coding;
- struct coding_detection_info *detect_info;
+detect_coding_emacs_mule (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -2069,11 +2050,9 @@ detect_coding_emacs_mule (coding, detect_info)
-1. If SRC is too short, return -2. */
int
-emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status)
- struct coding_system *coding;
- const unsigned char *src;
- int *nbytes, *nchars, *id;
- struct composition_status *cmp_status;
+emacs_mule_char (struct coding_system *coding, const unsigned char *src,
+ int *nbytes, int *nchars, int *id,
+ struct composition_status *cmp_status)
{
const unsigned char *src_end = coding->source + coding->src_bytes;
const unsigned char *src_base = src;
@@ -2210,7 +2189,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status)
(3) alt&rule composition: 0x80 0xF5 BYTES CHARS | ALT RULE ... ALT CHAR ...
and these old form:
-
+
(4) relative composition: 0x80 | MSEQ ... MSEQ
(5) rulebase composition: 0x80 0xFF | MSEQ MRULE ... MSEQ
@@ -2391,9 +2370,8 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status)
static int
-emacs_mule_finish_composition (charbuf, cmp_status)
- int *charbuf;
- struct composition_status *cmp_status;
+emacs_mule_finish_composition (int *charbuf,
+ struct composition_status *cmp_status)
{
int idx = - cmp_status->length;
int new_chars;
@@ -2448,8 +2426,7 @@ emacs_mule_finish_composition (charbuf, cmp_status)
static void
-decode_coding_emacs_mule (coding)
- struct coding_system *coding;
+decode_coding_emacs_mule (struct coding_system *coding)
{
const unsigned char *src = coding->source + coding->consumed;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -2713,8 +2690,7 @@ decode_coding_emacs_mule (coding)
static int
-encode_coding_emacs_mule (coding)
- struct coding_system *coding;
+encode_coding_emacs_mule (struct coding_system *coding)
{
int multibytep = coding->dst_multibyte;
int *charbuf = coding->charbuf;
@@ -3007,8 +2983,7 @@ enum iso_code_class_type iso_code_class[256];
(CODING_ISO_INITIAL (&coding_categories[category], 1) >= 0)
static void
-setup_iso_safe_charsets (attrs)
- Lisp_Object attrs;
+setup_iso_safe_charsets (Lisp_Object attrs)
{
Lisp_Object charset_list, safe_charsets;
Lisp_Object request;
@@ -3076,9 +3051,8 @@ setup_iso_safe_charsets (attrs)
If it is, return 1, else return 0. */
static int
-detect_coding_iso_2022 (coding, detect_info)
- struct coding_system *coding;
- struct coding_detection_info *detect_info;
+detect_coding_iso_2022 (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base = src;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -3442,12 +3416,10 @@ detect_coding_iso_2022 (coding, detect_info)
/* Finish the current composition as invalid. */
-static int finish_composition P_ ((int *, struct composition_status *));
+static int finish_composition (int *, struct composition_status *);
static int
-finish_composition (charbuf, cmp_status)
- int *charbuf;
- struct composition_status *cmp_status;
+finish_composition (int *charbuf, struct composition_status *cmp_status)
{
int idx = - cmp_status->length;
int new_chars;
@@ -3584,8 +3556,7 @@ finish_composition (charbuf, cmp_status)
/* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */
static void
-decode_coding_iso_2022 (coding)
- struct coding_system *coding;
+decode_coding_iso_2022 (struct coding_system *coding)
{
const unsigned char *src = coding->source + coding->consumed;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -4317,7 +4288,7 @@ decode_coding_iso_2022 (coding)
#define ENCODE_ISO_CHARACTER(charset, c) \
do { \
- int code = ENCODE_CHAR ((charset),(c)); \
+ int code = ENCODE_CHAR ((charset), (c)); \
\
if (CHARSET_DIMENSION (charset) == 1) \
ENCODE_ISO_CHARACTER_DIMENSION1 ((charset), code); \
@@ -4331,11 +4302,9 @@ decode_coding_iso_2022 (coding)
Return new DST. */
unsigned char *
-encode_invocation_designation (charset, coding, dst, p_nchars)
- struct charset *charset;
- struct coding_system *coding;
- unsigned char *dst;
- int *p_nchars;
+encode_invocation_designation (struct charset *charset,
+ struct coding_system *coding,
+ unsigned char *dst, int *p_nchars)
{
int multibytep = coding->dst_multibyte;
int produced_chars = *p_nchars;
@@ -4447,10 +4416,8 @@ encode_invocation_designation (charset, coding, dst, p_nchars)
find all the necessary designations. */
static unsigned char *
-encode_designation_at_bol (coding, charbuf, charbuf_end, dst)
- struct coding_system *coding;
- int *charbuf, *charbuf_end;
- unsigned char *dst;
+encode_designation_at_bol (struct coding_system *coding, int *charbuf,
+ int *charbuf_end, unsigned char *dst)
{
struct charset *charset;
/* Table of charsets to be designated to each graphic register. */
@@ -4500,8 +4467,7 @@ encode_designation_at_bol (coding, charbuf, charbuf_end, dst)
/* See the above "GENERAL NOTES on `encode_coding_XXX ()' functions". */
static int
-encode_coding_iso_2022 (coding)
- struct coding_system *coding;
+encode_coding_iso_2022 (struct coding_system *coding)
{
int multibytep = coding->dst_multibyte;
int *charbuf = coding->charbuf;
@@ -4691,9 +4657,8 @@ encode_coding_iso_2022 (coding)
CATEGORY_MASK_SJIS, else return 0. */
static int
-detect_coding_sjis (coding, detect_info)
- struct coding_system *coding;
- struct coding_detection_info *detect_info;
+detect_coding_sjis (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -4749,9 +4714,8 @@ detect_coding_sjis (coding, detect_info)
CATEGORY_MASK_BIG5, else return 0. */
static int
-detect_coding_big5 (coding, detect_info)
- struct coding_system *coding;
- struct coding_detection_info *detect_info;
+detect_coding_big5 (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -4797,8 +4761,7 @@ detect_coding_big5 (coding, detect_info)
If SJIS_P is 1, decode SJIS text, else decode BIG5 test. */
static void
-decode_coding_sjis (coding)
- struct coding_system *coding;
+decode_coding_sjis (struct coding_system *coding)
{
const unsigned char *src = coding->source + coding->consumed;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -4916,8 +4879,7 @@ decode_coding_sjis (coding)
}
static void
-decode_coding_big5 (coding)
- struct coding_system *coding;
+decode_coding_big5 (struct coding_system *coding)
{
const unsigned char *src = coding->source + coding->consumed;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -5021,8 +4983,7 @@ decode_coding_big5 (coding)
SJIS text, else encode BIG5 text. */
static int
-encode_coding_sjis (coding)
- struct coding_system *coding;
+encode_coding_sjis (struct coding_system *coding)
{
int multibytep = coding->dst_multibyte;
int *charbuf = coding->charbuf;
@@ -5114,8 +5075,7 @@ encode_coding_sjis (coding)
}
static int
-encode_coding_big5 (coding)
- struct coding_system *coding;
+encode_coding_big5 (struct coding_system *coding)
{
int multibytep = coding->dst_multibyte;
int *charbuf = coding->charbuf;
@@ -5193,9 +5153,8 @@ encode_coding_big5 (coding)
CATEGORY_MASK_CCL, else return 0. */
static int
-detect_coding_ccl (coding, detect_info)
- struct coding_system *coding;
- struct coding_detection_info *detect_info;
+detect_coding_ccl (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -5234,8 +5193,7 @@ detect_coding_ccl (coding, detect_info)
}
static void
-decode_coding_ccl (coding)
- struct coding_system *coding;
+decode_coding_ccl (struct coding_system *coding)
{
const unsigned char *src = coding->source + coding->consumed;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -5304,8 +5262,7 @@ decode_coding_ccl (coding)
}
static int
-encode_coding_ccl (coding)
- struct coding_system *coding;
+encode_coding_ccl (struct coding_system *coding)
{
struct ccl_program *ccl = &coding->spec.ccl->ccl;
int multibytep = coding->dst_multibyte;
@@ -5374,8 +5331,7 @@ encode_coding_ccl (coding)
/* See the above "GENERAL NOTES on `decode_coding_XXX ()' functions". */
static void
-decode_coding_raw_text (coding)
- struct coding_system *coding;
+decode_coding_raw_text (struct coding_system *coding)
{
int eol_crlf =
!inhibit_eol_conversion && EQ (CODING_ID_EOL_TYPE (coding->id), Qdos);
@@ -5394,8 +5350,7 @@ decode_coding_raw_text (coding)
}
static int
-encode_coding_raw_text (coding)
- struct coding_system *coding;
+encode_coding_raw_text (struct coding_system *coding)
{
int multibytep = coding->dst_multibyte;
int *charbuf = coding->charbuf;
@@ -5478,9 +5433,8 @@ encode_coding_raw_text (coding)
is, return 1, else return 0. */
static int
-detect_coding_charset (coding, detect_info)
- struct coding_system *coding;
- struct coding_detection_info *detect_info;
+detect_coding_charset (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -5582,8 +5536,7 @@ detect_coding_charset (coding, detect_info)
}
static void
-decode_coding_charset (coding)
- struct coding_system *coding;
+decode_coding_charset (struct coding_system *coding)
{
const unsigned char *src = coding->source + coding->consumed;
const unsigned char *src_end = coding->source + coding->src_bytes;
@@ -5711,8 +5664,7 @@ decode_coding_charset (coding)
}
static int
-encode_coding_charset (coding)
- struct coding_system *coding;
+encode_coding_charset (struct coding_system *coding)
{
int multibytep = coding->dst_multibyte;
int *charbuf = coding->charbuf;
@@ -5782,9 +5734,7 @@ encode_coding_charset (coding)
CODING_SYSTEM is invalid, signal an error. */
void
-setup_coding_system (coding_system, coding)
- Lisp_Object coding_system;
- struct coding_system *coding;
+setup_coding_system (Lisp_Object coding_system, struct coding_system *coding)
{
Lisp_Object attrs;
Lisp_Object eol_type;
@@ -5987,8 +5937,7 @@ setup_coding_system (coding_system, coding)
/* Return a list of charsets supported by CODING. */
Lisp_Object
-coding_charset_list (coding)
- struct coding_system *coding;
+coding_charset_list (struct coding_system *coding)
{
Lisp_Object attrs, charset_list;
@@ -6011,8 +5960,7 @@ coding_charset_list (coding)
/* Return a list of charsets supported by CODING-SYSTEM. */
Lisp_Object
-coding_system_charset_list (coding_system)
- Lisp_Object coding_system;
+coding_system_charset_list (Lisp_Object coding_system)
{
int id;
Lisp_Object attrs, charset_list;
@@ -6045,8 +5993,7 @@ coding_system_charset_list (coding_system)
eol_type as CODING-SYSTEM. */
Lisp_Object
-raw_text_coding_system (coding_system)
- Lisp_Object coding_system;
+raw_text_coding_system (Lisp_Object coding_system)
{
Lisp_Object spec, attrs;
Lisp_Object eol_type, raw_text_eol_type;
@@ -6077,8 +6024,7 @@ raw_text_coding_system (coding_system)
(system_eol_type). */
Lisp_Object
-coding_inherit_eol_type (coding_system, parent)
- Lisp_Object coding_system, parent;
+coding_inherit_eol_type (Lisp_Object coding_system, Lisp_Object parent)
{
Lisp_Object spec, eol_type;
@@ -6233,10 +6179,8 @@ coding_inherit_eol_type (coding_system, parent)
#define MAX_EOL_CHECK_COUNT 3
static int
-detect_eol (source, src_bytes, category)
- const unsigned char *source;
- EMACS_INT src_bytes;
- enum coding_category category;
+detect_eol (const unsigned char *source, EMACS_INT src_bytes,
+ enum coding_category category)
{
const unsigned char *src = source, *src_end = src + src_bytes;
unsigned char c;
@@ -6334,9 +6278,7 @@ detect_eol (source, src_bytes, category)
static Lisp_Object
-adjust_coding_eol_type (coding, eol_seen)
- struct coding_system *coding;
- int eol_seen;
+adjust_coding_eol_type (struct coding_system *coding, int eol_seen)
{
Lisp_Object eol_type;
@@ -6364,8 +6306,7 @@ adjust_coding_eol_type (coding, eol_seen)
system. */
void
-detect_coding (coding)
- struct coding_system *coding;
+detect_coding (struct coding_system *coding)
{
const unsigned char *src, *src_end;
int saved_mode = coding->mode;
@@ -6544,8 +6485,7 @@ detect_coding (coding)
static void
-decode_eol (coding)
- struct coding_system *coding;
+decode_eol (struct coding_system *coding)
{
Lisp_Object eol_type;
unsigned char *p, *pbeg, *pend;
@@ -6610,7 +6550,7 @@ decode_eol (coding)
for (p = pend - 2; p >= pbeg; p--)
if (*p == '\r')
{
- safe_bcopy ((char *) (p + 1), (char *) p, pend-- - p - 1);
+ memmove (p, p + 1, pend-- - p - 1);
n++;
}
}
@@ -6647,9 +6587,7 @@ decode_eol (coding)
decoding (ENCODEP is zero). */
static Lisp_Object
-get_translation_table (attrs, encodep, max_lookup)
- Lisp_Object attrs;
- int encodep, *max_lookup;
+get_translation_table (Lisp_Object attrs, int encodep, int *max_lookup)
{
Lisp_Object standard, translation_table;
Lisp_Object val;
@@ -6751,9 +6689,7 @@ get_translation_table (attrs, encodep, max_lookup)
If BUF is too short to lookup characters in FROM, return Qt. */
static Lisp_Object
-get_translation (trans, buf, buf_end)
- Lisp_Object trans;
- int *buf, *buf_end;
+get_translation (Lisp_Object trans, int *buf, int *buf_end)
{
if (INTEGERP (trans))
@@ -6780,10 +6716,8 @@ get_translation (trans, buf, buf_end)
static int
-produce_chars (coding, translation_table, last_block)
- struct coding_system *coding;
- Lisp_Object translation_table;
- int last_block;
+produce_chars (struct coding_system *coding, Lisp_Object translation_table,
+ int last_block)
{
unsigned char *dst = coding->destination + coding->produced;
unsigned char *dst_end = coding->destination + coding->dst_bytes;
@@ -6981,10 +6915,7 @@ produce_chars (coding, translation_table, last_block)
*/
static INLINE void
-produce_composition (coding, charbuf, pos)
- struct coding_system *coding;
- int *charbuf;
- EMACS_INT pos;
+produce_composition (struct coding_system *coding, int *charbuf, EMACS_INT pos)
{
int len;
EMACS_INT to;
@@ -7028,10 +6959,7 @@ produce_composition (coding, charbuf, pos)
*/
static INLINE void
-produce_charset (coding, charbuf, pos)
- struct coding_system *coding;
- int *charbuf;
- EMACS_INT pos;
+produce_charset (struct coding_system *coding, int *charbuf, EMACS_INT pos)
{
EMACS_INT from = pos - charbuf[2];
struct charset *charset = CHARSET_FROM_ID (charbuf[3]);
@@ -7066,9 +6994,7 @@ produce_charset (coding, charbuf, pos)
static void
-produce_annotation (coding, pos)
- struct coding_system *coding;
- EMACS_INT pos;
+produce_annotation (struct coding_system *coding, EMACS_INT pos)
{
int *charbuf = coding->charbuf;
int *charbuf_end = charbuf + coding->charbuf_used;
@@ -7123,8 +7049,7 @@ produce_annotation (coding, pos)
*/
static int
-decode_coding (coding)
- struct coding_system *coding;
+decode_coding (struct coding_system *coding)
{
Lisp_Object attrs;
Lisp_Object undo_list;
@@ -7262,11 +7187,9 @@ decode_coding (coding)
return BUF. */
static INLINE int *
-handle_composition_annotation (pos, limit, coding, buf, stop)
- EMACS_INT pos, limit;
- struct coding_system *coding;
- int *buf;
- EMACS_INT *stop;
+handle_composition_annotation (EMACS_INT pos, EMACS_INT limit,
+ struct coding_system *coding, int *buf,
+ EMACS_INT *stop)
{
EMACS_INT start, end;
Lisp_Object prop;
@@ -7347,11 +7270,9 @@ handle_composition_annotation (pos, limit, coding, buf, stop)
property value is non-nil (limiting by LIMIT), and return BUF. */
static INLINE int *
-handle_charset_annotation (pos, limit, coding, buf, stop)
- EMACS_INT pos, limit;
- struct coding_system *coding;
- int *buf;
- EMACS_INT *stop;
+handle_charset_annotation (EMACS_INT pos, EMACS_INT limit,
+ struct coding_system *coding, int *buf,
+ EMACS_INT *stop)
{
Lisp_Object val, next;
int id;
@@ -7371,10 +7292,8 @@ handle_charset_annotation (pos, limit, coding, buf, stop)
static void
-consume_chars (coding, translation_table, max_lookup)
- struct coding_system *coding;
- Lisp_Object translation_table;
- int max_lookup;
+consume_chars (struct coding_system *coding, Lisp_Object translation_table,
+ int max_lookup)
{
int *buf = coding->charbuf;
int *buf_end = coding->charbuf + coding->charbuf_size;
@@ -7530,8 +7449,7 @@ consume_chars (coding, translation_table, max_lookup)
memory area specified by CODING->destination. */
static int
-encode_coding (coding)
- struct coding_system *coding;
+encode_coding (struct coding_system *coding)
{
Lisp_Object attrs;
Lisp_Object translation_table;
@@ -7595,8 +7513,7 @@ static int reused_workbuf_in_use;
multibyteness of returning buffer. */
static Lisp_Object
-make_conversion_work_buffer (multibyte)
- int multibyte;
+make_conversion_work_buffer (int multibyte)
{
Lisp_Object name, workbuf;
struct buffer *current;
@@ -7628,8 +7545,7 @@ make_conversion_work_buffer (multibyte)
static Lisp_Object
-code_conversion_restore (arg)
- Lisp_Object arg;
+code_conversion_restore (Lisp_Object arg)
{
Lisp_Object current, workbuf;
struct gcpro gcpro1;
@@ -7650,8 +7566,7 @@ code_conversion_restore (arg)
}
Lisp_Object
-code_conversion_save (with_work_buf, multibyte)
- int with_work_buf, multibyte;
+code_conversion_save (int with_work_buf, int multibyte)
{
Lisp_Object workbuf = Qnil;
@@ -7663,11 +7578,10 @@ code_conversion_save (with_work_buf, multibyte)
}
int
-decode_coding_gap (coding, chars, bytes)
- struct coding_system *coding;
- EMACS_INT chars, bytes;
+decode_coding_gap (struct coding_system *coding,
+ EMACS_INT chars, EMACS_INT bytes)
{
- int count = specpdl_ptr - specpdl;
+ int count = SPECPDL_INDEX ();
Lisp_Object attrs;
code_conversion_save (0, 0);
@@ -7710,11 +7624,10 @@ decode_coding_gap (coding, chars, bytes)
}
int
-encode_coding_gap (coding, chars, bytes)
- struct coding_system *coding;
- EMACS_INT chars, bytes;
+encode_coding_gap (struct coding_system *coding,
+ EMACS_INT chars, EMACS_INT bytes)
{
- int count = specpdl_ptr - specpdl;
+ int count = SPECPDL_INDEX ();
code_conversion_save (0, 0);
@@ -7765,14 +7678,13 @@ encode_coding_gap (coding, chars, bytes)
*/
void
-decode_coding_object (coding, src_object, from, from_byte, to, to_byte,
- dst_object)
- struct coding_system *coding;
- Lisp_Object src_object;
- EMACS_INT from, from_byte, to, to_byte;
- Lisp_Object dst_object;
+decode_coding_object (struct coding_system *coding,
+ Lisp_Object src_object,
+ EMACS_INT from, EMACS_INT from_byte,
+ EMACS_INT to, EMACS_INT to_byte,
+ Lisp_Object dst_object)
{
- int count = specpdl_ptr - specpdl;
+ int count = SPECPDL_INDEX ();
unsigned char *destination;
EMACS_INT dst_bytes;
EMACS_INT chars = to - from;
@@ -7902,7 +7814,7 @@ decode_coding_object (coding, src_object, from, from_byte, to, to_byte,
}
if (BEGV < GPT && GPT < BEGV + coding->produced_char)
move_gap_both (BEGV, BEGV_BYTE);
- bcopy (BEGV_ADDR, destination, coding->produced);
+ memcpy (destination, BEGV_ADDR, coding->produced);
coding->destination = destination;
}
}
@@ -7956,14 +7868,13 @@ decode_coding_object (coding, src_object, from, from_byte, to, to_byte,
void
-encode_coding_object (coding, src_object, from, from_byte, to, to_byte,
- dst_object)
- struct coding_system *coding;
- Lisp_Object src_object;
- EMACS_INT from, from_byte, to, to_byte;
- Lisp_Object dst_object;
+encode_coding_object (struct coding_system *coding,
+ Lisp_Object src_object,
+ EMACS_INT from, EMACS_INT from_byte,
+ EMACS_INT to, EMACS_INT to_byte,
+ Lisp_Object dst_object)
{
- int count = specpdl_ptr - specpdl;
+ int count = SPECPDL_INDEX ();
EMACS_INT chars = to - from;
EMACS_INT bytes = to_byte - from_byte;
Lisp_Object attrs;
@@ -8165,7 +8076,7 @@ encode_coding_object (coding, src_object, from, from_byte, to, to_byte,
Lisp_Object
-preferred_coding_system ()
+preferred_coding_system (void)
{
int id = coding_categories[coding_priorities[0]].id;
@@ -8180,8 +8091,7 @@ DEFUN ("coding-system-p", Fcoding_system_p, Scoding_system_p, 1, 1, 0,
doc: /* Return t if OBJECT is nil or a coding-system.
See the documentation of `define-coding-system' for information
about coding-system objects. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (NILP (object)
|| CODING_SYSTEM_ID (object) >= 0)
@@ -8195,8 +8105,7 @@ about coding-system objects. */)
DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system,
Sread_non_nil_coding_system, 1, 1, 0,
doc: /* Read a coding system from the minibuffer, prompting with string PROMPT. */)
- (prompt)
- Lisp_Object prompt;
+ (Lisp_Object prompt)
{
Lisp_Object val;
do
@@ -8213,8 +8122,7 @@ DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0,
If the user enters null input, return second argument DEFAULT-CODING-SYSTEM.
Ignores case when completing coding systems (all Emacs coding systems
are lower-case). */)
- (prompt, default_coding_system)
- Lisp_Object prompt, default_coding_system;
+ (Lisp_Object prompt, Lisp_Object default_coding_system)
{
Lisp_Object val;
int count = SPECPDL_INDEX ();
@@ -8235,8 +8143,7 @@ DEFUN ("check-coding-system", Fcheck_coding_system, Scheck_coding_system,
If valid, return CODING-SYSTEM, else signal a `coding-system-error' error.
It is valid if it is nil or a symbol defined as a coding system by the
function `define-coding-system'. */)
- (coding_system)
- Lisp_Object coding_system;
+ (Lisp_Object coding_system)
{
Lisp_Object define_form;
@@ -8269,13 +8176,10 @@ function `define-coding-system'. */)
detect only text-format. */
Lisp_Object
-detect_coding_system (src, src_chars, src_bytes, highest, multibytep,
- coding_system)
- const unsigned char *src;
- EMACS_INT src_chars, src_bytes;
- int highest;
- int multibytep;
- Lisp_Object coding_system;
+detect_coding_system (const unsigned char *src,
+ EMACS_INT src_chars, EMACS_INT src_bytes,
+ int highest, int multibytep,
+ Lisp_Object coding_system)
{
const unsigned char *src_end = src + src_bytes;
Lisp_Object attrs, eol_type;
@@ -8591,8 +8495,7 @@ format.
If optional argument HIGHEST is non-nil, return the coding system of
highest priority. */)
- (start, end, highest)
- Lisp_Object start, end, highest;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object highest)
{
int from, to;
int from_byte, to_byte;
@@ -8630,8 +8533,7 @@ format.
If optional argument HIGHEST is non-nil, return the coding system of
highest priority. */)
- (string, highest)
- Lisp_Object string, highest;
+ (Lisp_Object string, Lisp_Object highest)
{
CHECK_STRING (string);
@@ -8643,9 +8545,7 @@ highest priority. */)
static INLINE int
-char_encodable_p (c, attrs)
- int c;
- Lisp_Object attrs;
+char_encodable_p (int c, Lisp_Object attrs)
{
Lisp_Object tail;
struct charset *charset;
@@ -8675,8 +8575,7 @@ DEFUN ("find-coding-systems-region-internal",
Ffind_coding_systems_region_internal,
Sfind_coding_systems_region_internal, 2, 3, 0,
doc: /* Internal use only. */)
- (start, end, exclude)
- Lisp_Object start, end, exclude;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object exclude)
{
Lisp_Object coding_attrs_list, safe_codings;
EMACS_INT start_byte, end_byte;
@@ -8809,8 +8708,7 @@ list of positions.
If optional 5th argument STRING is non-nil, it is a string to search
for un-encodable characters. In that case, START and END are indexes
to the string. */)
- (start, end, coding_system, count, string)
- Lisp_Object start, end, coding_system, count, string;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object count, Lisp_Object string)
{
int n;
struct coding_system coding;
@@ -8925,8 +8823,7 @@ buffer positions. END is ignored.
If the current buffer (or START if it is a string) is unibyte, the value
is nil. */)
- (start, end, coding_system_list)
- Lisp_Object start, end, coding_system_list;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system_list)
{
Lisp_Object list;
EMACS_INT start_byte, end_byte;
@@ -9031,9 +8928,9 @@ is nil. */)
Lisp_Object
-code_convert_region (start, end, coding_system, dst_object, encodep, norecord)
- Lisp_Object start, end, coding_system, dst_object;
- int encodep, norecord;
+code_convert_region (Lisp_Object start, Lisp_Object end,
+ Lisp_Object coding_system, Lisp_Object dst_object,
+ int encodep, int norecord)
{
struct coding_system coding;
EMACS_INT from, from_byte, to, to_byte;
@@ -9092,8 +8989,7 @@ If DESTINATION is t, the decoded text is returned.
This function sets `last-coding-system-used' to the precise coding system
used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
not fully specified.) */)
- (start, end, coding_system, destination)
- Lisp_Object start, end, coding_system, destination;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object destination)
{
return code_convert_region (start, end, coding_system, destination, 0, 0);
}
@@ -9115,17 +9011,14 @@ If DESTINATION is t, the encoded text is returned.
This function sets `last-coding-system-used' to the precise coding system
used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
not fully specified.) */)
- (start, end, coding_system, destination)
- Lisp_Object start, end, coding_system, destination;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object destination)
{
return code_convert_region (start, end, coding_system, destination, 1, 0);
}
Lisp_Object
-code_convert_string (string, coding_system, dst_object,
- encodep, nocopy, norecord)
- Lisp_Object string, coding_system, dst_object;
- int encodep, nocopy, norecord;
+code_convert_string (Lisp_Object string, Lisp_Object coding_system,
+ Lisp_Object dst_object, int encodep, int nocopy, int norecord)
{
struct coding_system coding;
EMACS_INT chars, bytes;
@@ -9172,9 +9065,8 @@ code_convert_string (string, coding_system, dst_object,
ENCODE_FILE, thus we ignore character composition. */
Lisp_Object
-code_convert_string_norecord (string, coding_system, encodep)
- Lisp_Object string, coding_system;
- int encodep;
+code_convert_string_norecord (Lisp_Object string, Lisp_Object coding_system,
+ int encodep)
{
return code_convert_string (string, coding_system, Qt, encodep, 0, 1);
}
@@ -9194,8 +9086,7 @@ case, the return value is the length of the decoded text.
This function sets `last-coding-system-used' to the precise coding system
used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
not fully specified.) */)
- (string, coding_system, nocopy, buffer)
- Lisp_Object string, coding_system, nocopy, buffer;
+ (Lisp_Object string, Lisp_Object coding_system, Lisp_Object nocopy, Lisp_Object buffer)
{
return code_convert_string (string, coding_system, buffer,
0, ! NILP (nocopy), 0);
@@ -9215,8 +9106,7 @@ case, the return value is the length of the encoded text.
This function sets `last-coding-system-used' to the precise coding system
used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
not fully specified.) */)
- (string, coding_system, nocopy, buffer)
- Lisp_Object string, coding_system, nocopy, buffer;
+ (Lisp_Object string, Lisp_Object coding_system, Lisp_Object nocopy, Lisp_Object buffer)
{
return code_convert_string (string, coding_system, buffer,
1, ! NILP (nocopy), 1);
@@ -9226,8 +9116,7 @@ not fully specified.) */)
DEFUN ("decode-sjis-char", Fdecode_sjis_char, Sdecode_sjis_char, 1, 1, 0,
doc: /* Decode a Japanese character which has CODE in shift_jis encoding.
Return the corresponding character. */)
- (code)
- Lisp_Object code;
+ (Lisp_Object code)
{
Lisp_Object spec, attrs, val;
struct charset *charset_roman, *charset_kanji, *charset_kana, *charset;
@@ -9274,8 +9163,7 @@ Return the corresponding character. */)
DEFUN ("encode-sjis-char", Fencode_sjis_char, Sencode_sjis_char, 1, 1, 0,
doc: /* Encode a Japanese character CH to shift_jis encoding.
Return the corresponding code in SJIS. */)
- (ch)
- Lisp_Object ch;
+ (Lisp_Object ch)
{
Lisp_Object spec, attrs, charset_list;
int c;
@@ -9303,8 +9191,7 @@ Return the corresponding code in SJIS. */)
DEFUN ("decode-big5-char", Fdecode_big5_char, Sdecode_big5_char, 1, 1, 0,
doc: /* Decode a Big5 character which has CODE in BIG5 coding system.
Return the corresponding character. */)
- (code)
- Lisp_Object code;
+ (Lisp_Object code)
{
Lisp_Object spec, attrs, val;
struct charset *charset_roman, *charset_big5, *charset;
@@ -9342,8 +9229,7 @@ Return the corresponding character. */)
DEFUN ("encode-big5-char", Fencode_big5_char, Sencode_big5_char, 1, 1, 0,
doc: /* Encode the Big5 character CH to BIG5 coding system.
Return the corresponding character code in Big5. */)
- (ch)
- Lisp_Object ch;
+ (Lisp_Object ch)
{
Lisp_Object spec, attrs, charset_list;
struct charset *charset;
@@ -9370,9 +9256,7 @@ Return the corresponding character code in Big5. */)
DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_internal,
Sset_terminal_coding_system_internal, 1, 2, 0,
doc: /* Internal use only. */)
- (coding_system, terminal)
- Lisp_Object coding_system;
- Lisp_Object terminal;
+ (Lisp_Object coding_system, Lisp_Object terminal)
{
struct coding_system *terminal_coding = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1));
CHECK_SYMBOL (coding_system);
@@ -9390,8 +9274,7 @@ DEFUN ("set-safe-terminal-coding-system-internal",
Fset_safe_terminal_coding_system_internal,
Sset_safe_terminal_coding_system_internal, 1, 1, 0,
doc: /* Internal use only. */)
- (coding_system)
- Lisp_Object coding_system;
+ (Lisp_Object coding_system)
{
CHECK_SYMBOL (coding_system);
setup_coding_system (Fcheck_coding_system (coding_system),
@@ -9408,8 +9291,7 @@ DEFUN ("terminal-coding-system", Fterminal_coding_system,
doc: /* Return coding system specified for terminal output on the given terminal.
TERMINAL may be a terminal object, a frame, or nil for the selected
frame's terminal device. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct coding_system *terminal_coding
= TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1));
@@ -9422,9 +9304,7 @@ frame's terminal device. */)
DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_internal,
Sset_keyboard_coding_system_internal, 1, 2, 0,
doc: /* Internal use only. */)
- (coding_system, terminal)
- Lisp_Object coding_system;
- Lisp_Object terminal;
+ (Lisp_Object coding_system, Lisp_Object terminal)
{
struct terminal *t = get_terminal (terminal, 1);
CHECK_SYMBOL (coding_system);
@@ -9442,8 +9322,7 @@ DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_intern
DEFUN ("keyboard-coding-system",
Fkeyboard_coding_system, Skeyboard_coding_system, 0, 1, 0,
doc: /* Return coding system specified for decoding keyboard input. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
return CODING_ID_NAME (TERMINAL_KEYBOARD_CODING
(get_terminal (terminal, 1))->id);
@@ -9491,9 +9370,7 @@ function to call for FILENAME, that function should examine the
contents of BUFFER instead of reading the file.
usage: (find-operation-coding-system OPERATION ARGUMENTS...) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
Lisp_Object operation, target_idx, target, val;
register Lisp_Object chain;
@@ -9569,15 +9446,13 @@ If multiple coding systems belong to the same category,
all but the first one are ignored.
usage: (set-coding-system-priority &rest coding-systems) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
int i, j;
int changed[coding_category_max];
enum coding_category priorities[coding_category_max];
- bzero (changed, sizeof changed);
+ memset (changed, 0, sizeof changed);
for (i = j = 0; i < nargs; i++)
{
@@ -9612,7 +9487,7 @@ usage: (set-coding-system-priority &rest coding-systems) */)
priorities[i] = coding_priorities[j];
}
- bcopy (priorities, coding_priorities, sizeof priorities);
+ memcpy (coding_priorities, priorities, sizeof priorities);
/* Update `coding-category-list'. */
Vcoding_category_list = Qnil;
@@ -9631,8 +9506,7 @@ The list contains a subset of coding systems; i.e. coding systems
assigned to each coding category (see `coding-category-list').
HIGHESTP non-nil means just return the highest priority one. */)
- (highestp)
- Lisp_Object highestp;
+ (Lisp_Object highestp)
{
int i;
Lisp_Object val;
@@ -9656,19 +9530,18 @@ HIGHESTP non-nil means just return the highest priority one. */)
static const char *const suffixes[] = { "-unix", "-dos", "-mac" };
static Lisp_Object
-make_subsidiaries (base)
- Lisp_Object base;
+make_subsidiaries (Lisp_Object base)
{
Lisp_Object subsidiaries;
int base_name_len = SBYTES (SYMBOL_NAME (base));
char *buf = (char *) alloca (base_name_len + 6);
int i;
- bcopy (SDATA (SYMBOL_NAME (base)), buf, base_name_len);
+ memcpy (buf, SDATA (SYMBOL_NAME (base)), base_name_len);
subsidiaries = Fmake_vector (make_number (3), Qnil);
for (i = 0; i < 3; i++)
{
- bcopy (suffixes[i], buf + base_name_len, strlen (suffixes[i]) + 1);
+ memcpy (buf + base_name_len, suffixes[i], strlen (suffixes[i]) + 1);
ASET (subsidiaries, i, intern (buf));
}
return subsidiaries;
@@ -9679,9 +9552,7 @@ DEFUN ("define-coding-system-internal", Fdefine_coding_system_internal,
Sdefine_coding_system_internal, coding_arg_max, MANY, 0,
doc: /* For internal use only.
usage: (define-coding-system-internal ...) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
Lisp_Object name;
Lisp_Object spec_vec; /* [ ATTRS ALIASE EOL_TYPE ] */
@@ -10210,8 +10081,7 @@ usage: (define-coding-system-internal ...) */)
DEFUN ("coding-system-put", Fcoding_system_put, Scoding_system_put,
3, 3, 0,
doc: /* Change value in CODING-SYSTEM's property list PROP to VAL. */)
- (coding_system, prop, val)
- Lisp_Object coding_system, prop, val;
+ (Lisp_Object coding_system, Lisp_Object prop, Lisp_Object val)
{
Lisp_Object spec, attrs;
@@ -10267,8 +10137,7 @@ DEFUN ("coding-system-put", Fcoding_system_put, Scoding_system_put,
DEFUN ("define-coding-system-alias", Fdefine_coding_system_alias,
Sdefine_coding_system_alias, 2, 2, 0,
doc: /* Define ALIAS as an alias for CODING-SYSTEM. */)
- (alias, coding_system)
- Lisp_Object alias, coding_system;
+ (Lisp_Object alias, Lisp_Object coding_system)
{
Lisp_Object spec, aliases, eol_type, val;
@@ -10308,8 +10177,7 @@ DEFUN ("coding-system-base", Fcoding_system_base, Scoding_system_base,
1, 1, 0,
doc: /* Return the base of CODING-SYSTEM.
Any alias or subsidiary coding system is not a base coding system. */)
- (coding_system)
- Lisp_Object coding_system;
+ (Lisp_Object coding_system)
{
Lisp_Object spec, attrs;
@@ -10323,8 +10191,7 @@ Any alias or subsidiary coding system is not a base coding system. */)
DEFUN ("coding-system-plist", Fcoding_system_plist, Scoding_system_plist,
1, 1, 0,
doc: "Return the property list of CODING-SYSTEM.")
- (coding_system)
- Lisp_Object coding_system;
+ (Lisp_Object coding_system)
{
Lisp_Object spec, attrs;
@@ -10339,8 +10206,7 @@ DEFUN ("coding-system-plist", Fcoding_system_plist, Scoding_system_plist,
DEFUN ("coding-system-aliases", Fcoding_system_aliases, Scoding_system_aliases,
1, 1, 0,
doc: /* Return the list of aliases of CODING-SYSTEM. */)
- (coding_system)
- Lisp_Object coding_system;
+ (Lisp_Object coding_system)
{
Lisp_Object spec;
@@ -10361,8 +10227,7 @@ and CR respectively.
A vector value indicates that a format of end-of-line should be
detected automatically. Nth element of the vector is the subsidiary
coding system whose eol-type is N. */)
- (coding_system)
- Lisp_Object coding_system;
+ (Lisp_Object coding_system)
{
Lisp_Object spec, eol_type;
int n;
@@ -10385,7 +10250,7 @@ coding system whose eol-type is N. */)
/*** 9. Post-amble ***/
void
-init_coding_once ()
+init_coding_once (void)
{
int i;
@@ -10427,7 +10292,7 @@ init_coding_once ()
#ifdef emacs
void
-syms_of_coding ()
+syms_of_coding (void)
{
staticpro (&Vcoding_system_hash_table);
{
@@ -10968,7 +10833,7 @@ character.");
for (i = 0; i < coding_category_max; i++)
Fset (AREF (Vcoding_category_table, i), Qno_conversion);
}
-#if defined (MSDOS) || defined (WINDOWSNT)
+#if defined (DOS_NT)
system_eol_type = Qdos;
#else
system_eol_type = Qunix;
@@ -10977,8 +10842,7 @@ character.");
}
char *
-emacs_strerror (error_number)
- int error_number;
+emacs_strerror (int error_number)
{
char *str;
diff --git a/src/coding.h b/src/coding.h
index f47c33847f9..75ed84bef71 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -499,10 +499,10 @@ struct coding_system
int default_char;
- int (*detector) P_ ((struct coding_system *,
- struct coding_detection_info *));
- void (*decoder) P_ ((struct coding_system *));
- int (*encoder) P_ ((struct coding_system *));
+ int (*detector) (struct coding_system *,
+ struct coding_detection_info *);
+ void (*decoder) (struct coding_system *);
+ int (*encoder) (struct coding_system *);
};
/* Meanings of bits in the member `common_flags' of the structure
@@ -691,33 +691,33 @@ struct coding_system
#define ENCODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 1)
/* Extern declarations. */
-extern Lisp_Object code_conversion_save P_ ((int, int));
-extern int decoding_buffer_size P_ ((struct coding_system *, int));
-extern int encoding_buffer_size P_ ((struct coding_system *, int));
-extern void setup_coding_system P_ ((Lisp_Object, struct coding_system *));
-extern Lisp_Object coding_charset_list P_ ((struct coding_system *));
-extern Lisp_Object coding_system_charset_list P_ ((Lisp_Object));
-extern void detect_coding P_ ((struct coding_system *));
-extern Lisp_Object code_convert_region P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object,
- int, int));
-extern Lisp_Object code_convert_string P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, int, int, int));
-extern Lisp_Object code_convert_string_norecord P_ ((Lisp_Object, Lisp_Object,
- int));
-extern Lisp_Object raw_text_coding_system P_ ((Lisp_Object));
-extern Lisp_Object coding_inherit_eol_type P_ ((Lisp_Object, Lisp_Object));
-
-extern int decode_coding_gap P_ ((struct coding_system *,
- EMACS_INT, EMACS_INT));
-extern int encode_coding_gap P_ ((struct coding_system *,
- EMACS_INT, EMACS_INT));
-extern void decode_coding_object P_ ((struct coding_system *,
- Lisp_Object, EMACS_INT, EMACS_INT,
- EMACS_INT, EMACS_INT, Lisp_Object));
-extern void encode_coding_object P_ ((struct coding_system *,
- Lisp_Object, EMACS_INT, EMACS_INT,
- EMACS_INT, EMACS_INT, Lisp_Object));
+extern Lisp_Object code_conversion_save (int, int);
+extern int decoding_buffer_size (struct coding_system *, int);
+extern int encoding_buffer_size (struct coding_system *, int);
+extern void setup_coding_system (Lisp_Object, struct coding_system *);
+extern Lisp_Object coding_charset_list (struct coding_system *);
+extern Lisp_Object coding_system_charset_list (Lisp_Object);
+extern void detect_coding (struct coding_system *);
+extern Lisp_Object code_convert_region (Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object,
+ int, int);
+extern Lisp_Object code_convert_string (Lisp_Object, Lisp_Object,
+ Lisp_Object, int, int, int);
+extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object,
+ int);
+extern Lisp_Object raw_text_coding_system (Lisp_Object);
+extern Lisp_Object coding_inherit_eol_type (Lisp_Object, Lisp_Object);
+
+extern int decode_coding_gap (struct coding_system *,
+ EMACS_INT, EMACS_INT);
+extern int encode_coding_gap (struct coding_system *,
+ EMACS_INT, EMACS_INT);
+extern void decode_coding_object (struct coding_system *,
+ Lisp_Object, EMACS_INT, EMACS_INT,
+ EMACS_INT, EMACS_INT, Lisp_Object);
+extern void encode_coding_object (struct coding_system *,
+ Lisp_Object, EMACS_INT, EMACS_INT,
+ EMACS_INT, EMACS_INT, Lisp_Object);
/* Macros for backward compatibility. */
@@ -753,7 +753,7 @@ extern void encode_coding_object P_ ((struct coding_system *,
} while (0)
-extern Lisp_Object preferred_coding_system P_ (());
+extern Lisp_Object preferred_coding_system (void);
extern Lisp_Object Qutf_8, Qutf_8_emacs;
@@ -780,7 +780,7 @@ extern Lisp_Object Qcall_process, Qcall_process_region;
extern Lisp_Object Qstart_process, Qopen_network_stream;
extern Lisp_Object Qwrite_region;
-extern char *emacs_strerror P_ ((int));
+extern char *emacs_strerror (int);
/* Coding-system for reading files and receiving data from process. */
extern Lisp_Object Vcoding_system_for_read;
@@ -823,7 +823,7 @@ extern Lisp_Object Vdefault_file_name_coding_system;
extern Lisp_Object Qcoding_system_error;
extern char emacs_mule_bytes[256];
-extern int emacs_mule_string_char P_ ((unsigned char *));
+extern int emacs_mule_string_char (unsigned char *);
#endif /* EMACS_CODING_H */
diff --git a/src/composite.c b/src/composite.c
index cab57e824a9..4568698619f 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -180,9 +180,7 @@ Lisp_Object composition_temp;
If the composition is invalid, return -1. */
int
-get_composition_id (charpos, bytepos, nchars, prop, string)
- int charpos, bytepos, nchars;
- Lisp_Object prop, string;
+get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp_Object string)
{
Lisp_Object id, length, components, key, *key_contents;
int glyph_len;
@@ -429,10 +427,7 @@ get_composition_id (charpos, bytepos, nchars, prop, string)
This doesn't check the validity of composition. */
int
-find_composition (pos, limit, start, end, prop, object)
- int pos, limit;
- EMACS_INT *start, *end;
- Lisp_Object *prop, object;
+find_composition (int pos, int limit, EMACS_INT *start, EMACS_INT *end, Lisp_Object *prop, Lisp_Object object)
{
Lisp_Object val;
@@ -470,9 +465,7 @@ find_composition (pos, limit, start, end, prop, object)
FROM and TO with property PROP. */
static void
-run_composition_function (from, to, prop)
- int from, to;
- Lisp_Object prop;
+run_composition_function (int from, int to, Lisp_Object prop)
{
Lisp_Object func;
EMACS_INT start, end;
@@ -504,9 +497,7 @@ run_composition_function (from, to, prop)
change is deletion, FROM == TO. Otherwise, FROM < TO. */
void
-update_compositions (from, to, check_mask)
- EMACS_INT from, to;
- int check_mask;
+update_compositions (EMACS_INT from, EMACS_INT to, int check_mask)
{
Lisp_Object prop;
EMACS_INT start, end;
@@ -612,8 +603,7 @@ update_compositions (from, to, check_mask)
top-level copies of them so that none of them are `eq'. */
void
-make_composition_value_copy (list)
- Lisp_Object list;
+make_composition_value_copy (Lisp_Object list)
{
Lisp_Object plist, val;
@@ -638,9 +628,7 @@ make_composition_value_copy (list)
indices START and END in STRING. */
void
-compose_text (start, end, components, modification_func, string)
- int start, end;
- Lisp_Object components, modification_func, string;
+compose_text (int start, int end, Lisp_Object components, Lisp_Object modification_func, Lisp_Object string)
{
Lisp_Object prop;
@@ -651,9 +639,9 @@ compose_text (start, end, components, modification_func, string)
}
-static Lisp_Object autocmp_chars P_ ((Lisp_Object, EMACS_INT, EMACS_INT,
- EMACS_INT, struct window *,
- struct face *, Lisp_Object));
+static Lisp_Object autocmp_chars (Lisp_Object, EMACS_INT, EMACS_INT,
+ EMACS_INT, struct window *,
+ struct face *, Lisp_Object);
/* Lisp glyph-string handlers */
@@ -664,11 +652,10 @@ static Lisp_Object autocmp_chars P_ ((Lisp_Object, EMACS_INT, EMACS_INT,
static Lisp_Object gstring_hash_table;
-static Lisp_Object gstring_lookup_cache P_ ((Lisp_Object));
+static Lisp_Object gstring_lookup_cache (Lisp_Object);
static Lisp_Object
-gstring_lookup_cache (header)
- Lisp_Object header;
+gstring_lookup_cache (Lisp_Object header)
{
struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table);
int i = hash_lookup (h, header, NULL);
@@ -677,9 +664,7 @@ gstring_lookup_cache (header)
}
Lisp_Object
-composition_gstring_put_cache (gstring, len)
- Lisp_Object gstring;
- int len;
+composition_gstring_put_cache (Lisp_Object gstring, int len)
{
struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table);
unsigned hash;
@@ -707,21 +692,19 @@ composition_gstring_put_cache (gstring, len)
}
Lisp_Object
-composition_gstring_from_id (id)
- int id;
+composition_gstring_from_id (int id)
{
struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table);
return HASH_VALUE (h, id);
}
-static Lisp_Object fill_gstring_header P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object,
- Lisp_Object));
+static Lisp_Object fill_gstring_header (Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object,
+ Lisp_Object);
int
-composition_gstring_p (gstring)
- Lisp_Object gstring;
+composition_gstring_p (Lisp_Object gstring)
{
Lisp_Object header;
int i;
@@ -752,10 +735,7 @@ composition_gstring_p (gstring)
}
int
-composition_gstring_width (gstring, from, to, metrics)
- Lisp_Object gstring;
- int from, to;
- struct font_metrics *metrics;
+composition_gstring_width (Lisp_Object gstring, int from, int to, struct font_metrics *metrics)
{
Lisp_Object *glyph;
int width = 0;
@@ -811,8 +791,7 @@ static Lisp_Object gstring_work;
static Lisp_Object gstring_work_headers;
static Lisp_Object
-fill_gstring_header (header, start, end, font_object, string)
- Lisp_Object header, start, end, font_object, string;
+fill_gstring_header (Lisp_Object header, Lisp_Object start, Lisp_Object end, Lisp_Object font_object, Lisp_Object string)
{
EMACS_INT from, to, from_byte;
EMACS_INT len, i;
@@ -869,11 +848,10 @@ fill_gstring_header (header, start, end, font_object, string)
return header;
}
-extern void font_fill_lglyph_metrics P_ ((Lisp_Object, Lisp_Object));
+extern void font_fill_lglyph_metrics (Lisp_Object, Lisp_Object);
static void
-fill_gstring_body (gstring)
- Lisp_Object gstring;
+fill_gstring_body (Lisp_Object gstring)
{
Lisp_Object font_object = LGSTRING_FONT (gstring);
Lisp_Object header = AREF (gstring, 0);
@@ -923,12 +901,7 @@ fill_gstring_body (gstring)
object. Otherwise return nil. */
static Lisp_Object
-autocmp_chars (rule, charpos, bytepos, limit, win, face, string)
- Lisp_Object rule;
- EMACS_INT charpos, bytepos, limit;
- struct window *win;
- struct face *face;
- Lisp_Object string;
+autocmp_chars (Lisp_Object rule, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT limit, struct window *win, struct face *face, Lisp_Object string)
{
int count = SPECPDL_INDEX ();
FRAME_PTR f = XFRAME (win->frame);
@@ -1020,10 +993,7 @@ static int _work_char;
composition. */
void
-composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string)
- struct composition_it *cmp_it;
- EMACS_INT charpos, bytepos, endpos;
- Lisp_Object string;
+composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT endpos, Lisp_Object string)
{
EMACS_INT start, end, c;
Lisp_Object prop, val;
@@ -1253,12 +1223,7 @@ composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string)
CMP_IT->stop_pos, and return 0. */
int
-composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string)
- struct composition_it *cmp_it;
- EMACS_INT charpos, bytepos, endpos;
- struct window *w;
- struct face *face;
- Lisp_Object string;
+composition_reseat_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT endpos, struct window *w, struct face *face, Lisp_Object string)
{
if (endpos <= charpos)
{
@@ -1417,10 +1382,7 @@ composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string)
the cluster, or -1 if the composition is somehow broken. */
int
-composition_update_it (cmp_it, charpos, bytepos, string)
- struct composition_it *cmp_it;
- EMACS_INT charpos, bytepos;
- Lisp_Object string;
+composition_update_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_INT bytepos, Lisp_Object string)
{
int i, c;
@@ -1543,9 +1505,7 @@ struct position_record
the composition, and return 1. Otherwise, return 0. */
static int
-find_automatic_composition (pos, limit, start, end, gstring, string)
- EMACS_INT pos, limit, *start, *end;
- Lisp_Object *gstring, string;
+find_automatic_composition (EMACS_INT pos, EMACS_INT limit, EMACS_INT *start, EMACS_INT *end, Lisp_Object *gstring, Lisp_Object string)
{
EMACS_INT head, tail, stop;
/* Limit to check a composition after POS. */
@@ -1716,8 +1676,7 @@ find_automatic_composition (pos, limit, start, end, gstring, string)
to NEW_PT. */
int
-composition_adjust_point (last_pt, new_pt)
- EMACS_INT last_pt, new_pt;
+composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt)
{
EMACS_INT charpos, bytepos, startpos, beg, end, pos;
Lisp_Object val;
@@ -1799,8 +1758,7 @@ where
If GLYPH is nil, the remaining elements of the glyph-string vector
should be ignored. */)
- (from, to, font_object, string)
- Lisp_Object font_object, from, to, string;
+ (Lisp_Object from, Lisp_Object to, Lisp_Object font_object, Lisp_Object string)
{
Lisp_Object gstring, header;
EMACS_INT frompos, topos;
@@ -1845,8 +1803,7 @@ DEFUN ("compose-region-internal", Fcompose_region_internal,
Compose text in the region between START and END.
Optional 3rd and 4th arguments are COMPONENTS and MODIFICATION-FUNC
for the composition. See `compose-region' for more details. */)
- (start, end, components, modification_func)
- Lisp_Object start, end, components, modification_func;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object components, Lisp_Object modification_func)
{
validate_region (&start, &end);
if (!NILP (components)
@@ -1866,8 +1823,7 @@ DEFUN ("compose-string-internal", Fcompose_string_internal,
Compose text between indices START and END of STRING.
Optional 4th and 5th arguments are COMPONENTS and MODIFICATION-FUNC
for the composition. See `compose-string' for more details. */)
- (string, start, end, components, modification_func)
- Lisp_Object string, start, end, components, modification_func;
+ (Lisp_Object string, Lisp_Object start, Lisp_Object end, Lisp_Object components, Lisp_Object modification_func)
{
CHECK_STRING (string);
CHECK_NUMBER (start);
@@ -1888,8 +1844,7 @@ DEFUN ("find-composition-internal", Ffind_composition_internal,
Return information about composition at or nearest to position POS.
See `find-composition' for more details. */)
- (pos, limit, string, detail_p)
- Lisp_Object pos, limit, string, detail_p;
+ (Lisp_Object pos, Lisp_Object limit, Lisp_Object string, Lisp_Object detail_p)
{
Lisp_Object prop, tail, gstring;
EMACS_INT start, end, from, to;
@@ -1974,7 +1929,7 @@ See `find-composition' for more details. */)
void
-syms_of_composite ()
+syms_of_composite (void)
{
int i;
diff --git a/src/composite.h b/src/composite.h
index 59c237c8de2..554ab554115 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -212,16 +212,16 @@ extern Lisp_Object Vauto_composition_function;
extern Lisp_Object Qauto_composition_function;
extern Lisp_Object Vcomposition_function_table;
-extern int get_composition_id P_ ((int, int, int, Lisp_Object, Lisp_Object));
-extern int find_composition P_ ((int, int, EMACS_INT *, EMACS_INT *, Lisp_Object *,
- Lisp_Object));
-extern void update_compositions P_ ((EMACS_INT, EMACS_INT, int));
-extern void make_composition_value_copy P_ ((Lisp_Object));
-extern void compose_region P_ ((int, int, Lisp_Object, Lisp_Object,
- Lisp_Object));
-extern void syms_of_composite P_ ((void));
-extern void compose_text P_ ((int, int, Lisp_Object, Lisp_Object,
- Lisp_Object));
+extern int get_composition_id (int, int, int, Lisp_Object, Lisp_Object);
+extern int find_composition (int, int, EMACS_INT *, EMACS_INT *, Lisp_Object *,
+ Lisp_Object);
+extern void update_compositions (EMACS_INT, EMACS_INT, int);
+extern void make_composition_value_copy (Lisp_Object);
+extern void compose_region (int, int, Lisp_Object, Lisp_Object,
+ Lisp_Object);
+extern void syms_of_composite (void);
+extern void compose_text (int, int, Lisp_Object, Lisp_Object,
+ Lisp_Object);
/* Macros for lispy glyph-string. This is completely different from
struct glyph_string. */
@@ -303,23 +303,23 @@ struct composition_it;
struct face;
struct font_metrics;
-extern Lisp_Object composition_gstring_put_cache P_ ((Lisp_Object, int));
-extern Lisp_Object composition_gstring_from_id P_ ((int));
-extern int composition_gstring_p P_ ((Lisp_Object));
-extern int composition_gstring_width P_ ((Lisp_Object, int, int,
- struct font_metrics *));
-
-extern void composition_compute_stop_pos P_ ((struct composition_it *,
- EMACS_INT, EMACS_INT, EMACS_INT,
- Lisp_Object));
-extern int composition_reseat_it P_ ((struct composition_it *,
- EMACS_INT, EMACS_INT, EMACS_INT,
- struct window *, struct face *,
- Lisp_Object));
-extern int composition_update_it P_ ((struct composition_it *,
- EMACS_INT, EMACS_INT, Lisp_Object));
-
-extern int composition_adjust_point P_ ((EMACS_INT, EMACS_INT));
+extern Lisp_Object composition_gstring_put_cache (Lisp_Object, int);
+extern Lisp_Object composition_gstring_from_id (int);
+extern int composition_gstring_p (Lisp_Object);
+extern int composition_gstring_width (Lisp_Object, int, int,
+ struct font_metrics *);
+
+extern void composition_compute_stop_pos (struct composition_it *,
+ EMACS_INT, EMACS_INT, EMACS_INT,
+ Lisp_Object);
+extern int composition_reseat_it (struct composition_it *,
+ EMACS_INT, EMACS_INT, EMACS_INT,
+ struct window *, struct face *,
+ Lisp_Object);
+extern int composition_update_it (struct composition_it *,
+ EMACS_INT, EMACS_INT, Lisp_Object);
+
+extern int composition_adjust_point (EMACS_INT, EMACS_INT);
EXFUN (Fcompose_region_internal, 4);
EXFUN (Fcompose_string_internal, 5);
diff --git a/src/config.in b/src/config.in
index 3fa3c30ce0e..40b62633446 100644
--- a/src/config.in
+++ b/src/config.in
@@ -30,6 +30,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if the mktime function is broken. */
#undef BROKEN_MKTIME
+/* Define if Emacs cannot be dumped on your system. */
+#undef CANNOT_DUMP
+
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
@@ -99,15 +102,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if ALSA is available. */
#undef HAVE_ALSA
-/* Define to 1 if you have the `bcmp' function. */
-#undef HAVE_BCMP
-
-/* Define to 1 if you have the `bcopy' function. */
-#undef HAVE_BCOPY
-
-/* Define to 1 if you have the `bzero' function. */
-#undef HAVE_BZERO
-
/* Define to 1 if you have the `cbrt' function. */
#undef HAVE_CBRT
@@ -195,9 +189,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if using GConf. */
#undef HAVE_GCONF
-/* Define to 1 if you have the `gdk_display_open' function. */
-#undef HAVE_GDK_DISPLAY_OPEN
-
/* Define to 1 if you have the `getaddrinfo' function. */
#undef HAVE_GETADDRINFO
@@ -264,14 +255,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the `grantpt' function. */
#undef HAVE_GRANTPT
+/* Define to 1 if you have the `gtk_adjustment_get_page_size' function. */
+#undef HAVE_GTK_ADJUSTMENT_GET_PAGE_SIZE
+
/* Define to 1 if you have GTK and pthread (-lpthread). */
#undef HAVE_GTK_AND_PTHREAD
-/* Define to 1 if GTK has both file selection and chooser dialog. */
-#undef HAVE_GTK_FILE_BOTH
-
-/* Define to 1 if you have the `gtk_file_chooser_dialog_new' function. */
-#undef HAVE_GTK_FILE_CHOOSER_DIALOG_NEW
+/* Define to 1 if you have the `gtk_dialog_get_action_area' function. */
+#undef HAVE_GTK_DIALOG_GET_ACTION_AREA
/* Define to 1 if you have the `gtk_file_selection_new' function. */
#undef HAVE_GTK_FILE_SELECTION_NEW
@@ -279,15 +270,24 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the `gtk_main' function. */
#undef HAVE_GTK_MAIN
-/* Define to 1 if GTK can handle more than one display. */
-#undef HAVE_GTK_MULTIDISPLAY
+/* Define to 1 if you have the `gtk_orientable_set_orientation' function. */
+#undef HAVE_GTK_ORIENTABLE_SET_ORIENTATION
+
+/* Define to 1 if you have the `gtk_widget_get_mapped' function. */
+#undef HAVE_GTK_WIDGET_GET_MAPPED
+
+/* Define to 1 if you have the `gtk_widget_get_sensitive' function. */
+#undef HAVE_GTK_WIDGET_GET_SENSITIVE
+
+/* Define to 1 if you have the `gtk_widget_get_window' function. */
+#undef HAVE_GTK_WIDGET_GET_WINDOW
+
+/* Define to 1 if you have the `gtk_widget_set_has_window' function. */
+#undef HAVE_GTK_WIDGET_SET_HAS_WINDOW
/* Define to 1 if netdb.h declares h_errno. */
#undef HAVE_H_ERRNO
-/* Define to 1 if you have the `index' function. */
-#undef HAVE_INDEX
-
/* Define to 1 if you have inet sockets. */
#undef HAVE_INET_SOCKETS
@@ -534,9 +534,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if res_init is available. */
#undef HAVE_RES_INIT
-/* Define to 1 if you have the `rindex' function. */
-#undef HAVE_RINDEX
-
/* Define to 1 if you have the `rint' function. */
#undef HAVE_RINT
@@ -576,6 +573,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if the system has the type `size_t'. */
#undef HAVE_SIZE_T
+/* Define to 1 if you have sound support. */
+#undef HAVE_SOUND
+
/* Define to 1 if you have the <soundcard.h> header file. */
#undef HAVE_SOUNDCARD_H
@@ -591,6 +591,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
@@ -603,6 +606,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
/* Define to 1 if you have the `strsignal' function. */
#undef HAVE_STRSIGNAL
@@ -753,6 +759,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the X11R6 or newer version of Xlib. */
#undef HAVE_X11R6
+/* Define if you have usable X11R6-style XIM support. */
+#undef HAVE_X11R6_XIM
+
/* Define to 1 if you have the X11R6 or newer version of Xt. */
#undef HAVE_X11XTR6
@@ -783,6 +792,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the `XSetWMProtocols' function. */
#undef HAVE_XSETWMPROTOCOLS
+/* Define if you have usable i18n support. */
+#undef HAVE_X_I18N
+
/* Define to 1 if you have the SM library (-lSM). */
#undef HAVE_X_SM
@@ -890,6 +902,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Process async input synchronously. */
#undef SYNC_INPUT
+/* Define to use system malloc. */
+#undef SYSTEM_MALLOC
+
/* Define to 1 if you use terminfo instead of termcap. */
#undef TERMINFO
@@ -909,9 +924,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if using GTK. */
#undef USE_GTK
+/* Define this to use a lisp union for the Lisp_Object data type. */
+#undef USE_LISP_UNION_TYPE
+
/* Define to 1 if using the Lucid X toolkit. */
#undef USE_LUCID
+/* Define to use mmap to allocate buffer text. */
+#undef USE_MMAP_FOR_BUFFERS
+
/* Define to 1 if using the Motif X toolkit. */
#undef USE_MOTIF
@@ -1018,25 +1039,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Turned on June 1996 supposing nobody will mind it. */
#define AMPERSAND_FULL_NAME
-/* Define HAVE_SOUND if we have sound support. We know it works
- and compiles only on the specified platforms. For others,
- it probably doesn't make sense to try. */
-
-#if defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
-#ifdef HAVE_MACHINE_SOUNDCARD_H
-#define HAVE_SOUND 1
-#endif
-#ifdef HAVE_SYS_SOUNDCARD_H
-#define HAVE_SOUND 1
-#endif
-#ifdef HAVE_SOUNDCARD_H
-#define HAVE_SOUND 1
-#endif
-#ifdef HAVE_ALSA
-#define HAVE_SOUND 1
-#endif
-#endif /* __FreeBSD__ || __NetBSD__ || __linux__ */
-
/* If using GNU, then support inline function declarations. */
/* Don't try to switch on inline handling as detected by AC_C_INLINE
generally, because even if non-gcc compilers accept `inline', they
@@ -1096,11 +1098,6 @@ SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */
#define my_strftime nstrftime /* for strftime.c */
-/* Some of the files of Emacs which are intended for use with other
- programs assume that if you have a config.h file, you must declare
- the type of getenv. */
-extern char *getenv ();
-
/* These default definitions are good for almost all machines.
The exceptions override them in m/MACHINE.h. */
@@ -1127,27 +1124,14 @@ extern char *getenv ();
#endif
#endif
-/* Define if the compiler supports function prototypes. It may do so
- but not define __STDC__ (e.g. DEC C by default) or may define it as
- zero. */
+/* Define if the compiler supports function prototypes. It may do so but
+ not define __STDC__ (e.g. DEC C by default) or may define it as zero. */
#undef PROTOTYPES
-/* For mktime.c: */
-#ifndef __P
-# if defined PROTOTYPES
-# define __P(args) args
-# else
-# define __P(args) ()
-# endif /* GCC. */
-#endif /* __P */
#ifdef HAVE_STRING_H
#include <string.h>
#endif
-#ifdef HAVE_STRINGS_H
-#include <strings.h> /* May be needed for bcopy & al. */
-#endif
-
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -1170,16 +1154,12 @@ void *alloca (size_t);
typedef unsigned size_t;
#endif
-/* Define HAVE_X_I18N if we have usable i18n support. */
-
-#ifdef HAVE_X11R6
-#define HAVE_X_I18N
+#ifndef HAVE_STRCHR
+#define strchr(a, b) index (a, b)
#endif
-/* Define HAVE_X11R6_XIM if we have usable X11R6-style XIM support. */
-
-#if defined HAVE_X11R6 && !defined INHIBIT_X11R6_XIM
-#define HAVE_X11R6_XIM
+#ifndef HAVE_STRRCHR
+#define strrchr(a, b) rindex (a, b)
#endif
#if defined __GNUC__ && (__GNUC__ > 2 \
@@ -1201,16 +1181,6 @@ typedef unsigned size_t;
# endif
#endif
-#ifndef HAVE_BCOPY
-#define bcopy(a,b,s) memcpy (b,a,s)
-#endif
-#ifndef HAVE_BZERO
-#define bzero(a,s) memset (a,0,s)
-#endif
-#ifndef HAVE_BCMP
-#define BCMP memcmp
-#endif
-
#endif /* EMACS_CONFIG_H */
/*
diff --git a/src/data.c b/src/data.c
index 6a21ad44720..cccd53f6076 100644
--- a/src/data.c
+++ b/src/data.c
@@ -50,7 +50,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <math.h>
#if !defined (atof)
-extern double atof ();
+extern double atof (const char *);
#endif /* !atof */
Lisp_Object Qnil, Qt, Qquote, Qlambda, Qsubr, Qunbound;
@@ -97,16 +97,14 @@ Lisp_Object Vmost_positive_fixnum, Vmost_negative_fixnum;
void
-circular_list_error (list)
- Lisp_Object list;
+circular_list_error (Lisp_Object list)
{
xsignal (Qcircular_list, list);
}
Lisp_Object
-wrong_type_argument (predicate, value)
- register Lisp_Object predicate, value;
+wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value)
{
/* If VALUE is not even a valid Lisp object, we'd want to abort here
where we can get a backtrace showing where it came from. We used
@@ -119,21 +117,19 @@ wrong_type_argument (predicate, value)
}
void
-pure_write_error ()
+pure_write_error (void)
{
error ("Attempt to modify read-only object");
}
void
-args_out_of_range (a1, a2)
- Lisp_Object a1, a2;
+args_out_of_range (Lisp_Object a1, Lisp_Object a2)
{
xsignal2 (Qargs_out_of_range, a1, a2);
}
void
-args_out_of_range_3 (a1, a2, a3)
- Lisp_Object a1, a2, a3;
+args_out_of_range_3 (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3)
{
xsignal3 (Qargs_out_of_range, a1, a2, a3);
}
@@ -146,8 +142,7 @@ int sign_extend_temp;
/* On a few machines, XINT can only be done by calling this. */
int
-sign_extend_lisp_int (num)
- EMACS_INT num;
+sign_extend_lisp_int (EMACS_INT num)
{
if (num & (((EMACS_INT) 1) << (VALBITS - 1)))
return num | (((EMACS_INT) (-1)) << VALBITS);
@@ -159,8 +154,7 @@ sign_extend_lisp_int (num)
DEFUN ("eq", Feq, Seq, 2, 2, 0,
doc: /* Return t if the two args are the same Lisp object. */)
- (obj1, obj2)
- Lisp_Object obj1, obj2;
+ (Lisp_Object obj1, Lisp_Object obj2)
{
if (EQ (obj1, obj2))
return Qt;
@@ -169,8 +163,7 @@ DEFUN ("eq", Feq, Seq, 2, 2, 0,
DEFUN ("null", Fnull, Snull, 1, 1, 0,
doc: /* Return t if OBJECT is nil. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (NILP (object))
return Qt;
@@ -181,8 +174,7 @@ DEFUN ("type-of", Ftype_of, Stype_of, 1, 1, 0,
doc: /* Return a symbol representing the type of OBJECT.
The symbol returned names the object's basic type;
for example, (type-of 1) returns `integer'. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
switch (XTYPE (object))
{
@@ -252,8 +244,7 @@ for example, (type-of 1) returns `integer'. */)
DEFUN ("consp", Fconsp, Sconsp, 1, 1, 0,
doc: /* Return t if OBJECT is a cons cell. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (CONSP (object))
return Qt;
@@ -262,8 +253,7 @@ DEFUN ("consp", Fconsp, Sconsp, 1, 1, 0,
DEFUN ("atom", Fatom, Satom, 1, 1, 0,
doc: /* Return t if OBJECT is not a cons cell. This includes nil. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (CONSP (object))
return Qnil;
@@ -273,8 +263,7 @@ DEFUN ("atom", Fatom, Satom, 1, 1, 0,
DEFUN ("listp", Flistp, Slistp, 1, 1, 0,
doc: /* Return t if OBJECT is a list, that is, a cons cell or nil.
Otherwise, return nil. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (CONSP (object) || NILP (object))
return Qt;
@@ -283,8 +272,7 @@ Otherwise, return nil. */)
DEFUN ("nlistp", Fnlistp, Snlistp, 1, 1, 0,
doc: /* Return t if OBJECT is not a list. Lists include nil. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (CONSP (object) || NILP (object))
return Qnil;
@@ -293,8 +281,7 @@ DEFUN ("nlistp", Fnlistp, Snlistp, 1, 1, 0,
DEFUN ("symbolp", Fsymbolp, Ssymbolp, 1, 1, 0,
doc: /* Return t if OBJECT is a symbol. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (SYMBOLP (object))
return Qt;
@@ -307,8 +294,7 @@ DEFUN ("keywordp", Fkeywordp, Skeywordp, 1, 1, 0,
doc: /* Return t if OBJECT is a keyword.
This means that it is a symbol with a print name beginning with `:'
interned in the initial obarray. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (SYMBOLP (object)
&& SREF (SYMBOL_NAME (object), 0) == ':'
@@ -319,8 +305,7 @@ interned in the initial obarray. */)
DEFUN ("vectorp", Fvectorp, Svectorp, 1, 1, 0,
doc: /* Return t if OBJECT is a vector. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (VECTORP (object))
return Qt;
@@ -329,8 +314,7 @@ DEFUN ("vectorp", Fvectorp, Svectorp, 1, 1, 0,
DEFUN ("stringp", Fstringp, Sstringp, 1, 1, 0,
doc: /* Return t if OBJECT is a string. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (STRINGP (object))
return Qt;
@@ -340,8 +324,7 @@ DEFUN ("stringp", Fstringp, Sstringp, 1, 1, 0,
DEFUN ("multibyte-string-p", Fmultibyte_string_p, Smultibyte_string_p,
1, 1, 0,
doc: /* Return t if OBJECT is a multibyte string. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (STRINGP (object) && STRING_MULTIBYTE (object))
return Qt;
@@ -350,8 +333,7 @@ DEFUN ("multibyte-string-p", Fmultibyte_string_p, Smultibyte_string_p,
DEFUN ("char-table-p", Fchar_table_p, Schar_table_p, 1, 1, 0,
doc: /* Return t if OBJECT is a char-table. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (CHAR_TABLE_P (object))
return Qt;
@@ -361,8 +343,7 @@ DEFUN ("char-table-p", Fchar_table_p, Schar_table_p, 1, 1, 0,
DEFUN ("vector-or-char-table-p", Fvector_or_char_table_p,
Svector_or_char_table_p, 1, 1, 0,
doc: /* Return t if OBJECT is a char-table or vector. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (VECTORP (object) || CHAR_TABLE_P (object))
return Qt;
@@ -371,8 +352,7 @@ DEFUN ("vector-or-char-table-p", Fvector_or_char_table_p,
DEFUN ("bool-vector-p", Fbool_vector_p, Sbool_vector_p, 1, 1, 0,
doc: /* Return t if OBJECT is a bool-vector. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (BOOL_VECTOR_P (object))
return Qt;
@@ -381,8 +361,7 @@ DEFUN ("bool-vector-p", Fbool_vector_p, Sbool_vector_p, 1, 1, 0,
DEFUN ("arrayp", Farrayp, Sarrayp, 1, 1, 0,
doc: /* Return t if OBJECT is an array (string or vector). */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (ARRAYP (object))
return Qt;
@@ -391,8 +370,7 @@ DEFUN ("arrayp", Farrayp, Sarrayp, 1, 1, 0,
DEFUN ("sequencep", Fsequencep, Ssequencep, 1, 1, 0,
doc: /* Return t if OBJECT is a sequence (list or array). */)
- (object)
- register Lisp_Object object;
+ (register Lisp_Object object)
{
if (CONSP (object) || NILP (object) || ARRAYP (object))
return Qt;
@@ -401,8 +379,7 @@ DEFUN ("sequencep", Fsequencep, Ssequencep, 1, 1, 0,
DEFUN ("bufferp", Fbufferp, Sbufferp, 1, 1, 0,
doc: /* Return t if OBJECT is an editor buffer. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (BUFFERP (object))
return Qt;
@@ -411,8 +388,7 @@ DEFUN ("bufferp", Fbufferp, Sbufferp, 1, 1, 0,
DEFUN ("markerp", Fmarkerp, Smarkerp, 1, 1, 0,
doc: /* Return t if OBJECT is a marker (editor pointer). */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (MARKERP (object))
return Qt;
@@ -421,8 +397,7 @@ DEFUN ("markerp", Fmarkerp, Smarkerp, 1, 1, 0,
DEFUN ("subrp", Fsubrp, Ssubrp, 1, 1, 0,
doc: /* Return t if OBJECT is a built-in function. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (SUBRP (object))
return Qt;
@@ -432,8 +407,7 @@ DEFUN ("subrp", Fsubrp, Ssubrp, 1, 1, 0,
DEFUN ("byte-code-function-p", Fbyte_code_function_p, Sbyte_code_function_p,
1, 1, 0,
doc: /* Return t if OBJECT is a byte-compiled function object. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (COMPILEDP (object))
return Qt;
@@ -450,8 +424,7 @@ DEFUN ("funvecp", Ffunvecp, Sfunvecp, 1, 1, 0,
DEFUN ("char-or-string-p", Fchar_or_string_p, Schar_or_string_p, 1, 1, 0,
doc: /* Return t if OBJECT is a character or a string. */)
- (object)
- register Lisp_Object object;
+ (register Lisp_Object object)
{
if (CHARACTERP (object) || STRINGP (object))
return Qt;
@@ -460,8 +433,7 @@ DEFUN ("char-or-string-p", Fchar_or_string_p, Schar_or_string_p, 1, 1, 0,
DEFUN ("integerp", Fintegerp, Sintegerp, 1, 1, 0,
doc: /* Return t if OBJECT is an integer. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (INTEGERP (object))
return Qt;
@@ -470,8 +442,7 @@ DEFUN ("integerp", Fintegerp, Sintegerp, 1, 1, 0,
DEFUN ("integer-or-marker-p", Finteger_or_marker_p, Sinteger_or_marker_p, 1, 1, 0,
doc: /* Return t if OBJECT is an integer or a marker (editor pointer). */)
- (object)
- register Lisp_Object object;
+ (register Lisp_Object object)
{
if (MARKERP (object) || INTEGERP (object))
return Qt;
@@ -480,8 +451,7 @@ DEFUN ("integer-or-marker-p", Finteger_or_marker_p, Sinteger_or_marker_p, 1, 1,
DEFUN ("natnump", Fnatnump, Snatnump, 1, 1, 0,
doc: /* Return t if OBJECT is a nonnegative integer. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (NATNUMP (object))
return Qt;
@@ -490,8 +460,7 @@ DEFUN ("natnump", Fnatnump, Snatnump, 1, 1, 0,
DEFUN ("numberp", Fnumberp, Snumberp, 1, 1, 0,
doc: /* Return t if OBJECT is a number (floating point or integer). */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (NUMBERP (object))
return Qt;
@@ -502,8 +471,7 @@ DEFUN ("numberp", Fnumberp, Snumberp, 1, 1, 0,
DEFUN ("number-or-marker-p", Fnumber_or_marker_p,
Snumber_or_marker_p, 1, 1, 0,
doc: /* Return t if OBJECT is a number or a marker. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (NUMBERP (object) || MARKERP (object))
return Qt;
@@ -512,8 +480,7 @@ DEFUN ("number-or-marker-p", Fnumber_or_marker_p,
DEFUN ("floatp", Ffloatp, Sfloatp, 1, 1, 0,
doc: /* Return t if OBJECT is a floating point number. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (FLOATP (object))
return Qt;
@@ -529,16 +496,14 @@ Error if arg is not nil and not a cons cell. See also `car-safe'.
See Info node `(elisp)Cons Cells' for a discussion of related basic
Lisp concepts such as car, cdr, cons cell and list. */)
- (list)
- register Lisp_Object list;
+ (register Lisp_Object list)
{
return CAR (list);
}
DEFUN ("car-safe", Fcar_safe, Scar_safe, 1, 1, 0,
doc: /* Return the car of OBJECT if it is a cons cell, or else nil. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
return CAR_SAFE (object);
}
@@ -549,24 +514,21 @@ Error if arg is not nil and not a cons cell. See also `cdr-safe'.
See Info node `(elisp)Cons Cells' for a discussion of related basic
Lisp concepts such as cdr, car, cons cell and list. */)
- (list)
- register Lisp_Object list;
+ (register Lisp_Object list)
{
return CDR (list);
}
DEFUN ("cdr-safe", Fcdr_safe, Scdr_safe, 1, 1, 0,
doc: /* Return the cdr of OBJECT if it is a cons cell, or else nil. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
return CDR_SAFE (object);
}
DEFUN ("setcar", Fsetcar, Ssetcar, 2, 2, 0,
doc: /* Set the car of CELL to be NEWCAR. Returns NEWCAR. */)
- (cell, newcar)
- register Lisp_Object cell, newcar;
+ (register Lisp_Object cell, Lisp_Object newcar)
{
CHECK_CONS (cell);
CHECK_IMPURE (cell);
@@ -576,8 +538,7 @@ DEFUN ("setcar", Fsetcar, Ssetcar, 2, 2, 0,
DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0,
doc: /* Set the cdr of CELL to be NEWCDR. Returns NEWCDR. */)
- (cell, newcdr)
- register Lisp_Object cell, newcdr;
+ (register Lisp_Object cell, Lisp_Object newcdr)
{
CHECK_CONS (cell);
CHECK_IMPURE (cell);
@@ -589,8 +550,7 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0,
DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0,
doc: /* Return t if SYMBOL's value is not void. */)
- (symbol)
- register Lisp_Object symbol;
+ (register Lisp_Object symbol)
{
Lisp_Object valcontents;
struct Lisp_Symbol *sym;
@@ -628,8 +588,7 @@ DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0,
DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0,
doc: /* Return t if SYMBOL's function definition is not void. */)
- (symbol)
- register Lisp_Object symbol;
+ (register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
return (EQ (XSYMBOL (symbol)->function, Qunbound) ? Qnil : Qt);
@@ -638,8 +597,7 @@ DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0,
DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0,
doc: /* Make SYMBOL's value be void.
Return SYMBOL. */)
- (symbol)
- register Lisp_Object symbol;
+ (register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
if (SYMBOL_CONSTANT_P (symbol))
@@ -651,8 +609,7 @@ Return SYMBOL. */)
DEFUN ("fmakunbound", Ffmakunbound, Sfmakunbound, 1, 1, 0,
doc: /* Make SYMBOL's function definition be void.
Return SYMBOL. */)
- (symbol)
- register Lisp_Object symbol;
+ (register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
if (NILP (symbol) || EQ (symbol, Qt))
@@ -663,8 +620,7 @@ Return SYMBOL. */)
DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0,
doc: /* Return SYMBOL's function definition. Error if that is void. */)
- (symbol)
- register Lisp_Object symbol;
+ (register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
if (!EQ (XSYMBOL (symbol)->function, Qunbound))
@@ -674,8 +630,7 @@ DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0,
DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0,
doc: /* Return SYMBOL's property list. */)
- (symbol)
- register Lisp_Object symbol;
+ (register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
return XSYMBOL (symbol)->plist;
@@ -683,8 +638,7 @@ DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0,
DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0,
doc: /* Return SYMBOL's name, a string. */)
- (symbol)
- register Lisp_Object symbol;
+ (register Lisp_Object symbol)
{
register Lisp_Object name;
@@ -695,8 +649,7 @@ DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0,
DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
doc: /* Set SYMBOL's function definition to DEFINITION, and return DEFINITION. */)
- (symbol, definition)
- register Lisp_Object symbol, definition;
+ (register Lisp_Object symbol, Lisp_Object definition)
{
register Lisp_Object function;
@@ -730,8 +683,7 @@ Associates the function with the current load file, if any.
The optional third argument DOCSTRING specifies the documentation string
for SYMBOL; if it is omitted or nil, SYMBOL uses the documentation string
determined by DEFINITION. */)
- (symbol, definition, docstring)
- register Lisp_Object symbol, definition, docstring;
+ (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring)
{
CHECK_SYMBOL (symbol);
if (CONSP (XSYMBOL (symbol)->function)
@@ -746,8 +698,7 @@ determined by DEFINITION. */)
DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0,
doc: /* Set SYMBOL's property list to NEWPLIST, and return NEWPLIST. */)
- (symbol, newplist)
- register Lisp_Object symbol, newplist;
+ (register Lisp_Object symbol, Lisp_Object newplist)
{
CHECK_SYMBOL (symbol);
XSYMBOL (symbol)->plist = newplist;
@@ -760,8 +711,7 @@ SUBR must be a built-in function.
The returned value is a pair (MIN . MAX). MIN is the minimum number
of args. MAX is the maximum number or the symbol `many', for a
function with `&rest' args, or `unevalled' for a special form. */)
- (subr)
- Lisp_Object subr;
+ (Lisp_Object subr)
{
short minargs, maxargs;
CHECK_SUBR (subr);
@@ -778,8 +728,7 @@ function with `&rest' args, or `unevalled' for a special form. */)
DEFUN ("subr-name", Fsubr_name, Ssubr_name, 1, 1, 0,
doc: /* Return name of subroutine SUBR.
SUBR must be a built-in function. */)
- (subr)
- Lisp_Object subr;
+ (Lisp_Object subr)
{
const char *name;
CHECK_SUBR (subr);
@@ -791,8 +740,7 @@ DEFUN ("interactive-form", Finteractive_form, Sinteractive_form, 1, 1, 0,
doc: /* Return the interactive form of CMD or nil if none.
If CMD is not a command, the return value is nil.
Value, if non-nil, is a list \(interactive SPEC). */)
- (cmd)
- Lisp_Object cmd;
+ (Lisp_Object cmd)
{
Lisp_Object fun = indirect_function (cmd); /* Check cycles. */
@@ -851,8 +799,7 @@ Value, if non-nil, is a list \(interactive SPEC). */)
indirections contains a loop. */
struct Lisp_Symbol *
-indirect_variable (symbol)
- struct Lisp_Symbol *symbol;
+indirect_variable (struct Lisp_Symbol *symbol)
{
struct Lisp_Symbol *tortoise, *hare;
@@ -885,8 +832,7 @@ If OBJECT is a symbol, follow all variable indirections and return the final
variable. If OBJECT is not a symbol, just return it.
Signal a cyclic-variable-indirection error if there is a loop in the
variable chain of symbols. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (SYMBOLP (object))
XSETSYMBOL (object, indirect_variable (XSYMBOL (object)));
@@ -903,8 +849,7 @@ variable chain of symbols. */)
((blv)->forwarded ? do_symval_forwarding (BLV_FWD (blv)) : BLV_VALUE (blv))
Lisp_Object
-do_symval_forwarding (valcontents)
- register union Lisp_Fwd *valcontents;
+do_symval_forwarding (register union Lisp_Fwd *valcontents)
{
register Lisp_Object val;
switch (XFWDTYPE (valcontents))
@@ -958,11 +903,7 @@ do_symval_forwarding (valcontents)
} while (0)
static void
-store_symval_forwarding (/* symbol, */ valcontents, newval, buf)
- /* struct Lisp_Symbol *symbol; */
- union Lisp_Fwd *valcontents;
- register Lisp_Object newval;
- struct buffer *buf;
+store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newval, struct buffer *buf)
{
switch (XFWDTYPE (valcontents))
{
@@ -1043,8 +984,7 @@ store_symval_forwarding (/* symbol, */ valcontents, newval, buf)
This makes it safe to alter the status of other bindings. */
void
-swap_in_global_binding (symbol)
- struct Lisp_Symbol *symbol;
+swap_in_global_binding (struct Lisp_Symbol *symbol)
{
struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (symbol);
@@ -1070,9 +1010,7 @@ swap_in_global_binding (symbol)
This could be another forwarding pointer. */
static void
-swap_in_symval_forwarding (symbol, blv)
- struct Lisp_Symbol *symbol;
- struct Lisp_Buffer_Local_Value *blv;
+swap_in_symval_forwarding (struct Lisp_Symbol *symbol, struct Lisp_Buffer_Local_Value *blv)
{
register Lisp_Object tem1;
@@ -1122,8 +1060,7 @@ swap_in_symval_forwarding (symbol, blv)
within this function. Great care is required for this. */
Lisp_Object
-find_symbol_value (symbol)
- Lisp_Object symbol;
+find_symbol_value (Lisp_Object symbol)
{
struct Lisp_Symbol *sym;
@@ -1150,8 +1087,7 @@ find_symbol_value (symbol)
DEFUN ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0,
doc: /* Return SYMBOL's value. Error if that is void. */)
- (symbol)
- Lisp_Object symbol;
+ (Lisp_Object symbol)
{
Lisp_Object val;
@@ -1164,8 +1100,7 @@ DEFUN ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0,
DEFUN ("set", Fset, Sset, 2, 2, 0,
doc: /* Set SYMBOL's value to NEWVAL, and return NEWVAL. */)
- (symbol, newval)
- register Lisp_Object symbol, newval;
+ (register Lisp_Object symbol, Lisp_Object newval)
{
set_internal (symbol, newval, Qnil, 0);
return newval;
@@ -1194,8 +1129,7 @@ let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol)
}
static int
-let_shadows_global_binding_p (symbol)
- Lisp_Object symbol;
+let_shadows_global_binding_p (Lisp_Object symbol)
{
struct specbinding *p;
@@ -1215,9 +1149,7 @@ let_shadows_global_binding_p (symbol)
If BINDFLAG is nonzero, we don't do that. */
void
-set_internal (symbol, newval, where, bindflag)
- register Lisp_Object symbol, newval, where;
- int bindflag;
+set_internal (register Lisp_Object symbol, register Lisp_Object newval, register Lisp_Object where, int bindflag)
{
int voide = EQ (newval, Qunbound);
struct Lisp_Symbol *sym;
@@ -1368,8 +1300,7 @@ set_internal (symbol, newval, where, bindflag)
Return Qunbound if it is void. */
Lisp_Object
-default_value (symbol)
- Lisp_Object symbol;
+default_value (Lisp_Object symbol)
{
struct Lisp_Symbol *sym;
@@ -1417,8 +1348,7 @@ DEFUN ("default-boundp", Fdefault_boundp, Sdefault_boundp, 1, 1, 0,
doc: /* Return t if SYMBOL has a non-void default value.
This is the value that is seen in buffers that do not have their own values
for this variable. */)
- (symbol)
- Lisp_Object symbol;
+ (Lisp_Object symbol)
{
register Lisp_Object value;
@@ -1431,8 +1361,7 @@ DEFUN ("default-value", Fdefault_value, Sdefault_value, 1, 1, 0,
This is the value that is seen in buffers that do not have their own values
for this variable. The default value is meaningful for variables with
local bindings in certain buffers. */)
- (symbol)
- Lisp_Object symbol;
+ (Lisp_Object symbol)
{
register Lisp_Object value;
@@ -1447,8 +1376,7 @@ DEFUN ("set-default", Fset_default, Sset_default, 2, 2, 0,
doc: /* Set SYMBOL's default value to VALUE. SYMBOL and VALUE are evaluated.
The default value is seen in buffers that do not have their own values
for this variable. */)
- (symbol, value)
- Lisp_Object symbol, value;
+ (Lisp_Object symbol, Lisp_Object value)
{
struct Lisp_Symbol *sym;
@@ -1527,8 +1455,7 @@ This sets each VAR's default value to the corresponding VALUE.
The VALUE for the Nth VAR can refer to the new default values
of previous VARs.
usage: (setq-default [VAR VALUE]...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object args_left;
register Lisp_Object val, symbol;
@@ -1602,8 +1529,7 @@ In most cases it is better to use `make-local-variable',
which makes a variable local in just one buffer.
The function `default-value' gets the default value and `set-default' sets it. */)
- (variable)
- register Lisp_Object variable;
+ (register Lisp_Object variable)
{
struct Lisp_Symbol *sym;
struct Lisp_Buffer_Local_Value *blv = NULL;
@@ -1680,8 +1606,7 @@ See also `make-variable-buffer-local'.
Do not use `make-local-variable' to make a hook variable buffer-local.
Instead, use `add-hook' and specify t for the LOCAL argument. */)
- (variable)
- register Lisp_Object variable;
+ (register Lisp_Object variable)
{
register Lisp_Object tem;
int forwarded;
@@ -1782,8 +1707,7 @@ DEFUN ("kill-local-variable", Fkill_local_variable, Skill_local_variable,
1, 1, "vKill Local Variable: ",
doc: /* Make VARIABLE no longer have a separate value in the current buffer.
From now on the default value will apply in this buffer. Return VARIABLE. */)
- (variable)
- register Lisp_Object variable;
+ (register Lisp_Object variable)
{
register Lisp_Object tem;
struct Lisp_Buffer_Local_Value *blv;
@@ -1871,8 +1795,7 @@ is to set the VARIABLE frame parameter of that frame. See
Note that since Emacs 23.1, variables cannot be both buffer-local and
frame-local any more (buffer-local bindings used to take precedence over
frame-local bindings). */)
- (variable)
- register Lisp_Object variable;
+ (register Lisp_Object variable)
{
int forwarded;
union Lisp_Val_Fwd valcontents;
@@ -1927,8 +1850,7 @@ DEFUN ("local-variable-p", Flocal_variable_p, Slocal_variable_p,
1, 2, 0,
doc: /* Non-nil if VARIABLE has a local binding in buffer BUFFER.
BUFFER defaults to the current buffer. */)
- (variable, buffer)
- register Lisp_Object variable, buffer;
+ (register Lisp_Object variable, Lisp_Object buffer)
{
register struct buffer *buf;
struct Lisp_Symbol *sym;
@@ -1992,8 +1914,7 @@ while it does not have a `let'-style binding that was made in BUFFER,
will produce a buffer local binding. See Info node
`(elisp)Creating Buffer-Local'.
BUFFER defaults to the current buffer. */)
- (variable, buffer)
- register Lisp_Object variable, buffer;
+ (register Lisp_Object variable, Lisp_Object buffer)
{
struct Lisp_Symbol *sym;
@@ -2026,8 +1947,7 @@ DEFUN ("variable-binding-locus", Fvariable_binding_locus, Svariable_binding_locu
If the current binding is buffer-local, the value is the current buffer.
If the current binding is frame-local, the value is the selected frame.
If the current binding is global (the default), the value is nil. */)
- (variable)
- register Lisp_Object variable;
+ (register Lisp_Object variable)
{
struct Lisp_Symbol *sym;
@@ -2068,7 +1988,7 @@ If the current binding is global (the default), the value is nil. */)
/* This code is disabled now that we use the selected frame to return
keyboard-local-values. */
#if 0
-extern struct terminal *get_terminal P_ ((Lisp_Object display, int));
+extern struct terminal *get_terminal (Lisp_Object display, int);
DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0,
doc: /* Return the terminal-local value of SYMBOL on TERMINAL.
@@ -2077,9 +1997,7 @@ value, like `symbol-value'.
TERMINAL may be a terminal object, a frame, or nil (meaning the
selected frame's terminal device). */)
- (symbol, terminal)
- Lisp_Object symbol;
- Lisp_Object terminal;
+ (Lisp_Object symbol, Lisp_Object terminal)
{
Lisp_Object result;
struct terminal *t = get_terminal (terminal, 1);
@@ -2096,10 +2014,7 @@ binding, like `set'.
TERMINAL may be a terminal object, a frame, or nil (meaning the
selected frame's terminal device). */)
- (symbol, terminal, value)
- Lisp_Object symbol;
- Lisp_Object terminal;
- Lisp_Object value;
+ (Lisp_Object symbol, Lisp_Object terminal, Lisp_Object value)
{
Lisp_Object result;
struct terminal *t = get_terminal (terminal, 1);
@@ -2120,8 +2035,7 @@ selected frame's terminal device). */)
This is like Findirect_function, except that it doesn't signal an
error if the chain ends up unbound. */
Lisp_Object
-indirect_function (object)
- register Lisp_Object object;
+indirect_function (register Lisp_Object object)
{
Lisp_Object tortoise, hare;
@@ -2153,9 +2067,7 @@ If the final symbol in the chain is unbound, signal a void-function error.
Optional arg NOERROR non-nil means to return nil instead of signalling.
Signal a cyclic-function-indirection error if there is a loop in the
function chain of symbols. */)
- (object, noerror)
- register Lisp_Object object;
- Lisp_Object noerror;
+ (register Lisp_Object object, Lisp_Object noerror)
{
Lisp_Object result;
@@ -2179,9 +2091,7 @@ DEFUN ("aref", Faref, Saref, 2, 2, 0,
doc: /* Return the element of ARRAY at index IDX.
ARRAY may be a vector, a string, a char-table, a bool-vector,
or a byte-code object. IDX starts at 0. */)
- (array, idx)
- register Lisp_Object array;
- Lisp_Object idx;
+ (register Lisp_Object array, Lisp_Object idx)
{
register int idxval;
@@ -2235,9 +2145,7 @@ DEFUN ("aset", Faset, Saset, 3, 3, 0,
doc: /* Store into the element of ARRAY at index IDX the value NEWELT.
Return NEWELT. ARRAY may be a vector, a string, a char-table or a
bool-vector. IDX starts at 0. */)
- (array, idx, newelt)
- register Lisp_Object array;
- Lisp_Object idx, newelt;
+ (register Lisp_Object array, Lisp_Object idx, Lisp_Object newelt)
{
register int idxval;
@@ -2295,13 +2203,13 @@ bool-vector. IDX starts at 0. */)
USE_SAFE_ALLOCA;
SAFE_ALLOCA (str, unsigned char *, nbytes);
- bcopy (SDATA (array), str, nbytes);
+ memcpy (str, SDATA (array), nbytes);
allocate_string_data (XSTRING (array), nchars,
nbytes + new_bytes - prev_bytes);
- bcopy (str, SDATA (array), idxval_byte);
+ memcpy (SDATA (array), str, idxval_byte);
p1 = SDATA (array) + idxval_byte;
- bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes,
- nbytes - (idxval_byte + prev_bytes));
+ memcpy (p1 + new_bytes, str + idxval_byte + prev_bytes,
+ nbytes - (idxval_byte + prev_bytes));
SAFE_FREE ();
clear_string_char_byte_cache ();
}
@@ -2337,9 +2245,7 @@ bool-vector. IDX starts at 0. */)
enum comparison { equal, notequal, less, grtr, less_or_equal, grtr_or_equal };
Lisp_Object
-arithcompare (num1, num2, comparison)
- Lisp_Object num1, num2;
- enum comparison comparison;
+arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison)
{
double f1 = 0, f2 = 0;
int floatp = 0;
@@ -2393,24 +2299,21 @@ arithcompare (num1, num2, comparison)
DEFUN ("=", Feqlsign, Seqlsign, 2, 2, 0,
doc: /* Return t if two args, both numbers or markers, are equal. */)
- (num1, num2)
- register Lisp_Object num1, num2;
+ (register Lisp_Object num1, Lisp_Object num2)
{
return arithcompare (num1, num2, equal);
}
DEFUN ("<", Flss, Slss, 2, 2, 0,
doc: /* Return t if first arg is less than second arg. Both must be numbers or markers. */)
- (num1, num2)
- register Lisp_Object num1, num2;
+ (register Lisp_Object num1, Lisp_Object num2)
{
return arithcompare (num1, num2, less);
}
DEFUN (">", Fgtr, Sgtr, 2, 2, 0,
doc: /* Return t if first arg is greater than second arg. Both must be numbers or markers. */)
- (num1, num2)
- register Lisp_Object num1, num2;
+ (register Lisp_Object num1, Lisp_Object num2)
{
return arithcompare (num1, num2, grtr);
}
@@ -2418,8 +2321,7 @@ DEFUN (">", Fgtr, Sgtr, 2, 2, 0,
DEFUN ("<=", Fleq, Sleq, 2, 2, 0,
doc: /* Return t if first arg is less than or equal to second arg.
Both must be numbers or markers. */)
- (num1, num2)
- register Lisp_Object num1, num2;
+ (register Lisp_Object num1, Lisp_Object num2)
{
return arithcompare (num1, num2, less_or_equal);
}
@@ -2427,24 +2329,21 @@ Both must be numbers or markers. */)
DEFUN (">=", Fgeq, Sgeq, 2, 2, 0,
doc: /* Return t if first arg is greater than or equal to second arg.
Both must be numbers or markers. */)
- (num1, num2)
- register Lisp_Object num1, num2;
+ (register Lisp_Object num1, Lisp_Object num2)
{
return arithcompare (num1, num2, grtr_or_equal);
}
DEFUN ("/=", Fneq, Sneq, 2, 2, 0,
doc: /* Return t if first arg is not equal to second arg. Both must be numbers or markers. */)
- (num1, num2)
- register Lisp_Object num1, num2;
+ (register Lisp_Object num1, Lisp_Object num2)
{
return arithcompare (num1, num2, notequal);
}
DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0,
doc: /* Return t if NUMBER is zero. */)
- (number)
- register Lisp_Object number;
+ (register Lisp_Object number)
{
CHECK_NUMBER_OR_FLOAT (number);
@@ -2465,8 +2364,7 @@ DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0,
when the value fits in one. */
Lisp_Object
-long_to_cons (i)
- unsigned long i;
+long_to_cons (long unsigned int i)
{
unsigned long top = i >> 16;
unsigned int bot = i & 0xFFFF;
@@ -2478,8 +2376,7 @@ long_to_cons (i)
}
unsigned long
-cons_to_long (c)
- Lisp_Object c;
+cons_to_long (Lisp_Object c)
{
Lisp_Object top, bot;
if (INTEGERP (c))
@@ -2495,8 +2392,7 @@ DEFUN ("number-to-string", Fnumber_to_string, Snumber_to_string, 1, 1, 0,
doc: /* Return the decimal representation of NUMBER as a string.
Uses a minus sign if negative.
NUMBER may be an integer or a floating point number. */)
- (number)
- Lisp_Object number;
+ (Lisp_Object number)
{
char buffer[VALBITS];
@@ -2520,8 +2416,7 @@ NUMBER may be an integer or a floating point number. */)
}
INLINE static int
-digit_to_number (character, base)
- int character, base;
+digit_to_number (int character, int base)
{
int digit;
@@ -2548,8 +2443,7 @@ It ignores leading spaces and tabs, and all trailing chars.
If BASE, interpret STRING as a number in that base. If BASE isn't
present, base 10 is used. BASE must be between 2 and 16 (inclusive).
If the base used is not 10, STRING is always parsed as integer. */)
- (string, base)
- register Lisp_Object string, base;
+ (register Lisp_Object string, Lisp_Object base)
{
register unsigned char *p;
register int b;
@@ -2616,15 +2510,12 @@ enum arithop
Amin
};
-static Lisp_Object float_arith_driver P_ ((double, int, enum arithop,
- int, Lisp_Object *));
-extern Lisp_Object fmod_float ();
+static Lisp_Object float_arith_driver (double, int, enum arithop,
+ int, Lisp_Object *);
+extern Lisp_Object fmod_float (Lisp_Object, Lisp_Object);
Lisp_Object
-arith_driver (code, nargs, args)
- enum arithop code;
- int nargs;
- register Lisp_Object *args;
+arith_driver (enum arithop code, int nargs, register Lisp_Object *args)
{
register Lisp_Object val;
register int argnum;
@@ -2709,12 +2600,7 @@ arith_driver (code, nargs, args)
#define isnan(x) ((x) != (x))
static Lisp_Object
-float_arith_driver (accum, argnum, code, nargs, args)
- double accum;
- register int argnum;
- enum arithop code;
- int nargs;
- register Lisp_Object *args;
+float_arith_driver (double accum, register int argnum, enum arithop code, int nargs, register Lisp_Object *args)
{
register Lisp_Object val;
double next;
@@ -2776,9 +2662,7 @@ float_arith_driver (accum, argnum, code, nargs, args)
DEFUN ("+", Fplus, Splus, 0, MANY, 0,
doc: /* Return sum of any number of arguments, which are numbers or markers.
usage: (+ &rest NUMBERS-OR-MARKERS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
return arith_driver (Aadd, nargs, args);
}
@@ -2788,9 +2672,7 @@ DEFUN ("-", Fminus, Sminus, 0, MANY, 0,
With one arg, negates it. With more than one arg,
subtracts all but the first from the first.
usage: (- &optional NUMBER-OR-MARKER &rest MORE-NUMBERS-OR-MARKERS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
return arith_driver (Asub, nargs, args);
}
@@ -2798,9 +2680,7 @@ usage: (- &optional NUMBER-OR-MARKER &rest MORE-NUMBERS-OR-MARKERS) */)
DEFUN ("*", Ftimes, Stimes, 0, MANY, 0,
doc: /* Return product of any number of arguments, which are numbers or markers.
usage: (* &rest NUMBERS-OR-MARKERS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
return arith_driver (Amult, nargs, args);
}
@@ -2809,9 +2689,7 @@ DEFUN ("/", Fquo, Squo, 2, MANY, 0,
doc: /* Return first argument divided by all the remaining arguments.
The arguments must be numbers or markers.
usage: (/ DIVIDEND DIVISOR &rest DIVISORS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
int argnum;
for (argnum = 2; argnum < nargs; argnum++)
@@ -2823,8 +2701,7 @@ usage: (/ DIVIDEND DIVISOR &rest DIVISORS) */)
DEFUN ("%", Frem, Srem, 2, 2, 0,
doc: /* Return remainder of X divided by Y.
Both must be integers or markers. */)
- (x, y)
- register Lisp_Object x, y;
+ (register Lisp_Object x, Lisp_Object y)
{
Lisp_Object val;
@@ -2865,8 +2742,7 @@ DEFUN ("mod", Fmod, Smod, 2, 2, 0,
doc: /* Return X modulo Y.
The result falls between zero (inclusive) and Y (exclusive).
Both X and Y must be numbers or markers. */)
- (x, y)
- register Lisp_Object x, y;
+ (register Lisp_Object x, Lisp_Object y)
{
Lisp_Object val;
EMACS_INT i1, i2;
@@ -2897,9 +2773,7 @@ DEFUN ("max", Fmax, Smax, 1, MANY, 0,
doc: /* Return largest of all the arguments (which must be numbers or markers).
The value is always a number; markers are converted to numbers.
usage: (max NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
return arith_driver (Amax, nargs, args);
}
@@ -2908,9 +2782,7 @@ DEFUN ("min", Fmin, Smin, 1, MANY, 0,
doc: /* Return smallest of all the arguments (which must be numbers or markers).
The value is always a number; markers are converted to numbers.
usage: (min NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
return arith_driver (Amin, nargs, args);
}
@@ -2919,9 +2791,7 @@ DEFUN ("logand", Flogand, Slogand, 0, MANY, 0,
doc: /* Return bitwise-and of all the arguments.
Arguments may be integers, or markers converted to integers.
usage: (logand &rest INTS-OR-MARKERS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
return arith_driver (Alogand, nargs, args);
}
@@ -2930,9 +2800,7 @@ DEFUN ("logior", Flogior, Slogior, 0, MANY, 0,
doc: /* Return bitwise-or of all the arguments.
Arguments may be integers, or markers converted to integers.
usage: (logior &rest INTS-OR-MARKERS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
return arith_driver (Alogior, nargs, args);
}
@@ -2941,9 +2809,7 @@ DEFUN ("logxor", Flogxor, Slogxor, 0, MANY, 0,
doc: /* Return bitwise-exclusive-or of all the arguments.
Arguments may be integers, or markers converted to integers.
usage: (logxor &rest INTS-OR-MARKERS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
return arith_driver (Alogxor, nargs, args);
}
@@ -2952,8 +2818,7 @@ DEFUN ("ash", Fash, Sash, 2, 2, 0,
doc: /* Return VALUE with its bits shifted left by COUNT.
If COUNT is negative, shifting is actually to the right.
In this case, the sign bit is duplicated. */)
- (value, count)
- register Lisp_Object value, count;
+ (register Lisp_Object value, Lisp_Object count)
{
register Lisp_Object val;
@@ -2975,8 +2840,7 @@ DEFUN ("lsh", Flsh, Slsh, 2, 2, 0,
doc: /* Return VALUE with its bits shifted left by COUNT.
If COUNT is negative, shifting is actually to the right.
In this case, zeros are shifted in on the left. */)
- (value, count)
- register Lisp_Object value, count;
+ (register Lisp_Object value, Lisp_Object count)
{
register Lisp_Object val;
@@ -2997,8 +2861,7 @@ In this case, zeros are shifted in on the left. */)
DEFUN ("1+", Fadd1, Sadd1, 1, 1, 0,
doc: /* Return NUMBER plus one. NUMBER may be a number or a marker.
Markers are converted to integers. */)
- (number)
- register Lisp_Object number;
+ (register Lisp_Object number)
{
CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (number);
@@ -3012,8 +2875,7 @@ Markers are converted to integers. */)
DEFUN ("1-", Fsub1, Ssub1, 1, 1, 0,
doc: /* Return NUMBER minus one. NUMBER may be a number or a marker.
Markers are converted to integers. */)
- (number)
- register Lisp_Object number;
+ (register Lisp_Object number)
{
CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (number);
@@ -3026,8 +2888,7 @@ Markers are converted to integers. */)
DEFUN ("lognot", Flognot, Slognot, 1, 1, 0,
doc: /* Return the bitwise complement of NUMBER. NUMBER must be an integer. */)
- (number)
- register Lisp_Object number;
+ (register Lisp_Object number)
{
CHECK_NUMBER (number);
XSETINT (number, ~XINT (number));
@@ -3038,7 +2899,7 @@ DEFUN ("byteorder", Fbyteorder, Sbyteorder, 0, 0, 0,
doc: /* Return the byteorder for the machine.
Returns 66 (ASCII uppercase B) for big endian machines or 108 (ASCII
lowercase l) for small endian machines. */)
- ()
+ (void)
{
unsigned i = 0x04030201;
int order = *(char *)&i == 1 ? 108 : 66;
@@ -3049,7 +2910,7 @@ lowercase l) for small endian machines. */)
void
-syms_of_data ()
+syms_of_data (void)
{
Lisp_Object error_tail, arith_tail;
@@ -3481,8 +3342,7 @@ syms_of_data ()
}
SIGTYPE
-arith_error (signo)
- int signo;
+arith_error (int signo)
{
sigsetmask (SIGEMPTYMASK);
@@ -3491,7 +3351,7 @@ arith_error (signo)
}
void
-init_data ()
+init_data (void)
{
/* Don't do this if just dumping out.
We don't want to call `signal' in this case
diff --git a/src/dbusbind.c b/src/dbusbind.c
index e813d0b5ad8..683d6f047fa 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -163,8 +163,7 @@ int xd_in_read_queued_messages = 0;
/* Determine the DBusType of a given Lisp symbol. OBJECT must be one
of the predefined D-Bus type symbols. */
static int
-xd_symbol_to_dbus_type (object)
- Lisp_Object object;
+xd_symbol_to_dbus_type (Lisp_Object object)
{
return
((EQ (object, QCdbus_type_byte)) ? DBUS_TYPE_BYTE
@@ -221,10 +220,7 @@ xd_symbol_to_dbus_type (object)
signature is embedded, or DBUS_TYPE_INVALID. It is needed for the
check that DBUS_TYPE_DICT_ENTRY occurs only as array element. */
static void
-xd_signature (signature, dtype, parent_type, object)
- char *signature;
- unsigned int dtype, parent_type;
- Lisp_Object object;
+xd_signature (char *signature, unsigned int dtype, unsigned int parent_type, Lisp_Object object)
{
unsigned int subtype;
Lisp_Object elt;
@@ -393,10 +389,7 @@ xd_signature (signature, dtype, parent_type, object)
`dbus-send-signal', into corresponding C values appended as
arguments to a D-Bus message. */
static void
-xd_append_arg (dtype, object, iter)
- unsigned int dtype;
- Lisp_Object object;
- DBusMessageIter *iter;
+xd_append_arg (unsigned int dtype, Lisp_Object object, DBusMessageIter *iter)
{
char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH];
DBusMessageIter subiter;
@@ -604,9 +597,7 @@ xd_append_arg (dtype, object, iter)
D-Bus message must be a valid DBusType. Compound D-Bus types
result always in a Lisp list. */
static Lisp_Object
-xd_retrieve_arg (dtype, iter)
- unsigned int dtype;
- DBusMessageIter *iter;
+xd_retrieve_arg (unsigned int dtype, DBusMessageIter *iter)
{
switch (dtype)
@@ -723,10 +714,11 @@ xd_retrieve_arg (dtype, iter)
}
/* Initialize D-Bus connection. BUS is a Lisp symbol, either :system
- or :session. It tells which D-Bus to be initialized. */
+ or :session. It tells which D-Bus to initialize. If RAISE_ERROR
+ is non-zero signal an error when the connection cannot be
+ initialized. */
static DBusConnection *
-xd_initialize (bus)
- Lisp_Object bus;
+xd_initialize (Lisp_Object bus, int raise_error)
{
DBusConnection *connection;
DBusError derror;
@@ -734,12 +726,18 @@ xd_initialize (bus)
/* Parameter check. */
CHECK_SYMBOL (bus);
if (!(EQ (bus, QCdbus_system_bus) || EQ (bus, QCdbus_session_bus)))
- XD_SIGNAL2 (build_string ("Wrong bus name"), bus);
+ if (raise_error)
+ XD_SIGNAL2 (build_string ("Wrong bus name"), bus);
+ else
+ return NULL;
/* We do not want to have an autolaunch for the session bus. */
if (EQ (bus, QCdbus_session_bus)
&& getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL)
- XD_SIGNAL2 (build_string ("No connection to bus"), bus);
+ if (raise_error)
+ XD_SIGNAL2 (build_string ("No connection to bus"), bus);
+ else
+ return NULL;
/* Open a connection to the bus. */
dbus_error_init (&derror);
@@ -750,9 +748,12 @@ xd_initialize (bus)
connection = dbus_bus_get (DBUS_BUS_SESSION, &derror);
if (dbus_error_is_set (&derror))
- XD_ERROR (derror);
+ if (raise_error)
+ XD_ERROR (derror);
+ else
+ connection = NULL;
- if (connection == NULL)
+ if (connection == NULL && raise_error)
XD_SIGNAL2 (build_string ("No connection to bus"), bus);
/* Cleanup. */
@@ -766,9 +767,7 @@ xd_initialize (bus)
/* Add connection file descriptor to input_wait_mask, in order to
let select() detect, whether a new message has been arrived. */
dbus_bool_t
-xd_add_watch (watch, data)
- DBusWatch *watch;
- void *data;
+xd_add_watch (DBusWatch *watch, void *data)
{
/* We check only for incoming data. */
if (dbus_watch_get_flags (watch) & DBUS_WATCH_READABLE)
@@ -797,9 +796,7 @@ xd_add_watch (watch, data)
/* Remove connection file descriptor from input_wait_mask. DATA is
the used bus, either QCdbus_system_bus or QCdbus_session_bus. */
void
-xd_remove_watch (watch, data)
- DBusWatch *watch;
- void *data;
+xd_remove_watch (DBusWatch *watch, void *data)
{
/* We check only for incoming data. */
if (dbus_watch_get_flags (watch) & DBUS_WATCH_READABLE)
@@ -835,8 +832,7 @@ xd_remove_watch (watch, data)
DEFUN ("dbus-init-bus", Fdbus_init_bus, Sdbus_init_bus, 1, 1, 0,
doc: /* Initialize connection to D-Bus BUS.
This is an internal function, it shall not be used outside dbus.el. */)
- (bus)
- Lisp_Object bus;
+ (Lisp_Object bus)
{
DBusConnection *connection;
@@ -844,7 +840,7 @@ This is an internal function, it shall not be used outside dbus.el. */)
CHECK_SYMBOL (bus);
/* Open a connection to the bus. */
- connection = xd_initialize (bus);
+ connection = xd_initialize (bus, TRUE);
/* Add the watch functions. We pass also the bus as data, in order
to distinguish between the busses in xd_remove_watch. */
@@ -861,8 +857,7 @@ This is an internal function, it shall not be used outside dbus.el. */)
DEFUN ("dbus-get-unique-name", Fdbus_get_unique_name, Sdbus_get_unique_name,
1, 1, 0,
doc: /* Return the unique name of Emacs registered at D-Bus BUS. */)
- (bus)
- Lisp_Object bus;
+ (Lisp_Object bus)
{
DBusConnection *connection;
const char *name;
@@ -871,7 +866,7 @@ DEFUN ("dbus-get-unique-name", Fdbus_get_unique_name, Sdbus_get_unique_name,
CHECK_SYMBOL (bus);
/* Open a connection to the bus. */
- connection = xd_initialize (bus);
+ connection = xd_initialize (bus, TRUE);
/* Request the name. */
name = dbus_bus_get_unique_name (connection);
@@ -950,9 +945,7 @@ object is returned instead of a list containing this single Lisp object.
=> "i686"
usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &optional :timeout TIMEOUT &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
Lisp_Object bus, service, path, interface, method;
Lisp_Object result;
@@ -988,7 +981,7 @@ usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &optional :timeout TI
SDATA (method));
/* Open a connection to the bus. */
- connection = xd_initialize (bus);
+ connection = xd_initialize (bus, TRUE);
/* Create the message. */
dmessage = dbus_message_new_method_call (SDATA (service),
@@ -1134,9 +1127,7 @@ Example:
-| i686
usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLER &optional :timeout TIMEOUT &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
Lisp_Object bus, service, path, interface, method, handler;
Lisp_Object result;
@@ -1173,7 +1164,7 @@ usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLE
SDATA (method));
/* Open a connection to the bus. */
- connection = xd_initialize (bus);
+ connection = xd_initialize (bus, TRUE);
/* Create the message. */
dmessage = dbus_message_new_method_call (SDATA (service),
@@ -1264,9 +1255,7 @@ DEFUN ("dbus-method-return-internal", Fdbus_method_return_internal,
This is an internal function, it shall not be used outside dbus.el.
usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
Lisp_Object bus, serial, service;
struct gcpro gcpro1, gcpro2, gcpro3;
@@ -1290,7 +1279,7 @@ usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS) */)
XD_DEBUG_MESSAGE ("%lu %s ", (unsigned long) XUINT (serial), SDATA (service));
/* Open a connection to the bus. */
- connection = xd_initialize (bus);
+ connection = xd_initialize (bus, TRUE);
/* Create the message. */
dmessage = dbus_message_new (DBUS_MESSAGE_TYPE_METHOD_RETURN);
@@ -1358,9 +1347,7 @@ DEFUN ("dbus-method-error-internal", Fdbus_method_error_internal,
This is an internal function, it shall not be used outside dbus.el.
usage: (dbus-method-error-internal BUS SERIAL SERVICE &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
Lisp_Object bus, serial, service;
struct gcpro gcpro1, gcpro2, gcpro3;
@@ -1384,7 +1371,7 @@ usage: (dbus-method-error-internal BUS SERIAL SERVICE &rest ARGS) */)
XD_DEBUG_MESSAGE ("%lu %s ", (unsigned long) XUINT (serial), SDATA (service));
/* Open a connection to the bus. */
- connection = xd_initialize (bus);
+ connection = xd_initialize (bus, TRUE);
/* Create the message. */
dmessage = dbus_message_new (DBUS_MESSAGE_TYPE_ERROR);
@@ -1475,9 +1462,7 @@ Example:
"org.gnu.Emacs.FileManager" "FileModified" "/home/albinus/.emacs")
usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
Lisp_Object bus, service, path, interface, signal;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
@@ -1509,7 +1494,7 @@ usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */)
SDATA (signal));
/* Open a connection to the bus. */
- connection = xd_initialize (bus);
+ connection = xd_initialize (bus, TRUE);
/* Create the message. */
dmessage = dbus_message_new_signal (SDATA (path),
@@ -1569,13 +1554,13 @@ usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */)
/* Check, whether there is pending input in the message queue of the
D-Bus BUS. BUS is a Lisp symbol, either :system or :session. */
int
-xd_get_dispatch_status (bus)
- Lisp_Object bus;
+xd_get_dispatch_status (Lisp_Object bus)
{
DBusConnection *connection;
/* Open a connection to the bus. */
- connection = xd_initialize (bus);
+ connection = xd_initialize (bus, FALSE);
+ if (connection == NULL) return FALSE;
/* Non blocking read of the next available message. */
dbus_connection_read_write (connection, 0);
@@ -1589,7 +1574,7 @@ xd_get_dispatch_status (bus)
/* Check for queued incoming messages from the system and session buses. */
int
-xd_pending_messages ()
+xd_pending_messages (void)
{
/* Vdbus_registered_objects_table will be initialized as hash table
@@ -1606,8 +1591,7 @@ xd_pending_messages ()
/* Read queued incoming message of the D-Bus BUS. BUS is a Lisp
symbol, either :system or :session. */
static Lisp_Object
-xd_read_message (bus)
- Lisp_Object bus;
+xd_read_message (Lisp_Object bus)
{
Lisp_Object args, key, value;
struct gcpro gcpro1;
@@ -1620,7 +1604,7 @@ xd_read_message (bus)
const char *uname, *path, *interface, *member;
/* Open a connection to the bus. */
- connection = xd_initialize (bus);
+ connection = xd_initialize (bus, TRUE);
/* Non blocking read of the next available message. */
dbus_connection_read_write (connection, 0);
@@ -1764,7 +1748,7 @@ xd_read_message (bus)
/* Read queued incoming messages from the system and session buses. */
void
-xd_read_queued_messages ()
+xd_read_queued_messages (void)
{
/* Vdbus_registered_objects_table will be initialized as hash table
@@ -1819,9 +1803,7 @@ INTERFACE, SIGNAL and HANDLER must not be nil. Example:
`dbus-unregister-object' for removing the registration.
usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
Lisp_Object bus, service, path, interface, signal, handler;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
@@ -1872,7 +1854,7 @@ usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARG
if (NILP (uname) || (SBYTES (uname) > 0))
{
/* Open a connection to the bus. */
- connection = xd_initialize (bus);
+ connection = xd_initialize (bus, TRUE);
/* Create a rule to receive related signals. */
sprintf (rule,
@@ -1943,8 +1925,7 @@ interface offered by SERVICE. It must provide METHOD. HANDLER is a
Lisp function to be called when a method call is received. It must
accept the input arguments of METHOD. The return value of HANDLER is
used for composing the returning D-Bus message. */)
- (bus, service, path, interface, method, handler)
- Lisp_Object bus, service, path, interface, method, handler;
+ (Lisp_Object bus, Lisp_Object service, Lisp_Object path, Lisp_Object interface, Lisp_Object method, Lisp_Object handler)
{
Lisp_Object key, key1, value;
DBusConnection *connection;
@@ -1963,7 +1944,7 @@ used for composing the returning D-Bus message. */)
a segmentation fault. */
/* Open a connection to the bus. */
- connection = xd_initialize (bus);
+ connection = xd_initialize (bus, TRUE);
/* Request the known name from the bus. We can ignore the result,
it is set to -1 if there is an error - kind of redundancy. */
@@ -1990,7 +1971,7 @@ used for composing the returning D-Bus message. */)
void
-syms_of_dbusbind ()
+syms_of_dbusbind (void)
{
Qdbus_init_bus = intern_c_string ("dbus-init-bus");
diff --git a/src/dired.c b/src/dired.c
index a3ea23df2f6..cdb4545e81c 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -90,10 +90,10 @@ extern struct direct *readdir ();
#include "blockinput.h"
/* Returns a search buffer, with a fastmap allocated and ready to go. */
-extern struct re_pattern_buffer *compile_pattern ();
+extern struct re_pattern_buffer *compile_pattern (Lisp_Object, struct re_registers *, Lisp_Object, int, int);
/* From filemode.c. Can't go in Lisp.h because of `stat'. */
-extern void filemodestring P_ ((struct stat *, char *));
+extern void filemodestring (struct stat *, char *);
/* if system does not have symbolic links, it does not have lstat.
In that case, use ordinary stat instead. */
@@ -115,7 +115,7 @@ Lisp_Object Qfile_name_all_completions;
Lisp_Object Qfile_attributes;
Lisp_Object Qfile_attributes_lessp;
-static int scmp P_ ((unsigned char *, unsigned char *, int));
+static int scmp (unsigned char *, unsigned char *, int);
#ifdef WINDOWSNT
Lisp_Object
@@ -127,8 +127,7 @@ directory_files_internal_w32_unwind (Lisp_Object arg)
#endif
Lisp_Object
-directory_files_internal_unwind (dh)
- Lisp_Object dh;
+directory_files_internal_unwind (Lisp_Object dh)
{
DIR *d = (DIR *) XSAVE_VALUE (dh)->pointer;
BLOCK_INPUT;
@@ -143,10 +142,7 @@ directory_files_internal_unwind (dh)
In the latter case, ID_FORMAT is passed to Ffile_attributes. */
Lisp_Object
-directory_files_internal (directory, full, match, nosort, attrs, id_format)
- Lisp_Object directory, full, match, nosort;
- int attrs;
- Lisp_Object id_format;
+directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, int attrs, Lisp_Object id_format)
{
DIR *d;
int directory_nbytes;
@@ -293,15 +289,14 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format)
int nchars;
fullname = make_uninit_multibyte_string (nbytes, nbytes);
- bcopy (SDATA (directory), SDATA (fullname),
- directory_nbytes);
+ memcpy (SDATA (fullname), SDATA (directory),
+ directory_nbytes);
if (needsep)
SSET (fullname, directory_nbytes, DIRECTORY_SEP);
- bcopy (SDATA (name),
- SDATA (fullname) + directory_nbytes + needsep,
- len);
+ memcpy (SDATA (fullname) + directory_nbytes + needsep,
+ SDATA (name), len);
nchars = chars_in_text (SDATA (fullname), nbytes);
@@ -371,8 +366,7 @@ If MATCH is non-nil, mention only file names that match the regexp MATCH.
If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
Otherwise, the list returned is sorted with `string-lessp'.
NOSORT is useful if you plan to sort the result yourself. */)
- (directory, full, match, nosort)
- Lisp_Object directory, full, match, nosort;
+ (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort)
{
Lisp_Object handler;
directory = Fexpand_file_name (directory, Qnil);
@@ -400,8 +394,7 @@ ID-FORMAT specifies the preferred format of attributes uid and gid, see
`file-attributes' for further documentation.
On MS-Windows, performance depends on `w32-get-true-file-attributes',
which see. */)
- (directory, full, match, nosort, id_format)
- Lisp_Object directory, full, match, nosort, id_format;
+ (Lisp_Object directory, Lisp_Object full, Lisp_Object match, Lisp_Object nosort, Lisp_Object id_format)
{
Lisp_Object handler;
directory = Fexpand_file_name (directory, Qnil);
@@ -417,7 +410,7 @@ which see. */)
}
-Lisp_Object file_name_completion ();
+Lisp_Object file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag, Lisp_Object predicate);
DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion,
2, 3, 0,
@@ -432,8 +425,7 @@ completion (in absolute form) and ignore it if PREDICATE returns nil.
This function ignores some of the possible completions as
determined by the variable `completion-ignored-extensions', which see. */)
- (file, directory, predicate)
- Lisp_Object file, directory, predicate;
+ (Lisp_Object file, Lisp_Object directory, Lisp_Object predicate)
{
Lisp_Object handler;
@@ -456,8 +448,7 @@ DEFUN ("file-name-all-completions", Ffile_name_all_completions,
Sfile_name_all_completions, 2, 2, 0,
doc: /* Return a list of all completions of file name FILE in directory DIRECTORY.
These are all file names in directory DIRECTORY which begin with FILE. */)
- (file, directory)
- Lisp_Object file, directory;
+ (Lisp_Object file, Lisp_Object directory)
{
Lisp_Object handler;
@@ -476,14 +467,11 @@ These are all file names in directory DIRECTORY which begin with FILE. */)
return file_name_completion (file, directory, 1, 0, Qnil);
}
-static int file_name_completion_stat ();
+static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr);
Lisp_Object Qdefault_directory;
Lisp_Object
-file_name_completion (file, dirname, all_flag, ver_flag, predicate)
- Lisp_Object file, dirname;
- int all_flag, ver_flag;
- Lisp_Object predicate;
+file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag, Lisp_Object predicate)
{
DIR *d;
int bestmatchsize = 0;
@@ -825,9 +813,7 @@ file_name_completion (file, dirname, all_flag, ver_flag, predicate)
else number of chars that match at the beginning. */
static int
-scmp (s1, s2, len)
- register unsigned char *s1, *s2;
- int len;
+scmp (register unsigned char *s1, register unsigned char *s2, int len)
{
register int l = len;
@@ -848,10 +834,7 @@ scmp (s1, s2, len)
}
static int
-file_name_completion_stat (dirname, dp, st_addr)
- Lisp_Object dirname;
- DIRENTRY *dp;
- struct stat *st_addr;
+file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr)
{
int len = NAMLEN (dp);
int pos = SCHARS (dirname);
@@ -869,11 +852,11 @@ file_name_completion_stat (dirname, dp, st_addr)
_djstat_flags = _STAT_INODE | _STAT_EXEC_MAGIC | _STAT_DIRSIZE;
#endif /* MSDOS */
- bcopy (SDATA (dirname), fullname, pos);
+ memcpy (fullname, SDATA (dirname), pos);
if (!IS_DIRECTORY_SEP (fullname[pos - 1]))
fullname[pos++] = DIRECTORY_SEP;
- bcopy (dp->d_name, fullname + pos, len);
+ memcpy (fullname + pos, dp->d_name, len);
fullname[pos + len] = 0;
#ifdef S_IFLNK
@@ -893,8 +876,7 @@ file_name_completion_stat (dirname, dp, st_addr)
}
Lisp_Object
-make_time (time)
- time_t time;
+make_time (time_t time)
{
return Fcons (make_number (time >> 16),
Fcons (make_number (time & 0177777), Qnil));
@@ -973,16 +955,15 @@ which see.
On some FAT-based filesystems, only the date of last access is recorded,
so last access time will always be midnight of that day. */)
- (filename, id_format)
- Lisp_Object filename, id_format;
+ (Lisp_Object filename, Lisp_Object id_format)
{
Lisp_Object values[12];
Lisp_Object encoded;
struct stat s;
-#if defined (BSD4_2) || defined (BSD4_3)
+#ifdef BSD4_2
Lisp_Object dirname;
struct stat sdir;
-#endif
+#endif /* BSD4_2 */
char modes[10];
Lisp_Object handler;
struct gcpro gcpro1;
@@ -1049,7 +1030,7 @@ so last access time will always be midnight of that day. */)
filemodestring (&s, modes);
values[8] = make_string (modes, 10);
-#if defined (BSD4_2) || defined (BSD4_3) /* file gid will be dir gid */
+#ifdef BSD4_2 /* file gid will be dir gid */
dirname = Ffile_name_directory (filename);
if (! NILP (dirname))
encoded = ENCODE_FILE (dirname);
@@ -1059,7 +1040,7 @@ so last access time will always be midnight of that day. */)
values[9] = Qt;
#else /* file gid will be egid */
values[9] = (s.st_gid != getegid ()) ? Qt : Qnil;
-#endif /* BSD4_2 (or BSD4_3) */
+#endif /* not BSD4_2 */
if (!FIXNUM_OVERFLOW_P (s.st_ino))
/* Keep the most common cases as integers. */
values[10] = make_number (s.st_ino);
@@ -1096,14 +1077,13 @@ so last access time will always be midnight of that day. */)
DEFUN ("file-attributes-lessp", Ffile_attributes_lessp, Sfile_attributes_lessp, 2, 2, 0,
doc: /* Return t if first arg file attributes list is less than second.
Comparison is in lexicographic order and case is significant. */)
- (f1, f2)
- Lisp_Object f1, f2;
+ (Lisp_Object f1, Lisp_Object f2)
{
return Fstring_lessp (Fcar (f1), Fcar (f2));
}
void
-syms_of_dired ()
+syms_of_dired (void)
{
Qdirectory_files = intern_c_string ("directory-files");
Qdirectory_files_and_attributes = intern_c_string ("directory-files-and-attributes");
diff --git a/src/dispextern.h b/src/dispextern.h
index f0d14c0e487..5ca7e813a1e 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -105,6 +105,8 @@ enum window_part
/* Number of bits allocated to store fringe bitmap numbers. */
#define FRINGE_ID_BITS 16
+/* Number of bits allocated to store fringe bitmap height. */
+#define FRINGE_HEIGHT_BITS 8
/***********************************************************************
@@ -642,7 +644,7 @@ struct glyph_matrix
This aborts if any pointer is found twice. */
#if GLYPH_DEBUG
-void check_matrix_pointer_lossage P_ ((struct glyph_matrix *));
+void check_matrix_pointer_lossage (struct glyph_matrix *);
#define CHECK_MATRIX(MATRIX) check_matrix_pointer_lossage ((MATRIX))
#else
#define CHECK_MATRIX(MATRIX) (void) 0
@@ -800,6 +802,12 @@ struct glyph_row
/* Face of the right fringe glyph. */
unsigned right_fringe_face_id : FACE_ID_BITS;
+ /* Vertical offset of the left fringe bitmap. */
+ signed left_fringe_offset : FRINGE_HEIGHT_BITS;
+
+ /* Vertical offset of the right fringe bitmap. */
+ signed right_fringe_offset : FRINGE_HEIGHT_BITS;
+
/* 1 means that we must draw the bitmaps of this row. */
unsigned redraw_fringe_bitmaps_p : 1;
@@ -914,7 +922,7 @@ struct glyph_row
we don't try to access rows that are out of bounds. */
#if GLYPH_DEBUG
-struct glyph_row *matrix_row P_ ((struct glyph_matrix *, int));
+struct glyph_row *matrix_row (struct glyph_matrix *, int);
#define MATRIX_ROW(MATRIX, ROW) matrix_row ((MATRIX), (ROW))
#else
#define MATRIX_ROW(MATRIX, ROW) ((MATRIX)->rows + (ROW))
@@ -2478,7 +2486,7 @@ struct run
/* Handlers for setting frame parameters. */
-typedef void (*frame_parm_handler) P_ ((struct frame *, Lisp_Object, Lisp_Object));
+typedef void (*frame_parm_handler) (struct frame *, Lisp_Object, Lisp_Object);
/* Structure holding system-dependent interface functions needed
@@ -2491,110 +2499,110 @@ struct redisplay_interface
/* Produce glyphs/get display metrics for the display element IT is
loaded with. */
- void (*produce_glyphs) P_ ((struct it *it));
+ void (*produce_glyphs) (struct it *it);
/* Write or insert LEN glyphs from STRING at the nominal output
position. */
- void (*write_glyphs) P_ ((struct glyph *string, int len));
- void (*insert_glyphs) P_ ((struct glyph *start, int len));
+ void (*write_glyphs) (struct glyph *string, int len);
+ void (*insert_glyphs) (struct glyph *start, int len);
/* Clear from nominal output position to X. X < 0 means clear
to right end of display. */
- void (*clear_end_of_line) P_ ((int x));
+ void (*clear_end_of_line) (int x);
/* Function to call to scroll the display as described by RUN on
window W. */
- void (*scroll_run_hook) P_ ((struct window *w, struct run *run));
+ void (*scroll_run_hook) (struct window *w, struct run *run);
/* Function to call after a line in a display has been completely
updated. Used to draw truncation marks and alike. DESIRED_ROW
is the desired row which has been updated. */
- void (*after_update_window_line_hook) P_ ((struct glyph_row *desired_row));
+ void (*after_update_window_line_hook) (struct glyph_row *desired_row);
/* Function to call before beginning to update window W in
window-based redisplay. */
- void (*update_window_begin_hook) P_ ((struct window *w));
+ void (*update_window_begin_hook) (struct window *w);
/* Function to call after window W has been updated in window-based
redisplay. CURSOR_ON_P non-zero means switch cursor on.
MOUSE_FACE_OVERWRITTEN_P non-zero means that some lines in W
that contained glyphs in mouse-face were overwritten, so we
have to update the mouse highlight. */
- void (*update_window_end_hook) P_ ((struct window *w, int cursor_on_p,
- int mouse_face_overwritten_p));
+ void (*update_window_end_hook) (struct window *w, int cursor_on_p,
+ int mouse_face_overwritten_p);
/* Move cursor to row/column position VPOS/HPOS, pixel coordinates
Y/X. HPOS/VPOS are window-relative row and column numbers and X/Y
are window-relative pixel positions. */
- void (*cursor_to) P_ ((int vpos, int hpos, int y, int x));
+ void (*cursor_to) (int vpos, int hpos, int y, int x);
/* Flush the display of frame F. For X, this is XFlush. */
- void (*flush_display) P_ ((struct frame *f));
+ void (*flush_display) (struct frame *f);
/* Flush the display of frame F if non-NULL. This is called
during redisplay, and should be NULL on systems which flushes
automatically before reading input. */
- void (*flush_display_optional) P_ ((struct frame *f));
+ void (*flush_display_optional) (struct frame *f);
/* Clear the mouse hightlight in window W, if there is any. */
- void (*clear_window_mouse_face) P_ ((struct window *w));
+ void (*clear_window_mouse_face) (struct window *w);
/* Set *LEFT and *RIGHT to the left and right overhang of GLYPH on
frame F. */
- void (*get_glyph_overhangs) P_ ((struct glyph *glyph, struct frame *f,
- int *left, int *right));
+ void (*get_glyph_overhangs) (struct glyph *glyph, struct frame *f,
+ int *left, int *right);
/* Fix the display of AREA of ROW in window W for overlapping rows.
This function is called from redraw_overlapping_rows after
desired rows have been made current. */
- void (*fix_overlapping_area) P_ ((struct window *w, struct glyph_row *row,
- enum glyph_row_area area, int));
+ void (*fix_overlapping_area) (struct window *w, struct glyph_row *row,
+ enum glyph_row_area area, int);
#ifdef HAVE_WINDOW_SYSTEM
/* Draw a fringe bitmap in window W of row ROW using parameters P. */
- void (*draw_fringe_bitmap) P_ ((struct window *w, struct glyph_row *row,
- struct draw_fringe_bitmap_params *p));
+ void (*draw_fringe_bitmap) (struct window *w, struct glyph_row *row,
+ struct draw_fringe_bitmap_params *p);
/* Define and destroy fringe bitmap no. WHICH. */
- void (*define_fringe_bitmap) P_ ((int which, unsigned short *bits,
- int h, int wd));
- void (*destroy_fringe_bitmap) P_ ((int which));
+ void (*define_fringe_bitmap) (int which, unsigned short *bits,
+ int h, int wd);
+ void (*destroy_fringe_bitmap) (int which);
/* Compute left and right overhang of glyph string S.
A NULL pointer if platform does not support this. */
- void (*compute_glyph_string_overhangs) P_ ((struct glyph_string *s));
+ void (*compute_glyph_string_overhangs) (struct glyph_string *s);
/* Draw a glyph string S. */
- void (*draw_glyph_string) P_ ((struct glyph_string *s));
+ void (*draw_glyph_string) (struct glyph_string *s);
/* Define cursor CURSOR on frame F. */
- void (*define_frame_cursor) P_ ((struct frame *f, Cursor cursor));
+ void (*define_frame_cursor) (struct frame *f, Cursor cursor);
/* Clear the area at (X,Y,WIDTH,HEIGHT) of frame F. */
- void (*clear_frame_area) P_ ((struct frame *f, int x, int y,
- int width, int height));
+ void (*clear_frame_area) (struct frame *f, int x, int y,
+ int width, int height);
/* Draw specified cursor CURSOR_TYPE of width CURSOR_WIDTH
at row GLYPH_ROW on window W if ON_P is 1. If ON_P is
0, don't draw cursor. If ACTIVE_P is 1, system caret
should track this cursor (when applicable). */
- void (*draw_window_cursor) P_ ((struct window *w,
- struct glyph_row *glyph_row,
- int x, int y,
- int cursor_type, int cursor_width,
- int on_p, int active_p));
+ void (*draw_window_cursor) (struct window *w,
+ struct glyph_row *glyph_row,
+ int x, int y,
+ int cursor_type, int cursor_width,
+ int on_p, int active_p);
/* Draw vertical border for window W from (X,Y0) to (X,Y1). */
- void (*draw_vertical_window_border) P_ ((struct window *w,
- int x, int y0, int y1));
+ void (*draw_vertical_window_border) (struct window *w,
+ int x, int y0, int y1);
/* Shift display of frame F to make room for inserted glyphs.
The area at pixel (X,Y) of width WIDTH and height HEIGHT is
shifted right by SHIFT_BY pixels. */
- void (*shift_glyphs_for_insert) P_ ((struct frame *f,
- int x, int y, int width,
- int height, int shift_by));
+ void (*shift_glyphs_for_insert) (struct frame *f,
+ int x, int y, int width,
+ int height, int shift_by);
#endif /* HAVE_WINDOW_SYSTEM */
};
@@ -2621,14 +2629,14 @@ struct image_type
/* Check that SPEC is a valid image specification for the given
image type. Value is non-zero if SPEC is valid. */
- int (* valid_p) P_ ((Lisp_Object spec));
+ int (* valid_p) (Lisp_Object spec);
/* Load IMG which is used on frame F from information contained in
IMG->spec. Value is non-zero if successful. */
- int (* load) P_ ((struct frame *f, struct image *img));
+ int (* load) (struct frame *f, struct image *img);
/* Free resources of image IMG which is used on frame F. */
- void (* free) P_ ((struct frame *f, struct image *img));
+ void (* free) (struct frame *f, struct image *img);
/* Next in list of all supported image types. */
struct image_type *next;
@@ -2885,65 +2893,65 @@ extern EMACS_INT tool_bar_button_relief;
/* Defined in bidi.c */
-extern void bidi_init_it P_ ((EMACS_INT, EMACS_INT, struct bidi_it *));
-extern void bidi_move_to_visually_next P_ ((struct bidi_it *));
-extern void bidi_paragraph_init P_ ((bidi_dir_t, struct bidi_it *));
-extern int bidi_mirror_char P_ ((int));
+extern void bidi_init_it (EMACS_INT, EMACS_INT, struct bidi_it *);
+extern void bidi_move_to_visually_next (struct bidi_it *);
+extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *);
+extern int bidi_mirror_char (int);
/* Defined in xdisp.c */
-struct glyph_row *row_containing_pos P_ ((struct window *, int,
- struct glyph_row *,
- struct glyph_row *, int));
-EMACS_INT string_buffer_position P_ ((struct window *, Lisp_Object,
- EMACS_INT));
-int line_bottom_y P_ ((struct it *));
-int display_prop_intangible_p P_ ((Lisp_Object));
-void resize_echo_area_exactly P_ ((void));
-int resize_mini_window P_ ((struct window *, int));
-int try_window P_ ((Lisp_Object, struct text_pos, int));
-void window_box P_ ((struct window *, int, int *, int *, int *, int *));
-int window_box_height P_ ((struct window *));
-int window_text_bottom_y P_ ((struct window *));
-int window_box_width P_ ((struct window *, int));
-int window_box_left P_ ((struct window *, int));
-int window_box_left_offset P_ ((struct window *, int));
-int window_box_right P_ ((struct window *, int));
-int window_box_right_offset P_ ((struct window *, int));
-void window_box_edges P_ ((struct window *, int, int *, int *, int *, int *));
-int estimate_mode_line_height P_ ((struct frame *, enum face_id));
-void pixel_to_glyph_coords P_ ((struct frame *, int, int, int *, int *,
- NativeRectangle *, int));
-int glyph_to_pixel_coords P_ ((struct window *, int, int, int *, int *));
-void remember_mouse_glyph P_ ((struct frame *, int, int, NativeRectangle *));
-
-void mark_window_display_accurate P_ ((Lisp_Object, int));
-void redisplay_preserve_echo_area P_ ((int));
-int set_cursor_from_row P_ ((struct window *, struct glyph_row *,
- struct glyph_matrix *, int, int, int, int));
-void init_iterator P_ ((struct it *, struct window *, EMACS_INT,
- EMACS_INT, struct glyph_row *, enum face_id));
-void init_iterator_to_row_start P_ ((struct it *, struct window *,
- struct glyph_row *));
-int get_next_display_element P_ ((struct it *));
-void set_iterator_to_next P_ ((struct it *, int));
-void start_display P_ ((struct it *, struct window *, struct text_pos));
-void move_it_to P_ ((struct it *, int, int, int, int, int));
-void move_it_vertically P_ ((struct it *, int));
-void move_it_vertically_backward P_ ((struct it *, int));
-void move_it_by_lines P_ ((struct it *, int, int));
-void move_it_past_eol P_ ((struct it *));
+struct glyph_row *row_containing_pos (struct window *, int,
+ struct glyph_row *,
+ struct glyph_row *, int);
+EMACS_INT string_buffer_position (struct window *, Lisp_Object,
+ EMACS_INT);
+int line_bottom_y (struct it *);
+int display_prop_intangible_p (Lisp_Object);
+void resize_echo_area_exactly (void);
+int resize_mini_window (struct window *, int);
+int try_window (Lisp_Object, struct text_pos, int);
+void window_box (struct window *, int, int *, int *, int *, int *);
+int window_box_height (struct window *);
+int window_text_bottom_y (struct window *);
+int window_box_width (struct window *, int);
+int window_box_left (struct window *, int);
+int window_box_left_offset (struct window *, int);
+int window_box_right (struct window *, int);
+int window_box_right_offset (struct window *, int);
+void window_box_edges (struct window *, int, int *, int *, int *, int *);
+int estimate_mode_line_height (struct frame *, enum face_id);
+void pixel_to_glyph_coords (struct frame *, int, int, int *, int *,
+ NativeRectangle *, int);
+int glyph_to_pixel_coords (struct window *, int, int, int *, int *);
+void remember_mouse_glyph (struct frame *, int, int, NativeRectangle *);
+
+void mark_window_display_accurate (Lisp_Object, int);
+void redisplay_preserve_echo_area (int);
+int set_cursor_from_row (struct window *, struct glyph_row *,
+ struct glyph_matrix *, int, int, int, int);
+void init_iterator (struct it *, struct window *, EMACS_INT,
+ EMACS_INT, struct glyph_row *, enum face_id);
+void init_iterator_to_row_start (struct it *, struct window *,
+ struct glyph_row *);
+int get_next_display_element (struct it *);
+void set_iterator_to_next (struct it *, int);
+void start_display (struct it *, struct window *, struct text_pos);
+void move_it_to (struct it *, int, int, int, int, int);
+void move_it_vertically (struct it *, int);
+void move_it_vertically_backward (struct it *, int);
+void move_it_by_lines (struct it *, int, int);
+void move_it_past_eol (struct it *);
void move_it_in_display_line (struct it *it,
EMACS_INT to_charpos, int to_x,
enum move_operation_enum op);
-int in_display_vector_p P_ ((struct it *));
-int frame_mode_line_height P_ ((struct frame *));
-void highlight_trailing_whitespace P_ ((struct frame *, struct glyph_row *));
+int in_display_vector_p (struct it *);
+int frame_mode_line_height (struct frame *);
+void highlight_trailing_whitespace (struct frame *, struct glyph_row *);
extern Lisp_Object Qtool_bar;
extern Lisp_Object Vshow_trailing_whitespace;
extern int mode_line_in_non_selected_windows;
extern int redisplaying_p;
-extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object));
+extern void add_to_log (char *, Lisp_Object, Lisp_Object);
extern int help_echo_showing_p;
extern int current_mode_line_height, current_header_line_height;
extern Lisp_Object help_echo_string, help_echo_window;
@@ -2955,67 +2963,67 @@ extern Lisp_Object Vmouse_autoselect_window;
extern int unibyte_display_via_language_environment;
extern EMACS_INT underline_minimum_offset;
-extern void reseat_at_previous_visible_line_start P_ ((struct it *));
+extern void reseat_at_previous_visible_line_start (struct it *);
-extern int calc_pixel_width_or_height P_ ((double *, struct it *, Lisp_Object,
- struct font *, int, int *));
+extern int calc_pixel_width_or_height (double *, struct it *, Lisp_Object,
+ struct font *, int, int *);
#ifdef HAVE_WINDOW_SYSTEM
#if GLYPH_DEBUG
-extern void dump_glyph_string P_ ((struct glyph_string *));
+extern void dump_glyph_string (struct glyph_string *);
#endif
-extern void x_get_glyph_overhangs P_ ((struct glyph *, struct frame *,
- int *, int *));
-extern void x_produce_glyphs P_ ((struct it *));
+extern void x_get_glyph_overhangs (struct glyph *, struct frame *,
+ int *, int *);
+extern void x_produce_glyphs (struct it *);
-extern void x_write_glyphs P_ ((struct glyph *, int));
-extern void x_insert_glyphs P_ ((struct glyph *, int len));
-extern void x_clear_end_of_line P_ ((int));
+extern void x_write_glyphs (struct glyph *, int);
+extern void x_insert_glyphs (struct glyph *, int len);
+extern void x_clear_end_of_line (int);
extern int x_stretch_cursor_p;
extern struct cursor_pos output_cursor;
-extern void x_fix_overlapping_area P_ ((struct window *, struct glyph_row *,
- enum glyph_row_area, int));
-extern void draw_phys_cursor_glyph P_ ((struct window *,
- struct glyph_row *,
- enum draw_glyphs_face));
-extern void get_phys_cursor_geometry P_ ((struct window *, struct glyph_row *,
- struct glyph *, int *, int *, int *));
-extern void erase_phys_cursor P_ ((struct window *));
-extern void display_and_set_cursor P_ ((struct window *,
- int, int, int, int, int));
-
-extern void set_output_cursor P_ ((struct cursor_pos *));
-extern void x_cursor_to P_ ((int, int, int, int));
-
-extern void x_update_cursor P_ ((struct frame *, int));
-extern void x_clear_cursor P_ ((struct window *));
-extern void x_draw_vertical_border P_ ((struct window *w));
-
-extern void frame_to_window_pixel_xy P_ ((struct window *, int *, int *));
-extern int get_glyph_string_clip_rects P_ ((struct glyph_string *,
- NativeRectangle *, int));
-extern void get_glyph_string_clip_rect P_ ((struct glyph_string *,
- NativeRectangle *nr));
-extern Lisp_Object find_hot_spot P_ ((Lisp_Object, int, int));
-extern void note_mouse_highlight P_ ((struct frame *, int, int));
-extern void x_clear_window_mouse_face P_ ((struct window *));
-extern void cancel_mouse_face P_ ((struct frame *));
-
-extern void handle_tool_bar_click P_ ((struct frame *,
- int, int, int, unsigned int));
+extern void x_fix_overlapping_area (struct window *, struct glyph_row *,
+ enum glyph_row_area, int);
+extern void draw_phys_cursor_glyph (struct window *,
+ struct glyph_row *,
+ enum draw_glyphs_face);
+extern void get_phys_cursor_geometry (struct window *, struct glyph_row *,
+ struct glyph *, int *, int *, int *);
+extern void erase_phys_cursor (struct window *);
+extern void display_and_set_cursor (struct window *,
+ int, int, int, int, int);
+
+extern void set_output_cursor (struct cursor_pos *);
+extern void x_cursor_to (int, int, int, int);
+
+extern void x_update_cursor (struct frame *, int);
+extern void x_clear_cursor (struct window *);
+extern void x_draw_vertical_border (struct window *w);
+
+extern void frame_to_window_pixel_xy (struct window *, int *, int *);
+extern int get_glyph_string_clip_rects (struct glyph_string *,
+ NativeRectangle *, int);
+extern void get_glyph_string_clip_rect (struct glyph_string *,
+ NativeRectangle *nr);
+extern Lisp_Object find_hot_spot (Lisp_Object, int, int);
+extern void note_mouse_highlight (struct frame *, int, int);
+extern void x_clear_window_mouse_face (struct window *);
+extern void cancel_mouse_face (struct frame *);
+
+extern void handle_tool_bar_click (struct frame *,
+ int, int, int, unsigned int);
/* msdos.c defines its own versions of these functions. */
-extern int clear_mouse_face P_ ((Display_Info *));
-extern void show_mouse_face P_ ((Display_Info *, enum draw_glyphs_face));
-extern int cursor_in_mouse_face_p P_ ((struct window *w));
+extern int clear_mouse_face (Display_Info *);
+extern void show_mouse_face (Display_Info *, enum draw_glyphs_face);
+extern int cursor_in_mouse_face_p (struct window *w);
-extern void expose_frame P_ ((struct frame *, int, int, int, int));
-extern int x_intersect_rectangles P_ ((XRectangle *, XRectangle *,
- XRectangle *));
+extern void expose_frame (struct frame *, int, int, int, int);
+extern int x_intersect_rectangles (XRectangle *, XRectangle *,
+ XRectangle *);
#endif
/* Flags passed to try_window. */
@@ -3025,107 +3033,107 @@ extern int x_intersect_rectangles P_ ((XRectangle *, XRectangle *,
/* Defined in fringe.c */
int lookup_fringe_bitmap (Lisp_Object);
-void draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, int));
-void draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *));
-int draw_window_fringes P_ ((struct window *, int));
-int update_window_fringes P_ ((struct window *, int));
-void compute_fringe_widths P_ ((struct frame *, int));
+void draw_fringe_bitmap (struct window *, struct glyph_row *, int);
+void draw_row_fringe_bitmaps (struct window *, struct glyph_row *);
+int draw_window_fringes (struct window *, int);
+int update_window_fringes (struct window *, int);
+void compute_fringe_widths (struct frame *, int);
#ifdef WINDOWSNT
-void w32_init_fringe P_ ((struct redisplay_interface *));
-void w32_reset_fringes P_ ((void));
+void w32_init_fringe (struct redisplay_interface *);
+void w32_reset_fringes (void);
#endif
/* Defined in image.c */
#ifdef HAVE_WINDOW_SYSTEM
-extern int x_bitmap_height P_ ((struct frame *, int));
-extern int x_bitmap_width P_ ((struct frame *, int));
-extern int x_bitmap_pixmap P_ ((struct frame *, int));
-extern void x_reference_bitmap P_ ((struct frame *, int));
-extern int x_create_bitmap_from_data P_ ((struct frame *, char *,
- unsigned int, unsigned int));
-extern int x_create_bitmap_from_file P_ ((struct frame *, Lisp_Object));
+extern int x_bitmap_height (struct frame *, int);
+extern int x_bitmap_width (struct frame *, int);
+extern int x_bitmap_pixmap (struct frame *, int);
+extern void x_reference_bitmap (struct frame *, int);
+extern int x_create_bitmap_from_data (struct frame *, char *,
+ unsigned int, unsigned int);
+extern int x_create_bitmap_from_file (struct frame *, Lisp_Object);
#if defined (HAVE_XPM) && defined (HAVE_X_WINDOWS)
-extern int x_create_bitmap_from_xpm_data P_ ((struct frame *f, char **bits));
+extern int x_create_bitmap_from_xpm_data (struct frame *f, char **bits);
#endif
#ifndef x_destroy_bitmap
-extern void x_destroy_bitmap P_ ((struct frame *, int));
+extern void x_destroy_bitmap (struct frame *, int);
#endif
-extern void x_destroy_all_bitmaps P_ ((Display_Info *));
-extern int x_create_bitmap_mask P_ ((struct frame * , int));
-extern Lisp_Object x_find_image_file P_ ((Lisp_Object));
-
-void x_kill_gs_process P_ ((Pixmap, struct frame *));
-struct image_cache *make_image_cache P_ ((void));
-void free_image_cache P_ ((struct frame *));
-void clear_image_caches P_ ((Lisp_Object));
-void mark_image_cache P_ ((struct image_cache *));
-int valid_image_p P_ ((Lisp_Object));
-void prepare_image_for_display P_ ((struct frame *, struct image *));
-int lookup_image P_ ((struct frame *, Lisp_Object));
-
-unsigned long image_background P_ ((struct image *, struct frame *,
- XImagePtr_or_DC ximg));
-int image_background_transparent P_ ((struct image *, struct frame *,
- XImagePtr_or_DC mask));
-
-int image_ascent P_ ((struct image *, struct face *, struct glyph_slice *));
+extern void x_destroy_all_bitmaps (Display_Info *);
+extern int x_create_bitmap_mask (struct frame * , int);
+extern Lisp_Object x_find_image_file (Lisp_Object);
+
+void x_kill_gs_process (Pixmap, struct frame *);
+struct image_cache *make_image_cache (void);
+void free_image_cache (struct frame *);
+void clear_image_caches (Lisp_Object);
+void mark_image_cache (struct image_cache *);
+int valid_image_p (Lisp_Object);
+void prepare_image_for_display (struct frame *, struct image *);
+int lookup_image (struct frame *, Lisp_Object);
+
+unsigned long image_background (struct image *, struct frame *,
+ XImagePtr_or_DC ximg);
+int image_background_transparent (struct image *, struct frame *,
+ XImagePtr_or_DC mask);
+
+int image_ascent (struct image *, struct face *, struct glyph_slice *);
#endif
/* Defined in sysdep.c */
-void get_tty_size P_ ((int, int *, int *));
-void request_sigio P_ ((void));
-void unrequest_sigio P_ ((void));
-int tabs_safe_p P_ ((int));
-void init_baud_rate P_ ((int));
-void init_sigio P_ ((int));
+void get_tty_size (int, int *, int *);
+void request_sigio (void);
+void unrequest_sigio (void);
+int tabs_safe_p (int);
+void init_baud_rate (int);
+void init_sigio (int);
/* Defined in xfaces.c */
#ifdef HAVE_X_WINDOWS
-void x_free_colors P_ ((struct frame *, unsigned long *, int));
+void x_free_colors (struct frame *, unsigned long *, int);
#endif
-void update_face_from_frame_parameter P_ ((struct frame *, Lisp_Object,
- Lisp_Object));
-Lisp_Object tty_color_name P_ ((struct frame *, int));
-void clear_face_cache P_ ((int));
-unsigned long load_color P_ ((struct frame *, struct face *, Lisp_Object,
- enum lface_attribute_index));
-void unload_color P_ ((struct frame *, unsigned long));
-char *choose_face_font P_ ((struct frame *, Lisp_Object *, Lisp_Object,
- int *));
-int ascii_face_of_lisp_face P_ ((struct frame *, int));
-void prepare_face_for_display P_ ((struct frame *, struct face *));
-int xstrcasecmp P_ ((const unsigned char *, const unsigned char *));
-int lookup_face P_ ((struct frame *, Lisp_Object *));
-int lookup_named_face P_ ((struct frame *, Lisp_Object, int));
-int lookup_basic_face P_ ((struct frame *, int));
-int smaller_face P_ ((struct frame *, int, int));
-int face_with_height P_ ((struct frame *, int, int));
-int lookup_derived_face P_ ((struct frame *, Lisp_Object, int, int));
-void init_frame_faces P_ ((struct frame *));
-void free_frame_faces P_ ((struct frame *));
-void recompute_basic_faces P_ ((struct frame *));
-int face_at_buffer_position P_ ((struct window *w, EMACS_INT pos,
- EMACS_INT region_beg, EMACS_INT region_end,
- EMACS_INT *endptr, EMACS_INT limit,
- int mouse, int base_face_id));
-int face_for_overlay_string P_ ((struct window *w, EMACS_INT pos,
- EMACS_INT region_beg, EMACS_INT region_end,
- EMACS_INT *endptr, EMACS_INT limit,
- int mouse, Lisp_Object overlay));
-int face_at_string_position P_ ((struct window *w, Lisp_Object string,
- EMACS_INT pos, EMACS_INT bufpos,
- EMACS_INT region_beg, EMACS_INT region_end,
- EMACS_INT *endptr, enum face_id, int mouse));
-int merge_faces P_ ((struct frame *, Lisp_Object, int, int));
-int compute_char_face P_ ((struct frame *, int, Lisp_Object));
-void free_all_realized_faces P_ ((Lisp_Object));
-void free_realized_face P_ ((struct frame *, struct face *));
+void update_face_from_frame_parameter (struct frame *, Lisp_Object,
+ Lisp_Object);
+Lisp_Object tty_color_name (struct frame *, int);
+void clear_face_cache (int);
+unsigned long load_color (struct frame *, struct face *, Lisp_Object,
+ enum lface_attribute_index);
+void unload_color (struct frame *, unsigned long);
+char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object,
+ int *);
+int ascii_face_of_lisp_face (struct frame *, int);
+void prepare_face_for_display (struct frame *, struct face *);
+int xstrcasecmp (const unsigned char *, const unsigned char *);
+int lookup_face (struct frame *, Lisp_Object *);
+int lookup_named_face (struct frame *, Lisp_Object, int);
+int lookup_basic_face (struct frame *, int);
+int smaller_face (struct frame *, int, int);
+int face_with_height (struct frame *, int, int);
+int lookup_derived_face (struct frame *, Lisp_Object, int, int);
+void init_frame_faces (struct frame *);
+void free_frame_faces (struct frame *);
+void recompute_basic_faces (struct frame *);
+int face_at_buffer_position (struct window *w, EMACS_INT pos,
+ EMACS_INT region_beg, EMACS_INT region_end,
+ EMACS_INT *endptr, EMACS_INT limit,
+ int mouse, int base_face_id);
+int face_for_overlay_string (struct window *w, EMACS_INT pos,
+ EMACS_INT region_beg, EMACS_INT region_end,
+ EMACS_INT *endptr, EMACS_INT limit,
+ int mouse, Lisp_Object overlay);
+int face_at_string_position (struct window *w, Lisp_Object string,
+ EMACS_INT pos, EMACS_INT bufpos,
+ EMACS_INT region_beg, EMACS_INT region_end,
+ EMACS_INT *endptr, enum face_id, int mouse);
+int merge_faces (struct frame *, Lisp_Object, int, int);
+int compute_char_face (struct frame *, int, Lisp_Object);
+void free_all_realized_faces (Lisp_Object);
+void free_realized_face (struct frame *, struct face *);
extern Lisp_Object Qforeground_color, Qbackground_color;
extern Lisp_Object Qframe_set_background_mode;
extern char unspecified_fg[], unspecified_bg[];
@@ -3135,24 +3143,24 @@ extern Lisp_Object Vface_remapping_alist;
/* Defined in xfns.c */
#ifdef HAVE_X_WINDOWS
-void gamma_correct P_ ((struct frame *, XColor *));
+void gamma_correct (struct frame *, XColor *);
#endif
#ifdef WINDOWSNT
-void gamma_correct P_ ((struct frame *, COLORREF *));
+void gamma_correct (struct frame *, COLORREF *);
#endif
#ifdef HAVE_WINDOW_SYSTEM
-int x_screen_planes P_ ((struct frame *));
-void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
+int x_screen_planes (struct frame *);
+void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
extern Lisp_Object tip_frame;
extern Window tip_window;
EXFUN (Fx_show_tip, 6);
EXFUN (Fx_hide_tip, 0);
-extern void start_hourglass P_ ((void));
-extern void cancel_hourglass P_ ((void));
-extern int hourglass_started P_ ((void));
+extern void start_hourglass (void);
+extern void cancel_hourglass (void);
+extern int hourglass_started (void);
extern int display_hourglass_p;
extern int hourglass_shown_p;
struct atimer; /* Defined in atimer.h. */
@@ -3161,8 +3169,8 @@ struct atimer; /* Defined in atimer.h. */
extern struct atimer *hourglass_atimer;
/* Each GUI implements these. FIXME: move into RIF. */
-extern void show_hourglass P_ ((struct atimer *));
-extern void hide_hourglass P_ ((void));
+extern void show_hourglass (struct atimer *);
+extern void hide_hourglass (void);
/* Returns the background color of IMG, calculating one heuristically if
necessary. If non-zero, XIMG is an existing XImage object to use for
@@ -3187,116 +3195,116 @@ extern void hide_hourglass P_ ((void));
/* Defined in xmenu.c */
-int popup_activated P_ ((void));
+int popup_activated (void);
/* Defined in dispnew.c */
extern int inverse_video;
-extern int required_matrix_width P_ ((struct window *));
-extern int required_matrix_height P_ ((struct window *));
-extern Lisp_Object buffer_posn_from_coords P_ ((struct window *,
- int *, int *,
- struct display_pos *,
- Lisp_Object *,
- int *, int *, int *, int *));
-extern Lisp_Object mode_line_string P_ ((struct window *, enum window_part,
- int *, int *, int *,
- Lisp_Object *,
- int *, int *, int *, int *));
-extern Lisp_Object marginal_area_string P_ ((struct window *, enum window_part,
- int *, int *, int *,
- Lisp_Object *,
- int *, int *, int *, int *));
-extern void redraw_frame P_ ((struct frame *));
-extern void redraw_garbaged_frames P_ ((void));
-extern void cancel_line P_ ((int, struct frame *));
-extern void init_desired_glyphs P_ ((struct frame *));
-extern int scroll_frame_lines P_ ((struct frame *, int, int, int, int));
-extern int update_frame P_ ((struct frame *, int, int));
-extern int scrolling P_ ((struct frame *));
-extern void bitch_at_user P_ ((void));
-void adjust_glyphs P_ ((struct frame *));
-void free_glyphs P_ ((struct frame *));
-void free_window_matrices P_ ((struct window *));
-void check_glyph_memory P_ ((void));
-void mirrored_line_dance P_ ((struct glyph_matrix *, int, int, int *, char *));
-void clear_glyph_matrix P_ ((struct glyph_matrix *));
-void clear_current_matrices P_ ((struct frame *f));
-void clear_desired_matrices P_ ((struct frame *));
-void shift_glyph_matrix P_ ((struct window *, struct glyph_matrix *,
- int, int, int));
-void rotate_matrix P_ ((struct glyph_matrix *, int, int, int));
-void increment_matrix_positions P_ ((struct glyph_matrix *,
- int, int, int, int));
-void blank_row P_ ((struct window *, struct glyph_row *, int));
-void increment_row_positions P_ ((struct glyph_row *, int, int));
-void enable_glyph_matrix_rows P_ ((struct glyph_matrix *, int, int, int));
-void clear_glyph_row P_ ((struct glyph_row *));
-void prepare_desired_row P_ ((struct glyph_row *));
-int line_hash_code P_ ((struct glyph_row *));
-void set_window_update_flags P_ ((struct window *, int));
-void redraw_frame P_ ((struct frame *));
-void redraw_garbaged_frames P_ ((void));
-int scroll_cost P_ ((struct frame *, int, int, int));
-int update_frame P_ ((struct frame *, int, int));
-void update_single_window P_ ((struct window *, int));
-int scrolling P_ ((struct frame *));
-void do_pending_window_change P_ ((int));
-void change_frame_size P_ ((struct frame *, int, int, int, int, int));
-void bitch_at_user P_ ((void));
-void init_display P_ ((void));
-void syms_of_display P_ ((void));
+extern int required_matrix_width (struct window *);
+extern int required_matrix_height (struct window *);
+extern Lisp_Object buffer_posn_from_coords (struct window *,
+ int *, int *,
+ struct display_pos *,
+ Lisp_Object *,
+ int *, int *, int *, int *);
+extern Lisp_Object mode_line_string (struct window *, enum window_part,
+ int *, int *, int *,
+ Lisp_Object *,
+ int *, int *, int *, int *);
+extern Lisp_Object marginal_area_string (struct window *, enum window_part,
+ int *, int *, int *,
+ Lisp_Object *,
+ int *, int *, int *, int *);
+extern void redraw_frame (struct frame *);
+extern void redraw_garbaged_frames (void);
+extern void cancel_line (int, struct frame *);
+extern void init_desired_glyphs (struct frame *);
+extern int scroll_frame_lines (struct frame *, int, int, int, int);
+extern int update_frame (struct frame *, int, int);
+extern int scrolling (struct frame *);
+extern void bitch_at_user (void);
+void adjust_glyphs (struct frame *);
+void free_glyphs (struct frame *);
+void free_window_matrices (struct window *);
+void check_glyph_memory (void);
+void mirrored_line_dance (struct glyph_matrix *, int, int, int *, char *);
+void clear_glyph_matrix (struct glyph_matrix *);
+void clear_current_matrices (struct frame *f);
+void clear_desired_matrices (struct frame *);
+void shift_glyph_matrix (struct window *, struct glyph_matrix *,
+ int, int, int);
+void rotate_matrix (struct glyph_matrix *, int, int, int);
+void increment_matrix_positions (struct glyph_matrix *,
+ int, int, int, int);
+void blank_row (struct window *, struct glyph_row *, int);
+void increment_row_positions (struct glyph_row *, int, int);
+void enable_glyph_matrix_rows (struct glyph_matrix *, int, int, int);
+void clear_glyph_row (struct glyph_row *);
+void prepare_desired_row (struct glyph_row *);
+int line_hash_code (struct glyph_row *);
+void set_window_update_flags (struct window *, int);
+void redraw_frame (struct frame *);
+void redraw_garbaged_frames (void);
+int scroll_cost (struct frame *, int, int, int);
+int update_frame (struct frame *, int, int);
+void update_single_window (struct window *, int);
+int scrolling (struct frame *);
+void do_pending_window_change (int);
+void change_frame_size (struct frame *, int, int, int, int, int);
+void bitch_at_user (void);
+void init_display (void);
+void syms_of_display (void);
extern Lisp_Object Qredisplay_dont_pause;
-void spec_glyph_lookup_face P_ ((struct window *, GLYPH *));
+void spec_glyph_lookup_face (struct window *, GLYPH *);
/* Defined in terminal.c */
-extern void ring_bell P_ ((struct frame *));
-extern void update_begin P_ ((struct frame *));
-extern void update_end P_ ((struct frame *));
-extern void set_terminal_window P_ ((struct frame *, int));
-extern void cursor_to P_ ((struct frame *, int, int));
-extern void raw_cursor_to P_ ((struct frame *, int, int));
-extern void clear_to_end P_ ((struct frame *));
-extern void clear_frame P_ ((struct frame *));
-extern void clear_end_of_line P_ ((struct frame *, int));
-extern void write_glyphs P_ ((struct frame *, struct glyph *, int));
-extern void insert_glyphs P_ ((struct frame *, struct glyph *, int));
-extern void delete_glyphs P_ ((struct frame *, int));
-extern void ins_del_lines P_ ((struct frame *, int, int));
+extern void ring_bell (struct frame *);
+extern void update_begin (struct frame *);
+extern void update_end (struct frame *);
+extern void set_terminal_window (struct frame *, int);
+extern void cursor_to (struct frame *, int, int);
+extern void raw_cursor_to (struct frame *, int, int);
+extern void clear_to_end (struct frame *);
+extern void clear_frame (struct frame *);
+extern void clear_end_of_line (struct frame *, int);
+extern void write_glyphs (struct frame *, struct glyph *, int);
+extern void insert_glyphs (struct frame *, struct glyph *, int);
+extern void delete_glyphs (struct frame *, int);
+extern void ins_del_lines (struct frame *, int, int);
-extern struct terminal *init_initial_terminal P_ ((void));
+extern struct terminal *init_initial_terminal (void);
/* Defined in term.c */
-extern void tty_set_terminal_modes P_ ((struct terminal *));
-extern void tty_reset_terminal_modes P_ ((struct terminal *));
-extern void tty_turn_off_insert P_ ((struct tty_display_info *));
-extern void tty_turn_off_highlight P_ ((struct tty_display_info *));
-extern int string_cost P_ ((char *));
-extern int per_line_cost P_ ((char *));
-extern void calculate_costs P_ ((struct frame *));
-extern void produce_glyphs P_ ((struct it *));
-extern void produce_special_glyphs P_ ((struct it *, enum display_element_type));
-extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long));
+extern void tty_set_terminal_modes (struct terminal *);
+extern void tty_reset_terminal_modes (struct terminal *);
+extern void tty_turn_off_insert (struct tty_display_info *);
+extern void tty_turn_off_highlight (struct tty_display_info *);
+extern int string_cost (char *);
+extern int per_line_cost (char *);
+extern void calculate_costs (struct frame *);
+extern void produce_glyphs (struct it *);
+extern void produce_special_glyphs (struct it *, enum display_element_type);
+extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, unsigned long);
extern void set_tty_color_mode (struct tty_display_info *, struct frame *);
-extern struct terminal *get_tty_terminal P_ ((Lisp_Object, int));
-extern struct terminal *get_named_tty P_ ((char *));
+extern struct terminal *get_tty_terminal (Lisp_Object, int);
+extern struct terminal *get_named_tty (char *);
EXFUN (Ftty_type, 1);
-extern void create_tty_output P_ ((struct frame *));
-extern struct terminal *init_tty P_ ((char *, char *, int));
+extern void create_tty_output (struct frame *);
+extern struct terminal *init_tty (char *, char *, int);
/* Defined in scroll.c */
-extern int scrolling_max_lines_saved P_ ((int, int, int *, int *, int *));
-extern int scroll_cost P_ ((struct frame *, int, int, int));
-extern void do_line_insertion_deletion_costs P_ ((struct frame *, char *,
- char *, char *, char *,
- char *, char *, int));
-void scrolling_1 P_ ((struct frame *, int, int, int, int *, int *, int *,
- int *, int));
+extern int scrolling_max_lines_saved (int, int, int *, int *, int *);
+extern int scroll_cost (struct frame *, int, int, int);
+extern void do_line_insertion_deletion_costs (struct frame *, char *,
+ char *, char *, char *,
+ char *, char *, int);
+void scrolling_1 (struct frame *, int, int, int, int *, int *, int *,
+ int *, int);
/* Defined in frame.c */
@@ -3313,20 +3321,20 @@ enum resource_types
RES_TYPE_BOOLEAN_NUMBER
};
-extern Lisp_Object x_get_arg P_ ((Display_Info *, Lisp_Object,
- Lisp_Object, char *, char *class,
- enum resource_types));
-extern Lisp_Object x_frame_get_arg P_ ((struct frame *, Lisp_Object,
- Lisp_Object, char *, char *,
- enum resource_types));
-extern Lisp_Object x_frame_get_and_record_arg P_ ((
- struct frame *, Lisp_Object,
- Lisp_Object, char *, char *,
- enum resource_types));
-extern Lisp_Object x_default_parameter P_ ((struct frame *, Lisp_Object,
- Lisp_Object, Lisp_Object,
- char *, char *,
- enum resource_types));
+extern Lisp_Object x_get_arg (Display_Info *, Lisp_Object,
+ Lisp_Object, char *, char *class,
+ enum resource_types);
+extern Lisp_Object x_frame_get_arg (struct frame *, Lisp_Object,
+ Lisp_Object, char *, char *,
+ enum resource_types);
+extern Lisp_Object x_frame_get_and_record_arg (
+ struct frame *, Lisp_Object,
+ Lisp_Object, char *, char *,
+ enum resource_types);
+extern Lisp_Object x_default_parameter (struct frame *, Lisp_Object,
+ Lisp_Object, Lisp_Object,
+ char *, char *,
+ enum resource_types);
#endif /* HAVE_WINDOW_SYSTEM */
diff --git a/src/dispnew.c b/src/dispnew.c
index a8ba1995435..fe64143ec07 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -114,73 +114,73 @@ struct dim
/* Function prototypes. */
-static struct glyph_matrix *save_current_matrix P_ ((struct frame *));
-static void restore_current_matrix P_ ((struct frame *, struct glyph_matrix *));
-static int showing_window_margins_p P_ ((struct window *));
-static void fake_current_matrices P_ ((Lisp_Object));
-static void redraw_overlapping_rows P_ ((struct window *, int));
-static void redraw_overlapped_rows P_ ((struct window *, int));
-static int count_blanks P_ ((struct glyph *, int));
-static int count_match P_ ((struct glyph *, struct glyph *,
- struct glyph *, struct glyph *));
-static unsigned line_draw_cost P_ ((struct glyph_matrix *, int));
-static void update_frame_line P_ ((struct frame *, int));
+static struct glyph_matrix *save_current_matrix (struct frame *);
+static void restore_current_matrix (struct frame *, struct glyph_matrix *);
+static int showing_window_margins_p (struct window *);
+static void fake_current_matrices (Lisp_Object);
+static void redraw_overlapping_rows (struct window *, int);
+static void redraw_overlapped_rows (struct window *, int);
+static int count_blanks (struct glyph *, int);
+static int count_match (struct glyph *, struct glyph *,
+ struct glyph *, struct glyph *);
+static unsigned line_draw_cost (struct glyph_matrix *, int);
+static void update_frame_line (struct frame *, int);
static struct dim allocate_matrices_for_frame_redisplay
- P_ ((Lisp_Object, int, int, int, int *));
-static void allocate_matrices_for_window_redisplay P_ ((struct window *));
-static int realloc_glyph_pool P_ ((struct glyph_pool *, struct dim));
-static void adjust_frame_glyphs P_ ((struct frame *));
-struct glyph_matrix *new_glyph_matrix P_ ((struct glyph_pool *));
-static void free_glyph_matrix P_ ((struct glyph_matrix *));
-static void adjust_glyph_matrix P_ ((struct window *, struct glyph_matrix *,
- int, int, struct dim));
-static void change_frame_size_1 P_ ((struct frame *, int, int, int, int, int));
-static void swap_glyph_pointers P_ ((struct glyph_row *, struct glyph_row *));
+ (Lisp_Object, int, int, int, int *);
+static void allocate_matrices_for_window_redisplay (struct window *);
+static int realloc_glyph_pool (struct glyph_pool *, struct dim);
+static void adjust_frame_glyphs (struct frame *);
+struct glyph_matrix *new_glyph_matrix (struct glyph_pool *);
+static void free_glyph_matrix (struct glyph_matrix *);
+static void adjust_glyph_matrix (struct window *, struct glyph_matrix *,
+ int, int, struct dim);
+static void change_frame_size_1 (struct frame *, int, int, int, int, int);
+static void swap_glyph_pointers (struct glyph_row *, struct glyph_row *);
#if GLYPH_DEBUG
-static int glyph_row_slice_p P_ ((struct glyph_row *, struct glyph_row *));
+static int glyph_row_slice_p (struct glyph_row *, struct glyph_row *);
#endif
-static void fill_up_frame_row_with_spaces P_ ((struct glyph_row *, int));
-static void build_frame_matrix_from_window_tree P_ ((struct glyph_matrix *,
- struct window *));
-static void build_frame_matrix_from_leaf_window P_ ((struct glyph_matrix *,
- struct window *));
-static struct glyph_pool *new_glyph_pool P_ ((void));
-static void free_glyph_pool P_ ((struct glyph_pool *));
-static void adjust_frame_glyphs_initially P_ ((void));
-static void adjust_frame_message_buffer P_ ((struct frame *));
-static void adjust_decode_mode_spec_buffer P_ ((struct frame *));
-static void fill_up_glyph_row_with_spaces P_ ((struct glyph_row *));
-static void build_frame_matrix P_ ((struct frame *));
-void clear_current_matrices P_ ((struct frame *));
-void scroll_glyph_matrix_range P_ ((struct glyph_matrix *, int, int,
- int, int));
-static void clear_window_matrices P_ ((struct window *, int));
-static void fill_up_glyph_row_area_with_spaces P_ ((struct glyph_row *, int));
-static int scrolling_window P_ ((struct window *, int));
-static int update_window_line P_ ((struct window *, int, int *));
-static void update_marginal_area P_ ((struct window *, int, int));
-static int update_text_area P_ ((struct window *, int));
-static void make_current P_ ((struct glyph_matrix *, struct glyph_matrix *,
- int));
-static void mirror_make_current P_ ((struct window *, int));
-void check_window_matrix_pointers P_ ((struct window *));
+static void fill_up_frame_row_with_spaces (struct glyph_row *, int);
+static void build_frame_matrix_from_window_tree (struct glyph_matrix *,
+ struct window *);
+static void build_frame_matrix_from_leaf_window (struct glyph_matrix *,
+ struct window *);
+static struct glyph_pool *new_glyph_pool (void);
+static void free_glyph_pool (struct glyph_pool *);
+static void adjust_frame_glyphs_initially (void);
+static void adjust_frame_message_buffer (struct frame *);
+static void adjust_decode_mode_spec_buffer (struct frame *);
+static void fill_up_glyph_row_with_spaces (struct glyph_row *);
+static void build_frame_matrix (struct frame *);
+void clear_current_matrices (struct frame *);
+void scroll_glyph_matrix_range (struct glyph_matrix *, int, int,
+ int, int);
+static void clear_window_matrices (struct window *, int);
+static void fill_up_glyph_row_area_with_spaces (struct glyph_row *, int);
+static int scrolling_window (struct window *, int);
+static int update_window_line (struct window *, int, int *);
+static void update_marginal_area (struct window *, int, int);
+static int update_text_area (struct window *, int);
+static void make_current (struct glyph_matrix *, struct glyph_matrix *,
+ int);
+static void mirror_make_current (struct window *, int);
+void check_window_matrix_pointers (struct window *);
#if GLYPH_DEBUG
-static void check_matrix_pointers P_ ((struct glyph_matrix *,
- struct glyph_matrix *));
+static void check_matrix_pointers (struct glyph_matrix *,
+ struct glyph_matrix *);
#endif
-static void mirror_line_dance P_ ((struct window *, int, int, int *, char *));
-static int update_window_tree P_ ((struct window *, int));
-static int update_window P_ ((struct window *, int));
-static int update_frame_1 P_ ((struct frame *, int, int));
-static void set_window_cursor_after_update P_ ((struct window *));
-static int row_equal_p P_ ((struct window *, struct glyph_row *,
- struct glyph_row *, int));
-static void adjust_frame_glyphs_for_window_redisplay P_ ((struct frame *));
-static void adjust_frame_glyphs_for_frame_redisplay P_ ((struct frame *));
-static void reverse_rows P_ ((struct glyph_matrix *, int, int));
-static int margin_glyphs_to_reserve P_ ((struct window *, int, Lisp_Object));
-static void sync_window_with_frame_matrix_rows P_ ((struct window *));
-struct window *frame_row_to_window P_ ((struct window *, int));
+static void mirror_line_dance (struct window *, int, int, int *, char *);
+static int update_window_tree (struct window *, int);
+static int update_window (struct window *, int);
+static int update_frame_1 (struct frame *, int, int);
+static void set_window_cursor_after_update (struct window *);
+static int row_equal_p (struct window *, struct glyph_row *,
+ struct glyph_row *, int);
+static void adjust_frame_glyphs_for_window_redisplay (struct frame *);
+static void adjust_frame_glyphs_for_frame_redisplay (struct frame *);
+static void reverse_rows (struct glyph_matrix *, int, int);
+static int margin_glyphs_to_reserve (struct window *, int, Lisp_Object);
+static void sync_window_with_frame_matrix_rows (struct window *);
+struct window *frame_row_to_window (struct window *, int);
/* Non-zero means don't pause redisplay for pending input. (This is
@@ -325,8 +325,8 @@ int fonts_changed_p;
#if GLYPH_DEBUG
-static int window_to_frame_vpos P_ ((struct window *, int));
-static int window_to_frame_hpos P_ ((struct window *, int));
+static int window_to_frame_vpos (struct window *, int);
+static int window_to_frame_hpos (struct window *, int);
#define WINDOW_TO_FRAME_VPOS(W, VPOS) window_to_frame_vpos ((W), (VPOS))
#define WINDOW_TO_FRAME_HPOS(W, HPOS) window_to_frame_hpos ((W), (HPOS))
@@ -355,8 +355,8 @@ static int history_idx;
static unsigned history_tick;
-static void add_frame_display_history P_ ((struct frame *, int));
-static void add_window_display_history P_ ((struct window *, char *, int));
+static void add_frame_display_history (struct frame *, int);
+static void add_window_display_history (struct window *, char *, int);
/* Add to the redisplay history how window W has been displayed.
MSG is a trace containing the information how W's glyph matrix
@@ -413,7 +413,7 @@ add_frame_display_history (f, paused_p)
DEFUN ("dump-redisplay-history", Fdump_redisplay_history,
Sdump_redisplay_history, 0, 0, "",
doc: /* Dump redisplay history to stderr. */)
- ()
+ (void)
{
int i;
@@ -436,65 +436,15 @@ DEFUN ("dump-redisplay-history", Fdump_redisplay_history,
#endif /* GLYPH_DEBUG == 0 */
-/* Like bcopy except never gets confused by overlap. Let this be the
- first function defined in this file, or change emacs.c where the
- address of this function is used. */
+#ifdef PROFILING
+/* FIXME: only used to find text start for profiling. */
void
-safe_bcopy (from, to, size)
- const char *from;
- char *to;
- int size;
+safe_bcopy (const char *from, char *to, int size)
{
- if (size <= 0 || from == to)
- return;
-
- /* If the source and destination don't overlap, then bcopy can
- handle it. If they do overlap, but the destination is lower in
- memory than the source, we'll assume bcopy can handle that. */
- if (to < from || from + size <= to)
- bcopy (from, to, size);
-
- /* Otherwise, we'll copy from the end. */
- else
- {
- register const char *endf = from + size;
- register char *endt = to + size;
-
- /* If TO - FROM is large, then we should break the copy into
- nonoverlapping chunks of TO - FROM bytes each. However, if
- TO - FROM is small, then the bcopy function call overhead
- makes this not worth it. The crossover point could be about
- anywhere. Since I don't think the obvious copy loop is too
- bad, I'm trying to err in its favor. */
- if (to - from < 64)
- {
- do
- *--endt = *--endf;
- while (endf != from);
- }
- else
- {
- for (;;)
- {
- endt -= (to - from);
- endf -= (to - from);
-
- if (endt < to)
- break;
-
- bcopy (endf, endt, to - from);
- }
-
- /* If SIZE wasn't a multiple of TO - FROM, there will be a
- little left over. The amount left over is (endt + (to -
- from)) - to, which is endt - from. */
- bcopy (from, to, endt - from);
- }
- }
+ abort ();
}
-
-
+#endif
/***********************************************************************
Glyph Matrices
@@ -507,14 +457,13 @@ safe_bcopy (from, to, size)
POOL, the structure is otherwise zeroed. */
struct glyph_matrix *
-new_glyph_matrix (pool)
- struct glyph_pool *pool;
+new_glyph_matrix (struct glyph_pool *pool)
{
struct glyph_matrix *result;
/* Allocate and clear. */
result = (struct glyph_matrix *) xmalloc (sizeof *result);
- bzero (result, sizeof *result);
+ memset (result, 0, sizeof *result);
/* Increment number of allocated matrices. This count is used
to detect memory leaks. */
@@ -538,8 +487,7 @@ new_glyph_matrix (pool)
matrix also frees the glyph memory in this case. */
static void
-free_glyph_matrix (matrix)
- struct glyph_matrix *matrix;
+free_glyph_matrix (struct glyph_matrix *matrix)
{
if (matrix)
{
@@ -569,10 +517,7 @@ free_glyph_matrix (matrix)
or a float. */
static int
-margin_glyphs_to_reserve (w, total_glyphs, margin)
- struct window *w;
- int total_glyphs;
- Lisp_Object margin;
+margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin)
{
int n;
@@ -613,11 +558,7 @@ margin_glyphs_to_reserve (w, total_glyphs, margin)
leads to screen flickering. */
static void
-adjust_glyph_matrix (w, matrix, x, y, dim)
- struct window *w;
- struct glyph_matrix *matrix;
- int x, y;
- struct dim dim;
+adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y, struct dim dim)
{
int i;
int new_rows;
@@ -667,8 +608,8 @@ adjust_glyph_matrix (w, matrix, x, y, dim)
int size = dim.height * sizeof (struct glyph_row);
new_rows = dim.height - matrix->rows_allocated;
matrix->rows = (struct glyph_row *) xrealloc (matrix->rows, size);
- bzero (matrix->rows + matrix->rows_allocated,
- new_rows * sizeof *matrix->rows);
+ memset (matrix->rows + matrix->rows_allocated, 0,
+ new_rows * sizeof *matrix->rows);
matrix->rows_allocated = dim.height;
}
else
@@ -860,9 +801,7 @@ adjust_glyph_matrix (w, matrix, x, y, dim)
below). */
static void
-reverse_rows (matrix, start, end)
- struct glyph_matrix *matrix;
- int start, end;
+reverse_rows (struct glyph_matrix *matrix, int start, int end)
{
int i, j;
@@ -891,9 +830,7 @@ reverse_rows (matrix, start, end)
rotating right. */
void
-rotate_matrix (matrix, first, last, by)
- struct glyph_matrix *matrix;
- int first, last, by;
+rotate_matrix (struct glyph_matrix *matrix, int first, int last, int by)
{
if (by < 0)
{
@@ -918,9 +855,7 @@ rotate_matrix (matrix, first, last, by)
DELTA_BYTES. */
void
-increment_matrix_positions (matrix, start, end, delta, delta_bytes)
- struct glyph_matrix *matrix;
- int start, end, delta, delta_bytes;
+increment_matrix_positions (struct glyph_matrix *matrix, int start, int end, int delta, int delta_bytes)
{
/* Check that START and END are reasonable values. */
xassert (start >= 0 && start <= matrix->nrows);
@@ -937,10 +872,7 @@ increment_matrix_positions (matrix, start, end, delta, delta_bytes)
ENABLED_P is non-zero, enabled_p flags in rows will be set to 1. */
void
-enable_glyph_matrix_rows (matrix, start, end, enabled_p)
- struct glyph_matrix *matrix;
- int start, end;
- int enabled_p;
+enable_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end, int enabled_p)
{
xassert (start <= end);
xassert (start >= 0 && start < matrix->nrows);
@@ -962,8 +894,7 @@ enable_glyph_matrix_rows (matrix, start, end, enabled_p)
currently present is the flag MATRIX->no_scrolling_p. */
void
-clear_glyph_matrix (matrix)
- struct glyph_matrix *matrix;
+clear_glyph_matrix (struct glyph_matrix *matrix)
{
if (matrix)
{
@@ -978,10 +909,7 @@ clear_glyph_matrix (matrix)
and recompute their visible height. */
void
-shift_glyph_matrix (w, matrix, start, end, dy)
- struct window *w;
- struct glyph_matrix *matrix;
- int start, end, dy;
+shift_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int start, int end, int dy)
{
int min_y, max_y;
@@ -1012,8 +940,7 @@ shift_glyph_matrix (w, matrix, start, end, dy)
current matrix. */
void
-clear_current_matrices (f)
- register struct frame *f;
+clear_current_matrices (register struct frame *f)
{
/* Clear frame current matrix, if we have one. */
if (f->current_matrix)
@@ -1038,8 +965,7 @@ clear_current_matrices (f)
/* Clear out all display lines of F for a coming redisplay. */
void
-clear_desired_matrices (f)
- register struct frame *f;
+clear_desired_matrices (register struct frame *f)
{
if (f->desired_matrix)
clear_glyph_matrix (f->desired_matrix);
@@ -1060,9 +986,7 @@ clear_desired_matrices (f)
non-zero clear desired matrices, otherwise clear current matrices. */
static void
-clear_window_matrices (w, desired_p)
- struct window *w;
- int desired_p;
+clear_window_matrices (struct window *w, int desired_p)
{
while (w)
{
@@ -1106,8 +1030,7 @@ clear_window_matrices (w, desired_p)
static struct glyph_row null_row;
void
-clear_glyph_row (row)
- struct glyph_row *row;
+clear_glyph_row (struct glyph_row *row)
{
struct glyph *p[1 + LAST_AREA];
@@ -1133,7 +1056,7 @@ clear_glyph_row (row)
returned by xmalloc. If flickering happens again, activate
the code below. If the flickering is gone with that, chances
are that the flickering has the same reason as here. */
- bzero (p[0], (char *) p[LAST_AREA] - (char *) p[0]);
+ memset (p[0], 0, (char *) p[LAST_AREA] - (char *) p[0]);
#endif
}
@@ -1142,10 +1065,7 @@ clear_glyph_row (row)
in window W starting at y-position Y. */
void
-blank_row (w, row, y)
- struct window *w;
- struct glyph_row *row;
- int y;
+blank_row (struct window *w, struct glyph_row *row, int y)
{
int min_y, max_y;
@@ -1174,9 +1094,7 @@ blank_row (w, row, y)
ends. */
void
-increment_row_positions (row, delta, delta_bytes)
- struct glyph_row *row;
- int delta, delta_bytes;
+increment_row_positions (struct glyph_row *row, int delta, int delta_bytes)
{
int area, i;
@@ -1251,8 +1169,7 @@ swap_glyphs_in_rows (a, b)
/* Exchange pointers to glyph memory between glyph rows A and B. */
static INLINE void
-swap_glyph_pointers (a, b)
- struct glyph_row *a, *b;
+swap_glyph_pointers (struct glyph_row *a, struct glyph_row *b)
{
int i;
for (i = 0; i < LAST_AREA + 1; ++i)
@@ -1268,19 +1185,18 @@ swap_glyph_pointers (a, b)
that glyph pointers in the structures are left unchanged. */
INLINE void
-copy_row_except_pointers (to, from)
- struct glyph_row *to, *from;
+copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from)
{
struct glyph *pointers[1 + LAST_AREA];
/* Save glyph pointers of TO. */
- bcopy (to->glyphs, pointers, sizeof to->glyphs);
+ memcpy (pointers, to->glyphs, sizeof to->glyphs);
/* Do a structure assignment. */
*to = *from;
/* Restore original pointers of TO. */
- bcopy (pointers, to->glyphs, sizeof to->glyphs);
+ memcpy (to->glyphs, pointers, sizeof to->glyphs);
}
@@ -1290,9 +1206,7 @@ copy_row_except_pointers (to, from)
positions in row TO by DELTA/ DELTA_BYTES. */
void
-copy_glyph_row_contents (to, from, delta, delta_bytes)
- struct glyph_row *to, *from;
- int delta, delta_bytes;
+copy_glyph_row_contents (struct glyph_row *to, struct glyph_row *from, int delta, int delta_bytes)
{
int area;
@@ -1303,8 +1217,8 @@ copy_glyph_row_contents (to, from, delta, delta_bytes)
/* Copy glyphs from FROM to TO. */
for (area = 0; area < LAST_AREA; ++area)
if (from->used[area])
- bcopy (from->glyphs[area], to->glyphs[area],
- from->used[area] * sizeof (struct glyph));
+ memcpy (to->glyphs[area], from->glyphs[area],
+ from->used[area] * sizeof (struct glyph));
/* Increment buffer positions in TO by DELTA. */
increment_row_positions (to, delta, delta_bytes);
@@ -1317,8 +1231,7 @@ copy_glyph_row_contents (to, from, delta, delta_bytes)
a memory leak. */
static INLINE void
-assign_row (to, from)
- struct glyph_row *to, *from;
+assign_row (struct glyph_row *to, struct glyph_row *from)
{
swap_glyph_pointers (to, from);
copy_row_except_pointers (to, from);
@@ -1378,8 +1291,7 @@ find_glyph_row_slice (window_matrix, frame_matrix, row)
call to this function really clears it. */
void
-prepare_desired_row (row)
- struct glyph_row *row;
+prepare_desired_row (struct glyph_row *row)
{
if (!row->enabled_p)
{
@@ -1395,8 +1307,7 @@ prepare_desired_row (row)
/* Return a hash code for glyph row ROW. */
int
-line_hash_code (row)
- struct glyph_row *row;
+line_hash_code (struct glyph_row *row)
{
int hash = 0;
@@ -1429,9 +1340,7 @@ line_hash_code (row)
zero, leading and trailing spaces are ignored. */
static unsigned int
-line_draw_cost (matrix, vpos)
- struct glyph_matrix *matrix;
- int vpos;
+line_draw_cost (struct glyph_matrix *matrix, int vpos)
{
struct glyph_row *row = matrix->rows + vpos;
struct glyph *beg = row->glyphs[TEXT_AREA];
@@ -1492,10 +1401,7 @@ line_draw_cost (matrix, vpos)
flags of A and B, too. */
static INLINE int
-row_equal_p (w, a, b, mouse_face_p)
- struct window *w;
- struct glyph_row *a, *b;
- int mouse_face_p;
+row_equal_p (struct window *w, struct glyph_row *a, struct glyph_row *b, int mouse_face_p)
{
if (a == b)
return 1;
@@ -1565,13 +1471,13 @@ row_equal_p (w, a, b, mouse_face_p)
incremented for each pool allocated. */
static struct glyph_pool *
-new_glyph_pool ()
+new_glyph_pool (void)
{
struct glyph_pool *result;
/* Allocate a new glyph_pool and clear it. */
result = (struct glyph_pool *) xmalloc (sizeof *result);
- bzero (result, sizeof *result);
+ memset (result, 0, sizeof *result);
/* For memory leak and double deletion checking. */
++glyph_pool_count;
@@ -1588,8 +1494,7 @@ new_glyph_pool ()
was passed to free_glyph_pool. */
static void
-free_glyph_pool (pool)
- struct glyph_pool *pool;
+free_glyph_pool (struct glyph_pool *pool)
{
if (pool)
{
@@ -1613,9 +1518,7 @@ free_glyph_pool (pool)
re-adjusting window glyph matrices necessary. */
static int
-realloc_glyph_pool (pool, matrix_dim)
- struct glyph_pool *pool;
- struct dim matrix_dim;
+realloc_glyph_pool (struct glyph_pool *pool, struct dim matrix_dim)
{
int needed;
int changed_p;
@@ -1635,7 +1538,7 @@ realloc_glyph_pool (pool, matrix_dim)
else
{
pool->glyphs = (struct glyph *) xmalloc (size);
- bzero (pool->glyphs, size);
+ memset (pool->glyphs, 0, size);
}
pool->nglyphs = needed;
@@ -1873,12 +1776,8 @@ check_matrix_invariants (w)
#define CHANGED_LEAF_MATRIX (1 << 1)
static struct dim
-allocate_matrices_for_frame_redisplay (window, x, y, dim_only_p,
- window_change_flags)
- Lisp_Object window;
- int x, y;
- int dim_only_p;
- int *window_change_flags;
+allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
+ int dim_only_p, int *window_change_flags)
{
struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
int x0 = x, y0 = y;
@@ -1994,8 +1893,7 @@ allocate_matrices_for_frame_redisplay (window, x, y, dim_only_p,
/* Return the required height of glyph matrices for window W. */
int
-required_matrix_height (w)
- struct window *w;
+required_matrix_height (struct window *w)
{
#ifdef HAVE_WINDOW_SYSTEM
struct frame *f = XFRAME (w->frame);
@@ -2021,8 +1919,7 @@ required_matrix_height (w)
/* Return the required width of glyph matrices for window W. */
int
-required_matrix_width (w)
- struct window *w;
+required_matrix_width (struct window *w)
{
#ifdef HAVE_WINDOW_SYSTEM
struct frame *f = XFRAME (w->frame);
@@ -2050,8 +1947,7 @@ required_matrix_width (w)
window whose matrices must be allocated/reallocated. */
static void
-allocate_matrices_for_window_redisplay (w)
- struct window *w;
+allocate_matrices_for_window_redisplay (struct window *w)
{
while (w)
{
@@ -2088,8 +1984,7 @@ allocate_matrices_for_window_redisplay (w)
changes, or its window configuration changes. */
void
-adjust_glyphs (f)
- struct frame *f;
+adjust_glyphs (struct frame *f)
{
/* Block input so that expose events and other events that access
glyph matrices are not processed while we are changing them. */
@@ -2121,7 +2016,7 @@ adjust_glyphs (f)
windows to estimated values. */
static void
-adjust_frame_glyphs_initially ()
+adjust_frame_glyphs_initially (void)
{
struct frame *sf = SELECTED_FRAME ();
struct window *root = XWINDOW (sf->root_window);
@@ -2148,8 +2043,7 @@ adjust_frame_glyphs_initially ()
/* Allocate/reallocate glyph matrices of a single frame F. */
static void
-adjust_frame_glyphs (f)
- struct frame *f;
+adjust_frame_glyphs (struct frame *f)
{
if (FRAME_WINDOW_P (f))
adjust_frame_glyphs_for_window_redisplay (f);
@@ -2167,8 +2061,7 @@ adjust_frame_glyphs (f)
/* Return 1 if any window in the tree has nonzero window margins. See
the hack at the end of adjust_frame_glyphs_for_frame_redisplay. */
static int
-showing_window_margins_p (w)
- struct window *w;
+showing_window_margins_p (struct window *w)
{
while (w)
{
@@ -2196,8 +2089,7 @@ showing_window_margins_p (w)
windows from the frame's current matrix. */
static void
-fake_current_matrices (window)
- Lisp_Object window;
+fake_current_matrices (Lisp_Object window)
{
struct window *w;
@@ -2247,18 +2139,17 @@ fake_current_matrices (window)
a glyph matrix holding the contents of F's current frame matrix. */
static struct glyph_matrix *
-save_current_matrix (f)
- struct frame *f;
+save_current_matrix (struct frame *f)
{
int i;
struct glyph_matrix *saved;
saved = (struct glyph_matrix *) xmalloc (sizeof *saved);
- bzero (saved, sizeof *saved);
+ memset (saved, 0, sizeof *saved);
saved->nrows = f->current_matrix->nrows;
saved->rows = (struct glyph_row *) xmalloc (saved->nrows
* sizeof *saved->rows);
- bzero (saved->rows, saved->nrows * sizeof *saved->rows);
+ memset (saved->rows, 0, saved->nrows * sizeof *saved->rows);
for (i = 0; i < saved->nrows; ++i)
{
@@ -2266,7 +2157,7 @@ save_current_matrix (f)
struct glyph_row *to = saved->rows + i;
size_t nbytes = from->used[TEXT_AREA] * sizeof (struct glyph);
to->glyphs[TEXT_AREA] = (struct glyph *) xmalloc (nbytes);
- bcopy (from->glyphs[TEXT_AREA], to->glyphs[TEXT_AREA], nbytes);
+ memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], nbytes);
to->used[TEXT_AREA] = from->used[TEXT_AREA];
}
@@ -2278,9 +2169,7 @@ save_current_matrix (f)
and free memory associated with SAVED. */
static void
-restore_current_matrix (f, saved)
- struct frame *f;
- struct glyph_matrix *saved;
+restore_current_matrix (struct frame *f, struct glyph_matrix *saved)
{
int i;
@@ -2289,7 +2178,7 @@ restore_current_matrix (f, saved)
struct glyph_row *from = saved->rows + i;
struct glyph_row *to = f->current_matrix->rows + i;
size_t nbytes = from->used[TEXT_AREA] * sizeof (struct glyph);
- bcopy (from->glyphs[TEXT_AREA], to->glyphs[TEXT_AREA], nbytes);
+ memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], nbytes);
to->used[TEXT_AREA] = from->used[TEXT_AREA];
xfree (from->glyphs[TEXT_AREA]);
}
@@ -2304,8 +2193,7 @@ restore_current_matrix (f, saved)
frame-based redisplay. */
static void
-adjust_frame_glyphs_for_frame_redisplay (f)
- struct frame *f;
+adjust_frame_glyphs_for_frame_redisplay (struct frame *f)
{
struct dim matrix_dim;
int pool_changed_p;
@@ -2405,8 +2293,7 @@ adjust_frame_glyphs_for_frame_redisplay (f)
window-based redisplay. */
static void
-adjust_frame_glyphs_for_window_redisplay (f)
- struct frame *f;
+adjust_frame_glyphs_for_window_redisplay (struct frame *f)
{
struct window *w;
@@ -2474,8 +2361,7 @@ adjust_frame_glyphs_for_window_redisplay (f)
eventually without causing trouble). */
static void
-adjust_frame_message_buffer (f)
- struct frame *f;
+adjust_frame_message_buffer (struct frame *f)
{
int size = FRAME_MESSAGE_BUF_SIZE (f) + 1;
@@ -2493,8 +2379,7 @@ adjust_frame_message_buffer (f)
/* Re-allocate buffer for decode_mode_spec on frame F. */
static void
-adjust_decode_mode_spec_buffer (f)
- struct frame *f;
+adjust_decode_mode_spec_buffer (struct frame *f)
{
f->decode_mode_spec_buffer
= (char *) xrealloc (f->decode_mode_spec_buffer,
@@ -2513,8 +2398,7 @@ adjust_decode_mode_spec_buffer (f)
the function is called when F is destroyed. */
void
-free_glyphs (f)
- struct frame *f;
+free_glyphs (struct frame *f)
{
if (f && f->glyphs_initialized_p)
{
@@ -2575,8 +2459,7 @@ free_glyphs (f)
the same tree more than once. */
void
-free_window_matrices (w)
- struct window *w;
+free_window_matrices (struct window *w)
{
while (w)
{
@@ -2606,7 +2489,7 @@ free_window_matrices (w)
explicitly and check that nothing is left allocated. */
void
-check_glyph_memory ()
+check_glyph_memory (void)
{
Lisp_Object tail, frame;
@@ -2690,8 +2573,7 @@ check_glyph_memory ()
sure not to touch them in this function. */
static void
-build_frame_matrix (f)
- struct frame *f;
+build_frame_matrix (struct frame *f)
{
int i;
@@ -2713,9 +2595,7 @@ build_frame_matrix (f)
matrices. W is the root of a window tree. */
static void
-build_frame_matrix_from_window_tree (matrix, w)
- struct glyph_matrix *matrix;
- struct window *w;
+build_frame_matrix_from_window_tree (struct glyph_matrix *matrix, struct window *w)
{
while (w)
{
@@ -2743,9 +2623,7 @@ build_frame_matrix_from_window_tree (matrix, w)
preserve_other_columns in the old redisplay. */
static void
-build_frame_matrix_from_leaf_window (frame_matrix, w)
- struct glyph_matrix *frame_matrix;
- struct window *w;
+build_frame_matrix_from_leaf_window (struct glyph_matrix *frame_matrix, struct window *w)
{
struct glyph_matrix *window_matrix;
int window_y, frame_y;
@@ -2811,9 +2689,9 @@ build_frame_matrix_from_leaf_window (frame_matrix, w)
if (current_row_p)
{
/* Copy window row to frame row. */
- bcopy (window_row->glyphs[0],
- frame_row->glyphs[TEXT_AREA] + window_matrix->matrix_x,
- window_matrix->matrix_w * sizeof (struct glyph));
+ memcpy (frame_row->glyphs[TEXT_AREA] + window_matrix->matrix_x,
+ window_row->glyphs[0],
+ window_matrix->matrix_w * sizeof (struct glyph));
}
else
{
@@ -2862,9 +2740,7 @@ build_frame_matrix_from_leaf_window (frame_matrix, w)
for instance, vertical separators, truncation markers, etc. */
void
-spec_glyph_lookup_face (w, glyph)
- struct window *w;
- GLYPH *glyph;
+spec_glyph_lookup_face (struct window *w, GLYPH *glyph)
{
int lface_id = GLYPH_FACE (*glyph);
/* Convert the glyph's specified face to a realized (cache) face. */
@@ -2893,8 +2769,7 @@ spec_glyph_lookup_face (w, glyph)
To be called for frame-based redisplay, only. */
static void
-fill_up_glyph_row_with_spaces (row)
- struct glyph_row *row;
+fill_up_glyph_row_with_spaces (struct glyph_row *row)
{
fill_up_glyph_row_area_with_spaces (row, LEFT_MARGIN_AREA);
fill_up_glyph_row_area_with_spaces (row, TEXT_AREA);
@@ -2906,9 +2781,7 @@ fill_up_glyph_row_with_spaces (row)
frame-based redisplay only. */
static void
-fill_up_glyph_row_area_with_spaces (row, area)
- struct glyph_row *row;
- int area;
+fill_up_glyph_row_area_with_spaces (struct glyph_row *row, int area)
{
if (row->glyphs[area] < row->glyphs[area + 1])
{
@@ -2926,9 +2799,7 @@ fill_up_glyph_row_area_with_spaces (row, area)
reached. In frame matrices only one area, TEXT_AREA, is used. */
static void
-fill_up_frame_row_with_spaces (row, upto)
- struct glyph_row *row;
- int upto;
+fill_up_frame_row_with_spaces (struct glyph_row *row, int upto)
{
int i = row->used[TEXT_AREA];
struct glyph *glyph = row->glyphs[TEXT_AREA];
@@ -2950,8 +2821,7 @@ fill_up_frame_row_with_spaces (row, upto)
working on frame matrices or not. */
static INLINE void
-set_frame_matrix_frame (f)
- struct frame *f;
+set_frame_matrix_frame (struct frame *f)
{
frame_matrix_frame = f;
}
@@ -2966,9 +2836,7 @@ set_frame_matrix_frame (f)
operations in window matrices of frame_matrix_frame. */
static INLINE void
-make_current (desired_matrix, current_matrix, row)
- struct glyph_matrix *desired_matrix, *current_matrix;
- int row;
+make_current (struct glyph_matrix *desired_matrix, struct glyph_matrix *current_matrix, int row)
{
struct glyph_row *current_row = MATRIX_ROW (current_matrix, row);
struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, row);
@@ -2995,9 +2863,7 @@ make_current (desired_matrix, current_matrix, row)
matrices of leaf windows in the window tree rooted at W. */
static void
-mirror_make_current (w, frame_row)
- struct window *w;
- int frame_row;
+mirror_make_current (struct window *w, int frame_row)
{
while (w)
{
@@ -3045,12 +2911,8 @@ mirror_make_current (w, frame_row)
This function is called from do_scrolling and do_direct_scrolling. */
void
-mirrored_line_dance (matrix, unchanged_at_top, nlines, copy_from,
- retained_p)
- struct glyph_matrix *matrix;
- int unchanged_at_top, nlines;
- int *copy_from;
- char *retained_p;
+mirrored_line_dance (struct glyph_matrix *matrix, int unchanged_at_top, int nlines,
+ int *copy_from, char *retained_p)
{
/* A copy of original rows. */
struct glyph_row *old_rows;
@@ -3062,7 +2924,7 @@ mirrored_line_dance (matrix, unchanged_at_top, nlines, copy_from,
/* Make a copy of the original rows. */
old_rows = (struct glyph_row *) alloca (nlines * sizeof *old_rows);
- bcopy (new_rows, old_rows, nlines * sizeof *old_rows);
+ memcpy (old_rows, new_rows, nlines * sizeof *old_rows);
/* Assign new rows, maybe clear lines. */
for (i = 0; i < nlines; ++i)
@@ -3090,8 +2952,7 @@ mirrored_line_dance (matrix, unchanged_at_top, nlines, copy_from,
the current frame matrix. */
static void
-sync_window_with_frame_matrix_rows (w)
- struct window *w;
+sync_window_with_frame_matrix_rows (struct window *w)
{
struct frame *f = XFRAME (w->frame);
struct glyph_row *window_row, *window_row_end, *frame_row;
@@ -3128,9 +2989,7 @@ sync_window_with_frame_matrix_rows (w)
row ROW. Value is null if none is found. */
struct window *
-frame_row_to_window (w, row)
- struct window *w;
- int row;
+frame_row_to_window (struct window *w, int row)
{
struct window *found = NULL;
@@ -3163,11 +3022,7 @@ frame_row_to_window (w, row)
which is empty. */
static void
-mirror_line_dance (w, unchanged_at_top, nlines, copy_from, retained_p)
- struct window *w;
- int unchanged_at_top, nlines;
- int *copy_from;
- char *retained_p;
+mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy_from, char *retained_p)
{
while (w)
{
@@ -3187,7 +3042,7 @@ mirror_line_dance (w, unchanged_at_top, nlines, copy_from, retained_p)
/* Make a copy of the original rows of matrix m. */
old_rows = (struct glyph_row *) alloca (m->nrows * sizeof *old_rows);
- bcopy (m->rows, old_rows, m->nrows * sizeof *old_rows);
+ memcpy (old_rows, m->rows, m->nrows * sizeof *old_rows);
for (i = 0; i < nlines; ++i)
{
@@ -3381,8 +3236,7 @@ window_to_frame_hpos (w, hpos)
DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0,
doc: /* Clear frame FRAME and output again what is supposed to appear on it. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct frame *f;
@@ -3419,8 +3273,7 @@ DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0,
function redraw-frame. */
void
-redraw_frame (f)
- struct frame *f;
+redraw_frame (struct frame *f)
{
Lisp_Object frame;
XSETFRAME (frame, f);
@@ -3430,7 +3283,7 @@ redraw_frame (f)
DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
doc: /* Clear and redisplay all visible frames. */)
- ()
+ (void)
{
Lisp_Object tail, frame;
@@ -3446,7 +3299,7 @@ DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
visible frames marked as garbaged. */
void
-redraw_garbaged_frames ()
+redraw_garbaged_frames (void)
{
Lisp_Object tail, frame;
@@ -3471,10 +3324,7 @@ redraw_garbaged_frames ()
Value is non-zero if redisplay was stopped due to pending input. */
int
-update_frame (f, force_p, inhibit_hairy_id_p)
- struct frame *f;
- int force_p;
- int inhibit_hairy_id_p;
+update_frame (struct frame *f, int force_p, int inhibit_hairy_id_p)
{
/* 1 means display has been paused because of pending input. */
int paused_p;
@@ -3606,9 +3456,7 @@ update_frame (f, force_p, inhibit_hairy_id_p)
don't stop updating when input is pending. */
static int
-update_window_tree (w, force_p)
- struct window *w;
- int force_p;
+update_window_tree (struct window *w, int force_p)
{
int paused_p = 0;
@@ -3632,9 +3480,7 @@ update_window_tree (w, force_p)
FORCE_P is non-zero, don't stop updating if input is pending. */
void
-update_single_window (w, force_p)
- struct window *w;
- int force_p;
+update_single_window (struct window *w, int force_p)
{
if (w->must_be_updated_p)
{
@@ -3679,9 +3525,7 @@ update_single_window (w, force_p)
overlapped by other rows. YB is bottom-most y-position in W. */
static void
-redraw_overlapped_rows (w, yb)
- struct window *w;
- int yb;
+redraw_overlapped_rows (struct window *w, int yb)
{
int i;
struct frame *f = XFRAME (WINDOW_FRAME (w));
@@ -3729,9 +3573,7 @@ redraw_overlapped_rows (w, yb)
others. YB is bottom-most y-position in W. */
static void
-redraw_overlapping_rows (w, yb)
- struct window *w;
- int yb;
+redraw_overlapping_rows (struct window *w, int yb)
{
int i, bottom_y;
struct glyph_row *row;
@@ -3793,8 +3635,7 @@ redraw_overlapping_rows (w, yb)
which is below what's displayed in the window. */
void
-check_current_matrix_flags (w)
- struct window *w;
+check_current_matrix_flags (struct window *w)
{
int last_seen_p = 0;
int i, yb = window_text_bottom_y (w);
@@ -3816,9 +3657,7 @@ check_current_matrix_flags (w)
not stop when detecting pending input. */
static int
-update_window (w, force_p)
- struct window *w;
- int force_p;
+update_window (struct window *w, int force_p)
{
struct glyph_matrix *desired_matrix = w->desired_matrix;
int paused_p;
@@ -4010,9 +3849,7 @@ update_window (w, force_p)
AREA can be either LEFT_MARGIN_AREA or RIGHT_MARGIN_AREA. */
static void
-update_marginal_area (w, area, vpos)
- struct window *w;
- int area, vpos;
+update_marginal_area (struct window *w, int area, int vpos)
{
struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
@@ -4035,9 +3872,7 @@ update_marginal_area (w, area, vpos)
Value is non-zero if display has changed. */
static int
-update_text_area (w, vpos)
- struct window *w;
- int vpos;
+update_text_area (struct window *w, int vpos)
{
struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos);
struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
@@ -4282,9 +4117,7 @@ update_text_area (w, vpos)
changed. */
static int
-update_window_line (w, vpos, mouse_face_overwritten_p)
- struct window *w;
- int vpos, *mouse_face_overwritten_p;
+update_window_line (struct window *w, int vpos, int *mouse_face_overwritten_p)
{
struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos);
struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
@@ -4353,8 +4186,7 @@ update_window_line (w, vpos, mouse_face_overwritten_p)
be called from update_window. */
static void
-set_window_cursor_after_update (w)
- struct window *w;
+set_window_cursor_after_update (struct window *w)
{
struct frame *f = XFRAME (w->frame);
struct redisplay_interface *rif = FRAME_RIF (f);
@@ -4438,9 +4270,7 @@ set_window_cursor_after_update (w)
tree rooted at W. */
void
-set_window_update_flags (w, on_p)
- struct window *w;
- int on_p;
+set_window_update_flags (struct window *w, int on_p)
{
while (w)
{
@@ -4518,9 +4348,7 @@ static struct run **runs;
of window W. */
static INLINE struct row_entry *
-add_row_entry (w, row)
- struct window *w;
- struct glyph_row *row;
+add_row_entry (struct window *w, struct glyph_row *row)
{
struct row_entry *entry;
int i = row->hash % row_table_size;
@@ -4571,9 +4399,7 @@ add_row_entry (w, row)
1 if we did scroll. */
static int
-scrolling_window (w, header_line_p)
- struct window *w;
- int header_line_p;
+scrolling_window (struct window *w, int header_line_p)
{
struct glyph_matrix *desired_matrix = w->desired_matrix;
struct glyph_matrix *current_matrix = w->current_matrix;
@@ -4681,7 +4507,7 @@ scrolling_window (w, header_line_p)
row_table_size = next_almost_prime (3 * n);
nbytes = row_table_size * sizeof *row_table;
row_table = (struct row_entry **) xrealloc (row_table, nbytes);
- bzero (row_table, nbytes);
+ memset (row_table, 0, nbytes);
}
if (n > row_entry_pool_size)
@@ -4876,10 +4702,7 @@ scrolling_window (w, header_line_p)
Value is non-zero if update was stopped due to pending input. */
static int
-update_frame_1 (f, force_p, inhibit_id_p)
- struct frame *f;
- int force_p;
- int inhibit_id_p;
+update_frame_1 (struct frame *f, int force_p, int inhibit_id_p)
{
/* Frame matrices to work on. */
struct glyph_matrix *current_matrix = f->current_matrix;
@@ -5089,8 +4912,7 @@ update_frame_1 (f, force_p, inhibit_id_p)
/* Do line insertions/deletions on frame F for frame-based redisplay. */
int
-scrolling (frame)
- struct frame *frame;
+scrolling (struct frame *frame)
{
int unchanged_at_top, unchanged_at_bottom;
int window_size;
@@ -5184,9 +5006,7 @@ scrolling (frame)
which is LEN glyphs long. */
static int
-count_blanks (r, len)
- struct glyph *r;
- int len;
+count_blanks (struct glyph *r, int len)
{
int i;
@@ -5203,8 +5023,7 @@ count_blanks (r, len)
of STR2. Value is the number of equal glyphs equal at the start. */
static int
-count_match (str1, end1, str2, end2)
- struct glyph *str1, *end1, *str2, *end2;
+count_match (struct glyph *str1, struct glyph *end1, struct glyph *str2, struct glyph *end2)
{
struct glyph *p1 = str1;
struct glyph *p2 = str2;
@@ -5227,9 +5046,7 @@ extern int *char_ins_del_vector;
/* Perform a frame-based update on line VPOS in frame FRAME. */
static void
-update_frame_line (f, vpos)
- struct frame *f;
- int vpos;
+update_frame_line (struct frame *f, int vpos)
{
struct glyph *obody, *nbody, *op1, *op2, *np1, *nend;
int tem;
@@ -5545,13 +5362,7 @@ update_frame_line (f, vpos)
Adjust *X and *Y to character positions. */
Lisp_Object
-buffer_posn_from_coords (w, x, y, pos, object, dx, dy, width, height)
- struct window *w;
- int *x, *y;
- struct display_pos *pos;
- Lisp_Object *object;
- int *dx, *dy;
- int *width, *height;
+buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *pos, Lisp_Object *object, int *dx, int *dy, int *width, int *height)
{
struct it it;
Lisp_Object old_current_buffer = Fcurrent_buffer ();
@@ -5646,14 +5457,7 @@ buffer_posn_from_coords (w, x, y, pos, object, dx, dy, width, height)
*CHARPOS is set to the position in the string returned. */
Lisp_Object
-mode_line_string (w, part, x, y, charpos, object, dx, dy, width, height)
- struct window *w;
- enum window_part part;
- int *x, *y;
- int *charpos;
- Lisp_Object *object;
- int *dx, *dy;
- int *width, *height;
+mode_line_string (struct window *w, enum window_part part, int *x, int *y, int *charpos, Lisp_Object *object, int *dx, int *dy, int *width, int *height)
{
struct glyph_row *row;
struct glyph *glyph, *end;
@@ -5720,14 +5524,7 @@ mode_line_string (w, part, x, y, charpos, object, dx, dy, width, height)
the string returned. */
Lisp_Object
-marginal_area_string (w, part, x, y, charpos, object, dx, dy, width, height)
- struct window *w;
- enum window_part part;
- int *x, *y;
- int *charpos;
- Lisp_Object *object;
- int *dx, *dy;
- int *width, *height;
+marginal_area_string (struct window *w, enum window_part part, int *x, int *y, int *charpos, Lisp_Object *object, int *dx, int *dy, int *width, int *height)
{
struct glyph_row *row = w->current_matrix->rows;
struct glyph *glyph, *end;
@@ -5816,8 +5613,8 @@ marginal_area_string (w, part, x, y, charpos, object, dx, dy, width, height)
#ifdef SIGWINCH
SIGTYPE
-window_change_signal (signalnum) /* If we don't have an argument, */
- int signalnum; /* some compilers complain in signal calls. */
+window_change_signal (int signalnum) /* If we don't have an argument, */
+ /* some compilers complain in signal calls. */
{
int width, height;
int old_errno = errno;
@@ -5865,8 +5662,7 @@ window_change_signal (signalnum) /* If we don't have an argument, */
safe to change frame sizes while a redisplay is in progress. */
void
-do_pending_window_change (safe)
- int safe;
+do_pending_window_change (int safe)
{
/* If window_change_signal should have run before, run it now. */
if (redisplaying_p && !safe)
@@ -5902,9 +5698,7 @@ do_pending_window_change (safe)
safe to change frame sizes while a redisplay is in progress. */
void
-change_frame_size (f, newheight, newwidth, pretend, delay, safe)
- register struct frame *f;
- int newheight, newwidth, pretend, delay, safe;
+change_frame_size (register struct frame *f, int newheight, int newwidth, int pretend, int delay, int safe)
{
Lisp_Object tail, frame;
@@ -5923,9 +5717,7 @@ change_frame_size (f, newheight, newwidth, pretend, delay, safe)
}
static void
-change_frame_size_1 (f, newheight, newwidth, pretend, delay, safe)
- register struct frame *f;
- int newheight, newwidth, pretend, delay, safe;
+change_frame_size_1 (register struct frame *f, int newheight, int newwidth, int pretend, int delay, int safe)
{
int new_frame_total_cols;
int count = SPECPDL_INDEX ();
@@ -6054,8 +5846,7 @@ DEFUN ("open-termscript", Fopen_termscript, Sopen_termscript,
1, 1, "FOpen termscript file: ",
doc: /* Start writing all terminal output to FILE as well as the terminal.
FILE = nil means just close any termscript file currently open. */)
- (file)
- Lisp_Object file;
+ (Lisp_Object file)
{
struct tty_display_info *tty;
@@ -6093,9 +5884,7 @@ Optional parameter TERMINAL specifies the tty terminal device to use.
It may be a terminal object, a frame, or nil for the terminal used by
the currently selected frame. In batch mode, STRING is sent to stdout
when TERMINAL is nil. */)
- (string, terminal)
- Lisp_Object string;
- Lisp_Object terminal;
+ (Lisp_Object string, Lisp_Object terminal)
{
struct terminal *t = get_terminal (terminal, 1);
FILE *out;
@@ -6136,8 +5925,7 @@ DEFUN ("ding", Fding, Sding, 0, 1, 0,
doc: /* Beep, or flash the screen.
Also, unless an argument is given,
terminate any keyboard macro currently executing. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
if (!NILP (arg))
{
@@ -6153,7 +5941,7 @@ terminate any keyboard macro currently executing. */)
}
void
-bitch_at_user ()
+bitch_at_user (void)
{
if (noninteractive)
putchar (07);
@@ -6176,8 +5964,7 @@ fraction of a second. Optional second arg MILLISECONDS specifies an
additional wait period, in milliseconds; this may be useful if your
Emacs was built without floating point support.
\(Not all operating systems support waiting for a fraction of a second.) */)
- (seconds, milliseconds)
- Lisp_Object seconds, milliseconds;
+ (Lisp_Object seconds, Lisp_Object milliseconds)
{
int sec, usec;
@@ -6230,9 +6017,7 @@ Emacs was built without floating point support.
*/
Lisp_Object
-sit_for (timeout, reading, do_display)
- Lisp_Object timeout;
- int reading, do_display;
+sit_for (Lisp_Object timeout, int reading, int do_display)
{
int sec, usec;
@@ -6283,8 +6068,7 @@ DEFUN ("redisplay", Fredisplay, Sredisplay, 0, 1, 0,
If optional arg FORCE is non-nil or `redisplay-dont-pause' is non-nil,
perform a full redisplay even if input is available.
Return t if redisplay was performed, nil otherwise. */)
- (force)
- Lisp_Object force;
+ (Lisp_Object force)
{
int count;
@@ -6328,8 +6112,7 @@ the current state.
If VARIABLE is nil, an internal variable is used. Users should not
pass nil for VARIABLE. */)
- (variable)
- Lisp_Object variable;
+ (Lisp_Object variable)
{
Lisp_Object state, tail, frame, buf;
Lisp_Object *vecp, *end;
@@ -6448,7 +6231,7 @@ pass nil for VARIABLE. */)
decoding routine to set up variables in the terminal package. */
void
-init_display ()
+init_display (void)
{
char *terminal_type;
@@ -6655,8 +6438,7 @@ DEFUN ("internal-show-cursor", Finternal_show_cursor,
WINDOW nil means use the selected window. SHOW non-nil means
show a cursor in WINDOW in the next redisplay. SHOW nil means
don't show a cursor. */)
- (window, show)
- Lisp_Object window, show;
+ (Lisp_Object window, Lisp_Object show)
{
/* Don't change cursor state while redisplaying. This could confuse
output routines. */
@@ -6678,8 +6460,7 @@ DEFUN ("internal-show-cursor-p", Finternal_show_cursor_p,
Sinternal_show_cursor_p, 0, 1, 0,
doc: /* Value is non-nil if next redisplay will display a cursor in WINDOW.
WINDOW nil or omitted means report on the selected window. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
struct window *w;
@@ -6695,7 +6476,7 @@ WINDOW nil or omitted means report on the selected window. */)
DEFUN ("last-nonminibuffer-frame", Flast_nonminibuf_frame,
Slast_nonminibuf_frame, 0, 0, 0,
doc: /* Value is last nonminibuffer frame. */)
- ()
+ (void)
{
Lisp_Object frame = Qnil;
@@ -6710,7 +6491,7 @@ DEFUN ("last-nonminibuffer-frame", Flast_nonminibuf_frame,
***********************************************************************/
void
-syms_of_display ()
+syms_of_display (void)
{
defsubr (&Sredraw_frame);
defsubr (&Sredraw_display);
diff --git a/src/disptab.h b/src/disptab.h
index e0f603346df..1a7f63050b6 100644
--- a/src/disptab.h
+++ b/src/disptab.h
@@ -32,7 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define DISP_INVIS_VECTOR(dp) ((dp)->extras[4])
#define DISP_BORDER_GLYPH(dp) ((dp)->extras[5])
-extern Lisp_Object disp_char_vector P_ ((struct Lisp_Char_Table *, int));
+extern Lisp_Object disp_char_vector (struct Lisp_Char_Table *, int);
#define DISP_CHAR_VECTOR(dp, c) \
(ASCII_CHAR_P(c) \
@@ -44,10 +44,10 @@ extern Lisp_Object disp_char_vector P_ ((struct Lisp_Char_Table *, int));
: disp_char_vector ((dp), (c)))
/* Defined in window.c. */
-extern struct Lisp_Char_Table *window_display_table P_ ((struct window *));
+extern struct Lisp_Char_Table *window_display_table (struct window *);
/* Defined in indent.c. */
-extern struct Lisp_Char_Table *buffer_display_table P_ ((void));
+extern struct Lisp_Char_Table *buffer_display_table (void);
/* Display table to use for vectors that don't specify their own. */
extern Lisp_Object Vstandard_display_table;
diff --git a/src/doc.c b/src/doc.c
index 9133c2e6b84..5f4fe426da0 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -45,10 +45,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "keymap.h"
#include "buildobj.h"
-#ifdef HAVE_INDEX
-extern char *index P_ ((const char *, int));
-#endif
-
Lisp_Object Vdoc_file_name;
Lisp_Object Qfunction_documentation;
@@ -65,14 +61,13 @@ static char *get_doc_string_buffer;
static int get_doc_string_buffer_size;
static unsigned char *read_bytecode_pointer;
-Lisp_Object Fsnarf_documentation P_ ((Lisp_Object));
+Lisp_Object Fsnarf_documentation (Lisp_Object);
/* readchar in lread.c calls back here to fetch the next byte.
If UNREADFLAG is 1, we unread a byte. */
int
-read_bytecode_char (unreadflag)
- int unreadflag;
+read_bytecode_char (int unreadflag)
{
if (unreadflag)
{
@@ -102,9 +97,7 @@ read_bytecode_char (unreadflag)
and return a cons cell. */
Lisp_Object
-get_doc_string (filepos, unibyte, definition)
- Lisp_Object filepos;
- int unibyte, definition;
+get_doc_string (Lisp_Object filepos, int unibyte, int definition)
{
char *from, *to;
register int fd;
@@ -221,9 +214,9 @@ get_doc_string (filepos, unibyte, definition)
if (!nread)
break;
if (p == get_doc_string_buffer)
- p1 = (char *) index (p + offset, '\037');
+ p1 = strchr (p + offset, '\037');
else
- p1 = (char *) index (p, '\037');
+ p1 = strchr (p, '\037');
if (p1)
{
*p1 = 0;
@@ -311,15 +304,13 @@ get_doc_string (filepos, unibyte, definition)
of a compiled function from the .elc file. */
Lisp_Object
-read_doc_string (filepos)
- Lisp_Object filepos;
+read_doc_string (Lisp_Object filepos)
{
return get_doc_string (filepos, 0, 1);
}
static int
-reread_doc_file (file)
- Lisp_Object file;
+reread_doc_file (Lisp_Object file)
{
#if 0
Lisp_Object reply, prompt[3];
@@ -346,8 +337,7 @@ DEFUN ("documentation", Fdocumentation, Sdocumentation, 1, 2, 0,
doc: /* Return the documentation string of FUNCTION.
Unless a non-nil second argument RAW is given, the
string is passed through `substitute-command-keys'. */)
- (function, raw)
- Lisp_Object function, raw;
+ (Lisp_Object function, Lisp_Object raw)
{
Lisp_Object fun;
Lisp_Object funcar;
@@ -481,8 +471,7 @@ Third argument RAW omitted or nil means pass the result through
This differs from `get' in that it can refer to strings stored in the
`etc/DOC' file; and that it evaluates documentation properties that
aren't strings. */)
- (symbol, prop, raw)
- Lisp_Object symbol, prop, raw;
+ (Lisp_Object symbol, Lisp_Object prop, Lisp_Object raw)
{
int try_reload = 1;
Lisp_Object tem;
@@ -522,10 +511,8 @@ aren't strings. */)
/* Scanning the DOC files and placing docstring offsets into functions. */
static void
-store_function_docstring (fun, offset)
- Lisp_Object fun;
- /* Use EMACS_INT because we get this from pointer subtraction. */
- EMACS_INT offset;
+store_function_docstring (Lisp_Object fun, EMACS_INT offset)
+/* Use EMACS_INT because we get offset from pointer subtraction. */
{
fun = indirect_function (fun);
@@ -574,8 +561,7 @@ The function takes one argument, FILENAME, a string;
it specifies the file name (without a directory) of the DOC file.
That file is found in `../etc' now; later, when the dumped Emacs is run,
the same file name is found in the `doc-directory'. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
int fd;
char buf[1024 + 1];
@@ -652,7 +638,7 @@ the same file name is found in the `doc-directory'. */)
/* p points to ^_Ffunctionname\n or ^_Vvarname\n. */
if (p != end)
{
- end = (char *) index (p, '\n');
+ end = strchr (p, '\n');
/* See if this is a file name, and if it is a file in build-files. */
if (p[1] == 'S' && end - p > 4 && end[-2] == '.'
@@ -702,7 +688,7 @@ the same file name is found in the `doc-directory'. */)
}
pos += end - buf;
filled -= end - buf;
- bcopy (end, buf, filled);
+ memcpy (buf, end, filled);
}
emacs_close (fd);
return Qnil;
@@ -723,8 +709,7 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int
Returns original STRING if no substitutions were made. Otherwise,
a new string, without any text properties, is returned. */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
unsigned char *buf;
int changed = 0;
@@ -781,7 +766,7 @@ a new string, without any text properties, is returned. */)
if (len == 1)
*bufp = *strp;
else
- bcopy (strp, bufp, len);
+ memcpy (bufp, strp, len);
strp += len;
bufp += len;
nchars++;
@@ -833,7 +818,7 @@ a new string, without any text properties, is returned. */)
int offset = bufp - buf;
buf = (unsigned char *) xrealloc (buf, bsize += 4);
bufp = buf + offset;
- bcopy ("M-x ", bufp, 4);
+ memcpy (bufp, "M-x ", 4);
bufp += 4;
nchars += 4;
if (multibyte)
@@ -927,7 +912,7 @@ a new string, without any text properties, is returned. */)
int offset = bufp - buf;
buf = (unsigned char *) xrealloc (buf, bsize += length_byte);
bufp = buf + offset;
- bcopy (start, bufp, length_byte);
+ memcpy (bufp, start, length_byte);
bufp += length_byte;
nchars += length;
/* Check STRING again in case gc relocated it. */
@@ -944,7 +929,7 @@ a new string, without any text properties, is returned. */)
if (len == 1)
*bufp = *strp;
else
- bcopy (strp, bufp, len);
+ memcpy (bufp, strp, len);
strp += len;
bufp += len;
nchars++;
@@ -960,7 +945,7 @@ a new string, without any text properties, is returned. */)
}
void
-syms_of_doc ()
+syms_of_doc (void)
{
Qfunction_documentation = intern_c_string ("function-documentation");
staticpro (&Qfunction_documentation);
diff --git a/src/doprnt.c b/src/doprnt.c
index cf8a9280863..1b45b21e36b 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -48,8 +48,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
another macro. */
#include "character.h"
-static int doprnt1 ();
-
/* Generate output from a format-spec FORMAT,
terminated at position FORMAT_END.
Output goes in BUFFER, which has room for BUFSIZE chars.
@@ -61,16 +59,10 @@ static int doprnt1 ();
Integers are passed as C integers. */
int
-doprnt (buffer, bufsize, format, format_end, nargs, args)
- char *buffer;
- register int bufsize;
- char *format;
- char *format_end;
- int nargs;
- char **args;
+doprnt (char *buffer, register int bufsize, const char *format,
+ const char *format_end, va_list ap)
{
- int cnt = 0; /* Number of arg to gobble next */
- register char *fmt = format; /* Pointer into format string */
+ const char *fmt = format; /* Pointer into format string */
register char *bufptr = buffer; /* Pointer into output buffer.. */
/* Use this for sprintf unless we need something really big. */
@@ -169,8 +161,6 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
case 'd':
case 'o':
case 'x':
- if (cnt == nargs)
- error ("Not enough arguments for format string");
if (sizeof (int) == sizeof (EMACS_INT))
;
else if (sizeof (long) == sizeof (EMACS_INT))
@@ -181,7 +171,7 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
string++;
else
abort ();
- sprintf (sprintf_buffer, fmtcpy, args[cnt++]);
+ sprintf (sprintf_buffer, fmtcpy, va_arg(ap, char *));
/* Now copy into final output, truncating as nec. */
string = (unsigned char *) sprintf_buffer;
goto doit;
@@ -190,12 +180,8 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
case 'e':
case 'g':
{
- union { double d; char *half[2]; } u;
- if (cnt + 1 == nargs)
- error ("Not enough arguments for format string");
- u.half[0] = args[cnt++];
- u.half[1] = args[cnt++];
- sprintf (sprintf_buffer, fmtcpy, u.d);
+ double d = va_arg(ap, double);
+ sprintf (sprintf_buffer, fmtcpy, d);
/* Now copy into final output, truncating as nec. */
string = (unsigned char *) sprintf_buffer;
goto doit;
@@ -204,11 +190,9 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
case 'S':
string[-1] = 's';
case 's':
- if (cnt == nargs)
- error ("Not enough arguments for format string");
if (fmtcpy[1] != 's')
minlen = atoi (&fmtcpy[1]);
- string = (unsigned char *) args[cnt++];
+ string = va_arg(ap, unsigned char *);
tem = strlen (string);
width = strwidth (string, tem);
goto doit1;
@@ -237,12 +221,12 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
/* Truncate the string at character boundary. */
tem = bufsize;
while (!CHAR_HEAD_P (string[tem - 1])) tem--;
- bcopy (string, bufptr, tem);
+ memcpy (bufptr, string, tem);
/* We must calculate WIDTH again. */
width = strwidth (bufptr, tem);
}
else
- bcopy (string, bufptr, tem);
+ memcpy (bufptr, string, tem);
bufptr += tem;
bufsize -= tem;
if (minlen < 0)
@@ -258,16 +242,21 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
continue;
case 'c':
- if (cnt == nargs)
- error ("Not enough arguments for format string");
- tem = CHAR_STRING ((int) (EMACS_INT) args[cnt], charbuf);
- string = charbuf;
- cnt++;
- string[tem] = 0;
- width = strwidth (string, tem);
- if (fmtcpy[1] != 'c')
- minlen = atoi (&fmtcpy[1]);
- goto doit1;
+ {
+ /* Sometimes for %c we pass a char, which would widen
+ to int. Sometimes we pass XFASTINT() or XINT()
+ values, which would be EMACS_INT. Let's hope that
+ both are passed the same way, otherwise we'll need
+ to rewrite callers. */
+ EMACS_INT chr = va_arg(ap, EMACS_INT);
+ tem = CHAR_STRING ((int) chr, charbuf);
+ string = charbuf;
+ string[tem] = 0;
+ width = strwidth (string, tem);
+ if (fmtcpy[1] != 'c')
+ minlen = atoi (&fmtcpy[1]);
+ goto doit1;
+ }
case '%':
fmt--; /* Drop thru and this % will be treated as normal */
diff --git a/src/dosfns.c b/src/dosfns.c
index e8756de21a1..5be0a363da8 100644
--- a/src/dosfns.c
+++ b/src/dosfns.c
@@ -55,8 +55,7 @@ Return the updated REGISTER vector.
INTERRUPT should be an integer in the range 0 to 255.
REGISTERS should be a vector produced by `make-register' and
`set-register-value'. */)
- (interrupt, registers)
- Lisp_Object interrupt, registers;
+ (Lisp_Object interrupt, Lisp_Object registers)
{
register int i;
int no;
@@ -97,8 +96,7 @@ REGISTERS should be a vector produced by `make-register' and
DEFUN ("msdos-memget", Fdos_memget, Sdos_memget, 2, 2, 0,
doc: /* Read DOS memory at offset ADDRESS into VECTOR.
Return the updated VECTOR. */)
- (address, vector)
- Lisp_Object address, vector;
+ (Lisp_Object address, Lisp_Object vector)
{
register int i;
int offs, len;
@@ -122,8 +120,7 @@ Return the updated VECTOR. */)
DEFUN ("msdos-memput", Fdos_memput, Sdos_memput, 2, 2, 0,
doc: /* Write DOS memory at offset ADDRESS from VECTOR. */)
- (address, vector)
- Lisp_Object address, vector;
+ (Lisp_Object address, Lisp_Object vector)
{
register int i;
int offs, len;
@@ -153,8 +150,7 @@ DEFUN ("msdos-set-keyboard", Fmsdos_set_keyboard, Smsdos_set_keyboard, 1, 2, 0,
If the optional argument ALLKEYS is non-nil, the keyboard is mapped for
all keys; otherwise it is only used when the ALT key is pressed.
The current keyboard layout is available in dos-keyboard-code. */)
- (country_code, allkeys)
- Lisp_Object country_code, allkeys;
+ (Lisp_Object country_code, Lisp_Object allkeys)
{
CHECK_NUMBER (country_code);
if (!dos_set_keyboard (XINT (country_code), !NILP (allkeys)))
@@ -168,7 +164,7 @@ The current keyboard layout is available in dos-keyboard-code. */)
DEFUN ("msdos-mouse-p", Fmsdos_mouse_p, Smsdos_mouse_p, 0, 0, 0,
doc: /* Report whether a mouse is present. */)
- ()
+ (void)
{
if (have_mouse)
return Qt;
@@ -179,7 +175,7 @@ DEFUN ("msdos-mouse-p", Fmsdos_mouse_p, Smsdos_mouse_p, 0, 0, 0,
DEFUN ("msdos-mouse-init", Fmsdos_mouse_init, Smsdos_mouse_init, 0, 0, "",
doc: /* Initialize and enable mouse if available. */)
- ()
+ (void)
{
if (have_mouse)
{
@@ -192,7 +188,7 @@ DEFUN ("msdos-mouse-init", Fmsdos_mouse_init, Smsdos_mouse_init, 0, 0, "",
DEFUN ("msdos-mouse-enable", Fmsdos_mouse_enable, Smsdos_mouse_enable, 0, 0, "",
doc: /* Enable mouse if available. */)
- ()
+ (void)
{
if (have_mouse)
{
@@ -204,7 +200,7 @@ DEFUN ("msdos-mouse-enable", Fmsdos_mouse_enable, Smsdos_mouse_enable, 0, 0, "",
DEFUN ("msdos-mouse-disable", Fmsdos_mouse_disable, Smsdos_mouse_disable, 0, 0, "",
doc: /* Disable mouse if available. */)
- ()
+ (void)
{
mouse_off ();
if (have_mouse) have_mouse = -1;
@@ -214,7 +210,7 @@ DEFUN ("msdos-mouse-disable", Fmsdos_mouse_disable, Smsdos_mouse_disable, 0, 0,
DEFUN ("insert-startup-screen", Finsert_startup_screen, Sinsert_startup_screen, 0, 0, "",
doc: /* Insert copy of screen contents prior to starting Emacs.
Return nil if startup screen is not available. */)
- ()
+ (void)
{
char *s;
int rows, cols, i, j;
@@ -283,7 +279,7 @@ restore_parent_vm_title (void)
#endif /* !HAVE_X_WINDOWS */
void
-init_dosfns ()
+init_dosfns (void)
{
union REGS regs;
_go32_dpmi_registers dpmiregs;
@@ -481,9 +477,7 @@ w95_set_virtual_machine_title (const char *title_string)
sets the name in the frame struct, but has no other effects. */
void
-x_set_title (f, name)
- struct frame *f;
- Lisp_Object name;
+x_set_title (struct frame *f, Lisp_Object name)
{
/* Don't change the title if it's already NAME. */
if (EQ (name, f->title))
@@ -511,8 +505,7 @@ Value is a list of floats (TOTAL FREE AVAIL), where TOTAL is the total
storage of the file system, FREE is the free storage, and AVAIL is the
storage available to a non-superuser. All 3 numbers are in bytes.
If the underlying system call fails, value is nil. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
struct statfs stfs;
Lisp_Object encoded, value;
@@ -536,7 +529,7 @@ If the underlying system call fails, value is nil. */)
(There are no other processes on DOS, right?) */
Lisp_Object
-list_system_processes ()
+list_system_processes (void)
{
Lisp_Object proclist = Qnil;
@@ -689,7 +682,8 @@ dos_cleanup (void)
/*
* Define everything
*/
-syms_of_dosfns ()
+void
+syms_of_dosfns (void)
{
defsubr (&Sint86);
defsubr (&Sdos_memget);
diff --git a/src/dosfns.h b/src/dosfns.h
index 1759ffd8a90..820b6b30e43 100644
--- a/src/dosfns.h
+++ b/src/dosfns.h
@@ -38,8 +38,8 @@ extern Lisp_Object Vdos_windows_version;
#ifndef HAVE_X_WINDOWS
extern Lisp_Object Vdos_display_scancodes;
-extern int msdos_stdcolor_idx P_ ((const char *));
-extern Lisp_Object msdos_stdcolor_name P_ ((int));
+extern int msdos_stdcolor_idx (const char *);
+extern Lisp_Object msdos_stdcolor_name (int);
#endif
/* arch-tag: a83b8c4c-63c8-451e-9e94-bc72e3e2f8bc
diff --git a/src/editfns.c b/src/editfns.c
index ea279a462f2..805dba60446 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -86,38 +86,34 @@ extern char **environ;
(1000 - TM_YEAR_BASE <= (tm_year) && (tm_year) <= 9999 - TM_YEAR_BASE)
#endif
-extern size_t emacs_strftimeu P_ ((char *, size_t, const char *,
- const struct tm *, int));
+extern size_t emacs_strftimeu (char *, size_t, const char *,
+ const struct tm *, int);
#ifdef WINDOWSNT
extern Lisp_Object w32_get_internal_run_time ();
#endif
-static int tm_diff P_ ((struct tm *, struct tm *));
-static void find_field P_ ((Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *));
-static void update_buffer_properties P_ ((int, int));
-static Lisp_Object region_limit P_ ((int));
-int lisp_time_argument P_ ((Lisp_Object, time_t *, int *));
-static size_t emacs_memftimeu P_ ((char *, size_t, const char *,
- size_t, const struct tm *, int));
+static int tm_diff (struct tm *, struct tm *);
+static void find_field (Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *);
+static void update_buffer_properties (int, int);
+static Lisp_Object region_limit (int);
+int lisp_time_argument (Lisp_Object, time_t *, int *);
+static size_t emacs_memftimeu (char *, size_t, const char *,
+ size_t, const struct tm *, int);
static void general_insert_function (void (*) (const unsigned char *, EMACS_INT),
void (*) (Lisp_Object, EMACS_INT,
EMACS_INT, EMACS_INT,
EMACS_INT, int),
int, int, Lisp_Object *);
-static Lisp_Object subst_char_in_region_unwind P_ ((Lisp_Object));
-static Lisp_Object subst_char_in_region_unwind_1 P_ ((Lisp_Object));
-static void transpose_markers P_ ((int, int, int, int, int, int, int, int));
-
-#ifdef HAVE_INDEX
-extern char *index P_ ((const char *, int));
-#endif
+static Lisp_Object subst_char_in_region_unwind (Lisp_Object);
+static Lisp_Object subst_char_in_region_unwind_1 (Lisp_Object);
+static void transpose_markers (int, int, int, int, int, int, int, int);
Lisp_Object Vbuffer_access_fontify_functions;
Lisp_Object Qbuffer_access_fontify_functions;
Lisp_Object Vbuffer_access_fontified_property;
-Lisp_Object Fuser_full_name P_ ((Lisp_Object));
+Lisp_Object Fuser_full_name (Lisp_Object);
/* Non-nil means don't stop at field boundary in text motion commands. */
@@ -141,7 +137,7 @@ Lisp_Object Qboundary;
void
-init_editfns ()
+init_editfns (void)
{
char *user_name;
register unsigned char *p;
@@ -209,8 +205,7 @@ init_editfns ()
DEFUN ("char-to-string", Fchar_to_string, Schar_to_string, 1, 1, 0,
doc: /* Convert arg CHAR to a string containing that character.
usage: (char-to-string CHAR) */)
- (character)
- Lisp_Object character;
+ (Lisp_Object character)
{
int len;
unsigned char str[MAX_MULTIBYTE_LENGTH];
@@ -223,8 +218,7 @@ usage: (char-to-string CHAR) */)
DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0,
doc: /* Convert arg BYTE to a string containing that byte. */)
- (byte)
- Lisp_Object byte;
+ (Lisp_Object byte)
{
unsigned char b;
CHECK_NUMBER (byte);
@@ -235,8 +229,7 @@ DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0,
DEFUN ("string-to-char", Fstring_to_char, Sstring_to_char, 1, 1, 0,
doc: /* Convert arg STRING to a character, the first character of that string.
A multibyte character is handled correctly. */)
- (string)
- register Lisp_Object string;
+ (register Lisp_Object string)
{
register Lisp_Object val;
CHECK_STRING (string);
@@ -253,8 +246,7 @@ A multibyte character is handled correctly. */)
}
static Lisp_Object
-buildmark (charpos, bytepos)
- int charpos, bytepos;
+buildmark (int charpos, int bytepos)
{
register Lisp_Object mark;
mark = Fmake_marker ();
@@ -265,7 +257,7 @@ buildmark (charpos, bytepos)
DEFUN ("point", Fpoint, Spoint, 0, 0, 0,
doc: /* Return value of point, as an integer.
Beginning of buffer is position (point-min). */)
- ()
+ (void)
{
Lisp_Object temp;
XSETFASTINT (temp, PT);
@@ -274,14 +266,13 @@ Beginning of buffer is position (point-min). */)
DEFUN ("point-marker", Fpoint_marker, Spoint_marker, 0, 0, 0,
doc: /* Return value of point, as a marker object. */)
- ()
+ (void)
{
return buildmark (PT, PT_BYTE);
}
int
-clip_to_bounds (lower, num, upper)
- int lower, num, upper;
+clip_to_bounds (int lower, int num, int upper)
{
if (num < lower)
return lower;
@@ -296,8 +287,7 @@ DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, "NGoto char: ",
Beginning of buffer is position (point-min), end is (point-max).
The return value is POSITION. */)
- (position)
- register Lisp_Object position;
+ (register Lisp_Object position)
{
int pos;
@@ -328,8 +318,7 @@ The return value is POSITION. */)
If there is no region active, signal an error. */
static Lisp_Object
-region_limit (beginningp)
- int beginningp;
+region_limit (int beginningp)
{
extern Lisp_Object Vmark_even_if_inactive; /* Defined in callint.c. */
Lisp_Object m;
@@ -350,14 +339,14 @@ region_limit (beginningp)
DEFUN ("region-beginning", Fregion_beginning, Sregion_beginning, 0, 0, 0,
doc: /* Return position of beginning of region, as an integer. */)
- ()
+ (void)
{
return region_limit (1);
}
DEFUN ("region-end", Fregion_end, Sregion_end, 0, 0, 0,
doc: /* Return position of end of region, as an integer. */)
- ()
+ (void)
{
return region_limit (0);
}
@@ -366,7 +355,7 @@ DEFUN ("mark-marker", Fmark_marker, Smark_marker, 0, 0, 0,
doc: /* Return this buffer's mark, as a marker object.
Watch out! Moving this marker changes the mark position.
If you set the marker not to point anywhere, the buffer will have no mark. */)
- ()
+ (void)
{
return current_buffer->mark;
}
@@ -377,10 +366,7 @@ If you set the marker not to point anywhere, the buffer will have no mark. */)
of length LEN. */
static int
-overlays_around (pos, vec, len)
- int pos;
- Lisp_Object *vec;
- int len;
+overlays_around (int pos, Lisp_Object *vec, int len)
{
Lisp_Object overlay, start, end;
struct Lisp_Overlay *tail;
@@ -436,9 +422,7 @@ overlays_around (pos, vec, len)
window-specific overlays are considered only if they are associated
with OBJECT. */
Lisp_Object
-get_pos_property (position, prop, object)
- Lisp_Object position, object;
- register Lisp_Object prop;
+get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object object)
{
CHECK_NUMBER_COERCE_MARKER (position);
@@ -533,11 +517,7 @@ get_pos_property (position, prop, object)
is not stored. */
static void
-find_field (pos, merge_at_boundary, beg_limit, beg, end_limit, end)
- Lisp_Object pos;
- Lisp_Object merge_at_boundary;
- Lisp_Object beg_limit, end_limit;
- int *beg, *end;
+find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, Lisp_Object beg_limit, int *beg, Lisp_Object end_limit, int *end)
{
/* Fields right before and after the point. */
Lisp_Object before_field, after_field;
@@ -651,8 +631,7 @@ DEFUN ("delete-field", Fdelete_field, Sdelete_field, 0, 1, 0,
doc: /* Delete the field surrounding POS.
A field is a region of text with the same `field' property.
If POS is nil, the value of point is used for POS. */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
int beg, end;
find_field (pos, Qnil, Qnil, &beg, Qnil, &end);
@@ -665,8 +644,7 @@ DEFUN ("field-string", Ffield_string, Sfield_string, 0, 1, 0,
doc: /* Return the contents of the field surrounding POS as a string.
A field is a region of text with the same `field' property.
If POS is nil, the value of point is used for POS. */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
int beg, end;
find_field (pos, Qnil, Qnil, &beg, Qnil, &end);
@@ -677,8 +655,7 @@ DEFUN ("field-string-no-properties", Ffield_string_no_properties, Sfield_string_
doc: /* Return the contents of the field around POS, without text properties.
A field is a region of text with the same `field' property.
If POS is nil, the value of point is used for POS. */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
int beg, end;
find_field (pos, Qnil, Qnil, &beg, Qnil, &end);
@@ -693,8 +670,7 @@ If ESCAPE-FROM-EDGE is non-nil and POS is at the beginning of its
field, then the beginning of the *previous* field is returned.
If LIMIT is non-nil, it is a buffer position; if the beginning of the field
is before LIMIT, then LIMIT will be returned instead. */)
- (pos, escape_from_edge, limit)
- Lisp_Object pos, escape_from_edge, limit;
+ (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit)
{
int beg;
find_field (pos, escape_from_edge, limit, &beg, Qnil, 0);
@@ -709,8 +685,7 @@ If ESCAPE-FROM-EDGE is non-nil and POS is at the end of its field,
then the end of the *following* field is returned.
If LIMIT is non-nil, it is a buffer position; if the end of the field
is after LIMIT, then LIMIT will be returned instead. */)
- (pos, escape_from_edge, limit)
- Lisp_Object pos, escape_from_edge, limit;
+ (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit)
{
int end;
find_field (pos, escape_from_edge, Qnil, 0, limit, &end);
@@ -744,9 +719,7 @@ If the optional argument INHIBIT-CAPTURE-PROPERTY is non-nil, and OLD-POS has
a non-nil property of that name, then any field boundaries are ignored.
Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */)
- (new_pos, old_pos, escape_from_edge, only_in_line, inhibit_capture_property)
- Lisp_Object new_pos, old_pos;
- Lisp_Object escape_from_edge, only_in_line, inhibit_capture_property;
+ (Lisp_Object new_pos, Lisp_Object old_pos, Lisp_Object escape_from_edge, Lisp_Object only_in_line, Lisp_Object inhibit_capture_property)
{
/* If non-zero, then the original point, before re-positioning. */
int orig_point = 0;
@@ -841,8 +814,7 @@ starts at point, the scan stops as soon as it starts. To ignore field
boundaries bind `inhibit-field-text-motion' to t.
This function does not move point. */)
- (n)
- Lisp_Object n;
+ (Lisp_Object n)
{
int orig, orig_byte, end;
int count = SPECPDL_INDEX ();
@@ -880,8 +852,7 @@ at point, the scan stops as soon as it starts. To ignore field
boundaries bind `inhibit-field-text-motion' to t.
This function does not move point. */)
- (n)
- Lisp_Object n;
+ (Lisp_Object n)
{
int end_pos;
int orig = PT;
@@ -900,7 +871,7 @@ This function does not move point. */)
Lisp_Object
-save_excursion_save ()
+save_excursion_save (void)
{
int visible = (XBUFFER (XWINDOW (selected_window)->buffer)
== current_buffer);
@@ -913,8 +884,7 @@ save_excursion_save ()
}
Lisp_Object
-save_excursion_restore (info)
- Lisp_Object info;
+save_excursion_restore (Lisp_Object info)
{
Lisp_Object tem, tem1, omark, nmark;
struct gcpro gcpro1, gcpro2, gcpro3;
@@ -1013,8 +983,7 @@ If you only want to save the current buffer but not point nor mark,
then just use `save-current-buffer', or even `with-current-buffer'.
usage: (save-excursion &rest BODY) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object val;
int count = SPECPDL_INDEX ();
@@ -1029,8 +998,7 @@ DEFUN ("save-current-buffer", Fsave_current_buffer, Ssave_current_buffer, 0, UNE
doc: /* Save the current buffer; execute BODY; restore the current buffer.
Executes BODY just like `progn'.
usage: (save-current-buffer &rest BODY) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
Lisp_Object val;
int count = SPECPDL_INDEX ();
@@ -1044,8 +1012,7 @@ usage: (save-current-buffer &rest BODY) */)
DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 1, 0,
doc: /* Return the number of characters in the current buffer.
If BUFFER, return the number of characters in that buffer instead. */)
- (buffer)
- Lisp_Object buffer;
+ (Lisp_Object buffer)
{
if (NILP (buffer))
return make_number (Z - BEG);
@@ -1060,7 +1027,7 @@ If BUFFER, return the number of characters in that buffer instead. */)
DEFUN ("point-min", Fpoint_min, Spoint_min, 0, 0, 0,
doc: /* Return the minimum permissible value of point in the current buffer.
This is 1, unless narrowing (a buffer restriction) is in effect. */)
- ()
+ (void)
{
Lisp_Object temp;
XSETFASTINT (temp, BEGV);
@@ -1070,7 +1037,7 @@ This is 1, unless narrowing (a buffer restriction) is in effect. */)
DEFUN ("point-min-marker", Fpoint_min_marker, Spoint_min_marker, 0, 0, 0,
doc: /* Return a marker to the minimum permissible value of point in this buffer.
This is the beginning, unless narrowing (a buffer restriction) is in effect. */)
- ()
+ (void)
{
return buildmark (BEGV, BEGV_BYTE);
}
@@ -1079,7 +1046,7 @@ DEFUN ("point-max", Fpoint_max, Spoint_max, 0, 0, 0,
doc: /* Return the maximum permissible value of point in the current buffer.
This is (1+ (buffer-size)), unless narrowing (a buffer restriction)
is in effect, in which case it is less. */)
- ()
+ (void)
{
Lisp_Object temp;
XSETFASTINT (temp, ZV);
@@ -1090,7 +1057,7 @@ DEFUN ("point-max-marker", Fpoint_max_marker, Spoint_max_marker, 0, 0, 0,
doc: /* Return a marker to the maximum permissible value of point in this buffer.
This is (1+ (buffer-size)), unless narrowing (a buffer restriction)
is in effect, in which case it is less. */)
- ()
+ (void)
{
return buildmark (ZV, ZV_BYTE);
}
@@ -1098,7 +1065,7 @@ is in effect, in which case it is less. */)
DEFUN ("gap-position", Fgap_position, Sgap_position, 0, 0, 0,
doc: /* Return the position of the gap, in the current buffer.
See also `gap-size'. */)
- ()
+ (void)
{
Lisp_Object temp;
XSETFASTINT (temp, GPT);
@@ -1108,7 +1075,7 @@ See also `gap-size'. */)
DEFUN ("gap-size", Fgap_size, Sgap_size, 0, 0, 0,
doc: /* Return the size of the current buffer's gap.
See also `gap-position'. */)
- ()
+ (void)
{
Lisp_Object temp;
XSETFASTINT (temp, GAP_SIZE);
@@ -1118,8 +1085,7 @@ See also `gap-position'. */)
DEFUN ("position-bytes", Fposition_bytes, Sposition_bytes, 1, 1, 0,
doc: /* Return the byte position for character position POSITION.
If POSITION is out of range, the value is nil. */)
- (position)
- Lisp_Object position;
+ (Lisp_Object position)
{
CHECK_NUMBER_COERCE_MARKER (position);
if (XINT (position) < BEG || XINT (position) > Z)
@@ -1130,8 +1096,7 @@ If POSITION is out of range, the value is nil. */)
DEFUN ("byte-to-position", Fbyte_to_position, Sbyte_to_position, 1, 1, 0,
doc: /* Return the character position for byte position BYTEPOS.
If BYTEPOS is out of range, the value is nil. */)
- (bytepos)
- Lisp_Object bytepos;
+ (Lisp_Object bytepos)
{
CHECK_NUMBER (bytepos);
if (XINT (bytepos) < BEG_BYTE || XINT (bytepos) > Z_BYTE)
@@ -1142,7 +1107,7 @@ If BYTEPOS is out of range, the value is nil. */)
DEFUN ("following-char", Ffollowing_char, Sfollowing_char, 0, 0, 0,
doc: /* Return the character following point, as a number.
At the end of the buffer or accessible region, return 0. */)
- ()
+ (void)
{
Lisp_Object temp;
if (PT >= ZV)
@@ -1155,7 +1120,7 @@ At the end of the buffer or accessible region, return 0. */)
DEFUN ("preceding-char", Fprevious_char, Sprevious_char, 0, 0, 0,
doc: /* Return the character preceding point, as a number.
At the beginning of the buffer or accessible region, return 0. */)
- ()
+ (void)
{
Lisp_Object temp;
if (PT <= BEGV)
@@ -1174,7 +1139,7 @@ At the beginning of the buffer or accessible region, return 0. */)
DEFUN ("bobp", Fbobp, Sbobp, 0, 0, 0,
doc: /* Return t if point is at the beginning of the buffer.
If the buffer is narrowed, this means the beginning of the narrowed part. */)
- ()
+ (void)
{
if (PT == BEGV)
return Qt;
@@ -1184,7 +1149,7 @@ If the buffer is narrowed, this means the beginning of the narrowed part. */)
DEFUN ("eobp", Feobp, Seobp, 0, 0, 0,
doc: /* Return t if point is at the end of the buffer.
If the buffer is narrowed, this means the end of the narrowed part. */)
- ()
+ (void)
{
if (PT == ZV)
return Qt;
@@ -1193,7 +1158,7 @@ If the buffer is narrowed, this means the end of the narrowed part. */)
DEFUN ("bolp", Fbolp, Sbolp, 0, 0, 0,
doc: /* Return t if point is at the beginning of a line. */)
- ()
+ (void)
{
if (PT == BEGV || FETCH_BYTE (PT_BYTE - 1) == '\n')
return Qt;
@@ -1203,7 +1168,7 @@ DEFUN ("bolp", Fbolp, Sbolp, 0, 0, 0,
DEFUN ("eolp", Feolp, Seolp, 0, 0, 0,
doc: /* Return t if point is at the end of a line.
`End of a line' includes point being at the end of the buffer. */)
- ()
+ (void)
{
if (PT == ZV || FETCH_BYTE (PT_BYTE) == '\n')
return Qt;
@@ -1214,8 +1179,7 @@ DEFUN ("char-after", Fchar_after, Schar_after, 0, 1, 0,
doc: /* Return character in current buffer at position POS.
POS is an integer or a marker and defaults to point.
If POS is out of range, the value is nil. */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
register int pos_byte;
@@ -1247,8 +1211,7 @@ DEFUN ("char-before", Fchar_before, Schar_before, 0, 1, 0,
doc: /* Return character in current buffer preceding position POS.
POS is an integer or a marker and defaults to point.
If POS is out of range, the value is nil. */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
register Lisp_Object val;
register int pos_byte;
@@ -1297,8 +1260,7 @@ that determines the value of this function.
If optional argument UID is an integer or a float, return the login name
of the user with that uid, or nil if there is no such user. */)
- (uid)
- Lisp_Object uid;
+ (Lisp_Object uid)
{
struct passwd *pw;
uid_t id;
@@ -1324,7 +1286,7 @@ DEFUN ("user-real-login-name", Fuser_real_login_name, Suser_real_login_name,
doc: /* Return the name of the user's real uid, as a string.
This ignores the environment variables LOGNAME and USER, so it differs from
`user-login-name' when running under `su'. */)
- ()
+ (void)
{
/* Set up the user name info if we didn't do it before.
(That can happen if Emacs is dumpable
@@ -1337,7 +1299,7 @@ This ignores the environment variables LOGNAME and USER, so it differs from
DEFUN ("user-uid", Fuser_uid, Suser_uid, 0, 0, 0,
doc: /* Return the effective uid of Emacs.
Value is an integer or a float, depending on the value. */)
- ()
+ (void)
{
/* Assignment to EMACS_INT stops GCC whining about limited range of
data type. */
@@ -1353,7 +1315,7 @@ Value is an integer or a float, depending on the value. */)
DEFUN ("user-real-uid", Fuser_real_uid, Suser_real_uid, 0, 0, 0,
doc: /* Return the real uid of Emacs.
Value is an integer or a float, depending on the value. */)
- ()
+ (void)
{
/* Assignment to EMACS_INT stops GCC whining about limited range of
data type. */
@@ -1375,8 +1337,7 @@ If optional argument UID is an integer or float, return the full name
of the user with that uid, or nil if there is no such user.
If UID is a string, return the full name of the user with that login
name, or nil if there is no such user. */)
- (uid)
- Lisp_Object uid;
+ (Lisp_Object uid)
{
struct passwd *pw;
register unsigned char *p, *q;
@@ -1404,12 +1365,12 @@ name, or nil if there is no such user. */)
p = (unsigned char *) USER_FULL_NAME;
/* Chop off everything after the first comma. */
- q = (unsigned char *) index (p, ',');
+ q = (unsigned char *) strchr (p, ',');
full = make_string (p, q ? q - p : strlen (p));
#ifdef AMPERSAND_FULL_NAME
p = SDATA (full);
- q = (unsigned char *) index (p, '&');
+ q = (unsigned char *) strchr (p, '&');
/* Substitute the login name for the &, upcasing the first character. */
if (q)
{
@@ -1418,7 +1379,7 @@ name, or nil if there is no such user. */)
login = Fuser_login_name (make_number (pw->pw_uid));
r = (unsigned char *) alloca (strlen (p) + SCHARS (login) + 1);
- bcopy (p, r, q - p);
+ memcpy (r, p, q - p);
r[q - p] = 0;
strcat (r, SDATA (login));
r[q - p] = UPCASE (r[q - p]);
@@ -1432,7 +1393,7 @@ name, or nil if there is no such user. */)
DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0,
doc: /* Return the host name of the machine you are running on, as a string. */)
- ()
+ (void)
{
return Vsystem_name;
}
@@ -1440,7 +1401,7 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0,
/* For the benefit of callers who don't want to include lisp.h */
char *
-get_system_name ()
+get_system_name (void)
{
if (STRINGP (Vsystem_name))
return (char *) SDATA (Vsystem_name);
@@ -1449,7 +1410,7 @@ get_system_name ()
}
char *
-get_operating_system_release()
+get_operating_system_release (void)
{
if (STRINGP (Voperating_system_release))
return (char *) SDATA (Voperating_system_release);
@@ -1459,7 +1420,7 @@ get_operating_system_release()
DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0,
doc: /* Return the process ID of Emacs, as an integer. */)
- ()
+ (void)
{
return make_number (getpid ());
}
@@ -1473,7 +1434,7 @@ count.
The microsecond count is zero on systems that do not provide
resolution finer than a second. */)
- ()
+ (void)
{
EMACS_TIME t;
@@ -1494,7 +1455,7 @@ count.
On systems that can't determine the run time, `get-internal-run-time'
does the same thing as `current-time'. The microsecond count is zero
on systems that do not provide resolution finer than a second. */)
- ()
+ (void)
{
#ifdef HAVE_GETRUSAGE
struct rusage usage;
@@ -1527,10 +1488,7 @@ on systems that do not provide resolution finer than a second. */)
int
-lisp_time_argument (specified_time, result, usec)
- Lisp_Object specified_time;
- time_t *result;
- int *usec;
+lisp_time_argument (Lisp_Object specified_time, time_t *result, int *usec)
{
if (NILP (specified_time))
{
@@ -1588,8 +1546,7 @@ have the form (HIGH . LOW), but this is considered obsolete.
WARNING: Since the result is floating point, it may not be exact.
If precise time stamps are required, use either `current-time',
or (if you need time as a string) `format-time-string'. */)
- (specified_time)
- Lisp_Object specified_time;
+ (Lisp_Object specified_time)
{
time_t sec;
int usec;
@@ -1611,13 +1568,7 @@ or (if you need time as a string) `format-time-string'. */)
This function behaves like emacs_strftimeu, except it allows null
bytes in FORMAT. */
static size_t
-emacs_memftimeu (s, maxsize, format, format_len, tp, ut)
- char *s;
- size_t maxsize;
- const char *format;
- size_t format_len;
- const struct tm *tp;
- int ut;
+emacs_memftimeu (char *s, size_t maxsize, const char *format, size_t format_len, const struct tm *tp, int ut)
{
size_t total = 0;
@@ -1705,8 +1656,7 @@ The modifiers are `E' and `O'. For certain characters X,
%OX is like %X, but uses the locale's number symbols.
For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */)
- (format_string, time, universal)
- Lisp_Object format_string, time, universal;
+ (Lisp_Object format_string, Lisp_Object time, Lisp_Object universal)
{
time_t value;
int size;
@@ -1773,8 +1723,7 @@ where 0 is Sunday. DST is t if daylight saving time is in effect,
otherwise nil. ZONE is an integer indicating the number of seconds
east of Greenwich. (Note that Common Lisp has different meanings for
DOW and ZONE.) */)
- (specified_time)
- Lisp_Object specified_time;
+ (Lisp_Object specified_time)
{
time_t time_spec;
struct tm save_tm;
@@ -1834,9 +1783,7 @@ Years before 1970 are not guaranteed to work. On some systems,
year values as low as 1901 do work.
usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
time_t time;
struct tm tm;
@@ -1922,8 +1869,7 @@ current time. The argument should have the form (HIGH LOW . IGNORED).
Thus, you can use times obtained from `current-time' and from
`file-attributes'. SPECIFIED-TIME can also have the form (HIGH . LOW),
but this is considered obsolete. */)
- (specified_time)
- Lisp_Object specified_time;
+ (Lisp_Object specified_time)
{
time_t value;
struct tm *tm;
@@ -1950,8 +1896,7 @@ but this is considered obsolete. */)
/* Yield A - B, measured in seconds.
This function is copied from the GNU C Library. */
static int
-tm_diff (a, b)
- struct tm *a, *b;
+tm_diff (struct tm *a, struct tm *b)
{
/* Compute intervening leap days correctly even if year is negative.
Take care to avoid int overflow in leap day calculations,
@@ -1986,8 +1931,7 @@ have the form (HIGH . LOW), but this is considered obsolete.
Some operating systems cannot provide all this information to Emacs;
in this case, `current-time-zone' returns a list containing nil for
the data it can't find. */)
- (specified_time)
- Lisp_Object specified_time;
+ (Lisp_Object specified_time)
{
time_t value;
struct tm *t;
@@ -2051,8 +1995,7 @@ DEFUN ("set-time-zone-rule", Fset_time_zone_rule, Sset_time_zone_rule, 1, 1, 0,
doc: /* Set the local time zone using TZ, a string specifying a time zone rule.
If TZ is nil, use implementation-defined default time zone information.
If TZ is t, use Universal Time. */)
- (tz)
- Lisp_Object tz;
+ (Lisp_Object tz)
{
char *tzstring;
@@ -2098,8 +2041,7 @@ static char set_time_zone_rule_tz2[] = "TZ=GMT+1";
responsibility to free. */
void
-set_time_zone_rule (tzstring)
- char *tzstring;
+set_time_zone_rule (const char *tzstring)
{
int envptrs;
char **from, **to, **newenv;
@@ -2221,8 +2163,7 @@ general_insert_function (void (*insert_func)
}
void
-insert1 (arg)
- Lisp_Object arg;
+insert1 (Lisp_Object arg)
{
Finsert (1, &arg);
}
@@ -2250,9 +2191,7 @@ buffer; to accomplish this, apply `string-as-multibyte' to the string
and insert the result.
usage: (insert &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
general_insert_function (insert, insert_from_string, 0, nargs, args);
return Qnil;
@@ -2271,9 +2210,7 @@ If the current buffer is unibyte, multibyte strings are converted
to unibyte for insertion.
usage: (insert-and-inherit &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
general_insert_function (insert_and_inherit, insert_from_string, 1,
nargs, args);
@@ -2290,9 +2227,7 @@ If the current buffer is unibyte, multibyte strings are converted
to unibyte for insertion.
usage: (insert-before-markers &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
general_insert_function (insert_before_markers,
insert_from_string_before_markers, 0,
@@ -2311,9 +2246,7 @@ If the current buffer is unibyte, multibyte strings are converted
to unibyte for insertion.
usage: (insert-before-markers-and-inherit &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
general_insert_function (insert_before_markers_and_inherit,
insert_from_string_before_markers, 1,
@@ -2326,8 +2259,7 @@ DEFUN ("insert-char", Finsert_char, Sinsert_char, 2, 3, 0,
Point, and before-insertion markers, are relocated as in the function `insert'.
The optional third arg INHERIT, if non-nil, says to inherit text properties
from adjoining text, if those properties are sticky. */)
- (character, count, inherit)
- Lisp_Object character, count, inherit;
+ (Lisp_Object character, Lisp_Object count, Lisp_Object inherit)
{
register unsigned char *string;
register int strlen;
@@ -2379,8 +2311,7 @@ corresponding eight-bit character is inserted.
Point, and before-insertion markers, are relocated as in the function `insert'.
The optional third arg INHERIT, if non-nil, says to inherit text properties
from adjoining text, if those properties are sticky. */)
- (byte, count, inherit)
- Lisp_Object byte, count, inherit;
+ (Lisp_Object byte, Lisp_Object count, Lisp_Object inherit)
{
CHECK_NUMBER (byte);
if (XINT (byte) < 0 || XINT (byte) > 255)
@@ -2408,9 +2339,7 @@ from adjoining text, if those properties are sticky. */)
buffer substrings. */
Lisp_Object
-make_buffer_string (start, end, props)
- int start, end;
- int props;
+make_buffer_string (int start, int end, int props)
{
int start_byte = CHAR_TO_BYTE (start);
int end_byte = CHAR_TO_BYTE (end);
@@ -2434,9 +2363,7 @@ make_buffer_string (start, end, props)
buffer substrings. */
Lisp_Object
-make_buffer_string_both (start, start_byte, end, end_byte, props)
- int start, start_byte, end, end_byte;
- int props;
+make_buffer_string_both (int start, int start_byte, int end, int end_byte, int props)
{
Lisp_Object result, tem, tem1;
@@ -2447,8 +2374,7 @@ make_buffer_string_both (start, start_byte, end, end_byte, props)
result = make_uninit_multibyte_string (end - start, end_byte - start_byte);
else
result = make_uninit_string (end - start);
- bcopy (BYTE_POS_ADDR (start_byte), SDATA (result),
- end_byte - start_byte);
+ memcpy (SDATA (result), BYTE_POS_ADDR (start_byte), end_byte - start_byte);
/* If desired, update and copy the text properties. */
if (props)
@@ -2470,8 +2396,7 @@ make_buffer_string_both (start, start_byte, end, end_byte, props)
in the current buffer, if necessary. */
static void
-update_buffer_properties (start, end)
- int start, end;
+update_buffer_properties (int start, int end)
{
/* If this buffer has some access functions,
call them, specifying the range of the buffer being accessed. */
@@ -2508,8 +2433,7 @@ The string returned is multibyte if the buffer is multibyte.
This function copies the text properties of that part of the buffer
into the result string; if you don't want the text properties,
use `buffer-substring-no-properties' instead. */)
- (start, end)
- Lisp_Object start, end;
+ (Lisp_Object start, Lisp_Object end)
{
register int b, e;
@@ -2525,8 +2449,7 @@ DEFUN ("buffer-substring-no-properties", Fbuffer_substring_no_properties,
doc: /* Return the characters of part of the buffer, without the text properties.
The two arguments START and END are character positions;
they can be in either order. */)
- (start, end)
- Lisp_Object start, end;
+ (Lisp_Object start, Lisp_Object end)
{
register int b, e;
@@ -2541,7 +2464,7 @@ DEFUN ("buffer-string", Fbuffer_string, Sbuffer_string, 0, 0, 0,
doc: /* Return the contents of the current buffer as a string.
If narrowing is in effect, this function returns only the visible part
of the buffer. */)
- ()
+ (void)
{
return make_buffer_string (BEGV, ZV, 1);
}
@@ -2552,8 +2475,7 @@ DEFUN ("insert-buffer-substring", Finsert_buffer_substring, Sinsert_buffer_subst
BUFFER may be a buffer or a buffer name.
Arguments START and END are character positions specifying the substring.
They default to the values of (point-min) and (point-max) in BUFFER. */)
- (buffer, start, end)
- Lisp_Object buffer, start, end;
+ (Lisp_Object buffer, Lisp_Object start, Lisp_Object end)
{
register int b, e, temp;
register struct buffer *bp, *obuf;
@@ -2606,8 +2528,7 @@ That makes six args in all, three for each substring.
The value of `case-fold-search' in the current buffer
determines whether case is significant or ignored. */)
- (buffer1, start1, end1, buffer2, start2, end2)
- Lisp_Object buffer1, start1, end1, buffer2, start2, end2;
+ (Lisp_Object buffer1, Lisp_Object start1, Lisp_Object end1, Lisp_Object buffer2, Lisp_Object start2, Lisp_Object end2)
{
register int begp1, endp1, begp2, endp2, temp;
register struct buffer *bp1, *bp2;
@@ -2757,15 +2678,13 @@ determines whether case is significant or ignored. */)
}
static Lisp_Object
-subst_char_in_region_unwind (arg)
- Lisp_Object arg;
+subst_char_in_region_unwind (Lisp_Object arg)
{
return current_buffer->undo_list = arg;
}
static Lisp_Object
-subst_char_in_region_unwind_1 (arg)
- Lisp_Object arg;
+subst_char_in_region_unwind_1 (Lisp_Object arg)
{
return current_buffer->filename = arg;
}
@@ -2776,8 +2695,7 @@ DEFUN ("subst-char-in-region", Fsubst_char_in_region,
If optional arg NOUNDO is non-nil, don't record this change for undo
and don't mark the buffer as really changed.
Both characters must have the same length of multi-byte form. */)
- (start, end, fromchar, tochar, noundo)
- Lisp_Object start, end, fromchar, tochar, noundo;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object fromchar, Lisp_Object tochar, Lisp_Object noundo)
{
register int pos, pos_byte, stop, i, len, end_byte;
/* Keep track of the first change in the buffer:
@@ -2953,7 +2871,7 @@ Both characters must have the same length of multi-byte form. */)
}
-static Lisp_Object check_translation P_ ((int, int, int, Lisp_Object));
+static Lisp_Object check_translation (int, int, int, Lisp_Object);
/* Helper function for Ftranslate_region_internal.
@@ -2962,9 +2880,7 @@ static Lisp_Object check_translation P_ ((int, int, int, Lisp_Object));
element is found, return it. Otherwise return Qnil. */
static Lisp_Object
-check_translation (pos, pos_byte, end, val)
- int pos, pos_byte, end;
- Lisp_Object val;
+check_translation (int pos, int pos_byte, int end, Lisp_Object val)
{
int buf_size = 16, buf_used = 0;
int *buf = alloca (sizeof (int) * buf_size);
@@ -3020,10 +2936,7 @@ From START to END, translate characters according to TABLE.
TABLE is a string or a char-table; the Nth character in it is the
mapping for the character with code N.
It returns the number of characters changed. */)
- (start, end, table)
- Lisp_Object start;
- Lisp_Object end;
- register Lisp_Object table;
+ (Lisp_Object start, Lisp_Object end, register Lisp_Object table)
{
register unsigned char *tt; /* Trans table. */
register int nc; /* New character. */
@@ -3189,8 +3102,7 @@ DEFUN ("delete-region", Fdelete_region, Sdelete_region, 2, 2, "r",
When called from a program, expects two arguments,
positions (integers or markers) specifying the stretch to be deleted. */)
- (start, end)
- Lisp_Object start, end;
+ (Lisp_Object start, Lisp_Object end)
{
validate_region (&start, &end);
del_range (XINT (start), XINT (end));
@@ -3200,8 +3112,7 @@ positions (integers or markers) specifying the stretch to be deleted. */)
DEFUN ("delete-and-extract-region", Fdelete_and_extract_region,
Sdelete_and_extract_region, 2, 2, 0,
doc: /* Delete the text between START and END and return it. */)
- (start, end)
- Lisp_Object start, end;
+ (Lisp_Object start, Lisp_Object end)
{
validate_region (&start, &end);
if (XINT (start) == XINT (end))
@@ -3212,7 +3123,7 @@ DEFUN ("delete-and-extract-region", Fdelete_and_extract_region,
DEFUN ("widen", Fwiden, Swiden, 0, 0, "",
doc: /* Remove restrictions (narrowing) from current buffer.
This allows the buffer's full text to be seen and edited. */)
- ()
+ (void)
{
if (BEG != BEGV || Z != ZV)
current_buffer->clip_changed = 1;
@@ -3233,8 +3144,7 @@ See also `save-restriction'.
When calling from a program, pass two arguments; positions (integers
or markers) bounding the text that should remain visible. */)
- (start, end)
- register Lisp_Object start, end;
+ (register Lisp_Object start, Lisp_Object end)
{
CHECK_NUMBER_COERCE_MARKER (start);
CHECK_NUMBER_COERCE_MARKER (end);
@@ -3263,7 +3173,7 @@ or markers) bounding the text that should remain visible. */)
}
Lisp_Object
-save_restriction_save ()
+save_restriction_save (void)
{
if (BEGV == BEG && ZV == Z)
/* The common case that the buffer isn't narrowed.
@@ -3287,8 +3197,7 @@ save_restriction_save ()
}
Lisp_Object
-save_restriction_restore (data)
- Lisp_Object data;
+save_restriction_restore (Lisp_Object data)
{
struct buffer *cur = NULL;
struct buffer *buf = (CONSP (data)
@@ -3368,8 +3277,7 @@ use `save-excursion' outermost:
(save-excursion (save-restriction ...))
usage: (save-restriction &rest BODY) */)
- (body)
- Lisp_Object body;
+ (Lisp_Object body)
{
register Lisp_Object val;
int count = SPECPDL_INDEX ();
@@ -3402,9 +3310,7 @@ any existing message; this lets the minibuffer contents show. See
also `current-message'.
usage: (message FORMAT-STRING &rest ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
if (NILP (args[0])
|| (STRINGP (args[0])
@@ -3432,9 +3338,7 @@ If the first argument is nil or the empty string, clear any existing
message; let the minibuffer contents show.
usage: (message-box FORMAT-STRING &rest ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
if (NILP (args[0]))
{
@@ -3472,7 +3376,7 @@ usage: (message-box FORMAT-STRING &rest ARGS) */)
message_length = SBYTES (val);
message_text = (char *)xrealloc (message_text, message_length);
}
- bcopy (SDATA (val), message_text, SBYTES (val));
+ memcpy (message_text, SDATA (val), SBYTES (val));
message2 (message_text, SBYTES (val),
STRING_MULTIBYTE (val));
return val;
@@ -3494,9 +3398,7 @@ If the first argument is nil or the empty string, clear any existing
message; let the minibuffer contents show.
usage: (message-or-box FORMAT-STRING &rest ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
#ifdef HAVE_MENUS
if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
@@ -3508,7 +3410,7 @@ usage: (message-or-box FORMAT-STRING &rest ARGS) */)
DEFUN ("current-message", Fcurrent_message, Scurrent_message, 0, 0, 0,
doc: /* Return the string currently displayed in the echo area, or nil if none. */)
- ()
+ (void)
{
return current_message ();
}
@@ -3520,9 +3422,7 @@ First argument is the string to copy.
Remaining arguments form a sequence of PROPERTY VALUE pairs for text
properties to add to the result.
usage: (propertize STRING &rest PROPERTIES) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
Lisp_Object properties, string;
struct gcpro gcpro1, gcpro2;
@@ -3604,9 +3504,7 @@ decimal point itself is omitted. For %s and %S, the precision
specifier truncates the string to the given width.
usage: (format STRING &rest OBJECTS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
register int n; /* The number of the next arg to substitute */
register int total; /* An estimate of the final length */
@@ -3627,7 +3525,7 @@ usage: (format STRING &rest OBJECTS) */)
string itself, will not be used. Element NARGS, corresponding to
no argument, *will* be assigned to in the case that a `%' and `.'
occur after the final format specifier. */
- int *precision = (int *) (alloca((nargs + 1) * sizeof (int)));
+ int *precision = (int *) (alloca ((nargs + 1) * sizeof (int)));
int longest_format;
Lisp_Object val;
int arg_intervals = 0;
@@ -3689,12 +3587,12 @@ usage: (format STRING &rest OBJECTS) */)
int i;
if (!info)
info = (struct info *) alloca (nbytes);
- bzero (info, nbytes);
+ memset (info, 0, nbytes);
for (i = 0; i <= nargs; i++)
info[i].start = -1;
if (!discarded)
SAFE_ALLOCA (discarded, char *, SBYTES (args[0]));
- bzero (discarded, SBYTES (args[0]));
+ memset (discarded, 0, SBYTES (args[0]));
}
/* Add to TOTAL enough space to hold the converted arguments. */
@@ -3798,7 +3696,7 @@ usage: (format STRING &rest OBJECTS) */)
string will finally appear (Bug#5710). */
actual_width = lisp_string_width (args[n], -1, NULL, NULL);
if (precision[n] != -1)
- actual_width = min(actual_width,precision[n]);
+ actual_width = min (actual_width, precision[n]);
}
/* Would get MPV otherwise, since Lisp_Int's `point' to low memory. */
else if (INTEGERP (args[n]) && *format != 's')
@@ -3911,7 +3809,7 @@ usage: (format STRING &rest OBJECTS) */)
discarded[format - format_start] = 1;
format++;
- while (index("-+0# ", *format))
+ while (strchr ("-+0# ", *format))
{
if (*format == '-')
{
@@ -4008,8 +3906,8 @@ usage: (format STRING &rest OBJECTS) */)
{
int this_nchars;
- bcopy (this_format_start, this_format,
- format - this_format_start);
+ memcpy (this_format, this_format_start,
+ format - this_format_start);
this_format[format - this_format_start] = 0;
if (format[-1] == 'e' || format[-1] == 'f' || format[-1] == 'g')
@@ -4209,9 +4107,7 @@ usage: (format STRING &rest OBJECTS) */)
}
Lisp_Object
-format2 (string1, arg0, arg1)
- char *string1;
- Lisp_Object arg0, arg1;
+format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1)
{
Lisp_Object args[3];
args[0] = build_string (string1);
@@ -4224,8 +4120,7 @@ DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0,
doc: /* Return t if two characters match, optionally ignoring case.
Both arguments must be characters (i.e. integers).
Case is ignored if `case-fold-search' is non-nil in the current buffer. */)
- (c1, c2)
- register Lisp_Object c1, c2;
+ (register Lisp_Object c1, Lisp_Object c2)
{
int i1, i2;
/* Check they're chars, not just integers, otherwise we could get array
@@ -4274,10 +4169,9 @@ Case is ignored if `case-fold-search' is non-nil in the current buffer. */)
It's the caller's job to ensure that START1 <= END1 <= START2 <= END2. */
static void
-transpose_markers (start1, end1, start2, end2,
- start1_byte, end1_byte, start2_byte, end2_byte)
- register int start1, end1, start2, end2;
- register int start1_byte, end1_byte, start2_byte, end2_byte;
+transpose_markers (int start1, int end1, int start2, int end2,
+ int start1_byte, int end1_byte,
+ int start2_byte, int end2_byte)
{
register int amt1, amt1_byte, amt2, amt2_byte, diff, diff_byte, mpos;
register struct Lisp_Marker *marker;
@@ -4351,8 +4245,7 @@ Optional fifth arg LEAVE-MARKERS, if non-nil, means don't update
any markers that happen to be located in the regions.
Transposing beyond buffer boundaries is an error. */)
- (startr1, endr1, startr2, endr2, leave_markers)
- Lisp_Object startr1, endr1, startr2, endr2, leave_markers;
+ (Lisp_Object startr1, Lisp_Object endr1, Lisp_Object startr2, Lisp_Object endr2, Lisp_Object leave_markers)
{
register EMACS_INT start1, end1, start2, end2;
EMACS_INT start1_byte, start2_byte, len1_byte, len2_byte;
@@ -4488,9 +4381,9 @@ Transposing beyond buffer boundaries is an error. */)
start1_addr = BYTE_POS_ADDR (start1_byte);
start2_addr = BYTE_POS_ADDR (start2_byte);
- bcopy (start2_addr, temp, len2_byte);
- bcopy (start1_addr, start1_addr + len2_byte, len1_byte);
- bcopy (temp, start1_addr, len2_byte);
+ memcpy (temp, start2_addr, len2_byte);
+ memcpy (start1_addr + len2_byte, start1_addr, len1_byte);
+ memcpy (start1_addr, temp, len2_byte);
SAFE_FREE ();
}
else
@@ -4501,9 +4394,9 @@ Transposing beyond buffer boundaries is an error. */)
SAFE_ALLOCA (temp, unsigned char *, len1_byte);
start1_addr = BYTE_POS_ADDR (start1_byte);
start2_addr = BYTE_POS_ADDR (start2_byte);
- bcopy (start1_addr, temp, len1_byte);
- bcopy (start2_addr, start1_addr, len2_byte);
- bcopy (temp, start1_addr + len2_byte, len1_byte);
+ memcpy (temp, start1_addr, len1_byte);
+ memcpy (start1_addr, start2_addr, len2_byte);
+ memcpy (start1_addr + len2_byte, temp, len1_byte);
SAFE_FREE ();
}
graft_intervals_into_buffer (tmp_interval1, start1 + len2,
@@ -4541,9 +4434,9 @@ Transposing beyond buffer boundaries is an error. */)
SAFE_ALLOCA (temp, unsigned char *, len1_byte);
start1_addr = BYTE_POS_ADDR (start1_byte);
start2_addr = BYTE_POS_ADDR (start2_byte);
- bcopy (start1_addr, temp, len1_byte);
- bcopy (start2_addr, start1_addr, len2_byte);
- bcopy (temp, start2_addr, len1_byte);
+ memcpy (temp, start1_addr, len1_byte);
+ memcpy (start1_addr, start2_addr, len2_byte);
+ memcpy (start2_addr, temp, len1_byte);
SAFE_FREE ();
graft_intervals_into_buffer (tmp_interval1, start2,
@@ -4571,10 +4464,10 @@ Transposing beyond buffer boundaries is an error. */)
SAFE_ALLOCA (temp, unsigned char *, len2_byte);
start1_addr = BYTE_POS_ADDR (start1_byte);
start2_addr = BYTE_POS_ADDR (start2_byte);
- bcopy (start2_addr, temp, len2_byte);
- bcopy (start1_addr, start1_addr + len_mid + len2_byte, len1_byte);
- safe_bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid);
- bcopy (temp, start1_addr, len2_byte);
+ memcpy (temp, start2_addr, len2_byte);
+ memcpy (start1_addr + len_mid + len2_byte, start1_addr, len1_byte);
+ memmove (start1_addr + len2_byte, start1_addr + len1_byte, len_mid);
+ memcpy (start1_addr, temp, len2_byte);
SAFE_FREE ();
graft_intervals_into_buffer (tmp_interval1, end2 - len1,
@@ -4604,10 +4497,10 @@ Transposing beyond buffer boundaries is an error. */)
SAFE_ALLOCA (temp, unsigned char *, len1_byte);
start1_addr = BYTE_POS_ADDR (start1_byte);
start2_addr = BYTE_POS_ADDR (start2_byte);
- bcopy (start1_addr, temp, len1_byte);
- bcopy (start2_addr, start1_addr, len2_byte);
- bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid);
- bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte);
+ memcpy (temp, start1_addr, len1_byte);
+ memcpy (start1_addr, start2_addr, len2_byte);
+ memcpy (start1_addr + len2_byte, start1_addr + len1_byte, len_mid);
+ memcpy (start1_addr + len2_byte + len_mid, temp, len1_byte);
SAFE_FREE ();
graft_intervals_into_buffer (tmp_interval1, end2 - len1,
@@ -4639,7 +4532,7 @@ Transposing beyond buffer boundaries is an error. */)
void
-syms_of_editfns ()
+syms_of_editfns (void)
{
environbuf = 0;
initial_tz = 0;
diff --git a/src/emacs.c b/src/emacs.c
index 7e778e2e5fd..fbae7763877 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -90,12 +90,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
const char emacs_version[] = "24.0.50";
-extern void malloc_warning P_ ((char *));
-extern void set_time_zone_rule P_ ((char *));
-#ifdef HAVE_INDEX
-extern char *index P_ ((const char *, int));
-#endif
-
/* Make these values available in GDB, which doesn't see macros. */
#ifdef USE_LSB_TAG
@@ -157,9 +151,9 @@ int initialized;
static data inside glibc's malloc. */
void *malloc_state_ptr;
/* From glibc, a routine that returns a copy of the malloc internal state. */
-extern void *malloc_get_state ();
+extern void *malloc_get_state (void);
/* From glibc, a routine that overwrites the malloc internal state. */
-extern int malloc_set_state ();
+extern int malloc_set_state (void*);
/* Non-zero if the MALLOC_CHECK_ environment variable was set while
dumping. Used to work around a bug in glibc's malloc. */
int malloc_using_checking;
@@ -252,8 +246,8 @@ int daemon_pipe[2];
char **initial_argv;
int initial_argc;
-static void sort_args ();
-void syms_of_emacs ();
+static void sort_args (int argc, char **argv);
+void syms_of_emacs (void);
/* MSVC needs each string be shorter than 2048 bytes, so the usage
strings below are split to not overflow this limit. */
@@ -361,7 +355,7 @@ int fatal_error_in_progress;
/* If non-null, call this function from fatal_error_signal before
committing suicide. */
-void (*fatal_error_signal_hook) P_ ((void));
+void (*fatal_error_signal_hook) (void);
#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD
/* When compiled with GTK and running under Gnome,
@@ -374,8 +368,7 @@ pthread_t main_thread;
/* Handle bus errors, invalid instruction, etc. */
SIGTYPE
-fatal_error_signal (sig)
- int sig;
+fatal_error_signal (int sig)
{
SIGNAL_THREAD_CHECK (sig);
fatal_error_code = sig;
@@ -432,7 +425,7 @@ memory_warning_signal (sig)
#if ! defined (DOS_NT) && ! defined (NO_ABORT)
void
-abort ()
+abort (void)
{
kill (getpid (), SIGABRT);
/* This shouldn't be executed, but it prevents a warning. */
@@ -444,10 +437,7 @@ abort ()
/* Code for dealing with Lisp access to the Unix command line. */
static void
-init_cmdargs (argc, argv, skip_args)
- int argc;
- char **argv;
- int skip_args;
+init_cmdargs (int argc, char **argv, int skip_args)
{
register int i;
Lisp_Object name, dir, tem;
@@ -589,7 +579,7 @@ init_cmdargs (argc, argv, skip_args)
DEFUN ("invocation-name", Finvocation_name, Sinvocation_name, 0, 0, 0,
doc: /* Return the program name that was used to run Emacs.
Any directory names are omitted. */)
- ()
+ (void)
{
return Fcopy_sequence (Vinvocation_name);
}
@@ -597,7 +587,7 @@ Any directory names are omitted. */)
DEFUN ("invocation-directory", Finvocation_directory, Sinvocation_directory,
0, 0, 0,
doc: /* Return the directory name in which the Emacs executable was located. */)
- ()
+ (void)
{
return Fcopy_sequence (Vinvocation_directory);
}
@@ -616,11 +606,11 @@ static char dump_tz[] = "UtC0";
(We don't have any real constructors or destructors.) */
#ifdef __GNUC__
#ifndef GCC_CTORS_IN_LIBC
-void __do_global_ctors ()
+void __do_global_ctors (void)
{}
-void __do_global_ctors_aux ()
+void __do_global_ctors_aux (void)
{}
-void __do_global_dtors ()
+void __do_global_dtors (void)
{}
/* GNU/Linux has a bug in its library; avoid an error. */
#ifndef GNU_LINUX
@@ -628,7 +618,7 @@ char * __CTOR_LIST__[2] = { (char *) (-1), 0 };
#endif
char * __DTOR_LIST__[2] = { (char *) (-1), 0 };
#endif /* GCC_CTORS_IN_LIBC */
-void __main ()
+void __main (void)
{}
#endif /* __GNUC__ */
#endif /* ORDINARY_LINK */
@@ -644,14 +634,7 @@ void __main ()
enough information to do it right. */
static int
-argmatch (argv, argc, sstr, lstr, minlen, valptr, skipptr)
- char **argv;
- int argc;
- char *sstr;
- char *lstr;
- int minlen;
- char **valptr;
- int *skipptr;
+argmatch (char **argv, int argc, char *sstr, char *lstr, int minlen, char **valptr, int *skipptr)
{
char *p = NULL;
int arglen;
@@ -675,7 +658,7 @@ argmatch (argv, argc, sstr, lstr, minlen, valptr, skipptr)
*skipptr += 1;
return 1;
}
- arglen = (valptr != NULL && (p = index (arg, '=')) != NULL
+ arglen = (valptr != NULL && (p = strchr (arg, '=')) != NULL
? p - arg : strlen (arg));
if (lstr == 0 || arglen < minlen || strncmp (arg, lstr, arglen) != 0)
return 0;
@@ -709,7 +692,7 @@ argmatch (argv, argc, sstr, lstr, minlen, valptr, skipptr)
possible using this special hook. */
static void
-malloc_initialize_hook ()
+malloc_initialize_hook (void)
{
#ifndef USE_CRT_DLL
extern char **environ;
@@ -747,7 +730,7 @@ malloc_initialize_hook ()
}
}
-void (*__malloc_initialize_hook) () = malloc_initialize_hook;
+void (*__malloc_initialize_hook) (void) = malloc_initialize_hook;
#endif /* DOUG_LEA_MALLOC */
@@ -974,12 +957,6 @@ main (int argc, char **argv)
}
#endif /* MSDOS */
-#ifdef SET_EMACS_PRIORITY
- if (emacs_priority)
- nice (emacs_priority);
- setuid (getuid ());
-#endif /* SET_EMACS_PRIORITY */
-
/* Skip initial setlocale if LC_ALL is "C", as it's not needed in that case.
The build procedure uses this while dumping, to ensure that the
dumped Emacs does not have its system locale tables initialized,
@@ -1202,7 +1179,7 @@ main (int argc, char **argv)
#endif
#if defined (HAVE_GTK_AND_PTHREAD) && !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC)
{
- extern void malloc_enable_thread P_ ((void));
+ extern void malloc_enable_thread (void);
malloc_enable_thread ();
}
@@ -1663,6 +1640,9 @@ main (int argc, char **argv)
#ifdef MSDOS
syms_of_xmenu ();
+ syms_of_dosfns();
+ syms_of_msdos();
+ syms_of_win16select();
#endif /* MSDOS */
#ifdef HAVE_NS
@@ -1677,13 +1657,9 @@ main (int argc, char **argv)
syms_of_dbusbind ();
#endif /* HAVE_DBUS */
-#ifdef SYMS_SYSTEM
- SYMS_SYSTEM;
-#endif
-
-#ifdef SYMS_MACHINE
- SYMS_MACHINE;
-#endif
+#ifdef WINDOWSNT
+ syms_of_ntterm ();
+#endif /* WINDOWSNT */
keys_of_casefiddle ();
keys_of_cmds ();
@@ -1772,13 +1748,14 @@ main (int argc, char **argv)
extern char etext;
#endif
extern void safe_bcopy ();
- extern void dump_opcode_frequencies ();
atexit (_mcleanup);
/* This uses safe_bcopy because that function comes first in the
Emacs executable. It might be better to use something that
gives the start of the text segment, but start_of_text is not
defined on all systems now. */
+ /* FIXME: Does not work on architectures with function
+ descriptors. */
monstartup (safe_bcopy, &etext);
}
else
@@ -1928,9 +1905,7 @@ const struct standard_args standard_args[] =
than once, eliminate all but one copy of it. */
static void
-sort_args (argc, argv)
- int argc;
- char **argv;
+sort_args (int argc, char **argv)
{
char **new = (char **) xmalloc (sizeof (char *) * argc);
/* For each element of argv,
@@ -1988,7 +1963,7 @@ sort_args (argc, argv)
{
match = -1;
thislen = strlen (argv[from]);
- equals = index (argv[from], '=');
+ equals = strchr (argv[from], '=');
if (equals != 0)
thislen = equals - argv[from];
@@ -2071,7 +2046,7 @@ sort_args (argc, argv)
while (to < argc)
new[to++] = 0;
- bcopy (new, argv, sizeof (char *) * argc);
+ memcpy (argv, new, sizeof (char *) * argc);
xfree (options);
xfree (new);
@@ -2086,8 +2061,7 @@ If ARG is a string, stuff it as keyboard input.
The value of `kill-emacs-hook', if not void,
is a list of functions (of no args),
all of which are called before Emacs is actually killed. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
struct gcpro gcpro1;
@@ -2127,9 +2101,7 @@ all of which are called before Emacs is actually killed. */)
and Fkill_emacs. */
void
-shut_down_emacs (sig, no_x, stuff)
- int sig, no_x;
- Lisp_Object stuff;
+shut_down_emacs (int sig, int no_x, Lisp_Object stuff)
{
/* Prevent running of hooks from now on. */
Vrun_hooks = Qnil;
@@ -2158,9 +2130,7 @@ shut_down_emacs (sig, no_x, stuff)
stuff_buffered_input (stuff);
-#ifdef subprocesses
inhibit_sentinels = 1;
-#endif
kill_buffer_processes (Qnil);
Fdo_auto_save (Qt, Qnil);
@@ -2217,8 +2187,7 @@ Take symbols from SYMFILE (presumably the file you executed to run Emacs).
This is used in the file `loadup.el' when building Emacs.
You must run Emacs in batch mode in order to dump it. */)
- (filename, symfile)
- Lisp_Object filename, symfile;
+ (Lisp_Object filename, Lisp_Object symfile)
{
extern char my_edata[];
Lisp_Object tem;
@@ -2312,7 +2281,7 @@ You must run Emacs in batch mode in order to dump it. */)
#if HAVE_SETLOCALE
/* Recover from setlocale (LC_ALL, ""). */
void
-fixup_locale ()
+fixup_locale (void)
{
/* The Emacs Lisp reader needs LC_NUMERIC to be "C",
so that numbers are read and printed properly for Emacs Lisp. */
@@ -2322,10 +2291,7 @@ fixup_locale ()
/* Set system locale CATEGORY, with previous locale *PLOCALE, to
DESIRED_LOCALE. */
static void
-synchronize_locale (category, plocale, desired_locale)
- int category;
- Lisp_Object *plocale;
- Lisp_Object desired_locale;
+synchronize_locale (int category, Lisp_Object *plocale, Lisp_Object desired_locale)
{
if (! EQ (*plocale, desired_locale))
{
@@ -2338,7 +2304,7 @@ synchronize_locale (category, plocale, desired_locale)
/* Set system time locale to match Vsystem_time_locale, if possible. */
void
-synchronize_system_time_locale ()
+synchronize_system_time_locale (void)
{
synchronize_locale (LC_TIME, &Vprevious_system_time_locale,
Vsystem_time_locale);
@@ -2347,7 +2313,7 @@ synchronize_system_time_locale ()
/* Set system messages locale to match Vsystem_messages_locale, if
possible. */
void
-synchronize_system_messages_locale ()
+synchronize_system_messages_locale (void)
{
#ifdef LC_MESSAGES
synchronize_locale (LC_MESSAGES, &Vprevious_system_messages_locale,
@@ -2361,17 +2327,16 @@ synchronize_system_messages_locale ()
#endif
Lisp_Object
-decode_env_path (evarname, defalt)
- char *evarname, *defalt;
+decode_env_path (const char *evarname, const char *defalt)
{
- register char *path, *p;
+ const char *path, *p;
Lisp_Object lpath, element, tem;
/* It's okay to use getenv here, because this function is only used
to initialize variables when Emacs starts up, and isn't called
after that. */
if (evarname != 0)
- path = (char *) getenv (evarname);
+ path = getenv (evarname);
else
path = 0;
if (!path)
@@ -2380,18 +2345,18 @@ decode_env_path (evarname, defalt)
/* Ensure values from the environment use the proper directory separator. */
if (path)
{
- p = alloca (strlen (path) + 1);
- strcpy (p, path);
- path = p;
-
- dostounix_filename (path);
+ char *path_copy = alloca (strlen (path) + 1);
+ strcpy (path_copy, path);
+ dostounix_filename (path_copy);
+ path = path_copy;
}
#endif
lpath = Qnil;
while (1)
{
- p = index (path, SEPCHAR);
- if (!p) p = path + strlen (path);
+ p = strchr (path, SEPCHAR);
+ if (!p)
+ p = path + strlen (path);
element = (p - path ? make_string (path, p - path)
: build_string ("."));
@@ -2424,7 +2389,7 @@ decode_env_path (evarname, defalt)
DEFUN ("daemonp", Fdaemonp, Sdaemonp, 0, 0, 0,
doc: /* Return non-nil if the current emacs process is a daemon.
If the daemon was given a name argument, return that name. */)
- ()
+ (void)
{
if (IS_DAEMON)
if (daemon_name)
@@ -2439,7 +2404,7 @@ DEFUN ("daemon-initialized", Fdaemon_initialized, Sdaemon_initialized, 0, 0, 0,
doc: /* Mark the Emacs daemon as being initialized.
This finishes the daemonization process by doing the other half of detaching
from the parent process and its tty file descriptors. */)
- ()
+ (void)
{
int nfd;
@@ -2474,7 +2439,7 @@ from the parent process and its tty file descriptors. */)
}
void
-syms_of_emacs ()
+syms_of_emacs (void)
{
Qfile_name_handler_alist = intern_c_string ("file-name-handler-alist");
staticpro (&Qfile_name_handler_alist);
diff --git a/src/eval.c b/src/eval.c
index a6290618753..ec031f391c8 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1,7 +1,7 @@
/* Evaluator for GNU Emacs Lisp interpreter.
Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -179,21 +179,12 @@ Lisp_Object Vmacro_declaration_function;
extern Lisp_Object Qrisky_local_variable;
extern Lisp_Object Qfunction;
-static Lisp_Object funcall_lambda P_ ((Lisp_Object, int, Lisp_Object *,
- Lisp_Object));
-
-static void unwind_to_catch P_ ((struct catchtag *, Lisp_Object)) NO_RETURN;
-
-#if __GNUC__
-/* "gcc -O3" enables automatic function inlining, which optimizes out
- the arguments for the invocations of these functions, whereas they
- expect these values on the stack. */
-Lisp_Object apply1 () __attribute__((noinline));
-Lisp_Object call2 () __attribute__((noinline));
-#endif
+static Lisp_Object funcall_lambda (Lisp_Object, int, Lisp_Object *,
+ Lisp_Object);
+static void unwind_to_catch (struct catchtag *, Lisp_Object) NO_RETURN;
void
-init_eval_once ()
+init_eval_once (void)
{
specpdl_size = 50;
specpdl = (struct specbinding *) xmalloc (specpdl_size * sizeof (struct specbinding));
@@ -206,7 +197,7 @@ init_eval_once ()
}
void
-init_eval ()
+init_eval (void)
{
specpdl_ptr = specpdl;
catchlist = 0;
@@ -225,8 +216,7 @@ init_eval ()
/* unwind-protect function used by call_debugger. */
static Lisp_Object
-restore_stack_limits (data)
- Lisp_Object data;
+restore_stack_limits (Lisp_Object data)
{
max_specpdl_size = XINT (XCAR (data));
max_lisp_eval_depth = XINT (XCDR (data));
@@ -236,8 +226,7 @@ restore_stack_limits (data)
/* Call the Lisp debugger, giving it argument ARG. */
Lisp_Object
-call_debugger (arg)
- Lisp_Object arg;
+call_debugger (Lisp_Object arg)
{
int debug_while_redisplaying;
int count = SPECPDL_INDEX ();
@@ -293,8 +282,7 @@ call_debugger (arg)
}
void
-do_debug_on_call (code)
- Lisp_Object code;
+do_debug_on_call (Lisp_Object code)
{
debug_on_next_call = 0;
backtrace_list->debug_on_exit = 1;
@@ -310,8 +298,7 @@ DEFUN ("or", For, Sor, 0, UNEVALLED, 0,
The remaining args are not evalled at all.
If all args return nil, return nil.
usage: (or CONDITIONS...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object val = Qnil;
struct gcpro gcpro1;
@@ -335,8 +322,7 @@ DEFUN ("and", Fand, Sand, 0, UNEVALLED, 0,
The remaining args are not evalled at all.
If no arg yields nil, return the last arg's value.
usage: (and CONDITIONS...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object val = Qt;
struct gcpro gcpro1;
@@ -361,8 +347,7 @@ Returns the value of THEN or the value of the last of the ELSE's.
THEN must be one expression, but ELSE... can be zero or more expressions.
If COND yields nil, and there are no ELSE's, the value is nil.
usage: (if COND THEN ELSE...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object cond;
struct gcpro gcpro1;
@@ -386,8 +371,7 @@ If no clause succeeds, cond returns nil.
If a clause has one element, as in (CONDITION),
CONDITION's value if non-nil is returned from the cond-form.
usage: (cond CLAUSES...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object clause, val;
struct gcpro gcpro1;
@@ -414,8 +398,7 @@ usage: (cond CLAUSES...) */)
DEFUN ("progn", Fprogn, Sprogn, 0, UNEVALLED, 0,
doc: /* Eval BODY forms sequentially and return value of last one.
usage: (progn BODY...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object val = Qnil;
struct gcpro gcpro1;
@@ -437,8 +420,7 @@ DEFUN ("prog1", Fprog1, Sprog1, 1, UNEVALLED, 0,
The value of FIRST is saved during the evaluation of the remaining args,
whose values are discarded.
usage: (prog1 FIRST BODY...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
Lisp_Object val;
register Lisp_Object args_left;
@@ -455,7 +437,7 @@ usage: (prog1 FIRST BODY...) */)
do
{
if (!(argnum++))
- val = Feval (Fcar (args_left));
+ val = Feval (Fcar (args_left));
else
Feval (Fcar (args_left));
args_left = Fcdr (args_left);
@@ -471,8 +453,7 @@ DEFUN ("prog2", Fprog2, Sprog2, 2, UNEVALLED, 0,
The value of FORM2 is saved during the evaluation of the
remaining args, whose values are discarded.
usage: (prog2 FORM1 FORM2 BODY...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
Lisp_Object val;
register Lisp_Object args_left;
@@ -491,7 +472,7 @@ usage: (prog2 FORM1 FORM2 BODY...) */)
do
{
if (!(argnum++))
- val = Feval (Fcar (args_left));
+ val = Feval (Fcar (args_left));
else
Feval (Fcar (args_left));
args_left = Fcdr (args_left);
@@ -511,8 +492,7 @@ The second VAL is not computed until after the first SYM is set, and so on;
each VAL can use the new value of variables set earlier in the `setq'.
The return value of the `setq' form is the value of the last VAL.
usage: (setq [SYM VAL]...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object args_left;
register Lisp_Object val, sym, lex_binding;
@@ -548,8 +528,7 @@ usage: (setq [SYM VAL]...) */)
DEFUN ("quote", Fquote, Squote, 1, UNEVALLED, 0,
doc: /* Return the argument, without evaluating it. `(quote x)' yields `x'.
usage: (quote ARG) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
if (!NILP (Fcdr (args)))
xsignal2 (Qwrong_number_of_arguments, Qquote, Flength (args));
@@ -561,8 +540,7 @@ DEFUN ("function", Ffunction, Sfunction, 1, UNEVALLED, 0,
In byte compilation, `function' causes its argument to be compiled.
`quote' cannot do that.
usage: (function ARG) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
Lisp_Object quoted = XCAR (args);
@@ -598,7 +576,7 @@ To test whether your function was called with `call-interactively',
either (i) add an extra optional argument and give it an `interactive'
spec that specifies non-nil unconditionally (such as \"p\"); or (ii)
use `called-interactively-p'. */)
- ()
+ (void)
{
return interactive_p (1) ? Qt : Qnil;
}
@@ -624,8 +602,7 @@ function-modifying features. Instead of using this, it is sometimes
cleaner to give your function an extra optional argument whose
`interactive' spec specifies non-nil unconditionally (\"p\" is a good
way to do this), or via (not (or executing-kbd-macro noninteractive)). */)
- (kind)
- Lisp_Object kind;
+ (Lisp_Object kind)
{
return ((INTERACTIVE || !EQ (kind, intern ("interactive")))
&& interactive_p (1)) ? Qt : Qnil;
@@ -639,8 +616,7 @@ way to do this), or via (not (or executing-kbd-macro noninteractive)). */)
called is a built-in. */
int
-interactive_p (exclude_subrs_p)
- int exclude_subrs_p;
+interactive_p (int exclude_subrs_p)
{
struct backtrace *btp;
Lisp_Object fun;
@@ -687,8 +663,7 @@ DEFUN ("defun", Fdefun, Sdefun, 2, UNEVALLED, 0,
The definition is (lambda ARGLIST [DOCSTRING] BODY...).
See also the function `interactive'.
usage: (defun NAME ARGLIST [DOCSTRING] BODY...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object fn_name;
register Lisp_Object defn;
@@ -733,8 +708,7 @@ The elements can look like this:
Set NAME's `doc-string-elt' property to ELT.
usage: (defmacro NAME ARGLIST [DOCSTRING] [DECL] BODY...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object fn_name;
register Lisp_Object defn;
@@ -796,8 +770,7 @@ or of the variable at the end of the chain of aliases, if BASE-VARIABLE is
itself an alias. If NEW-ALIAS is bound, and BASE-VARIABLE is not,
then the value of BASE-VARIABLE is set to that of NEW-ALIAS.
The return value is BASE-VARIABLE. */)
- (new_alias, base_variable, docstring)
- Lisp_Object new_alias, base_variable, docstring;
+ (Lisp_Object new_alias, Lisp_Object base_variable, Lisp_Object docstring)
{
struct Lisp_Symbol *sym;
@@ -869,8 +842,7 @@ load a file defining variables, with this form or with `defconst' or
for these variables. \(`defconst' and `defcustom' behave similarly in
this respect.)
usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object sym, tem, tail;
@@ -945,8 +917,7 @@ If SYMBOL has a local binding, then this form sets the local binding's
value. However, you should normally not make local bindings for
variables defined with this form.
usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object sym, tem;
@@ -973,8 +944,7 @@ usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */)
/* Error handler used in Fuser_variable_p. */
static Lisp_Object
-user_variable_p_eh (ignore)
- Lisp_Object ignore;
+user_variable_p_eh (Lisp_Object ignore)
{
return Qnil;
}
@@ -996,8 +966,7 @@ A variable is a user variable if
\(3) it is an alias for another user variable.
Return nil if VARIABLE is an alias and there is a loop in the
chain of symbols. */)
- (variable)
- Lisp_Object variable;
+ (Lisp_Object variable)
{
Lisp_Object documentation;
@@ -1007,30 +976,30 @@ chain of symbols. */)
/* If indirect and there's an alias loop, don't check anything else. */
if (XSYMBOL (variable)->redirect == SYMBOL_VARALIAS
&& NILP (internal_condition_case_1 (lisp_indirect_variable, variable,
- Qt, user_variable_p_eh)))
+ Qt, user_variable_p_eh)))
return Qnil;
while (1)
{
documentation = Fget (variable, Qvariable_documentation);
if (INTEGERP (documentation) && XINT (documentation) < 0)
- return Qt;
+ return Qt;
if (STRINGP (documentation)
- && ((unsigned char) SREF (documentation, 0) == '*'))
- return Qt;
+ && ((unsigned char) SREF (documentation, 0) == '*'))
+ return Qt;
/* If it is (STRING . INTEGER), a negative integer means a user variable. */
if (CONSP (documentation)
- && STRINGP (XCAR (documentation))
- && INTEGERP (XCDR (documentation))
- && XINT (XCDR (documentation)) < 0)
- return Qt;
+ && STRINGP (XCAR (documentation))
+ && INTEGERP (XCDR (documentation))
+ && XINT (XCDR (documentation)) < 0)
+ return Qt;
/* Customizable? See `custom-variable-p'. */
if ((!NILP (Fget (variable, intern ("standard-value"))))
- || (!NILP (Fget (variable, intern ("custom-autoload")))))
- return Qt;
+ || (!NILP (Fget (variable, intern ("custom-autoload")))))
+ return Qt;
if (!(XSYMBOL (variable)->redirect == SYMBOL_VARALIAS))
- return Qnil;
+ return Qnil;
/* An indirect variable? Let's follow the chain. */
XSETSYMBOL (variable, SYMBOL_ALIAS (XSYMBOL (variable)));
@@ -1044,8 +1013,7 @@ Each element of VARLIST is a symbol (which is bound to nil)
or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM).
Each VALUEFORM can refer to the symbols already bound by this VARLIST.
usage: (let* VARLIST BODY...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
Lisp_Object varlist, var, val, elt, lexenv;
int count = SPECPDL_INDEX ();
@@ -1101,8 +1069,7 @@ Each element of VARLIST is a symbol (which is bound to nil)
or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM).
All the VALUEFORMs are evalled before any symbols are bound.
usage: (let VARLIST BODY...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
Lisp_Object *temps, tem, lexenv;
register Lisp_Object elt, varlist;
@@ -1168,8 +1135,7 @@ DEFUN ("while", Fwhile, Swhile, 1, UNEVALLED, 0,
The order of execution is thus TEST, BODY, TEST, BODY and so on
until TEST returns nil.
usage: (while TEST BODY...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
Lisp_Object test, body;
struct gcpro gcpro1, gcpro2;
@@ -1196,9 +1162,7 @@ in place of FORM. When a non-macro-call results, it is returned.
The second optional arg ENVIRONMENT specifies an environment of macro
definitions to shadow the loaded ones for use in file byte-compilation. */)
- (form, environment)
- Lisp_Object form;
- Lisp_Object environment;
+ (Lisp_Object form, Lisp_Object environment)
{
/* With cleanups from Hallvard Furuseth. */
register Lisp_Object expander, sym, def, tem;
@@ -1276,8 +1240,7 @@ Within BODY, a call to `throw' with the same TAG exits BODY and this `catch'.
If no throw happens, `catch' returns the value of the last BODY form.
If a throw happens, it specifies the value to return from `catch'.
usage: (catch TAG BODY...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object tag;
struct gcpro gcpro1;
@@ -1293,10 +1256,7 @@ usage: (catch TAG BODY...) */)
This is how catches are done from within C code. */
Lisp_Object
-internal_catch (tag, func, arg)
- Lisp_Object tag;
- Lisp_Object (*func) ();
- Lisp_Object arg;
+internal_catch (Lisp_Object tag, Lisp_Object (*func) (Lisp_Object), Lisp_Object arg)
{
/* This structure is made part of the chain `catchlist'. */
struct catchtag c;
@@ -1341,9 +1301,7 @@ internal_catch (tag, func, arg)
This is used for correct unwinding in Fthrow and Fsignal. */
static void
-unwind_to_catch (catch, value)
- struct catchtag *catch;
- Lisp_Object value;
+unwind_to_catch (struct catchtag *catch, Lisp_Object value)
{
register int last_time;
@@ -1361,7 +1319,7 @@ unwind_to_catch (catch, value)
last_time = catchlist == catch;
/* Unwind the specpdl stack, and then restore the proper set of
- handlers. */
+ handlers. */
unbind_to (catchlist->pdlcount, Qnil);
handlerlist = catchlist->handlerlist;
catchlist = catchlist->next;
@@ -1372,8 +1330,8 @@ unwind_to_catch (catch, value)
/* If x_catch_errors was done, turn it off now.
(First we give unbind_to a chance to do that.) */
#if 0 /* This would disable x_catch_errors after x_connection_closed.
- * The catch must remain in effect during that delicate
- * state. --lorentey */
+ The catch must remain in effect during that delicate
+ state. --lorentey */
x_fully_uncatch_errors ();
#endif
#endif
@@ -1395,8 +1353,7 @@ unwind_to_catch (catch, value)
DEFUN ("throw", Fthrow, Sthrow, 2, 2, 0,
doc: /* Throw to the catch for TAG and return VALUE from it.
Both TAG and VALUE are evalled. */)
- (tag, value)
- register Lisp_Object tag, value;
+ (register Lisp_Object tag, Lisp_Object value)
{
register struct catchtag *c;
@@ -1416,8 +1373,7 @@ If BODYFORM completes normally, its value is returned
after executing the UNWINDFORMS.
If BODYFORM exits nonlocally, the UNWINDFORMS are executed anyway.
usage: (unwind-protect BODYFORM UNWINDFORMS...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
Lisp_Object val;
int count = SPECPDL_INDEX ();
@@ -1451,14 +1407,13 @@ instead of a single condition name. Then it handles all of them.
When a handler handles an error, control returns to the `condition-case'
and it executes the handler's BODY...
with VAR bound to (ERROR-SYMBOL . SIGNAL-DATA) from the error.
-(If VAR is nil, the handler can't access that information.)
+\(If VAR is nil, the handler can't access that information.)
Then the value of the last BODY form is returned from the `condition-case'
expression.
See also the function `signal' for more info.
usage: (condition-case VAR BODYFORM &rest HANDLERS) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object bodyform, handlers;
volatile Lisp_Object var;
@@ -1474,9 +1429,8 @@ usage: (condition-case VAR BODYFORM &rest HANDLERS) */)
rather than passed in a list. Used by Fbyte_code. */
Lisp_Object
-internal_lisp_condition_case (var, bodyform, handlers)
- volatile Lisp_Object var;
- Lisp_Object bodyform, handlers;
+internal_lisp_condition_case (volatile Lisp_Object var, Lisp_Object bodyform,
+ Lisp_Object handlers)
{
Lisp_Object val;
struct catchtag c;
@@ -1508,7 +1462,7 @@ internal_lisp_condition_case (var, bodyform, handlers)
if (_setjmp (c.jmp))
{
if (!NILP (h.var))
- specbind (h.var, c.val);
+ specbind (h.var, c.val);
val = Fprogn (Fcdr (h.chosen_clause));
/* Note that this just undoes the binding of h.var; whoever
@@ -1543,10 +1497,8 @@ internal_lisp_condition_case (var, bodyform, handlers)
but allow the debugger to run if that is enabled. */
Lisp_Object
-internal_condition_case (bfun, handlers, hfun)
- Lisp_Object (*bfun) ();
- Lisp_Object handlers;
- Lisp_Object (*hfun) ();
+internal_condition_case (Lisp_Object (*bfun) (void), Lisp_Object handlers,
+ Lisp_Object (*hfun) (Lisp_Object))
{
Lisp_Object val;
struct catchtag c;
@@ -1590,11 +1542,8 @@ internal_condition_case (bfun, handlers, hfun)
/* Like internal_condition_case but call BFUN with ARG as its argument. */
Lisp_Object
-internal_condition_case_1 (bfun, arg, handlers, hfun)
- Lisp_Object (*bfun) ();
- Lisp_Object arg;
- Lisp_Object handlers;
- Lisp_Object (*hfun) ();
+internal_condition_case_1 (Lisp_Object (*bfun) (Lisp_Object), Lisp_Object arg,
+ Lisp_Object handlers, Lisp_Object (*hfun) (Lisp_Object))
{
Lisp_Object val;
struct catchtag c;
@@ -1734,8 +1683,8 @@ internal_condition_case_n (Lisp_Object (*bfun) (int, Lisp_Object*),
}
-static Lisp_Object find_handler_clause P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object));
+static Lisp_Object find_handler_clause (Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object);
DEFUN ("signal", Fsignal, Ssignal, 2, 2, 0,
doc: /* Signal an error. Args are ERROR-SYMBOL and associated DATA.
@@ -1751,8 +1700,7 @@ See Info anchor `(elisp)Definition of signal' for some details on how this
error message is constructed.
If the signal is handled, DATA is made available to the handler.
See also the function `condition-case'. */)
- (error_symbol, data)
- Lisp_Object error_symbol, data;
+ (Lisp_Object error_symbol, Lisp_Object data)
{
/* When memory is full, ERROR-SYMBOL is nil,
and DATA is (REAL-ERROR-SYMBOL . REAL-DATA).
@@ -1864,8 +1812,7 @@ See also the function `condition-case'. */)
Used for anything but Qquit (which can return from Fsignal). */
void
-xsignal (error_symbol, data)
- Lisp_Object error_symbol, data;
+xsignal (Lisp_Object error_symbol, Lisp_Object data)
{
Fsignal (error_symbol, data);
abort ();
@@ -1874,29 +1821,25 @@ xsignal (error_symbol, data)
/* Like xsignal, but takes 0, 1, 2, or 3 args instead of a list. */
void
-xsignal0 (error_symbol)
- Lisp_Object error_symbol;
+xsignal0 (Lisp_Object error_symbol)
{
xsignal (error_symbol, Qnil);
}
void
-xsignal1 (error_symbol, arg)
- Lisp_Object error_symbol, arg;
+xsignal1 (Lisp_Object error_symbol, Lisp_Object arg)
{
xsignal (error_symbol, list1 (arg));
}
void
-xsignal2 (error_symbol, arg1, arg2)
- Lisp_Object error_symbol, arg1, arg2;
+xsignal2 (Lisp_Object error_symbol, Lisp_Object arg1, Lisp_Object arg2)
{
xsignal (error_symbol, list2 (arg1, arg2));
}
void
-xsignal3 (error_symbol, arg1, arg2, arg3)
- Lisp_Object error_symbol, arg1, arg2, arg3;
+xsignal3 (Lisp_Object error_symbol, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3)
{
xsignal (error_symbol, list3 (arg1, arg2, arg3));
}
@@ -1905,9 +1848,7 @@ xsignal3 (error_symbol, arg1, arg2, arg3)
If ARG is not a genuine list, make it a one-element list. */
void
-signal_error (s, arg)
- char *s;
- Lisp_Object arg;
+signal_error (const char *s, Lisp_Object arg)
{
Lisp_Object tortoise, hare;
@@ -1936,8 +1877,7 @@ signal_error (s, arg)
a list containing one of CONDITIONS. */
static int
-wants_debugger (list, conditions)
- Lisp_Object list, conditions;
+wants_debugger (Lisp_Object list, Lisp_Object conditions)
{
if (NILP (list))
return 0;
@@ -1961,8 +1901,7 @@ wants_debugger (list, conditions)
according to debugger-ignored-errors. */
static int
-skip_debugger (conditions, data)
- Lisp_Object conditions, data;
+skip_debugger (Lisp_Object conditions, Lisp_Object data)
{
Lisp_Object tail;
int first_string = 1;
@@ -1999,8 +1938,7 @@ skip_debugger (conditions, data)
SIG and DATA describe the signal, as in find_handler_clause. */
static int
-maybe_call_debugger (conditions, sig, data)
- Lisp_Object conditions, sig, data;
+maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data)
{
Lisp_Object combined_data;
@@ -2036,8 +1974,8 @@ maybe_call_debugger (conditions, sig, data)
a second error here in case we're handling specpdl overflow. */
static Lisp_Object
-find_handler_clause (handlers, conditions, sig, data)
- Lisp_Object handlers, conditions, sig, data;
+find_handler_clause (Lisp_Object handlers, Lisp_Object conditions,
+ Lisp_Object sig, Lisp_Object data)
{
register Lisp_Object h;
register Lisp_Object tem;
@@ -2126,13 +2064,10 @@ find_handler_clause (handlers, conditions, sig, data)
return Qnil;
}
-/* dump an error message; called like printf */
-/* VARARGS 1 */
+/* dump an error message; called like vprintf */
void
-error (m, a1, a2, a3)
- char *m;
- char *a1, *a2, *a3;
+verror (const char *m, va_list ap)
{
char buf[200];
int size = 200;
@@ -2142,15 +2077,12 @@ error (m, a1, a2, a3)
int allocated = 0;
Lisp_Object string;
- args[0] = a1;
- args[1] = a2;
- args[2] = a3;
-
mlen = strlen (m);
while (1)
{
- int used = doprnt (buffer, size, m, m + mlen, 3, args);
+ int used;
+ used = doprnt (buffer, size, m, m + mlen, ap);
if (used < size)
break;
size *= 2;
@@ -2169,6 +2101,19 @@ error (m, a1, a2, a3)
xsignal1 (Qerror, string);
}
+
+
+/* dump an error message; called like printf */
+
+/* VARARGS 1 */
+void
+error (const char *m, ...)
+{
+ va_list ap;
+ va_start (ap, m);
+ verror (m, ap);
+ va_end (ap);
+}
DEFUN ("commandp", Fcommandp, Scommandp, 1, 2, 0,
doc: /* Non-nil if FUNCTION makes provisions for interactive calling.
@@ -2185,8 +2130,7 @@ Also, a symbol satisfies `commandp' if its function definition does so.
If the optional argument FOR-CALL-INTERACTIVELY is non-nil,
then strings and vectors are not accepted. */)
- (function, for_call_interactively)
- Lisp_Object function, for_call_interactively;
+ (Lisp_Object function, Lisp_Object for_call_interactively)
{
register Lisp_Object fun;
register Lisp_Object funcar;
@@ -2250,8 +2194,7 @@ Third through fifth args give info about the real definition.
They default to nil.
If FUNCTION is already defined other than as an autoload,
this does nothing and returns nil. */)
- (function, file, docstring, interactive, type)
- Lisp_Object function, file, docstring, interactive, type;
+ (Lisp_Object function, Lisp_Object file, Lisp_Object docstring, Lisp_Object interactive, Lisp_Object type)
{
CHECK_SYMBOL (function);
CHECK_STRING (file);
@@ -2279,8 +2222,7 @@ this does nothing and returns nil. */)
}
Lisp_Object
-un_autoload (oldqueue)
- Lisp_Object oldqueue;
+un_autoload (Lisp_Object oldqueue)
{
register Lisp_Object queue, first, second;
@@ -2307,8 +2249,7 @@ un_autoload (oldqueue)
FUNDEF is the autoload definition (a list). */
void
-do_autoload (fundef, funname)
- Lisp_Object fundef, funname;
+do_autoload (Lisp_Object fundef, Lisp_Object funname)
{
int count = SPECPDL_INDEX ();
Lisp_Object fun;
@@ -2333,7 +2274,7 @@ do_autoload (fundef, funname)
the function. We do this in the specific case of autoloading
because autoloading is not an explicit request "load this file",
but rather a request to "call this function".
-
+
The value saved here is to be restored into Vautoload_queue. */
record_unwind_protect (un_autoload, Vautoload_queue);
Vautoload_queue = Qt;
@@ -2354,8 +2295,7 @@ do_autoload (fundef, funname)
DEFUN ("eval", Feval, Seval, 1, 1, 0,
doc: /* Evaluate FORM and return its value. */)
- (form)
- Lisp_Object form;
+ (Lisp_Object form)
{
Lisp_Object fun, val, original_fun, original_args;
Lisp_Object funcar;
@@ -2453,7 +2393,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0,
if (XSUBR (fun)->max_args == UNEVALLED)
{
backtrace.evalargs = 0;
- val = (*XSUBR (fun)->function) (args_left);
+ val = (XSUBR (fun)->function.aUNEVALLED) (args_left);
goto done;
}
@@ -2479,7 +2419,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0,
backtrace.args = vals;
backtrace.nargs = XINT (numargs);
- val = (*XSUBR (fun)->function) (XINT (numargs), vals);
+ val = (XSUBR (fun)->function.aMANY) (XINT (numargs), vals);
UNGCPRO;
goto done;
}
@@ -2503,40 +2443,40 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0,
switch (i)
{
case 0:
- val = (*XSUBR (fun)->function) ();
+ val = (XSUBR (fun)->function.a0) ();
goto done;
case 1:
- val = (*XSUBR (fun)->function) (argvals[0]);
+ val = (XSUBR (fun)->function.a1) (argvals[0]);
goto done;
case 2:
- val = (*XSUBR (fun)->function) (argvals[0], argvals[1]);
+ val = (XSUBR (fun)->function.a2) (argvals[0], argvals[1]);
goto done;
case 3:
- val = (*XSUBR (fun)->function) (argvals[0], argvals[1],
- argvals[2]);
+ val = (XSUBR (fun)->function.a3) (argvals[0], argvals[1],
+ argvals[2]);
goto done;
case 4:
- val = (*XSUBR (fun)->function) (argvals[0], argvals[1],
- argvals[2], argvals[3]);
+ val = (XSUBR (fun)->function.a4) (argvals[0], argvals[1],
+ argvals[2], argvals[3]);
goto done;
case 5:
- val = (*XSUBR (fun)->function) (argvals[0], argvals[1], argvals[2],
- argvals[3], argvals[4]);
+ val = (XSUBR (fun)->function.a5) (argvals[0], argvals[1], argvals[2],
+ argvals[3], argvals[4]);
goto done;
case 6:
- val = (*XSUBR (fun)->function) (argvals[0], argvals[1], argvals[2],
- argvals[3], argvals[4], argvals[5]);
+ val = (XSUBR (fun)->function.a6) (argvals[0], argvals[1], argvals[2],
+ argvals[3], argvals[4], argvals[5]);
goto done;
case 7:
- val = (*XSUBR (fun)->function) (argvals[0], argvals[1], argvals[2],
- argvals[3], argvals[4], argvals[5],
- argvals[6]);
+ val = (XSUBR (fun)->function.a7) (argvals[0], argvals[1], argvals[2],
+ argvals[3], argvals[4], argvals[5],
+ argvals[6]);
goto done;
case 8:
- val = (*XSUBR (fun)->function) (argvals[0], argvals[1], argvals[2],
- argvals[3], argvals[4], argvals[5],
- argvals[6], argvals[7]);
+ val = (XSUBR (fun)->function.a8) (argvals[0], argvals[1], argvals[2],
+ argvals[3], argvals[4], argvals[5],
+ argvals[6], argvals[7]);
goto done;
default:
@@ -2597,9 +2537,7 @@ DEFUN ("apply", Fapply, Sapply, 2, MANY, 0,
Then return the value FUNCTION returns.
Thus, (apply '+ 1 2 '(3 4)) returns 10.
usage: (apply FUNCTION &rest ARGUMENTS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
register int i, numargs;
register Lisp_Object spread_arg;
@@ -2663,7 +2601,7 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
gcpro1.nvars = 1 + numargs;
}
- bcopy (args, funcall_args, nargs * sizeof (Lisp_Object));
+ memcpy (funcall_args, args, nargs * sizeof (Lisp_Object));
/* Spread the last arg we got. Its first element goes in
the slot that it used to occupy, hence this value of I. */
i = nargs - 1;
@@ -2680,8 +2618,8 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
/* Run hook variables in various ways. */
enum run_hooks_condition {to_completion, until_success, until_failure};
-static Lisp_Object run_hook_with_args P_ ((int, Lisp_Object *,
- enum run_hooks_condition));
+static Lisp_Object run_hook_with_args (int, Lisp_Object *,
+ enum run_hooks_condition);
DEFUN ("run-hooks", Frun_hooks, Srun_hooks, 0, MANY, 0,
doc: /* Run each hook in HOOKS.
@@ -2698,9 +2636,7 @@ hook; they should use `run-mode-hooks' instead.
Do not use `make-local-variable' to make a hook variable buffer-local.
Instead, use `add-hook' and specify t for the LOCAL argument.
usage: (run-hooks &rest HOOKS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
Lisp_Object hook[1];
register int i;
@@ -2729,9 +2665,7 @@ as that may change.
Do not use `make-local-variable' to make a hook variable buffer-local.
Instead, use `add-hook' and specify t for the LOCAL argument.
usage: (run-hook-with-args HOOK &rest ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
return run_hook_with_args (nargs, args, to_completion);
}
@@ -2751,9 +2685,7 @@ However, if they all return nil, we return nil.
Do not use `make-local-variable' to make a hook variable buffer-local.
Instead, use `add-hook' and specify t for the LOCAL argument.
usage: (run-hook-with-args-until-success HOOK &rest ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
return run_hook_with_args (nargs, args, until_success);
}
@@ -2772,9 +2704,7 @@ Then we return nil. However, if they all return non-nil, we return non-nil.
Do not use `make-local-variable' to make a hook variable buffer-local.
Instead, use `add-hook' and specify t for the LOCAL argument.
usage: (run-hook-with-args-until-failure HOOK &rest ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
return run_hook_with_args (nargs, args, until_failure);
}
@@ -2788,10 +2718,7 @@ usage: (run-hook-with-args-until-failure HOOK &rest ARGS) */)
except that it isn't necessary to gcpro ARGS[0]. */
static Lisp_Object
-run_hook_with_args (nargs, args, cond)
- int nargs;
- Lisp_Object *args;
- enum run_hooks_condition cond;
+run_hook_with_args (int nargs, Lisp_Object *args, enum run_hooks_condition cond)
{
Lisp_Object sym, val, ret;
struct gcpro gcpro1, gcpro2, gcpro3;
@@ -2871,10 +2798,7 @@ run_hook_with_args (nargs, args, cond)
except that it isn't necessary to gcpro ARGS[0]. */
Lisp_Object
-run_hook_list_with_args (funlist, nargs, args)
- Lisp_Object funlist;
- int nargs;
- Lisp_Object *args;
+run_hook_list_with_args (Lisp_Object funlist, int nargs, Lisp_Object *args)
{
Lisp_Object sym;
Lisp_Object val;
@@ -2916,8 +2840,7 @@ run_hook_list_with_args (funlist, nargs, args)
/* Run the hook HOOK, giving each function the two args ARG1 and ARG2. */
void
-run_hook_with_args_2 (hook, arg1, arg2)
- Lisp_Object hook, arg1, arg2;
+run_hook_with_args_2 (Lisp_Object hook, Lisp_Object arg1, Lisp_Object arg2)
{
Lisp_Object temp[3];
temp[0] = hook;
@@ -2929,8 +2852,7 @@ run_hook_with_args_2 (hook, arg1, arg2)
/* Apply fn to arg */
Lisp_Object
-apply1 (fn, arg)
- Lisp_Object fn, arg;
+apply1 (Lisp_Object fn, Lisp_Object arg)
{
struct gcpro gcpro1;
@@ -2949,8 +2871,7 @@ apply1 (fn, arg)
/* Call function fn on no arguments */
Lisp_Object
-call0 (fn)
- Lisp_Object fn;
+call0 (Lisp_Object fn)
{
struct gcpro gcpro1;
@@ -2961,8 +2882,7 @@ call0 (fn)
/* Call function fn with 1 argument arg1 */
/* ARGSUSED */
Lisp_Object
-call1 (fn, arg1)
- Lisp_Object fn, arg1;
+call1 (Lisp_Object fn, Lisp_Object arg1)
{
struct gcpro gcpro1;
Lisp_Object args[2];
@@ -2977,8 +2897,7 @@ call1 (fn, arg1)
/* Call function fn with 2 arguments arg1, arg2 */
/* ARGSUSED */
Lisp_Object
-call2 (fn, arg1, arg2)
- Lisp_Object fn, arg1, arg2;
+call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2)
{
struct gcpro gcpro1;
Lisp_Object args[3];
@@ -2993,8 +2912,7 @@ call2 (fn, arg1, arg2)
/* Call function fn with 3 arguments arg1, arg2, arg3 */
/* ARGSUSED */
Lisp_Object
-call3 (fn, arg1, arg2, arg3)
- Lisp_Object fn, arg1, arg2, arg3;
+call3 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3)
{
struct gcpro gcpro1;
Lisp_Object args[4];
@@ -3010,8 +2928,8 @@ call3 (fn, arg1, arg2, arg3)
/* Call function fn with 4 arguments arg1, arg2, arg3, arg4 */
/* ARGSUSED */
Lisp_Object
-call4 (fn, arg1, arg2, arg3, arg4)
- Lisp_Object fn, arg1, arg2, arg3, arg4;
+call4 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3,
+ Lisp_Object arg4)
{
struct gcpro gcpro1;
Lisp_Object args[5];
@@ -3028,8 +2946,8 @@ call4 (fn, arg1, arg2, arg3, arg4)
/* Call function fn with 5 arguments arg1, arg2, arg3, arg4, arg5 */
/* ARGSUSED */
Lisp_Object
-call5 (fn, arg1, arg2, arg3, arg4, arg5)
- Lisp_Object fn, arg1, arg2, arg3, arg4, arg5;
+call5 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3,
+ Lisp_Object arg4, Lisp_Object arg5)
{
struct gcpro gcpro1;
Lisp_Object args[6];
@@ -3047,8 +2965,8 @@ call5 (fn, arg1, arg2, arg3, arg4, arg5)
/* Call function fn with 6 arguments arg1, arg2, arg3, arg4, arg5, arg6 */
/* ARGSUSED */
Lisp_Object
-call6 (fn, arg1, arg2, arg3, arg4, arg5, arg6)
- Lisp_Object fn, arg1, arg2, arg3, arg4, arg5, arg6;
+call6 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3,
+ Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6)
{
struct gcpro gcpro1;
Lisp_Object args[7];
@@ -3067,8 +2985,8 @@ call6 (fn, arg1, arg2, arg3, arg4, arg5, arg6)
/* Call function fn with 7 arguments arg1, arg2, arg3, arg4, arg5, arg6, arg7 */
/* ARGSUSED */
Lisp_Object
-call7 (fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
- Lisp_Object fn, arg1, arg2, arg3, arg4, arg5, arg6, arg7;
+call7 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3,
+ Lisp_Object arg4, Lisp_Object arg5, Lisp_Object arg6, Lisp_Object arg7)
{
struct gcpro gcpro1;
Lisp_Object args[8];
@@ -3126,9 +3044,7 @@ DEFUN ("funcall", Ffuncall, Sfuncall, 1, MANY, 0,
Return the value that function returns.
Thus, (funcall 'cons 'x 'y) returns (x . y).
usage: (funcall FUNCTION &rest ARGUMENTS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
Lisp_Object fun, original_fun;
Lisp_Object funcar;
@@ -3191,14 +3107,14 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
if (XSUBR (fun)->max_args == MANY)
{
- val = (*XSUBR (fun)->function) (numargs, args + 1);
+ val = (XSUBR (fun)->function.aMANY) (numargs, args + 1);
goto done;
}
if (XSUBR (fun)->max_args > numargs)
{
internal_args = (Lisp_Object *) alloca (XSUBR (fun)->max_args * sizeof (Lisp_Object));
- bcopy (args + 1, internal_args, numargs * sizeof (Lisp_Object));
+ memcpy (internal_args, args + 1, numargs * sizeof (Lisp_Object));
for (i = numargs; i < XSUBR (fun)->max_args; i++)
internal_args[i] = Qnil;
}
@@ -3207,44 +3123,44 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
switch (XSUBR (fun)->max_args)
{
case 0:
- val = (*XSUBR (fun)->function) ();
+ val = (XSUBR (fun)->function.a0) ();
goto done;
case 1:
- val = (*XSUBR (fun)->function) (internal_args[0]);
+ val = (XSUBR (fun)->function.a1) (internal_args[0]);
goto done;
case 2:
- val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1]);
+ val = (XSUBR (fun)->function.a2) (internal_args[0], internal_args[1]);
goto done;
case 3:
- val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1],
- internal_args[2]);
+ val = (XSUBR (fun)->function.a3) (internal_args[0], internal_args[1],
+ internal_args[2]);
goto done;
case 4:
- val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1],
- internal_args[2], internal_args[3]);
+ val = (XSUBR (fun)->function.a4) (internal_args[0], internal_args[1],
+ internal_args[2], internal_args[3]);
goto done;
case 5:
- val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1],
- internal_args[2], internal_args[3],
- internal_args[4]);
+ val = (XSUBR (fun)->function.a5) (internal_args[0], internal_args[1],
+ internal_args[2], internal_args[3],
+ internal_args[4]);
goto done;
case 6:
- val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1],
- internal_args[2], internal_args[3],
- internal_args[4], internal_args[5]);
+ val = (XSUBR (fun)->function.a6) (internal_args[0], internal_args[1],
+ internal_args[2], internal_args[3],
+ internal_args[4], internal_args[5]);
goto done;
case 7:
- val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1],
- internal_args[2], internal_args[3],
- internal_args[4], internal_args[5],
- internal_args[6]);
+ val = (XSUBR (fun)->function.a7) (internal_args[0], internal_args[1],
+ internal_args[2], internal_args[3],
+ internal_args[4], internal_args[5],
+ internal_args[6]);
goto done;
case 8:
- val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1],
- internal_args[2], internal_args[3],
- internal_args[4], internal_args[5],
- internal_args[6], internal_args[7]);
+ val = (XSUBR (fun)->function.a8) (internal_args[0], internal_args[1],
+ internal_args[2], internal_args[3],
+ internal_args[4], internal_args[5],
+ internal_args[6], internal_args[7]);
goto done;
default:
@@ -3294,10 +3210,8 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
}
Lisp_Object
-apply_lambda (fun, args, eval_flag, lexenv)
- Lisp_Object fun, args;
- int eval_flag;
- Lisp_Object lexenv;
+apply_lambda (Lisp_Object fun, Lisp_Object args, int eval_flag,
+ Lisp_Object lexenv)
{
Lisp_Object args_left;
Lisp_Object numargs;
@@ -3395,11 +3309,9 @@ funcall_funvec (fun, nargs, args)
FUN must be either a lambda-expression or a compiled-code object. */
static Lisp_Object
-funcall_lambda (fun, nargs, arg_vector, lexenv)
- Lisp_Object fun;
- int nargs;
- register Lisp_Object *arg_vector;
- Lisp_Object lexenv;
+funcall_lambda (Lisp_Object fun, int nargs,
+ register Lisp_Object *arg_vector,
+ Lisp_Object lexenv)
{
Lisp_Object val, syms_left, next;
int count = SPECPDL_INDEX ();
@@ -3516,8 +3428,7 @@ funcall_lambda (fun, nargs, arg_vector, lexenv)
DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode,
1, 1, 0,
doc: /* If byte-compiled OBJECT is lazy-loaded, fetch it now. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
Lisp_Object tem;
@@ -3539,7 +3450,7 @@ DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode,
}
void
-grow_specpdl ()
+grow_specpdl (void)
{
register int count = SPECPDL_INDEX ();
if (specpdl_size >= max_specpdl_size)
@@ -3572,8 +3483,7 @@ grow_specpdl ()
BUFFER did not yet have a buffer-local value). */
void
-specbind (symbol, value)
- Lisp_Object symbol, value;
+specbind (Lisp_Object symbol, Lisp_Object value)
{
struct Lisp_Symbol *sym;
@@ -3590,18 +3500,17 @@ specbind (symbol, value)
case SYMBOL_VARALIAS:
sym = indirect_variable (sym); XSETSYMBOL (symbol, sym); goto start;
case SYMBOL_PLAINVAL:
- { /* The most common case is that of a non-constant symbol with a
- trivial value. Make that as fast as we can. */
- specpdl_ptr->symbol = symbol;
- specpdl_ptr->old_value = SYMBOL_VAL (sym);
- specpdl_ptr->func = NULL;
- ++specpdl_ptr;
- if (!sym->constant)
- SET_SYMBOL_VAL (sym, value);
- else
- set_internal (symbol, value, Qnil, 1);
- break;
- }
+ /* The most common case is that of a non-constant symbol with a
+ trivial value. Make that as fast as we can. */
+ specpdl_ptr->symbol = symbol;
+ specpdl_ptr->old_value = SYMBOL_VAL (sym);
+ specpdl_ptr->func = NULL;
+ ++specpdl_ptr;
+ if (!sym->constant)
+ SET_SYMBOL_VAL (sym, value);
+ else
+ set_internal (symbol, value, Qnil, 1);
+ break;
case SYMBOL_LOCALIZED:
if (SYMBOL_BLV (sym)->frame_local)
error ("Frame-local vars cannot be let-bound");
@@ -3671,9 +3580,7 @@ specbind (symbol, value)
}
void
-record_unwind_protect (function, arg)
- Lisp_Object (*function) P_ ((Lisp_Object));
- Lisp_Object arg;
+record_unwind_protect (Lisp_Object (*function) (Lisp_Object), Lisp_Object arg)
{
eassert (!handling_signal);
@@ -3686,9 +3593,7 @@ record_unwind_protect (function, arg)
}
Lisp_Object
-unbind_to (count, value)
- int count;
- Lisp_Object value;
+unbind_to (int count, Lisp_Object value)
{
Lisp_Object quitf = Vquit_flag;
struct gcpro gcpro1, gcpro2;
@@ -3715,7 +3620,7 @@ unbind_to (count, value)
bound a variable that had a buffer-local or frame-local
binding. WHERE nil means that the variable had the default
value when it was bound. CURRENT-BUFFER is the buffer that
- was current when the variable was bound. */
+ was current when the variable was bound. */
else if (CONSP (this_binding.symbol))
{
Lisp_Object symbol, where;
@@ -3789,8 +3694,7 @@ usage: (curry FUN &rest ARGS) */)
DEFUN ("backtrace-debug", Fbacktrace_debug, Sbacktrace_debug, 2, 2, 0,
doc: /* Set the debug-on-exit flag of eval frame LEVEL levels down to FLAG.
The debugger is entered when that frame exits, if the flag is non-nil. */)
- (level, flag)
- Lisp_Object level, flag;
+ (Lisp_Object level, Lisp_Object flag)
{
register struct backtrace *backlist = backtrace_list;
register int i;
@@ -3811,7 +3715,7 @@ The debugger is entered when that frame exits, if the flag is non-nil. */)
DEFUN ("backtrace", Fbacktrace, Sbacktrace, 0, 0, "",
doc: /* Print a trace of Lisp function calls currently active.
Output stream used is value of `standard-output'. */)
- ()
+ (void)
{
register struct backtrace *backlist = backtrace_list;
register int i;
@@ -3876,8 +3780,7 @@ A &rest arg is represented as the tail of the list ARG-VALUES.
FUNCTION is whatever was supplied as car of evaluated list,
or a lambda expression for macro calls.
If NFRAMES is more than the number of frames, the value is nil. */)
- (nframes)
- Lisp_Object nframes;
+ (Lisp_Object nframes)
{
register struct backtrace *backlist = backtrace_list;
register int i;
@@ -3906,7 +3809,7 @@ If NFRAMES is more than the number of frames, the value is nil. */)
void
-mark_backtrace ()
+mark_backtrace (void)
{
register struct backtrace *backlist;
register int i;
@@ -3925,7 +3828,7 @@ mark_backtrace ()
}
void
-syms_of_eval ()
+syms_of_eval (void)
{
DEFVAR_INT ("max-specpdl-size", &max_specpdl_size,
doc: /* *Limit on number of Lisp variable bindings and `unwind-protect's.
diff --git a/src/fileio.c b/src/fileio.c
index 8c2ee45c073..c942803e280 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -240,15 +240,13 @@ Lisp_Object Qfile_name_history;
Lisp_Object Qcar_less_than_car;
-static int a_write P_ ((int, Lisp_Object, int, int,
- Lisp_Object *, struct coding_system *));
-static int e_write P_ ((int, Lisp_Object, int, int, struct coding_system *));
+static int a_write (int, Lisp_Object, int, int,
+ Lisp_Object *, struct coding_system *);
+static int e_write (int, Lisp_Object, int, int, struct coding_system *);
void
-report_file_error (string, data)
- const char *string;
- Lisp_Object data;
+report_file_error (const char *string, Lisp_Object data)
{
Lisp_Object errstring;
int errorno = errno;
@@ -286,8 +284,7 @@ report_file_error (string, data)
}
Lisp_Object
-close_file_unwind (fd)
- Lisp_Object fd;
+close_file_unwind (Lisp_Object fd)
{
emacs_close (XFASTINT (fd));
return Qnil;
@@ -296,8 +293,7 @@ close_file_unwind (fd)
/* Restore point, having saved it as a marker. */
Lisp_Object
-restore_point_unwind (location)
- Lisp_Object location;
+restore_point_unwind (Lisp_Object location)
{
Fgoto_char (location);
Fset_marker (location, Qnil, Qnil);
@@ -350,8 +346,7 @@ If OPERATION equals `inhibit-file-name-operation', then we ignore
any handlers that are members of `inhibit-file-name-handlers',
but we still do run any other handlers. This lets handlers
use the standard functions without calling themselves recursively. */)
- (filename, operation)
- Lisp_Object filename, operation;
+ (Lisp_Object filename, Lisp_Object operation)
{
/* This function must not munge the match data. */
Lisp_Object chain, inhibited_handlers, result;
@@ -407,8 +402,7 @@ DEFUN ("file-name-directory", Ffile_name_directory, Sfile_name_directory,
Return nil if FILENAME does not include a directory.
Otherwise return a directory name.
Given a Unix syntax file name, returns a string ending in slash. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
#ifndef DOS_NT
register const unsigned char *beg;
@@ -429,7 +423,7 @@ Given a Unix syntax file name, returns a string ending in slash. */)
filename = FILE_SYSTEM_CASE (filename);
#ifdef DOS_NT
beg = (unsigned char *) alloca (SBYTES (filename) + 1);
- bcopy (SDATA (filename), beg, SBYTES (filename) + 1);
+ memcpy (beg, SDATA (filename), SBYTES (filename) + 1);
#else
beg = SDATA (filename);
#endif
@@ -482,8 +476,7 @@ DEFUN ("file-name-nondirectory", Ffile_name_nondirectory,
For example, in a Unix-syntax file name,
this is everything after the last slash,
or the entire name if it contains no slash. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
register const unsigned char *beg, *p, *end;
Lisp_Object handler;
@@ -523,8 +516,7 @@ If FILENAME refers to a file which is not accessible from a local process,
then this should return nil.
The `call-process' and `start-process' functions use this function to
get a current directory to run processes in. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
Lisp_Object handler;
@@ -539,8 +531,7 @@ get a current directory to run processes in. */)
char *
-file_name_as_directory (out, in)
- char *out, *in;
+file_name_as_directory (char *out, char *in)
{
int size = strlen (in) - 1;
@@ -574,8 +565,7 @@ a directory is different from its name as a file.
The result can be used as the value of `default-directory'
or passed as second argument to `expand-file-name'.
For a Unix-syntax file name, just appends a slash. */)
- (file)
- Lisp_Object file;
+ (Lisp_Object file)
{
char *buf;
Lisp_Object handler;
@@ -604,8 +594,7 @@ For a Unix-syntax file name, just appends a slash. */)
*/
int
-directory_file_name (src, dst)
- char *src, *dst;
+directory_file_name (char *src, char *dst)
{
long slen;
@@ -634,8 +623,7 @@ This is the name of the file that holds the data for the directory DIRECTORY.
This operation exists because a directory is also a file, but its name as
a directory is different from its name as a file.
In Unix-syntax, this function just removes the final slash. */)
- (directory)
- Lisp_Object directory;
+ (Lisp_Object directory)
{
char *buf;
Lisp_Object handler;
@@ -688,9 +676,7 @@ static unsigned make_temp_name_count, make_temp_name_count_initialized_p;
generated. */
Lisp_Object
-make_temp_name (prefix, base64_p)
- Lisp_Object prefix;
- int base64_p;
+make_temp_name (Lisp_Object prefix, int base64_p)
{
Lisp_Object val;
int len, clen;
@@ -733,10 +719,10 @@ make_temp_name (prefix, base64_p)
if (!STRING_MULTIBYTE (prefix))
STRING_SET_UNIBYTE (val);
data = SDATA (val);
- bcopy(SDATA (prefix), data, len);
+ memcpy (data, SDATA (prefix), len);
p = data + len;
- bcopy (pidbuf, p, pidlen);
+ memcpy (p, pidbuf, pidlen);
p += pidlen;
/* Here we try to minimize useless stat'ing when this function is
@@ -809,8 +795,7 @@ probably use `make-temp-file' instead, except in three circumstances:
* If you are creating the file in the user's home directory.
* If you are creating a directory rather than an ordinary file.
* If you are taking special precautions as `make-temp-file' does. */)
- (prefix)
- Lisp_Object prefix;
+ (Lisp_Object prefix)
{
return make_temp_name (prefix, 0);
}
@@ -835,8 +820,7 @@ non-intuitive results for the root directory; for instance,
\(expand-file-name ".." "/") returns "/..". For this reason, use
(directory-file-name (file-name-directory dirname)) to traverse a
filesystem tree, not (expand-file-name ".." dirname). */)
- (name, default_directory)
- Lisp_Object name, default_directory;
+ (Lisp_Object name, Lisp_Object default_directory)
{
/* These point to SDATA and need to be careful with string-relocation
during GC (via DECODE_FILE). */
@@ -947,7 +931,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
/* Make a local copy of nm[] to protect it from GC in DECODE_FILE below. */
nm = (unsigned char *) alloca (SBYTES (name) + 1);
- bcopy (SDATA (name), nm, SBYTES (name) + 1);
+ memcpy (nm, SDATA (name), SBYTES (name) + 1);
#ifdef DOS_NT
/* Note if special escape prefix is present, but remove for now. */
@@ -1101,7 +1085,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
unsigned char *o, *p;
for (p = nm; *p && (!IS_DIRECTORY_SEP (*p)); p++);
o = alloca (p - nm + 1);
- bcopy ((char *) nm, o, p - nm);
+ memcpy (o, nm, p - nm);
o [p - nm] = 0;
BLOCK_INPUT;
@@ -1252,7 +1236,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
)
{
unsigned char *temp = (unsigned char *) alloca (length);
- bcopy (newdir, temp, length - 1);
+ memcpy (temp, newdir, length - 1);
temp[length - 1] = 0;
newdir = temp;
}
@@ -1471,11 +1455,11 @@ See also the function `substitute-in-file-name'.")
/* Get past ~ to user */
unsigned char *user = nm + 1;
/* Find end of name. */
- unsigned char *ptr = (unsigned char *) index (user, '/');
+ unsigned char *ptr = (unsigned char *) strchr (user, '/');
int len = ptr ? ptr - user : strlen (user);
/* Copy the user name into temp storage. */
o = (unsigned char *) alloca (len + 1);
- bcopy ((char *) user, o, len);
+ memcpy (o, user, len);
o[len] = 0;
/* Look up the user name. */
@@ -1558,8 +1542,7 @@ See also the function `substitute-in-file-name'.")
/* If /~ or // appears, discard everything through first slash. */
static int
-file_name_absolute_p (filename)
- const unsigned char *filename;
+file_name_absolute_p (const unsigned char *filename)
{
return
(IS_DIRECTORY_SEP (*filename) || *filename == '~'
@@ -1571,8 +1554,7 @@ file_name_absolute_p (filename)
}
static unsigned char *
-search_embedded_absfilename (nm, endp)
- unsigned char *nm, *endp;
+search_embedded_absfilename (unsigned char *nm, unsigned char *endp)
{
unsigned char *p, *s;
@@ -1593,7 +1575,7 @@ search_embedded_absfilename (nm, endp)
{
unsigned char *o = alloca (s - p + 1);
struct passwd *pw;
- bcopy (p, o, s - p);
+ memcpy (o, p, s - p);
o [s - p] = 0;
/* If we have ~user and `user' exists, discard
@@ -1623,8 +1605,7 @@ the entire variable name in braces.
If `/~' appears, all of FILENAME through that `/' is discarded.
If `//' appears, everything up to and including the first of
those `/' is discarded. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
unsigned char *nm;
@@ -1650,7 +1631,7 @@ those `/' is discarded. */)
decode of environment variables, causing the original Lisp_String
data to be relocated. */
nm = (unsigned char *) alloca (SBYTES (filename) + 1);
- bcopy (SDATA (filename), nm, SBYTES (filename) + 1);
+ memcpy (nm, SDATA (filename), SBYTES (filename) + 1);
#ifdef DOS_NT
dostounix_filename (nm);
@@ -1823,8 +1804,7 @@ those `/' is discarded. */)
(directory-file-name (expand-file-name FOO)). */
Lisp_Object
-expand_and_dir_to_file (filename, defdir)
- Lisp_Object filename, defdir;
+expand_and_dir_to_file (Lisp_Object filename, Lisp_Object defdir)
{
register Lisp_Object absname;
@@ -1853,12 +1833,7 @@ expand_and_dir_to_file (filename, defdir)
If QUICK is nonzero, we ask for y or n, not yes or no. */
void
-barf_or_query_if_file_exists (absname, querystring, interactive, statptr, quick)
- Lisp_Object absname;
- unsigned char *querystring;
- int interactive;
- struct stat *statptr;
- int quick;
+barf_or_query_if_file_exists (Lisp_Object absname, unsigned char *querystring, int interactive, struct stat *statptr, int quick)
{
register Lisp_Object tem, encoded_filename;
struct stat statbuf;
@@ -1921,9 +1896,7 @@ uid and gid of FILE to NEWNAME.
If PRESERVE-SELINUX-CONTEXT is non-nil and SELinux is enabled
on the system, we copy the SELinux context of FILE to NEWNAME. */)
- (file, newname, ok_if_already_exists, keep_time, preserve_uid_gid, preserve_selinux_context)
- Lisp_Object file, newname, ok_if_already_exists, keep_time;
- Lisp_Object preserve_uid_gid, preserve_selinux_context;
+ (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists, Lisp_Object keep_time, Lisp_Object preserve_uid_gid, Lisp_Object preserve_selinux_context)
{
int ifd, ofd, n;
char buf[16 * 1024];
@@ -2134,8 +2107,7 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */)
DEFUN ("make-directory-internal", Fmake_directory_internal,
Smake_directory_internal, 1, 1, 0,
doc: /* Create a new directory named DIRECTORY. */)
- (directory)
- Lisp_Object directory;
+ (Lisp_Object directory)
{
const unsigned char *dir;
Lisp_Object handler;
@@ -2165,8 +2137,7 @@ DEFUN ("make-directory-internal", Fmake_directory_internal,
DEFUN ("delete-directory-internal", Fdelete_directory_internal,
Sdelete_directory_internal, 1, 1, 0,
doc: /* Delete the directory named DIRECTORY. Does not follow symlinks. */)
- (directory)
- Lisp_Object directory;
+ (Lisp_Object directory)
{
const unsigned char *dir;
Lisp_Object handler;
@@ -2196,9 +2167,7 @@ TRASH non-nil means to trash the file instead of deleting, provided
When called interactively, TRASH is t if no prefix argument is given.
With a prefix argument, TRASH is nil. */)
- (filename, trash)
- Lisp_Object filename;
- Lisp_Object trash;
+ (Lisp_Object filename, Lisp_Object trash)
{
Lisp_Object handler;
Lisp_Object encoded_file;
@@ -2228,8 +2197,7 @@ With a prefix argument, TRASH is nil. */)
}
static Lisp_Object
-internal_delete_file_1 (ignore)
- Lisp_Object ignore;
+internal_delete_file_1 (Lisp_Object ignore)
{
return Qt;
}
@@ -2255,8 +2223,7 @@ Signals a `file-already-exists' error if a file NEWNAME already exists
unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.
A number as third arg means request confirmation if NEWNAME already exists.
This is what happens in interactive use with M-x. */)
- (file, newname, ok_if_already_exists)
- Lisp_Object file, newname, ok_if_already_exists;
+ (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists)
{
Lisp_Object handler;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
@@ -2353,8 +2320,7 @@ Signals a `file-already-exists' error if a file NEWNAME already exists
unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.
A number as third arg means request confirmation if NEWNAME already exists.
This is what happens in interactive use with M-x. */)
- (file, newname, ok_if_already_exists)
- Lisp_Object file, newname, ok_if_already_exists;
+ (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists)
{
Lisp_Object handler;
Lisp_Object encoded_file, encoded_newname;
@@ -2409,8 +2375,7 @@ Signals a `file-already-exists' error if a file LINKNAME already exists
unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.
A number as third arg means request confirmation if LINKNAME already exists.
This happens for interactive use with M-x. */)
- (filename, linkname, ok_if_already_exists)
- Lisp_Object filename, linkname, ok_if_already_exists;
+ (Lisp_Object filename, Lisp_Object linkname, Lisp_Object ok_if_already_exists)
{
Lisp_Object handler;
Lisp_Object encoded_filename, encoded_linkname;
@@ -2485,8 +2450,7 @@ DEFUN ("file-name-absolute-p", Ffile_name_absolute_p, Sfile_name_absolute_p,
1, 1, 0,
doc: /* Return t if file FILENAME specifies an absolute file name.
On Unix, this is a name starting with a `/' or a `~'. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
CHECK_STRING (filename);
return file_name_absolute_p (SDATA (filename)) ? Qt : Qnil;
@@ -2495,8 +2459,7 @@ On Unix, this is a name starting with a `/' or a `~'. */)
/* Return nonzero if file FILENAME exists and can be executed. */
static int
-check_executable (filename)
- char *filename;
+check_executable (char *filename)
{
#ifdef DOS_NT
int len = strlen (filename);
@@ -2520,8 +2483,7 @@ check_executable (filename)
/* Return nonzero if file FILENAME exists and can be written. */
static int
-check_writable (filename)
- char *filename;
+check_writable (char *filename)
{
#ifdef MSDOS
struct stat st;
@@ -2547,8 +2509,7 @@ DEFUN ("file-exists-p", Ffile_exists_p, Sfile_exists_p, 1, 1, 0,
See also `file-readable-p' and `file-attributes'.
This returns nil for a symlink to a nonexistent file.
Use `file-symlink-p' to test for such links. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
Lisp_Object absname;
Lisp_Object handler;
@@ -2571,8 +2532,7 @@ Use `file-symlink-p' to test for such links. */)
DEFUN ("file-executable-p", Ffile_executable_p, Sfile_executable_p, 1, 1, 0,
doc: /* Return t if FILENAME can be executed by you.
For a directory, this means you can access files in that directory. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
Lisp_Object absname;
Lisp_Object handler;
@@ -2594,8 +2554,7 @@ For a directory, this means you can access files in that directory. */)
DEFUN ("file-readable-p", Ffile_readable_p, Sfile_readable_p, 1, 1, 0,
doc: /* Return t if file FILENAME exists and you can read it.
See also `file-exists-p' and `file-attributes'. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
Lisp_Object absname;
Lisp_Object handler;
@@ -2644,8 +2603,7 @@ See also `file-exists-p' and `file-attributes'. */)
on the RT/PC. */
DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0,
doc: /* Return t if file FILENAME can be written or created by you. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
Lisp_Object absname, dir, encoded;
Lisp_Object handler;
@@ -2689,8 +2647,7 @@ DEFUN ("access-file", Faccess_file, Saccess_file, 2, 2, 0,
doc: /* Access file FILENAME, and get an error if that does not work.
The second argument STRING is used in the error message.
If there is no error, returns nil. */)
- (filename, string)
- Lisp_Object filename, string;
+ (Lisp_Object filename, Lisp_Object string)
{
Lisp_Object handler, encoded_filename, absname;
int fd;
@@ -2723,8 +2680,7 @@ Otherwise it returns nil.
This function returns t when given the name of a symlink that
points to a nonexistent file. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
Lisp_Object handler;
@@ -2752,7 +2708,7 @@ points to a nonexistent file. */)
{
bufsize *= 2;
buf = (char *) xrealloc (buf, bufsize);
- bzero (buf, bufsize);
+ memset (buf, 0, bufsize);
errno = 0;
valsize = readlink (SDATA (filename), buf, bufsize);
@@ -2773,7 +2729,7 @@ points to a nonexistent file. */)
while (valsize >= bufsize);
val = make_string (buf, valsize);
- if (buf[0] == '/' && index (buf, ':'))
+ if (buf[0] == '/' && strchr (buf, ':'))
val = concat2 (build_string ("/:"), val);
xfree (buf);
val = DECODE_FILE (val);
@@ -2788,8 +2744,7 @@ DEFUN ("file-directory-p", Ffile_directory_p, Sfile_directory_p, 1, 1, 0,
doc: /* Return t if FILENAME names an existing directory.
Symbolic links to directories count as directories.
See `file-symlink-p' to distinguish symlinks. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
register Lisp_Object absname;
struct stat st;
@@ -2818,8 +2773,7 @@ directory as a buffer's current directory, this predicate must return true.
A directory name spec may be given instead; then the value is t
if the directory so specified exists and really is a readable and
searchable directory. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
Lisp_Object handler;
int tem;
@@ -2843,8 +2797,7 @@ DEFUN ("file-regular-p", Ffile_regular_p, Sfile_regular_p, 1, 1, 0,
This is the sort of file that holds an ordinary stream of data bytes.
Symbolic links to regular files count as regular files.
See `file-symlink-p' to distinguish symlinks. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
register Lisp_Object absname;
struct stat st;
@@ -2886,8 +2839,7 @@ DEFUN ("file-selinux-context", Ffile_selinux_context,
doc: /* Return SELinux context of file named FILENAME,
as a list ("user", "role", "type", "range"). Return (nil, nil, nil, nil)
if file does not exist, is not accessible, or SELinux is disabled */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
Lisp_Object absname;
Lisp_Object values[4];
@@ -2942,8 +2894,7 @@ DEFUN ("set-file-selinux-context", Fset_file_selinux_context,
doc: /* Set SELinux context of file named FILENAME to CONTEXT
as a list ("user", "role", "type", "range"). Has no effect if SELinux
is disabled. */)
- (filename, context)
- Lisp_Object filename, context;
+ (Lisp_Object filename, Lisp_Object context)
{
Lisp_Object absname, encoded_absname;
Lisp_Object handler;
@@ -3018,8 +2969,7 @@ is disabled. */)
DEFUN ("file-modes", Ffile_modes, Sfile_modes, 1, 1, 0,
doc: /* Return mode bits of file named FILENAME, as an integer.
Return nil, if file does not exist or is not accessible. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
Lisp_Object absname;
struct stat st;
@@ -3049,8 +2999,7 @@ Only the 12 low bits of MODE are used.
Interactively, mode bits are read by `read-file-modes', which accepts
symbolic notation, like the `chmod' command from GNU Coreutils. */)
- (filename, mode)
- Lisp_Object filename, mode;
+ (Lisp_Object filename, Lisp_Object mode)
{
Lisp_Object absname, encoded_absname;
Lisp_Object handler;
@@ -3076,8 +3025,7 @@ DEFUN ("set-default-file-modes", Fset_default_file_modes, Sset_default_file_mode
doc: /* Set the file permission bits for newly created files.
The argument MODE should be an integer; only the low 9 bits are used.
This setting is inherited by subprocesses. */)
- (mode)
- Lisp_Object mode;
+ (Lisp_Object mode)
{
CHECK_NUMBER (mode);
@@ -3089,7 +3037,7 @@ This setting is inherited by subprocesses. */)
DEFUN ("default-file-modes", Fdefault_file_modes, Sdefault_file_modes, 0, 0, 0,
doc: /* Return the default file protection for created files.
The value is an integer. */)
- ()
+ (void)
{
int realmask;
Lisp_Object value;
@@ -3101,7 +3049,7 @@ The value is an integer. */)
return value;
}
-extern int lisp_time_argument P_ ((Lisp_Object, time_t *, int *));
+extern int lisp_time_argument (Lisp_Object, time_t *, int *);
DEFUN ("set-file-times", Fset_file_times, Sset_file_times, 1, 2, 0,
doc: /* Set times of file FILENAME to TIME.
@@ -3109,8 +3057,7 @@ Set both access and modification times.
Return t on success, else nil.
Use the current time if TIME is nil. TIME is in the format of
`current-time'. */)
- (filename, time)
- Lisp_Object filename, time;
+ (Lisp_Object filename, Lisp_Object time)
{
Lisp_Object absname, encoded_absname;
Lisp_Object handler;
@@ -3157,7 +3104,7 @@ Use the current time if TIME is nil. TIME is in the format of
#ifdef HAVE_SYNC
DEFUN ("unix-sync", Funix_sync, Sunix_sync, 0, 0, "",
doc: /* Tell Unix to finish all pending disk updates. */)
- ()
+ (void)
{
sync ();
return Qnil;
@@ -3169,8 +3116,7 @@ DEFUN ("file-newer-than-file-p", Ffile_newer_than_file_p, Sfile_newer_than_file_
doc: /* Return t if file FILE1 is newer than file FILE2.
If FILE1 does not exist, the answer is nil;
otherwise, if FILE2 does not exist, the answer is t. */)
- (file1, file2)
- Lisp_Object file1, file2;
+ (Lisp_Object file1, Lisp_Object file2)
{
Lisp_Object absname1, absname2;
struct stat st;
@@ -3235,8 +3181,7 @@ Lisp_Object Qfind_buffer_file_type;
o set back the buffer multibyteness. */
static Lisp_Object
-decide_coding_unwind (unwind_data)
- Lisp_Object unwind_data;
+decide_coding_unwind (Lisp_Object unwind_data)
{
Lisp_Object multibyte, undo_list, buffer;
@@ -3268,12 +3213,12 @@ static EMACS_INT non_regular_nbytes;
/* Read from a non-regular file.
- Read non_regular_trytry bytes max from non_regular_fd.
+ Read non_regular_nbytes bytes max from non_regular_fd.
Non_regular_inserted specifies where to put the read bytes.
Value is the number of bytes read. */
static Lisp_Object
-read_non_regular ()
+read_non_regular (Lisp_Object ignore)
{
EMACS_INT nbytes;
@@ -3291,7 +3236,7 @@ read_non_regular ()
in insert-file-contents. */
static Lisp_Object
-read_non_regular_quit ()
+read_non_regular_quit (Lisp_Object ignore)
{
return Qnil;
}
@@ -3320,8 +3265,7 @@ the number of characters that replace previous buffer contents.
This function does code conversion according to the value of
`coding-system-for-read' or `file-coding-system-alist', and sets the
variable `last-coding-system-used' to the coding system actually used. */)
- (filename, visit, beg, end, replace)
- Lisp_Object filename, visit, beg, end, replace;
+ (Lisp_Object filename, Lisp_Object visit, Lisp_Object beg, Lisp_Object end, Lisp_Object replace)
{
struct stat st;
register int fd;
@@ -3857,7 +3801,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
conversion_buffer);
unprocessed = coding.carryover_bytes;
if (coding.carryover_bytes > 0)
- bcopy (coding.carryover, read_buf, unprocessed);
+ memcpy (read_buf, coding.carryover, unprocessed);
}
UNGCPRO;
emacs_close (fd);
@@ -4445,11 +4389,10 @@ variable `last-coding-system-used' to the coding system actually used. */)
RETURN_UNGCPRO (unbind_to (count, val));
}
-static Lisp_Object build_annotations P_ ((Lisp_Object, Lisp_Object));
+static Lisp_Object build_annotations (Lisp_Object, Lisp_Object);
static Lisp_Object
-build_annotations_unwind (arg)
- Lisp_Object arg;
+build_annotations_unwind (Lisp_Object arg)
{
Vwrite_region_annotation_buffers = arg;
return Qnil;
@@ -4458,10 +4401,9 @@ build_annotations_unwind (arg)
/* Decide the coding-system to encode the data with. */
static Lisp_Object
-choose_write_coding_system (start, end, filename,
- append, visit, lockname, coding)
- Lisp_Object start, end, filename, append, visit, lockname;
- struct coding_system *coding;
+choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object filename,
+ Lisp_Object append, Lisp_Object visit, Lisp_Object lockname,
+ struct coding_system *coding)
{
Lisp_Object val;
Lisp_Object eol_parent = Qnil;
@@ -4602,8 +4544,7 @@ This does code conversion according to the value of
This calls `write-region-annotate-functions' at the start, and
`write-region-post-annotation-function' at the end. */)
- (start, end, filename, append, visit, lockname, mustbenew)
- Lisp_Object start, end, filename, append, visit, lockname, mustbenew;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object filename, Lisp_Object append, Lisp_Object visit, Lisp_Object lockname, Lisp_Object mustbenew)
{
register int desc;
int failure;
@@ -4904,12 +4845,11 @@ This calls `write-region-annotate-functions' at the start, and
return Qnil;
}
-Lisp_Object merge ();
+Lisp_Object merge (Lisp_Object, Lisp_Object, Lisp_Object);
DEFUN ("car-less-than-car", Fcar_less_than_car, Scar_less_than_car, 2, 2, 0,
doc: /* Return t if (car A) is numerically less than (car B). */)
- (a, b)
- Lisp_Object a, b;
+ (Lisp_Object a, Lisp_Object b)
{
return Flss (Fcar (a), Fcar (b));
}
@@ -4923,8 +4863,7 @@ DEFUN ("car-less-than-car", Fcar_less_than_car, Scar_less_than_car, 2, 2, 0,
as save-excursion would do. */
static Lisp_Object
-build_annotations (start, end)
- Lisp_Object start, end;
+build_annotations (Lisp_Object start, Lisp_Object end)
{
Lisp_Object annotations;
Lisp_Object p, res;
@@ -5013,13 +4952,7 @@ build_annotations (start, end)
The return value is negative in case of system call failure. */
static int
-a_write (desc, string, pos, nchars, annot, coding)
- int desc;
- Lisp_Object string;
- register int nchars;
- int pos;
- Lisp_Object *annot;
- struct coding_system *coding;
+a_write (int desc, Lisp_Object string, int pos, register int nchars, Lisp_Object *annot, struct coding_system *coding)
{
Lisp_Object tem;
int nextpos;
@@ -5063,11 +4996,7 @@ a_write (desc, string, pos, nchars, annot, coding)
are indexes to the string STRING. */
static int
-e_write (desc, string, start, end, coding)
- int desc;
- Lisp_Object string;
- int start, end;
- struct coding_system *coding;
+e_write (int desc, Lisp_Object string, int start, int end, struct coding_system *coding)
{
if (STRINGP (string))
{
@@ -5147,8 +5076,7 @@ DEFUN ("verify-visited-file-modtime", Fverify_visited_file_modtime,
doc: /* Return t if last mod time of BUF's visited file matches what BUF records.
This means that the file has not been changed since it was visited or saved.
See Info node `(elisp)Modification Time' for more details. */)
- (buf)
- Lisp_Object buf;
+ (Lisp_Object buf)
{
struct buffer *b;
struct stat st;
@@ -5194,7 +5122,7 @@ DEFUN ("clear-visited-file-modtime", Fclear_visited_file_modtime,
Sclear_visited_file_modtime, 0, 0, 0,
doc: /* Clear out records of last mod time of visited file.
Next attempt to save will certainly not complain of a discrepancy. */)
- ()
+ (void)
{
current_buffer->modtime = 0;
current_buffer->modtime_size = -1;
@@ -5208,7 +5136,7 @@ The value is a list of the form (HIGH LOW), like the time values
that `file-attributes' returns. If the current buffer has no recorded
file modification time, this function returns 0.
See Info node `(elisp)Modification Time' for more details. */)
- ()
+ (void)
{
if (! current_buffer->modtime)
return make_number (0);
@@ -5223,8 +5151,7 @@ or if the file itself has been changed for some known benign reason.
An argument specifies the modification time value to use
\(instead of that of the visited file), in the form of a list
\(HIGH . LOW) or (HIGH LOW). */)
- (time_list)
- Lisp_Object time_list;
+ (Lisp_Object time_list)
{
if (!NILP (time_list))
{
@@ -5259,8 +5186,7 @@ An argument specifies the modification time value to use
}
Lisp_Object
-auto_save_error (error)
- Lisp_Object error;
+auto_save_error (Lisp_Object error)
{
Lisp_Object args[3], msg;
int i, nbytes;
@@ -5279,7 +5205,7 @@ auto_save_error (error)
GCPRO1 (msg);
nbytes = SBYTES (msg);
SAFE_ALLOCA (msgbuf, char *, nbytes);
- bcopy (SDATA (msg), msgbuf, nbytes);
+ memcpy (msgbuf, SDATA (msg), nbytes);
for (i = 0; i < 3; ++i)
{
@@ -5296,7 +5222,7 @@ auto_save_error (error)
}
Lisp_Object
-auto_save_1 ()
+auto_save_1 (void)
{
struct stat st;
Lisp_Object modes;
@@ -5322,8 +5248,8 @@ auto_save_1 ()
}
static Lisp_Object
-do_auto_save_unwind (arg) /* used as unwind-protect function */
- Lisp_Object arg;
+do_auto_save_unwind (Lisp_Object arg) /* used as unwind-protect function */
+
{
FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer;
auto_saving = 0;
@@ -5337,16 +5263,15 @@ do_auto_save_unwind (arg) /* used as unwind-protect function */
}
static Lisp_Object
-do_auto_save_unwind_1 (value) /* used as unwind-protect function */
- Lisp_Object value;
+do_auto_save_unwind_1 (Lisp_Object value) /* used as unwind-protect function */
+
{
minibuffer_auto_raise = XINT (value);
return Qnil;
}
static Lisp_Object
-do_auto_save_make_dir (dir)
- Lisp_Object dir;
+do_auto_save_make_dir (Lisp_Object dir)
{
Lisp_Object mode;
@@ -5356,8 +5281,7 @@ do_auto_save_make_dir (dir)
}
static Lisp_Object
-do_auto_save_eh (ignore)
- Lisp_Object ignore;
+do_auto_save_eh (Lisp_Object ignore)
{
return Qnil;
}
@@ -5373,8 +5297,7 @@ Normally we run the normal hook `auto-save-hook' before saving.
A non-nil NO-MESSAGE argument means do not print any message if successful.
A non-nil CURRENT-ONLY argument means save only current buffer. */)
- (no_message, current_only)
- Lisp_Object no_message, current_only;
+ (Lisp_Object no_message, Lisp_Object current_only)
{
struct buffer *old = current_buffer, *b;
Lisp_Object tail, buf;
@@ -5575,7 +5498,7 @@ DEFUN ("set-buffer-auto-saved", Fset_buffer_auto_saved,
Sset_buffer_auto_saved, 0, 0, 0,
doc: /* Mark current buffer as auto-saved with its current text.
No auto-save file will be written until the buffer changes again. */)
- ()
+ (void)
{
/* FIXME: This should not be called in indirect buffers, since
they're not autosaved. */
@@ -5588,7 +5511,7 @@ No auto-save file will be written until the buffer changes again. */)
DEFUN ("clear-buffer-auto-save-failure", Fclear_buffer_auto_save_failure,
Sclear_buffer_auto_save_failure, 0, 0, 0,
doc: /* Clear any record of a recent auto-save failure in the current buffer. */)
- ()
+ (void)
{
current_buffer->auto_save_failure_time = -1;
return Qnil;
@@ -5600,7 +5523,7 @@ DEFUN ("recent-auto-save-p", Frecent_auto_save_p, Srecent_auto_save_p,
More precisely, if it has been auto-saved since last read from or saved
in the visited file. If the buffer has no visited file,
then any auto-save counts as "recent". */)
- ()
+ (void)
{
/* FIXME: maybe we should return nil for indirect buffers since
they're never autosaved. */
@@ -5614,7 +5537,7 @@ DEFUN ("next-read-file-uses-dialog-p", Fnext_read_file_uses_dialog_p,
doc: /* Return t if a call to `read-file-name' will use a dialog.
The return value is only relevant for a call to `read-file-name' that happens
before any other event (mouse or keypress) is handled. */)
- ()
+ (void)
{
#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK)
if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
@@ -5627,8 +5550,7 @@ before any other event (mouse or keypress) is handled. */)
}
Lisp_Object
-Fread_file_name (prompt, dir, default_filename, mustmatch, initial, predicate)
- Lisp_Object prompt, dir, default_filename, mustmatch, initial, predicate;
+Fread_file_name (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object initial, Lisp_Object predicate)
{
struct gcpro gcpro1, gcpro2;
Lisp_Object args[7];
@@ -5646,7 +5568,7 @@ Fread_file_name (prompt, dir, default_filename, mustmatch, initial, predicate)
void
-syms_of_fileio ()
+syms_of_fileio (void)
{
Qoperations = intern_c_string ("operations");
Qexpand_file_name = intern_c_string ("expand-file-name");
diff --git a/src/filelock.c b/src/filelock.c
index b11338c58b6..c3f1bfde292 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -34,9 +34,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#ifdef HAVE_STRING_H
#include <string.h>
-#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -122,11 +120,11 @@ static int boot_time_initialized;
extern Lisp_Object Vshell_file_name;
#ifdef BOOT_TIME
-static void get_boot_time_1 P_ ((char *, int));
+static void get_boot_time_1 (char *, int);
#endif
static time_t
-get_boot_time ()
+get_boot_time (void)
{
#if defined (BOOT_TIME)
int counter;
@@ -253,9 +251,7 @@ get_boot_time ()
Success is indicated by setting BOOT_TIME to a larger value. */
void
-get_boot_time_1 (filename, newest)
- char *filename;
- int newest;
+get_boot_time_1 (char *filename, int newest)
{
struct utmp ut, *utp;
int desc;
@@ -326,9 +322,7 @@ typedef struct
fill_in_lock_file_name (lock, (file)))
static void
-fill_in_lock_file_name (lockfile, fn)
- register char *lockfile;
- register Lisp_Object fn;
+fill_in_lock_file_name (register char *lockfile, register Lisp_Object fn)
{
register char *p;
struct stat st;
@@ -364,9 +358,7 @@ fill_in_lock_file_name (lockfile, fn)
Return 1 if successful, 0 if not. */
static int
-lock_file_1 (lfname, force)
- char *lfname;
- int force;
+lock_file_1 (char *lfname, int force)
{
register int err;
time_t boot_time;
@@ -408,8 +400,7 @@ lock_file_1 (lfname, force)
/* Return 1 if times A and B are no more than one second apart. */
int
-within_one_second (a, b)
- time_t a, b;
+within_one_second (time_t a, time_t b)
{
return (a - b >= -1 && a - b <= 1);
}
@@ -420,13 +411,8 @@ within_one_second (a, b)
or -1 if something is wrong with the locking mechanism. */
static int
-current_lock_owner (owner, lfname)
- lock_info_type *owner;
- char *lfname;
+current_lock_owner (lock_info_type *owner, char *lfname)
{
-#ifndef index
- extern char *rindex (), *index ();
-#endif
int len, ret;
int local_owner = 0;
char *at, *dot, *colon;
@@ -468,8 +454,8 @@ current_lock_owner (owner, lfname)
/* Parse USER@HOST.PID:BOOT_TIME. If can't parse, return -1. */
/* The USER is everything before the last @. */
- at = rindex (lfinfo, '@');
- dot = rindex (lfinfo, '.');
+ at = strrchr (lfinfo, '@');
+ dot = strrchr (lfinfo, '.');
if (!at || !dot)
{
xfree (lfinfo);
@@ -540,9 +526,7 @@ current_lock_owner (owner, lfname)
Return -1 if cannot lock for any other reason. */
static int
-lock_if_free (clasher, lfname)
- lock_info_type *clasher;
- register char *lfname;
+lock_if_free (lock_info_type *clasher, register char *lfname)
{
while (lock_file_1 (lfname, 0) == 0)
{
@@ -585,8 +569,7 @@ lock_if_free (clasher, lfname)
take away the lock, or return nil meaning ignore the lock. */
void
-lock_file (fn)
- Lisp_Object fn;
+lock_file (Lisp_Object fn)
{
register Lisp_Object attack, orig_fn, encoded_fn;
register char *lfname, *locker;
@@ -645,8 +628,7 @@ lock_file (fn)
}
void
-unlock_file (fn)
- register Lisp_Object fn;
+unlock_file (register Lisp_Object fn)
{
register char *lfname;
@@ -660,7 +642,7 @@ unlock_file (fn)
}
void
-unlock_all_files ()
+unlock_all_files (void)
{
register Lisp_Object tail;
register struct buffer *b;
@@ -680,8 +662,7 @@ DEFUN ("lock-buffer", Flock_buffer, Slock_buffer,
doc: /* Lock FILE, if current buffer is modified.
FILE defaults to current buffer's visited file,
or else nothing is done if current buffer isn't visiting a file. */)
- (file)
- Lisp_Object file;
+ (Lisp_Object file)
{
if (NILP (file))
file = current_buffer->file_truename;
@@ -698,7 +679,7 @@ DEFUN ("unlock-buffer", Funlock_buffer, Sunlock_buffer,
doc: /* Unlock the file visited in the current buffer.
If the buffer is not modified, this does nothing because the file
should not be locked in that case. */)
- ()
+ (void)
{
if (SAVE_MODIFF < MODIFF
&& STRINGP (current_buffer->file_truename))
@@ -709,8 +690,7 @@ should not be locked in that case. */)
/* Unlock the file visited in buffer BUFFER. */
void
-unlock_buffer (buffer)
- struct buffer *buffer;
+unlock_buffer (struct buffer *buffer)
{
if (BUF_SAVE_MODIFF (buffer) < BUF_MODIFF (buffer)
&& STRINGP (buffer->file_truename))
@@ -721,8 +701,7 @@ DEFUN ("file-locked-p", Ffile_locked_p, Sfile_locked_p, 1, 1, 0,
doc: /* Return a value indicating whether FILENAME is locked.
The value is nil if the FILENAME is not locked,
t if it is locked by you, else a string saying which user has locked it. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
Lisp_Object ret;
register char *lfname;
@@ -750,14 +729,14 @@ t if it is locked by you, else a string saying which user has locked it. */)
/* Initialization functions. */
void
-init_filelock ()
+init_filelock (void)
{
boot_time = 0;
boot_time_initialized = 0;
}
void
-syms_of_filelock ()
+syms_of_filelock (void)
{
DEFVAR_LISP ("temporary-file-directory", &Vtemporary_file_directory,
doc: /* The directory for writing temporary files. */);
diff --git a/src/filemode.c b/src/filemode.c
index 4a11d2a3115..3048077ff52 100644
--- a/src/filemode.c
+++ b/src/filemode.c
@@ -17,10 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <sys/types.h>
#include <sys/stat.h>
@@ -90,10 +87,10 @@
#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
#endif
-void mode_string ();
-static char ftypelet ();
-static void rwx ();
-static void setst ();
+void mode_string (short unsigned int mode, char *str);
+static char ftypelet (long int bits);
+static void rwx (short unsigned int bits, char *chars);
+static void setst (short unsigned int bits, char *chars);
/* filemodestring - fill in string STR with an ls-style ASCII
representation of the st_mode field of file stats block STATP.
@@ -132,9 +129,7 @@ static void setst ();
'T' if the file is sticky but not executable. */
void
-filemodestring (statp, str)
- struct stat *statp;
- char *str;
+filemodestring (struct stat *statp, char *str)
{
mode_string (statp->st_mode, str);
}
@@ -143,9 +138,7 @@ filemodestring (statp, str)
is given as an argument. */
void
-mode_string (mode, str)
- unsigned short mode;
- char *str;
+mode_string (short unsigned int mode, char *str)
{
str[0] = ftypelet ((long) mode);
rwx ((mode & 0700) << 0, &str[1]);
@@ -167,8 +160,7 @@ mode_string (mode, str)
'?' for any other file type. */
static char
-ftypelet (bits)
- long bits;
+ftypelet (long int bits)
{
#ifdef S_ISBLK
if (S_ISBLK (bits))
@@ -207,9 +199,7 @@ ftypelet (bits)
flags in CHARS accordingly. */
static void
-rwx (bits, chars)
- unsigned short bits;
- char *chars;
+rwx (short unsigned int bits, char *chars)
{
chars[0] = (bits & S_IRUSR) ? 'r' : '-';
chars[1] = (bits & S_IWUSR) ? 'w' : '-';
@@ -220,9 +210,7 @@ rwx (bits, chars)
according to the file mode BITS. */
static void
-setst (bits, chars)
- unsigned short bits;
- char *chars;
+setst (short unsigned int bits, char *chars)
{
#ifdef S_ISUID
if (bits & S_ISUID)
diff --git a/src/floatfns.c b/src/floatfns.c
index 5cd996d033c..4c1548cfd8f 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -70,7 +70,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* This declaration is omitted on some systems, like Ultrix. */
#if !defined (HPUX) && defined (HAVE_LOGB) && !defined (logb)
-extern double logb ();
+extern double logb (double);
#endif /* not HPUX and HAVE_LOGB and no logb macro */
#if defined(DOMAIN) && defined(SING) && defined(OVERFLOW)
@@ -192,8 +192,7 @@ static char *float_error_fn_name;
/* Extract a Lisp number as a `double', or signal an error. */
double
-extract_float (num)
- Lisp_Object num;
+extract_float (Lisp_Object num)
{
CHECK_NUMBER_OR_FLOAT (num);
@@ -206,8 +205,7 @@ extract_float (num)
DEFUN ("acos", Facos, Sacos, 1, 1, 0,
doc: /* Return the inverse cosine of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
#ifdef FLOAT_CHECK_DOMAIN
@@ -220,8 +218,7 @@ DEFUN ("acos", Facos, Sacos, 1, 1, 0,
DEFUN ("asin", Fasin, Sasin, 1, 1, 0,
doc: /* Return the inverse sine of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
#ifdef FLOAT_CHECK_DOMAIN
@@ -238,8 +235,7 @@ If only one argument Y is given, return the inverse tangent of Y.
If two arguments Y and X are given, return the inverse tangent of Y
divided by X, i.e. the angle in radians between the vector (X, Y)
and the x-axis. */)
- (y, x)
- register Lisp_Object y, x;
+ (register Lisp_Object y, Lisp_Object x)
{
double d = extract_float (y);
@@ -256,8 +252,7 @@ and the x-axis. */)
DEFUN ("cos", Fcos, Scos, 1, 1, 0,
doc: /* Return the cosine of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
IN_FLOAT (d = cos (d), "cos", arg);
@@ -266,8 +261,7 @@ DEFUN ("cos", Fcos, Scos, 1, 1, 0,
DEFUN ("sin", Fsin, Ssin, 1, 1, 0,
doc: /* Return the sine of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
IN_FLOAT (d = sin (d), "sin", arg);
@@ -276,8 +270,7 @@ DEFUN ("sin", Fsin, Ssin, 1, 1, 0,
DEFUN ("tan", Ftan, Stan, 1, 1, 0,
doc: /* Return the tangent of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
double c = cos (d);
@@ -292,8 +285,7 @@ DEFUN ("tan", Ftan, Stan, 1, 1, 0,
#if defined HAVE_ISNAN && defined HAVE_COPYSIGN
DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0,
doc: /* Return non nil iff argument X is a NaN. */)
- (x)
- Lisp_Object x;
+ (Lisp_Object x)
{
CHECK_FLOAT (x);
return isnan (XFLOAT_DATA (x)) ? Qt : Qnil;
@@ -302,8 +294,7 @@ DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0,
DEFUN ("copysign", Fcopysign, Scopysign, 1, 2, 0,
doc: /* Copy sign of X2 to value of X1, and return the result.
Cause an error if X1 or X2 is not a float. */)
- (x1, x2)
- Lisp_Object x1, x2;
+ (Lisp_Object x1, Lisp_Object x2)
{
double f1, f2;
@@ -326,8 +317,7 @@ and an integral exponent EXP for 2, such that:
The function returns the cons cell (SGNFCAND . EXP).
If X is zero, both parts (SGNFCAND and EXP) are zero. */)
- (x)
- Lisp_Object x;
+ (Lisp_Object x)
{
double f = XFLOATINT (x);
@@ -345,8 +335,7 @@ DEFUN ("ldexp", Fldexp, Sldexp, 1, 2, 0,
doc: /* Construct number X from significand SGNFCAND and exponent EXP.
Returns the floating point value resulting from multiplying SGNFCAND
(the significand) by 2 raised to the power of EXP (the exponent). */)
- (sgnfcand, exp)
- Lisp_Object sgnfcand, exp;
+ (Lisp_Object sgnfcand, Lisp_Object exp)
{
CHECK_NUMBER (exp);
return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exp)));
@@ -357,8 +346,7 @@ Returns the floating point value resulting from multiplying SGNFCAND
DEFUN ("bessel-j0", Fbessel_j0, Sbessel_j0, 1, 1, 0,
doc: /* Return the bessel function j0 of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
IN_FLOAT (d = j0 (d), "bessel-j0", arg);
@@ -367,8 +355,7 @@ DEFUN ("bessel-j0", Fbessel_j0, Sbessel_j0, 1, 1, 0,
DEFUN ("bessel-j1", Fbessel_j1, Sbessel_j1, 1, 1, 0,
doc: /* Return the bessel function j1 of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
IN_FLOAT (d = j1 (d), "bessel-j1", arg);
@@ -378,8 +365,7 @@ DEFUN ("bessel-j1", Fbessel_j1, Sbessel_j1, 1, 1, 0,
DEFUN ("bessel-jn", Fbessel_jn, Sbessel_jn, 2, 2, 0,
doc: /* Return the order N bessel function output jn of ARG.
The first arg (the order) is truncated to an integer. */)
- (n, arg)
- register Lisp_Object n, arg;
+ (register Lisp_Object n, Lisp_Object arg)
{
int i1 = extract_float (n);
double f2 = extract_float (arg);
@@ -390,8 +376,7 @@ The first arg (the order) is truncated to an integer. */)
DEFUN ("bessel-y0", Fbessel_y0, Sbessel_y0, 1, 1, 0,
doc: /* Return the bessel function y0 of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
IN_FLOAT (d = y0 (d), "bessel-y0", arg);
@@ -400,8 +385,7 @@ DEFUN ("bessel-y0", Fbessel_y0, Sbessel_y0, 1, 1, 0,
DEFUN ("bessel-y1", Fbessel_y1, Sbessel_y1, 1, 1, 0,
doc: /* Return the bessel function y1 of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
IN_FLOAT (d = y1 (d), "bessel-y0", arg);
@@ -411,8 +395,7 @@ DEFUN ("bessel-y1", Fbessel_y1, Sbessel_y1, 1, 1, 0,
DEFUN ("bessel-yn", Fbessel_yn, Sbessel_yn, 2, 2, 0,
doc: /* Return the order N bessel function output yn of ARG.
The first arg (the order) is truncated to an integer. */)
- (n, arg)
- register Lisp_Object n, arg;
+ (register Lisp_Object n, Lisp_Object arg)
{
int i1 = extract_float (n);
double f2 = extract_float (arg);
@@ -427,8 +410,7 @@ The first arg (the order) is truncated to an integer. */)
DEFUN ("erf", Ferf, Serf, 1, 1, 0,
doc: /* Return the mathematical error function of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
IN_FLOAT (d = erf (d), "erf", arg);
@@ -437,8 +419,7 @@ DEFUN ("erf", Ferf, Serf, 1, 1, 0,
DEFUN ("erfc", Ferfc, Serfc, 1, 1, 0,
doc: /* Return the complementary error function of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
IN_FLOAT (d = erfc (d), "erfc", arg);
@@ -447,8 +428,7 @@ DEFUN ("erfc", Ferfc, Serfc, 1, 1, 0,
DEFUN ("log-gamma", Flog_gamma, Slog_gamma, 1, 1, 0,
doc: /* Return the log gamma of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
IN_FLOAT (d = lgamma (d), "log-gamma", arg);
@@ -457,8 +437,7 @@ DEFUN ("log-gamma", Flog_gamma, Slog_gamma, 1, 1, 0,
DEFUN ("cube-root", Fcube_root, Scube_root, 1, 1, 0,
doc: /* Return the cube root of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
#ifdef HAVE_CBRT
@@ -476,8 +455,7 @@ DEFUN ("cube-root", Fcube_root, Scube_root, 1, 1, 0,
DEFUN ("exp", Fexp, Sexp, 1, 1, 0,
doc: /* Return the exponential base e of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
#ifdef FLOAT_CHECK_DOMAIN
@@ -493,8 +471,7 @@ DEFUN ("exp", Fexp, Sexp, 1, 1, 0,
DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
doc: /* Return the exponential ARG1 ** ARG2. */)
- (arg1, arg2)
- register Lisp_Object arg1, arg2;
+ (register Lisp_Object arg1, Lisp_Object arg2)
{
double f1, f2, f3;
@@ -552,8 +529,7 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
DEFUN ("log", Flog, Slog, 1, 2, 0,
doc: /* Return the natural logarithm of ARG.
If the optional argument BASE is given, return log ARG using that base. */)
- (arg, base)
- register Lisp_Object arg, base;
+ (register Lisp_Object arg, Lisp_Object base)
{
double d = extract_float (arg);
@@ -581,8 +557,7 @@ If the optional argument BASE is given, return log ARG using that base. */)
DEFUN ("log10", Flog10, Slog10, 1, 1, 0,
doc: /* Return the logarithm base 10 of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
#ifdef FLOAT_CHECK_DOMAIN
@@ -595,8 +570,7 @@ DEFUN ("log10", Flog10, Slog10, 1, 1, 0,
DEFUN ("sqrt", Fsqrt, Ssqrt, 1, 1, 0,
doc: /* Return the square root of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
#ifdef FLOAT_CHECK_DOMAIN
@@ -611,8 +585,7 @@ DEFUN ("sqrt", Fsqrt, Ssqrt, 1, 1, 0,
DEFUN ("acosh", Facosh, Sacosh, 1, 1, 0,
doc: /* Return the inverse hyperbolic cosine of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
#ifdef FLOAT_CHECK_DOMAIN
@@ -629,8 +602,7 @@ DEFUN ("acosh", Facosh, Sacosh, 1, 1, 0,
DEFUN ("asinh", Fasinh, Sasinh, 1, 1, 0,
doc: /* Return the inverse hyperbolic sine of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
#ifdef HAVE_INVERSE_HYPERBOLIC
@@ -643,8 +615,7 @@ DEFUN ("asinh", Fasinh, Sasinh, 1, 1, 0,
DEFUN ("atanh", Fatanh, Satanh, 1, 1, 0,
doc: /* Return the inverse hyperbolic tangent of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
#ifdef FLOAT_CHECK_DOMAIN
@@ -661,8 +632,7 @@ DEFUN ("atanh", Fatanh, Satanh, 1, 1, 0,
DEFUN ("cosh", Fcosh, Scosh, 1, 1, 0,
doc: /* Return the hyperbolic cosine of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
#ifdef FLOAT_CHECK_DOMAIN
@@ -675,8 +645,7 @@ DEFUN ("cosh", Fcosh, Scosh, 1, 1, 0,
DEFUN ("sinh", Fsinh, Ssinh, 1, 1, 0,
doc: /* Return the hyperbolic sine of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
#ifdef FLOAT_CHECK_DOMAIN
@@ -689,8 +658,7 @@ DEFUN ("sinh", Fsinh, Ssinh, 1, 1, 0,
DEFUN ("tanh", Ftanh, Stanh, 1, 1, 0,
doc: /* Return the hyperbolic tangent of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
IN_FLOAT (d = tanh (d), "tanh", arg);
@@ -700,8 +668,7 @@ DEFUN ("tanh", Ftanh, Stanh, 1, 1, 0,
DEFUN ("abs", Fabs, Sabs, 1, 1, 0,
doc: /* Return the absolute value of ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
CHECK_NUMBER_OR_FLOAT (arg);
@@ -715,8 +682,7 @@ DEFUN ("abs", Fabs, Sabs, 1, 1, 0,
DEFUN ("float", Ffloat, Sfloat, 1, 1, 0,
doc: /* Return the floating point number equal to ARG. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
CHECK_NUMBER_OR_FLOAT (arg);
@@ -729,8 +695,7 @@ DEFUN ("float", Ffloat, Sfloat, 1, 1, 0,
DEFUN ("logb", Flogb, Slogb, 1, 1, 0,
doc: /* Returns largest integer <= the base 2 log of the magnitude of ARG.
This is the same as the exponent of a float. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
Lisp_Object val;
EMACS_INT value;
@@ -778,11 +743,10 @@ This is the same as the exponent of a float. */)
/* the rounding functions */
static Lisp_Object
-rounding_driver (arg, divisor, double_round, int_round2, name)
- register Lisp_Object arg, divisor;
- double (*double_round) ();
- EMACS_INT (*int_round2) ();
- char *name;
+rounding_driver (Lisp_Object arg, Lisp_Object divisor,
+ double (*double_round) (double),
+ EMACS_INT (*int_round2) (EMACS_INT, EMACS_INT),
+ char *name)
{
CHECK_NUMBER_OR_FLOAT (arg);
@@ -832,8 +796,7 @@ rounding_driver (arg, divisor, double_round, int_round2, name)
integer functions. */
static EMACS_INT
-ceiling2 (i1, i2)
- EMACS_INT i1, i2;
+ceiling2 (EMACS_INT i1, EMACS_INT i2)
{
return (i2 < 0
? (i1 < 0 ? ((-1 - i1) / -i2) + 1 : - (i1 / -i2))
@@ -841,8 +804,7 @@ ceiling2 (i1, i2)
}
static EMACS_INT
-floor2 (i1, i2)
- EMACS_INT i1, i2;
+floor2 (EMACS_INT i1, EMACS_INT i2)
{
return (i2 < 0
? (i1 <= 0 ? -i1 / -i2 : -1 - ((i1 - 1) / -i2))
@@ -850,8 +812,7 @@ floor2 (i1, i2)
}
static EMACS_INT
-truncate2 (i1, i2)
- EMACS_INT i1, i2;
+truncate2 (EMACS_INT i1, EMACS_INT i2)
{
return (i2 < 0
? (i1 < 0 ? -i1 / -i2 : - (i1 / -i2))
@@ -859,8 +820,7 @@ truncate2 (i1, i2)
}
static EMACS_INT
-round2 (i1, i2)
- EMACS_INT i1, i2;
+round2 (EMACS_INT i1, EMACS_INT i2)
{
/* The C language's division operator gives us one remainder R, but
we want the remainder R1 on the other side of 0 if R1 is closer
@@ -880,16 +840,14 @@ round2 (i1, i2)
#define emacs_rint rint
#else
static double
-emacs_rint (d)
- double d;
+emacs_rint (double d)
{
return floor (d + 0.5);
}
#endif
static double
-double_identity (d)
- double d;
+double_identity (double d)
{
return d;
}
@@ -898,8 +856,7 @@ DEFUN ("ceiling", Fceiling, Sceiling, 1, 2, 0,
doc: /* Return the smallest integer no less than ARG.
This rounds the value towards +inf.
With optional DIVISOR, return the smallest integer no less than ARG/DIVISOR. */)
- (arg, divisor)
- Lisp_Object arg, divisor;
+ (Lisp_Object arg, Lisp_Object divisor)
{
return rounding_driver (arg, divisor, ceil, ceiling2, "ceiling");
}
@@ -908,8 +865,7 @@ DEFUN ("floor", Ffloor, Sfloor, 1, 2, 0,
doc: /* Return the largest integer no greater than ARG.
This rounds the value towards -inf.
With optional DIVISOR, return the largest integer no greater than ARG/DIVISOR. */)
- (arg, divisor)
- Lisp_Object arg, divisor;
+ (Lisp_Object arg, Lisp_Object divisor)
{
return rounding_driver (arg, divisor, floor, floor2, "floor");
}
@@ -922,8 +878,7 @@ Rounding a value equidistant between two integers may choose the
integer closer to zero, or it may prefer an even integer, depending on
your machine. For example, \(round 2.5\) can return 3 on some
systems, but 2 on others. */)
- (arg, divisor)
- Lisp_Object arg, divisor;
+ (Lisp_Object arg, Lisp_Object divisor)
{
return rounding_driver (arg, divisor, emacs_rint, round2, "round");
}
@@ -932,8 +887,7 @@ DEFUN ("truncate", Ftruncate, Struncate, 1, 2, 0,
doc: /* Truncate a floating point number to an int.
Rounds ARG toward zero.
With optional DIVISOR, truncate ARG/DIVISOR. */)
- (arg, divisor)
- Lisp_Object arg, divisor;
+ (Lisp_Object arg, Lisp_Object divisor)
{
return rounding_driver (arg, divisor, double_identity, truncate2,
"truncate");
@@ -941,8 +895,7 @@ With optional DIVISOR, truncate ARG/DIVISOR. */)
Lisp_Object
-fmod_float (x, y)
- register Lisp_Object x, y;
+fmod_float (Lisp_Object x, Lisp_Object y)
{
double f1, f2;
@@ -964,8 +917,7 @@ fmod_float (x, y)
DEFUN ("fceiling", Ffceiling, Sfceiling, 1, 1, 0,
doc: /* Return the smallest integer no less than ARG, as a float.
\(Round toward +inf.\) */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
IN_FLOAT (d = ceil (d), "fceiling", arg);
@@ -975,8 +927,7 @@ DEFUN ("fceiling", Ffceiling, Sfceiling, 1, 1, 0,
DEFUN ("ffloor", Fffloor, Sffloor, 1, 1, 0,
doc: /* Return the largest integer no greater than ARG, as a float.
\(Round towards -inf.\) */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
IN_FLOAT (d = floor (d), "ffloor", arg);
@@ -985,8 +936,7 @@ DEFUN ("ffloor", Fffloor, Sffloor, 1, 1, 0,
DEFUN ("fround", Ffround, Sfround, 1, 1, 0,
doc: /* Return the nearest integer to ARG, as a float. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
IN_FLOAT (d = emacs_rint (d), "fround", arg);
@@ -996,8 +946,7 @@ DEFUN ("fround", Ffround, Sfround, 1, 1, 0,
DEFUN ("ftruncate", Fftruncate, Sftruncate, 1, 1, 0,
doc: /* Truncate a floating point number to an integral float value.
Rounds the value toward zero. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
double d = extract_float (arg);
if (d >= 0.0)
@@ -1035,8 +984,7 @@ float_error (signo)
#ifdef HAVE_MATHERR
int
-matherr (x)
- struct exception *x;
+matherr (struct exception *x)
{
Lisp_Object args;
if (! in_float)
@@ -1064,7 +1012,7 @@ matherr (x)
#endif /* HAVE_MATHERR */
void
-init_floatfns ()
+init_floatfns (void)
{
#ifdef FLOAT_CATCH_SIGILL
signal (SIGILL, float_error);
@@ -1073,7 +1021,7 @@ init_floatfns ()
}
void
-syms_of_floatfns ()
+syms_of_floatfns (void)
{
defsubr (&Sacos);
defsubr (&Sasin);
diff --git a/src/fns.c b/src/fns.c
index 9569c214268..c02f5584a8f 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -74,10 +74,10 @@ Lisp_Object Qcodeset, Qdays, Qmonths, Qpaper;
extern Lisp_Object Qinput_method_function;
-static int internal_equal P_ ((Lisp_Object , Lisp_Object, int, int));
+static int internal_equal (Lisp_Object , Lisp_Object, int, int);
-extern long get_random ();
-extern void seed_random P_ ((long));
+extern long get_random (void);
+extern void seed_random (long);
#ifndef HAVE_UNISTD_H
extern long time ();
@@ -85,8 +85,7 @@ extern long time ();
DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0,
doc: /* Return the argument unchanged. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
return arg;
}
@@ -98,8 +97,7 @@ All integers representable in Lisp are equally likely.
With positive integer LIMIT, return random number in interval [0,LIMIT).
With argument t, set the random number seed from the current time and pid.
Other values of LIMIT are ignored. */)
- (limit)
- Lisp_Object limit;
+ (Lisp_Object limit)
{
EMACS_INT val;
Lisp_Object lispy_val;
@@ -135,8 +133,7 @@ A byte-code function object is also allowed.
If the string contains multibyte characters, this is not necessarily
the number of bytes in the string; it is the number of characters.
To get the number of bytes, use `string-bytes'. */)
- (sequence)
- register Lisp_Object sequence;
+ (register Lisp_Object sequence)
{
register Lisp_Object val;
register int i;
@@ -186,8 +183,7 @@ DEFUN ("safe-length", Fsafe_length, Ssafe_length, 1, 1, 0,
This function never gets an error. If LIST is not really a list,
it returns 0. If LIST is circular, it returns a finite value
which is at least the number of distinct elements. */)
- (list)
- Lisp_Object list;
+ (Lisp_Object list)
{
Lisp_Object tail, halftail, length;
int len = 0;
@@ -210,8 +206,7 @@ which is at least the number of distinct elements. */)
DEFUN ("string-bytes", Fstring_bytes, Sstring_bytes, 1, 1, 0,
doc: /* Return the number of bytes in STRING.
If STRING is multibyte, this may be greater than the length of STRING. */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
CHECK_STRING (string);
return make_number (SBYTES (string));
@@ -221,8 +216,7 @@ DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0,
doc: /* Return t if two strings have identical contents.
Case is significant, but text properties are ignored.
Symbols are also allowed; their print names are used instead. */)
- (s1, s2)
- register Lisp_Object s1, s2;
+ (register Lisp_Object s1, Lisp_Object s2)
{
if (SYMBOLP (s1))
s1 = SYMBOL_NAME (s1);
@@ -233,7 +227,7 @@ Symbols are also allowed; their print names are used instead. */)
if (SCHARS (s1) != SCHARS (s2)
|| SBYTES (s1) != SBYTES (s2)
- || bcmp (SDATA (s1), SDATA (s2), SBYTES (s1)))
+ || memcmp (SDATA (s1), SDATA (s2), SBYTES (s1)))
return Qnil;
return Qt;
}
@@ -253,8 +247,7 @@ If string STR1 is less, the value is a negative number N;
- 1 - N is the number of characters that match at the beginning.
If string STR1 is greater, the value is a positive number N;
N - 1 is the number of characters that match at the beginning. */)
- (str1, start1, end1, str2, start2, end2, ignore_case)
- Lisp_Object str1, start1, end1, start2, str2, end2, ignore_case;
+ (Lisp_Object str1, Lisp_Object start1, Lisp_Object end1, Lisp_Object str2, Lisp_Object start2, Lisp_Object end2, Lisp_Object ignore_case)
{
register int end1_char, end2_char;
register int i1, i1_byte, i2, i2_byte;
@@ -345,8 +338,7 @@ DEFUN ("string-lessp", Fstring_lessp, Sstring_lessp, 2, 2, 0,
doc: /* Return t if first arg string is less than second in lexicographic order.
Case is significant.
Symbols are also allowed; their print names are used instead. */)
- (s1, s2)
- register Lisp_Object s1, s2;
+ (register Lisp_Object s1, Lisp_Object s2)
{
register int end;
register int i1, i1_byte, i2, i2_byte;
@@ -379,19 +371,12 @@ Symbols are also allowed; their print names are used instead. */)
return i1 < SCHARS (s2) ? Qt : Qnil;
}
-#if __GNUC__
-/* "gcc -O3" enables automatic function inlining, which optimizes out
- the arguments for the invocations of this function, whereas it
- expects these values on the stack. */
-static Lisp_Object concat P_ ((int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_special)) __attribute__((noinline));
-#else /* !__GNUC__ */
-static Lisp_Object concat P_ ((int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_special));
-#endif
+static Lisp_Object concat (int nargs, Lisp_Object *args,
+ enum Lisp_Type target_type, int last_special);
/* ARGSUSED */
Lisp_Object
-concat2 (s1, s2)
- Lisp_Object s1, s2;
+concat2 (Lisp_Object s1, Lisp_Object s2)
{
Lisp_Object args[2];
args[0] = s1;
@@ -401,8 +386,7 @@ concat2 (s1, s2)
/* ARGSUSED */
Lisp_Object
-concat3 (s1, s2, s3)
- Lisp_Object s1, s2, s3;
+concat3 (Lisp_Object s1, Lisp_Object s2, Lisp_Object s3)
{
Lisp_Object args[3];
args[0] = s1;
@@ -417,9 +401,7 @@ The result is a list whose elements are the elements of all the arguments.
Each argument may be a list, vector or string.
The last argument is not copied, just used as the tail of the new list.
usage: (append &rest SEQUENCES) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
return concat (nargs, args, Lisp_Cons, 1);
}
@@ -429,9 +411,7 @@ DEFUN ("concat", Fconcat, Sconcat, 0, MANY, 0,
The result is a string whose elements are the elements of all the arguments.
Each argument may be a string or a list or vector of characters (integers).
usage: (concat &rest SEQUENCES) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
return concat (nargs, args, Lisp_String, 0);
}
@@ -441,9 +421,7 @@ DEFUN ("vconcat", Fvconcat, Svconcat, 0, MANY, 0,
The result is a vector whose elements are the elements of all the arguments.
Each argument may be a list, vector or string.
usage: (vconcat &rest SEQUENCES) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
return concat (nargs, args, Lisp_Vectorlike, 0);
}
@@ -453,8 +431,7 @@ DEFUN ("copy-sequence", Fcopy_sequence, Scopy_sequence, 1, 1, 0,
doc: /* Return a copy of a list, vector, string or char-table.
The elements of a list or vector are not copied; they are shared
with the original. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
if (NILP (arg)) return arg;
@@ -471,8 +448,8 @@ with the original. */)
/ BOOL_VECTOR_BITS_PER_CHAR);
val = Fmake_bool_vector (Flength (arg), Qnil);
- bcopy (XBOOL_VECTOR (arg)->data, XBOOL_VECTOR (val)->data,
- size_in_chars);
+ memcpy (XBOOL_VECTOR (val)->data, XBOOL_VECTOR (arg)->data,
+ size_in_chars);
return val;
}
@@ -492,11 +469,7 @@ struct textprop_rec
};
static Lisp_Object
-concat (nargs, args, target_type, last_special)
- int nargs;
- Lisp_Object *args;
- enum Lisp_Type target_type;
- int last_special;
+concat (int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_special)
{
Lisp_Object val;
register Lisp_Object tail;
@@ -643,8 +616,7 @@ concat (nargs, args, target_type, last_special)
{
int thislen_byte = SBYTES (this);
- bcopy (SDATA (this), SDATA (val) + toindex_byte,
- SBYTES (this));
+ memcpy (SDATA (val) + toindex_byte, SDATA (this), SBYTES (this));
if (! NULL_INTERVAL_P (STRING_INTERVALS (this)))
{
textprops[num_textprops].argnum = argnum;
@@ -777,7 +749,7 @@ static EMACS_INT string_char_byte_cache_charpos;
static EMACS_INT string_char_byte_cache_bytepos;
void
-clear_string_char_byte_cache ()
+clear_string_char_byte_cache (void)
{
string_char_byte_cache_string = Qnil;
}
@@ -785,9 +757,7 @@ clear_string_char_byte_cache ()
/* Return the byte index corresponding to CHAR_INDEX in STRING. */
EMACS_INT
-string_char_to_byte (string, char_index)
- Lisp_Object string;
- EMACS_INT char_index;
+string_char_to_byte (Lisp_Object string, EMACS_INT char_index)
{
EMACS_INT i_byte;
EMACS_INT best_below, best_below_byte;
@@ -847,9 +817,7 @@ string_char_to_byte (string, char_index)
/* Return the character index corresponding to BYTE_INDEX in STRING. */
EMACS_INT
-string_byte_to_char (string, byte_index)
- Lisp_Object string;
- EMACS_INT byte_index;
+string_byte_to_char (Lisp_Object string, EMACS_INT byte_index)
{
EMACS_INT i, i_byte;
EMACS_INT best_below, best_below_byte;
@@ -913,8 +881,7 @@ string_byte_to_char (string, byte_index)
/* Convert STRING to a multibyte string. */
Lisp_Object
-string_make_multibyte (string)
- Lisp_Object string;
+string_make_multibyte (Lisp_Object string)
{
unsigned char *buf;
EMACS_INT nbytes;
@@ -947,8 +914,7 @@ string_make_multibyte (string)
converted to eight-bit characters. */
Lisp_Object
-string_to_multibyte (string)
- Lisp_Object string;
+string_to_multibyte (Lisp_Object string)
{
unsigned char *buf;
EMACS_INT nbytes;
@@ -965,7 +931,7 @@ string_to_multibyte (string)
return make_multibyte_string (SDATA (string), nbytes, nbytes);
SAFE_ALLOCA (buf, unsigned char *, nbytes);
- bcopy (SDATA (string), buf, SBYTES (string));
+ memcpy (buf, SDATA (string), SBYTES (string));
str_to_multibyte (buf, nbytes, SBYTES (string));
ret = make_multibyte_string (buf, SCHARS (string), nbytes);
@@ -978,8 +944,7 @@ string_to_multibyte (string)
/* Convert STRING to a single-byte string. */
Lisp_Object
-string_make_unibyte (string)
- Lisp_Object string;
+string_make_unibyte (Lisp_Object string)
{
int nchars;
unsigned char *buf;
@@ -1012,8 +977,7 @@ or entirely ASCII, it is returned unchanged. In particular, when
STRING is unibyte and entirely ASCII, the returned string is unibyte.
\(When the characters are all ASCII, Emacs primitives will treat the
string the same way whether it is unibyte or multibyte.) */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
CHECK_STRING (string);
@@ -1027,8 +991,7 @@ Multibyte character codes are converted to unibyte according to
`nonascii-translation-table' or, if that is nil, `nonascii-insert-offset'.
If the lookup in the translation table fails, this function takes just
the low 8 bits of each character. */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
CHECK_STRING (string);
@@ -1042,8 +1005,7 @@ If STRING is unibyte, the result is STRING itself.
Otherwise it is a newly created string, with no text properties.
If STRING is multibyte and contains a character of charset
`eight-bit', it is converted to the corresponding single byte. */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
CHECK_STRING (string);
@@ -1052,7 +1014,7 @@ If STRING is multibyte and contains a character of charset
int bytes = SBYTES (string);
unsigned char *str = (unsigned char *) xmalloc (bytes);
- bcopy (SDATA (string), str, bytes);
+ memcpy (str, SDATA (string), bytes);
bytes = str_as_unibyte (str, bytes);
string = make_unibyte_string (str, bytes);
xfree (str);
@@ -1075,8 +1037,7 @@ Beware, this often doesn't really do what you think it does.
It is similar to (decode-coding-string STRING 'utf-8-emacs).
If you're not sure, whether to use `string-as-multibyte' or
`string-to-multibyte', use `string-to-multibyte'. */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
CHECK_STRING (string);
@@ -1089,8 +1050,7 @@ If you're not sure, whether to use `string-as-multibyte' or
SBYTES (string),
&nchars, &nbytes);
new_string = make_uninit_multibyte_string (nchars, nbytes);
- bcopy (SDATA (string), SDATA (new_string),
- SBYTES (string));
+ memcpy (SDATA (new_string), SDATA (string), SBYTES (string));
if (nbytes != SBYTES (string))
str_as_multibyte (SDATA (new_string), nbytes,
SBYTES (string), NULL);
@@ -1112,8 +1072,7 @@ the corresponding multibyte character of charset `eight-bit'.
This differs from `string-as-multibyte' by converting each byte of a correct
utf-8 sequence to an eight-bit character, not just bytes that don't form a
correct sequence. */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
CHECK_STRING (string);
@@ -1128,8 +1087,7 @@ Otherwise it is a newly created string, with no text properties,
where each `eight-bit' character is converted to the corresponding byte.
If STRING contains a non-ASCII, non-`eight-bit' character,
an error is signaled. */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
CHECK_STRING (string);
@@ -1155,8 +1113,7 @@ but does not share the alist structure with ALIST.
The objects mapped (cars and cdrs of elements of the alist)
are shared, however.
Elements of ALIST that are not conses are also shared. */)
- (alist)
- Lisp_Object alist;
+ (Lisp_Object alist)
{
register Lisp_Object tem;
@@ -1186,9 +1143,7 @@ to the end of STRING.
The STRING argument may also be a vector. In that case, the return
value is a new vector that contains the elements between index FROM
\(inclusive) and index TO (exclusive) of that vector argument. */)
- (string, from, to)
- Lisp_Object string;
- register Lisp_Object from, to;
+ (Lisp_Object string, register Lisp_Object from, Lisp_Object to)
{
Lisp_Object res;
int size;
@@ -1257,9 +1212,7 @@ If FROM is nil or omitted, the substring starts at the beginning of STRING.
If FROM or TO is negative, it counts from the end.
With one argument, just copy STRING without its properties. */)
- (string, from, to)
- Lisp_Object string;
- register Lisp_Object from, to;
+ (Lisp_Object string, register Lisp_Object from, Lisp_Object to)
{
int size, size_byte;
int from_char, to_char;
@@ -1311,9 +1264,7 @@ With one argument, just copy STRING without its properties. */)
both in characters and in bytes. */
Lisp_Object
-substring_both (string, from, from_byte, to, to_byte)
- Lisp_Object string;
- int from, from_byte, to, to_byte;
+substring_both (Lisp_Object string, int from, int from_byte, int to, int to_byte)
{
Lisp_Object res;
int size;
@@ -1348,9 +1299,7 @@ substring_both (string, from, from_byte, to, to_byte)
DEFUN ("nthcdr", Fnthcdr, Snthcdr, 2, 2, 0,
doc: /* Take cdr N times on LIST, returns the result. */)
- (n, list)
- Lisp_Object n;
- register Lisp_Object list;
+ (Lisp_Object n, Lisp_Object list)
{
register int i, num;
CHECK_NUMBER (n);
@@ -1367,16 +1316,14 @@ DEFUN ("nthcdr", Fnthcdr, Snthcdr, 2, 2, 0,
DEFUN ("nth", Fnth, Snth, 2, 2, 0,
doc: /* Return the Nth element of LIST.
N counts from zero. If LIST is not that long, nil is returned. */)
- (n, list)
- Lisp_Object n, list;
+ (Lisp_Object n, Lisp_Object list)
{
return Fcar (Fnthcdr (n, list));
}
DEFUN ("elt", Felt, Selt, 2, 2, 0,
doc: /* Return element of SEQUENCE at index N. */)
- (sequence, n)
- register Lisp_Object sequence, n;
+ (register Lisp_Object sequence, Lisp_Object n)
{
CHECK_NUMBER (n);
if (CONSP (sequence) || NILP (sequence))
@@ -1392,9 +1339,7 @@ DEFUN ("elt", Felt, Selt, 2, 2, 0,
DEFUN ("member", Fmember, Smember, 2, 2, 0,
doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `equal'.
The value is actually the tail of LIST whose car is ELT. */)
- (elt, list)
- register Lisp_Object elt;
- Lisp_Object list;
+ (register Lisp_Object elt, Lisp_Object list)
{
register Lisp_Object tail;
for (tail = list; CONSP (tail); tail = XCDR (tail))
@@ -1412,8 +1357,7 @@ The value is actually the tail of LIST whose car is ELT. */)
DEFUN ("memq", Fmemq, Smemq, 2, 2, 0,
doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eq'.
The value is actually the tail of LIST whose car is ELT. */)
- (elt, list)
- register Lisp_Object elt, list;
+ (register Lisp_Object elt, Lisp_Object list)
{
while (1)
{
@@ -1439,9 +1383,7 @@ The value is actually the tail of LIST whose car is ELT. */)
DEFUN ("memql", Fmemql, Smemql, 2, 2, 0,
doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eql'.
The value is actually the tail of LIST whose car is ELT. */)
- (elt, list)
- register Lisp_Object elt;
- Lisp_Object list;
+ (register Lisp_Object elt, Lisp_Object list)
{
register Lisp_Object tail;
@@ -1464,8 +1406,7 @@ DEFUN ("assq", Fassq, Sassq, 2, 2, 0,
doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST.
The value is actually the first element of LIST whose car is KEY.
Elements of LIST that are not conses are ignored. */)
- (key, list)
- Lisp_Object key, list;
+ (Lisp_Object key, Lisp_Object list)
{
while (1)
{
@@ -1497,8 +1438,7 @@ Elements of LIST that are not conses are ignored. */)
Use only on lists known never to be circular. */
Lisp_Object
-assq_no_quit (key, list)
- Lisp_Object key, list;
+assq_no_quit (Lisp_Object key, Lisp_Object list)
{
while (CONSP (list)
&& (!CONSP (XCAR (list))
@@ -1511,8 +1451,7 @@ assq_no_quit (key, list)
DEFUN ("assoc", Fassoc, Sassoc, 2, 2, 0,
doc: /* Return non-nil if KEY is `equal' to the car of an element of LIST.
The value is actually the first element of LIST whose car equals KEY. */)
- (key, list)
- Lisp_Object key, list;
+ (Lisp_Object key, Lisp_Object list)
{
Lisp_Object car;
@@ -1549,8 +1488,7 @@ The value is actually the first element of LIST whose car equals KEY. */)
Use only on lists known never to be circular. */
Lisp_Object
-assoc_no_quit (key, list)
- Lisp_Object key, list;
+assoc_no_quit (Lisp_Object key, Lisp_Object list)
{
while (CONSP (list)
&& (!CONSP (XCAR (list))
@@ -1564,9 +1502,7 @@ assoc_no_quit (key, list)
DEFUN ("rassq", Frassq, Srassq, 2, 2, 0,
doc: /* Return non-nil if KEY is `eq' to the cdr of an element of LIST.
The value is actually the first element of LIST whose cdr is KEY. */)
- (key, list)
- register Lisp_Object key;
- Lisp_Object list;
+ (register Lisp_Object key, Lisp_Object list)
{
while (1)
{
@@ -1597,8 +1533,7 @@ The value is actually the first element of LIST whose cdr is KEY. */)
DEFUN ("rassoc", Frassoc, Srassoc, 2, 2, 0,
doc: /* Return non-nil if KEY is `equal' to the cdr of an element of LIST.
The value is actually the first element of LIST whose cdr equals KEY. */)
- (key, list)
- Lisp_Object key, list;
+ (Lisp_Object key, Lisp_Object list)
{
Lisp_Object cdr;
@@ -1637,9 +1572,7 @@ The modified LIST is returned. Comparison is done with `eq'.
If the first member of LIST is ELT, there is no way to remove it by side effect;
therefore, write `(setq foo (delq element foo))'
to be sure of changing the value of `foo'. */)
- (elt, list)
- register Lisp_Object elt;
- Lisp_Object list;
+ (register Lisp_Object elt, Lisp_Object list)
{
register Lisp_Object tail, prev;
register Lisp_Object tem;
@@ -1673,8 +1606,7 @@ If SEQ is not a list, or the first member of SEQ is ELT, deleting it
is not a side effect; it is simply using a different sequence.
Therefore, write `(setq foo (delete element foo))'
to be sure of changing the value of `foo'. */)
- (elt, seq)
- Lisp_Object elt, seq;
+ (Lisp_Object elt, Lisp_Object seq)
{
if (VECTORP (seq))
{
@@ -1789,8 +1721,7 @@ to be sure of changing the value of `foo'. */)
DEFUN ("nreverse", Fnreverse, Snreverse, 1, 1, 0,
doc: /* Reverse LIST by modifying cdr pointers.
Return the reversed list. */)
- (list)
- Lisp_Object list;
+ (Lisp_Object list)
{
register Lisp_Object prev, tail, next;
@@ -1812,8 +1743,7 @@ Return the reversed list. */)
DEFUN ("reverse", Freverse, Sreverse, 1, 1, 0,
doc: /* Reverse LIST, copying. Return the reversed list.
See also the function `nreverse', which is used more often. */)
- (list)
- Lisp_Object list;
+ (Lisp_Object list)
{
Lisp_Object new;
@@ -1826,15 +1756,14 @@ See also the function `nreverse', which is used more often. */)
return new;
}
-Lisp_Object merge ();
+Lisp_Object merge (Lisp_Object org_l1, Lisp_Object org_l2, Lisp_Object pred);
DEFUN ("sort", Fsort, Ssort, 2, 2, 0,
doc: /* Sort LIST, stably, comparing elements using PREDICATE.
Returns the sorted list. LIST is modified by side effects.
PREDICATE is called with two elements of LIST, and should return non-nil
if the first element should sort before the second. */)
- (list, predicate)
- Lisp_Object list, predicate;
+ (Lisp_Object list, Lisp_Object predicate)
{
Lisp_Object front, back;
register Lisp_Object len, tem;
@@ -1860,9 +1789,7 @@ if the first element should sort before the second. */)
}
Lisp_Object
-merge (org_l1, org_l2, pred)
- Lisp_Object org_l1, org_l2;
- Lisp_Object pred;
+merge (Lisp_Object org_l1, Lisp_Object org_l2, Lisp_Object pred)
{
Lisp_Object value;
register Lisp_Object tail;
@@ -1928,9 +1855,7 @@ PLIST is a property list, which is a list of the form
\(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value
corresponding to the given PROP, or nil if PROP is not one of the
properties on the list. This function never signals an error. */)
- (plist, prop)
- Lisp_Object plist;
- Lisp_Object prop;
+ (Lisp_Object plist, Lisp_Object prop)
{
Lisp_Object tail, halftail;
@@ -1960,8 +1885,7 @@ properties on the list. This function never signals an error. */)
DEFUN ("get", Fget, Sget, 2, 2, 0,
doc: /* Return the value of SYMBOL's PROPNAME property.
This is the last value stored with `(put SYMBOL PROPNAME VALUE)'. */)
- (symbol, propname)
- Lisp_Object symbol, propname;
+ (Lisp_Object symbol, Lisp_Object propname)
{
CHECK_SYMBOL (symbol);
return Fplist_get (XSYMBOL (symbol)->plist, propname);
@@ -1975,10 +1899,7 @@ If PROP is already a property on the list, its value is set to VAL,
otherwise the new PROP VAL pair is added. The new plist is returned;
use `(setq x (plist-put x prop val))' to be sure to use the new value.
The PLIST is modified by side effects. */)
- (plist, prop, val)
- Lisp_Object plist;
- register Lisp_Object prop;
- Lisp_Object val;
+ (Lisp_Object plist, register Lisp_Object prop, Lisp_Object val)
{
register Lisp_Object tail, prev;
Lisp_Object newcell;
@@ -2006,8 +1927,7 @@ The PLIST is modified by side effects. */)
DEFUN ("put", Fput, Sput, 3, 3, 0,
doc: /* Store SYMBOL's PROPNAME property with value VALUE.
It can be retrieved with `(get SYMBOL PROPNAME)'. */)
- (symbol, propname, value)
- Lisp_Object symbol, propname, value;
+ (Lisp_Object symbol, Lisp_Object propname, Lisp_Object value)
{
CHECK_SYMBOL (symbol);
XSYMBOL (symbol)->plist
@@ -2021,9 +1941,7 @@ PLIST is a property list, which is a list of the form
\(PROP1 VALUE1 PROP2 VALUE2...). This function returns the value
corresponding to the given PROP, or nil if PROP is not
one of the properties on the list. */)
- (plist, prop)
- Lisp_Object plist;
- Lisp_Object prop;
+ (Lisp_Object plist, Lisp_Object prop)
{
Lisp_Object tail;
@@ -2050,10 +1968,7 @@ If PROP is already a property on the list, its value is set to VAL,
otherwise the new PROP VAL pair is added. The new plist is returned;
use `(setq x (lax-plist-put x prop val))' to be sure to use the new value.
The PLIST is modified by side effects. */)
- (plist, prop, val)
- Lisp_Object plist;
- register Lisp_Object prop;
- Lisp_Object val;
+ (Lisp_Object plist, register Lisp_Object prop, Lisp_Object val)
{
register Lisp_Object tail, prev;
Lisp_Object newcell;
@@ -2081,8 +1996,7 @@ The PLIST is modified by side effects. */)
DEFUN ("eql", Feql, Seql, 2, 2, 0,
doc: /* Return t if the two args are the same Lisp object.
Floating-point numbers of equal value are `eql', but they may not be `eq'. */)
- (obj1, obj2)
- Lisp_Object obj1, obj2;
+ (Lisp_Object obj1, Lisp_Object obj2)
{
if (FLOATP (obj1))
return internal_equal (obj1, obj2, 0, 0) ? Qt : Qnil;
@@ -2098,8 +2012,7 @@ Vectors and strings are compared element by element.
Numbers are compared by value, but integers cannot equal floats.
(Use `=' if you want integers and floats to be able to be equal.)
Symbols must match exactly. */)
- (o1, o2)
- register Lisp_Object o1, o2;
+ (register Lisp_Object o1, Lisp_Object o2)
{
return internal_equal (o1, o2, 0, 0) ? Qt : Qnil;
}
@@ -2108,8 +2021,7 @@ DEFUN ("equal-including-properties", Fequal_including_properties, Sequal_includi
doc: /* Return t if two Lisp objects have similar structure and contents.
This is like `equal' except that it compares the text properties
of strings. (`equal' ignores text properties.) */)
- (o1, o2)
- register Lisp_Object o1, o2;
+ (register Lisp_Object o1, Lisp_Object o2)
{
return internal_equal (o1, o2, 0, 1) ? Qt : Qnil;
}
@@ -2119,9 +2031,7 @@ of strings. (`equal' ignores text properties.) */)
PROPS, if non-nil, means compare string text properties too. */
static int
-internal_equal (o1, o2, depth, props)
- register Lisp_Object o1, o2;
- int depth, props;
+internal_equal (register Lisp_Object o1, register Lisp_Object o2, int depth, int props)
{
if (depth > 200)
error ("Stack overflow in equal");
@@ -2193,8 +2103,8 @@ internal_equal (o1, o2, depth, props)
if (XBOOL_VECTOR (o1)->size != XBOOL_VECTOR (o2)->size)
return 0;
- if (bcmp (XBOOL_VECTOR (o1)->data, XBOOL_VECTOR (o2)->data,
- size_in_chars))
+ if (memcmp (XBOOL_VECTOR (o1)->data, XBOOL_VECTOR (o2)->data,
+ size_in_chars))
return 0;
return 1;
}
@@ -2229,8 +2139,7 @@ internal_equal (o1, o2, depth, props)
return 0;
if (SBYTES (o1) != SBYTES (o2))
return 0;
- if (bcmp (SDATA (o1), SDATA (o2),
- SBYTES (o1)))
+ if (memcmp (SDATA (o1), SDATA (o2), SBYTES (o1)))
return 0;
if (props && !compare_string_intervals (o1, o2))
return 0;
@@ -2243,13 +2152,11 @@ internal_equal (o1, o2, depth, props)
return 0;
}
-extern Lisp_Object Fmake_char_internal ();
DEFUN ("fillarray", Ffillarray, Sfillarray, 2, 2, 0,
doc: /* Store each element of ARRAY with ITEM.
ARRAY is a vector, string, char-table, or bool-vector. */)
- (array, item)
- Lisp_Object array, item;
+ (Lisp_Object array, Lisp_Object item)
{
register int size, index, charval;
if (VECTORP (array))
@@ -2323,13 +2230,12 @@ DEFUN ("clear-string", Fclear_string, Sclear_string,
1, 1, 0,
doc: /* Clear the contents of STRING.
This makes STRING unibyte and may change its length. */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
int len;
CHECK_STRING (string);
len = SBYTES (string);
- bzero (SDATA (string), len);
+ memset (SDATA (string), 0, len);
STRING_SET_CHARS (string, len);
STRING_SET_UNIBYTE (string);
return Qnil;
@@ -2337,8 +2243,7 @@ This makes STRING unibyte and may change its length. */)
/* ARGSUSED */
Lisp_Object
-nconc2 (s1, s2)
- Lisp_Object s1, s2;
+nconc2 (Lisp_Object s1, Lisp_Object s2)
{
Lisp_Object args[2];
args[0] = s1;
@@ -2350,9 +2255,7 @@ DEFUN ("nconc", Fnconc, Snconc, 0, MANY, 0,
doc: /* Concatenate any number of lists by altering them.
Only the last argument is not altered, and need not be a list.
usage: (nconc &rest LISTS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
register int argnum;
register Lisp_Object tail, tem, val;
@@ -2393,10 +2296,7 @@ usage: (nconc &rest LISTS) */)
LENI is the length of VALS, which should also be the length of SEQ. */
static void
-mapcar1 (leni, vals, fn, seq)
- int leni;
- Lisp_Object *vals;
- Lisp_Object fn, seq;
+mapcar1 (int leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq)
{
register Lisp_Object tail;
Lisp_Object dummy;
@@ -2476,8 +2376,7 @@ DEFUN ("mapconcat", Fmapconcat, Smapconcat, 3, 3, 0,
In between each pair of results, stick in SEPARATOR. Thus, " " as
SEPARATOR results in spaces between the values returned by FUNCTION.
SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
- (function, sequence, separator)
- Lisp_Object function, sequence, separator;
+ (Lisp_Object function, Lisp_Object sequence, Lisp_Object separator)
{
Lisp_Object len;
register int leni;
@@ -2517,8 +2416,7 @@ DEFUN ("mapcar", Fmapcar, Smapcar, 2, 2, 0,
doc: /* Apply FUNCTION to each element of SEQUENCE, and make a list of the results.
The result is a list just as long as SEQUENCE.
SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
- (function, sequence)
- Lisp_Object function, sequence;
+ (Lisp_Object function, Lisp_Object sequence)
{
register Lisp_Object len;
register int leni;
@@ -2545,8 +2443,7 @@ DEFUN ("mapc", Fmapc, Smapc, 2, 2, 0,
doc: /* Apply FUNCTION to each element of SEQUENCE for side effects only.
Unlike `mapcar', don't accumulate the results. Return SEQUENCE.
SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
- (function, sequence)
- Lisp_Object function, sequence;
+ (Lisp_Object function, Lisp_Object sequence)
{
register int leni;
@@ -2572,8 +2469,7 @@ for more information. In this case, the useful bindings are `act', `skip',
Under a windowing system a dialog box will be used if `last-nonmenu-event'
is nil and `use-dialog-box' is non-nil. */)
- (prompt)
- Lisp_Object prompt;
+ (Lisp_Object prompt)
{
register Lisp_Object obj, key, def, map;
register int answer;
@@ -2705,8 +2601,7 @@ is nil and `use-dialog-box' is non-nil. */)
Anything that calls this function must protect from GC! */
Lisp_Object
-do_yes_or_no_p (prompt)
- Lisp_Object prompt;
+do_yes_or_no_p (Lisp_Object prompt)
{
return call1 (intern ("yes-or-no-p"), prompt);
}
@@ -2722,8 +2617,7 @@ and can edit it until it has been confirmed.
Under a windowing system a dialog box will be used if `last-nonmenu-event'
is nil, and `use-dialog-box' is non-nil. */)
- (prompt)
- Lisp_Object prompt;
+ (Lisp_Object prompt)
{
register Lisp_Object ans;
Lisp_Object args[2];
@@ -2795,8 +2689,7 @@ An error is thrown if the load average can't be obtained. In some
cases making it work would require Emacs being installed setuid or
setgid so that it can read kernel information, and that usually isn't
advisable. */)
- (use_floats)
- Lisp_Object use_floats;
+ (Lisp_Object use_floats)
{
double load_ave[3];
int loads = getloadavg (load_ave, 3);
@@ -2827,8 +2720,7 @@ presence or absence of Emacs or environment extensions.
Use `provide' to declare that a feature is available. This function
looks at the value of the variable `features'. The optional argument
SUBFEATURE can be used to check a specific subfeature of FEATURE. */)
- (feature, subfeature)
- Lisp_Object feature, subfeature;
+ (Lisp_Object feature, Lisp_Object subfeature)
{
register Lisp_Object tem;
CHECK_SYMBOL (feature);
@@ -2842,8 +2734,7 @@ DEFUN ("provide", Fprovide, Sprovide, 1, 2, 0,
doc: /* Announce that FEATURE is a feature of the current Emacs.
The optional argument SUBFEATURES should be a list of symbols listing
particular subfeatures supported in this version of FEATURE. */)
- (feature, subfeatures)
- Lisp_Object feature, subfeatures;
+ (Lisp_Object feature, Lisp_Object subfeatures)
{
register Lisp_Object tem;
CHECK_SYMBOL (feature);
@@ -2873,8 +2764,7 @@ particular subfeatures supported in this version of FEATURE. */)
Lisp_Object require_nesting_list;
Lisp_Object
-require_unwind (old_value)
- Lisp_Object old_value;
+require_unwind (Lisp_Object old_value)
{
return require_nesting_list = old_value;
}
@@ -2890,8 +2780,7 @@ If the optional third argument NOERROR is non-nil,
then return nil if the file is not found instead of signaling an error.
Normally the return value is FEATURE.
The normal messages at start and end of loading FILENAME are suppressed. */)
- (feature, filename, noerror)
- Lisp_Object feature, filename, noerror;
+ (Lisp_Object feature, Lisp_Object filename, Lisp_Object noerror)
{
register Lisp_Object tem;
struct gcpro gcpro1, gcpro2;
@@ -2986,8 +2875,7 @@ PLIST is a property list, which is a list of the form
Unlike `plist-get', this allows you to distinguish between a missing
property and a property with the value nil.
The value is actually the tail of PLIST whose car is PROP. */)
- (plist, prop)
- Lisp_Object plist, prop;
+ (Lisp_Object plist, Lisp_Object prop)
{
while (CONSP (plist) && !EQ (XCAR (plist), prop))
{
@@ -3001,8 +2889,7 @@ The value is actually the tail of PLIST whose car is PROP. */)
DEFUN ("widget-put", Fwidget_put, Swidget_put, 3, 3, 0,
doc: /* In WIDGET, set PROPERTY to VALUE.
The value can later be retrieved with `widget-get'. */)
- (widget, property, value)
- Lisp_Object widget, property, value;
+ (Lisp_Object widget, Lisp_Object property, Lisp_Object value)
{
CHECK_CONS (widget);
XSETCDR (widget, Fplist_put (XCDR (widget), property, value));
@@ -3013,8 +2900,7 @@ DEFUN ("widget-get", Fwidget_get, Swidget_get, 2, 2, 0,
doc: /* In WIDGET, get the value of PROPERTY.
The value could either be specified when the widget was created, or
later with `widget-put'. */)
- (widget, property)
- Lisp_Object widget, property;
+ (Lisp_Object widget, Lisp_Object property)
{
Lisp_Object tmp;
@@ -3040,9 +2926,7 @@ DEFUN ("widget-apply", Fwidget_apply, Swidget_apply, 2, MANY, 0,
doc: /* Apply the value of WIDGET's PROPERTY to the widget itself.
ARGS are passed as extra arguments to the function.
usage: (widget-apply WIDGET PROPERTY &rest ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
/* This function can GC. */
Lisp_Object newargs[3];
@@ -3081,8 +2965,7 @@ If the system can't provide such information through a call to
See also Info node `(libc)Locales'.
The data read from the system are decoded using `locale-coding-system'. */)
- (item)
- Lisp_Object item;
+ (Lisp_Object item)
{
char *str = NULL;
#ifdef HAVE_LANGINFO_CODESET
@@ -3227,8 +3110,8 @@ static const short base64_char_to_value[128] =
base64 characters. */
-static int base64_encode_1 P_ ((const char *, char *, int, int, int));
-static int base64_decode_1 P_ ((const char *, char *, int, int, int *));
+static int base64_encode_1 (const char *, char *, int, int, int);
+static int base64_decode_1 (const char *, char *, int, int, int *);
DEFUN ("base64-encode-region", Fbase64_encode_region, Sbase64_encode_region,
2, 3, "r",
@@ -3236,8 +3119,7 @@ DEFUN ("base64-encode-region", Fbase64_encode_region, Sbase64_encode_region,
Return the length of the encoded text.
Optional third argument NO-LINE-BREAK means do not break long lines
into shorter lines. */)
- (beg, end, no_line_break)
- Lisp_Object beg, end, no_line_break;
+ (Lisp_Object beg, Lisp_Object end, Lisp_Object no_line_break)
{
char *encoded;
int allength, length;
@@ -3296,8 +3178,7 @@ DEFUN ("base64-encode-string", Fbase64_encode_string, Sbase64_encode_string,
doc: /* Base64-encode STRING and return the result.
Optional second argument NO-LINE-BREAK means do not break long lines
into shorter lines. */)
- (string, no_line_break)
- Lisp_Object string, no_line_break;
+ (Lisp_Object string, Lisp_Object no_line_break)
{
int allength, length, encoded_length;
char *encoded;
@@ -3336,12 +3217,7 @@ into shorter lines. */)
}
static int
-base64_encode_1 (from, to, length, line_break, multibyte)
- const char *from;
- char *to;
- int length;
- int line_break;
- int multibyte;
+base64_encode_1 (const char *from, char *to, int length, int line_break, int multibyte)
{
int counter = 0, i = 0;
char *e = to;
@@ -3440,8 +3316,7 @@ DEFUN ("base64-decode-region", Fbase64_decode_region, Sbase64_decode_region,
doc: /* Base64-decode the region between BEG and END.
Return the length of the decoded text.
If the region can't be decoded, signal an error and don't modify the buffer. */)
- (beg, end)
- Lisp_Object beg, end;
+ (Lisp_Object beg, Lisp_Object end)
{
int ibeg, iend, length, allength;
char *decoded;
@@ -3501,8 +3376,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string,
1, 1, 0,
doc: /* Base64-decode STRING and return the result. */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
char *decoded;
int length, decoded_length;
@@ -3538,12 +3412,7 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string,
characters in *NCHARS_RETURN. */
static int
-base64_decode_1 (from, to, length, multibyte, nchars_return)
- const char *from;
- char *to;
- int length;
- int multibyte;
- int *nchars_return;
+base64_decode_1 (const char *from, char *to, int length, int multibyte, int *nchars_return)
{
int i = 0;
char *e = to;
@@ -3655,25 +3524,25 @@ Lisp_Object Qhash_table_test, Qkey_or_value, Qkey_and_value;
/* Function prototypes. */
-static struct Lisp_Hash_Table *check_hash_table P_ ((Lisp_Object));
-static int get_key_arg P_ ((Lisp_Object, int, Lisp_Object *, char *));
-static void maybe_resize_hash_table P_ ((struct Lisp_Hash_Table *));
-static int cmpfn_eql P_ ((struct Lisp_Hash_Table *, Lisp_Object, unsigned,
- Lisp_Object, unsigned));
-static int cmpfn_equal P_ ((struct Lisp_Hash_Table *, Lisp_Object, unsigned,
- Lisp_Object, unsigned));
-static int cmpfn_user_defined P_ ((struct Lisp_Hash_Table *, Lisp_Object,
- unsigned, Lisp_Object, unsigned));
-static unsigned hashfn_eq P_ ((struct Lisp_Hash_Table *, Lisp_Object));
-static unsigned hashfn_eql P_ ((struct Lisp_Hash_Table *, Lisp_Object));
-static unsigned hashfn_equal P_ ((struct Lisp_Hash_Table *, Lisp_Object));
-static unsigned hashfn_user_defined P_ ((struct Lisp_Hash_Table *,
- Lisp_Object));
-static unsigned sxhash_string P_ ((unsigned char *, int));
-static unsigned sxhash_list P_ ((Lisp_Object, int));
-static unsigned sxhash_vector P_ ((Lisp_Object, int));
-static unsigned sxhash_bool_vector P_ ((Lisp_Object));
-static int sweep_weak_table P_ ((struct Lisp_Hash_Table *, int));
+static struct Lisp_Hash_Table *check_hash_table (Lisp_Object);
+static int get_key_arg (Lisp_Object, int, Lisp_Object *, char *);
+static void maybe_resize_hash_table (struct Lisp_Hash_Table *);
+static int cmpfn_eql (struct Lisp_Hash_Table *, Lisp_Object, unsigned,
+ Lisp_Object, unsigned);
+static int cmpfn_equal (struct Lisp_Hash_Table *, Lisp_Object, unsigned,
+ Lisp_Object, unsigned);
+static int cmpfn_user_defined (struct Lisp_Hash_Table *, Lisp_Object,
+ unsigned, Lisp_Object, unsigned);
+static unsigned hashfn_eq (struct Lisp_Hash_Table *, Lisp_Object);
+static unsigned hashfn_eql (struct Lisp_Hash_Table *, Lisp_Object);
+static unsigned hashfn_equal (struct Lisp_Hash_Table *, Lisp_Object);
+static unsigned hashfn_user_defined (struct Lisp_Hash_Table *,
+ Lisp_Object);
+static unsigned sxhash_string (unsigned char *, int);
+static unsigned sxhash_list (Lisp_Object, int);
+static unsigned sxhash_vector (Lisp_Object, int);
+static unsigned sxhash_bool_vector (Lisp_Object);
+static int sweep_weak_table (struct Lisp_Hash_Table *, int);
@@ -3685,8 +3554,7 @@ static int sweep_weak_table P_ ((struct Lisp_Hash_Table *, int));
Lisp_Hash_Table. Otherwise, signal an error. */
static struct Lisp_Hash_Table *
-check_hash_table (obj)
- Lisp_Object obj;
+check_hash_table (Lisp_Object obj)
{
CHECK_HASH_TABLE (obj);
return XHASH_TABLE (obj);
@@ -3697,8 +3565,7 @@ check_hash_table (obj)
number. */
int
-next_almost_prime (n)
- int n;
+next_almost_prime (int n)
{
if (n % 2 == 0)
n += 1;
@@ -3717,11 +3584,7 @@ next_almost_prime (n)
a DEFUN parameter list. */
static int
-get_key_arg (key, nargs, args, used)
- Lisp_Object key;
- int nargs;
- Lisp_Object *args;
- char *used;
+get_key_arg (Lisp_Object key, int nargs, Lisp_Object *args, char *used)
{
int i;
@@ -3746,10 +3609,7 @@ get_key_arg (key, nargs, args, used)
vector that are not copied from VEC are set to INIT. */
Lisp_Object
-larger_vector (vec, new_size, init)
- Lisp_Object vec;
- int new_size;
- Lisp_Object init;
+larger_vector (Lisp_Object vec, int new_size, Lisp_Object init)
{
struct Lisp_Vector *v;
int i, old_size;
@@ -3759,8 +3619,7 @@ larger_vector (vec, new_size, init)
xassert (new_size >= old_size);
v = allocate_vector (new_size);
- bcopy (XVECTOR (vec)->contents, v->contents,
- old_size * sizeof *v->contents);
+ memcpy (v->contents, XVECTOR (vec)->contents, old_size * sizeof *v->contents);
for (i = old_size; i < new_size; ++i)
v->contents[i] = init;
XSETVECTOR (vec, v);
@@ -3777,10 +3636,7 @@ larger_vector (vec, new_size, init)
KEY2 are the same. */
static int
-cmpfn_eql (h, key1, hash1, key2, hash2)
- struct Lisp_Hash_Table *h;
- Lisp_Object key1, key2;
- unsigned hash1, hash2;
+cmpfn_eql (struct Lisp_Hash_Table *h, Lisp_Object key1, unsigned int hash1, Lisp_Object key2, unsigned int hash2)
{
return (FLOATP (key1)
&& FLOATP (key2)
@@ -3793,10 +3649,7 @@ cmpfn_eql (h, key1, hash1, key2, hash2)
KEY2 are the same. */
static int
-cmpfn_equal (h, key1, hash1, key2, hash2)
- struct Lisp_Hash_Table *h;
- Lisp_Object key1, key2;
- unsigned hash1, hash2;
+cmpfn_equal (struct Lisp_Hash_Table *h, Lisp_Object key1, unsigned int hash1, Lisp_Object key2, unsigned int hash2)
{
return hash1 == hash2 && !NILP (Fequal (key1, key2));
}
@@ -3807,10 +3660,7 @@ cmpfn_equal (h, key1, hash1, key2, hash2)
if KEY1 and KEY2 are the same. */
static int
-cmpfn_user_defined (h, key1, hash1, key2, hash2)
- struct Lisp_Hash_Table *h;
- Lisp_Object key1, key2;
- unsigned hash1, hash2;
+cmpfn_user_defined (struct Lisp_Hash_Table *h, Lisp_Object key1, unsigned int hash1, Lisp_Object key2, unsigned int hash2)
{
if (hash1 == hash2)
{
@@ -3831,9 +3681,7 @@ cmpfn_user_defined (h, key1, hash1, key2, hash2)
in a Lisp integer. */
static unsigned
-hashfn_eq (h, key)
- struct Lisp_Hash_Table *h;
- Lisp_Object key;
+hashfn_eq (struct Lisp_Hash_Table *h, Lisp_Object key)
{
unsigned hash = XUINT (key) ^ XTYPE (key);
xassert ((hash & ~INTMASK) == 0);
@@ -3846,9 +3694,7 @@ hashfn_eq (h, key)
in a Lisp integer. */
static unsigned
-hashfn_eql (h, key)
- struct Lisp_Hash_Table *h;
- Lisp_Object key;
+hashfn_eql (struct Lisp_Hash_Table *h, Lisp_Object key)
{
unsigned hash;
if (FLOATP (key))
@@ -3865,9 +3711,7 @@ hashfn_eql (h, key)
in a Lisp integer. */
static unsigned
-hashfn_equal (h, key)
- struct Lisp_Hash_Table *h;
- Lisp_Object key;
+hashfn_equal (struct Lisp_Hash_Table *h, Lisp_Object key)
{
unsigned hash = sxhash (key, 0);
xassert ((hash & ~INTMASK) == 0);
@@ -3880,9 +3724,7 @@ hashfn_equal (h, key)
guaranteed to fit in a Lisp integer. */
static unsigned
-hashfn_user_defined (h, key)
- struct Lisp_Hash_Table *h;
- Lisp_Object key;
+hashfn_user_defined (struct Lisp_Hash_Table *h, Lisp_Object key)
{
Lisp_Object args[2], hash;
@@ -3918,10 +3760,9 @@ hashfn_user_defined (h, key)
one of the symbols `key', `value', `key-or-value', or `key-and-value'. */
Lisp_Object
-make_hash_table (test, size, rehash_size, rehash_threshold, weak,
- user_test, user_hash)
- Lisp_Object test, size, rehash_size, rehash_threshold, weak;
- Lisp_Object user_test, user_hash;
+make_hash_table (Lisp_Object test, Lisp_Object size, Lisp_Object rehash_size,
+ Lisp_Object rehash_threshold, Lisp_Object weak,
+ Lisp_Object user_test, Lisp_Object user_hash)
{
struct Lisp_Hash_Table *h;
Lisp_Object table;
@@ -4006,8 +3847,7 @@ make_hash_table (test, size, rehash_size, rehash_threshold, weak,
only the table itself is. */
Lisp_Object
-copy_hash_table (h1)
- struct Lisp_Hash_Table *h1;
+copy_hash_table (struct Lisp_Hash_Table *h1)
{
Lisp_Object table;
struct Lisp_Hash_Table *h2;
@@ -4015,7 +3855,7 @@ copy_hash_table (h1)
h2 = allocate_hash_table ();
next = h2->vec_next;
- bcopy (h1, h2, sizeof *h2);
+ memcpy (h2, h1, sizeof *h2);
h2->vec_next = next;
h2->key_and_value = Fcopy_sequence (h1->key_and_value);
h2->hash = Fcopy_sequence (h1->hash);
@@ -4038,8 +3878,7 @@ copy_hash_table (h1)
because it's already too large, throw an error. */
static INLINE void
-maybe_resize_hash_table (h)
- struct Lisp_Hash_Table *h;
+maybe_resize_hash_table (struct Lisp_Hash_Table *h)
{
if (NILP (h->next_free))
{
@@ -4104,10 +3943,7 @@ maybe_resize_hash_table (h)
matching KEY, or -1 if not found. */
int
-hash_lookup (h, key, hash)
- struct Lisp_Hash_Table *h;
- Lisp_Object key;
- unsigned *hash;
+hash_lookup (struct Lisp_Hash_Table *h, Lisp_Object key, unsigned int *hash)
{
unsigned hash_code;
int start_of_bucket;
@@ -4141,10 +3977,7 @@ hash_lookup (h, key, hash)
Value is the index of the entry in H matching KEY. */
int
-hash_put (h, key, value, hash)
- struct Lisp_Hash_Table *h;
- Lisp_Object key, value;
- unsigned hash;
+hash_put (struct Lisp_Hash_Table *h, Lisp_Object key, Lisp_Object value, unsigned int hash)
{
int start_of_bucket, i;
@@ -4174,9 +4007,7 @@ hash_put (h, key, value, hash)
/* Remove the entry matching KEY from hash table H, if there is one. */
static void
-hash_remove_from_table (h, key)
- struct Lisp_Hash_Table *h;
- Lisp_Object key;
+hash_remove_from_table (struct Lisp_Hash_Table *h, Lisp_Object key)
{
unsigned hash_code;
int start_of_bucket;
@@ -4224,8 +4055,7 @@ hash_remove_from_table (h, key)
/* Clear hash table H. */
void
-hash_clear (h)
- struct Lisp_Hash_Table *h;
+hash_clear (struct Lisp_Hash_Table *h)
{
if (h->count > 0)
{
@@ -4254,7 +4084,7 @@ hash_clear (h)
************************************************************************/
void
-init_weak_hash_tables ()
+init_weak_hash_tables (void)
{
weak_hash_tables = NULL;
}
@@ -4265,9 +4095,7 @@ init_weak_hash_tables ()
non-zero if anything was marked. */
static int
-sweep_weak_table (h, remove_entries_p)
- struct Lisp_Hash_Table *h;
- int remove_entries_p;
+sweep_weak_table (struct Lisp_Hash_Table *h, int remove_entries_p)
{
int bucket, n, marked;
@@ -4355,7 +4183,7 @@ sweep_weak_table (h, remove_entries_p)
from Vweak_hash_tables. Called from gc_sweep. */
void
-sweep_weak_hash_tables ()
+sweep_weak_hash_tables (void)
{
struct Lisp_Hash_Table *h, *used, *next;
int marked;
@@ -4423,9 +4251,7 @@ sweep_weak_hash_tables ()
code returned is guaranteed to fit in a Lisp integer. */
static unsigned
-sxhash_string (ptr, len)
- unsigned char *ptr;
- int len;
+sxhash_string (unsigned char *ptr, int len)
{
unsigned char *p = ptr;
unsigned char *end = p + len;
@@ -4448,9 +4274,7 @@ sxhash_string (ptr, len)
list. We don't recurse deeper than SXHASH_MAX_DEPTH in it. */
static unsigned
-sxhash_list (list, depth)
- Lisp_Object list;
- int depth;
+sxhash_list (Lisp_Object list, int depth)
{
unsigned hash = 0;
int i;
@@ -4478,9 +4302,7 @@ sxhash_list (list, depth)
the Lisp structure. */
static unsigned
-sxhash_vector (vec, depth)
- Lisp_Object vec;
- int depth;
+sxhash_vector (Lisp_Object vec, int depth)
{
unsigned hash = ASIZE (vec);
int i, n;
@@ -4499,8 +4321,7 @@ sxhash_vector (vec, depth)
/* Return a hash for bool-vector VECTOR. */
static unsigned
-sxhash_bool_vector (vec)
- Lisp_Object vec;
+sxhash_bool_vector (Lisp_Object vec)
{
unsigned hash = XBOOL_VECTOR (vec)->size;
int i, n;
@@ -4517,9 +4338,7 @@ sxhash_bool_vector (vec)
structure. Value is an unsigned integer clipped to INTMASK. */
unsigned
-sxhash (obj, depth)
- Lisp_Object obj;
- int depth;
+sxhash (Lisp_Object obj, int depth)
{
unsigned hash;
@@ -4590,8 +4409,7 @@ sxhash (obj, depth)
DEFUN ("sxhash", Fsxhash, Ssxhash, 1, 1, 0,
doc: /* Compute a hash code for OBJ and return it as integer. */)
- (obj)
- Lisp_Object obj;
+ (Lisp_Object obj)
{
unsigned hash = sxhash (obj, 0);
return make_number (hash);
@@ -4630,9 +4448,7 @@ WEAK. WEAK t is equivalent to `key-and-value'. Default value of WEAK
is nil.
usage: (make-hash-table &rest KEYWORD-ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
Lisp_Object test, size, rehash_size, rehash_threshold, weak;
Lisp_Object user_test, user_hash;
@@ -4642,7 +4458,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */)
/* The vector `used' is used to keep track of arguments that
have been consumed. */
used = (char *) alloca (nargs * sizeof *used);
- bzero (used, nargs * sizeof *used);
+ memset (used, 0, nargs * sizeof *used);
/* See if there's a `:test TEST' among the arguments. */
i = get_key_arg (QCtest, nargs, args, used);
@@ -4709,8 +4525,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */)
DEFUN ("copy-hash-table", Fcopy_hash_table, Scopy_hash_table, 1, 1, 0,
doc: /* Return a copy of hash table TABLE. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
return copy_hash_table (check_hash_table (table));
}
@@ -4718,8 +4533,7 @@ DEFUN ("copy-hash-table", Fcopy_hash_table, Scopy_hash_table, 1, 1, 0,
DEFUN ("hash-table-count", Fhash_table_count, Shash_table_count, 1, 1, 0,
doc: /* Return the number of elements in TABLE. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
return make_number (check_hash_table (table)->count);
}
@@ -4728,8 +4542,7 @@ DEFUN ("hash-table-count", Fhash_table_count, Shash_table_count, 1, 1, 0,
DEFUN ("hash-table-rehash-size", Fhash_table_rehash_size,
Shash_table_rehash_size, 1, 1, 0,
doc: /* Return the current rehash size of TABLE. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
return check_hash_table (table)->rehash_size;
}
@@ -4738,8 +4551,7 @@ DEFUN ("hash-table-rehash-size", Fhash_table_rehash_size,
DEFUN ("hash-table-rehash-threshold", Fhash_table_rehash_threshold,
Shash_table_rehash_threshold, 1, 1, 0,
doc: /* Return the current rehash threshold of TABLE. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
return check_hash_table (table)->rehash_threshold;
}
@@ -4750,8 +4562,7 @@ DEFUN ("hash-table-size", Fhash_table_size, Shash_table_size, 1, 1, 0,
The size can be used as an argument to `make-hash-table' to create
a hash table than can hold as many elements of TABLE holds
without need for resizing. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
struct Lisp_Hash_Table *h = check_hash_table (table);
return make_number (HASH_TABLE_SIZE (h));
@@ -4760,8 +4571,7 @@ without need for resizing. */)
DEFUN ("hash-table-test", Fhash_table_test, Shash_table_test, 1, 1, 0,
doc: /* Return the test TABLE uses. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
return check_hash_table (table)->test;
}
@@ -4770,8 +4580,7 @@ DEFUN ("hash-table-test", Fhash_table_test, Shash_table_test, 1, 1, 0,
DEFUN ("hash-table-weakness", Fhash_table_weakness, Shash_table_weakness,
1, 1, 0,
doc: /* Return the weakness of TABLE. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
return check_hash_table (table)->weak;
}
@@ -4779,8 +4588,7 @@ DEFUN ("hash-table-weakness", Fhash_table_weakness, Shash_table_weakness,
DEFUN ("hash-table-p", Fhash_table_p, Shash_table_p, 1, 1, 0,
doc: /* Return t if OBJ is a Lisp hash table object. */)
- (obj)
- Lisp_Object obj;
+ (Lisp_Object obj)
{
return HASH_TABLE_P (obj) ? Qt : Qnil;
}
@@ -4788,8 +4596,7 @@ DEFUN ("hash-table-p", Fhash_table_p, Shash_table_p, 1, 1, 0,
DEFUN ("clrhash", Fclrhash, Sclrhash, 1, 1, 0,
doc: /* Clear hash table TABLE and return it. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
hash_clear (check_hash_table (table));
/* Be compatible with XEmacs. */
@@ -4800,8 +4607,7 @@ DEFUN ("clrhash", Fclrhash, Sclrhash, 1, 1, 0,
DEFUN ("gethash", Fgethash, Sgethash, 2, 3, 0,
doc: /* Look up KEY in TABLE and return its associated value.
If KEY is not found, return DFLT which defaults to nil. */)
- (key, table, dflt)
- Lisp_Object key, table, dflt;
+ (Lisp_Object key, Lisp_Object table, Lisp_Object dflt)
{
struct Lisp_Hash_Table *h = check_hash_table (table);
int i = hash_lookup (h, key, NULL);
@@ -4813,8 +4619,7 @@ DEFUN ("puthash", Fputhash, Sputhash, 3, 3, 0,
doc: /* Associate KEY with VALUE in hash table TABLE.
If KEY is already present in table, replace its current value with
VALUE. */)
- (key, value, table)
- Lisp_Object key, value, table;
+ (Lisp_Object key, Lisp_Object value, Lisp_Object table)
{
struct Lisp_Hash_Table *h = check_hash_table (table);
int i;
@@ -4832,8 +4637,7 @@ VALUE. */)
DEFUN ("remhash", Fremhash, Sremhash, 2, 2, 0,
doc: /* Remove KEY from TABLE. */)
- (key, table)
- Lisp_Object key, table;
+ (Lisp_Object key, Lisp_Object table)
{
struct Lisp_Hash_Table *h = check_hash_table (table);
hash_remove_from_table (h, key);
@@ -4844,8 +4648,7 @@ DEFUN ("remhash", Fremhash, Sremhash, 2, 2, 0,
DEFUN ("maphash", Fmaphash, Smaphash, 2, 2, 0,
doc: /* Call FUNCTION for all entries in hash table TABLE.
FUNCTION is called with two arguments, KEY and VALUE. */)
- (function, table)
- Lisp_Object function, table;
+ (Lisp_Object function, Lisp_Object table)
{
struct Lisp_Hash_Table *h = check_hash_table (table);
Lisp_Object args[3];
@@ -4876,8 +4679,7 @@ both arguments are the same. HASH must be a function taking one
argument and return an integer that is the hash code of the argument.
Hash code computation should use the whole value range of integers,
including negative integers. */)
- (name, test, hash)
- Lisp_Object name, test, hash;
+ (Lisp_Object name, Lisp_Object test, Lisp_Object hash)
{
return Fput (name, Qhash_table_test, list2 (test, hash));
}
@@ -4917,8 +4719,7 @@ command `prefer-coding-system') is used.
If NOERROR is non-nil, silently assume the `raw-text' coding if the
guesswork fails. Normally, an error is signaled in such case. */)
- (object, start, end, coding_system, noerror)
- Lisp_Object object, start, end, coding_system, noerror;
+ (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror)
{
unsigned char digest[16];
unsigned char value[33];
@@ -5113,7 +4914,7 @@ guesswork fails. Normally, an error is signaled in such case. */)
void
-syms_of_fns ()
+syms_of_fns (void)
{
/* Hash table stuff. */
Qhash_table_p = intern_c_string ("hash-table-p");
@@ -5289,7 +5090,7 @@ this variable. */);
void
-init_fns ()
+init_fns (void)
{
}
diff --git a/src/font.c b/src/font.c
index e07dbc5dd16..cb3e9c5d326 100644
--- a/src/font.c
+++ b/src/font.c
@@ -175,7 +175,7 @@ static struct font_driver_list *font_driver_list;
/* Creaters of font-related Lisp object. */
Lisp_Object
-font_make_spec ()
+font_make_spec (void)
{
Lisp_Object font_spec;
struct font_spec *spec
@@ -187,7 +187,7 @@ font_make_spec ()
}
Lisp_Object
-font_make_entity ()
+font_make_entity (void)
{
Lisp_Object font_entity;
struct font_entity *entity
@@ -202,10 +202,7 @@ font_make_entity ()
not nil, copy properties from ENTITY to the font-object. If
PIXELSIZE is positive, set the `size' property to PIXELSIZE. */
Lisp_Object
-font_make_object (size, entity, pixelsize)
- int size;
- Lisp_Object entity;
- int pixelsize;
+font_make_object (int size, Lisp_Object entity, int pixelsize)
{
Lisp_Object font_object;
struct font *font
@@ -229,10 +226,10 @@ font_make_object (size, entity, pixelsize)
-static int font_pixel_size P_ ((FRAME_PTR f, Lisp_Object));
-static Lisp_Object font_open_entity P_ ((FRAME_PTR, Lisp_Object, int));
-static Lisp_Object font_matching_entity P_ ((FRAME_PTR, Lisp_Object *,
- Lisp_Object));
+static int font_pixel_size (FRAME_PTR f, Lisp_Object);
+static Lisp_Object font_open_entity (FRAME_PTR, Lisp_Object, int);
+static Lisp_Object font_matching_entity (FRAME_PTR, Lisp_Object *,
+ Lisp_Object);
/* Number of registered font drivers. */
static int num_font_drivers;
@@ -245,10 +242,7 @@ static int num_font_drivers;
STR. */
Lisp_Object
-font_intern_prop (str, len, force_symbol)
- char *str;
- int len;
- int force_symbol;
+font_intern_prop (char *str, int len, int force_symbol)
{
int i;
Lisp_Object tem;
@@ -290,9 +284,7 @@ font_intern_prop (str, len, force_symbol)
/* Return a pixel size of font-spec SPEC on frame F. */
static int
-font_pixel_size (f, spec)
- FRAME_PTR f;
- Lisp_Object spec;
+font_pixel_size (FRAME_PTR f, Lisp_Object spec)
{
#ifdef HAVE_WINDOW_SYSTEM
Lisp_Object size = AREF (spec, FONT_SIZE_INDEX);
@@ -327,10 +319,7 @@ font_pixel_size (f, spec)
VAL is an integer. */
int
-font_style_to_value (prop, val, noerror)
- enum font_property_index prop;
- Lisp_Object val;
- int noerror;
+font_style_to_value (enum font_property_index prop, Lisp_Object val, int noerror)
{
Lisp_Object table = AREF (font_style_table, prop - FONT_WEIGHT_INDEX);
int len = ASIZE (table);
@@ -395,10 +384,7 @@ font_style_to_value (prop, val, noerror)
}
Lisp_Object
-font_style_symbolic (font, prop, for_face)
- Lisp_Object font;
- enum font_property_index prop;
- int for_face;
+font_style_symbolic (Lisp_Object font, enum font_property_index prop, int for_face)
{
Lisp_Object val = AREF (font, prop);
Lisp_Object table, elt;
@@ -416,7 +402,7 @@ font_style_symbolic (font, prop, for_face)
extern Lisp_Object Vface_alternative_font_family_alist;
-extern Lisp_Object find_font_encoding P_ ((Lisp_Object));
+extern Lisp_Object find_font_encoding (Lisp_Object);
/* Return ENCODING or a cons of ENCODING and REPERTORY of the font
@@ -424,8 +410,7 @@ extern Lisp_Object find_font_encoding P_ ((Lisp_Object));
of the font. REPERTORY is a charset symbol or nil. */
Lisp_Object
-find_font_encoding (fontname)
- Lisp_Object fontname;
+find_font_encoding (Lisp_Object fontname)
{
Lisp_Object tail, elt;
@@ -448,9 +433,7 @@ find_font_encoding (fontname)
REGISTRY is available, return 0. Otherwise return -1. */
int
-font_registry_charsets (registry, encoding, repertory)
- Lisp_Object registry;
- struct charset **encoding, **repertory;
+font_registry_charsets (Lisp_Object registry, struct charset **encoding, struct charset **repertory)
{
Lisp_Object val;
int encoding_id, repertory_id;
@@ -508,16 +491,15 @@ font_registry_charsets (registry, encoding, repertory)
/* Font property value validaters. See the comment of
font_property_table for the meaning of the arguments. */
-static Lisp_Object font_prop_validate P_ ((int, Lisp_Object, Lisp_Object));
-static Lisp_Object font_prop_validate_symbol P_ ((Lisp_Object, Lisp_Object));
-static Lisp_Object font_prop_validate_style P_ ((Lisp_Object, Lisp_Object));
-static Lisp_Object font_prop_validate_non_neg P_ ((Lisp_Object, Lisp_Object));
-static Lisp_Object font_prop_validate_spacing P_ ((Lisp_Object, Lisp_Object));
-static int get_font_prop_index P_ ((Lisp_Object));
+static Lisp_Object font_prop_validate (int, Lisp_Object, Lisp_Object);
+static Lisp_Object font_prop_validate_symbol (Lisp_Object, Lisp_Object);
+static Lisp_Object font_prop_validate_style (Lisp_Object, Lisp_Object);
+static Lisp_Object font_prop_validate_non_neg (Lisp_Object, Lisp_Object);
+static Lisp_Object font_prop_validate_spacing (Lisp_Object, Lisp_Object);
+static int get_font_prop_index (Lisp_Object);
static Lisp_Object
-font_prop_validate_symbol (prop, val)
- Lisp_Object prop, val;
+font_prop_validate_symbol (Lisp_Object prop, Lisp_Object val)
{
if (STRINGP (val))
val = Fintern (val, Qnil);
@@ -530,8 +512,7 @@ font_prop_validate_symbol (prop, val)
static Lisp_Object
-font_prop_validate_style (style, val)
- Lisp_Object style, val;
+font_prop_validate_style (Lisp_Object style, Lisp_Object val)
{
enum font_property_index prop = (EQ (style, QCweight) ? FONT_WEIGHT_INDEX
: EQ (style, QCslant) ? FONT_SLANT_INDEX
@@ -565,16 +546,14 @@ font_prop_validate_style (style, val)
}
static Lisp_Object
-font_prop_validate_non_neg (prop, val)
- Lisp_Object prop, val;
+font_prop_validate_non_neg (Lisp_Object prop, Lisp_Object val)
{
return (NATNUMP (val) || (FLOATP (val) && XFLOAT_DATA (val) >= 0)
? val : Qerror);
}
static Lisp_Object
-font_prop_validate_spacing (prop, val)
- Lisp_Object prop, val;
+font_prop_validate_spacing (Lisp_Object prop, Lisp_Object val)
{
if (NILP (val) || (NATNUMP (val) && XINT (val) <= FONT_SPACING_CHARCELL))
return val;
@@ -595,8 +574,7 @@ font_prop_validate_spacing (prop, val)
}
static Lisp_Object
-font_prop_validate_otf (prop, val)
- Lisp_Object prop, val;
+font_prop_validate_otf (Lisp_Object prop, Lisp_Object val)
{
Lisp_Object tail, tmp;
int i;
@@ -638,7 +616,7 @@ struct
/* Function to validate PROP's value VAL, or NULL if any value is
ok. The value is VAL or its regularized value if VAL is valid,
and Qerror if not. */
- Lisp_Object (*validater) P_ ((Lisp_Object prop, Lisp_Object val));
+ Lisp_Object (*validater) (Lisp_Object prop, Lisp_Object val);
} font_property_table[] =
{ { &QCtype, font_prop_validate_symbol },
{ &QCfoundry, font_prop_validate_symbol },
@@ -667,8 +645,7 @@ struct
already known property. */
static int
-get_font_prop_index (key)
- Lisp_Object key;
+get_font_prop_index (Lisp_Object key)
{
int i;
@@ -683,9 +660,7 @@ get_font_prop_index (key)
signal an error. The value is VAL or the regularized one. */
static Lisp_Object
-font_prop_validate (idx, prop, val)
- int idx;
- Lisp_Object prop, val;
+font_prop_validate (int idx, Lisp_Object prop, Lisp_Object val)
{
Lisp_Object validated;
@@ -710,8 +685,7 @@ font_prop_validate (idx, prop, val)
keeping the sorting order. Don't check the validity of VAL. */
Lisp_Object
-font_put_extra (font, prop, val)
- Lisp_Object font, prop, val;
+font_put_extra (Lisp_Object font, Lisp_Object prop, Lisp_Object val)
{
Lisp_Object extra = AREF (font, FONT_EXTRA_INDEX);
Lisp_Object slot = (NILP (extra) ? Qnil : assq_no_quit (prop, extra));
@@ -740,9 +714,9 @@ font_put_extra (font, prop, val)
/* Font name parser and unparser */
-static int parse_matrix P_ ((char *));
-static int font_expand_wildcards P_ ((Lisp_Object *, int));
-static int font_parse_name P_ ((char *, Lisp_Object));
+static int parse_matrix (char *);
+static int font_expand_wildcards (Lisp_Object *, int);
+static int font_parse_name (char *, Lisp_Object);
/* An enumerator for each field of an XLFD font name. */
enum xlfd_field_index
@@ -799,8 +773,7 @@ enum xlfd_field_mask
-1. */
static int
-parse_matrix (p)
- char *p;
+parse_matrix (char *p)
{
double matrix[4];
char *end;
@@ -822,9 +795,7 @@ parse_matrix (p)
field position by its contents. */
static int
-font_expand_wildcards (field, n)
- Lisp_Object field[XLFD_LAST_INDEX];
- int n;
+font_expand_wildcards (Lisp_Object *field, int n)
{
/* Copy of FIELD. */
Lisp_Object tmp[XLFD_LAST_INDEX];
@@ -1058,9 +1029,7 @@ font_check_xlfd_parse (Lisp_Object font, char *name)
a fully specified XLFD. */
int
-font_parse_xlfd (name, font)
- char *name;
- Lisp_Object font;
+font_parse_xlfd (char *name, Lisp_Object font)
{
int len = strlen (name);
int i, j, n;
@@ -1242,11 +1211,7 @@ font_parse_xlfd (name, font)
0, use PIXEL_SIZE instead. */
int
-font_unparse_xlfd (font, pixel_size, name, nbytes)
- Lisp_Object font;
- int pixel_size;
- char *name;
- int nbytes;
+font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
{
char *f[XLFD_REGISTRY_INDEX + 1];
Lisp_Object val;
@@ -1389,9 +1354,7 @@ font_unparse_xlfd (font, pixel_size, name, nbytes)
This function tries to guess which format it is. */
int
-font_parse_fcname (name, font)
- char *name;
- Lisp_Object font;
+font_parse_fcname (char *name, Lisp_Object font)
{
char *p, *q;
char *size_beg = NULL, *size_end = NULL;
@@ -1544,7 +1507,7 @@ font_parse_fcname (name, font)
int size_found = 1;
for (q = p + 1; *q && *q != ' '; q++)
- if (! isdigit (*q))
+ if (! isdigit (*q) && *q != '.')
{
size_found = 0;
break;
@@ -1648,11 +1611,7 @@ font_parse_fcname (name, font)
FONT_SIZE_INDEX of FONT is 0, use PIXEL_SIZE instead. */
int
-font_unparse_fcname (font, pixel_size, name, nbytes)
- Lisp_Object font;
- int pixel_size;
- char *name;
- int nbytes;
+font_unparse_fcname (Lisp_Object font, int pixel_size, char *name, int nbytes)
{
Lisp_Object family, foundry;
Lisp_Object tail, val;
@@ -1771,11 +1730,7 @@ font_unparse_fcname (font, pixel_size, name, nbytes)
size. */
int
-font_unparse_gtkname (font, f, name, nbytes)
- Lisp_Object font;
- struct frame *f;
- char *name;
- int nbytes;
+font_unparse_gtkname (Lisp_Object font, struct frame *f, char *name, int nbytes)
{
char *p;
int len = 1;
@@ -1858,11 +1813,9 @@ font_unparse_gtkname (font, f, name, nbytes)
0. Otherwise return -1. */
static int
-font_parse_name (name, font)
- char *name;
- Lisp_Object font;
+font_parse_name (char *name, Lisp_Object font)
{
- if (name[0] == '-' || index (name, '*') || index (name, '?'))
+ if (name[0] == '-' || strchr (name, '*') || strchr (name, '?'))
return font_parse_xlfd (name, font);
return font_parse_fcname (name, font);
}
@@ -1873,8 +1826,7 @@ font_parse_name (name, font)
part. */
void
-font_parse_family_registry (family, registry, font_spec)
- Lisp_Object family, registry, font_spec;
+font_parse_family_registry (Lisp_Object family, Lisp_Object registry, Lisp_Object font_spec)
{
int len;
char *p0, *p1;
@@ -1885,7 +1837,7 @@ font_parse_family_registry (family, registry, font_spec)
CHECK_STRING (family);
len = SBYTES (family);
p0 = (char *) SDATA (family);
- p1 = index (p0, '-');
+ p1 = strchr (p0, '-');
if (p1)
{
if ((*p0 != '*' && p1 - p0 > 0)
@@ -1904,7 +1856,7 @@ font_parse_family_registry (family, registry, font_spec)
CHECK_STRING (registry);
len = SBYTES (registry);
p0 = (char *) SDATA (registry);
- p1 = index (p0, '-');
+ p1 = strchr (p0, '-');
if (! p1)
{
if (SDATA (registry)[len - 1] == '*')
@@ -2220,17 +2172,16 @@ font_otf_Anchor (anchor)
/* Font sorting */
-static unsigned font_score P_ ((Lisp_Object, Lisp_Object *));
-static int font_compare P_ ((const void *, const void *));
-static Lisp_Object font_sort_entities P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, int));
+static unsigned font_score (Lisp_Object, Lisp_Object *);
+static int font_compare (const void *, const void *);
+static Lisp_Object font_sort_entities (Lisp_Object, Lisp_Object,
+ Lisp_Object, int);
/* Return a rescaling ratio of FONT_ENTITY. */
extern Lisp_Object Vface_font_rescale_alist;
static double
-font_rescale_ratio (font_entity)
- Lisp_Object font_entity;
+font_rescale_ratio (Lisp_Object font_entity)
{
Lisp_Object tail, elt;
Lisp_Object name = Qnil;
@@ -2277,8 +2228,7 @@ static int sort_shift_bits[FONT_SIZE_INDEX + 1];
SPEC_PROP. */
static unsigned
-font_score (entity, spec_prop)
- Lisp_Object entity, *spec_prop;
+font_score (Lisp_Object entity, Lisp_Object *spec_prop)
{
unsigned score = 0;
int i;
@@ -2352,8 +2302,7 @@ struct font_sort_data
/* The comparison function for qsort. */
static int
-font_compare (d1, d2)
- const void *d1, *d2;
+font_compare (const void *d1, const void *d2)
{
const struct font_sort_data *data1 = d1;
const struct font_sort_data *data2 = d2;
@@ -2381,9 +2330,7 @@ font_compare (d1, d2)
such a case. */
static Lisp_Object
-font_sort_entities (list, prefer, frame, best_only)
- Lisp_Object list, prefer, frame;
- int best_only;
+font_sort_entities (Lisp_Object list, Lisp_Object prefer, Lisp_Object frame, int best_only)
{
Lisp_Object prefer_prop[FONT_SPEC_MAX];
int len, maxlen, i;
@@ -2488,8 +2435,7 @@ font_sort_entities (list, prefer, frame, best_only)
function with font_sort_order after setting up it. */
void
-font_update_sort_order (order)
- int *order;
+font_update_sort_order (int *order)
{
int i, shift_bits;
@@ -2509,8 +2455,7 @@ font_update_sort_order (order)
}
static int
-font_check_otf_features (script, langsys, features, table)
- Lisp_Object script, langsys, features, table;
+font_check_otf_features (Lisp_Object script, Lisp_Object langsys, Lisp_Object features, Lisp_Object table)
{
Lisp_Object val;
int negative;
@@ -2584,8 +2529,7 @@ font_check_otf (Lisp_Object spec, Lisp_Object otf_capability)
specification SPEC. */
int
-font_match_p (spec, font)
- Lisp_Object spec, font;
+font_match_p (Lisp_Object spec, Lisp_Object font)
{
Lisp_Object prop[FONT_SPEC_MAX], *props;
Lisp_Object extra, font_extra;
@@ -2701,16 +2645,14 @@ font_match_p (spec, font)
is a number frames sharing this cache, and FONT-CACHE-DATA is a
cons (FONT-SPEC FONT-ENTITY ...). */
-static void font_prepare_cache P_ ((FRAME_PTR, struct font_driver *));
-static void font_finish_cache P_ ((FRAME_PTR, struct font_driver *));
-static Lisp_Object font_get_cache P_ ((FRAME_PTR, struct font_driver *));
-static void font_clear_cache P_ ((FRAME_PTR, Lisp_Object,
- struct font_driver *));
+static void font_prepare_cache (FRAME_PTR, struct font_driver *);
+static void font_finish_cache (FRAME_PTR, struct font_driver *);
+static Lisp_Object font_get_cache (FRAME_PTR, struct font_driver *);
+static void font_clear_cache (FRAME_PTR, Lisp_Object,
+ struct font_driver *);
static void
-font_prepare_cache (f, driver)
- FRAME_PTR f;
- struct font_driver *driver;
+font_prepare_cache (FRAME_PTR f, struct font_driver *driver)
{
Lisp_Object cache, val;
@@ -2732,9 +2674,7 @@ font_prepare_cache (f, driver)
static void
-font_finish_cache (f, driver)
- FRAME_PTR f;
- struct font_driver *driver;
+font_finish_cache (FRAME_PTR f, struct font_driver *driver)
{
Lisp_Object cache, val, tmp;
@@ -2755,9 +2695,7 @@ font_finish_cache (f, driver)
static Lisp_Object
-font_get_cache (f, driver)
- FRAME_PTR f;
- struct font_driver *driver;
+font_get_cache (FRAME_PTR f, struct font_driver *driver)
{
Lisp_Object val = driver->get_cache (f);
Lisp_Object type = driver->type;
@@ -2773,10 +2711,7 @@ font_get_cache (f, driver)
static int num_fonts;
static void
-font_clear_cache (f, cache, driver)
- FRAME_PTR f;
- Lisp_Object cache;
- struct font_driver *driver;
+font_clear_cache (FRAME_PTR f, Lisp_Object cache, struct font_driver *driver)
{
Lisp_Object tail, elt;
Lisp_Object tail2, entity;
@@ -2830,9 +2765,7 @@ static Lisp_Object scratch_font_spec, scratch_font_prefer;
extern Lisp_Object Vface_ignored_fonts;
Lisp_Object
-font_delete_unmatched (vec, spec, size)
- Lisp_Object vec, spec;
- int size;
+font_delete_unmatched (Lisp_Object vec, Lisp_Object spec, int size)
{
Lisp_Object entity, val;
enum font_property_index prop;
@@ -2905,8 +2838,7 @@ font_delete_unmatched (vec, spec, size)
same font-driver. */
Lisp_Object
-font_list_entities (frame, spec)
- Lisp_Object frame, spec;
+font_list_entities (Lisp_Object frame, Lisp_Object spec)
{
FRAME_PTR f = XFRAME (frame);
struct font_driver_list *driver_list = f->font_driver_list;
@@ -2982,9 +2914,7 @@ font_list_entities (frame, spec)
font-related attributes. */
static Lisp_Object
-font_matching_entity (f, attrs, spec)
- FRAME_PTR f;
- Lisp_Object *attrs, spec;
+font_matching_entity (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec)
{
struct font_driver_list *driver_list = f->font_driver_list;
Lisp_Object ftype, size, entity;
@@ -3032,10 +2962,7 @@ font_matching_entity (f, attrs, spec)
opened font object. */
static Lisp_Object
-font_open_entity (f, entity, pixel_size)
- FRAME_PTR f;
- Lisp_Object entity;
- int pixel_size;
+font_open_entity (FRAME_PTR f, Lisp_Object entity, int pixel_size)
{
struct font_driver_list *driver_list;
Lisp_Object objlist, size, val, font_object;
@@ -3078,7 +3005,6 @@ font_open_entity (f, entity, pixel_size)
return Qnil;
ASET (entity, FONT_OBJLIST_INDEX,
Fcons (font_object, AREF (entity, FONT_OBJLIST_INDEX)));
- ASET (font_object, FONT_OBJLIST_INDEX, Qnil);
num_fonts++;
font = XFONT_OBJECT (font_object);
@@ -3111,9 +3037,7 @@ font_open_entity (f, entity, pixel_size)
/* Close FONT_OBJECT that is opened on frame F. */
void
-font_close_object (f, font_object)
- FRAME_PTR f;
- Lisp_Object font_object;
+font_close_object (FRAME_PTR f, Lisp_Object font_object)
{
struct font *font = XFONT_OBJECT (font_object);
@@ -3134,10 +3058,7 @@ font_close_object (f, font_object)
FONT is a font-entity and it must be opened to check. */
int
-font_has_char (f, font, c)
- FRAME_PTR f;
- Lisp_Object font;
- int c;
+font_has_char (FRAME_PTR f, Lisp_Object font, int c)
{
struct font *fontp;
@@ -3172,9 +3093,7 @@ font_has_char (f, font, c)
/* Return the glyph ID of FONT_OBJECT for character C. */
unsigned
-font_encode_char (font_object, c)
- Lisp_Object font_object;
- int c;
+font_encode_char (Lisp_Object font_object, int c)
{
struct font *font;
@@ -3187,8 +3106,7 @@ font_encode_char (font_object, c)
/* Return the name of FONT_OBJECT. */
Lisp_Object
-font_get_name (font_object)
- Lisp_Object font_object;
+font_get_name (Lisp_Object font_object)
{
font_assert (FONT_OBJECT_P (font_object));
return AREF (font_object, FONT_NAME_INDEX);
@@ -3198,8 +3116,7 @@ font_get_name (font_object)
/* Return the specification of FONT_OBJECT. */
Lisp_Object
-font_get_spec (font_object)
- Lisp_Object font_object;
+font_get_spec (Lisp_Object font_object)
{
Lisp_Object spec = font_make_spec ();
int i;
@@ -3216,8 +3133,7 @@ font_get_spec (font_object)
could not be parsed by font_parse_name, return Qnil. */
Lisp_Object
-font_spec_from_name (font_name)
- Lisp_Object font_name;
+font_spec_from_name (Lisp_Object font_name)
{
Lisp_Object spec = Ffont_spec (0, NULL);
@@ -3231,9 +3147,7 @@ font_spec_from_name (font_name)
void
-font_clear_prop (attrs, prop)
- Lisp_Object *attrs;
- enum font_property_index prop;
+font_clear_prop (Lisp_Object *attrs, enum font_property_index prop)
{
Lisp_Object font = attrs[LFACE_FONT_INDEX];
@@ -3284,9 +3198,7 @@ font_clear_prop (attrs, prop)
}
void
-font_update_lface (f, attrs)
- FRAME_PTR f;
- Lisp_Object *attrs;
+font_update_lface (FRAME_PTR f, Lisp_Object *attrs)
{
Lisp_Object spec;
@@ -3333,9 +3245,7 @@ font_update_lface (f, attrs)
supports C and matches best with ATTRS and PIXEL_SIZE. */
static Lisp_Object
-font_select_entity (frame, entities, attrs, pixel_size, c)
- Lisp_Object frame, entities, *attrs;
- int pixel_size, c;
+font_select_entity (Lisp_Object frame, Lisp_Object entities, Lisp_Object *attrs, int pixel_size, int c)
{
Lisp_Object font_entity;
Lisp_Object prefer;
@@ -3380,11 +3290,7 @@ font_select_entity (frame, entities, attrs, pixel_size, c)
character that the entity must support. */
Lisp_Object
-font_find_for_lface (f, attrs, spec, c)
- FRAME_PTR f;
- Lisp_Object *attrs;
- Lisp_Object spec;
- int c;
+font_find_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec, int c)
{
Lisp_Object work;
Lisp_Object frame, entities, val;
@@ -3534,11 +3440,7 @@ font_find_for_lface (f, attrs, spec, c)
Lisp_Object
-font_open_for_lface (f, entity, attrs, spec)
- FRAME_PTR f;
- Lisp_Object entity;
- Lisp_Object *attrs;
- Lisp_Object spec;
+font_open_for_lface (FRAME_PTR f, Lisp_Object entity, Lisp_Object *attrs, Lisp_Object spec)
{
int size;
@@ -3581,9 +3483,7 @@ font_open_for_lface (f, entity, attrs, spec)
font-object. */
Lisp_Object
-font_load_for_lface (f, attrs, spec)
- FRAME_PTR f;
- Lisp_Object *attrs, spec;
+font_load_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec)
{
Lisp_Object entity, name;
@@ -3613,9 +3513,7 @@ font_load_for_lface (f, attrs, spec)
/* Make FACE on frame F ready to use the font opened for FACE. */
void
-font_prepare_for_face (f, face)
- FRAME_PTR f;
- struct face *face;
+font_prepare_for_face (FRAME_PTR f, struct face *face)
{
if (face->font->driver->prepare_face)
face->font->driver->prepare_face (f, face);
@@ -3625,9 +3523,7 @@ font_prepare_for_face (f, face)
/* Make FACE on frame F stop using the font opened for FACE. */
void
-font_done_for_face (f, face)
- FRAME_PTR f;
- struct face *face;
+font_done_for_face (FRAME_PTR f, struct face *face)
{
if (face->font->driver->done_face)
face->font->driver->done_face (f, face);
@@ -3639,9 +3535,7 @@ font_done_for_face (f, face)
font is found, return Qnil. */
Lisp_Object
-font_open_by_spec (f, spec)
- FRAME_PTR f;
- Lisp_Object spec;
+font_open_by_spec (FRAME_PTR f, Lisp_Object spec)
{
Lisp_Object attrs[LFACE_VECTOR_SIZE];
@@ -3665,9 +3559,7 @@ font_open_by_spec (f, spec)
found, return Qnil. */
Lisp_Object
-font_open_by_name (f, name)
- FRAME_PTR f;
- char *name;
+font_open_by_name (FRAME_PTR f, char *name)
{
Lisp_Object args[2];
Lisp_Object spec, ret;
@@ -3697,9 +3589,7 @@ font_open_by_name (f, name)
(e.g. syms_of_xfont). */
void
-register_font_driver (driver, f)
- struct font_driver *driver;
- FRAME_PTR f;
+register_font_driver (struct font_driver *driver, FRAME_PTR f)
{
struct font_driver_list *root = f ? f->font_driver_list : font_driver_list;
struct font_driver_list *prev, *list;
@@ -3727,8 +3617,7 @@ register_font_driver (driver, f)
}
void
-free_font_driver_list (f)
- FRAME_PTR f;
+free_font_driver_list (FRAME_PTR f)
{
struct font_driver_list *list, *next;
@@ -3750,9 +3639,7 @@ free_font_driver_list (f)
F. */
Lisp_Object
-font_update_drivers (f, new_drivers)
- FRAME_PTR f;
- Lisp_Object new_drivers;
+font_update_drivers (FRAME_PTR f, Lisp_Object new_drivers)
{
Lisp_Object active_drivers = Qnil;
struct font_driver *driver;
@@ -3843,10 +3730,7 @@ font_update_drivers (f, new_drivers)
}
int
-font_put_frame_data (f, driver, data)
- FRAME_PTR f;
- struct font_driver *driver;
- void *data;
+font_put_frame_data (FRAME_PTR f, struct font_driver *driver, void *data)
{
struct font_data_list *list, *prev;
@@ -3880,9 +3764,7 @@ font_put_frame_data (f, driver, data)
void *
-font_get_frame_data (f, driver)
- FRAME_PTR f;
- struct font_driver *driver;
+font_get_frame_data (FRAME_PTR f, struct font_driver *driver)
{
struct font_data_list *list;
@@ -3901,12 +3783,7 @@ font_get_frame_data (f, driver)
STRING. */
Lisp_Object
-font_at (c, pos, face, w, string)
- int c;
- EMACS_INT pos;
- struct face *face;
- struct window *w;
- Lisp_Object string;
+font_at (int c, EMACS_INT pos, struct face *face, struct window *w, Lisp_Object string)
{
FRAME_PTR f;
int multibyte;
@@ -3988,11 +3865,7 @@ font_at (c, pos, face, w, string)
It is assured that the current buffer (or STRING) is multibyte. */
Lisp_Object
-font_range (pos, limit, w, face, string)
- EMACS_INT pos, *limit;
- struct window *w;
- struct face *face;
- Lisp_Object string;
+font_range (EMACS_INT pos, EMACS_INT *limit, struct window *w, struct face *face, Lisp_Object string)
{
EMACS_INT pos_byte, ignore;
int c;
@@ -4051,8 +3924,7 @@ Return nil otherwise.
Optional 2nd argument EXTRA-TYPE, if non-nil, specifies to check
which kind of font it is. It must be one of `font-spec', `font-entity',
`font-object'. */)
- (object, extra_type)
- Lisp_Object object, extra_type;
+ (Lisp_Object object, Lisp_Object extra_type)
{
if (NILP (extra_type))
return (FONTP (object) ? Qt : Qnil);
@@ -4130,9 +4002,7 @@ be an OpenType font, and whose GPOS table of `thai' script's default
language system must contain `mark' feature.
usage: (font-spec ARGS...) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
Lisp_Object spec = font_make_spec ();
int i;
@@ -4173,8 +4043,7 @@ usage: (font-spec ARGS...) */)
DEFUN ("copy-font-spec", Fcopy_font_spec, Scopy_font_spec, 1, 1, 0,
doc: /* Return a copy of FONT as a font-spec. */)
- (font)
- Lisp_Object font;
+ (Lisp_Object font)
{
Lisp_Object new_spec, tail, prev, extra;
int i;
@@ -4202,8 +4071,7 @@ DEFUN ("merge-font-spec", Fmerge_font_spec, Smerge_font_spec, 2, 2, 0,
doc: /* Merge font-specs FROM and TO, and return a new font-spec.
Every specified properties in FROM override the corresponding
properties in TO. */)
- (from, to)
- Lisp_Object from, to;
+ (Lisp_Object from, Lisp_Object to)
{
Lisp_Object extra, tail;
int i;
@@ -4231,16 +4099,24 @@ properties in TO. */)
DEFUN ("font-get", Ffont_get, Sfont_get, 2, 2, 0,
doc: /* Return the value of FONT's property KEY.
FONT is a font-spec, a font-entity, or a font-object.
-KEY must be one of these symbols:
+KEY is any symbol, but these are reserved for specific meanings:
:family, :weight, :slant, :width, :foundry, :adstyle, :registry,
- :size, :name, :script
+ :size, :name, :script, :otf
See the documentation of `font-spec' for their meanings.
-If FONT is a font-entity or font-object, the value of :script may be
-a list of scripts that are supported by the font. */)
- (font, key)
- Lisp_Object font, key;
+In addition, if FONT is a font-entity or a font-object, values of
+:script and :otf are different from those of a font-spec as below:
+
+The value of :script may be a list of scripts that are supported by the font.
+
+The value of :otf is a cons (GSUB . GPOS) where GSUB and GPOS are lists
+representing the OpenType features supported by the font by this form:
+ ((SCRIPT (LANGSYS FEATURE ...) ...) ...)
+SCRIPT, LANGSYS, and FEATURE are all symbols representing OpenType
+Layout tags. */)
+ (Lisp_Object font, Lisp_Object key)
{
int idx;
+ Lisp_Object val;
CHECK_FONT (font);
CHECK_SYMBOL (key);
@@ -4250,7 +4126,20 @@ a list of scripts that are supported by the font. */)
return font_style_symbolic (font, idx, 0);
if (idx >= 0 && idx < FONT_EXTRA_INDEX)
return AREF (font, idx);
- return Fcdr (Fassq (key, AREF (font, FONT_EXTRA_INDEX)));
+ val = Fassq (key, AREF (font, FONT_EXTRA_INDEX));
+ if (NILP (val) && EQ (key, QCotf) && FONT_OBJECT_P (font))
+ {
+ struct font *fontp = XFONT_OBJECT (font);
+
+ if (fontp->driver->otf_capability)
+ val = fontp->driver->otf_capability (fontp);
+ else
+ val = Fcons (Qnil, Qnil);
+ font_put_extra (font, QCotf, val);
+ }
+ else
+ val = Fcdr (val);
+ return val;
}
#ifdef HAVE_WINDOW_SYSTEM
@@ -4268,8 +4157,7 @@ may be omitted from the list if they are not specified by FONT.
The optional argument FRAME specifies the frame that the face attributes
are to be displayed on. If omitted, the selected frame is used. */)
- (font, frame)
- Lisp_Object font, frame;
+ (Lisp_Object font, Lisp_Object frame)
{
struct frame *f;
Lisp_Object plist[10];
@@ -4342,18 +4230,36 @@ are to be displayed on. If omitted, the selected frame is used. */)
#endif
DEFUN ("font-put", Ffont_put, Sfont_put, 3, 3, 0,
- doc: /* Set one property of FONT-SPEC: give property PROP value VAL. */)
- (font_spec, prop, val)
- Lisp_Object font_spec, prop, val;
+ doc: /* Set one property of FONT: give property KEY value VAL.
+FONT is a font-spec, a font-entity, or a font-object.
+
+If FONT is a font-spec, KEY can be any symbol. But if KEY is the one
+accepted by the function `font-spec' (which see), VAL must be what
+allowed in `font-spec'.
+
+If FONT is a font-entity or a font-object, KEY must not be the one
+accepted by `font-spec'. */)
+ (Lisp_Object font, Lisp_Object prop, Lisp_Object val)
{
int idx;
- CHECK_FONT_SPEC (font_spec);
idx = get_font_prop_index (prop);
if (idx >= 0 && idx < FONT_EXTRA_INDEX)
- ASET (font_spec, idx, font_prop_validate (idx, Qnil, val));
+ {
+ CHECK_FONT_SPEC (font);
+ ASET (font, idx, font_prop_validate (idx, Qnil, val));
+ }
else
- font_put_extra (font_spec, prop, font_prop_validate (0, prop, val));
+ {
+ if (EQ (prop, QCname)
+ || EQ (prop, QCscript)
+ || EQ (prop, QClang)
+ || EQ (prop, QCotf))
+ CHECK_FONT_SPEC (font);
+ else
+ CHECK_FONT (font);
+ font_put_extra (font, prop, font_prop_validate (0, prop, val));
+ }
return val;
}
@@ -4364,8 +4270,7 @@ Optional 3rd argument NUM, if non-nil, limits the number of returned fonts.
Optional 4th argument PREFER, if non-nil, is a font-spec to
control the order of the returned list. Fonts are sorted by
how close they are to PREFER. */)
- (font_spec, frame, num, prefer)
- Lisp_Object font_spec, frame, num, prefer;
+ (Lisp_Object font_spec, Lisp_Object frame, Lisp_Object num, Lisp_Object prefer)
{
Lisp_Object vec, list;
int n = 0;
@@ -4414,8 +4319,7 @@ how close they are to PREFER. */)
DEFUN ("font-family-list", Ffont_family_list, Sfont_family_list, 0, 1, 0,
doc: /* List available font families on the current frame.
Optional argument FRAME, if non-nil, specifies the target frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
FRAME_PTR f;
struct font_driver_list *driver_list;
@@ -4444,8 +4348,7 @@ Optional argument FRAME, if non-nil, specifies the target frame. */)
DEFUN ("find-font", Ffind_font, Sfind_font, 1, 2, 0,
doc: /* Return a font-entity matching with FONT-SPEC on the current frame.
Optional 2nd argument FRAME, if non-nil, specifies the target frame. */)
- (font_spec, frame)
- Lisp_Object font_spec, frame;
+ (Lisp_Object font_spec, Lisp_Object frame)
{
Lisp_Object val = Flist_fonts (font_spec, frame, make_number (1), Qnil);
@@ -4460,8 +4363,7 @@ FONT is a font-spec, font-entity, or font-object.
If the name is too long for XLFD (maximum 255 chars), return nil.
If the 2nd optional arg FOLD-WILDCARDS is non-nil,
the consecutive wildcards are folded to one. */)
- (font, fold_wildcards)
- Lisp_Object font, fold_wildcards;
+ (Lisp_Object font, Lisp_Object fold_wildcards)
{
char name[256];
int pixel_size = 0;
@@ -4501,7 +4403,7 @@ the consecutive wildcards are folded to one. */)
DEFUN ("clear-font-cache", Fclear_font_cache, Sclear_font_cache, 0, 0, 0,
doc: /* Clear font cache. */)
- ()
+ (void)
{
Lisp_Object list, frame;
@@ -4535,8 +4437,7 @@ DEFUN ("clear-font-cache", Fclear_font_cache, Sclear_font_cache, 0, 0, 0,
void
-font_fill_lglyph_metrics (glyph, font_object)
- Lisp_Object glyph, font_object;
+font_fill_lglyph_metrics (Lisp_Object glyph, Lisp_Object font_object)
{
struct font *font = XFONT_OBJECT (font_object);
unsigned code;
@@ -4563,8 +4464,7 @@ header of the glyph-string.
If the shaping was successful, the value is GSTRING itself or a newly
created glyph-string. Otherwise, the value is nil. */)
- (gstring)
- Lisp_Object gstring;
+ (Lisp_Object gstring)
{
struct font *font;
Lisp_Object font_object, n, glyph;
@@ -4641,8 +4541,7 @@ where
VARIATION-SELECTOR is a chracter code of variation selection
(#xFE00..#xFE0F or #xE0100..#xE01EF)
GLYPH-ID is a glyph code of the corresponding variation glyph. */)
- (font_object, character)
- Lisp_Object font_object, character;
+ (Lisp_Object font_object, Lisp_Object character)
{
unsigned variations[256];
struct font *font;
@@ -4710,8 +4609,7 @@ produced in GSTRING-OUT, and the value is nil.
See the documentation of `font-make-gstring' for the format of
glyph-string. */)
- (otf_features, gstring_in, from, to, gstring_out, index)
- Lisp_Object otf_features, gstring_in, from, to, gstring_out, index;
+ (Lisp_Object otf_features, Lisp_Object gstring_in, Lisp_Object from, Lisp_Object to, Lisp_Object gstring_out, Lisp_Object index)
{
Lisp_Object font_object = LGSTRING_FONT (gstring_in);
Lisp_Object val;
@@ -4761,8 +4659,7 @@ The value is a list of cons cells of the format (GLYPH-ID . CHARACTER),
where GLYPH-ID is a glyph index of the font, and CHARACTER is a
character code corresponding to the glyph or nil if there's no
corresponding character. */)
- (font_object, character, otf_features)
- Lisp_Object font_object, character, otf_features;
+ (Lisp_Object font_object, Lisp_Object character, Lisp_Object otf_features)
{
struct font *font;
Lisp_Object gstring_in, gstring_out, g;
@@ -4803,10 +4700,7 @@ corresponding character. */)
DEFUN ("open-font", Fopen_font, Sopen_font, 1, 3, 0,
doc: /* Open FONT-ENTITY. */)
- (font_entity, size, frame)
- Lisp_Object font_entity;
- Lisp_Object size;
- Lisp_Object frame;
+ (Lisp_Object font_entity, Lisp_Object size, Lisp_Object frame)
{
int isize;
@@ -4832,8 +4726,7 @@ DEFUN ("open-font", Fopen_font, Sopen_font, 1, 3, 0,
DEFUN ("close-font", Fclose_font, Sclose_font, 1, 2, 0,
doc: /* Close FONT-OBJECT. */)
- (font_object, frame)
- Lisp_Object font_object, frame;
+ (Lisp_Object font_object, Lisp_Object frame)
{
CHECK_FONT_OBJECT (font_object);
if (NILP (frame))
@@ -4884,8 +4777,7 @@ representing the default langsys.
FEATURE is a symbol representing OpenType feature tag.
If the font is not OpenType font, CAPABILITY is nil. */)
- (font_object)
- Lisp_Object font_object;
+ (Lisp_Object font_object)
{
struct font *font;
Lisp_Object val;
@@ -4906,25 +4798,99 @@ If the font is not OpenType font, CAPABILITY is nil. */)
return val;
}
-DEFUN ("get-font-glyphs", Fget_font_glyphs, Sget_font_glyphs, 2, 2, 0,
- doc: /* Return a vector of glyphs of FONT-OBJECT for drawing STRING.
-Each element is a vector [GLYPH-CODE LBEARING RBEARING WIDTH ASCENT DESCENT]. */)
- (font_object, string)
- Lisp_Object font_object, string;
+DEFUN ("font-get-glyphs", Ffont_get_glyphs, Sfont_get_glyphs, 3, 4, 0,
+ doc:
+ /* Return a vector of FONT-OBJECT's glyphs for the specified characters.
+FROM and TO are positions (integers or markers) specifying a region
+of the current buffer.
+If the optional fourth arg OBJECT is not nil, it is a string or a
+vector containing the target characters.
+
+Each element is a vector containing information of a glyph in this format:
+ [FROM-IDX TO-IDX C CODE WIDTH LBEARING RBEARING ASCENT DESCENT ADJUSTMENT]
+where
+ FROM is an index numbers of a character the glyph corresponds to.
+ TO is the same as FROM.
+ C is the character of the glyph.
+ CODE is the glyph-code of C in FONT-OBJECT.
+ WIDTH thru DESCENT are the metrics (in pixels) of the glyph.
+ ADJUSTMENT is always nil.
+If FONT-OBJECT doesn't have a glyph for a character,
+the corresponding element is nil. */)
+ (Lisp_Object font_object, Lisp_Object from, Lisp_Object to,
+ Lisp_Object object)
{
struct font *font;
- int i, len;
- Lisp_Object vec;
+ int i, len, c;
+ Lisp_Object *chars, vec;
+ USE_SAFE_ALLOCA;
CHECK_FONT_GET_OBJECT (font_object, font);
- CHECK_STRING (string);
- len = SCHARS (string);
+ if (NILP (object))
+ {
+ EMACS_INT charpos, bytepos;
+
+ validate_region (&from, &to);
+ if (EQ (from, to))
+ return Qnil;
+ len = XFASTINT (to) - XFASTINT (from);
+ SAFE_ALLOCA_LISP (chars, len);
+ charpos = XFASTINT (from);
+ bytepos = CHAR_TO_BYTE (charpos);
+ for (i = 0; charpos < XFASTINT (to); i++)
+ {
+ FETCH_CHAR_ADVANCE (c, charpos, bytepos);
+ chars[i] = make_number (c);
+ }
+ }
+ else if (STRINGP (object))
+ {
+ const unsigned char *p;
+
+ CHECK_NUMBER (from);
+ CHECK_NUMBER (to);
+ if (XINT (from) < 0 || XINT (from) > XINT (to)
+ || XINT (to) > SCHARS (object))
+ args_out_of_range_3 (object, from, to);
+ if (EQ (from, to))
+ return Qnil;
+ len = XFASTINT (to) - XFASTINT (from);
+ SAFE_ALLOCA_LISP (chars, len);
+ p = SDATA (object);
+ if (STRING_MULTIBYTE (object))
+ for (i = 0; i < len; i++)
+ {
+ c = STRING_CHAR_ADVANCE (p);
+ chars[i] = make_number (c);
+ }
+ else
+ for (i = 0; i < len; i++)
+ chars[i] = make_number (p[i]);
+ }
+ else
+ {
+ CHECK_VECTOR (object);
+ CHECK_NUMBER (from);
+ CHECK_NUMBER (to);
+ if (XINT (from) < 0 || XINT (from) > XINT (to)
+ || XINT (to) > ASIZE (object))
+ args_out_of_range_3 (object, from, to);
+ if (EQ (from, to))
+ return Qnil;
+ len = XFASTINT (to) - XFASTINT (from);
+ for (i = 0; i < len; i++)
+ {
+ Lisp_Object elt = AREF (object, XFASTINT (from) + i);
+ CHECK_CHARACTER (elt);
+ }
+ chars = &(AREF (object, XFASTINT (from)));
+ }
+
vec = Fmake_vector (make_number (len), Qnil);
for (i = 0; i < len; i++)
{
- Lisp_Object ch = Faref (string, make_number (i));
- Lisp_Object val;
- int c = XINT (ch);
+ Lisp_Object g;
+ int c = XFASTINT (chars[i]);
unsigned code;
EMACS_INT cod;
struct font_metrics metrics;
@@ -4932,28 +4898,28 @@ Each element is a vector [GLYPH-CODE LBEARING RBEARING WIDTH ASCENT DESCENT]. *
cod = code = font->driver->encode_char (font, c);
if (code == FONT_INVALID_CODE)
continue;
- val = Fmake_vector (make_number (6), Qnil);
- if (cod <= MOST_POSITIVE_FIXNUM)
- ASET (val, 0, make_number (code));
- else
- ASET (val, 0, Fcons (make_number (code >> 16),
- make_number (code & 0xFFFF)));
+ g = Fmake_vector (make_number (LGLYPH_SIZE), Qnil);
+ LGLYPH_SET_FROM (g, i);
+ LGLYPH_SET_TO (g, i);
+ LGLYPH_SET_CHAR (g, c);
+ LGLYPH_SET_CODE (g, code);
font->driver->text_extents (font, &code, 1, &metrics);
- ASET (val, 1, make_number (metrics.lbearing));
- ASET (val, 2, make_number (metrics.rbearing));
- ASET (val, 3, make_number (metrics.width));
- ASET (val, 4, make_number (metrics.ascent));
- ASET (val, 5, make_number (metrics.descent));
- ASET (vec, i, val);
- }
+ LGLYPH_SET_WIDTH (g, metrics.width);
+ LGLYPH_SET_LBEARING (g, metrics.lbearing);
+ LGLYPH_SET_RBEARING (g, metrics.rbearing);
+ LGLYPH_SET_ASCENT (g, metrics.ascent);
+ LGLYPH_SET_DESCENT (g, metrics.descent);
+ ASET (vec, i, g);
+ }
+ if (! VECTORP (object))
+ SAFE_FREE ();
return vec;
}
DEFUN ("font-match-p", Ffont_match_p, Sfont_match_p, 2, 2, 0,
doc: /* Return t if and only if font-spec SPEC matches with FONT.
FONT is a font-spec, font-entity, or font-object. */)
- (spec, font)
- Lisp_Object spec, font;
+ (Lisp_Object spec, Lisp_Object font)
{
CHECK_FONT_SPEC (spec);
CHECK_FONT (font);
@@ -4965,8 +4931,7 @@ DEFUN ("font-at", Ffont_at, Sfont_at, 1, 3, 0,
doc: /* Return a font-object for displaying a character at POSITION.
Optional second arg WINDOW, if non-nil, is a window displaying
the current buffer. It defaults to the currently selected window. */)
- (position, window, string)
- Lisp_Object position, window, string;
+ (Lisp_Object position, Lisp_Object window, Lisp_Object string)
{
struct window *w;
EMACS_INT pos;
@@ -4999,8 +4964,7 @@ DEFUN ("draw-string", Fdraw_string, Sdraw_string, 2, 2, 0,
doc: /* Draw STRING by FONT-OBJECT on the top left corner of the current frame.
The value is a number of glyphs drawn.
Type C-l to recover what previously shown. */)
- (font_object, string)
- Lisp_Object font_object, string;
+ (Lisp_Object font_object, Lisp_Object string)
{
Lisp_Object frame = selected_frame;
FRAME_PTR f = XFRAME (frame);
@@ -5054,8 +5018,7 @@ where
RELATIVE-COMPOSE and DEFAULT-ASCENT are the numbers controlling
how to compose characters.
If the named font is not yet loaded, return nil. */)
- (name, frame)
- Lisp_Object name, frame;
+ (Lisp_Object name, Lisp_Object frame)
{
FRAME_PTR f;
struct font *font;
@@ -5118,9 +5081,7 @@ If the named font is not yet loaded, return nil. */)
build_style_table ((TBL), sizeof TBL / sizeof (struct table_entry))
static Lisp_Object
-build_style_table (entry, nelement)
- struct table_entry *entry;
- int nelement;
+build_style_table (const struct table_entry *entry, int nelement)
{
int i, j;
Lisp_Object table, elt;
@@ -5150,9 +5111,7 @@ static Lisp_Object Vfont_log_deferred;
opening), ARG is the argument for the action, and RESULT is the
result of the action. */
void
-font_add_log (action, arg, result)
- char *action;
- Lisp_Object arg, result;
+font_add_log (char *action, Lisp_Object arg, Lisp_Object result)
{
Lisp_Object tail, val;
int i;
@@ -5238,9 +5197,7 @@ font_add_log (action, arg, result)
as font_add_log. */
void
-font_deferred_log (action, arg, result)
- char *action;
- Lisp_Object arg, result;
+font_deferred_log (char *action, Lisp_Object arg, Lisp_Object result)
{
if (EQ (Vfont_log, Qt))
return;
@@ -5249,17 +5206,17 @@ font_deferred_log (action, arg, result)
ASET (Vfont_log_deferred, 2, result);
}
-extern void syms_of_ftfont P_ (());
-extern void syms_of_xfont P_ (());
-extern void syms_of_xftfont P_ (());
-extern void syms_of_ftxfont P_ (());
-extern void syms_of_bdffont P_ (());
-extern void syms_of_w32font P_ (());
-extern void syms_of_atmfont P_ (());
-extern void syms_of_nsfont P_ (());
+extern void syms_of_ftfont (void);
+extern void syms_of_xfont (void);
+extern void syms_of_xftfont (void);
+extern void syms_of_ftxfont (void);
+extern void syms_of_bdffont (void);
+extern void syms_of_w32font (void);
+extern void syms_of_atmfont (void);
+extern void syms_of_nsfont (void);
void
-syms_of_font ()
+syms_of_font (void)
{
sort_shift_bits[FONT_TYPE_INDEX] = 0;
sort_shift_bits[FONT_SLANT_INDEX] = 2;
@@ -5347,7 +5304,7 @@ syms_of_font ()
defsubr (&Sopen_font);
defsubr (&Sclose_font);
defsubr (&Squery_font);
- defsubr (&Sget_font_glyphs);
+ defsubr (&Sfont_get_glyphs);
defsubr (&Sfont_match_p);
defsubr (&Sfont_at);
#if 0
@@ -5446,7 +5403,7 @@ EMACS_FONT_LOG is set. Otherwise, it is set to t. */);
}
void
-init_font ()
+init_font (void)
{
Vfont_log = egetenv ("EMACS_FONT_LOG") ? Qnil : Qt;
}
diff --git a/src/font.h b/src/font.h
index 952ea269495..694f07e5f07 100644
--- a/src/font.h
+++ b/src/font.h
@@ -159,14 +159,19 @@ enum font_property_index
/* This value is the length of font-spec vector. */
FONT_SPEC_MAX,
- /* The followings are used only for a font-entity. */
+ /* The followings are used only for a font-entity and a font-object. */
/* List of font-objects opened from the font-entity. */
FONT_OBJLIST_INDEX = FONT_SPEC_MAX,
+ /* Font-entity from which the font-object is opened. */
+ FONT_ENTITY_INDEX = FONT_SPEC_MAX,
+
/* This value is the length of font-entity vector. */
FONT_ENTITY_MAX,
+ /* The followings are used only for a font-object. */
+
/* XLFD name of the font (string). */
FONT_NAME_INDEX = FONT_ENTITY_MAX,
@@ -507,7 +512,7 @@ struct font_driver
/* Return a cache of font-entities on frame F. The cache must be a
cons whose cdr part is the actual cache area. */
- Lisp_Object (*get_cache) P_ ((FRAME_PTR F));
+ Lisp_Object (*get_cache) (FRAME_PTR F);
/* List fonts exactly matching with FONT_SPEC on FRAME. The value
is a list of font-entities. The font properties to be considered
@@ -530,7 +535,7 @@ struct font_driver
This and the following `match' are the only APIs that allocate
font-entities. */
- Lisp_Object (*list) P_ ((Lisp_Object frame, Lisp_Object font_spec));
+ Lisp_Object (*list) (Lisp_Object frame, Lisp_Object font_spec);
/* Return a font-entity most closely matching with FONT_SPEC on
FRAME. Which font property to consider, and how to calculate the
@@ -539,92 +544,92 @@ struct font_driver
The properties that the font-entity has is the same as `list'
method. */
- Lisp_Object (*match) P_ ((Lisp_Object frame, Lisp_Object font_spec));
+ Lisp_Object (*match) (Lisp_Object frame, Lisp_Object font_spec);
/* Optional.
List available families. The value is a list of family names
(symbols). */
- Lisp_Object (*list_family) P_ ((Lisp_Object frame));
+ Lisp_Object (*list_family) (Lisp_Object frame);
/* Optional (if FONT_EXTRA_INDEX is not Lisp_Save_Value).
Free FONT_EXTRA_INDEX field of FONT_ENTITY. */
- void (*free_entity) P_ ((Lisp_Object font_entity));
+ void (*free_entity) (Lisp_Object font_entity);
/* Open a font specified by FONT_ENTITY on frame F. If the font is
scalable, open it with PIXEL_SIZE. */
- Lisp_Object (*open) P_ ((FRAME_PTR f, Lisp_Object font_entity,
- int pixel_size));
+ Lisp_Object (*open) (FRAME_PTR f, Lisp_Object font_entity,
+ int pixel_size);
/* Close FONT on frame F. */
- void (*close) P_ ((FRAME_PTR f, struct font *font));
+ void (*close) (FRAME_PTR f, struct font *font);
/* Optional (if FACE->extra is not used).
Prepare FACE for displaying characters by FONT on frame F by
storing some data in FACE->extra. If successful, return 0.
Otherwise, return -1. */
- int (*prepare_face) P_ ((FRAME_PTR f, struct face *face));
+ int (*prepare_face) (FRAME_PTR f, struct face *face);
/* Optional.
Done FACE for displaying characters by FACE->font on frame F. */
- void (*done_face) P_ ((FRAME_PTR f, struct face *face));
+ void (*done_face) (FRAME_PTR f, struct face *face);
/* Optional.
If FONT (FONT-ENTITY or FONT-OBJECT) has a glyph for character C
(Unicode code point), return 1. If not, return 0. If FONT is
FONT-ENTITY and it must be opened to check it, return -1. */
- int (*has_char) P_ ((Lisp_Object font, int c));
+ int (*has_char) (Lisp_Object font, int c);
/* Return a glyph code of FONT for characer C (Unicode code point).
If FONT doesn't have such a glyph, return FONT_INVALID_CODE. */
- unsigned (*encode_char) P_ ((struct font *font, int c));
+ unsigned (*encode_char) (struct font *font, int c);
/* Computate the total metrics of the NGLYPHS glyphs specified by
the font FONT and the sequence of glyph codes CODE, and store the
result in METRICS. */
- int (*text_extents) P_ ((struct font *font,
- unsigned *code, int nglyphs,
- struct font_metrics *metrics));
+ int (*text_extents) (struct font *font,
+ unsigned *code, int nglyphs,
+ struct font_metrics *metrics);
/* Optional.
Draw glyphs between FROM and TO of S->char2b at (X Y) pixel
position of frame F with S->FACE and S->GC. If WITH_BACKGROUND
is nonzero, fill the background in advance. It is assured that
WITH_BACKGROUND is zero when (FROM > 0 || TO < S->nchars). */
- int (*draw) P_ ((struct glyph_string *s, int from, int to,
- int x, int y, int with_background));
+ int (*draw) (struct glyph_string *s, int from, int to,
+ int x, int y, int with_background);
/* Optional.
Store bitmap data for glyph-code CODE of FONT in BITMAP. It is
intended that this method is callled from the other font-driver
for actual drawing. */
- int (*get_bitmap) P_ ((struct font *font, unsigned code,
- struct font_bitmap *bitmap,
- int bits_per_pixel));
+ int (*get_bitmap) (struct font *font, unsigned code,
+ struct font_bitmap *bitmap,
+ int bits_per_pixel);
/* Optional.
Free bitmap data in BITMAP. */
- void (*free_bitmap) P_ ((struct font *font, struct font_bitmap *bitmap));
+ void (*free_bitmap) (struct font *font, struct font_bitmap *bitmap);
/* Optional.
Return an outline data for glyph-code CODE of FONT. The format
of the outline data depends on the font-driver. */
- void *(*get_outline) P_ ((struct font *font, unsigned code));
+ void *(*get_outline) (struct font *font, unsigned code);
/* Optional.
Free OUTLINE (that is obtained by the above method). */
- void (*free_outline) P_ ((struct font *font, void *outline));
+ void (*free_outline) (struct font *font, void *outline);
/* Optional.
Get coordinates of the INDEXth anchor point of the glyph whose
code is CODE. Store the coordinates in *X and *Y. Return 0 if
the operations was successfull. Otherwise return -1. */
- int (*anchor_point) P_ ((struct font *font, unsigned code, int index,
- int *x, int *y));
+ int (*anchor_point) (struct font *font, unsigned code, int index,
+ int *x, int *y);
/* Optional.
Return a list describing which scripts/languages FONT
supports by which GSUB/GPOS features of OpenType tables. */
- Lisp_Object (*otf_capability) P_ ((struct font *font));
+ Lisp_Object (*otf_capability) (struct font *font);
/* Optional.
Apply FONT's OTF-FEATURES to the glyph string.
@@ -641,20 +646,20 @@ struct font_driver
Return the number of output codes. If none of the features are
applicable to the input data, return 0. If GSTRING-OUT is too
short, return -1. */
- int (*otf_drive) P_ ((struct font *font, Lisp_Object features,
- Lisp_Object gstring_in, int from, int to,
- Lisp_Object gstring_out, int idx, int alternate_subst));
+ int (*otf_drive) (struct font *font, Lisp_Object features,
+ Lisp_Object gstring_in, int from, int to,
+ Lisp_Object gstring_out, int idx, int alternate_subst);
/* Optional.
Make the font driver ready for frame F. Usually this function
makes some data specific to F and stores it in F by calling
font_put_frame_data (). */
- int (*start_for_frame) P_ ((FRAME_PTR f));
+ int (*start_for_frame) (FRAME_PTR f);
/* Optional.
End using the driver for frame F. Usually this function free
some data stored for F. */
- int (*end_for_frame) P_ ((FRAME_PTR f));
+ int (*end_for_frame) (FRAME_PTR f);
/* Optional.
@@ -670,14 +675,14 @@ struct font_driver
a new glyph object and storing it in GSTRING. If (M) is greater
than the length of GSTRING, nil should be return. In that case,
this function is called again with the larger GSTRING. */
- Lisp_Object (*shape) P_ ((Lisp_Object lgstring));
+ Lisp_Object (*shape) (Lisp_Object lgstring);
/* Optional.
If FONT is usable on frame F, return 0. Otherwise return -1.
This method is used only for debugging. If this method is NULL,
Emacs assumes that the font is usable on any frame. */
- int (*check) P_ ((FRAME_PTR F, struct font *font));
+ int (*check) (FRAME_PTR F, struct font *font);
/* Optional.
@@ -685,18 +690,18 @@ struct font_driver
FONT. VARIATIONS is an array of 256 elements. If the variation
selector N (1..256) defines a glyph, that glyph code is stored in
the (N-1)th element of VARIATIONS. */
- int (*get_variation_glyphs) P_ ((struct font *font,
- int c, unsigned variations[256]));
+ int (*get_variation_glyphs) (struct font *font,
+ int c, unsigned variations[256]);
- void (*filter_properties) P_ ((Lisp_Object font, Lisp_Object properties));
+ void (*filter_properties) (Lisp_Object font, Lisp_Object properties);
/* Optional.
Return non-zero if FONT_OBJECT can be used as a (cached) font
for ENTITY on frame F. */
- int (*cached_font_ok) P_ ((struct frame *f,
- Lisp_Object font_object,
- Lisp_Object entity));
+ int (*cached_font_ok) (struct frame *f,
+ Lisp_Object font_object,
+ Lisp_Object entity);
};
@@ -739,80 +744,80 @@ EXFUN (Ffont_family_list, 1);
EXFUN (Fclear_font_cache, 0);
EXFUN (Ffont_xlfd_name, 2);
-extern Lisp_Object font_make_spec P_ ((void));
-extern Lisp_Object font_make_entity P_ ((void));
-extern Lisp_Object font_make_object P_ ((int, Lisp_Object, int));
-
-extern Lisp_Object find_font_encoding P_ ((Lisp_Object));
-extern int font_registry_charsets P_ ((Lisp_Object, struct charset **,
- struct charset **));
-extern int font_style_to_value P_ ((enum font_property_index prop,
- Lisp_Object name, int noerror));
-extern Lisp_Object font_style_symbolic P_ ((Lisp_Object font,
- enum font_property_index prop,
- int for_face));
-
-extern int font_match_p P_ ((Lisp_Object spec, Lisp_Object font));
-extern Lisp_Object font_list_entities P_ ((Lisp_Object frame,
- Lisp_Object spec));
-
-extern Lisp_Object font_get_name P_ ((Lisp_Object font_object));
-extern Lisp_Object font_spec_from_name P_ ((Lisp_Object font_name));
-extern Lisp_Object font_get_frame P_ ((Lisp_Object font_object));
-extern int font_has_char P_ ((FRAME_PTR, Lisp_Object, int));
-extern unsigned font_encode_char P_ ((Lisp_Object, int));
-
-extern void font_clear_prop P_ ((Lisp_Object *attrs,
- enum font_property_index prop));
-extern void font_update_lface P_ ((FRAME_PTR f, Lisp_Object *attrs));
-extern Lisp_Object font_find_for_lface P_ ((FRAME_PTR f, Lisp_Object *lface,
- Lisp_Object spec, int c));
-extern Lisp_Object font_open_for_lface P_ ((FRAME_PTR f, Lisp_Object entity,
- Lisp_Object *lface,
- Lisp_Object spec));
-extern Lisp_Object font_load_for_lface P_ ((FRAME_PTR f, Lisp_Object *lface,
- Lisp_Object spec));
-extern void font_prepare_for_face P_ ((FRAME_PTR f, struct face *face));
-extern void font_done_for_face P_ ((FRAME_PTR f, struct face *face));
-
-extern Lisp_Object font_open_by_spec P_ ((FRAME_PTR f, Lisp_Object spec));
-extern Lisp_Object font_open_by_name P_ ((FRAME_PTR f, char *name));
+extern Lisp_Object font_make_spec (void);
+extern Lisp_Object font_make_entity (void);
+extern Lisp_Object font_make_object (int, Lisp_Object, int);
+
+extern Lisp_Object find_font_encoding (Lisp_Object);
+extern int font_registry_charsets (Lisp_Object, struct charset **,
+ struct charset **);
+extern int font_style_to_value (enum font_property_index prop,
+ Lisp_Object name, int noerror);
+extern Lisp_Object font_style_symbolic (Lisp_Object font,
+ enum font_property_index prop,
+ int for_face);
+
+extern int font_match_p (Lisp_Object spec, Lisp_Object font);
+extern Lisp_Object font_list_entities (Lisp_Object frame,
+ Lisp_Object spec);
+
+extern Lisp_Object font_get_name (Lisp_Object font_object);
+extern Lisp_Object font_spec_from_name (Lisp_Object font_name);
+extern Lisp_Object font_get_frame (Lisp_Object font_object);
+extern int font_has_char (FRAME_PTR, Lisp_Object, int);
+extern unsigned font_encode_char (Lisp_Object, int);
+
+extern void font_clear_prop (Lisp_Object *attrs,
+ enum font_property_index prop);
+extern void font_update_lface (FRAME_PTR f, Lisp_Object *attrs);
+extern Lisp_Object font_find_for_lface (FRAME_PTR f, Lisp_Object *lface,
+ Lisp_Object spec, int c);
+extern Lisp_Object font_open_for_lface (FRAME_PTR f, Lisp_Object entity,
+ Lisp_Object *lface,
+ Lisp_Object spec);
+extern Lisp_Object font_load_for_lface (FRAME_PTR f, Lisp_Object *lface,
+ Lisp_Object spec);
+extern void font_prepare_for_face (FRAME_PTR f, struct face *face);
+extern void font_done_for_face (FRAME_PTR f, struct face *face);
+
+extern Lisp_Object font_open_by_spec (FRAME_PTR f, Lisp_Object spec);
+extern Lisp_Object font_open_by_name (FRAME_PTR f, char *name);
extern void font_close_object (FRAME_PTR f, Lisp_Object font_object);
-extern Lisp_Object font_intern_prop P_ ((char *str, int len, int force_symbol));
-extern void font_update_sort_order P_ ((int *order));
-
-extern void font_parse_family_registry P_ ((Lisp_Object family,
- Lisp_Object registry,
- Lisp_Object spec));
-extern Lisp_Object font_spec_from_family_registry P_ ((Lisp_Object family,
- Lisp_Object registry));
-
-extern int font_parse_xlfd P_ ((char *name, Lisp_Object font));
-extern int font_unparse_xlfd P_ ((Lisp_Object font, int pixel_size,
- char *name, int bytes));
-extern int font_parse_fcname P_ ((char *name, Lisp_Object font));
-extern int font_unparse_fcname P_ ((Lisp_Object font, int pixel_size,
- char *name, int bytes));
-extern int font_unparse_gtkname P_ ((Lisp_Object, struct frame *, char *, int));
-extern void register_font_driver P_ ((struct font_driver *driver, FRAME_PTR f));
-extern void free_font_driver_list P_ ((FRAME_PTR f));
-extern Lisp_Object font_update_drivers P_ ((FRAME_PTR f, Lisp_Object list));
-extern Lisp_Object font_at P_ ((int c, EMACS_INT pos, struct face *face,
- struct window *w, Lisp_Object object));
+extern Lisp_Object font_intern_prop (char *str, int len, int force_symbol);
+extern void font_update_sort_order (int *order);
+
+extern void font_parse_family_registry (Lisp_Object family,
+ Lisp_Object registry,
+ Lisp_Object spec);
+extern Lisp_Object font_spec_from_family_registry (Lisp_Object family,
+ Lisp_Object registry);
+
+extern int font_parse_xlfd (char *name, Lisp_Object font);
+extern int font_unparse_xlfd (Lisp_Object font, int pixel_size,
+ char *name, int bytes);
+extern int font_parse_fcname (char *name, Lisp_Object font);
+extern int font_unparse_fcname (Lisp_Object font, int pixel_size,
+ char *name, int bytes);
+extern int font_unparse_gtkname (Lisp_Object, struct frame *, char *, int);
+extern void register_font_driver (struct font_driver *driver, FRAME_PTR f);
+extern void free_font_driver_list (FRAME_PTR f);
+extern Lisp_Object font_update_drivers (FRAME_PTR f, Lisp_Object list);
+extern Lisp_Object font_at (int c, EMACS_INT pos, struct face *face,
+ struct window *w, Lisp_Object object);
extern Lisp_Object font_range (EMACS_INT, EMACS_INT *,
struct window *, struct face *,
Lisp_Object);
-extern void font_fill_lglyph_metrics P_ ((Lisp_Object, Lisp_Object));
+extern void font_fill_lglyph_metrics (Lisp_Object, Lisp_Object);
-extern Lisp_Object font_put_extra P_ ((Lisp_Object font, Lisp_Object prop,
- Lisp_Object val));
+extern Lisp_Object font_put_extra (Lisp_Object font, Lisp_Object prop,
+ Lisp_Object val);
-extern int font_put_frame_data P_ ((FRAME_PTR f,
- struct font_driver *driver,
- void *data));
-extern void *font_get_frame_data P_ ((FRAME_PTR f,
- struct font_driver *driver));
+extern int font_put_frame_data (FRAME_PTR f,
+ struct font_driver *driver,
+ void *data);
+extern void *font_get_frame_data (FRAME_PTR f,
+ struct font_driver *driver);
#ifdef HAVE_FREETYPE
extern struct font_driver ftfont_driver;
@@ -837,8 +842,8 @@ extern struct font_driver nsfont_driver;
#endif
extern Lisp_Object Vfont_log;
-extern void font_add_log P_ ((char *, Lisp_Object, Lisp_Object));
-extern void font_deferred_log P_ ((char *, Lisp_Object, Lisp_Object));
+extern void font_add_log (char *, Lisp_Object, Lisp_Object);
+extern void font_deferred_log (char *, Lisp_Object, Lisp_Object);
#define FONT_ADD_LOG(ACTION, ARG, RESULT) \
do { \
diff --git a/src/fontset.c b/src/fontset.c
index e4fd9d72780..9a27fc3e36b 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -203,23 +203,23 @@ Lisp_Object Vvertical_centering_font_regexp;
Lisp_Object Votf_script_alist;
/* Check if any window system is used now. */
-void (*check_window_system_func) P_ ((void));
+void (*check_window_system_func) (void);
/* Prototype declarations for static functions. */
-static Lisp_Object fontset_add P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
- Lisp_Object));
-static Lisp_Object fontset_find_font P_ ((Lisp_Object, int, struct face *,
- int, int));
-static void reorder_font_vector P_ ((Lisp_Object, struct font *));
-static Lisp_Object fontset_font P_ ((Lisp_Object, int, struct face *, int));
-static Lisp_Object make_fontset P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
-static Lisp_Object fontset_pattern_regexp P_ ((Lisp_Object));
-static void accumulate_script_ranges P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object));
-Lisp_Object find_font_encoding P_ ((Lisp_Object));
-
-static void set_fontset_font P_ ((Lisp_Object, Lisp_Object));
+static Lisp_Object fontset_add (Lisp_Object, Lisp_Object, Lisp_Object,
+ Lisp_Object);
+static Lisp_Object fontset_find_font (Lisp_Object, int, struct face *,
+ int, int);
+static void reorder_font_vector (Lisp_Object, struct font *);
+static Lisp_Object fontset_font (Lisp_Object, int, struct face *, int);
+static Lisp_Object make_fontset (Lisp_Object, Lisp_Object, Lisp_Object);
+static Lisp_Object fontset_pattern_regexp (Lisp_Object);
+static void accumulate_script_ranges (Lisp_Object, Lisp_Object,
+ Lisp_Object);
+Lisp_Object find_font_encoding (Lisp_Object);
+
+static void set_fontset_font (Lisp_Object, Lisp_Object);
#ifdef FONTSET_DEBUG
@@ -306,9 +306,7 @@ fontset_id_valid_p (id)
: fontset_ref ((fontset), (c)))
static Lisp_Object
-fontset_ref (fontset, c)
- Lisp_Object fontset;
- int c;
+fontset_ref (Lisp_Object fontset, int c)
{
Lisp_Object elt;
@@ -343,8 +341,7 @@ fontset_ref (fontset, c)
: fontset_add ((fontset), (range), (elt), (add)))
static Lisp_Object
-fontset_add (fontset, range, elt, add)
- Lisp_Object fontset, range, elt, add;
+fontset_add (Lisp_Object fontset, Lisp_Object range, Lisp_Object elt, Lisp_Object add)
{
Lisp_Object args[2];
int idx = (EQ (add, Qappend) ? 0 : 1);
@@ -376,8 +373,7 @@ fontset_add (fontset, range, elt, add)
}
static int
-fontset_compare_rfontdef (val1, val2)
- const void *val1, *val2;
+fontset_compare_rfontdef (const void *val1, const void *val2)
{
return (RFONT_DEF_SCORE (*(Lisp_Object *) val1)
- RFONT_DEF_SCORE (*(Lisp_Object *) val2));
@@ -392,12 +388,10 @@ fontset_compare_rfontdef (val1, val2)
If PREFERRED_FAMILY is not nil, that family has the higher priority
if the encoding charsets or languages in font-specs are the same. */
-extern Lisp_Object Fassoc_string ();
+extern Lisp_Object Fassoc_string (Lisp_Object, Lisp_Object, Lisp_Object);
static void
-reorder_font_vector (font_group, font)
- Lisp_Object font_group;
- struct font *font;
+reorder_font_vector (Lisp_Object font_group, struct font *font)
{
Lisp_Object vec, font_object;
int size;
@@ -525,11 +519,7 @@ fontset_get_font_group (Lisp_Object fontset, int c)
If FALLBACK is nonzero, search only fallback fonts. */
static Lisp_Object
-fontset_find_font (fontset, c, face, id, fallback)
- Lisp_Object fontset;
- int c;
- struct face *face;
- int id, fallback;
+fontset_find_font (Lisp_Object fontset, int c, struct face *face, int id, int fallback)
{
Lisp_Object vec, font_group;
int i, charset_matched = 0, found_index;
@@ -728,11 +718,7 @@ fontset_find_font (fontset, c, face, id, fallback)
static Lisp_Object
-fontset_font (fontset, c, face, id)
- Lisp_Object fontset;
- int c;
- struct face *face;
- int id;
+fontset_font (Lisp_Object fontset, int c, struct face *face, int id)
{
Lisp_Object rfont_def, default_rfont_def;
Lisp_Object base_fontset;
@@ -793,8 +779,7 @@ fontset_font (fontset, c, face, id)
BASE. */
static Lisp_Object
-make_fontset (frame, name, base)
- Lisp_Object frame, name, base;
+make_fontset (Lisp_Object frame, Lisp_Object name, Lisp_Object base)
{
Lisp_Object fontset;
int size = ASIZE (Vfontset_table);
@@ -835,8 +820,7 @@ make_fontset (frame, name, base)
/* Return the name of the fontset who has ID. */
Lisp_Object
-fontset_name (id)
- int id;
+fontset_name (int id)
{
Lisp_Object fontset;
@@ -848,8 +832,7 @@ fontset_name (id)
/* Return the ASCII font name of the fontset who has ID. */
Lisp_Object
-fontset_ascii (id)
- int id;
+fontset_ascii (int id)
{
Lisp_Object fontset, elt;
@@ -861,9 +844,7 @@ fontset_ascii (id)
}
void
-free_realized_fontset (f, fontset)
- FRAME_PTR f;
- Lisp_Object fontset;
+free_realized_fontset (FRAME_PTR f, Lisp_Object fontset)
{
Lisp_Object tail;
@@ -879,9 +860,7 @@ free_realized_fontset (f, fontset)
free_realized_face. */
void
-free_face_fontset (f, face)
- FRAME_PTR f;
- struct face *face;
+free_face_fontset (FRAME_PTR f, struct face *face)
{
Lisp_Object fontset;
@@ -915,9 +894,7 @@ free_face_fontset (f, face)
when C is not an ASCII character. */
int
-face_suitable_for_char_p (face, c)
- struct face *face;
- int c;
+face_suitable_for_char_p (struct face *face, int c)
{
Lisp_Object fontset, rfont_def;
@@ -934,11 +911,7 @@ face_suitable_for_char_p (face, c)
the macro FACE_FOR_CHAR. */
int
-face_for_char (f, face, c, pos, object)
- FRAME_PTR f;
- struct face *face;
- int c, pos;
- Lisp_Object object;
+face_for_char (FRAME_PTR f, struct face *face, int c, int pos, Lisp_Object object)
{
Lisp_Object fontset, rfont_def, charset;
int face_id;
@@ -1006,10 +979,7 @@ face_for_char (f, face, c, pos, object)
Lisp_Object
-font_for_char (face, c, pos, object)
- struct face *face;
- int c, pos;
- Lisp_Object object;
+font_for_char (struct face *face, int c, int pos, Lisp_Object object)
{
Lisp_Object fontset, rfont_def, charset;
int id;
@@ -1059,10 +1029,7 @@ font_for_char (face, c, pos, object)
Called from realize_x_face. */
int
-make_fontset_for_ascii_face (f, base_fontset_id, face)
- FRAME_PTR f;
- int base_fontset_id;
- struct face *face;
+make_fontset_for_ascii_face (FRAME_PTR f, int base_fontset_id, struct face *face)
{
Lisp_Object base_fontset, fontset, frame;
@@ -1096,11 +1063,10 @@ static Lisp_Object Vcached_fontset_data;
expression corresponding to PATTERN. */
static Lisp_Object
-fontset_pattern_regexp (pattern)
- Lisp_Object pattern;
+fontset_pattern_regexp (Lisp_Object pattern)
{
- if (!index ((char *) SDATA (pattern), '*')
- && !index ((char *) SDATA (pattern), '?'))
+ if (!strchr ((char *) SDATA (pattern), '*')
+ && !strchr ((char *) SDATA (pattern), '?'))
/* PATTERN does not contain any wild cards. */
return Qnil;
@@ -1171,9 +1137,7 @@ fontset_pattern_regexp (pattern)
*/
int
-fs_query_fontset (name, name_pattern)
- Lisp_Object name;
- int name_pattern;
+fs_query_fontset (Lisp_Object name, int name_pattern)
{
Lisp_Object tem;
int i;
@@ -1222,8 +1186,7 @@ The value is nil if there is no matching fontset.
PATTERN can contain `*' or `?' as a wildcard
just as X font name matching algorithm allows.
If REGEXPP is non-nil, PATTERN is a regular expression. */)
- (pattern, regexpp)
- Lisp_Object pattern, regexpp;
+ (Lisp_Object pattern, Lisp_Object regexpp)
{
Lisp_Object fontset;
int id;
@@ -1246,10 +1209,7 @@ If REGEXPP is non-nil, PATTERN is a regular expression. */)
/* Return a list of base fontset names matching PATTERN on frame F. */
Lisp_Object
-list_fontsets (f, pattern, size)
- FRAME_PTR f;
- Lisp_Object pattern;
- int size;
+list_fontsets (FRAME_PTR f, Lisp_Object pattern, int size)
{
Lisp_Object frame, regexp, val;
int id;
@@ -1285,8 +1245,7 @@ list_fontsets (f, pattern, size)
/* Free all realized fontsets whose base fontset is BASE. */
static void
-free_realized_fontsets (base)
- Lisp_Object base;
+free_realized_fontsets (Lisp_Object base)
{
int id;
@@ -1343,8 +1302,7 @@ free_realized_fontsets (base)
Set *FRAME to the actual frame. */
static Lisp_Object
-check_fontset_name (name, frame)
- Lisp_Object name, *frame;
+check_fontset_name (Lisp_Object name, Lisp_Object *frame)
{
int id;
@@ -1373,8 +1331,7 @@ check_fontset_name (name, frame)
}
static void
-accumulate_script_ranges (arg, range, val)
- Lisp_Object arg, range, val;
+accumulate_script_ranges (Lisp_Object arg, Lisp_Object range, Lisp_Object val)
{
if (EQ (XCAR (arg), val))
{
@@ -1399,8 +1356,7 @@ accumulate_script_ranges (arg, range, val)
case. */
static void
-set_fontset_font (arg, range)
- Lisp_Object arg, range;
+set_fontset_font (Lisp_Object arg, Lisp_Object range)
{
Lisp_Object fontset, font_def, add, ascii, script_range_list;
int from = XINT (XCAR (range)), to = XINT (XCDR (range));
@@ -1440,7 +1396,7 @@ set_fontset_font (arg, range)
}
extern Lisp_Object QCfamily, QCregistry;
-static void update_auto_fontset_alist P_ ((Lisp_Object, Lisp_Object));
+static void update_auto_fontset_alist (Lisp_Object, Lisp_Object);
DEFUN ("set-fontset-font", Fset_fontset_font, Sset_fontset_font, 3, 5, 0,
@@ -1478,8 +1434,7 @@ Optional 5th argument ADD, if non-nil, specifies how to add FONT-SPEC
to the font specifications for TARGET previously set. If it is
`prepend', FONT-SPEC is prepended. If it is `append', FONT-SPEC is
appended. By default, FONT-SPEC overrides the previous settings. */)
- (name, target, font_spec, frame, add)
- Lisp_Object name, target, font_spec, frame, add;
+ (Lisp_Object name, Lisp_Object target, Lisp_Object font_spec, Lisp_Object frame, Lisp_Object add)
{
Lisp_Object fontset;
Lisp_Object font_def, registry, family;
@@ -1688,8 +1643,7 @@ char-table `char-script-table'.
FONT-SPEC is a vector, a cons, or a string. See the documentation of
`set-fontset-font' for the meaning. */)
- (name, fontlist)
- Lisp_Object name, fontlist;
+ (Lisp_Object name, Lisp_Object fontlist)
{
Lisp_Object fontset;
int id;
@@ -1762,8 +1716,7 @@ static int num_auto_fontsets;
user intends to use FONT-OBJECT for Latin characters. */
int
-fontset_from_font (font_object)
- Lisp_Object font_object;
+fontset_from_font (Lisp_Object font_object)
{
Lisp_Object font_name = font_get_name (font_object);
Lisp_Object font_spec = Fcopy_font_spec (font_object);
@@ -1819,8 +1772,7 @@ fontset_from_font (font_object)
fontset_from_font. */
static void
-update_auto_fontset_alist (font_object, fontset)
- Lisp_Object font_object, fontset;
+update_auto_fontset_alist (Lisp_Object font_object, Lisp_Object fontset)
{
Lisp_Object prev, tail;
@@ -1866,8 +1818,7 @@ update_auto_fontset_alist (font_object, fontset)
DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
doc: /* For internal use only. */)
- (position, ch)
- Lisp_Object position, ch;
+ (Lisp_Object position, Lisp_Object ch)
{
EMACS_INT pos, pos_byte, dummy;
int face_id;
@@ -1957,8 +1908,7 @@ The char-table has one extra slot. If FONTSET is not the default
fontset, the value the extra slot is a char-table containing the
information about the derived fonts from the default fontset. The
format is the same as above. */)
- (fontset, frame)
- Lisp_Object fontset, frame;
+ (Lisp_Object fontset, Lisp_Object frame)
{
FRAME_PTR f;
Lisp_Object *realized[2], fontsets[2], tables[2];
@@ -2093,8 +2043,7 @@ fontset.
If the 2nd optional arg ALL is non-nil, return a list of all font name
patterns. */)
- (name, ch, all)
- Lisp_Object name, ch, all;
+ (Lisp_Object name, Lisp_Object ch, Lisp_Object all)
{
int c;
Lisp_Object fontset, elt, list, repertory, val;
@@ -2154,7 +2103,7 @@ patterns. */)
DEFUN ("fontset-list", Ffontset_list, Sfontset_list, 0, 0, 0,
doc: /* Return a list of all defined fontset names. */)
- ()
+ (void)
{
Lisp_Object fontset, list;
int i;
@@ -2211,7 +2160,7 @@ dump_fontset (fontset)
DEFUN ("fontset-list-all", Ffontset_list_all, Sfontset_list_all, 0, 0, 0,
doc: /* Return a brief summary of all fontsets for debug use. */)
- ()
+ (void)
{
Lisp_Object val;
int i;
@@ -2224,7 +2173,7 @@ DEFUN ("fontset-list-all", Ffontset_list_all, Sfontset_list_all, 0, 0, 0,
#endif /* FONTSET_DEBUG */
void
-syms_of_fontset ()
+syms_of_fontset (void)
{
DEFSYM (Qfontset, "fontset");
Fput (Qfontset, Qchar_table_extra_slots, make_number (9));
diff --git a/src/fontset.h b/src/fontset.h
index 78bdfaaaca0..178170a04ce 100644
--- a/src/fontset.h
+++ b/src/fontset.h
@@ -28,22 +28,22 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define EMACS_FONTSET_H
/* Check if any window system is used now. */
-extern void (*check_window_system_func) P_ ((void));
+extern void (*check_window_system_func) (void);
struct face;
-extern void free_face_fontset P_ ((FRAME_PTR, struct face *));
-extern Lisp_Object fontset_font_pattern P_ ((FRAME_PTR, struct face *, int));
-extern int face_suitable_for_char_p P_ ((struct face *, int));
-extern int face_for_char P_ ((FRAME_PTR, struct face *, int,
- int, Lisp_Object));
-extern Lisp_Object font_for_char P_ ((struct face *, int, int, Lisp_Object));
+extern void free_face_fontset (FRAME_PTR, struct face *);
+extern Lisp_Object fontset_font_pattern (FRAME_PTR, struct face *, int);
+extern int face_suitable_for_char_p (struct face *, int);
+extern int face_for_char (FRAME_PTR, struct face *, int,
+ int, Lisp_Object);
+extern Lisp_Object font_for_char (struct face *, int, int, Lisp_Object);
-extern int make_fontset_for_ascii_face P_ ((FRAME_PTR, int, struct face *));
-extern int fontset_from_font P_ ((Lisp_Object));
-extern int fs_query_fontset P_ ((Lisp_Object, int));
+extern int make_fontset_for_ascii_face (FRAME_PTR, int, struct face *);
+extern int fontset_from_font (Lisp_Object);
+extern int fs_query_fontset (Lisp_Object, int);
EXFUN (Fquery_fontset, 2);
-extern Lisp_Object list_fontsets P_ ((struct frame *, Lisp_Object, int));
+extern Lisp_Object list_fontsets (struct frame *, Lisp_Object, int);
extern Lisp_Object Vuse_default_ascent;
extern Lisp_Object Vignore_relative_composition;
@@ -52,12 +52,12 @@ extern Lisp_Object Vfontset_alias_alist;
extern Lisp_Object Vvertical_centering_font_regexp;
extern Lisp_Object Votf_script_alist;
-extern Lisp_Object fontset_name P_ ((int));
-extern Lisp_Object fontset_ascii P_ ((int));
-extern int fontset_height P_ ((int));
+extern Lisp_Object fontset_name (int);
+extern Lisp_Object fontset_ascii (int);
+extern int fontset_height (int);
struct font;
-extern int face_for_font P_ ((struct frame *, Lisp_Object, struct face *));
+extern int face_for_font (struct frame *, Lisp_Object, struct face *);
#endif /* EMACS_FONTSET_H */
diff --git a/src/frame.c b/src/frame.c
index 3e1b2daf556..69a640cdc96 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -100,6 +100,7 @@ Lisp_Object Qgeometry; /* Not used */
Lisp_Object Qheight, Qwidth;
Lisp_Object Qleft, Qright;
Lisp_Object Qicon_left, Qicon_top, Qicon_type, Qicon_name;
+Lisp_Object Qtooltip;
Lisp_Object Qinternal_border_width;
Lisp_Object Qmouse_color;
Lisp_Object Qminibuffer;
@@ -119,6 +120,7 @@ Lisp_Object Qtitle, Qname;
Lisp_Object Qexplicit_name;
Lisp_Object Qunsplittable;
Lisp_Object Qmenu_bar_lines, Qtool_bar_lines;
+Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
Lisp_Object Qleft_fringe, Qright_fringe;
Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list;
Lisp_Object Qtty_color_mode;
@@ -141,9 +143,7 @@ static Lisp_Object Vdelete_frame_functions, Qdelete_frame_functions;
int focus_follows_mouse;
static void
-set_menu_bar_lines_1 (window, n)
- Lisp_Object window;
- int n;
+set_menu_bar_lines_1 (Lisp_Object window, int n)
{
struct window *w = XWINDOW (window);
@@ -169,9 +169,7 @@ set_menu_bar_lines_1 (window, n)
}
void
-set_menu_bar_lines (f, value, oldval)
- struct frame *f;
- Lisp_Object value, oldval;
+set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
int nlines;
int olines = FRAME_MENU_BAR_LINES (f);
@@ -201,10 +199,10 @@ set_menu_bar_lines (f, value, oldval)
Lisp_Object Vframe_list;
extern Lisp_Object Vminibuffer_list;
-extern Lisp_Object get_minibuffer ();
-extern Lisp_Object Fhandle_switch_frame ();
-extern Lisp_Object Fredirect_frame_focus ();
-extern Lisp_Object x_get_focus_frame ();
+extern Lisp_Object get_minibuffer (int);
+extern Lisp_Object Fhandle_switch_frame (Lisp_Object event);
+extern Lisp_Object Fredirect_frame_focus (Lisp_Object frame, Lisp_Object focus_frame);
+extern Lisp_Object x_get_focus_frame (struct frame *frame);
extern Lisp_Object QCname, Qfont_param;
@@ -216,8 +214,7 @@ Value is t for a termcap frame (a character-only terminal),
`ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display,
`pc' for a direct-write MS-DOS frame.
See also `frame-live-p'. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (!FRAMEP (object))
return Qnil;
@@ -247,8 +244,7 @@ Value is nil if OBJECT is not a live frame. If object is a live
frame, the return value indicates what sort of terminal device it is
displayed on. See the documentation of `framep' for possible
return values. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
return ((FRAMEP (object)
&& FRAME_LIVE_P (XFRAME (object)))
@@ -262,8 +258,7 @@ The value is a symbol---for instance, 'x' for X windows.
The value is nil if Emacs is using a text-only terminal.
FRAME defaults to the currently selected frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
Lisp_Object type;
if (NILP (frame))
@@ -281,8 +276,7 @@ FRAME defaults to the currently selected frame. */)
}
struct frame *
-make_frame (mini_p)
- int mini_p;
+make_frame (int mini_p)
{
Lisp_Object frame;
register struct frame *f;
@@ -333,6 +327,8 @@ make_frame (mini_p)
f->n_tool_bar_items = 0;
f->left_fringe_width = f->right_fringe_width = 0;
f->fringe_cols = 0;
+ f->menu_bar_lines = 0;
+ f->tool_bar_lines = 0;
f->scroll_bar_actual_width = 0;
f->border_width = 0;
f->internal_border_width = 0;
@@ -432,10 +428,7 @@ make_frame (mini_p)
default (the global minibuffer). */
struct frame *
-make_frame_without_minibuffer (mini_window, kb, display)
- register Lisp_Object mini_window;
- KBOARD *kb;
- Lisp_Object display;
+make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lisp_Object display)
{
register struct frame *f;
struct gcpro gcpro1;
@@ -484,7 +477,7 @@ make_frame_without_minibuffer (mini_window, kb, display)
/* Make a frame containing only a minibuffer window. */
struct frame *
-make_minibuffer_frame ()
+make_minibuffer_frame (void)
{
/* First make a frame containing just a root window, no minibuffer. */
@@ -561,6 +554,9 @@ make_initial_frame (void)
FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
+ /* The default value of menu-bar-mode is t. */
+ set_menu_bar_lines (f, make_number (1), Qnil);
+
#ifdef CANNOT_DUMP
if (!noninteractive)
init_frame_faces (f);
@@ -610,6 +606,7 @@ make_terminal_frame (struct terminal *terminal)
FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
+ FRAME_MENU_BAR_LINES(f) = NILP (Vmenu_bar_mode) ? 0 : 1;
/* Set the top frame to the newly created frame. */
if (FRAMEP (FRAME_TTY (f)->top_frame)
@@ -626,8 +623,7 @@ make_terminal_frame (struct terminal *terminal)
/* Get a suitable value for frame parameter PARAMETER for a newly
created frame, based on (1) the user-supplied frame parameter
- alist SUPPLIED_PARMS, (2) CURRENT_VALUE, and finally, if all else
- fails, (3) Vdefault_frame_alist. */
+ alist SUPPLIED_PARMS, and (2) CURRENT_VALUE. */
static Lisp_Object
get_future_frame_param (Lisp_Object parameter,
@@ -641,8 +637,6 @@ get_future_frame_param (Lisp_Object parameter,
result = Fassq (parameter, XFRAME (selected_frame)->param_alist);
if (NILP (result) && current_value != NULL)
result = build_string (current_value);
- if (NILP (result))
- result = Fassq (parameter, Vdefault_frame_alist);
if (!NILP (result) && !STRINGP (result))
result = XCDR (result);
if (NILP (result) || !STRINGP (result))
@@ -668,8 +662,7 @@ and the `tty-type' parameter specifies the terminal type. Example:
Note that changing the size of one terminal frame automatically
affects all frames on the same terminal device. */)
- (parms)
- Lisp_Object parms;
+ (Lisp_Object parms)
{
struct frame *f;
struct terminal *t = NULL;
@@ -747,7 +740,6 @@ affects all frames on the same terminal device. */)
adjust_glyphs (f);
calculate_costs (f);
XSETFRAME (frame, f);
- Fmodify_frame_parameters (frame, Vdefault_frame_alist);
Fmodify_frame_parameters (frame, parms);
Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty_type,
build_string (t->display_info.tty->type)),
@@ -787,9 +779,7 @@ affects all frames on the same terminal device. */)
The value of NORECORD is passed as argument to Fselect_window. */
Lisp_Object
-do_switch_frame (frame, track, for_deletion, norecord)
- Lisp_Object frame, norecord;
- int track, for_deletion;
+do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object norecord)
{
struct frame *sf = SELECTED_FRAME ();
@@ -899,8 +889,7 @@ the window system's input focus. On a text-only terminal, the
next redisplay will display FRAME.
This function returns FRAME, or nil if FRAME has been deleted. */)
- (frame, norecord)
- Lisp_Object frame, norecord;
+ (Lisp_Object frame, Lisp_Object norecord)
{
return do_switch_frame (frame, 1, 0, norecord);
}
@@ -915,8 +904,7 @@ This function selects the selected window of the frame of EVENT.
If EVENT is frame object, handle it as if it were a switch-frame event
to that frame. */)
- (event)
- Lisp_Object event;
+ (Lisp_Object event)
{
/* Preserve prefix arg that the command loop just cleared. */
current_kboard->Vprefix_arg = Vcurrent_prefix_arg;
@@ -926,15 +914,14 @@ to that frame. */)
DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0,
doc: /* Return the frame that is now selected. */)
- ()
+ (void)
{
return selected_frame;
}
DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
doc: /* Return the frame object that window WINDOW is on. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
CHECK_LIVE_WINDOW (window);
return XWINDOW (window)->frame;
@@ -943,8 +930,7 @@ DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
DEFUN ("frame-first-window", Fframe_first_window, Sframe_first_window, 0, 1, 0,
doc: /* Returns the topmost, leftmost window of FRAME.
If omitted, FRAME defaults to the currently selected frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
Lisp_Object w;
@@ -970,7 +956,7 @@ If omitted, FRAME defaults to the currently selected frame. */)
DEFUN ("active-minibuffer-window", Factive_minibuffer_window,
Sactive_minibuffer_window, 0, 0, 0,
doc: /* Return the currently active minibuffer window, or nil if none. */)
- ()
+ (void)
{
return minibuf_level ? minibuf_window : Qnil;
}
@@ -978,8 +964,7 @@ DEFUN ("active-minibuffer-window", Factive_minibuffer_window,
DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0,
doc: /* Returns the root-window of FRAME.
If omitted, FRAME defaults to the currently selected frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
Lisp_Object window;
@@ -998,8 +983,7 @@ DEFUN ("frame-selected-window", Fframe_selected_window,
Sframe_selected_window, 0, 1, 0,
doc: /* Return the selected window of FRAME.
FRAME defaults to the currently selected frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
Lisp_Object window;
@@ -1022,8 +1006,7 @@ selected frame, this makes WINDOW the selected window.
Optional argument NORECORD non-nil means to neither change the
order of recently selected windows nor the buffer list.
Return WINDOW. */)
- (frame, window, norecord)
- Lisp_Object frame, window, norecord;
+ (Lisp_Object frame, Lisp_Object window, Lisp_Object norecord)
{
if (NILP (frame))
frame = selected_frame;
@@ -1044,7 +1027,7 @@ Return WINDOW. */)
DEFUN ("frame-list", Fframe_list, Sframe_list,
0, 0, 0,
doc: /* Return a list of all live frames. */)
- ()
+ (void)
{
Lisp_Object frames;
frames = Fcopy_sequence (Vframe_list);
@@ -1064,9 +1047,7 @@ DEFUN ("frame-list", Fframe_list, Sframe_list,
Otherwise, include all frames. */
static Lisp_Object
-next_frame (frame, minibuf)
- Lisp_Object frame;
- Lisp_Object minibuf;
+next_frame (Lisp_Object frame, Lisp_Object minibuf)
{
Lisp_Object tail;
int passed = 0;
@@ -1144,9 +1125,7 @@ next_frame (frame, minibuf)
Otherwise, include all frames. */
static Lisp_Object
-prev_frame (frame, minibuf)
- Lisp_Object frame;
- Lisp_Object minibuf;
+prev_frame (Lisp_Object frame, Lisp_Object minibuf)
{
Lisp_Object tail;
Lisp_Object prev;
@@ -1229,8 +1208,7 @@ and any frame now using that window as the minibuffer.
If MINIFRAME is `visible', include all visible frames.
If MINIFRAME is 0, include all visible and iconified frames.
Otherwise, include all frames. */)
- (frame, miniframe)
- Lisp_Object frame, miniframe;
+ (Lisp_Object frame, Lisp_Object miniframe)
{
if (NILP (frame))
frame = selected_frame;
@@ -1250,8 +1228,7 @@ and any frame now using that window as the minibuffer.
If MINIFRAME is `visible', include all visible frames.
If MINIFRAME is 0, include all visible and iconified frames.
Otherwise, include all frames. */)
- (frame, miniframe)
- Lisp_Object frame, miniframe;
+ (Lisp_Object frame, Lisp_Object miniframe)
{
if (NILP (frame))
frame = selected_frame;
@@ -1264,8 +1241,7 @@ Otherwise, include all frames. */)
(Exception: if F is the terminal frame, and we are using X, return 1.) */
int
-other_visible_frames (f)
- FRAME_PTR f;
+other_visible_frames (FRAME_PTR f)
{
/* We know the selected frame is visible,
so if F is some other frame, it can't be the sole visible one. */
@@ -1319,17 +1295,17 @@ extern Lisp_Object Qrun_hook_with_args;
this. Any other value of FORCE implements the semantics
described for Fdelete_frame. */
Lisp_Object
-delete_frame (frame, force)
+delete_frame (Lisp_Object frame, Lisp_Object force)
/* If we use `register' here, gcc-4.0.2 on amd64 using
-DUSE_LISP_UNION_TYPE complains further down that we're getting the
address of `force'. Go figure. */
- Lisp_Object frame, force;
+
{
struct frame *f;
struct frame *sf = SELECTED_FRAME ();
struct kboard *kb;
- int minibuffer_selected;
+ int minibuffer_selected, tooltip_frame;
if (EQ (frame, Qnil))
{
@@ -1381,13 +1357,15 @@ delete_frame (frame, force)
}
}
+ tooltip_frame = !NILP (Fframe_parameter (frame, intern ("tooltip")));
+
/* Run `delete-frame-functions' unless FORCE is `noelisp' or
frame is a tooltip. FORCE is set to `noelisp' when handling
a disconnect from the terminal, so we don't dare call Lisp
code. */
- if (NILP (Vrun_hooks) || !NILP (Fframe_parameter (frame, intern ("tooltip"))))
+ if (NILP (Vrun_hooks) || tooltip_frame)
;
- if (EQ (force, Qnoelisp))
+ else if (EQ (force, Qnoelisp))
pending_funcalls
= Fcons (list3 (Qrun_hook_with_args, Qdelete_frame_functions, frame),
pending_funcalls);
@@ -1633,7 +1611,8 @@ delete_frame (frame, force)
}
/* Cause frame titles to update--necessary if we now have just one frame. */
- update_mode_lines = 1;
+ if (!tooltip_frame)
+ update_mode_lines = 1;
return Qnil;
}
@@ -1649,8 +1628,7 @@ but if the second optional argument FORCE is non-nil, you may do so.
This function runs `delete-frame-functions' before actually
deleting the frame, unless the frame is a tooltip.
The functions are run with one argument, the frame to be deleted. */)
- (frame, force)
- Lisp_Object frame, force;
+ (Lisp_Object frame, Lisp_Object force)
{
return delete_frame (frame, !NILP (force) ? Qt : Qnil);
}
@@ -1669,7 +1647,7 @@ and nil for X and Y.
If `mouse-position-function' is non-nil, `mouse-position' calls it,
passing the normal return value to that function as an argument,
and returns whatever that function returns. */)
- ()
+ (void)
{
FRAME_PTR f;
Lisp_Object lispy_dummy;
@@ -1715,7 +1693,7 @@ the vertical offset.
If Emacs is running on a mouseless terminal or hasn't been programmed
to read the mouse position, it returns the selected frame for FRAME
and nil for X and Y. */)
- ()
+ (void)
{
FRAME_PTR f;
Lisp_Object lispy_dummy;
@@ -1752,8 +1730,7 @@ This function is a no-op for an X frame that is not visible.
If you have just created a frame, you must wait for it to become visible
before calling this function on it, like this.
(while (not (frame-visible-p frame)) (sleep-for .5)) */)
- (frame, x, y)
- Lisp_Object frame, x, y;
+ (Lisp_Object frame, Lisp_Object x, Lisp_Object y)
{
CHECK_LIVE_FRAME (frame);
CHECK_NUMBER (x);
@@ -1794,8 +1771,7 @@ Note, this is a no-op for an X frame that is not visible.
If you have just created a frame, you must wait for it to become visible
before calling this function on it, like this.
(while (not (frame-visible-p frame)) (sleep-for .5)) */)
- (frame, x, y)
- Lisp_Object frame, x, y;
+ (Lisp_Object frame, Lisp_Object x, Lisp_Object y)
{
CHECK_LIVE_FRAME (frame);
CHECK_NUMBER (x);
@@ -1826,14 +1802,13 @@ before calling this function on it, like this.
return Qnil;
}
-static void make_frame_visible_1 P_ ((Lisp_Object));
+static void make_frame_visible_1 (Lisp_Object);
DEFUN ("make-frame-visible", Fmake_frame_visible, Smake_frame_visible,
0, 1, "",
doc: /* Make the frame FRAME visible (assuming it is an X window).
If omitted, FRAME defaults to the currently selected frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
if (NILP (frame))
frame = selected_frame;
@@ -1861,8 +1836,7 @@ If omitted, FRAME defaults to the currently selected frame. */)
and all its descendents. */
static void
-make_frame_visible_1 (window)
- Lisp_Object window;
+make_frame_visible_1 (Lisp_Object window)
{
struct window *w;
@@ -1893,8 +1867,7 @@ but if the second optional argument FORCE is non-nil, you may do so.
This function has no effect on text-only terminal frames. Such frames
are always considered visible, whether or not they are currently being
displayed in the terminal. */)
- (frame, force)
- Lisp_Object frame, force;
+ (Lisp_Object frame, Lisp_Object force)
{
if (NILP (frame))
frame = selected_frame;
@@ -1935,8 +1908,7 @@ DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame,
0, 1, "",
doc: /* Make the frame FRAME into an icon.
If omitted, FRAME defaults to the currently selected frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
if (NILP (frame))
frame = selected_frame;
@@ -1981,8 +1953,7 @@ usually not displayed at all, even in a window system's \"taskbar\".
If FRAME is a text-only terminal frame, this always returns t.
Such frames are always considered visible, whether or not they are
currently being displayed on the terminal. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
CHECK_LIVE_FRAME (frame);
@@ -1998,7 +1969,7 @@ currently being displayed on the terminal. */)
DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list,
0, 0, 0,
doc: /* Return a list of all frames now \"visible\" (being updated). */)
- ()
+ (void)
{
Lisp_Object tail, frame;
struct frame *f;
@@ -2024,8 +1995,7 @@ If FRAME is invisible or iconified, make it visible.
If you don't specify a frame, the selected frame is used.
If Emacs is displaying on an ordinary terminal or some other device which
doesn't support multiple overlapping frames, this function selects FRAME. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct frame *f;
if (NILP (frame))
@@ -2054,8 +2024,7 @@ DEFUN ("lower-frame", Flower_frame, Slower_frame, 0, 1, "",
If you don't specify a frame, the selected frame is used.
If Emacs is displaying on an ordinary terminal or some other device which
doesn't support multiple overlapping frames, this function does nothing. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct frame *f;
@@ -2098,8 +2067,7 @@ differently from a frame whose focus is redirected to nil; the former
is affected by `select-frame', while the latter is not.
The redirection lasts until `redirect-frame-focus' is called to change it. */)
- (frame, focus_frame)
- Lisp_Object frame, focus_frame;
+ (Lisp_Object frame, Lisp_Object focus_frame)
{
struct frame *f;
@@ -2126,8 +2094,7 @@ DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 1, 1, 0,
doc: /* Return the frame to which FRAME's keystrokes are currently being sent.
This returns nil if FRAME's focus is not redirected.
See `redirect-frame-focus'. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
CHECK_LIVE_FRAME (frame);
@@ -2139,9 +2106,7 @@ See `redirect-frame-focus'. */)
/* Return the value of frame parameter PROP in frame FRAME. */
Lisp_Object
-get_frame_param (frame, prop)
- register struct frame *frame;
- Lisp_Object prop;
+get_frame_param (register struct frame *frame, Lisp_Object prop)
{
register Lisp_Object tem;
@@ -2154,8 +2119,7 @@ get_frame_param (frame, prop)
/* Return the buffer-predicate of the selected frame. */
Lisp_Object
-frame_buffer_predicate (frame)
- Lisp_Object frame;
+frame_buffer_predicate (Lisp_Object frame)
{
return XFRAME (frame)->buffer_predicate;
}
@@ -2163,8 +2127,7 @@ frame_buffer_predicate (frame)
/* Return the buffer-list of the selected frame. */
Lisp_Object
-frame_buffer_list (frame)
- Lisp_Object frame;
+frame_buffer_list (Lisp_Object frame)
{
return XFRAME (frame)->buffer_list;
}
@@ -2172,8 +2135,7 @@ frame_buffer_list (frame)
/* Set the buffer-list of the selected frame. */
void
-set_frame_buffer_list (frame, list)
- Lisp_Object frame, list;
+set_frame_buffer_list (Lisp_Object frame, Lisp_Object list)
{
XFRAME (frame)->buffer_list = list;
}
@@ -2181,8 +2143,7 @@ set_frame_buffer_list (frame, list)
/* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */
void
-frames_discard_buffer (buffer)
- Lisp_Object buffer;
+frames_discard_buffer (Lisp_Object buffer)
{
Lisp_Object frame, tail;
@@ -2199,9 +2160,7 @@ frames_discard_buffer (buffer)
If the alist already has an element for PROP, we change it. */
void
-store_in_alist (alistptr, prop, val)
- Lisp_Object *alistptr, val;
- Lisp_Object prop;
+store_in_alist (Lisp_Object *alistptr, Lisp_Object prop, Lisp_Object val)
{
register Lisp_Object tem;
@@ -2213,9 +2172,7 @@ store_in_alist (alistptr, prop, val)
}
static int
-frame_name_fnn_p (str, len)
- char *str;
- EMACS_INT len;
+frame_name_fnn_p (char *str, EMACS_INT len)
{
if (len > 1 && str[0] == 'F')
{
@@ -2233,9 +2190,7 @@ frame_name_fnn_p (str, len)
Modeled after x_set_name which is used for WINDOW frames. */
static void
-set_term_frame_name (f, name)
- struct frame *f;
- Lisp_Object name;
+set_term_frame_name (struct frame *f, Lisp_Object name)
{
f->explicit_name = ! NILP (name);
@@ -2273,9 +2228,7 @@ set_term_frame_name (f, name)
}
void
-store_frame_param (f, prop, val)
- struct frame *f;
- Lisp_Object prop, val;
+store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
{
register Lisp_Object old_alist_elt;
@@ -2362,8 +2315,7 @@ DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0,
It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.
The meaningful PARMs depend on the kind of frame.
If FRAME is omitted, return information on the currently selected frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
Lisp_Object alist;
FRAME_PTR f;
@@ -2460,8 +2412,7 @@ If FRAME is omitted, return information on the currently selected frame. */)
DEFUN ("frame-parameter", Fframe_parameter, Sframe_parameter, 2, 2, 0,
doc: /* Return FRAME's value for parameter PARAMETER.
If FRAME is nil, describe the currently selected frame. */)
- (frame, parameter)
- Lisp_Object frame, parameter;
+ (Lisp_Object frame, Lisp_Object parameter)
{
struct frame *f;
Lisp_Object value;
@@ -2551,8 +2502,7 @@ as a frame-local binding for the variable FOO, if you have
enabled such bindings for that variable with `make-variable-frame-local'.
Note that this functionality is obsolete as of Emacs 22.2, and its
use is not recommended. Explicitly check for a frame-parameter instead. */)
- (frame, alist)
- Lisp_Object frame, alist;
+ (Lisp_Object frame, Lisp_Object alist)
{
FRAME_PTR f;
register Lisp_Object tail, prop, val;
@@ -2617,8 +2567,7 @@ DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height,
doc: /* Height in pixels of a line in the font in frame FRAME.
If FRAME is omitted, the selected frame is used.
For a terminal frame, the value is always 1. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct frame *f;
@@ -2642,8 +2591,7 @@ DEFUN ("frame-char-width", Fframe_char_width, Sframe_char_width,
If FRAME is omitted, the selected frame is used.
On a graphical screen, the width is the standard width of the default font.
For a terminal screen, the value is always 1. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct frame *f;
@@ -2679,8 +2627,7 @@ and menu bar.
For a text-only terminal, it includes the menu bar. In this case, the
result is really in characters rather than pixels (i.e., is identical
to `frame-height'). */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct frame *f;
@@ -2702,8 +2649,7 @@ DEFUN ("frame-pixel-width", Fframe_pixel_width,
doc: /* Return FRAME's width in pixels.
For a terminal frame, the result really gives the width in characters.
If FRAME is omitted, the selected frame is used. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct frame *f;
@@ -2724,8 +2670,7 @@ DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0,
doc: /* Specify that the frame FRAME has LINES lines.
Optional third arg non-nil means that redisplay should use LINES lines
but that the idea of the actual height of the frame should not be changed. */)
- (frame, lines, pretend)
- Lisp_Object frame, lines, pretend;
+ (Lisp_Object frame, Lisp_Object lines, Lisp_Object pretend)
{
register struct frame *f;
@@ -2753,8 +2698,7 @@ DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0,
doc: /* Specify that the frame FRAME has COLS columns.
Optional third arg non-nil means that redisplay should use COLS columns
but that the idea of the actual width of the frame should not be changed. */)
- (frame, cols, pretend)
- Lisp_Object frame, cols, pretend;
+ (Lisp_Object frame, Lisp_Object cols, Lisp_Object pretend)
{
register struct frame *f;
CHECK_NUMBER (cols);
@@ -2779,8 +2723,7 @@ but that the idea of the actual width of the frame should not be changed. */)
DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0,
doc: /* Sets size of FRAME to COLS by ROWS, measured in characters. */)
- (frame, cols, rows)
- Lisp_Object frame, cols, rows;
+ (Lisp_Object frame, Lisp_Object cols, Lisp_Object rows)
{
register struct frame *f;
@@ -2812,8 +2755,7 @@ DEFUN ("set-frame-position", Fset_frame_position,
This is actually the position of the upper left corner of the frame.
Negative values for XOFFSET or YOFFSET are interpreted relative to
the rightmost or bottommost possible position (that stays within the screen). */)
- (frame, xoffset, yoffset)
- Lisp_Object frame, xoffset, yoffset;
+ (Lisp_Object frame, Lisp_Object xoffset, Lisp_Object yoffset)
{
register struct frame *f;
@@ -2896,12 +2838,7 @@ extern Lisp_Object Qtop;
*/
void
-x_fullscreen_adjust (f, width, height, top_pos, left_pos)
- struct frame *f;
- int *width;
- int *height;
- int *top_pos;
- int *left_pos;
+x_fullscreen_adjust (struct frame *f, int *width, int *height, int *top_pos, int *left_pos)
{
int newwidth = FRAME_COLS (f);
int newheight = FRAME_LINES (f);
@@ -2944,9 +2881,7 @@ x_fullscreen_adjust (f, width, height, top_pos, left_pos)
to store the new value in the parameter alist. */
void
-x_set_frame_parameters (f, alist)
- FRAME_PTR f;
- Lisp_Object alist;
+x_set_frame_parameters (FRAME_PTR f, Lisp_Object alist)
{
Lisp_Object tail;
@@ -3220,9 +3155,7 @@ x_set_frame_parameters (f, alist)
param_alist need to be considered here. */
void
-x_report_frame_params (f, alistptr)
- struct frame *f;
- Lisp_Object *alistptr;
+x_report_frame_params (struct frame *f, Lisp_Object *alistptr)
{
char buf[16];
Lisp_Object tem;
@@ -3291,9 +3224,7 @@ x_report_frame_params (f, alistptr)
the previous value of that parameter, NEW_VALUE is the new value. */
void
-x_set_fullscreen (f, new_value, old_value)
- struct frame *f;
- Lisp_Object new_value, old_value;
+x_set_fullscreen (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
if (NILP (new_value))
f->want_fullscreen = FULLSCREEN_NONE;
@@ -3315,9 +3246,7 @@ x_set_fullscreen (f, new_value, old_value)
the previous value of that parameter, NEW_VALUE is the new value. */
void
-x_set_line_spacing (f, new_value, old_value)
- struct frame *f;
- Lisp_Object new_value, old_value;
+x_set_line_spacing (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
if (NILP (new_value))
f->extra_line_spacing = 0;
@@ -3334,9 +3263,7 @@ x_set_line_spacing (f, new_value, old_value)
the previous value of that parameter, NEW_VALUE is the new value. */
void
-x_set_screen_gamma (f, new_value, old_value)
- struct frame *f;
- Lisp_Object new_value, old_value;
+x_set_screen_gamma (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
Lisp_Object bgcolor;
@@ -3366,9 +3293,7 @@ x_set_screen_gamma (f, new_value, old_value)
void
-x_set_font (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
Lisp_Object frame, font_object, font_param = Qnil;
int fontset = -1;
@@ -3465,9 +3390,7 @@ x_set_font (f, arg, oldval)
void
-x_set_font_backend (f, new_value, old_value)
- struct frame *f;
- Lisp_Object new_value, old_value;
+x_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
if (! NILP (new_value)
&& !CONSP (new_value))
@@ -3523,17 +3446,13 @@ x_set_font_backend (f, new_value, old_value)
void
-x_set_fringe_width (f, new_value, old_value)
- struct frame *f;
- Lisp_Object new_value, old_value;
+x_set_fringe_width (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
compute_fringe_widths (f, 1);
}
void
-x_set_border_width (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
CHECK_NUMBER (arg);
@@ -3547,9 +3466,7 @@ x_set_border_width (f, arg, oldval)
}
void
-x_set_internal_border_width (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int old = FRAME_INTERNAL_BORDER_WIDTH (f);
@@ -3577,9 +3494,7 @@ x_set_internal_border_width (f, arg, oldval)
}
void
-x_set_visibility (f, value, oldval)
- struct frame *f;
- Lisp_Object value, oldval;
+x_set_visibility (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
Lisp_Object frame;
XSETFRAME (frame, f);
@@ -3593,33 +3508,25 @@ x_set_visibility (f, value, oldval)
}
void
-x_set_autoraise (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_autoraise (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
f->auto_raise = !EQ (Qnil, arg);
}
void
-x_set_autolower (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_autolower (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
f->auto_lower = !EQ (Qnil, arg);
}
void
-x_set_unsplittable (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_unsplittable (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
f->no_split = !NILP (arg);
}
void
-x_set_vertical_scroll_bars (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_vertical_scroll_bars (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
if ((EQ (arg, Qleft) && FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))
|| (EQ (arg, Qright) && FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f))
@@ -3650,9 +3557,7 @@ x_set_vertical_scroll_bars (f, arg, oldval)
}
void
-x_set_scroll_bar_width (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_scroll_bar_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int wid = FRAME_COLUMN_WIDTH (f);
@@ -3687,8 +3592,7 @@ x_set_scroll_bar_width (f, arg, oldval)
/* Return non-nil if frame F wants a bitmap icon. */
Lisp_Object
-x_icon_type (f)
- FRAME_PTR f;
+x_icon_type (FRAME_PTR f)
{
Lisp_Object tem;
@@ -3700,9 +3604,7 @@ x_icon_type (f)
}
void
-x_set_alpha (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_alpha (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
double alpha = 1.0;
double newval[2];
@@ -3760,7 +3662,7 @@ x_set_alpha (f, arg, oldval)
Fix it up, or set it to `emacs' if it is too hopeless. */
void
-validate_x_resource_name ()
+validate_x_resource_name (void)
{
int len = 0;
/* Number of valid characters in the resource name. */
@@ -3827,17 +3729,15 @@ validate_x_resource_name ()
}
-extern char *x_get_string_resource P_ ((XrmDatabase, char *, char *));
-extern Display_Info *check_x_display_info P_ ((Lisp_Object));
+extern char *x_get_string_resource (XrmDatabase, char *, char *);
+extern Display_Info *check_x_display_info (Lisp_Object);
/* Get specified attribute from resource database RDB.
See Fx_get_resource below for other parameters. */
static Lisp_Object
-xrdb_get_resource (rdb, attribute, class, component, subclass)
- XrmDatabase rdb;
- Lisp_Object attribute, class, component, subclass;
+xrdb_get_resource (XrmDatabase rdb, Lisp_Object attribute, Lisp_Object class, Lisp_Object component, Lisp_Object subclass)
{
register char *value;
char *name_key;
@@ -3908,8 +3808,7 @@ The optional arguments COMPONENT and SUBCLASS add to the key and the
class, respectively. You must specify both of them or neither.
If you specify them, the key is `INSTANCE.COMPONENT.ATTRIBUTE'
and the class is `Emacs.CLASS.SUBCLASS'. */)
- (attribute, class, component, subclass)
- Lisp_Object attribute, class, component, subclass;
+ (Lisp_Object attribute, Lisp_Object class, Lisp_Object component, Lisp_Object subclass)
{
#ifdef HAVE_X_WINDOWS
check_x ();
@@ -3922,9 +3821,7 @@ and the class is `Emacs.CLASS.SUBCLASS'. */)
/* Get an X resource, like Fx_get_resource, but for display DPYINFO. */
Lisp_Object
-display_x_get_resource (dpyinfo, attribute, class, component, subclass)
- Display_Info *dpyinfo;
- Lisp_Object attribute, class, component, subclass;
+display_x_get_resource (Display_Info *dpyinfo, Lisp_Object attribute, Lisp_Object class, Lisp_Object component, Lisp_Object subclass)
{
return xrdb_get_resource (dpyinfo->xrdb,
attribute, class, component, subclass);
@@ -3934,8 +3831,7 @@ display_x_get_resource (dpyinfo, attribute, class, component, subclass)
/* Used when C code wants a resource value. */
/* Called from oldXMenu/Create.c. */
char *
-x_get_resource_string (attribute, class)
- char *attribute, *class;
+x_get_resource_string (char *attribute, char *class)
{
char *name_key;
char *class_key;
@@ -3968,12 +3864,7 @@ x_get_resource_string (attribute, class)
and don't let it get stored in any Lisp-visible variables! */
Lisp_Object
-x_get_arg (dpyinfo, alist, param, attribute, class, type)
- Display_Info *dpyinfo;
- Lisp_Object alist, param;
- char *attribute;
- char *class;
- enum resource_types type;
+x_get_arg (Display_Info *dpyinfo, Lisp_Object alist, Lisp_Object param, char *attribute, char *class, enum resource_types type)
{
register Lisp_Object tem;
@@ -4071,12 +3962,7 @@ x_get_arg (dpyinfo, alist, param, attribute, class, type)
}
Lisp_Object
-x_frame_get_arg (f, alist, param, attribute, class, type)
- struct frame *f;
- Lisp_Object alist, param;
- char *attribute;
- char *class;
- enum resource_types type;
+x_frame_get_arg (struct frame *f, Lisp_Object alist, Lisp_Object param, char *attribute, char *class, enum resource_types type)
{
return x_get_arg (FRAME_X_DISPLAY_INFO (f),
alist, param, attribute, class, type);
@@ -4085,12 +3971,7 @@ x_frame_get_arg (f, alist, param, attribute, class, type)
/* Like x_frame_get_arg, but also record the value in f->param_alist. */
Lisp_Object
-x_frame_get_and_record_arg (f, alist, param, attribute, class, type)
- struct frame *f;
- Lisp_Object alist, param;
- char *attribute;
- char *class;
- enum resource_types type;
+x_frame_get_and_record_arg (struct frame *f, Lisp_Object alist, Lisp_Object param, char *attribute, char *class, enum resource_types type)
{
Lisp_Object value;
@@ -4110,14 +3991,7 @@ x_frame_get_and_record_arg (f, alist, param, attribute, class, type)
If that is not found either, use the value DEFLT. */
Lisp_Object
-x_default_parameter (f, alist, prop, deflt, xprop, xclass, type)
- struct frame *f;
- Lisp_Object alist;
- Lisp_Object prop;
- Lisp_Object deflt;
- char *xprop;
- char *xclass;
- enum resource_types type;
+x_default_parameter (struct frame *f, Lisp_Object alist, Lisp_Object prop, Lisp_Object deflt, char *xprop, char *xclass, enum resource_types type)
{
Lisp_Object tem;
@@ -4147,8 +4021,7 @@ For X, the value of `left' or `top' may be an integer,
or a list (+ N) meaning N pixels relative to top/left corner,
or a list (- N) meaning -N pixels relative to bottom/right corner.
On Nextstep, this just calls `ns-parse-geometry'. */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
#ifdef HAVE_NS
call1 (Qns_parse_geometry, string);
@@ -4211,10 +4084,7 @@ On Nextstep, this just calls `ns-parse-geometry'. */)
#define DEFAULT_COLS 80
int
-x_figure_window_size (f, parms, toolbar_p)
- struct frame *f;
- Lisp_Object parms;
- int toolbar_p;
+x_figure_window_size (struct frame *f, Lisp_Object parms, int toolbar_p)
{
register Lisp_Object tem0, tem1, tem2;
long window_prompting = 0;
@@ -4389,7 +4259,7 @@ x_figure_window_size (f, parms, toolbar_p)
#endif /* HAVE_WINDOW_SYSTEM */
void
-frame_make_pointer_invisible ()
+frame_make_pointer_invisible (void)
{
if (! NILP (Vmake_pointer_invisible))
{
@@ -4409,7 +4279,7 @@ frame_make_pointer_invisible ()
}
void
-frame_make_pointer_visible ()
+frame_make_pointer_visible (void)
{
/* We don't check Vmake_pointer_invisible here in case the
pointer was invisible when Vmake_pointer_invisible was set to nil. */
@@ -4434,7 +4304,7 @@ frame_make_pointer_visible ()
***********************************************************************/
void
-syms_of_frame ()
+syms_of_frame (void)
{
Qframep = intern_c_string ("framep");
staticpro (&Qframep);
@@ -4460,6 +4330,8 @@ syms_of_frame ()
staticpro (&Qicon_left);
Qicon_top = intern_c_string ("icon-top");
staticpro (&Qicon_top);
+ Qtooltip = intern_c_string ("tooltip");
+ staticpro (&Qtooltip);
Qleft = intern_c_string ("left");
staticpro (&Qleft);
Qright = intern_c_string ("right");
@@ -4648,6 +4520,14 @@ recursively). */);
Qdelete_frame_functions = intern_c_string ("delete-frame-functions");
staticpro (&Qdelete_frame_functions);
+ DEFVAR_LISP ("menu-bar-mode", &Vmenu_bar_mode,
+ doc: /* Non-nil if Menu-Bar mode is enabled. */);
+ Vmenu_bar_mode = Qt;
+
+ DEFVAR_LISP ("tool-bar-mode", &Vtool_bar_mode,
+ doc: /* Non-nil if Tool-Bar mode is enabled. */);
+ Vtool_bar_mode = Qt;
+
DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
doc: /* Minibufferless frames use this frame's minibuffer.
diff --git a/src/frame.h b/src/frame.h
index 887d47eff21..0abd878a31f 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -828,19 +828,19 @@ extern Lisp_Object Qnoelisp;
extern struct frame *last_nonminibuf_frame;
-extern struct frame *make_initial_frame P_ ((void));
-extern struct frame *make_terminal_frame P_ ((struct terminal *));
-extern struct frame *make_frame P_ ((int));
+extern struct frame *make_initial_frame (void);
+extern struct frame *make_terminal_frame (struct terminal *);
+extern struct frame *make_frame (int);
#ifdef HAVE_WINDOW_SYSTEM
-extern struct frame *make_minibuffer_frame P_ ((void));
-extern struct frame *make_frame_without_minibuffer P_ ((Lisp_Object,
- struct kboard *,
- Lisp_Object));
+extern struct frame *make_minibuffer_frame (void);
+extern struct frame *make_frame_without_minibuffer (Lisp_Object,
+ struct kboard *,
+ Lisp_Object);
#endif /* HAVE_WINDOW_SYSTEM */
-extern int other_visible_frames P_ ((struct frame *));
-extern void frame_make_pointer_invisible P_ ((void));
-extern void frame_make_pointer_visible P_ ((void));
-extern Lisp_Object delete_frame P_ ((Lisp_Object, Lisp_Object));
+extern int other_visible_frames (struct frame *);
+extern void frame_make_pointer_invisible (void);
+extern void frame_make_pointer_visible (void);
+extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object);
extern Lisp_Object Vframe_list;
extern Lisp_Object Vdefault_frame_alist;
@@ -1081,11 +1081,11 @@ extern Lisp_Object Qdisplay;
/* These are in xterm.c, w32term.c, etc. */
-extern void x_set_scroll_bar_default_width P_ ((struct frame *));
-extern void x_set_offset P_ ((struct frame *, int, int, int));
-extern void x_wm_set_icon_position P_ ((struct frame *, int, int));
+extern void x_set_scroll_bar_default_width (struct frame *);
+extern void x_set_offset (struct frame *, int, int, int);
+extern void x_wm_set_icon_position (struct frame *, int, int);
-extern Lisp_Object x_new_font P_ ((struct frame *, Lisp_Object, int));
+extern Lisp_Object x_new_font (struct frame *, Lisp_Object, int);
/* These are in frame.c */
@@ -1095,38 +1095,38 @@ extern Lisp_Object Vx_resource_class;
extern Lisp_Object Qface_set_after_frame_default;
-extern void x_fullscreen_adjust P_ ((struct frame *f, int *, int *,
- int *, int *));
-
-extern void x_set_frame_parameters P_ ((struct frame *, Lisp_Object));
-extern void x_report_frame_params P_ ((struct frame *, Lisp_Object *));
-
-extern void x_set_fullscreen P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void x_set_line_spacing P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void x_set_screen_gamma P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void x_set_font P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void x_set_font_backend P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void x_set_fringe_width P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void x_set_border_width P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void x_set_internal_border_width P_ ((struct frame *, Lisp_Object,
- Lisp_Object));
-extern void x_set_visibility P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void x_set_autoraise P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void x_set_autolower P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void x_set_unsplittable P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void x_set_vertical_scroll_bars P_ ((struct frame *, Lisp_Object,
- Lisp_Object));
-extern void x_set_scroll_bar_width P_ ((struct frame *, Lisp_Object,
- Lisp_Object));
-
-extern Lisp_Object x_icon_type P_ ((struct frame *));
-
-extern int x_figure_window_size P_ ((struct frame *, Lisp_Object, int));
+extern void x_fullscreen_adjust (struct frame *f, int *, int *,
+ int *, int *);
+
+extern void x_set_frame_parameters (struct frame *, Lisp_Object);
+extern void x_report_frame_params (struct frame *, Lisp_Object *);
+
+extern void x_set_fullscreen (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_line_spacing (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_screen_gamma (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_font (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_font_backend (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_fringe_width (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_border_width (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_internal_border_width (struct frame *, Lisp_Object,
+ Lisp_Object);
+extern void x_set_visibility (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_autoraise (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_autolower (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_unsplittable (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_set_vertical_scroll_bars (struct frame *, Lisp_Object,
+ Lisp_Object);
+extern void x_set_scroll_bar_width (struct frame *, Lisp_Object,
+ Lisp_Object);
+
+extern Lisp_Object x_icon_type (struct frame *);
+
+extern int x_figure_window_size (struct frame *, Lisp_Object, int);
extern Lisp_Object Vframe_alpha_lower_limit;
-extern void x_set_alpha P_ ((struct frame *, Lisp_Object, Lisp_Object));
+extern void x_set_alpha (struct frame *, Lisp_Object, Lisp_Object);
-extern void validate_x_resource_name P_ ((void));
+extern void validate_x_resource_name (void);
extern Lisp_Object display_x_get_resource (Display_Info *,
Lisp_Object attribute,
diff --git a/src/fringe.c b/src/fringe.c
index dcb4705e2e5..bfb2c217172 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -490,8 +490,7 @@ int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS;
Return 0 if not a bitmap. */
int
-lookup_fringe_bitmap (bitmap)
- Lisp_Object bitmap;
+lookup_fringe_bitmap (Lisp_Object bitmap)
{
int bn;
@@ -517,8 +516,7 @@ lookup_fringe_bitmap (bitmap)
Return BN if not found in Vfringe_bitmaps. */
static Lisp_Object
-get_fringe_bitmap_name (bn)
- int bn;
+get_fringe_bitmap_name (int bn)
{
Lisp_Object bitmaps;
Lisp_Object num;
@@ -550,43 +548,41 @@ get_fringe_bitmap_name (bn)
*/
static void
-draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
- struct window *w;
- struct glyph_row *row;
- int left_p, overlay;
- int which;
+draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int overlay, int which)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
struct draw_fringe_bitmap_params p;
struct fringe_bitmap *fb;
int period;
int face_id = DEFAULT_FACE_ID;
+ int offset, header_line_height;
- p.cursor_p = 0;
p.overlay_p = (overlay & 1) == 1;
p.cursor_p = (overlay & 2) == 2;
if (which != NO_FRINGE_BITMAP)
{
+ offset = 0;
}
else if (left_p)
{
which = row->left_fringe_bitmap;
face_id = row->left_fringe_face_id;
+ offset = row->left_fringe_offset;
}
else
{
which = row->right_fringe_bitmap;
face_id = row->right_fringe_face_id;
+ offset = row->right_fringe_offset;
}
if (face_id == DEFAULT_FACE_ID)
{
- Lisp_Object face;
-
- if ((face = fringe_faces[which], NILP (face))
- || (face_id = lookup_derived_face (f, face, FRINGE_FACE_ID, 0),
- face_id < 0))
+ Lisp_Object face = fringe_faces[which];
+ face_id = NILP (face) ? lookup_named_face (f, Qfringe, 0)
+ : lookup_derived_face (f, face, FRINGE_FACE_ID, 0);
+ if (face_id < 0)
face_id = FRINGE_FACE_ID;
}
@@ -598,7 +594,7 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
period = fb->period;
/* Convert row to frame coordinates. */
- p.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
+ p.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y) + offset;
p.which = which;
p.bits = fb->bits;
@@ -607,9 +603,19 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
p.h = fb->height;
p.dh = (period > 0 ? (p.y % period) : 0);
p.h -= p.dh;
- /* Clip bitmap if too high. */
- if (p.h > row->height)
- p.h = row->height;
+
+ /* Adjust y to the offset in the row to start drawing the bitmap. */
+ switch (fb->align)
+ {
+ case ALIGN_BITMAP_CENTER:
+ p.y += (row->height - p.h) / 2;
+ break;
+ case ALIGN_BITMAP_BOTTOM:
+ p.y += (row->visible_height - p.h);
+ break;
+ case ALIGN_BITMAP_TOP:
+ break;
+ }
p.face = FACE_FROM_ID (f, face_id);
@@ -625,6 +631,9 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
/* Clear left fringe if no bitmap to draw or if bitmap doesn't fill
the fringe. */
p.bx = -1;
+ header_line_height = WINDOW_HEADER_LINE_HEIGHT (w);
+ p.by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, row->y));
+ p.ny = row->visible_height;
if (left_p)
{
int wd = WINDOW_LEFT_FRINGE_WIDTH (w);
@@ -635,7 +644,7 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
p.wd = wd;
p.x = x - p.wd - (wd - p.wd) / 2;
- if (p.wd < wd || row->height > p.h)
+ if (p.wd < wd || p.y > p.by || p.y + p.h < p.by + p.ny)
{
/* If W has a vertical border to its left, don't draw over it. */
wd -= ((!WINDOW_LEFTMOST_P (w)
@@ -657,42 +666,18 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
p.x = x + (wd - p.wd) / 2;
/* Clear right fringe if no bitmap to draw of if bitmap doesn't fill
the fringe. */
- if (p.wd < wd || row->height > p.h)
+ if (p.wd < wd || p.y > p.by || p.y + p.h < p.by + p.ny)
{
p.bx = x;
p.nx = wd;
}
}
- if (p.bx >= 0)
- {
- int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w);
-
- p.by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, row->y));
- p.ny = row->visible_height;
- }
-
- /* Adjust y to the offset in the row to start drawing the bitmap. */
- switch (fb->align)
- {
- case ALIGN_BITMAP_CENTER:
- p.y += (row->height - p.h) / 2;
- break;
- case ALIGN_BITMAP_BOTTOM:
- p.h = fb->height;
- p.y += (row->visible_height - p.h);
- break;
- case ALIGN_BITMAP_TOP:
- break;
- }
-
FRAME_RIF (f)->draw_fringe_bitmap (w, row, &p);
}
static int
-get_logical_cursor_bitmap (w, cursor)
- struct window *w;
- Lisp_Object cursor;
+get_logical_cursor_bitmap (struct window *w, Lisp_Object cursor)
{
Lisp_Object cmap, bm = Qnil;
@@ -715,10 +700,7 @@ get_logical_cursor_bitmap (w, cursor)
}
static int
-get_logical_fringe_bitmap (w, bitmap, right_p, partial_p)
- struct window *w;
- Lisp_Object bitmap;
- int right_p, partial_p;
+get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, int partial_p)
{
Lisp_Object cmap, bm1 = Qnil, bm2 = Qnil, bm;
int ln1 = 0, ln2 = 0;
@@ -818,10 +800,7 @@ get_logical_fringe_bitmap (w, bitmap, right_p, partial_p)
void
-draw_fringe_bitmap (w, row, left_p)
- struct window *w;
- struct glyph_row *row;
- int left_p;
+draw_fringe_bitmap (struct window *w, struct glyph_row *row, int left_p)
{
int overlay = 0;
@@ -874,9 +853,7 @@ draw_fringe_bitmap (w, row, left_p)
function with input blocked. */
void
-draw_row_fringe_bitmaps (w, row)
- struct window *w;
- struct glyph_row *row;
+draw_row_fringe_bitmaps (struct window *w, struct glyph_row *row)
{
xassert (interrupt_input_blocked);
@@ -904,14 +881,12 @@ draw_row_fringe_bitmaps (w, row)
*/
int
-draw_window_fringes (w, no_fringe)
- struct window *w;
- int no_fringe;
+draw_window_fringes (struct window *w, int no_fringe)
{
struct glyph_row *row;
int yb = window_text_bottom_y (w);
int nrows = w->current_matrix->nrows;
- int y = 0, rn;
+ int y, rn;
int updated = 0;
if (w->pseudo_window_p)
@@ -923,7 +898,7 @@ draw_window_fringes (w, no_fringe)
|| WINDOW_RIGHT_FRINGE_WIDTH (w) == 0))
updated++;
- for (y = 0, rn = 0, row = w->current_matrix->rows;
+ for (y = w->vscroll, rn = 0, row = w->current_matrix->rows;
y < yb && rn < nrows;
y += row->height, ++row, ++rn)
{
@@ -944,9 +919,7 @@ draw_window_fringes (w, no_fringe)
If KEEP_CURRENT_P is 0, update current_matrix too. */
int
-update_window_fringes (w, keep_current_p)
- struct window *w;
- int keep_current_p;
+update_window_fringes (struct window *w, int keep_current_p)
{
struct glyph_row *row, *cur = 0;
int yb = window_text_bottom_y (w);
@@ -959,6 +932,9 @@ update_window_fringes (w, keep_current_p)
Lisp_Object ind = Qnil;
#define MAX_BITMAP_CACHE (8*4)
int bitmap_cache[MAX_BITMAP_CACHE];
+ int top_ind_rn, bot_ind_rn;
+ int top_ind_min_y, bot_ind_max_y;
+ int top_row_ends_at_zv_p, bot_row_ends_at_zv_p;
if (w->pseudo_window_p)
return 0;
@@ -987,11 +963,10 @@ update_window_fringes (w, keep_current_p)
boundary_top = boundary_bot = Qleft;
}
+ top_ind_rn = bot_ind_rn = -1;
if (!NILP (ind))
{
- int done_top = 0, done_bot = 0;
-
- for (y = 0, rn = 0;
+ for (y = w->vscroll, rn = 0;
y < yb && rn < nrows;
y += row->height, ++rn)
{
@@ -1012,31 +987,25 @@ update_window_fringes (w, keep_current_p)
if (!row->mode_line_p)
{
- if (!done_top)
+ if (top_ind_rn < 0 && row->visible_height > 0)
{
if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer))
&& !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row))
row->indicate_bob_p = !NILP (boundary_top);
else
row->indicate_top_line_p = !NILP (arrow_top);
- done_top = 1;
+ top_ind_rn = rn;
}
- if (!done_bot)
+ if (bot_ind_rn < 0)
{
if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer))
&& !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row))
- row->indicate_eob_p = !NILP (boundary_bot), done_bot = 1;
+ row->indicate_eob_p = !NILP (boundary_bot), bot_ind_rn = rn;
else if (y + row->height >= yb)
- row->indicate_bottom_line_p = !NILP (arrow_bot), done_bot = 1;
+ row->indicate_bottom_line_p = !NILP (arrow_bot), bot_ind_rn = rn;
}
}
-
- if (indicate_bob_p != row->indicate_bob_p
- || indicate_top_line_p != row->indicate_top_line_p
- || indicate_eob_p != row->indicate_eob_p
- || indicate_bottom_line_p != row->indicate_bottom_line_p)
- row->redraw_fringe_bitmaps_p = 1;
}
}
@@ -1060,12 +1029,139 @@ update_window_fringes (w, keep_current_p)
get_logical_fringe_bitmap (w, which, 1, partial_p)))
- for (y = 0, rn = 0;
+ /* Extend top-aligned top indicator (or bottom-aligned bottom
+ indicator) to adjacent rows if it doesn't fit in one row. */
+ top_ind_min_y = bot_ind_max_y = -1;
+ if (top_ind_rn >= 0)
+ {
+ int bn = NO_FRINGE_BITMAP;
+
+ row = w->desired_matrix->rows + top_ind_rn;
+ if (!row->enabled_p)
+ row = w->current_matrix->rows + top_ind_rn;
+
+ top_row_ends_at_zv_p = row->ends_at_zv_p;
+ if (row->indicate_bob_p)
+ {
+ if (EQ (boundary_top, Qleft))
+ bn = ((row->indicate_eob_p && EQ (boundary_bot, Qleft))
+ ? LEFT_FRINGE (1, Qtop_bottom, row->ends_at_zv_p)
+ : LEFT_FRINGE (2, Qtop, 0));
+ else
+ bn = ((row->indicate_eob_p && EQ (boundary_bot, Qright))
+ ? RIGHT_FRINGE (1, Qtop_bottom, row->ends_at_zv_p)
+ : RIGHT_FRINGE (2, Qtop, 0));
+ }
+ else if (row->indicate_top_line_p)
+ {
+ if (EQ (arrow_top, Qleft))
+ bn = LEFT_FRINGE (6, Qup, 0);
+ else
+ bn = RIGHT_FRINGE (6, Qup, 0);
+ }
+
+ if (bn != NO_FRINGE_BITMAP)
+ {
+ struct fringe_bitmap *fb;
+
+ fb = fringe_bitmaps[bn];
+ if (fb == NULL)
+ fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS
+ ? bn : UNDEF_FRINGE_BITMAP];
+ if (fb->align == ALIGN_BITMAP_TOP && fb->period == 0)
+ {
+ struct glyph_row *row1;
+ int top_ind_max_y;
+
+ top_ind_min_y = WINDOW_HEADER_LINE_HEIGHT (w);
+ top_ind_max_y = top_ind_min_y + fb->height;
+ if (top_ind_max_y > yb)
+ top_ind_max_y = yb;
+
+ for (y = row->y + row->height, rn = top_ind_rn + 1;
+ y < top_ind_max_y && rn < nrows;
+ y += row1->height, rn++)
+ {
+ if (bot_ind_rn >= 0 && rn >= bot_ind_rn)
+ break;
+
+ row1 = w->desired_matrix->rows + rn;
+ if (!row1->enabled_p)
+ row1 = w->current_matrix->rows + rn;
+
+ row1->indicate_bob_p = row->indicate_bob_p;
+ row1->indicate_top_line_p = row->indicate_top_line_p;
+ }
+ }
+ }
+ }
+ if (bot_ind_rn >= 0)
+ {
+ int bn = NO_FRINGE_BITMAP;
+
+ row = w->desired_matrix->rows + bot_ind_rn;
+ if (!row->enabled_p)
+ row = w->current_matrix->rows + bot_ind_rn;
+
+ bot_row_ends_at_zv_p = row->ends_at_zv_p;
+ if (row->indicate_eob_p)
+ {
+ if (EQ (boundary_bot, Qleft))
+ bn = LEFT_FRINGE (3, Qbottom, row->ends_at_zv_p);
+ else
+ bn = RIGHT_FRINGE (3, Qbottom, row->ends_at_zv_p);
+ }
+ else if (row->indicate_bottom_line_p)
+ {
+ if (EQ (arrow_bot, Qleft))
+ bn = LEFT_FRINGE (7, Qdown, 0);
+ else
+ bn = RIGHT_FRINGE (7, Qdown, 0);
+ }
+
+ if (bn != NO_FRINGE_BITMAP)
+ {
+ struct fringe_bitmap *fb;
+
+ fb = fringe_bitmaps[bn];
+ if (fb == NULL)
+ fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS
+ ? bn : UNDEF_FRINGE_BITMAP];
+ if (fb->align == ALIGN_BITMAP_BOTTOM && fb->period == 0)
+ {
+ struct glyph_row *row1;
+ int bot_ind_min_y;
+
+ bot_ind_max_y = row->y + row->visible_height;
+ bot_ind_min_y = bot_ind_max_y - fb->height;
+ if (bot_ind_min_y < WINDOW_HEADER_LINE_HEIGHT (w))
+ bot_ind_min_y = WINDOW_HEADER_LINE_HEIGHT (w);
+
+ for (y = row->y, rn = bot_ind_rn - 1;
+ y >= bot_ind_min_y && rn >= 0;
+ y -= row1->height, rn--)
+ {
+ if (top_ind_rn >= 0 && rn <= top_ind_rn)
+ break;
+
+ row1 = w->desired_matrix->rows + rn;
+ if (!row1->enabled_p)
+ row1 = w->current_matrix->rows + rn;
+
+ row1->indicate_eob_p = row->indicate_eob_p;
+ row1->indicate_bottom_line_p = row->indicate_bottom_line_p;
+ }
+ }
+ }
+ }
+
+ for (y = w->vscroll, rn = 0;
y < yb && rn < nrows;
y += row->height, rn++)
{
int left, right;
unsigned left_face_id, right_face_id;
+ int left_offset, right_offset;
row = w->desired_matrix->rows + rn;
cur = w->current_matrix->rows + rn;
@@ -1073,6 +1169,7 @@ update_window_fringes (w, keep_current_p)
row = cur;
left_face_id = right_face_id = DEFAULT_FACE_ID;
+ left_offset = right_offset = 0;
/* Decide which bitmap to draw in the left fringe. */
if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
@@ -1086,20 +1183,36 @@ update_window_fringes (w, keep_current_p)
|| (row->reversed_p && row->truncated_on_right_p))
left = LEFT_FRINGE(0, Qtruncation, 0);
else if (row->indicate_bob_p && EQ (boundary_top, Qleft))
- left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft))
- ? LEFT_FRINGE (1, Qtop_bottom, row->ends_at_zv_p)
- : LEFT_FRINGE (2, Qtop, 0));
+ {
+ left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft))
+ ? LEFT_FRINGE (1, Qtop_bottom, top_row_ends_at_zv_p)
+ : LEFT_FRINGE (2, Qtop, 0));
+ if (top_ind_min_y >= 0)
+ left_offset = top_ind_min_y - row->y;
+ }
else if (row->indicate_eob_p && EQ (boundary_bot, Qleft))
- left = LEFT_FRINGE (3, Qbottom, row->ends_at_zv_p);
+ {
+ left = LEFT_FRINGE (3, Qbottom, bot_row_ends_at_zv_p);
+ if (bot_ind_max_y >= 0)
+ left_offset = bot_ind_max_y - (row->y + row->visible_height);
+ }
else if ((!row->reversed_p && MATRIX_ROW_CONTINUATION_LINE_P (row))
|| (row->reversed_p && row->continued_p))
left = LEFT_FRINGE (4, Qcontinuation, 0);
else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft))
left = LEFT_FRINGE (5, Qempty_line, 0);
else if (row->indicate_top_line_p && EQ (arrow_top, Qleft))
- left = LEFT_FRINGE (6, Qup, 0);
+ {
+ left = LEFT_FRINGE (6, Qup, 0);
+ if (top_ind_min_y >= 0)
+ left_offset = top_ind_min_y - row->y;
+ }
else if (row->indicate_bottom_line_p && EQ (arrow_bot, Qleft))
- left = LEFT_FRINGE (7, Qdown, 0);
+ {
+ left = LEFT_FRINGE (7, Qdown, 0);
+ if (bot_ind_max_y >= 0)
+ left_offset = bot_ind_max_y - (row->y + row->visible_height);
+ }
else
left = NO_FRINGE_BITMAP;
@@ -1115,18 +1228,34 @@ update_window_fringes (w, keep_current_p)
|| (row->reversed_p && row->truncated_on_left_p))
right = RIGHT_FRINGE (0, Qtruncation, 0);
else if (row->indicate_bob_p && EQ (boundary_top, Qright))
- right = ((row->indicate_eob_p && EQ (boundary_bot, Qright))
- ? RIGHT_FRINGE (1, Qtop_bottom, row->ends_at_zv_p)
- : RIGHT_FRINGE (2, Qtop, 0));
+ {
+ right = ((row->indicate_eob_p && EQ (boundary_bot, Qright))
+ ? RIGHT_FRINGE (1, Qtop_bottom, top_row_ends_at_zv_p)
+ : RIGHT_FRINGE (2, Qtop, 0));
+ if (top_ind_min_y >= 0)
+ right_offset = top_ind_min_y - row->y;
+ }
else if (row->indicate_eob_p && EQ (boundary_bot, Qright))
- right = RIGHT_FRINGE (3, Qbottom, row->ends_at_zv_p);
+ {
+ right = RIGHT_FRINGE (3, Qbottom, bot_row_ends_at_zv_p);
+ if (bot_ind_max_y >= 0)
+ right_offset = bot_ind_max_y - (row->y + row->visible_height);
+ }
else if ((!row->reversed_p && row->continued_p)
|| (row->reversed_p && MATRIX_ROW_CONTINUATION_LINE_P (row)))
right = RIGHT_FRINGE (4, Qcontinuation, 0);
else if (row->indicate_top_line_p && EQ (arrow_top, Qright))
- right = RIGHT_FRINGE (6, Qup, 0);
+ {
+ right = RIGHT_FRINGE (6, Qup, 0);
+ if (top_ind_min_y >= 0)
+ right_offset = top_ind_min_y - row->y;
+ }
else if (row->indicate_bottom_line_p && EQ (arrow_bot, Qright))
- right = RIGHT_FRINGE (7, Qdown, 0);
+ {
+ right = RIGHT_FRINGE (7, Qdown, 0);
+ if (bot_ind_max_y >= 0)
+ right_offset = bot_ind_max_y - (row->y + row->visible_height);
+ }
else if (row->indicate_empty_line_p && EQ (empty_pos, Qright))
right = RIGHT_FRINGE (5, Qempty_line, 0);
else
@@ -1139,6 +1268,8 @@ update_window_fringes (w, keep_current_p)
|| right != cur->right_fringe_bitmap
|| left_face_id != cur->left_fringe_face_id
|| right_face_id != cur->right_fringe_face_id
+ || left_offset != cur->left_fringe_offset
+ || right_offset != cur->right_fringe_offset
|| cur->redraw_fringe_bitmaps_p)
{
redraw_p = row->redraw_fringe_bitmaps_p = 1;
@@ -1149,6 +1280,8 @@ update_window_fringes (w, keep_current_p)
cur->right_fringe_bitmap = right;
cur->left_fringe_face_id = left_face_id;
cur->right_fringe_face_id = right_face_id;
+ cur->left_fringe_offset = left_offset;
+ cur->right_fringe_offset = right_offset;
}
}
@@ -1165,9 +1298,8 @@ update_window_fringes (w, keep_current_p)
row->right_fringe_bitmap = right;
row->left_fringe_face_id = left_face_id;
row->right_fringe_face_id = right_face_id;
-
- if (rn > 0 && row->redraw_fringe_bitmaps_p)
- row[-1].redraw_fringe_bitmaps_p = cur[-1].redraw_fringe_bitmaps_p = 1;
+ row->left_fringe_offset = left_offset;
+ row->right_fringe_offset = right_offset;
}
return redraw_p && !keep_current_p;
@@ -1188,9 +1320,7 @@ update_window_fringes (w, keep_current_p)
*/
void
-compute_fringe_widths (f, redraw)
- struct frame *f;
- int redraw;
+compute_fringe_widths (struct frame *f, int redraw)
{
int o_left = FRAME_LEFT_FRINGE_WIDTH (f);
int o_right = FRAME_RIGHT_FRINGE_WIDTH (f);
@@ -1272,8 +1402,7 @@ compute_fringe_widths (f, redraw)
/* Free resources used by a user-defined bitmap. */
void
-destroy_fringe_bitmap (n)
- int n;
+destroy_fringe_bitmap (int n)
{
struct fringe_bitmap **fbp;
@@ -1300,8 +1429,7 @@ DEFUN ("destroy-fringe-bitmap", Fdestroy_fringe_bitmap, Sdestroy_fringe_bitmap,
1, 1, 0,
doc: /* Destroy fringe bitmap BITMAP.
If BITMAP overrides a standard fringe bitmap, the original bitmap is restored. */)
- (bitmap)
- Lisp_Object bitmap;
+ (Lisp_Object bitmap)
{
int n;
@@ -1342,10 +1470,7 @@ static const unsigned char swap_nibble[16] = {
#endif /* HAVE_X_WINDOWS */
void
-init_fringe_bitmap (which, fb, once_p)
- int which;
- struct fringe_bitmap *fb;
- int once_p;
+init_fringe_bitmap (int which, struct fringe_bitmap *fb, int once_p)
{
if (once_p || fb->dynamic)
{
@@ -1415,8 +1540,7 @@ is used; the default is to center the bitmap. Fifth arg may also be a
list (ALIGN PERIODIC) where PERIODIC non-nil specifies that the bitmap
should be repeated.
If BITMAP already exists, the existing definition is replaced. */)
- (bitmap, bits, height, width, align)
- Lisp_Object bitmap, bits, height, width, align;
+ (Lisp_Object bitmap, Lisp_Object bits, Lisp_Object height, Lisp_Object width, Lisp_Object align)
{
int n, h, i, j;
unsigned short *b;
@@ -1520,7 +1644,7 @@ If BITMAP already exists, the existing definition is replaced. */)
xfb = (struct fringe_bitmap *) xmalloc (sizeof fb
+ fb.height * BYTES_PER_BITMAP_ROW);
fb.bits = b = (unsigned short *) (xfb + 1);
- bzero (b, fb.height);
+ memset (b, 0, fb.height);
j = 0;
while (j < fb.height)
@@ -1547,8 +1671,7 @@ DEFUN ("set-fringe-bitmap-face", Fset_fringe_bitmap_face, Sset_fringe_bitmap_fac
1, 2, 0,
doc: /* Set face for fringe bitmap BITMAP to FACE.
If FACE is nil, reset face to default fringe face. */)
- (bitmap, face)
- Lisp_Object bitmap, face;
+ (Lisp_Object bitmap, Lisp_Object face)
{
int n;
int face_id;
@@ -1580,8 +1703,7 @@ is the symbol for the bitmap in the left fringe (or nil if no bitmap),
RIGHT is similar for the right fringe, and OV is non-nil if there is an
overlay arrow in the left fringe.
Return nil if POS is not visible in WINDOW. */)
- (pos, window)
- Lisp_Object pos, window;
+ (Lisp_Object pos, Lisp_Object window)
{
struct window *w;
struct glyph_row *row;
@@ -1620,7 +1742,7 @@ Return nil if POS is not visible in WINDOW. */)
***********************************************************************/
void
-syms_of_fringe ()
+syms_of_fringe (void)
{
Qtruncation = intern_c_string ("truncation");
staticpro (&Qtruncation);
@@ -1657,7 +1779,7 @@ If nil, also continue lines which are exactly as wide as the window. */);
/* Garbage collection hook */
void
-mark_fringe_data ()
+mark_fringe_data (void)
{
int i;
@@ -1669,7 +1791,7 @@ mark_fringe_data ()
/* Initialize this module when Emacs starts. */
void
-init_fringe_once ()
+init_fringe_once (void)
{
int bt;
@@ -1678,7 +1800,7 @@ init_fringe_once ()
}
void
-init_fringe ()
+init_fringe (void)
{
int i;
@@ -1714,7 +1836,7 @@ w32_init_fringe (struct redisplay_interface *rif)
}
void
-w32_reset_fringes ()
+w32_reset_fringes (void)
{
/* Destroy row bitmaps. */
int bt;
diff --git a/src/ftfont.c b/src/ftfont.c
index 9699dc58009..1fdf4c265ce 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -80,16 +80,16 @@ enum ftfont_cache_for
FTFONT_CACHE_FOR_ENTITY
};
-static Lisp_Object ftfont_pattern_entity P_ ((FcPattern *, Lisp_Object));
+static Lisp_Object ftfont_pattern_entity (FcPattern *, Lisp_Object);
-static Lisp_Object ftfont_resolve_generic_family P_ ((Lisp_Object,
- FcPattern *));
-static Lisp_Object ftfont_lookup_cache P_ ((Lisp_Object,
- enum ftfont_cache_for));
+static Lisp_Object ftfont_resolve_generic_family (Lisp_Object,
+ FcPattern *);
+static Lisp_Object ftfont_lookup_cache (Lisp_Object,
+ enum ftfont_cache_for);
-static void ftfont_filter_properties P_ ((Lisp_Object font, Lisp_Object alist));
+static void ftfont_filter_properties (Lisp_Object font, Lisp_Object alist);
-Lisp_Object ftfont_font_format P_ ((FcPattern *, Lisp_Object));
+Lisp_Object ftfont_font_format (FcPattern *, Lisp_Object);
#define SYMBOL_FcChar8(SYM) (FcChar8 *) SDATA (SYMBOL_NAME (SYM))
@@ -188,9 +188,7 @@ get_adstyle_property (FcPattern *p)
}
static Lisp_Object
-ftfont_pattern_entity (p, extra)
- FcPattern *p;
- Lisp_Object extra;
+ftfont_pattern_entity (FcPattern *p, Lisp_Object extra)
{
Lisp_Object key, cache, entity;
char *file, *str;
@@ -289,9 +287,7 @@ ftfont_pattern_entity (p, extra)
static Lisp_Object ftfont_generic_family_list;
static Lisp_Object
-ftfont_resolve_generic_family (family, pattern)
- Lisp_Object family;
- FcPattern *pattern;
+ftfont_resolve_generic_family (Lisp_Object family, FcPattern *pattern)
{
Lisp_Object slot;
FcPattern *match;
@@ -348,9 +344,7 @@ struct ftfont_cache_data
};
static Lisp_Object
-ftfont_lookup_cache (key, cache_for)
- Lisp_Object key;
- enum ftfont_cache_for cache_for;
+ftfont_lookup_cache (Lisp_Object key, enum ftfont_cache_for cache_for)
{
Lisp_Object cache, val, entity;
struct ftfont_cache_data *cache_data;
@@ -450,8 +444,7 @@ ftfont_lookup_cache (key, cache_for)
}
FcCharSet *
-ftfont_get_fc_charset (entity)
- Lisp_Object entity;
+ftfont_get_fc_charset (Lisp_Object entity)
{
Lisp_Object val, cache;
struct ftfont_cache_data *cache_data;
@@ -464,8 +457,7 @@ ftfont_get_fc_charset (entity)
#ifdef HAVE_LIBOTF
static OTF *
-ftfont_get_otf (ftfont_info)
- struct ftfont_info *ftfont_info;
+ftfont_get_otf (struct ftfont_info *ftfont_info)
{
OTF *otf;
@@ -486,26 +478,26 @@ ftfont_get_otf (ftfont_info)
}
#endif /* HAVE_LIBOTF */
-static Lisp_Object ftfont_get_cache P_ ((FRAME_PTR));
-static Lisp_Object ftfont_list P_ ((Lisp_Object, Lisp_Object));
-static Lisp_Object ftfont_match P_ ((Lisp_Object, Lisp_Object));
-static Lisp_Object ftfont_list_family P_ ((Lisp_Object));
-static Lisp_Object ftfont_open P_ ((FRAME_PTR, Lisp_Object, int));
-static void ftfont_close P_ ((FRAME_PTR, struct font *));
-static int ftfont_has_char P_ ((Lisp_Object, int));
-static unsigned ftfont_encode_char P_ ((struct font *, int));
-static int ftfont_text_extents P_ ((struct font *, unsigned *, int,
- struct font_metrics *));
-static int ftfont_get_bitmap P_ ((struct font *, unsigned,
- struct font_bitmap *, int));
-static int ftfont_anchor_point P_ ((struct font *, unsigned, int,
- int *, int *));
-static Lisp_Object ftfont_otf_capability P_ ((struct font *));
-static Lisp_Object ftfont_shape P_ ((Lisp_Object));
+static Lisp_Object ftfont_get_cache (FRAME_PTR);
+static Lisp_Object ftfont_list (Lisp_Object, Lisp_Object);
+static Lisp_Object ftfont_match (Lisp_Object, Lisp_Object);
+static Lisp_Object ftfont_list_family (Lisp_Object);
+static Lisp_Object ftfont_open (FRAME_PTR, Lisp_Object, int);
+static void ftfont_close (FRAME_PTR, struct font *);
+static int ftfont_has_char (Lisp_Object, int);
+static unsigned ftfont_encode_char (struct font *, int);
+static int ftfont_text_extents (struct font *, unsigned *, int,
+ struct font_metrics *);
+static int ftfont_get_bitmap (struct font *, unsigned,
+ struct font_bitmap *, int);
+static int ftfont_anchor_point (struct font *, unsigned, int,
+ int *, int *);
+static Lisp_Object ftfont_otf_capability (struct font *);
+static Lisp_Object ftfont_shape (Lisp_Object);
#ifdef HAVE_OTF_GET_VARIATION_GLYPHS
-static int ftfont_variation_glyphs P_ ((struct font *, int c,
- unsigned variations[256]));
+static int ftfont_variation_glyphs (struct font *, int c,
+ unsigned variations[256]);
#endif /* HAVE_OTF_GET_VARIATION_GLYPHS */
struct font_driver ftfont_driver =
@@ -559,15 +551,13 @@ struct font_driver ftfont_driver =
extern Lisp_Object QCname;
static Lisp_Object
-ftfont_get_cache (f)
- FRAME_PTR f;
+ftfont_get_cache (FRAME_PTR f)
{
return freetype_font_cache;
}
static int
-ftfont_get_charset (registry)
- Lisp_Object registry;
+ftfont_get_charset (Lisp_Object registry)
{
char *str = (char *) SDATA (SYMBOL_NAME (registry));
char *re = alloca (SBYTES (SYMBOL_NAME (registry)) * 2 + 1);
@@ -705,16 +695,12 @@ ftfont_get_open_type_spec (Lisp_Object otf_spec)
return spec;
}
-static FcPattern *ftfont_spec_pattern P_ ((Lisp_Object, char *,
- struct OpenTypeSpec **,
- char **langname));
+static FcPattern *ftfont_spec_pattern (Lisp_Object, char *,
+ struct OpenTypeSpec **,
+ char **langname);
static FcPattern *
-ftfont_spec_pattern (spec, otlayout, otspec, langname)
- Lisp_Object spec;
- char *otlayout;
- struct OpenTypeSpec **otspec;
- char **langname;
+ftfont_spec_pattern (Lisp_Object spec, char *otlayout, struct OpenTypeSpec **otspec, char **langname)
{
Lisp_Object tmp, extra;
FcPattern *pattern = NULL;
@@ -871,8 +857,7 @@ ftfont_spec_pattern (spec, otlayout, otspec, langname)
}
static Lisp_Object
-ftfont_list (frame, spec)
- Lisp_Object frame, spec;
+ftfont_list (Lisp_Object frame, Lisp_Object spec)
{
Lisp_Object val = Qnil, family, adstyle;
int i;
@@ -1069,8 +1054,7 @@ ftfont_list (frame, spec)
}
static Lisp_Object
-ftfont_match (frame, spec)
- Lisp_Object frame, spec;
+ftfont_match (Lisp_Object frame, Lisp_Object spec)
{
Lisp_Object entity = Qnil;
FcPattern *pattern, *match = NULL;
@@ -1120,8 +1104,7 @@ ftfont_match (frame, spec)
}
static Lisp_Object
-ftfont_list_family (frame)
- Lisp_Object frame;
+ftfont_list_family (Lisp_Object frame)
{
Lisp_Object list = Qnil;
FcPattern *pattern = NULL;
@@ -1164,10 +1147,7 @@ ftfont_list_family (frame)
static Lisp_Object
-ftfont_open (f, entity, pixel_size)
- FRAME_PTR f;
- Lisp_Object entity;
- int pixel_size;
+ftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
{
struct ftfont_info *ftfont_info;
struct font *font;
@@ -1262,7 +1242,7 @@ ftfont_open (f, entity, pixel_size)
spacing = XINT (AREF (entity, FONT_SPACING_INDEX));
else
spacing = FC_PROPORTIONAL;
- if (spacing != FC_PROPORTIONAL)
+ if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL)
font->min_width = font->average_width = font->space_width
= (scalable ? ft_face->max_advance_width * size / upEM
: ft_face->size->metrics.max_advance >> 6);
@@ -1307,9 +1287,7 @@ ftfont_open (f, entity, pixel_size)
}
static void
-ftfont_close (f, font)
- FRAME_PTR f;
- struct font *font;
+ftfont_close (FRAME_PTR f, struct font *font)
{
struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
Lisp_Object val, cache;
@@ -1335,9 +1313,7 @@ ftfont_close (f, font)
}
static int
-ftfont_has_char (font, c)
- Lisp_Object font;
- int c;
+ftfont_has_char (Lisp_Object font, int c)
{
struct charset *cs = NULL;
@@ -1367,9 +1343,7 @@ ftfont_has_char (font, c)
}
static unsigned
-ftfont_encode_char (font, c)
- struct font *font;
- int c;
+ftfont_encode_char (struct font *font, int c)
{
struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
FT_Face ft_face = ftfont_info->ft_size->face;
@@ -1380,11 +1354,7 @@ ftfont_encode_char (font, c)
}
static int
-ftfont_text_extents (font, code, nglyphs, metrics)
- struct font *font;
- unsigned *code;
- int nglyphs;
- struct font_metrics *metrics;
+ftfont_text_extents (struct font *font, unsigned int *code, int nglyphs, struct font_metrics *metrics)
{
struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
FT_Face ft_face = ftfont_info->ft_size->face;
@@ -1394,7 +1364,7 @@ ftfont_text_extents (font, code, nglyphs, metrics)
if (ftfont_info->ft_size != ft_face->size)
FT_Activate_Size (ftfont_info->ft_size);
if (metrics)
- bzero (metrics, sizeof (struct font_metrics));
+ memset (metrics, 0, sizeof (struct font_metrics));
for (i = 0, first = 1; i < nglyphs; i++)
{
if (FT_Load_Glyph (ft_face, code[i], FT_LOAD_DEFAULT) == 0)
@@ -1439,11 +1409,7 @@ ftfont_text_extents (font, code, nglyphs, metrics)
}
static int
-ftfont_get_bitmap (font, code, bitmap, bits_per_pixel)
- struct font *font;
- unsigned code;
- struct font_bitmap *bitmap;
- int bits_per_pixel;
+ftfont_get_bitmap (struct font *font, unsigned int code, struct font_bitmap *bitmap, int bits_per_pixel)
{
struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
FT_Face ft_face = ftfont_info->ft_size->face;
@@ -1487,11 +1453,7 @@ ftfont_get_bitmap (font, code, bitmap, bits_per_pixel)
}
static int
-ftfont_anchor_point (font, code, index, x, y)
- struct font *font;
- unsigned code;
- int index;
- int *x, *y;
+ftfont_anchor_point (struct font *font, unsigned int code, int index, int *x, int *y)
{
struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
FT_Face ft_face = ftfont_info->ft_size->face;
@@ -1512,8 +1474,7 @@ ftfont_anchor_point (font, code, index, x, y)
#ifdef HAVE_LIBOTF
static Lisp_Object
-ftfont_otf_features (gsub_gpos)
- OTF_GSUB_GPOS *gsub_gpos;
+ftfont_otf_features (OTF_GSUB_GPOS *gsub_gpos)
{
Lisp_Object scripts, langsyses, features, sym;
int i, j, k, l;
@@ -1557,8 +1518,7 @@ ftfont_otf_features (gsub_gpos)
static Lisp_Object
-ftfont_otf_capability (font)
- struct font *font;
+ftfont_otf_capability (struct font *font)
{
struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
OTF *otf = ftfont_get_otf (ftfont_info);
@@ -1596,10 +1556,8 @@ struct MFLTFontFT
};
static int
-ftfont_get_glyph_id (font, gstring, from, to)
- MFLTFont *font;
- MFLTGlyphString *gstring;
- int from, to;
+ftfont_get_glyph_id (MFLTFont *font, MFLTGlyphString *gstring,
+ int from, int to)
{
struct MFLTFontFT *flt_font_ft = (struct MFLTFontFT *) font;
FT_Face ft_face = flt_font_ft->ft_face;
@@ -1623,10 +1581,8 @@ ftfont_get_glyph_id (font, gstring, from, to)
#define ROUND(x) (((x)+32) & -64)
static int
-ftfont_get_metrics (font, gstring, from, to)
- MFLTFont *font;
- MFLTGlyphString *gstring;
- int from, to;
+ftfont_get_metrics (MFLTFont *font, MFLTGlyphString *gstring,
+ int from, int to)
{
struct MFLTFontFT *flt_font_ft = (struct MFLTFontFT *) font;
FT_Face ft_face = flt_font_ft->ft_face;
@@ -2123,13 +2079,9 @@ ftfont_try_otf (MFLTFont *font, MFLTOtfSpec *spec,
#else /* not M17N_FLT_USE_NEW_FEATURE */
static int
-ftfont_drive_otf (font, spec, in, from, to, out, adjustment)
- MFLTFont *font;
- MFLTOtfSpec *spec;
- MFLTGlyphString *in;
- int from, to;
- MFLTGlyphString *out;
- MFLTGlyphAdjustment *adjustment;
+ftfont_drive_otf (MFLTFont *font, MFLTOtfSpec *spec, MFLTGlyphString *in,
+ int from, int to,
+ MFLTGlyphString *out, MFLTGlyphAdjustment *adjustment)
{
struct MFLTFontFT *flt_font_ft = (struct MFLTFontFT *) font;
FT_Face ft_face = flt_font_ft->ft_face;
@@ -2384,12 +2336,8 @@ static int m17n_flt_initialized;
extern Lisp_Object QCfamily;
static Lisp_Object
-ftfont_shape_by_flt (lgstring, font, ft_face, otf, matrix)
- Lisp_Object lgstring;
- struct font *font;
- FT_Face ft_face;
- OTF *otf;
- FT_Matrix *matrix;
+ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font,
+ FT_Face ft_face, OTF *otf, FT_Matrix *matrix)
{
EMACS_UINT len = LGSTRING_GLYPH_LEN (lgstring);
EMACS_UINT i;
@@ -2555,8 +2503,7 @@ ftfont_shape_by_flt (lgstring, font, ft_face, otf, matrix)
}
Lisp_Object
-ftfont_shape (lgstring)
- Lisp_Object lgstring;
+ftfont_shape (Lisp_Object lgstring)
{
struct font *font;
struct ftfont_info *ftfont_info;
@@ -2576,10 +2523,7 @@ ftfont_shape (lgstring)
#ifdef HAVE_OTF_GET_VARIATION_GLYPHS
static int
-ftfont_variation_glyphs (font, c, variations)
- struct font *font;
- int c;
- unsigned variations[256];
+ftfont_variation_glyphs (struct font *font, int c, unsigned variations[256])
{
struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
OTF *otf = ftfont_get_otf (ftfont_info);
@@ -2677,9 +2621,7 @@ static const char *ftfont_non_booleans [] = {
};
static void
-ftfont_filter_properties (font, alist)
- Lisp_Object font;
- Lisp_Object alist;
+ftfont_filter_properties (Lisp_Object font, Lisp_Object alist)
{
Lisp_Object it;
int i;
@@ -2721,7 +2663,7 @@ ftfont_filter_properties (font, alist)
void
-syms_of_ftfont ()
+syms_of_ftfont (void)
{
DEFSYM (Qfreetype, "freetype");
DEFSYM (Qmonospace, "monospace");
diff --git a/src/ftxfont.c b/src/ftxfont.c
index 847522a2f9c..0a9137617b8 100644
--- a/src/ftxfont.c
+++ b/src/ftxfont.c
@@ -39,12 +39,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
static Lisp_Object Qftx;
/* Prototypes for helper function. */
-static GC *ftxfont_get_gcs P_ ((FRAME_PTR, unsigned long, unsigned long));
-static int ftxfont_draw_bitmap P_ ((FRAME_PTR, GC, GC *, struct font *,
- unsigned, int, int, XPoint *, int, int *,
- int));
-static void ftxfont_draw_backgrond P_ ((FRAME_PTR, struct font *, GC,
- int, int, int));
+static GC *ftxfont_get_gcs (FRAME_PTR, unsigned long, unsigned long);
+static int ftxfont_draw_bitmap (FRAME_PTR, GC, GC *, struct font *,
+ unsigned, int, int, XPoint *, int, int *,
+ int);
+static void ftxfont_draw_backgrond (FRAME_PTR, struct font *, GC,
+ int, int, int);
struct ftxfont_frame_data
{
@@ -61,9 +61,7 @@ struct ftxfont_frame_data
/* Return an array of 6 GCs for antialiasing. */
static GC *
-ftxfont_get_gcs (f, foreground, background)
- FRAME_PTR f;
- unsigned long foreground, background;
+ftxfont_get_gcs (FRAME_PTR f, long unsigned int foreground, long unsigned int background)
{
XColor color;
XGCValues xgcv;
@@ -140,15 +138,7 @@ ftxfont_get_gcs (f, foreground, background)
}
static int
-ftxfont_draw_bitmap (f, gc_fore, gcs, font, code, x, y, p, size, n, flush)
- FRAME_PTR f;
- GC gc_fore, *gcs;
- struct font *font;
- unsigned code;
- int x, y;
- XPoint *p;
- int size, *n;
- int flush;
+ftxfont_draw_bitmap (FRAME_PTR f, GC gc_fore, GC *gcs, struct font *font, unsigned int code, int x, int y, XPoint *p, int size, int *n, int flush)
{
struct font_bitmap bitmap;
unsigned char *b;
@@ -224,11 +214,7 @@ ftxfont_draw_bitmap (f, gc_fore, gcs, font, code, x, y, p, size, n, flush)
}
static void
-ftxfont_draw_backgrond (f, font, gc, x, y, width)
- FRAME_PTR f;
- struct font *font;
- GC gc;
- int x, y, width;
+ftxfont_draw_backgrond (FRAME_PTR f, struct font *font, GC gc, int x, int y, int width)
{
XGCValues xgcv;
@@ -241,18 +227,16 @@ ftxfont_draw_backgrond (f, font, gc, x, y, width)
}
/* Prototypes for font-driver methods. */
-static Lisp_Object ftxfont_list P_ ((Lisp_Object, Lisp_Object));
-static Lisp_Object ftxfont_match P_ ((Lisp_Object, Lisp_Object));
-static Lisp_Object ftxfont_open P_ ((FRAME_PTR, Lisp_Object, int));
-static void ftxfont_close P_ ((FRAME_PTR, struct font *));
-static int ftxfont_draw P_ ((struct glyph_string *, int, int, int, int, int));
+static Lisp_Object ftxfont_list (Lisp_Object, Lisp_Object);
+static Lisp_Object ftxfont_match (Lisp_Object, Lisp_Object);
+static Lisp_Object ftxfont_open (FRAME_PTR, Lisp_Object, int);
+static void ftxfont_close (FRAME_PTR, struct font *);
+static int ftxfont_draw (struct glyph_string *, int, int, int, int, int);
struct font_driver ftxfont_driver;
static Lisp_Object
-ftxfont_list (frame, spec)
- Lisp_Object frame;
- Lisp_Object spec;
+ftxfont_list (Lisp_Object frame, Lisp_Object spec)
{
Lisp_Object list = ftfont_driver.list (frame, spec), tail;
@@ -262,9 +246,7 @@ ftxfont_list (frame, spec)
}
static Lisp_Object
-ftxfont_match (frame, spec)
- Lisp_Object frame;
- Lisp_Object spec;
+ftxfont_match (Lisp_Object frame, Lisp_Object spec)
{
Lisp_Object entity = ftfont_driver.match (frame, spec);
@@ -274,10 +256,7 @@ ftxfont_match (frame, spec)
}
static Lisp_Object
-ftxfont_open (f, entity, pixel_size)
- FRAME_PTR f;
- Lisp_Object entity;
- int pixel_size;
+ftxfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
{
Lisp_Object font_object;
struct font *font;
@@ -291,17 +270,13 @@ ftxfont_open (f, entity, pixel_size)
}
static void
-ftxfont_close (f, font)
- FRAME_PTR f;
- struct font *font;
+ftxfont_close (FRAME_PTR f, struct font *font)
{
ftfont_driver.close (f, font);
}
static int
-ftxfont_draw (s, from, to, x, y, with_background)
- struct glyph_string *s;
- int from, to, x, y, with_background;
+ftxfont_draw (struct glyph_string *s, int from, int to, int x, int y, int with_background)
{
FRAME_PTR f = s->f;
struct face *face = s->face;
@@ -372,8 +347,7 @@ ftxfont_draw (s, from, to, x, y, with_background)
}
static int
-ftxfont_end_for_frame (f)
- FRAME_PTR f;
+ftxfont_end_for_frame (FRAME_PTR f)
{
struct ftxfont_frame_data *data = font_get_frame_data (f, &ftxfont_driver);
@@ -396,7 +370,7 @@ ftxfont_end_for_frame (f)
void
-syms_of_ftxfont ()
+syms_of_ftxfont (void)
{
DEFSYM (Qftx, "ftx");
diff --git a/src/getloadavg.c b/src/getloadavg.c
index a174fc07a01..779a0ef804c 100644
--- a/src/getloadavg.c
+++ b/src/getloadavg.c
@@ -713,7 +713,7 @@ getloadavg (loadavg, nelem)
for (i = 0; i < conf.config_maxclass; ++i)
{
struct class_stats stats;
- bzero ((char *) &stats, sizeof stats);
+ memset (&stats, 0, sizeof stats);
desc.sd_type = CPUTYPE_CLASS;
desc.sd_objid = i;
diff --git a/src/gmalloc.c b/src/gmalloc.c
index a3f533bd5e8..8314798b171 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -1969,12 +1969,12 @@ Fifth Floor, Boston, MA 02110-1301, USA.
#endif
/* Old hook values. */
-static void (*old_free_hook) __P ((__ptr_t ptr));
-static __ptr_t (*old_malloc_hook) __P ((__malloc_size_t size));
-static __ptr_t (*old_realloc_hook) __P ((__ptr_t ptr, __malloc_size_t size));
+static void (*old_free_hook) (__ptr_t ptr);
+static __ptr_t (*old_malloc_hook) (__malloc_size_t size);
+static __ptr_t (*old_realloc_hook) (__ptr_t ptr, __malloc_size_t size);
/* Function to call when something awful happens. */
-static void (*abortfunc) __P ((enum mcheck_status));
+static void (*abortfunc) (enum mcheck_status);
/* Arbitrary magical numbers. */
#define MAGICWORD 0xfedabeeb
@@ -1992,7 +1992,7 @@ struct hdr
#if defined(_LIBC) || defined(STDC_HEADERS) || defined(USG)
#define flood memset
#else
-static void flood __P ((__ptr_t, int, __malloc_size_t));
+static void flood (__ptr_t, int, __malloc_size_t);
static void
flood (ptr, val, size)
__ptr_t ptr;
@@ -2005,7 +2005,7 @@ flood (ptr, val, size)
}
#endif
-static enum mcheck_status checkhdr __P ((const struct hdr *));
+static enum mcheck_status checkhdr (const struct hdr *);
static enum mcheck_status
checkhdr (hdr)
const struct hdr *hdr;
@@ -2031,7 +2031,7 @@ checkhdr (hdr)
return status;
}
-static void freehook __P ((__ptr_t));
+static void freehook (__ptr_t);
static void
freehook (ptr)
__ptr_t ptr;
@@ -2053,7 +2053,7 @@ freehook (ptr)
__free_hook = freehook;
}
-static __ptr_t mallochook __P ((__malloc_size_t));
+static __ptr_t mallochook (__malloc_size_t);
static __ptr_t
mallochook (size)
__malloc_size_t size;
@@ -2073,7 +2073,7 @@ mallochook (size)
return (__ptr_t) (hdr + 1);
}
-static __ptr_t reallochook __P ((__ptr_t, __malloc_size_t));
+static __ptr_t reallochook (__ptr_t, __malloc_size_t);
static __ptr_t
reallochook (ptr, size)
__ptr_t ptr;
@@ -2146,7 +2146,7 @@ static int mcheck_used = 0;
int
mcheck (func)
- void (*func) __P ((enum mcheck_status));
+ void (*func) (enum mcheck_status);
{
abortfunc = (func != NULL) ? func : &mabort;
diff --git a/src/gtkutil.c b/src/gtkutil.c
index c8800817b68..b1bb2e32324 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -47,13 +47,34 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Avoid "differ in sign" warnings */
#define SSDATA(x) ((char *) SDATA (x))
+#ifndef HAVE_GTK_WIDGET_SET_HAS_WINDOW
+#define gtk_widget_set_has_window(w, b) \
+ (gtk_fixed_set_has_window (GTK_FIXED (w), b))
+#endif
+#ifndef HAVE_GTK_DIALOG_GET_ACTION_AREA
+#define gtk_dialog_get_action_area(w) ((w)->action_area)
+#define gtk_dialog_get_content_area(w) ((w)->vbox)
+#endif
+#ifndef HAVE_GTK_WIDGET_GET_SENSITIVE
+#define gtk_widget_get_sensitive(w) (GTK_WIDGET_SENSITIVE (w))
+#endif
+#ifndef HAVE_GTK_ADJUSTMENT_GET_PAGE_SIZE
+#define gtk_adjustment_set_page_size(w, s) ((w)->page_size = (s))
+#define gtk_adjustment_set_page_increment(w, s) ((w)->page_increment = (s))
+#define gtk_adjustment_get_step_increment(w) ((w)->step_increment)
+#define gtk_adjustment_set_step_increment(w, s) ((w)->step_increment = (s))
+#endif
+#if GTK_MAJOR_VERSION > 2 || GTK_MINOR_VERSION > 11
+#define remove_submenu(w) gtk_menu_item_set_submenu ((w), NULL)
+#else
+#define remove_submenu(w) gtk_menu_item_remove_submenu ((w))
+#endif
+
/***********************************************************************
Display handling functions
***********************************************************************/
-#ifdef HAVE_GTK_MULTIDISPLAY
-
/* Keep track of the default display, or NULL if there is none. Emacs
may close all its displays. */
@@ -64,9 +85,7 @@ static GdkDisplay *gdpy_def;
W can be a GtkMenu or a GtkWindow widget. */
static void
-xg_set_screen (w, f)
- GtkWidget *w;
- FRAME_PTR f;
+xg_set_screen (GtkWidget *w, FRAME_PTR f)
{
if (FRAME_X_DISPLAY (f) != GDK_DISPLAY ())
{
@@ -81,20 +100,6 @@ xg_set_screen (w, f)
}
-#else /* not HAVE_GTK_MULTIDISPLAY */
-
-/* Make some defines so we can use the GTK 2.2 functions when
- compiling with GTK 2.0. */
-
-#define xg_set_screen(w, f)
-#define gdk_xid_table_lookup_for_display(dpy, w) gdk_xid_table_lookup (w)
-#define gdk_pixmap_foreign_new_for_display(dpy, p) gdk_pixmap_foreign_new (p)
-#define gdk_cursor_new_for_display(dpy, c) gdk_cursor_new (c)
-#define gdk_x11_lookup_xdisplay(dpy) 0
-#define GdkDisplay void
-
-#endif /* not HAVE_GTK_MULTIDISPLAY */
-
/* Open a display named by DISPLAY_NAME. The display is returned in *DPY.
*DPY is set to NULL if the display can't be opened.
@@ -102,12 +107,9 @@ xg_set_screen (w, f)
be opened, and less than zero if the GTK version doesn't support
multipe displays. */
-int
-xg_display_open (display_name, dpy)
- char *display_name;
- Display **dpy;
+void
+xg_display_open (char *display_name, Display **dpy)
{
-#ifdef HAVE_GTK_MULTIDISPLAY
GdkDisplay *gdpy;
gdpy = gdk_display_open (display_name);
@@ -119,12 +121,6 @@ xg_display_open (display_name, dpy)
}
*dpy = gdpy ? GDK_DISPLAY_XDISPLAY (gdpy) : NULL;
- return gdpy != NULL;
-
-#else /* not HAVE_GTK_MULTIDISPLAY */
-
- return -1;
-#endif /* not HAVE_GTK_MULTIDISPLAY */
}
@@ -133,7 +129,6 @@ xg_display_open (display_name, dpy)
void
xg_display_close (Display *dpy)
{
-#ifdef HAVE_GTK_MULTIDISPLAY
GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (dpy);
/* If this is the default display, try to change it before closing.
@@ -165,7 +160,6 @@ xg_display_close (Display *dpy)
/* This seems to be fixed in GTK 2.10. */
gdk_display_close (gdpy);
#endif
-#endif /* HAVE_GTK_MULTIDISPLAY */
}
@@ -182,7 +176,7 @@ static int malloc_cpt;
Return a pointer to the allocated structure. */
widget_value *
-malloc_widget_value ()
+malloc_widget_value (void)
{
widget_value *wv;
if (widget_value_free_list)
@@ -204,8 +198,7 @@ malloc_widget_value ()
by malloc_widget_value, and no substructures. */
void
-free_widget_value (wv)
- widget_value *wv;
+free_widget_value (widget_value *wv)
{
if (wv->free_list)
abort ();
@@ -229,8 +222,7 @@ free_widget_value (wv)
scroll bars on display DPY. */
GdkCursor *
-xg_create_default_cursor (dpy)
- Display *dpy;
+xg_create_default_cursor (Display *dpy)
{
GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (dpy);
return gdk_cursor_new_for_display (gdpy, GDK_LEFT_PTR);
@@ -239,10 +231,9 @@ xg_create_default_cursor (dpy)
/* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */
static GdkPixbuf *
-xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap)
- GdkPixmap *gpix;
- GdkPixmap *gmask;
- GdkColormap *cmap;
+xg_get_pixbuf_from_pix_and_mask (GdkPixmap *gpix,
+ GdkPixmap *gmask,
+ GdkColormap *cmap)
{
int width, height;
GdkPixbuf *icon_buf, *tmp_buf;
@@ -293,8 +284,7 @@ xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap)
}
static Lisp_Object
-file_for_image (image)
- Lisp_Object image;
+file_for_image (Lisp_Object image)
{
Lisp_Object specified_file = Qnil;
Lisp_Object tail;
@@ -321,11 +311,10 @@ file_for_image (image)
If OLD_WIDGET is not NULL, that widget is modified. */
static GtkWidget *
-xg_get_image_for_pixmap (f, img, widget, old_widget)
- FRAME_PTR f;
- struct image *img;
- GtkWidget *widget;
- GtkImage *old_widget;
+xg_get_image_for_pixmap (FRAME_PTR f,
+ struct image *img,
+ GtkWidget *widget,
+ GtkImage *old_widget)
{
GdkPixmap *gpix;
GdkPixmap *gmask;
@@ -393,13 +382,12 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
and it is those widgets that are visible. */
static void
-xg_set_cursor (w, cursor)
- GtkWidget *w;
- GdkCursor *cursor;
+xg_set_cursor (GtkWidget *w, GdkCursor *cursor)
{
- GList *children = gdk_window_peek_children (w->window);
+ GdkWindow *window = gtk_widget_get_window(w);
+ GList *children = gdk_window_peek_children (window);
- gdk_window_set_cursor (w->window, cursor);
+ gdk_window_set_cursor (window, cursor);
/* The scroll bar widget has more than one GDK window (had to look at
the source to figure this out), and there is no way to set cursor
@@ -447,8 +435,7 @@ xg_list_remove (xg_list_node *list, xg_list_node *node)
with g_free. */
static char *
-get_utf8_string (str)
- char *str;
+get_utf8_string (char *str)
{
char *utf8_str = str;
@@ -527,8 +514,7 @@ get_utf8_string (str)
F is the frame we shall set geometry for. */
static void
-xg_set_geometry (f)
- FRAME_PTR f;
+xg_set_geometry (FRAME_PTR f)
{
if (f->size_hint_flags & (USPosition | PPosition))
{
@@ -559,8 +545,7 @@ xg_set_geometry (f)
and use a GtkFixed widget, this doesn't happen automatically. */
static void
-xg_clear_under_internal_border (f)
- FRAME_PTR f;
+xg_clear_under_internal_border (FRAME_PTR f)
{
if (FRAME_INTERNAL_BORDER_WIDTH (f) > 0)
{
@@ -598,16 +583,15 @@ xg_clear_under_internal_border (f)
PIXELWIDTH, PIXELHEIGHT is the new size in pixels. */
void
-xg_frame_resized (f, pixelwidth, pixelheight)
- FRAME_PTR f;
- int pixelwidth, pixelheight;
+xg_frame_resized (FRAME_PTR f, int pixelwidth, int pixelheight)
{
int rows, columns;
if (pixelwidth == -1 && pixelheight == -1)
{
- if (FRAME_GTK_WIDGET (f) && GTK_WIDGET_MAPPED (FRAME_GTK_WIDGET (f)))
- gdk_window_get_geometry (FRAME_GTK_WIDGET (f)->window, 0, 0,
+ if (FRAME_GTK_WIDGET (f) && gtk_widget_get_mapped (FRAME_GTK_WIDGET (f)))
+ gdk_window_get_geometry (gtk_widget_get_window (FRAME_GTK_WIDGET (f)),
+ 0, 0,
&pixelwidth, &pixelheight, 0);
else return;
}
@@ -635,10 +619,7 @@ xg_frame_resized (f, pixelwidth, pixelheight)
COLUMNS/ROWS is the size the edit area shall have after the resize. */
void
-xg_frame_set_char_size (f, cols, rows)
- FRAME_PTR f;
- int cols;
- int rows;
+xg_frame_set_char_size (FRAME_PTR f, int cols, int rows)
{
int pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows)
+ FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
@@ -700,8 +681,7 @@ xg_frame_set_char_size (f, cols, rows)
The policy is to keep the number of editable lines. */
static void
-xg_height_changed (f)
- FRAME_PTR f;
+xg_height_changed (FRAME_PTR f)
{
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
FRAME_PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f));
@@ -716,9 +696,7 @@ xg_height_changed (f)
Return 0 if no widget match WDESC. */
GtkWidget *
-xg_win_to_widget (dpy, wdesc)
- Display *dpy;
- Window wdesc;
+xg_win_to_widget (Display *dpy, Window wdesc)
{
gpointer gdkwin;
GtkWidget *gwdesc = 0;
@@ -742,10 +720,7 @@ xg_win_to_widget (dpy, wdesc)
W is the widget that color will be used for. Used to find colormap. */
static void
-xg_pix_to_gcolor (w, pixel, c)
- GtkWidget *w;
- unsigned long pixel;
- GdkColor *c;
+xg_pix_to_gcolor (GtkWidget *w, long unsigned int pixel, GdkColor *c)
{
GdkColormap *map = gtk_widget_get_colormap (w);
gdk_colormap_query_color (map, pixel, c);
@@ -755,8 +730,7 @@ xg_pix_to_gcolor (w, pixel, c)
Return 0 if creation failed, non-zero otherwise. */
int
-xg_create_frame_widgets (f)
- FRAME_PTR f;
+xg_create_frame_widgets (FRAME_PTR f)
{
GtkWidget *wtop;
GtkWidget *wvbox;
@@ -802,7 +776,7 @@ xg_create_frame_widgets (f)
FRAME_GTK_WIDGET (f) = wfixed;
f->output_data.x->vbox_widget = wvbox;
- gtk_fixed_set_has_window (GTK_FIXED (wfixed), TRUE);
+ gtk_widget_set_has_window (wfixed, TRUE);
gtk_container_add (GTK_CONTAINER (wtop), wvbox);
gtk_box_pack_end (GTK_BOX (wvbox), wfixed, TRUE, TRUE, 0);
@@ -882,10 +856,7 @@ xg_create_frame_widgets (f)
flag (this is useful when FLAGS is 0). */
void
-x_wm_set_size_hint (f, flags, user_position)
- FRAME_PTR f;
- long flags;
- int user_position;
+x_wm_set_size_hint (FRAME_PTR f, long int flags, int user_position)
{
/* Must use GTK routines here, otherwise GTK resets the size hints
to its own defaults. */
@@ -981,9 +952,7 @@ x_wm_set_size_hint (f, flags, user_position)
BG is the pixel value to change to. */
void
-xg_set_background_color (f, bg)
- FRAME_PTR f;
- unsigned long bg;
+xg_set_background_color (FRAME_PTR f, long unsigned int bg)
{
if (FRAME_GTK_WIDGET (f))
{
@@ -1001,10 +970,7 @@ xg_set_background_color (f, bg)
functions so GTK does not overwrite the icon. */
void
-xg_set_frame_icon (f, icon_pixmap, icon_mask)
- FRAME_PTR f;
- Pixmap icon_pixmap;
- Pixmap icon_mask;
+xg_set_frame_icon (FRAME_PTR f, Pixmap icon_pixmap, Pixmap icon_mask)
{
GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
GdkPixmap *gpix = gdk_pixmap_foreign_new_for_display (gdpy, icon_pixmap);
@@ -1064,10 +1030,7 @@ get_dialog_title (char key)
Returns TRUE to end propagation of event. */
static gboolean
-dialog_delete_callback (w, event, user_data)
- GtkWidget *w;
- GdkEvent *event;
- gpointer user_data;
+dialog_delete_callback (GtkWidget *w, GdkEvent *event, gpointer user_data)
{
gtk_widget_unmap (w);
return TRUE;
@@ -1081,10 +1044,9 @@ dialog_delete_callback (w, event, user_data)
Returns the GTK dialog widget. */
static GtkWidget *
-create_dialog (wv, select_cb, deactivate_cb)
- widget_value *wv;
- GCallback select_cb;
- GCallback deactivate_cb;
+create_dialog (widget_value *wv,
+ GCallback select_cb,
+ GCallback deactivate_cb)
{
char *title = get_dialog_title (wv->name[0]);
int total_buttons = wv->name[1] - '0';
@@ -1093,8 +1055,9 @@ create_dialog (wv, select_cb, deactivate_cb)
int button_nr = 0;
int button_spacing = 10;
GtkWidget *wdialog = gtk_dialog_new ();
+ GtkDialog *wd = GTK_DIALOG (wdialog);
+ GtkBox *cur_box = GTK_BOX (gtk_dialog_get_action_area (wd));
widget_value *item;
- GtkBox *cur_box;
GtkWidget *wvbox;
GtkWidget *whbox_up;
GtkWidget *whbox_down;
@@ -1109,7 +1072,6 @@ create_dialog (wv, select_cb, deactivate_cb)
gtk_window_set_title (GTK_WINDOW (wdialog), title);
gtk_widget_set_name (wdialog, "emacs-dialog");
- cur_box = GTK_BOX (GTK_DIALOG (wdialog)->action_area);
if (make_two_rows)
{
@@ -1141,21 +1103,18 @@ create_dialog (wv, select_cb, deactivate_cb)
if (item->name && strcmp (item->name, "message") == 0)
{
+ GtkBox *wvbox = GTK_BOX (gtk_dialog_get_content_area (wd));
/* This is the text part of the dialog. */
w = gtk_label_new (utf8_label);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (wdialog)->vbox),
- gtk_label_new (""),
- FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (wdialog)->vbox), w,
- TRUE, TRUE, 0);
+ gtk_box_pack_start (wvbox, gtk_label_new (""), FALSE, FALSE, 0);
+ gtk_box_pack_start (wvbox, w, TRUE, TRUE, 0);
gtk_misc_set_alignment (GTK_MISC (w), 0.1, 0.5);
/* Try to make dialog look better. Must realize first so
the widget can calculate the size it needs. */
gtk_widget_realize (w);
gtk_widget_size_request (w, &req);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (wdialog)->vbox),
- req.height);
+ gtk_box_set_spacing (wvbox, req.height);
if (item->value && strlen (item->value) > 0)
button_spacing = 2*req.width/strlen (item->value);
}
@@ -1202,12 +1161,9 @@ struct xg_dialog_data
USER_DATA is what we passed in to g_signal_connect. */
static void
-xg_dialog_response_cb (w,
- response,
- user_data)
- GtkDialog *w;
- gint response;
- gpointer user_data;
+xg_dialog_response_cb (GtkDialog *w,
+ gint response,
+ gpointer user_data)
{
struct xg_dialog_data *dd = (struct xg_dialog_data *)user_data;
dd->response = response;
@@ -1218,8 +1174,7 @@ xg_dialog_response_cb (w,
/* Destroy the dialog. This makes it pop down. */
static Lisp_Object
-pop_down_dialog (arg)
- Lisp_Object arg;
+pop_down_dialog (Lisp_Object arg)
{
struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
struct xg_dialog_data *dd = (struct xg_dialog_data *) p->pointer;
@@ -1240,8 +1195,7 @@ pop_down_dialog (arg)
We pass in DATA as gpointer* so we can use this as a callback. */
static gboolean
-xg_maybe_add_timer (data)
- gpointer data;
+xg_maybe_add_timer (gpointer data)
{
struct xg_dialog_data *dd = (struct xg_dialog_data *) data;
EMACS_TIME next_time = timer_check (1);
@@ -1265,10 +1219,7 @@ xg_maybe_add_timer (data)
The dialog W is not destroyed when this function returns. */
static int
-xg_dialog_run (f, w)
- FRAME_PTR f;
- GtkWidget *w;
-
+xg_dialog_run (FRAME_PTR f, GtkWidget *w)
{
int count = SPECPDL_INDEX ();
struct xg_dialog_data dd;
@@ -1311,33 +1262,24 @@ xg_dialog_run (f, w)
Return zero if not. */
int
-xg_uses_old_file_dialog ()
+xg_uses_old_file_dialog (void)
{
-#ifdef HAVE_GTK_FILE_BOTH
+#ifdef HAVE_GTK_FILE_SELECTION_NEW
extern int x_gtk_use_old_file_dialog;
return x_gtk_use_old_file_dialog;
-#else /* ! HAVE_GTK_FILE_BOTH */
-
-#ifdef HAVE_GTK_FILE_SELECTION_NEW
- return 1;
#else
return 0;
#endif
-
-#endif /* ! HAVE_GTK_FILE_BOTH */
}
-typedef char * (*xg_get_file_func) P_ ((GtkWidget *));
-
-#ifdef HAVE_GTK_FILE_CHOOSER_DIALOG_NEW
+typedef char * (*xg_get_file_func) (GtkWidget *);
/* Return the selected file for file chooser dialog W.
The returned string must be free:d. */
static char *
-xg_get_file_name_from_chooser (w)
- GtkWidget *w;
+xg_get_file_name_from_chooser (GtkWidget *w)
{
return gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (w));
}
@@ -1346,9 +1288,7 @@ xg_get_file_name_from_chooser (w)
WIDGET is the toggle widget, DATA is the file chooser dialog. */
static void
-xg_toggle_visibility_cb (widget, data)
- GtkWidget *widget;
- gpointer data;
+xg_toggle_visibility_cb (GtkWidget *widget, gpointer data)
{
GtkFileChooser *dialog = GTK_FILE_CHOOSER (data);
gboolean visible;
@@ -1364,10 +1304,7 @@ xg_toggle_visibility_cb (widget, data)
changes that property by right clicking in the file list. */
static void
-xg_toggle_notify_cb (gobject, arg1, user_data)
- GObject *gobject;
- GParamSpec *arg1;
- gpointer user_data;
+xg_toggle_notify_cb (GObject *gobject, GParamSpec *arg1, gpointer user_data)
{
extern int x_gtk_show_hidden_files;
@@ -1405,13 +1342,11 @@ xg_toggle_notify_cb (gobject, arg1, user_data)
Returns the created widget. */
static GtkWidget *
-xg_get_file_with_chooser (f, prompt, default_filename,
- mustmatch_p, only_dir_p, func)
- FRAME_PTR f;
- char *prompt;
- char *default_filename;
- int mustmatch_p, only_dir_p;
- xg_get_file_func *func;
+xg_get_file_with_chooser (FRAME_PTR f,
+ char *prompt,
+ char *default_filename,
+ int mustmatch_p, int only_dir_p,
+ xg_get_file_func *func)
{
char message[1024];
@@ -1507,7 +1442,6 @@ xg_get_file_with_chooser (f, prompt, default_filename,
*func = xg_get_file_name_from_chooser;
return filewin;
}
-#endif /* HAVE_GTK_FILE_CHOOSER_DIALOG_NEW */
#ifdef HAVE_GTK_FILE_SELECTION_NEW
@@ -1515,8 +1449,7 @@ xg_get_file_with_chooser (f, prompt, default_filename,
The returned string must be free:d. */
static char *
-xg_get_file_name_from_selector (w)
- GtkWidget *w;
+xg_get_file_name_from_selector (GtkWidget *w)
{
GtkFileSelection *filesel = GTK_FILE_SELECTION (w);
return xstrdup ((char*) gtk_file_selection_get_filename (filesel));
@@ -1533,13 +1466,11 @@ xg_get_file_name_from_selector (w)
Returns the created widget. */
static GtkWidget *
-xg_get_file_with_selection (f, prompt, default_filename,
- mustmatch_p, only_dir_p, func)
- FRAME_PTR f;
- char *prompt;
- char *default_filename;
- int mustmatch_p, only_dir_p;
- xg_get_file_func *func;
+xg_get_file_with_selection (FRAME_PTR f,
+ char *prompt,
+ char *default_filename,
+ int mustmatch_p, int only_dir_p,
+ xg_get_file_func *func)
{
GtkWidget *filewin;
GtkFileSelection *filesel;
@@ -1577,11 +1508,11 @@ xg_get_file_with_selection (f, prompt, default_filename,
The returned string must be freed by the caller. */
char *
-xg_get_file_name (f, prompt, default_filename, mustmatch_p, only_dir_p)
- FRAME_PTR f;
- char *prompt;
- char *default_filename;
- int mustmatch_p, only_dir_p;
+xg_get_file_name (FRAME_PTR f,
+ char *prompt,
+ char *default_filename,
+ int mustmatch_p,
+ int only_dir_p)
{
GtkWidget *w = 0;
char *fn = 0;
@@ -1595,7 +1526,7 @@ xg_get_file_name (f, prompt, default_filename, mustmatch_p, only_dir_p)
sigblock (sigmask (__SIGRTMIN));
#endif /* HAVE_GTK_AND_PTHREAD */
-#ifdef HAVE_GTK_FILE_BOTH
+#ifdef HAVE_GTK_FILE_SELECTION_NEW
if (xg_uses_old_file_dialog ())
w = xg_get_file_with_selection (f, prompt, default_filename,
@@ -1604,18 +1535,10 @@ xg_get_file_name (f, prompt, default_filename, mustmatch_p, only_dir_p)
w = xg_get_file_with_chooser (f, prompt, default_filename,
mustmatch_p, only_dir_p, &func);
-#else /* not HAVE_GTK_FILE_BOTH */
-
-#ifdef HAVE_GTK_FILE_SELECTION_NEW
- w = xg_get_file_with_selection (f, prompt, default_filename,
- mustmatch_p, only_dir_p, &func);
-#endif
-#ifdef HAVE_GTK_FILE_CHOOSER_DIALOG_NEW
+#else /* not HAVE_GTK_FILE_SELECTION_NEW */
w = xg_get_file_with_chooser (f, prompt, default_filename,
mustmatch_p, only_dir_p, &func);
-#endif
-
-#endif /* HAVE_GTK_FILE_BOTH */
+#endif /* not HAVE_GTK_FILE_SELECTION_NEW */
gtk_widget_set_name (w, "emacs-filedialog");
@@ -1643,9 +1566,7 @@ xg_get_file_name (f, prompt, default_filename, mustmatch_p, only_dir_p)
DEFAULT_NAME, if non-zero, is the default font name. */
char *
-xg_get_font_name (f, default_name)
- FRAME_PTR f;
- char *default_name;
+xg_get_font_name (FRAME_PTR f, char *default_name)
{
GtkWidget *w;
char *fontname = NULL;
@@ -1710,10 +1631,7 @@ static xg_list_node xg_menu_item_cb_list;
allocated xg_menu_cb_data if CL_DATA is NULL. */
static xg_menu_cb_data *
-make_cl_data (cl_data, f, highlight_cb)
- xg_menu_cb_data *cl_data;
- FRAME_PTR f;
- GCallback highlight_cb;
+make_cl_data (xg_menu_cb_data *cl_data, FRAME_PTR f, GCallback highlight_cb)
{
if (! cl_data)
{
@@ -1744,10 +1662,9 @@ make_cl_data (cl_data, f, highlight_cb)
creating the menu bar. */
static void
-update_cl_data (cl_data, f, highlight_cb)
- xg_menu_cb_data *cl_data;
- FRAME_PTR f;
- GCallback highlight_cb;
+update_cl_data (xg_menu_cb_data *cl_data,
+ FRAME_PTR f,
+ GCallback highlight_cb)
{
if (cl_data)
{
@@ -1762,8 +1679,7 @@ update_cl_data (cl_data, f, highlight_cb)
If reference count is zero, free CL_DATA. */
static void
-unref_cl_data (cl_data)
- xg_menu_cb_data *cl_data;
+unref_cl_data (xg_menu_cb_data *cl_data)
{
if (cl_data && cl_data->ref_count > 0)
{
@@ -1779,7 +1695,7 @@ unref_cl_data (cl_data)
/* Function that marks all lisp data during GC. */
void
-xg_mark_data ()
+xg_mark_data (void)
{
xg_list_node *iter;
@@ -1801,9 +1717,7 @@ xg_mark_data ()
CLIENT_DATA points to the xg_menu_item_cb_data associated with the W. */
static void
-menuitem_destroy_callback (w, client_data)
- GtkWidget *w;
- gpointer client_data;
+menuitem_destroy_callback (GtkWidget *w, gpointer client_data)
{
if (client_data)
{
@@ -1821,10 +1735,9 @@ menuitem_destroy_callback (w, client_data)
Returns FALSE to tell GTK to keep processing this event. */
static gboolean
-menuitem_highlight_callback (w, event, client_data)
- GtkWidget *w;
- GdkEventCrossing *event;
- gpointer client_data;
+menuitem_highlight_callback (GtkWidget *w,
+ GdkEventCrossing *event,
+ gpointer client_data)
{
GdkEvent ev;
GtkWidget *subwidget;
@@ -1852,9 +1765,7 @@ menuitem_highlight_callback (w, event, client_data)
CLIENT_DATA points to the xg_menu_cb_data associated with W. */
static void
-menu_destroy_callback (w, client_data)
- GtkWidget *w;
- gpointer client_data;
+menu_destroy_callback (GtkWidget *w, gpointer client_data)
{
unref_cl_data ((xg_menu_cb_data*) client_data);
}
@@ -1865,9 +1776,7 @@ menu_destroy_callback (w, client_data)
Returns the GtkHBox. */
static GtkWidget *
-make_widget_for_menu_item (utf8_label, utf8_key)
- char *utf8_label;
- char *utf8_key;
+make_widget_for_menu_item (char *utf8_label, char *utf8_key)
{
GtkWidget *wlbl;
GtkWidget *wkey;
@@ -1905,11 +1814,10 @@ make_widget_for_menu_item (utf8_label, utf8_key)
but the MacOS X version doesn't either, so I guess that is OK. */
static GtkWidget *
-make_menu_item (utf8_label, utf8_key, item, group)
- char *utf8_label;
- char *utf8_key;
- widget_value *item;
- GSList **group;
+make_menu_item (char *utf8_label,
+ char *utf8_key,
+ widget_value *item,
+ GSList **group)
{
GtkWidget *w;
GtkWidget *wtoadd = 0;
@@ -2004,7 +1912,7 @@ static int xg_detached_menus;
/* Returns non-zero if there are detached menus. */
int
-xg_have_tear_offs ()
+xg_have_tear_offs (void)
{
return xg_detached_menus > 0;
}
@@ -2015,9 +1923,7 @@ xg_have_tear_offs ()
CLIENT_DATA is not used. */
static void
-tearoff_remove (widget, client_data)
- GtkWidget *widget;
- gpointer client_data;
+tearoff_remove (GtkWidget *widget, gpointer client_data)
{
if (xg_detached_menus > 0) --xg_detached_menus;
}
@@ -2028,9 +1934,7 @@ tearoff_remove (widget, client_data)
CLIENT_DATA is not used. */
static void
-tearoff_activate (widget, client_data)
- GtkWidget *widget;
- gpointer client_data;
+tearoff_activate (GtkWidget *widget, gpointer client_data)
{
GtkWidget *menu = gtk_widget_get_parent (widget);
if (gtk_menu_get_tearoff_state (GTK_MENU (menu)))
@@ -2058,13 +1962,12 @@ tearoff_activate (widget, client_data)
Returns the created GtkWidget. */
static GtkWidget *
-xg_create_one_menuitem (item, f, select_cb, highlight_cb, cl_data, group)
- widget_value *item;
- FRAME_PTR f;
- GCallback select_cb;
- GCallback highlight_cb;
- xg_menu_cb_data *cl_data;
- GSList **group;
+xg_create_one_menuitem (widget_value *item,
+ FRAME_PTR f,
+ GCallback select_cb,
+ GCallback highlight_cb,
+ xg_menu_cb_data *cl_data,
+ GSList **group)
{
char *utf8_label;
char *utf8_key;
@@ -2107,10 +2010,6 @@ xg_create_one_menuitem (item, f, select_cb, highlight_cb, cl_data, group)
return w;
}
-static GtkWidget *create_menus P_ ((widget_value *, FRAME_PTR, GCallback,
- GCallback, GCallback, int, int, int,
- GtkWidget *, xg_menu_cb_data *, char *));
-
/* Create a full menu tree specified by DATA.
F is the frame the created menu belongs to.
SELECT_CB is the callback to use when a menu item is selected.
@@ -2134,19 +2033,17 @@ static GtkWidget *create_menus P_ ((widget_value *, FRAME_PTR, GCallback,
This function calls itself to create submenus. */
static GtkWidget *
-create_menus (data, f, select_cb, deactivate_cb, highlight_cb,
- pop_up_p, menu_bar_p, add_tearoff_p, topmenu, cl_data, name)
- widget_value *data;
- FRAME_PTR f;
- GCallback select_cb;
- GCallback deactivate_cb;
- GCallback highlight_cb;
- int pop_up_p;
- int menu_bar_p;
- int add_tearoff_p;
- GtkWidget *topmenu;
- xg_menu_cb_data *cl_data;
- char *name;
+create_menus (widget_value *data,
+ FRAME_PTR f,
+ GCallback select_cb,
+ GCallback deactivate_cb,
+ GCallback highlight_cb,
+ int pop_up_p,
+ int menu_bar_p,
+ int add_tearoff_p,
+ GtkWidget *topmenu,
+ xg_menu_cb_data *cl_data,
+ char *name)
{
widget_value *item;
GtkWidget *wmenu = topmenu;
@@ -2278,15 +2175,9 @@ create_menus (data, f, select_cb, deactivate_cb, highlight_cb,
Returns the widget created. */
GtkWidget *
-xg_create_widget (type, name, f, val,
- select_cb, deactivate_cb, highlight_cb)
- char *type;
- char *name;
- FRAME_PTR f;
- widget_value *val;
- GCallback select_cb;
- GCallback deactivate_cb;
- GCallback highlight_cb;
+xg_create_widget (char *type, char *name, FRAME_PTR f, widget_value *val,
+ GCallback select_cb, GCallback deactivate_cb,
+ GCallback highlight_cb)
{
GtkWidget *w = 0;
int menu_bar_p = strcmp (type, "menubar") == 0;
@@ -2337,8 +2228,7 @@ xg_create_widget (type, name, f, val,
/* Return the label for menu item WITEM. */
static const char *
-xg_get_menu_item_label (witem)
- GtkMenuItem *witem;
+xg_get_menu_item_label (GtkMenuItem *witem)
{
GtkLabel *wlabel = GTK_LABEL (gtk_bin_get_child (GTK_BIN (witem)));
return gtk_label_get_label (wlabel);
@@ -2347,9 +2237,7 @@ xg_get_menu_item_label (witem)
/* Return non-zero if the menu item WITEM has the text LABEL. */
static int
-xg_item_label_same_p (witem, label)
- GtkMenuItem *witem;
- char *label;
+xg_item_label_same_p (GtkMenuItem *witem, char *label)
{
int is_same = 0;
char *utf8_label = get_utf8_string (label);
@@ -2368,8 +2256,7 @@ xg_item_label_same_p (witem, label)
/* Destroy widgets in LIST. */
static void
-xg_destroy_widgets (list)
- GList *list;
+xg_destroy_widgets (GList *list)
{
GList *iter;
@@ -2395,18 +2282,16 @@ xg_destroy_widgets (list)
This function calls itself to walk through the menu bar names. */
static void
-xg_update_menubar (menubar, f, list, iter, pos, val,
- select_cb, deactivate_cb, highlight_cb, cl_data)
- GtkWidget *menubar;
- FRAME_PTR f;
- GList **list;
- GList *iter;
- int pos;
- widget_value *val;
- GCallback select_cb;
- GCallback deactivate_cb;
- GCallback highlight_cb;
- xg_menu_cb_data *cl_data;
+xg_update_menubar (GtkWidget *menubar,
+ FRAME_PTR f,
+ GList **list,
+ GList *iter,
+ int pos,
+ widget_value *val,
+ GCallback select_cb,
+ GCallback deactivate_cb,
+ GCallback highlight_cb,
+ xg_menu_cb_data *cl_data)
{
if (! iter && ! val)
return;
@@ -2473,7 +2358,7 @@ xg_update_menubar (menubar, f, list, iter, pos, val,
New: A C
Remove B. */
- gtk_widget_ref (GTK_WIDGET (witem));
+ g_object_ref (G_OBJECT (witem));
gtk_container_remove (GTK_CONTAINER (menubar), GTK_WIDGET (witem));
gtk_widget_destroy (GTK_WIDGET (witem));
@@ -2522,7 +2407,7 @@ xg_update_menubar (menubar, f, list, iter, pos, val,
Insert X. */
int nr = pos;
- GList *group = 0;
+ GSList *group = 0;
GtkWidget *w = xg_create_one_menuitem (val,
f,
select_cb,
@@ -2555,11 +2440,11 @@ xg_update_menubar (menubar, f, list, iter, pos, val,
New: A C B
Move C before B */
- gtk_widget_ref (GTK_WIDGET (witem2));
+ g_object_ref (G_OBJECT (witem2));
gtk_container_remove (GTK_CONTAINER (menubar), GTK_WIDGET (witem2));
gtk_menu_shell_insert (GTK_MENU_SHELL (menubar),
GTK_WIDGET (witem2), pos);
- gtk_widget_unref (GTK_WIDGET (witem2));
+ g_object_unref (G_OBJECT (witem2));
g_list_free (*list);
*list = iter = gtk_container_get_children (GTK_CONTAINER (menubar));
@@ -2581,12 +2466,11 @@ xg_update_menubar (menubar, f, list, iter, pos, val,
CL_DATA is the data to set in the widget for menu invocation. */
static void
-xg_update_menu_item (val, w, select_cb, highlight_cb, cl_data)
- widget_value *val;
- GtkWidget *w;
- GCallback select_cb;
- GCallback highlight_cb;
- xg_menu_cb_data *cl_data;
+xg_update_menu_item (widget_value *val,
+ GtkWidget *w,
+ GCallback select_cb,
+ GCallback highlight_cb,
+ xg_menu_cb_data *cl_data)
{
GtkWidget *wchild;
GtkLabel *wlbl = 0;
@@ -2613,9 +2497,10 @@ xg_update_menu_item (val, w, select_cb, highlight_cb, cl_data)
if (! utf8_key)
{
/* Remove the key and keep just the label. */
- gtk_widget_ref (GTK_WIDGET (wlbl));
+ g_object_ref (G_OBJECT (wlbl));
gtk_container_remove (GTK_CONTAINER (w), wchild);
gtk_container_add (GTK_CONTAINER (w), GTK_WIDGET (wlbl));
+ g_object_unref (G_OBJECT (wlbl));
wkey = 0;
}
@@ -2652,9 +2537,9 @@ xg_update_menu_item (val, w, select_cb, highlight_cb, cl_data)
if (utf8_key && utf8_key != val->key) g_free (utf8_key);
if (utf8_label && utf8_label != val->name) g_free (utf8_label);
- if (! val->enabled && GTK_WIDGET_SENSITIVE (w))
+ if (! val->enabled && gtk_widget_get_sensitive (w))
gtk_widget_set_sensitive (w, FALSE);
- else if (val->enabled && ! GTK_WIDGET_SENSITIVE (w))
+ else if (val->enabled && ! gtk_widget_get_sensitive (w))
gtk_widget_set_sensitive (w, TRUE);
cb_data = (xg_menu_item_cb_data*) g_object_get_data (G_OBJECT (w),
@@ -2685,9 +2570,7 @@ xg_update_menu_item (val, w, select_cb, highlight_cb, cl_data)
/* Update the toggle menu item W so it corresponds to VAL. */
static void
-xg_update_toggle_item (val, w)
- widget_value *val;
- GtkWidget *w;
+xg_update_toggle_item (widget_value *val, GtkWidget *w)
{
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (w), val->selected);
}
@@ -2695,9 +2578,7 @@ xg_update_toggle_item (val, w)
/* Update the radio menu item W so it corresponds to VAL. */
static void
-xg_update_radio_item (val, w)
- widget_value *val;
- GtkWidget *w;
+xg_update_radio_item (widget_value *val, GtkWidget *w)
{
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (w), val->selected);
}
@@ -2715,15 +2596,13 @@ xg_update_radio_item (val, w)
was NULL. */
static GtkWidget *
-xg_update_submenu (submenu, f, val,
- select_cb, deactivate_cb, highlight_cb, cl_data)
- GtkWidget *submenu;
- FRAME_PTR f;
- widget_value *val;
- GCallback select_cb;
- GCallback deactivate_cb;
- GCallback highlight_cb;
- xg_menu_cb_data *cl_data;
+xg_update_submenu (GtkWidget *submenu,
+ FRAME_PTR f,
+ widget_value *val,
+ GCallback select_cb,
+ GCallback deactivate_cb,
+ GCallback highlight_cb,
+ xg_menu_cb_data *cl_data)
{
GtkWidget *newsub = submenu;
GList *list = 0;
@@ -2793,8 +2672,8 @@ xg_update_submenu (submenu, f, val,
if (sub && ! cur->contents)
{
/* Not a submenu anymore. */
- gtk_widget_ref (sub);
- gtk_menu_item_remove_submenu (witem);
+ g_object_ref (G_OBJECT (sub));
+ remove_submenu (witem);
gtk_widget_destroy (sub);
}
else if (cur->contents)
@@ -2858,15 +2737,10 @@ xg_update_submenu (submenu, f, val,
HIGHLIGHT_CB is the callback to call when entering/leaving menu items. */
void
-xg_modify_menubar_widgets (menubar, f, val, deep_p,
- select_cb, deactivate_cb, highlight_cb)
- GtkWidget *menubar;
- FRAME_PTR f;
- widget_value *val;
- int deep_p;
- GCallback select_cb;
- GCallback deactivate_cb;
- GCallback highlight_cb;
+xg_modify_menubar_widgets (GtkWidget *menubar, FRAME_PTR f, widget_value *val,
+ int deep_p,
+ GCallback select_cb, GCallback deactivate_cb,
+ GCallback highlight_cb)
{
xg_menu_cb_data *cl_data;
GList *list = gtk_container_get_children (GTK_CONTAINER (menubar));
@@ -2895,7 +2769,7 @@ xg_modify_menubar_widgets (menubar, f, val, deep_p,
GList *iter;
GtkWidget *sub = 0;
GtkWidget *newsub;
- GtkMenuItem *witem;
+ GtkMenuItem *witem = 0;
/* Find sub menu that corresponds to val and update it. */
for (iter = list ; iter; iter = g_list_next (iter))
@@ -2918,7 +2792,7 @@ xg_modify_menubar_widgets (menubar, f, val, deep_p,
/* sub may still be NULL. If we just updated non deep and added
a new menu bar item, it has no sub menu yet. So we set the
newly created sub menu under witem. */
- if (newsub != sub)
+ if (newsub != sub && witem != 0)
{
xg_set_screen (newsub, f);
gtk_menu_item_set_submenu (witem, newsub);
@@ -2934,13 +2808,12 @@ xg_modify_menubar_widgets (menubar, f, val, deep_p,
changed. Value is non-zero if widgets were updated. */
int
-xg_update_frame_menubar (f)
- FRAME_PTR f;
+xg_update_frame_menubar (FRAME_PTR f)
{
struct x_output *x = f->output_data.x;
GtkRequisition req;
- if (!x->menubar_widget || GTK_WIDGET_MAPPED (x->menubar_widget))
+ if (!x->menubar_widget || gtk_widget_get_mapped (x->menubar_widget))
return 0;
if (x->menubar_widget && gtk_widget_get_parent (x->menubar_widget))
@@ -2965,8 +2838,7 @@ xg_update_frame_menubar (f)
This is used when deleting a frame, and when turning off the menu bar. */
void
-free_frame_menubar (f)
- FRAME_PTR f;
+free_frame_menubar (FRAME_PTR f)
{
struct x_output *x = f->output_data.x;
@@ -2984,6 +2856,55 @@ free_frame_menubar (f)
}
}
+int
+xg_event_is_for_menubar (FRAME_PTR f, XEvent *event)
+{
+ struct x_output *x = f->output_data.x;
+ GList *iter;
+ GdkRectangle rec;
+ GList *list;
+ GdkDisplay *gdpy;
+ GdkWindow *gw;
+ GdkEvent gevent;
+ GtkWidget *gwdesc;
+
+ if (! x->menubar_widget) return 0;
+
+ if (! (event->xbutton.x >= 0
+ && event->xbutton.x < FRAME_PIXEL_WIDTH (f)
+ && event->xbutton.y >= 0
+ && event->xbutton.y < f->output_data.x->menubar_height
+ && event->xbutton.same_screen))
+ return 0;
+
+ gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
+ gw = gdk_xid_table_lookup_for_display (gdpy, event->xbutton.window);
+ if (! gw) return 0;
+ gevent.any.window = gw;
+ gwdesc = gtk_get_event_widget (&gevent);
+ if (! gwdesc) return 0;
+ if (! GTK_IS_MENU_BAR (gwdesc)
+ && ! GTK_IS_MENU_ITEM (gwdesc)
+ && ! gtk_widget_is_ancestor (x->menubar_widget, gwdesc))
+ return 0;
+
+ list = gtk_container_get_children (GTK_CONTAINER (x->menubar_widget));
+ if (! list) return 0;
+ rec.x = event->xbutton.x;
+ rec.y = event->xbutton.y;
+ rec.width = 1;
+ rec.height = 1;
+
+ for (iter = list ; iter; iter = g_list_next (iter))
+ {
+ GtkWidget *w = GTK_WIDGET (iter->data);
+ if (gtk_widget_get_mapped (w) && gtk_widget_intersect (w, &rec, NULL))
+ break;
+ }
+ g_list_free (list);
+ return iter == 0 ? 0 : 1;
+}
+
/***********************************************************************
@@ -3014,8 +2935,7 @@ static struct
/* Store the widget pointer W in id_to_widget and return the integer index. */
static int
-xg_store_widget_in_map (w)
- GtkWidget *w;
+xg_store_widget_in_map (GtkWidget *w)
{
int i;
@@ -3053,8 +2973,7 @@ xg_store_widget_in_map (w)
Called when scroll bar is destroyed. */
static void
-xg_remove_widget_from_map (idx)
- int idx;
+xg_remove_widget_from_map (int idx)
{
if (idx < id_to_widget.max_size && id_to_widget.widgets[idx] != 0)
{
@@ -3066,8 +2985,7 @@ xg_remove_widget_from_map (idx)
/* Get the widget pointer at IDX from id_to_widget. */
static GtkWidget *
-xg_get_widget_from_map (idx)
- int idx;
+xg_get_widget_from_map (int idx)
{
if (idx < id_to_widget.max_size && id_to_widget.widgets[idx] != 0)
return id_to_widget.widgets[idx];
@@ -3079,9 +2997,7 @@ xg_get_widget_from_map (idx)
Return -1 if WID not in id_to_widget. */
int
-xg_get_scroll_id_for_window (dpy, wid)
- Display *dpy;
- Window wid;
+xg_get_scroll_id_for_window (Display *dpy, Window wid)
{
int idx;
GtkWidget *w;
@@ -3103,9 +3019,7 @@ xg_get_scroll_id_for_window (dpy, wid)
We free pointer to last scroll bar values here and remove the index. */
static void
-xg_gtk_scroll_destroy (widget, data)
- GtkWidget *widget;
- gpointer data;
+xg_gtk_scroll_destroy (GtkWidget *widget, gpointer data)
{
int id = (int) (EMACS_INT) data; /* The EMACS_INT cast avoids a warning. */
xg_remove_widget_from_map (id);
@@ -3120,11 +3034,11 @@ xg_gtk_scroll_destroy (widget, data)
to set resources for the widget. */
void
-xg_create_scroll_bar (f, bar, scroll_callback, end_callback, scroll_bar_name)
- FRAME_PTR f;
- struct scroll_bar *bar;
- GCallback scroll_callback, end_callback;
- char *scroll_bar_name;
+xg_create_scroll_bar (FRAME_PTR f,
+ struct scroll_bar *bar,
+ GCallback scroll_callback,
+ GCallback end_callback,
+ char *scroll_bar_name)
{
GtkWidget *wscroll;
GtkWidget *webox;
@@ -3174,23 +3088,10 @@ xg_create_scroll_bar (f, bar, scroll_callback, end_callback, scroll_bar_name)
bar->x_window = scroll_id;
}
-/* Make the scroll bar represented by SCROLLBAR_ID visible. */
-
-void
-xg_show_scroll_bar (scrollbar_id)
- int scrollbar_id;
-{
- GtkWidget *w = xg_get_widget_from_map (scrollbar_id);
- if (w)
- gtk_widget_show_all (gtk_widget_get_parent (w));
-}
-
/* Remove the scroll bar represented by SCROLLBAR_ID from the frame F. */
void
-xg_remove_scroll_bar (f, scrollbar_id)
- FRAME_PTR f;
- int scrollbar_id;
+xg_remove_scroll_bar (FRAME_PTR f, int scrollbar_id)
{
GtkWidget *w = xg_get_widget_from_map (scrollbar_id);
if (w)
@@ -3208,13 +3109,12 @@ xg_remove_scroll_bar (f, scrollbar_id)
WIDTH, HEIGHT is the size in pixels the bar shall have. */
void
-xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height)
- FRAME_PTR f;
- int scrollbar_id;
- int top;
- int left;
- int width;
- int height;
+xg_update_scrollbar_pos (FRAME_PTR f,
+ int scrollbar_id,
+ int top,
+ int left,
+ int width,
+ int height)
{
GtkWidget *wscroll = xg_get_widget_from_map (scrollbar_id);
@@ -3223,30 +3123,35 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height)
{
GtkWidget *wfixed = f->output_data.x->edit_widget;
GtkWidget *wparent = gtk_widget_get_parent (wscroll);
- GtkFixed *wf = GTK_FIXED (wfixed);
+ gint msl;
/* Clear out old position. */
- GList *iter;
int oldx = -1, oldy = -1, oldw, oldh;
- for (iter = wf->children; iter; iter = iter->next)
- if (((GtkFixedChild *)iter->data)->widget == wparent)
- {
- GtkFixedChild *ch = (GtkFixedChild *)iter->data;
- if (ch->x != left || ch->y != top)
- {
- oldx = ch->x;
- oldy = ch->y;
- gtk_widget_get_size_request (wscroll, &oldw, &oldh);
- }
- break;
- }
+ if (gtk_widget_get_parent (wparent) == wfixed)
+ {
+ gtk_container_child_get (GTK_CONTAINER (wfixed), wparent,
+ "x", &oldx, "y", &oldy, NULL);
+ gtk_widget_get_size_request (wscroll, &oldw, &oldh);
+ }
/* Move and resize to new values. */
gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top);
- gtk_widget_set_size_request (wscroll, width, height);
+ gtk_widget_style_get (wscroll, "min-slider-length", &msl, NULL);
+ if (msl > height)
+ {
+ /* No room. Hide scroll bar as some themes output a warning if
+ the height is less than the min size. */
+ gtk_widget_hide (wparent);
+ gtk_widget_hide (wscroll);
+ }
+ else
+ {
+ gtk_widget_show_all (wparent);
+ gtk_widget_set_size_request (wscroll, width, height);
+ }
gtk_widget_queue_draw (wfixed);
gdk_window_process_all_updates ();
- if (oldx != -1)
+ if (oldx != -1 && oldw > 0 && oldh > 0)
{
/* Clear under old scroll bar position. This must be done after
the gtk_widget_queue_draw and gdk_window_process_all_updates
@@ -3270,9 +3175,10 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height)
displaying PORTION out of a whole WHOLE, and our position POSITION. */
void
-xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
- struct scroll_bar *bar;
- int portion, position, whole;
+xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
+ int portion,
+ int position,
+ int whole)
{
GtkWidget *wscroll = xg_get_widget_from_map (bar->x_window);
@@ -3316,13 +3222,13 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
/* Assume all lines are of equal size. */
new_step = size / max (1, FRAME_LINES (f));
- if ((int) adj->page_size != size
- || (int) adj->step_increment != new_step)
+ if ((int) gtk_adjustment_get_page_size (adj) != size
+ || (int) gtk_adjustment_get_step_increment (adj) != new_step)
{
- adj->page_size = size;
- adj->step_increment = new_step;
+ gtk_adjustment_set_page_size (adj, size);
+ gtk_adjustment_set_step_increment (adj, new_step);
/* Assume a page increment is about 95% of the page size */
- adj->page_increment = (int) (0.95*adj->page_size);
+ gtk_adjustment_set_page_increment (adj,(int) (0.95*size));
changed = 1;
}
@@ -3354,9 +3260,7 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
Return non-zero if the event is for a scroll bar, zero otherwise. */
int
-xg_event_is_for_scrollbar (f, event)
- FRAME_PTR f;
- XEvent *event;
+xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event)
{
int retval = 0;
@@ -3365,7 +3269,7 @@ xg_event_is_for_scrollbar (f, event)
/* Check if press occurred outside the edit widget. */
GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
retval = gdk_display_get_window_at_pointer (gdpy, NULL, NULL)
- != f->output_data.x->edit_widget->window;
+ != gtk_widget_get_window (f->output_data.x->edit_widget);
}
else if (f
&& ((event->type == ButtonRelease && event->xbutton.button < 4)
@@ -3411,10 +3315,9 @@ xg_event_is_for_scrollbar (f, event)
tool bar. 0 is the first button. */
static gboolean
-xg_tool_bar_button_cb (widget, event, user_data)
- GtkWidget *widget;
- GdkEventButton *event;
- gpointer user_data;
+xg_tool_bar_button_cb (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data)
{
/* Casts to avoid warnings when gpointer is 64 bits and int is 32 bits */
gpointer ptr = (gpointer) (EMACS_INT) event->state;
@@ -3429,9 +3332,7 @@ xg_tool_bar_button_cb (widget, event, user_data)
tool bar. 0 is the first button. */
static void
-xg_tool_bar_callback (w, client_data)
- GtkWidget *w;
- gpointer client_data;
+xg_tool_bar_callback (GtkWidget *w, gpointer client_data)
{
/* The EMACS_INT cast avoids a warning. */
int idx = (int) (EMACS_INT) client_data;
@@ -3480,9 +3381,7 @@ xg_tool_bar_callback (w, client_data)
tool bar. 0 is the first button. */
static void
-xg_tool_bar_proxy_callback (w, client_data)
- GtkWidget *w;
- gpointer client_data;
+xg_tool_bar_proxy_callback (GtkWidget *w, gpointer client_data)
{
GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w),
XG_TOOL_BAR_PROXY_BUTTON));
@@ -3491,18 +3390,17 @@ xg_tool_bar_proxy_callback (w, client_data)
static gboolean
-xg_tool_bar_help_callback P_ ((GtkWidget *w,
- GdkEventCrossing *event,
- gpointer client_data));
+xg_tool_bar_help_callback (GtkWidget *w,
+ GdkEventCrossing *event,
+ gpointer client_data);
/* This callback is called when a help is to be shown for an item in
the detached tool bar when the detached tool bar it is not expanded. */
static gboolean
-xg_tool_bar_proxy_help_callback (w, event, client_data)
- GtkWidget *w;
- GdkEventCrossing *event;
- gpointer client_data;
+xg_tool_bar_proxy_help_callback (GtkWidget *w,
+ GdkEventCrossing *event,
+ gpointer client_data)
{
GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w),
XG_TOOL_BAR_PROXY_BUTTON));
@@ -3510,6 +3408,17 @@ xg_tool_bar_proxy_help_callback (w, event, client_data)
return xg_tool_bar_help_callback (wbutton, event, client_data);
}
+static GtkWidget *
+xg_get_tool_bar_widgets (GtkWidget *vb, GtkWidget **wimage)
+{
+ GList *clist = gtk_container_get_children (GTK_CONTAINER (vb));
+ GtkWidget *c1 = (GtkWidget *) clist->data;
+ GtkWidget *c2 = (GtkWidget *) clist->next->data;
+ *wimage = GTK_IS_IMAGE (c1) ? c1 : c2;
+ g_list_free (clist);
+ return GTK_IS_LABEL (c1) ? c1 : c2;
+}
+
/* This callback is called when a tool item should create a proxy item,
such as for the overflow menu. Also called when the tool bar is detached.
@@ -3517,24 +3426,19 @@ xg_tool_bar_proxy_help_callback (w, event, client_data)
blank. */
static gboolean
-xg_tool_bar_menu_proxy (toolitem, user_data)
- GtkToolItem *toolitem;
- gpointer user_data;
+xg_tool_bar_menu_proxy (GtkToolItem *toolitem, gpointer user_data)
{
GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (toolitem));
GtkButton *wbutton = GTK_BUTTON (gtk_bin_get_child (GTK_BIN (weventbox)));
- GtkBox *vb = GTK_BOX (gtk_bin_get_child (GTK_BIN (wbutton)));
- GtkBoxChild *c1 = (GtkBoxChild *) vb->children->data;
- GtkBoxChild *c2 = (GtkBoxChild *) vb->children->next->data;
- GtkImage *wimage = GTK_IS_IMAGE (c1->widget)
- ? GTK_IMAGE (c1->widget) : GTK_IMAGE (c2->widget);
- GtkLabel *wlbl = GTK_IS_LABEL (c1->widget)
- ? GTK_LABEL (c1->widget) : GTK_LABEL (c2->widget);
+ GtkWidget *vb = gtk_bin_get_child (GTK_BIN (wbutton));
+ GtkWidget *c1;
+ GtkLabel *wlbl = GTK_LABEL (xg_get_tool_bar_widgets (vb, &c1));
+ GtkImage *wimage = GTK_IMAGE (c1);
GtkWidget *wmenuitem = gtk_image_menu_item_new_with_label
(gtk_label_get_text (wlbl));
-
GtkWidget *wmenuimage;
+
if (gtk_button_get_use_stock (wbutton))
wmenuimage = gtk_image_new_from_stock (gtk_button_get_label (wbutton),
GTK_ICON_SIZE_MENU);
@@ -3605,7 +3509,8 @@ xg_tool_bar_menu_proxy (toolitem, user_data)
g_object_set_data (G_OBJECT (wmenuitem), XG_TOOL_BAR_PROXY_BUTTON,
(gpointer) wbutton);
gtk_tool_item_set_proxy_menu_item (toolitem, "Emacs toolbar item", wmenuitem);
- gtk_widget_set_sensitive (wmenuitem, GTK_WIDGET_SENSITIVE (wbutton));
+ gtk_widget_set_sensitive (wmenuitem,
+ gtk_widget_get_sensitive (GTK_WIDGET (wbutton)));
/* Use enter/leave notify to show help. We use the events
rather than the GtkButton specific signals "enter" and
@@ -3631,10 +3536,9 @@ xg_tool_bar_menu_proxy (toolitem, user_data)
CLIENT_DATA is a pointer to the frame the tool bar belongs to. */
static void
-xg_tool_bar_detach_callback (wbox, w, client_data)
- GtkHandleBox *wbox;
- GtkWidget *w;
- gpointer client_data;
+xg_tool_bar_detach_callback (GtkHandleBox *wbox,
+ GtkWidget *w,
+ gpointer client_data)
{
FRAME_PTR f = (FRAME_PTR) client_data;
extern int x_gtk_whole_detached_tool_bar;
@@ -3662,10 +3566,9 @@ xg_tool_bar_detach_callback (wbox, w, client_data)
CLIENT_DATA is a pointer to the frame the tool bar belongs to. */
static void
-xg_tool_bar_attach_callback (wbox, w, client_data)
- GtkHandleBox *wbox;
- GtkWidget *w;
- gpointer client_data;
+xg_tool_bar_attach_callback (GtkHandleBox *wbox,
+ GtkWidget *w,
+ gpointer client_data)
{
FRAME_PTR f = (FRAME_PTR) client_data;
g_object_set (G_OBJECT (w), "show-arrow", TRUE, NULL);
@@ -3692,10 +3595,9 @@ xg_tool_bar_attach_callback (wbox, w, client_data)
Returns FALSE to tell GTK to keep processing this event. */
static gboolean
-xg_tool_bar_help_callback (w, event, client_data)
- GtkWidget *w;
- GdkEventCrossing *event;
- gpointer client_data;
+xg_tool_bar_help_callback (GtkWidget *w,
+ GdkEventCrossing *event,
+ gpointer client_data)
{
/* The EMACS_INT cast avoids a warning. */
int idx = (int) (EMACS_INT) client_data;
@@ -3734,10 +3636,9 @@ xg_tool_bar_help_callback (w, event, client_data)
Returns FALSE to tell GTK to keep processing this event. */
static gboolean
-xg_tool_bar_item_expose_callback (w, event, client_data)
- GtkWidget *w;
- GdkEventExpose *event;
- gpointer client_data;
+xg_tool_bar_item_expose_callback (GtkWidget *w,
+ GdkEventExpose *event,
+ gpointer client_data)
{
gint width, height;
@@ -3758,8 +3659,7 @@ xg_tool_bar_item_expose_callback (w, event, client_data)
/* Attach a tool bar to frame F. */
static void
-xg_pack_tool_bar (f)
- FRAME_PTR f;
+xg_pack_tool_bar (FRAME_PTR f)
{
struct x_output *x = f->output_data.x;
int vbox_pos = x->menubar_widget ? 1 : 0;
@@ -3784,10 +3684,16 @@ xg_pack_tool_bar (f)
}
/* Create a tool bar for frame F. */
+#ifdef HAVE_GTK_ORIENTABLE_SET_ORIENTATION
+#define toolbar_set_orientation(w, o) \
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (w), o)
+#else
+#define toolbar_set_orientation(w, o) \
+ gtk_toolbar_set_orientation (GTK_TOOLBAR (w), o)
+#endif
static void
-xg_create_tool_bar (f)
- FRAME_PTR f;
+xg_create_tool_bar (FRAME_PTR f)
{
struct x_output *x = f->output_data.x;
@@ -3797,7 +3703,7 @@ xg_create_tool_bar (f)
gtk_widget_set_name (x->toolbar_widget, "emacs-toolbar");
gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS);
- gtk_toolbar_set_orientation (GTK_TOOLBAR (x->toolbar_widget),
+ toolbar_set_orientation (x->toolbar_widget,
GTK_ORIENTATION_HORIZONTAL);
}
@@ -3808,10 +3714,7 @@ xg_create_tool_bar (f)
Returns IMAGE if RTL is not found. */
static Lisp_Object
-find_rtl_image (f, image, rtl)
- FRAME_PTR f;
- Lisp_Object image;
- Lisp_Object rtl;
+find_rtl_image (FRAME_PTR f, Lisp_Object image, Lisp_Object rtl)
{
int i;
Lisp_Object file, rtl_name;
@@ -3852,9 +3755,9 @@ xg_make_tool_item (FRAME_PTR f,
GtkWidget *weventbox = gtk_event_box_new ();
if (wimage)
- gtk_box_pack_start_defaults (GTK_BOX (vb), wimage);
+ gtk_box_pack_start (GTK_BOX (vb), wimage, TRUE, TRUE, 0);
- gtk_box_pack_start_defaults (GTK_BOX (vb), gtk_label_new (label));
+ gtk_box_pack_start (GTK_BOX (vb), gtk_label_new (label), TRUE, TRUE, 0);
gtk_button_set_focus_on_click (GTK_BUTTON (wb), FALSE);
gtk_button_set_relief (GTK_BUTTON (wb), GTK_RELIEF_NONE);
gtk_container_add (GTK_CONTAINER (wb), vb);
@@ -3924,13 +3827,9 @@ xg_show_toolbar_item (GtkToolItem *ti)
GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (ti));
GtkWidget *wbutton = gtk_bin_get_child (GTK_BIN (weventbox));
- GtkBox *vb = GTK_BOX (gtk_bin_get_child (GTK_BIN (wbutton)));
- GtkBoxChild *c1 = (GtkBoxChild *) vb->children->data;
- GtkBoxChild *c2 = (GtkBoxChild *) vb->children->next->data;
- GtkWidget *wimage = GTK_IS_IMAGE (c1->widget)
- ? c1->widget : c2->widget;
- GtkWidget *wlbl = GTK_IS_LABEL (c1->widget)
- ? c1->widget : c2->widget;
+ GtkWidget *vb = gtk_bin_get_child (GTK_BIN (wbutton));
+ GtkWidget *wimage;
+ GtkWidget *wlbl = xg_get_tool_bar_widgets (vb, &wimage);
GtkWidget *new_box = NULL;
if (GTK_IS_VBOX (vb) && horiz)
@@ -3939,17 +3838,17 @@ xg_show_toolbar_item (GtkToolItem *ti)
new_box = gtk_vbox_new (FALSE, 0);
if (new_box)
{
- gtk_widget_ref (wimage);
- gtk_widget_ref (wlbl);
+ g_object_ref (G_OBJECT (wimage));
+ g_object_ref (G_OBJECT (wlbl));
gtk_container_remove (GTK_CONTAINER (vb), wimage);
gtk_container_remove (GTK_CONTAINER (vb), wlbl);
gtk_widget_destroy (GTK_WIDGET (vb));
- gtk_box_pack_start_defaults (GTK_BOX (new_box), wimage);
- gtk_box_pack_start_defaults (GTK_BOX (new_box), wlbl);
+ gtk_box_pack_start (GTK_BOX (new_box), wimage, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (new_box), wlbl, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (wbutton), new_box);
- gtk_widget_unref (wimage);
- gtk_widget_unref (wlbl);
- vb = GTK_BOX (new_box);
+ g_object_unref (G_OBJECT (wimage));
+ g_object_unref (G_OBJECT (wlbl));
+ vb = new_box;
}
if (show_label) gtk_widget_show (wlbl);
@@ -3968,8 +3867,7 @@ xg_show_toolbar_item (GtkToolItem *ti)
extern Lisp_Object Qx_gtk_map_stock;
void
-update_frame_tool_bar (f)
- FRAME_PTR f;
+update_frame_tool_bar (FRAME_PTR f)
{
int i;
GtkRequisition old_req, new_req;
@@ -4033,7 +3931,6 @@ update_frame_tool_bar (f)
GtkWidget *wbutton = NULL;
GtkWidget *weventbox;
Lisp_Object specified_file;
- Lisp_Object lbl = PROP (TOOL_BAR_ITEM_LABEL);
char *label = SSDATA (PROP (TOOL_BAR_ITEM_LABEL));
ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (wtoolbar), i);
@@ -4165,13 +4062,9 @@ update_frame_tool_bar (f)
}
else
{
- GtkBox *vb = GTK_BOX (gtk_bin_get_child (GTK_BIN (wbutton)));
- GtkBoxChild *c1 = (GtkBoxChild *) vb->children->data;
- GtkBoxChild *c2 = (GtkBoxChild *) vb->children->next->data;
- GtkWidget *wimage = GTK_IS_IMAGE (c1->widget)
- ? c1->widget : c2->widget;
- GtkWidget *wlbl = GTK_IS_LABEL (c1->widget)
- ? c1->widget : c2->widget;
+ GtkWidget *vb = gtk_bin_get_child (GTK_BIN (wbutton));
+ GtkWidget *wimage;
+ GtkWidget *wlbl = xg_get_tool_bar_widgets (vb, &wimage);
Pixmap old_img = (Pixmap)g_object_get_data (G_OBJECT (wimage),
XG_TOOL_BAR_IMAGE_DATA);
@@ -4208,7 +4101,8 @@ update_frame_tool_bar (f)
}
else if (img && old_img != img->pixmap)
{
- (void) xg_get_image_for_pixmap (f, img, x->widget, wimage);
+ (void) xg_get_image_for_pixmap (f, img, x->widget,
+ GTK_IMAGE (wimage));
g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA,
(gpointer)img->pixmap);
@@ -4254,8 +4148,7 @@ update_frame_tool_bar (f)
Remove the tool bar. */
void
-free_frame_tool_bar (f)
- FRAME_PTR f;
+free_frame_tool_bar (FRAME_PTR f)
{
struct x_output *x = f->output_data.x;
@@ -4286,7 +4179,7 @@ free_frame_tool_bar (f)
Initializing
***********************************************************************/
void
-xg_initialize ()
+xg_initialize (void)
{
GtkBindingSet *binding_set;
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 602228f97be..14693650de5 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -38,7 +38,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Key for data that menu items hold. */
#define XG_ITEM_DATA "emacs_menuitem"
-
/* Button types in menus. */
enum button_type
{
@@ -119,94 +118,95 @@ typedef struct _widget_value
struct _widget_value *free_list;
} widget_value;
-#ifdef HAVE_GTK_FILE_BOTH
+#ifdef HAVE_GTK_FILE_SELECTION_NEW
extern int use_old_gtk_file_dialog;
#endif
-extern widget_value *malloc_widget_value P_ ((void));
-extern void free_widget_value P_ ((widget_value *));
-
-extern int xg_uses_old_file_dialog P_ ((void));
-
-extern char *xg_get_file_name P_ ((FRAME_PTR f,
- char *prompt,
- char *default_filename,
- int mustmatch_p,
- int only_dir_p));
-
-extern char *xg_get_font_name P_ ((FRAME_PTR f, char *));
-
-extern GtkWidget *xg_create_widget P_ ((char *type,
- char *name,
- FRAME_PTR f,
- widget_value *val,
- GCallback select_cb,
- GCallback deactivate_cb,
- GCallback hightlight_cb));
-
-extern void xg_modify_menubar_widgets P_ ((GtkWidget *menubar,
- FRAME_PTR f,
- widget_value *val,
- int deep_p,
- GCallback select_cb,
- GCallback deactivate_cb,
- GCallback hightlight_cb));
-
-extern int xg_update_frame_menubar P_ ((FRAME_PTR f));
-
-extern int xg_have_tear_offs P_ ((void));
-
-extern int xg_get_scroll_id_for_window P_ ((Display *dpy, Window wid));
-
-extern void xg_create_scroll_bar P_ ((FRAME_PTR f,
- struct scroll_bar *bar,
- GCallback scroll_callback,
- GCallback end_callback,
- char *scroll_bar_name));
-extern void xg_show_scroll_bar P_ ((int scrollbar_id));
-extern void xg_remove_scroll_bar P_ ((FRAME_PTR f, int scrollbar_id));
-
-extern void xg_update_scrollbar_pos P_ ((FRAME_PTR f,
- int scrollbar_id,
- int top,
- int left,
- int width,
- int height));
-
-extern void xg_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *bar,
- int portion,
- int position,
- int whole));
-extern int xg_event_is_for_scrollbar P_ ((FRAME_PTR f, XEvent *event));
-
-extern void update_frame_tool_bar P_ ((FRAME_PTR f));
-extern void free_frame_tool_bar P_ ((FRAME_PTR f));
-
-extern void xg_frame_resized P_ ((FRAME_PTR f,
- int pixelwidth,
- int pixelheight));
-extern void xg_frame_set_char_size P_ ((FRAME_PTR f, int cols, int rows));
-extern GtkWidget * xg_win_to_widget P_ ((Display *dpy, Window wdesc));
-
-extern int xg_display_open P_ ((char *display_name, Display **dpy));
-extern void xg_display_close P_ ((Display *dpy));
-extern GdkCursor * xg_create_default_cursor P_ ((Display *dpy));
-
-extern int xg_create_frame_widgets P_ ((FRAME_PTR f));
-extern void x_wm_set_size_hint P_ ((FRAME_PTR f,
- long flags,
- int user_position));
-extern void xg_set_background_color P_ ((FRAME_PTR f, unsigned long bg));
-
-extern void xg_set_frame_icon P_ ((FRAME_PTR f,
- Pixmap icon_pixmap,
- Pixmap icon_mask));
+extern widget_value *malloc_widget_value (void);
+extern void free_widget_value (widget_value *);
+
+extern int xg_uses_old_file_dialog (void);
+
+extern char *xg_get_file_name (FRAME_PTR f,
+ char *prompt,
+ char *default_filename,
+ int mustmatch_p,
+ int only_dir_p);
+
+extern char *xg_get_font_name (FRAME_PTR f, char *);
+
+extern GtkWidget *xg_create_widget (char *type,
+ char *name,
+ FRAME_PTR f,
+ widget_value *val,
+ GCallback select_cb,
+ GCallback deactivate_cb,
+ GCallback hightlight_cb);
+
+extern void xg_modify_menubar_widgets (GtkWidget *menubar,
+ FRAME_PTR f,
+ widget_value *val,
+ int deep_p,
+ GCallback select_cb,
+ GCallback deactivate_cb,
+ GCallback hightlight_cb);
+
+extern int xg_update_frame_menubar (FRAME_PTR f);
+
+extern int xg_event_is_for_menubar (FRAME_PTR f, XEvent *event);
+
+extern int xg_have_tear_offs (void);
+
+extern int xg_get_scroll_id_for_window (Display *dpy, Window wid);
+
+extern void xg_create_scroll_bar (FRAME_PTR f,
+ struct scroll_bar *bar,
+ GCallback scroll_callback,
+ GCallback end_callback,
+ char *scroll_bar_name);
+extern void xg_remove_scroll_bar (FRAME_PTR f, int scrollbar_id);
+
+extern void xg_update_scrollbar_pos (FRAME_PTR f,
+ int scrollbar_id,
+ int top,
+ int left,
+ int width,
+ int height);
+
+extern void xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
+ int portion,
+ int position,
+ int whole);
+extern int xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event);
+
+extern void update_frame_tool_bar (FRAME_PTR f);
+extern void free_frame_tool_bar (FRAME_PTR f);
+
+extern void xg_frame_resized (FRAME_PTR f,
+ int pixelwidth,
+ int pixelheight);
+extern void xg_frame_set_char_size (FRAME_PTR f, int cols, int rows);
+extern GtkWidget * xg_win_to_widget (Display *dpy, Window wdesc);
+
+extern void xg_display_open (char *display_name, Display **dpy);
+extern void xg_display_close (Display *dpy);
+extern GdkCursor * xg_create_default_cursor (Display *dpy);
+
+extern int xg_create_frame_widgets (FRAME_PTR f);
+extern void x_wm_set_size_hint (FRAME_PTR f,
+ long flags,
+ int user_position);
+extern void xg_set_background_color (FRAME_PTR f, unsigned long bg);
+
+extern void xg_set_frame_icon (FRAME_PTR f,
+ Pixmap icon_pixmap,
+ Pixmap icon_mask);
/* Mark all callback data that are Lisp_object:s during GC. */
-extern void xg_mark_data P_ ((void));
+extern void xg_mark_data (void);
/* Initialize GTK specific parts. */
-extern void xg_initialize P_ ((void));
+extern void xg_initialize (void);
/* Setting scrollbar values invokes the callback. Use this variable
to indicate that the callback should do nothing. */
diff --git a/src/image.c b/src/image.c
index 67c228cbc7f..2ea70e221cf 100644
--- a/src/image.c
+++ b/src/image.c
@@ -127,16 +127,16 @@ typedef struct ns_bitmap_record Bitmap_Record;
Lisp_Object Vx_bitmap_file_path;
-static void x_disable_image P_ ((struct frame *, struct image *));
-static void x_edge_detection P_ ((struct frame *, struct image *, Lisp_Object,
- Lisp_Object));
+static void x_disable_image (struct frame *, struct image *);
+static void x_edge_detection (struct frame *, struct image *, Lisp_Object,
+ Lisp_Object);
-static void init_color_table P_ ((void));
-static unsigned long lookup_rgb_color P_ ((struct frame *f, int r, int g, int b));
+static void init_color_table (void);
+static unsigned long lookup_rgb_color (struct frame *f, int r, int g, int b);
#ifdef COLOR_TABLE_SUPPORT
-static void free_color_table P_ ((void));
-static unsigned long *colors_in_color_table P_ ((int *n));
-static unsigned long lookup_pixel_color P_ ((struct frame *f, unsigned long p));
+static void free_color_table (void);
+static unsigned long *colors_in_color_table (int *n);
+static unsigned long lookup_pixel_color (struct frame *f, unsigned long p);
#endif
/* Code to deal with bitmaps. Bitmaps are referenced by their bitmap
@@ -157,7 +157,7 @@ XGetImage (Display *display, Pixmap pixmap, int x, int y,
unsigned long plane_mask, int format)
{
/* TODO: not sure what this function is supposed to do.. */
- ns_retain_object(pixmap);
+ ns_retain_object (pixmap);
return pixmap;
}
@@ -165,7 +165,7 @@ XGetImage (Display *display, Pixmap pixmap, int x, int y,
unsigned long
XGetPixel (XImagePtr ximage, int x, int y)
{
- return ns_get_pixel(ximage, x, y);
+ return ns_get_pixel (ximage, x, y);
}
/* use with imgs created by ns_image_for_XPM; alpha set to 1;
@@ -173,7 +173,7 @@ XGetPixel (XImagePtr ximage, int x, int y)
void
XPutPixel (XImagePtr ximage, int x, int y, unsigned long pixel)
{
- ns_put_pixel(ximage, x, y, pixel);
+ ns_put_pixel (ximage, x, y, pixel);
}
#endif /* HAVE_NS */
@@ -181,26 +181,20 @@ XPutPixel (XImagePtr ximage, int x, int y, unsigned long pixel)
/* Functions to access the contents of a bitmap, given an id. */
int
-x_bitmap_height (f, id)
- FRAME_PTR f;
- int id;
+x_bitmap_height (FRAME_PTR f, int id)
{
return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].height;
}
int
-x_bitmap_width (f, id)
- FRAME_PTR f;
- int id;
+x_bitmap_width (FRAME_PTR f, int id)
{
return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].width;
}
#if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI)
int
-x_bitmap_pixmap (f, id)
- FRAME_PTR f;
- int id;
+x_bitmap_pixmap (FRAME_PTR f, int id)
{
return (int) FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap;
}
@@ -208,9 +202,7 @@ x_bitmap_pixmap (f, id)
#ifdef HAVE_X_WINDOWS
int
-x_bitmap_mask (f, id)
- FRAME_PTR f;
- int id;
+x_bitmap_mask (FRAME_PTR f, int id)
{
return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].mask;
}
@@ -219,8 +211,7 @@ x_bitmap_mask (f, id)
/* Allocate a new bitmap record. Returns index of new record. */
static int
-x_allocate_bitmap_record (f)
- FRAME_PTR f;
+x_allocate_bitmap_record (FRAME_PTR f)
{
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
int i;
@@ -251,9 +242,7 @@ x_allocate_bitmap_record (f)
/* Add one reference to the reference count of the bitmap with id ID. */
void
-x_reference_bitmap (f, id)
- FRAME_PTR f;
- int id;
+x_reference_bitmap (FRAME_PTR f, int id)
{
++FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].refcount;
}
@@ -261,10 +250,7 @@ x_reference_bitmap (f, id)
/* Create a bitmap for frame F from a HEIGHT x WIDTH array of bits at BITS. */
int
-x_create_bitmap_from_data (f, bits, width, height)
- struct frame *f;
- char *bits;
- unsigned int width, height;
+x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsigned int height)
{
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
int id;
@@ -288,7 +274,7 @@ x_create_bitmap_from_data (f, bits, width, height)
#endif /* HAVE_NTGUI */
#ifdef HAVE_NS
- void *bitmap = ns_image_from_XBM(bits, width, height);
+ void *bitmap = ns_image_from_XBM (bits, width, height);
if (!bitmap)
return -1;
#endif
@@ -323,9 +309,7 @@ x_create_bitmap_from_data (f, bits, width, height)
/* Create bitmap from file FILE for frame F. */
int
-x_create_bitmap_from_file (f, file)
- struct frame *f;
- Lisp_Object file;
+x_create_bitmap_from_file (struct frame *f, Lisp_Object file)
{
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -335,7 +319,7 @@ x_create_bitmap_from_file (f, file)
#ifdef HAVE_NS
int id;
- void *bitmap = ns_image_from_file(file);
+ void *bitmap = ns_image_from_file (file);
if (!bitmap)
return -1;
@@ -346,8 +330,8 @@ x_create_bitmap_from_file (f, file)
dpyinfo->bitmaps[id - 1].refcount = 1;
dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (SBYTES (file) + 1);
dpyinfo->bitmaps[id - 1].depth = 1;
- dpyinfo->bitmaps[id - 1].height = ns_image_width(bitmap);
- dpyinfo->bitmaps[id - 1].width = ns_image_height(bitmap);
+ dpyinfo->bitmaps[id - 1].height = ns_image_width (bitmap);
+ dpyinfo->bitmaps[id - 1].width = ns_image_height (bitmap);
strcpy (dpyinfo->bitmaps[id - 1].file, SDATA (file));
return id;
#endif
@@ -402,9 +386,7 @@ x_create_bitmap_from_file (f, file)
/* Free bitmap B. */
static void
-free_bitmap_record (dpyinfo, bm)
- Display_Info *dpyinfo;
- Bitmap_Record *bm;
+free_bitmap_record (Display_Info *dpyinfo, Bitmap_Record *bm)
{
#ifdef HAVE_X_WINDOWS
XFreePixmap (dpyinfo->display, bm->pixmap);
@@ -417,7 +399,7 @@ free_bitmap_record (dpyinfo, bm)
#endif /* HAVE_NTGUI */
#ifdef HAVE_NS
- ns_release_object(bm->img);
+ ns_release_object (bm->img);
#endif
if (bm->file)
@@ -430,9 +412,7 @@ free_bitmap_record (dpyinfo, bm)
/* Remove reference to bitmap with id number ID. */
void
-x_destroy_bitmap (f, id)
- FRAME_PTR f;
- int id;
+x_destroy_bitmap (FRAME_PTR f, int id)
{
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -452,8 +432,7 @@ x_destroy_bitmap (f, id)
/* Free all the bitmaps for the display specified by DPYINFO. */
void
-x_destroy_all_bitmaps (dpyinfo)
- Display_Info *dpyinfo;
+x_destroy_all_bitmaps (Display_Info *dpyinfo)
{
int i;
Bitmap_Record *bm = dpyinfo->bitmaps;
@@ -471,25 +450,23 @@ x_destroy_all_bitmaps (dpyinfo)
/* Useful functions defined in the section
`Image type independent image structures' below. */
-static unsigned long four_corners_best P_ ((XImagePtr ximg,
- int *corners,
- unsigned long width,
- unsigned long height));
+static unsigned long four_corners_best (XImagePtr ximg,
+ int *corners,
+ unsigned long width,
+ unsigned long height);
-static int x_create_x_image_and_pixmap P_ ((struct frame *f, int width, int height,
- int depth, XImagePtr *ximg,
- Pixmap *pixmap));
+static int x_create_x_image_and_pixmap (struct frame *f, int width, int height,
+ int depth, XImagePtr *ximg,
+ Pixmap *pixmap);
-static void x_destroy_x_image P_ ((XImagePtr ximg));
+static void x_destroy_x_image (XImagePtr ximg);
/* Create a mask of a bitmap. Note is this not a perfect mask.
It's nicer with some borders in this context */
int
-x_create_bitmap_mask (f, id)
- struct frame *f;
- int id;
+x_create_bitmap_mask (struct frame *f, int id)
{
Pixmap pixmap, mask;
XImagePtr ximg, mask_img;
@@ -619,13 +596,13 @@ Lisp_Object Vimage_cache_eviction_delay;
/* Function prototypes. */
-static Lisp_Object define_image_type P_ ((struct image_type *type, int loaded));
-static struct image_type *lookup_image_type P_ ((Lisp_Object symbol));
-static void image_error P_ ((char *format, Lisp_Object, Lisp_Object));
-static void x_laplace P_ ((struct frame *, struct image *));
-static void x_emboss P_ ((struct frame *, struct image *));
-static int x_build_heuristic_mask P_ ((struct frame *, struct image *,
- Lisp_Object));
+static Lisp_Object define_image_type (struct image_type *type, int loaded);
+static struct image_type *lookup_image_type (Lisp_Object symbol);
+static void image_error (char *format, Lisp_Object, Lisp_Object);
+static void x_laplace (struct frame *, struct image *);
+static void x_emboss (struct frame *, struct image *);
+static int x_build_heuristic_mask (struct frame *, struct image *,
+ Lisp_Object);
#define CACHE_IMAGE_TYPE(type, status) \
do { Vimage_type_cache = Fcons (Fcons (type, status), Vimage_type_cache); } while (0)
@@ -637,9 +614,7 @@ static int x_build_heuristic_mask P_ ((struct frame *, struct image *,
image_types and caches the loading status of TYPE. */
static Lisp_Object
-define_image_type (type, loaded)
- struct image_type *type;
- int loaded;
+define_image_type (struct image_type *type, int loaded)
{
Lisp_Object success;
@@ -650,7 +625,7 @@ define_image_type (type, loaded)
/* Make a copy of TYPE to avoid a bus error in a dumped Emacs.
The initialized data segment is read-only. */
struct image_type *p = (struct image_type *) xmalloc (sizeof *p);
- bcopy (type, p, sizeof *p);
+ memcpy (p, type, sizeof *p);
p->next = image_types;
image_types = p;
success = Qt;
@@ -665,8 +640,7 @@ define_image_type (type, loaded)
structure. Value is null if SYMBOL is not a known image type. */
static INLINE struct image_type *
-lookup_image_type (symbol)
- Lisp_Object symbol;
+lookup_image_type (Lisp_Object symbol)
{
struct image_type *type;
@@ -690,8 +664,7 @@ lookup_image_type (symbol)
image type. */
int
-valid_image_p (object)
- Lisp_Object object;
+valid_image_p (Lisp_Object object)
{
int valid_p = 0;
@@ -726,9 +699,7 @@ valid_image_p (object)
therefore simply displays a message. */
static void
-image_error (format, arg1, arg2)
- char *format;
- Lisp_Object arg1, arg2;
+image_error (char *format, Lisp_Object arg1, Lisp_Object arg2)
{
add_to_log (format, arg1, arg2);
}
@@ -776,9 +747,9 @@ struct image_keyword
};
-static int parse_image_spec P_ ((Lisp_Object, struct image_keyword *,
- int, Lisp_Object));
-static Lisp_Object image_spec_value P_ ((Lisp_Object, Lisp_Object, int *));
+static int parse_image_spec (Lisp_Object, struct image_keyword *,
+ int, Lisp_Object);
+static Lisp_Object image_spec_value (Lisp_Object, Lisp_Object, int *);
/* Parse image spec SPEC according to KEYWORDS. A valid image spec
@@ -788,11 +759,8 @@ static Lisp_Object image_spec_value P_ ((Lisp_Object, Lisp_Object, int *));
allowed keyword/value pairs. Value is non-zero if SPEC is valid. */
static int
-parse_image_spec (spec, keywords, nkeywords, type)
- Lisp_Object spec;
- struct image_keyword *keywords;
- int nkeywords;
- Lisp_Object type;
+parse_image_spec (Lisp_Object spec, struct image_keyword *keywords,
+ int nkeywords, Lisp_Object type)
{
int i;
Lisp_Object plist;
@@ -928,9 +896,7 @@ parse_image_spec (spec, keywords, nkeywords, type)
to 1 if KEY was found in SPEC, set it to 0 otherwise. */
static Lisp_Object
-image_spec_value (spec, key, found)
- Lisp_Object spec, key;
- int *found;
+image_spec_value (Lisp_Object spec, Lisp_Object key, int *found)
{
Lisp_Object tail;
@@ -960,8 +926,7 @@ PIXELS non-nil means return the size in pixels, otherwise return the
size in canonical character units.
FRAME is the frame on which the image will be displayed. FRAME nil
or omitted means use the selected frame. */)
- (spec, pixels, frame)
- Lisp_Object spec, pixels, frame;
+ (Lisp_Object spec, Lisp_Object pixels, Lisp_Object frame)
{
Lisp_Object size;
@@ -991,8 +956,7 @@ DEFUN ("image-mask-p", Fimage_mask_p, Simage_mask_p, 1, 2, 0,
doc: /* Return t if image SPEC has a mask bitmap.
FRAME is the frame on which the image will be displayed. FRAME nil
or omitted means use the selected frame. */)
- (spec, frame)
- Lisp_Object spec, frame;
+ (Lisp_Object spec, Lisp_Object frame)
{
Lisp_Object mask;
@@ -1015,8 +979,7 @@ DEFUN ("image-metadata", Fimage_metadata, Simage_metadata, 1, 2, 0,
doc: /* Return metadata for image SPEC.
FRAME is the frame on which the image will be displayed. FRAME nil
or omitted means use the selected frame. */)
- (spec, frame)
- Lisp_Object spec, frame;
+ (Lisp_Object spec, Lisp_Object frame)
{
Lisp_Object ext;
@@ -1037,9 +1000,9 @@ or omitted means use the selected frame. */)
Image type independent image structures
***********************************************************************/
-static struct image *make_image P_ ((Lisp_Object spec, unsigned hash));
-static void free_image P_ ((struct frame *f, struct image *img));
-static int check_image_size P_ ((struct frame *f, int width, int height));
+static struct image *make_image (Lisp_Object spec, unsigned hash);
+static void free_image (struct frame *f, struct image *img);
+static int check_image_size (struct frame *f, int width, int height);
#define MAX_IMAGE_SIZE 6.0
Lisp_Object Vmax_image_size;
@@ -1048,15 +1011,13 @@ Lisp_Object Vmax_image_size;
SPEC. SPEC has a hash value of HASH. */
static struct image *
-make_image (spec, hash)
- Lisp_Object spec;
- unsigned hash;
+make_image (Lisp_Object spec, unsigned int hash)
{
struct image *img = (struct image *) xmalloc (sizeof *img);
Lisp_Object file = image_spec_value (spec, QCfile, NULL);
xassert (valid_image_p (spec));
- bzero (img, sizeof *img);
+ memset (img, 0, sizeof *img);
img->dependencies = NILP (file) ? Qnil : list1 (file);
img->type = lookup_image_type (image_spec_value (spec, QCtype, NULL));
xassert (img->type != NULL);
@@ -1072,9 +1033,7 @@ make_image (spec, hash)
/* Free image IMG which was used on frame F, including its resources. */
static void
-free_image (f, img)
- struct frame *f;
- struct image *img;
+free_image (struct frame *f, struct image *img)
{
if (img)
{
@@ -1094,6 +1053,10 @@ free_image (f, img)
/* Free resources, then free IMG. */
img->type->free (f, img);
xfree (img);
+
+ /* As display glyphs may still be referring to the image ID, we
+ must garbage the frame (Bug#6426). */
+ SET_FRAME_GARBAGED (f);
}
}
@@ -1101,10 +1064,7 @@ free_image (f, img)
otherwise, return 0. */
int
-check_image_size (f, width, height)
- struct frame *f;
- int width;
- int height;
+check_image_size (struct frame *f, int width, int height)
{
int w, h;
@@ -1135,9 +1095,7 @@ check_image_size (f, width, height)
drawing an image. */
void
-prepare_image_for_display (f, img)
- struct frame *f;
- struct image *img;
+prepare_image_for_display (struct frame *f, struct image *img)
{
EMACS_TIME t;
@@ -1157,10 +1115,7 @@ prepare_image_for_display (f, img)
drawn in face FACE. */
int
-image_ascent (img, face, slice)
- struct image *img;
- struct face *face;
- struct glyph_slice *slice;
+image_ascent (struct image *img, struct face *face, struct glyph_slice *slice)
{
int height;
int ascent;
@@ -1206,10 +1161,8 @@ image_ascent (img, face, slice)
On W32, XIMG is assumed to a device context with the bitmap selected. */
static RGB_PIXEL_COLOR
-four_corners_best (ximg, corners, width, height)
- XImagePtr_or_DC ximg;
- int *corners;
- unsigned long width, height;
+four_corners_best (XImagePtr_or_DC ximg, int *corners,
+ unsigned long width, unsigned long height)
{
RGB_PIXEL_COLOR corner_pixels[4], best;
int i, best_count;
@@ -1259,10 +1212,10 @@ four_corners_best (ximg, corners, width, height)
#elif defined (HAVE_NS)
#define Destroy_Image(ximg, dummy) \
- ns_release_object(ximg)
+ ns_release_object (ximg)
#define Free_Pixmap(display, pixmap) \
- ns_release_object(pixmap)
+ ns_release_object (pixmap)
#else
@@ -1281,10 +1234,7 @@ four_corners_best (ximg, corners, width, height)
use for the heuristic. */
RGB_PIXEL_COLOR
-image_background (img, f, ximg)
- struct image *img;
- struct frame *f;
- XImagePtr_or_DC ximg;
+image_background (struct image *img, struct frame *f, XImagePtr_or_DC ximg)
{
if (! img->background_valid)
/* IMG doesn't have a background yet, try to guess a reasonable value. */
@@ -1323,10 +1273,7 @@ image_background (img, f, ximg)
existing XImage object to use for the heuristic. */
int
-image_background_transparent (img, f, mask)
- struct image *img;
- struct frame *f;
- XImagePtr_or_DC mask;
+image_background_transparent (struct image *img, struct frame *f, XImagePtr_or_DC mask)
{
if (! img->background_transparent_valid)
/* IMG doesn't have a background yet, try to guess a reasonable value. */
@@ -1371,13 +1318,13 @@ image_background_transparent (img, f, mask)
Helper functions for X image types
***********************************************************************/
-static void x_clear_image_1 P_ ((struct frame *, struct image *, int,
- int, int));
-static void x_clear_image P_ ((struct frame *f, struct image *img));
-static unsigned long x_alloc_image_color P_ ((struct frame *f,
- struct image *img,
- Lisp_Object color_name,
- unsigned long dflt));
+static void x_clear_image_1 (struct frame *, struct image *, int,
+ int, int);
+static void x_clear_image (struct frame *f, struct image *img);
+static unsigned long x_alloc_image_color (struct frame *f,
+ struct image *img,
+ Lisp_Object color_name,
+ unsigned long dflt);
/* Clear X resources of image IMG on frame F. PIXMAP_P non-zero means
@@ -1386,10 +1333,8 @@ static unsigned long x_alloc_image_color P_ ((struct frame *f,
the image, if any. */
static void
-x_clear_image_1 (f, img, pixmap_p, mask_p, colors_p)
- struct frame *f;
- struct image *img;
- int pixmap_p, mask_p, colors_p;
+x_clear_image_1 (struct frame *f, struct image *img, int pixmap_p, int mask_p,
+ int colors_p)
{
if (pixmap_p && img->pixmap)
{
@@ -1422,9 +1367,7 @@ x_clear_image_1 (f, img, pixmap_p, mask_p, colors_p)
/* Free X resources of image IMG which is used on frame F. */
static void
-x_clear_image (f, img)
- struct frame *f;
- struct image *img;
+x_clear_image (struct frame *f, struct image *img)
{
BLOCK_INPUT;
x_clear_image_1 (f, img, 1, 1, 1);
@@ -1438,11 +1381,8 @@ x_clear_image (f, img)
color. */
static unsigned long
-x_alloc_image_color (f, img, color_name, dflt)
- struct frame *f;
- struct image *img;
- Lisp_Object color_name;
- unsigned long dflt;
+x_alloc_image_color (struct frame *f, struct image *img, Lisp_Object color_name,
+ unsigned long dflt)
{
XColor color;
unsigned long result;
@@ -1472,25 +1412,25 @@ x_alloc_image_color (f, img, color_name, dflt)
Image Cache
***********************************************************************/
-static struct image *search_image_cache P_ ((struct frame *, Lisp_Object, unsigned));
-static void cache_image P_ ((struct frame *f, struct image *img));
-static void postprocess_image P_ ((struct frame *, struct image *));
+static struct image *search_image_cache (struct frame *, Lisp_Object, unsigned);
+static void cache_image (struct frame *f, struct image *img);
+static void postprocess_image (struct frame *, struct image *);
/* Return a new, initialized image cache that is allocated from the
heap. Call free_image_cache to free an image cache. */
struct image_cache *
-make_image_cache ()
+make_image_cache (void)
{
struct image_cache *c = (struct image_cache *) xmalloc (sizeof *c);
int size;
- bzero (c, sizeof *c);
+ memset (c, 0, sizeof *c);
c->size = 50;
c->images = (struct image **) xmalloc (c->size * sizeof *c->images);
size = IMAGE_CACHE_BUCKETS_SIZE * sizeof *c->buckets;
c->buckets = (struct image **) xmalloc (size);
- bzero (c->buckets, size);
+ memset (c->buckets, 0, size);
return c;
}
@@ -1498,10 +1438,7 @@ make_image_cache ()
/* Find an image matching SPEC in the cache, and return it. If no
image is found, return NULL. */
static struct image *
-search_image_cache (f, spec, hash)
- struct frame *f;
- Lisp_Object spec;
- unsigned hash;
+search_image_cache (struct frame *f, Lisp_Object spec, unsigned int hash)
{
struct image *img;
struct image_cache *c = FRAME_IMAGE_CACHE (f);
@@ -1534,9 +1471,7 @@ search_image_cache (f, spec, hash)
/* Search frame F for an image with spec SPEC, and free it. */
static void
-uncache_image (f, spec)
- struct frame *f;
- Lisp_Object spec;
+uncache_image (struct frame *f, Lisp_Object spec)
{
struct image *img = search_image_cache (f, spec, sxhash (spec, 0));
if (img)
@@ -1548,8 +1483,7 @@ uncache_image (f, spec)
caches. */
void
-free_image_cache (f)
- struct frame *f;
+free_image_cache (struct frame *f)
{
struct image_cache *c = FRAME_IMAGE_CACHE (f);
if (c)
@@ -1677,8 +1611,7 @@ FILTER nil or a frame means clear all images in the selected frame.
FILTER t means clear the image caches of all frames.
Anything else, means only clear those images which refer to FILTER,
which is then usually a filename. */)
- (filter)
- Lisp_Object filter;
+ (Lisp_Object filter)
{
if (!(EQ (filter, Qnil) || FRAMEP (filter)))
clear_image_caches (filter);
@@ -1698,8 +1631,7 @@ current contents of that file.
FRAME nil or omitted means use the selected frame.
FRAME t means refresh the image on all frames. */)
- (spec, frame)
- Lisp_Object spec, frame;
+ (Lisp_Object spec, Lisp_Object frame)
{
if (!valid_image_p (spec))
error ("Invalid image specification");
@@ -1725,9 +1657,7 @@ FRAME t means refresh the image on all frames. */)
by the image's specification, */
static void
-postprocess_image (f, img)
- struct frame *f;
- struct image *img;
+postprocess_image (struct frame *f, struct image *img)
{
/* Manipulation of the image's mask. */
if (img->pixmap)
@@ -1800,9 +1730,7 @@ postprocess_image (f, img)
SPEC must be a valid Lisp image specification (see valid_image_p). */
int
-lookup_image (f, spec)
- struct frame *f;
- Lisp_Object spec;
+lookup_image (struct frame *f, Lisp_Object spec)
{
struct image_cache *c;
struct image *img;
@@ -1922,9 +1850,7 @@ lookup_image (f, spec)
/* Cache image IMG in the image cache of frame F. */
static void
-cache_image (f, img)
- struct frame *f;
- struct image *img;
+cache_image (struct frame *f, struct image *img)
{
struct image_cache *c = FRAME_IMAGE_CACHE (f);
int i;
@@ -1964,8 +1890,7 @@ cache_image (f, img)
/* Mark Lisp objects in image IMG. */
static void
-mark_image (img)
- struct image *img;
+mark_image (struct image *img)
{
mark_object (img->spec);
mark_object (img->dependencies);
@@ -2033,10 +1958,10 @@ w32_delayed_load (Lisp_Object libraries, Lisp_Object type)
#endif /* HAVE_NTGUI */
-static int x_create_x_image_and_pixmap P_ ((struct frame *, int, int, int,
- XImagePtr *, Pixmap *));
-static void x_destroy_x_image P_ ((XImagePtr));
-static void x_put_x_image P_ ((struct frame *, XImagePtr, Pixmap, int, int));
+static int x_create_x_image_and_pixmap (struct frame *, int, int, int,
+ XImagePtr *, Pixmap *);
+static void x_destroy_x_image (XImagePtr);
+static void x_put_x_image (struct frame *, XImagePtr, Pixmap, int, int);
/* Create an XImage and a pixmap of size WIDTH x HEIGHT for use on
@@ -2049,11 +1974,8 @@ static void x_put_x_image P_ ((struct frame *, XImagePtr, Pixmap, int, int));
should indicate the bit depth of the image. */
static int
-x_create_x_image_and_pixmap (f, width, height, depth, ximg, pixmap)
- struct frame *f;
- int width, height, depth;
- XImagePtr *ximg;
- Pixmap *pixmap;
+x_create_x_image_and_pixmap (struct frame *f, int width, int height, int depth,
+ XImagePtr *ximg, Pixmap *pixmap)
{
#ifdef HAVE_X_WINDOWS
Display *display = FRAME_X_DISPLAY (f);
@@ -2125,8 +2047,8 @@ x_create_x_image_and_pixmap (f, width, height, depth, ximg, pixmap)
return 0;
}
- header = &((*ximg)->info.bmiHeader);
- bzero (&((*ximg)->info), sizeof (BITMAPINFO));
+ header = &(*ximg)->info.bmiHeader;
+ memset (&(*ximg)->info, 0, sizeof (BITMAPINFO));
header->biSize = sizeof (*header);
header->biWidth = width;
header->biHeight = -height; /* negative indicates a top-down bitmap. */
@@ -2176,7 +2098,7 @@ x_create_x_image_and_pixmap (f, width, height, depth, ximg, pixmap)
#endif /* HAVE_NTGUI */
#ifdef HAVE_NS
- *pixmap = ns_image_for_XPM(width, height, depth);
+ *pixmap = ns_image_for_XPM (width, height, depth);
if (*pixmap == 0)
{
*ximg = NULL;
@@ -2192,8 +2114,7 @@ x_create_x_image_and_pixmap (f, width, height, depth, ximg, pixmap)
/* Destroy XImage XIMG. Free XIMG->data. */
static void
-x_destroy_x_image (ximg)
- XImagePtr ximg;
+x_destroy_x_image (XImagePtr ximg)
{
xassert (interrupt_input_blocked);
if (ximg)
@@ -2209,7 +2130,7 @@ x_destroy_x_image (ximg)
xfree (ximg);
#endif /* HAVE_NTGUI */
#ifdef HAVE_NS
- ns_release_object(ximg);
+ ns_release_object (ximg);
#endif /* HAVE_NS */
}
}
@@ -2219,11 +2140,7 @@ x_destroy_x_image (ximg)
are width and height of both the image and pixmap. */
static void
-x_put_x_image (f, ximg, pixmap, width, height)
- struct frame *f;
- XImagePtr ximg;
- Pixmap pixmap;
- int width, height;
+x_put_x_image (struct frame *f, XImagePtr ximg, Pixmap pixmap, int width, int height)
{
#ifdef HAVE_X_WINDOWS
GC gc;
@@ -2244,7 +2161,7 @@ x_put_x_image (f, ximg, pixmap, width, height)
#ifdef HAVE_NS
xassert (ximg == pixmap);
- ns_retain_object(ximg);
+ ns_retain_object (ximg);
#endif
}
@@ -2253,7 +2170,7 @@ x_put_x_image (f, ximg, pixmap, width, height)
File Handling
***********************************************************************/
-static unsigned char *slurp_file P_ ((char *, int *));
+static unsigned char *slurp_file (char *, int *);
/* Find image file FILE. Look in data-directory/images, then
@@ -2261,8 +2178,7 @@ static unsigned char *slurp_file P_ ((char *, int *));
found, or nil if not found. */
Lisp_Object
-x_find_image_file (file)
- Lisp_Object file;
+x_find_image_file (Lisp_Object file)
{
Lisp_Object file_found, search_path;
struct gcpro gcpro1, gcpro2;
@@ -2297,9 +2213,7 @@ x_find_image_file (file)
occurred. *SIZE is set to the size of the file. */
static unsigned char *
-slurp_file (file, size)
- char *file;
- int *size;
+slurp_file (char *file, int *size)
{
FILE *fp = NULL;
unsigned char *buf = NULL;
@@ -2333,15 +2247,15 @@ slurp_file (file, size)
XBM images
***********************************************************************/
-static int xbm_scan P_ ((unsigned char **, unsigned char *, char *, int *));
-static int xbm_load P_ ((struct frame *f, struct image *img));
-static int xbm_load_image P_ ((struct frame *f, struct image *img,
- unsigned char *, unsigned char *));
-static int xbm_image_p P_ ((Lisp_Object object));
-static int xbm_read_bitmap_data P_ ((struct frame *f,
- unsigned char *, unsigned char *,
- int *, int *, unsigned char **, int));
-static int xbm_file_p P_ ((Lisp_Object));
+static int xbm_scan (unsigned char **, unsigned char *, char *, int *);
+static int xbm_load (struct frame *f, struct image *img);
+static int xbm_load_image (struct frame *f, struct image *img,
+ unsigned char *, unsigned char *);
+static int xbm_image_p (Lisp_Object object);
+static int xbm_read_bitmap_data (struct frame *f,
+ unsigned char *, unsigned char *,
+ int *, int *, unsigned char **, int);
+static int xbm_file_p (Lisp_Object);
/* Indices of image specification fields in xbm_format, below. */
@@ -2434,12 +2348,11 @@ enum xbm_token
displayed is used. */
static int
-xbm_image_p (object)
- Lisp_Object object;
+xbm_image_p (Lisp_Object object)
{
struct image_keyword kw[XBM_LAST];
- bcopy (xbm_format, kw, sizeof kw);
+ memcpy (kw, xbm_format, sizeof kw);
if (!parse_image_spec (object, kw, XBM_LAST, Qxbm))
return 0;
@@ -2528,10 +2441,7 @@ xbm_image_p (object)
scanning a number, store its value in *IVAL. */
static int
-xbm_scan (s, end, sval, ival)
- unsigned char **s, *end;
- char *sval;
- int *ival;
+xbm_scan (unsigned char **s, unsigned char *end, char *sval, int *ival)
{
unsigned int c;
@@ -2632,7 +2542,7 @@ w32_create_pixmap_from_bitmap_data (int width, int height, char *data)
w1 = (width + 7) / 8; /* nb of 8bits elt in X bitmap */
w2 = ((width + 15) / 16) * 2; /* nb of 16bits elt in W32 bitmap */
bits = (unsigned char *) alloca (height * w2);
- bzero (bits, height * w2);
+ memset (bits, 0, height * w2);
for (i = 0; i < height; i++)
{
p = bits + i*w2;
@@ -2650,10 +2560,8 @@ w32_create_pixmap_from_bitmap_data (int width, int height, char *data)
}
static void
-convert_mono_to_color_image (f, img, foreground, background)
- struct frame *f;
- struct image *img;
- COLORREF foreground, background;
+convert_mono_to_color_image (struct frame *f, struct image *img,
+ COLORREF foreground, COLORREF background)
{
HDC hdc, old_img_dc, new_img_dc;
HGDIOBJ old_prev, new_prev;
@@ -2695,12 +2603,9 @@ convert_mono_to_color_image (f, img, foreground, background)
static void
-Create_Pixmap_From_Bitmap_Data (f, img, data, fg, bg, non_default_colors)
- struct frame *f;
- struct image *img;
- char *data;
- RGB_PIXEL_COLOR fg, bg;
- int non_default_colors;
+Create_Pixmap_From_Bitmap_Data (struct frame *f, struct image *img, char *data,
+ RGB_PIXEL_COLOR fg, RGB_PIXEL_COLOR bg,
+ int non_default_colors)
{
#ifdef HAVE_NTGUI
img->pixmap
@@ -2711,7 +2616,7 @@ Create_Pixmap_From_Bitmap_Data (f, img, data, fg, bg, non_default_colors)
convert_mono_to_color_image (f, img, fg, bg);
#elif defined (HAVE_NS)
- img->pixmap = ns_image_from_XBM(data, img->width, img->height);
+ img->pixmap = ns_image_from_XBM (data, img->width, img->height);
#else
img->pixmap
@@ -2736,12 +2641,9 @@ Create_Pixmap_From_Bitmap_Data (f, img, data, fg, bg, non_default_colors)
invalid (the bitmap remains unread). */
static int
-xbm_read_bitmap_data (f, contents, end, width, height, data, inhibit_image_error)
- struct frame *f;
- unsigned char *contents, *end;
- int *width, *height;
- unsigned char **data;
- int inhibit_image_error;
+xbm_read_bitmap_data (struct frame *f, unsigned char *contents, unsigned char *end,
+ int *width, int *height, unsigned char **data,
+ int inhibit_image_error)
{
unsigned char *s = contents;
char buffer[BUFSIZ];
@@ -2890,10 +2792,8 @@ xbm_read_bitmap_data (f, contents, end, width, height, data, inhibit_image_error
successful. */
static int
-xbm_load_image (f, img, contents, end)
- struct frame *f;
- struct image *img;
- unsigned char *contents, *end;
+xbm_load_image (struct frame *f, struct image *img, unsigned char *contents,
+ unsigned char *end)
{
int rc;
unsigned char *data;
@@ -2949,8 +2849,7 @@ xbm_load_image (f, img, contents, end)
/* Value is non-zero if DATA looks like an in-memory XBM file. */
static int
-xbm_file_p (data)
- Lisp_Object data;
+xbm_file_p (Lisp_Object data)
{
int w, h;
return (STRINGP (data)
@@ -2964,9 +2863,7 @@ xbm_file_p (data)
non-zero if successful. */
static int
-xbm_load (f, img)
- struct frame *f;
- struct image *img;
+xbm_load (struct frame *f, struct image *img)
{
int success_p = 0;
Lisp_Object file_name;
@@ -3018,7 +2915,7 @@ xbm_load (f, img)
in_memory_file_p = xbm_file_p (data);
/* Parse the image specification. */
- bcopy (xbm_format, fmt, sizeof fmt);
+ memcpy (fmt, xbm_format, sizeof fmt);
parsed_p = parse_image_spec (img->spec, fmt, XBM_LAST, Qxbm);
xassert (parsed_p);
@@ -3064,9 +2961,9 @@ xbm_load (f, img)
{
Lisp_Object line = XVECTOR (data)->contents[i];
if (STRINGP (line))
- bcopy (SDATA (line), p, nbytes);
+ memcpy (p, SDATA (line), nbytes);
else
- bcopy (XBOOL_VECTOR (line)->data, p, nbytes);
+ memcpy (p, XBOOL_VECTOR (line)->data, nbytes);
}
}
else if (STRINGP (data))
@@ -3082,7 +2979,7 @@ xbm_load (f, img)
invertedBits = bits;
nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR
* img->height;
- bits = (char *) alloca(nbytes);
+ bits = (char *) alloca (nbytes);
for (i = 0; i < nbytes; i++)
bits[i] = XBM_BIT_SHUFFLE (invertedBits[i]);
}
@@ -3114,9 +3011,9 @@ xbm_load (f, img)
#if defined (HAVE_XPM) || defined (HAVE_NS)
-static int xpm_image_p P_ ((Lisp_Object object));
-static int xpm_load P_ ((struct frame *f, struct image *img));
-static int xpm_valid_color_symbols_p P_ ((Lisp_Object));
+static int xpm_image_p (Lisp_Object object);
+static int xpm_load (struct frame *f, struct image *img);
+static int xpm_valid_color_symbols_p (Lisp_Object);
#endif /* HAVE_XPM || HAVE_NS */
@@ -3207,12 +3104,12 @@ static struct image_type xpm_type =
#ifdef ALLOC_XPM_COLORS
-static void xpm_init_color_cache P_ ((struct frame *, XpmAttributes *));
-static void xpm_free_color_cache P_ ((void));
-static int xpm_lookup_color P_ ((struct frame *, char *, XColor *));
-static int xpm_color_bucket P_ ((char *));
-static struct xpm_cached_color *xpm_cache_color P_ ((struct frame *, char *,
- XColor *, int));
+static void xpm_init_color_cache (struct frame *, XpmAttributes *);
+static void xpm_free_color_cache (void);
+static int xpm_lookup_color (struct frame *, char *, XColor *);
+static int xpm_color_bucket (char *);
+static struct xpm_cached_color *xpm_cache_color (struct frame *, char *,
+ XColor *, int);
/* An entry in a hash table used to cache color definitions of named
colors. This cache is necessary to speed up XPM image loading in
@@ -3240,9 +3137,7 @@ struct xpm_cached_color **xpm_color_cache;
/* Initialize the color cache. */
static void
-xpm_init_color_cache (f, attrs)
- struct frame *f;
- XpmAttributes *attrs;
+xpm_init_color_cache (struct frame *f, XpmAttributes *attrs)
{
size_t nbytes = XPM_COLOR_CACHE_BUCKETS * sizeof *xpm_color_cache;
xpm_color_cache = (struct xpm_cached_color **) xmalloc (nbytes);
@@ -3268,7 +3163,7 @@ xpm_init_color_cache (f, attrs)
/* Free the color cache. */
static void
-xpm_free_color_cache ()
+xpm_free_color_cache (void)
{
struct xpm_cached_color *p, *next;
int i;
@@ -3289,8 +3184,7 @@ xpm_free_color_cache ()
cache. */
static int
-xpm_color_bucket (color_name)
- char *color_name;
+xpm_color_bucket (char *color_name)
{
unsigned h = 0;
char *s;
@@ -3306,11 +3200,7 @@ xpm_color_bucket (color_name)
entry added. */
static struct xpm_cached_color *
-xpm_cache_color (f, color_name, color, bucket)
- struct frame *f;
- char *color_name;
- XColor *color;
- int bucket;
+xpm_cache_color (struct frame *f, char *color_name, XColor *color, int bucket)
{
size_t nbytes;
struct xpm_cached_color *p;
@@ -3333,10 +3223,7 @@ xpm_cache_color (f, color_name, color, bucket)
allocation failed. */
static int
-xpm_lookup_color (f, color_name, color)
- struct frame *f;
- char *color_name;
- XColor *color;
+xpm_lookup_color (struct frame *f, char *color_name, XColor *color)
{
struct xpm_cached_color *p;
int h = xpm_color_bucket (color_name);
@@ -3358,7 +3245,7 @@ xpm_lookup_color (f, color_name, color)
with transparency, and it's useful. */
else if (strcmp ("opaque", color_name) == 0)
{
- bzero (color, sizeof (XColor)); /* Is this necessary/correct? */
+ memset (color, 0, sizeof (XColor)); /* Is this necessary/correct? */
color->pixel = FRAME_FOREGROUND_PIXEL (f);
p = xpm_cache_color (f, color_name, color, h);
}
@@ -3373,12 +3260,8 @@ xpm_lookup_color (f, color_name, color)
if successful. */
static int
-xpm_alloc_color (dpy, cmap, color_name, color, closure)
- Display *dpy;
- Colormap cmap;
- char *color_name;
- XColor *color;
- void *closure;
+xpm_alloc_color (Display *dpy, Colormap cmap, char *color_name, XColor *color,
+ void *closure)
{
return xpm_lookup_color ((struct frame *) closure, color_name, color);
}
@@ -3389,12 +3272,7 @@ xpm_alloc_color (dpy, cmap, color_name, color, closure)
non-zero if successful. */
static int
-xpm_free_colors (dpy, cmap, pixels, npixels, closure)
- Display *dpy;
- Colormap cmap;
- Pixel *pixels;
- int npixels;
- void *closure;
+xpm_free_colors (Display *dpy, Colormap cmap, Pixel *pixels, int npixels, void *closure)
{
return 1;
}
@@ -3434,8 +3312,7 @@ init_xpm_functions (Lisp_Object libraries)
cdr are strings. */
static int
-xpm_valid_color_symbols_p (color_symbols)
- Lisp_Object color_symbols;
+xpm_valid_color_symbols_p (Lisp_Object color_symbols)
{
while (CONSP (color_symbols))
{
@@ -3454,11 +3331,10 @@ xpm_valid_color_symbols_p (color_symbols)
/* Value is non-zero if OBJECT is a valid XPM image specification. */
static int
-xpm_image_p (object)
- Lisp_Object object;
+xpm_image_p (Lisp_Object object)
{
struct image_keyword fmt[XPM_LAST];
- bcopy (xpm_format, fmt, sizeof fmt);
+ memcpy (fmt, xpm_format, sizeof fmt);
return (parse_image_spec (object, fmt, XPM_LAST, Qxpm)
/* Either `:file' or `:data' must be present. */
&& fmt[XPM_FILE].count + fmt[XPM_DATA].count == 1
@@ -3472,16 +3348,14 @@ xpm_image_p (object)
#if defined (HAVE_XPM) && defined (HAVE_X_WINDOWS)
int
-x_create_bitmap_from_xpm_data (f, bits)
- struct frame *f;
- char **bits;
+x_create_bitmap_from_xpm_data (struct frame *f, char **bits)
{
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
int id, rc;
XpmAttributes attrs;
Pixmap bitmap, mask;
- bzero (&attrs, sizeof attrs);
+ memset (&attrs, 0, sizeof attrs);
attrs.visual = FRAME_X_VISUAL (f);
attrs.colormap = FRAME_X_COLORMAP (f);
@@ -3517,9 +3391,7 @@ x_create_bitmap_from_xpm_data (f, bits)
#ifdef HAVE_XPM
static int
-xpm_load (f, img)
- struct frame *f;
- struct image *img;
+xpm_load (struct frame *f, struct image *img)
{
int rc;
XpmAttributes attrs;
@@ -3531,7 +3403,7 @@ xpm_load (f, img)
/* Configure the XPM lib. Use the visual of frame F. Allocate
close colors. Return colors allocated. */
- bzero (&attrs, sizeof attrs);
+ memset (&attrs, 0, sizeof attrs);
#ifndef HAVE_NTGUI
attrs.visual = FRAME_X_VISUAL (f);
@@ -3578,7 +3450,7 @@ xpm_load (f, img)
/* Allocate an XpmColorSymbol array. */
size = attrs.numsymbols * sizeof *xpm_syms;
xpm_syms = (XpmColorSymbol *) alloca (size);
- bzero (xpm_syms, size);
+ memset (xpm_syms, 0, size);
attrs.colorsymbols = xpm_syms;
/* Fill the color symbol array. */
@@ -3752,25 +3624,25 @@ xpm_load (f, img)
/* XPM support functions for NS where libxpm is not available.
Only XPM version 3 (without any extensions) is supported. */
-static int xpm_scan P_ ((const unsigned char **, const unsigned char *,
- const unsigned char **, int *));
+static int xpm_scan (const unsigned char **, const unsigned char *,
+ const unsigned char **, int *);
static Lisp_Object xpm_make_color_table_v
- P_ ((void (**) (Lisp_Object, const unsigned char *, int, Lisp_Object),
- Lisp_Object (**) (Lisp_Object, const unsigned char *, int)));
-static void xpm_put_color_table_v P_ ((Lisp_Object, const unsigned char *,
- int, Lisp_Object));
-static Lisp_Object xpm_get_color_table_v P_ ((Lisp_Object,
- const unsigned char *, int));
+ (void (**) (Lisp_Object, const unsigned char *, int, Lisp_Object),
+ Lisp_Object (**) (Lisp_Object, const unsigned char *, int));
+static void xpm_put_color_table_v (Lisp_Object, const unsigned char *,
+ int, Lisp_Object);
+static Lisp_Object xpm_get_color_table_v (Lisp_Object,
+ const unsigned char *, int);
static Lisp_Object xpm_make_color_table_h
- P_ ((void (**) (Lisp_Object, const unsigned char *, int, Lisp_Object),
- Lisp_Object (**) (Lisp_Object, const unsigned char *, int)));
-static void xpm_put_color_table_h P_ ((Lisp_Object, const unsigned char *,
- int, Lisp_Object));
-static Lisp_Object xpm_get_color_table_h P_ ((Lisp_Object,
- const unsigned char *, int));
-static int xpm_str_to_color_key P_ ((const char *));
-static int xpm_load_image P_ ((struct frame *, struct image *,
- const unsigned char *, const unsigned char *));
+ (void (**) (Lisp_Object, const unsigned char *, int, Lisp_Object),
+ Lisp_Object (**) (Lisp_Object, const unsigned char *, int));
+static void xpm_put_color_table_h (Lisp_Object, const unsigned char *,
+ int, Lisp_Object);
+static Lisp_Object xpm_get_color_table_h (Lisp_Object,
+ const unsigned char *, int);
+static int xpm_str_to_color_key (const char *);
+static int xpm_load_image (struct frame *, struct image *,
+ const unsigned char *, const unsigned char *);
/* Tokens returned from xpm_scan. */
@@ -3984,7 +3856,7 @@ xpm_load_image (f, img, contents, end)
if (!(end - s >= 9 && memcmp (s, "/* XPM */", 9) == 0))
goto failure;
s += 9;
- match();
+ match ();
expect_ident ("static");
expect_ident ("char");
expect ('*');
@@ -4134,8 +4006,8 @@ xpm_load_image (f, img, contents, end)
(!EQ (color_val, Qt) ? PIX_MASK_DRAW
: (have_mask = 1, PIX_MASK_RETAIN)));
#else
- if (EQ(color_val, Qt))
- ns_set_alpha(ximg, x, y, 0);
+ if (EQ (color_val, Qt))
+ ns_set_alpha (ximg, x, y, 0);
#endif
}
if (y + 1 < height)
@@ -4273,11 +4145,11 @@ int ct_colors_allocated;
/* Initialize the color table. */
static void
-init_color_table ()
+init_color_table (void)
{
int size = CT_SIZE * sizeof (*ct_table);
ct_table = (struct ct_color **) xmalloc (size);
- bzero (ct_table, size);
+ memset (ct_table, 0, size);
ct_colors_allocated = 0;
}
@@ -4285,7 +4157,7 @@ init_color_table ()
/* Free memory associated with the color table. */
static void
-free_color_table ()
+free_color_table (void)
{
int i;
struct ct_color *p, *next;
@@ -4308,9 +4180,7 @@ free_color_table ()
G, B, and make an entry in the color table. */
static unsigned long
-lookup_rgb_color (f, r, g, b)
- struct frame *f;
- int r, g, b;
+lookup_rgb_color (struct frame *f, int r, int g, int b)
{
unsigned hash = CT_HASH_RGB (r, g, b);
int i = hash % CT_SIZE;
@@ -4405,9 +4275,7 @@ lookup_rgb_color (f, r, g, b)
table. If not already present, allocate it. Value is PIXEL. */
static unsigned long
-lookup_pixel_color (f, pixel)
- struct frame *f;
- unsigned long pixel;
+lookup_pixel_color (struct frame *f, unsigned long pixel)
{
int i = pixel % CT_SIZE;
struct ct_color *p;
@@ -4459,8 +4327,7 @@ lookup_pixel_color (f, pixel)
allocated via xmalloc. Set *N to the number of colors. */
static unsigned long *
-colors_in_color_table (n)
- int *n;
+colors_in_color_table (int *n)
{
int i, j;
struct ct_color *p;
@@ -4488,9 +4355,7 @@ colors_in_color_table (n)
#else /* COLOR_TABLE_SUPPORT */
static unsigned long
-lookup_rgb_color (f, r, g, b)
- struct frame *f;
- int r, g, b;
+lookup_rgb_color (struct frame *f, int r, int g, int b)
{
unsigned long pixel;
@@ -4505,7 +4370,7 @@ lookup_rgb_color (f, r, g, b)
}
static void
-init_color_table ()
+init_color_table (void)
{
}
#endif /* COLOR_TABLE_SUPPORT */
@@ -4515,9 +4380,9 @@ init_color_table ()
Algorithms
***********************************************************************/
-static XColor *x_to_xcolors P_ ((struct frame *, struct image *, int));
-static void x_from_xcolors P_ ((struct frame *, struct image *, XColor *));
-static void x_detect_edges P_ ((struct frame *, struct image *, int[9], int));
+static XColor *x_to_xcolors (struct frame *, struct image *, int);
+static void x_from_xcolors (struct frame *, struct image *, XColor *);
+static void x_detect_edges (struct frame *, struct image *, int[9], int);
#ifdef HAVE_NTGUI
static void XPutPixel (XImagePtr , int, int, COLORREF);
@@ -4558,10 +4423,7 @@ static int laplace_matrix[9] = {
allocated with xmalloc; it must be freed by the caller. */
static XColor *
-x_to_xcolors (f, img, rgb_p)
- struct frame *f;
- struct image *img;
- int rgb_p;
+x_to_xcolors (struct frame *f, struct image *img, int rgb_p)
{
int x, y;
XColor *colors, *p;
@@ -4626,10 +4488,7 @@ x_to_xcolors (f, img, rgb_p)
stored in ximg->data. */
static void
-XPutPixel (ximg, x, y, color)
- XImagePtr ximg;
- int x, y;
- COLORREF color;
+XPutPixel (XImagePtr ximg, int x, int y, COLORREF color)
{
int width = ximg->info.bmiHeader.biWidth;
int height = ximg->info.bmiHeader.biHeight;
@@ -4674,10 +4533,7 @@ XPutPixel (ximg, x, y, color)
COLORS will be freed; an existing IMG->pixmap will be freed, too. */
static void
-x_from_xcolors (f, img, colors)
- struct frame *f;
- struct image *img;
- XColor *colors;
+x_from_xcolors (struct frame *f, struct image *img, XColor *colors)
{
int x, y;
XImagePtr oimg = NULL;
@@ -4719,10 +4575,7 @@ x_from_xcolors (f, img, colors)
outgoing image. */
static void
-x_detect_edges (f, img, matrix, color_adjust)
- struct frame *f;
- struct image *img;
- int matrix[9], color_adjust;
+x_detect_edges (struct frame *f, struct image *img, int *matrix, int color_adjust)
{
XColor *colors = x_to_xcolors (f, img, 1);
XColor *new, *p;
@@ -4788,9 +4641,7 @@ x_detect_edges (f, img, matrix, color_adjust)
on frame F. */
static void
-x_emboss (f, img)
- struct frame *f;
- struct image *img;
+x_emboss (struct frame *f, struct image *img)
{
x_detect_edges (f, img, emboss_matrix, 0xffff / 2);
}
@@ -4801,9 +4652,7 @@ x_emboss (f, img)
to draw disabled buttons, for example. */
static void
-x_laplace (f, img)
- struct frame *f;
- struct image *img;
+x_laplace (struct frame *f, struct image *img)
{
x_detect_edges (f, img, laplace_matrix, 45000);
}
@@ -4821,10 +4670,8 @@ x_laplace (f, img)
number. */
static void
-x_edge_detection (f, img, matrix, color_adjust)
- struct frame *f;
- struct image *img;
- Lisp_Object matrix, color_adjust;
+x_edge_detection (struct frame *f, struct image *img, Lisp_Object matrix,
+ Lisp_Object color_adjust)
{
int i = 0;
int trans[9];
@@ -4853,9 +4700,7 @@ x_edge_detection (f, img, matrix, color_adjust)
/* Transform image IMG on frame F so that it looks disabled. */
static void
-x_disable_image (f, img)
- struct frame *f;
- struct image *img;
+x_disable_image (struct frame *f, struct image *img)
{
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
#ifdef HAVE_NTGUI
@@ -4957,10 +4802,7 @@ x_disable_image (f, img)
heuristically. Value is non-zero if successful. */
static int
-x_build_heuristic_mask (f, img, how)
- struct frame *f;
- struct image *img;
- Lisp_Object how;
+x_build_heuristic_mask (struct frame *f, struct image *img, Lisp_Object how)
{
XImagePtr_or_DC ximg;
#ifndef HAVE_NTGUI
@@ -4998,7 +4840,7 @@ x_build_heuristic_mask (f, img, how)
/* Create the bit array serving as mask. */
row_width = (img->width + 7) / 8;
mask_img = xmalloc (row_width * img->height);
- bzero (mask_img, row_width * img->height);
+ memset (mask_img, 0, row_width * img->height);
/* Create a memory device context for IMG->pixmap. */
frame_dc = get_frame_dc (f);
@@ -5047,7 +4889,7 @@ x_build_heuristic_mask (f, img, how)
? PIX_MASK_DRAW : PIX_MASK_RETAIN));
#else
if (XGetPixel (ximg, x, y) == bg)
- ns_set_alpha(ximg, x, y, 0);
+ ns_set_alpha (ximg, x, y, 0);
#endif /* HAVE_NS */
#ifndef HAVE_NS
/* Fill in the background_transparent field while we have the mask handy. */
@@ -5087,9 +4929,9 @@ x_build_heuristic_mask (f, img, how)
PBM (mono, gray, color)
***********************************************************************/
-static int pbm_image_p P_ ((Lisp_Object object));
-static int pbm_load P_ ((struct frame *f, struct image *img));
-static int pbm_scan_number P_ ((unsigned char **, unsigned char *));
+static int pbm_image_p (Lisp_Object object);
+static int pbm_load (struct frame *f, struct image *img);
+static int pbm_scan_number (unsigned char **, unsigned char *);
/* The symbol `pbm' identifying images of this type. */
@@ -5146,12 +4988,11 @@ static struct image_type pbm_type =
/* Return non-zero if OBJECT is a valid PBM image specification. */
static int
-pbm_image_p (object)
- Lisp_Object object;
+pbm_image_p (Lisp_Object object)
{
struct image_keyword fmt[PBM_LAST];
- bcopy (pbm_format, fmt, sizeof fmt);
+ memcpy (fmt, pbm_format, sizeof fmt);
if (!parse_image_spec (object, fmt, PBM_LAST, Qpbm))
return 0;
@@ -5166,8 +5007,7 @@ pbm_image_p (object)
end of input. */
static int
-pbm_scan_number (s, end)
- unsigned char **s, *end;
+pbm_scan_number (unsigned char **s, unsigned char *end)
{
int c = 0, val = -1;
@@ -5242,9 +5082,7 @@ pbm_read_file (file, size)
/* Load PBM image IMG for use on frame F. */
static int
-pbm_load (f, img)
- struct frame *f;
- struct image *img;
+pbm_load (struct frame *f, struct image *img)
{
int raw_p, x, y;
int width, height, max_color_idx = 0;
@@ -5366,7 +5204,7 @@ pbm_load (f, img)
unsigned long bg = FRAME_BACKGROUND_PIXEL (f);
/* Parse the image specification. */
- bcopy (pbm_format, fmt, sizeof fmt);
+ memcpy (fmt, pbm_format, sizeof fmt);
parse_image_spec (img->spec, fmt, PBM_LAST, Qpbm);
/* Get foreground and background colors, maybe allocate colors. */
@@ -5511,8 +5349,8 @@ pbm_load (f, img)
/* Function prototypes. */
-static int png_image_p P_ ((Lisp_Object object));
-static int png_load P_ ((struct frame *f, struct image *img));
+static int png_image_p (Lisp_Object object);
+static int png_load (struct frame *f, struct image *img);
/* The symbol `png' identifying images of this type. */
@@ -5566,11 +5404,10 @@ static struct image_type png_type =
/* Return non-zero if OBJECT is a valid PNG image specification. */
static int
-png_image_p (object)
- Lisp_Object object;
+png_image_p (Lisp_Object object)
{
struct image_keyword fmt[PNG_LAST];
- bcopy (png_format, fmt, sizeof fmt);
+ memcpy (fmt, png_format, sizeof fmt);
if (!parse_image_spec (object, fmt, PNG_LAST, Qpng))
return 0;
@@ -5671,9 +5508,7 @@ init_png_functions (Lisp_Object libraries)
is initialized. */
static void
-my_png_error (png_ptr, msg)
- png_struct *png_ptr;
- char *msg;
+my_png_error (png_struct *png_ptr, const char *msg)
{
xassert (png_ptr != NULL);
image_error ("PNG error: %s", build_string (msg), Qnil);
@@ -5682,9 +5517,7 @@ my_png_error (png_ptr, msg)
static void
-my_png_warning (png_ptr, msg)
- png_struct *png_ptr;
- char *msg;
+my_png_warning (png_struct *png_ptr, const char *msg)
{
xassert (png_ptr != NULL);
image_error ("PNG warning: %s", build_string (msg), Qnil);
@@ -5705,10 +5538,7 @@ struct png_memory_storage
bytes from the input to DATA. */
static void
-png_read_from_memory (png_ptr, data, length)
- png_structp png_ptr;
- png_bytep data;
- png_size_t length;
+png_read_from_memory (png_structp png_ptr, png_bytep data, png_size_t length)
{
struct png_memory_storage *tbr
= (struct png_memory_storage *) fn_png_get_io_ptr (png_ptr);
@@ -5716,7 +5546,7 @@ png_read_from_memory (png_ptr, data, length)
if (length > tbr->len - tbr->index)
fn_png_error (png_ptr, "Read error");
- bcopy (tbr->bytes + tbr->index, data, length);
+ memcpy (data, tbr->bytes + tbr->index, length);
tbr->index = tbr->index + length;
}
@@ -5726,10 +5556,7 @@ png_read_from_memory (png_ptr, data, length)
bytes from the input to DATA. */
static void
-png_read_from_file (png_ptr, data, length)
- png_structp png_ptr;
- png_bytep data;
- png_size_t length;
+png_read_from_file (png_structp png_ptr, png_bytep data, png_size_t length)
{
FILE *fp = (FILE *) fn_png_get_io_ptr (png_ptr);
@@ -5742,9 +5569,7 @@ png_read_from_file (png_ptr, data, length)
successful. */
static int
-png_load (f, img)
- struct frame *f;
- struct image *img;
+png_load (struct frame *f, struct image *img)
{
Lisp_Object file, specified_file;
Lisp_Object specified_data;
@@ -5923,7 +5748,7 @@ png_load (f, img)
{
png_color_16 user_bg;
- bzero (&user_bg, sizeof user_bg);
+ memset (&user_bg, 0, sizeof user_bg);
user_bg.red = color.red >> shift;
user_bg.green = color.green >> shift;
user_bg.blue = color.blue >> shift;
@@ -5943,7 +5768,7 @@ png_load (f, img)
color.pixel = FRAME_BACKGROUND_PIXEL (f);
x_query_color (f, &color);
- bzero (&frame_background, sizeof frame_background);
+ memset (&frame_background, 0, sizeof frame_background);
frame_background.red = color.red >> shift;
frame_background.green = color.green >> shift;
frame_background.blue = color.blue >> shift;
@@ -6113,8 +5938,8 @@ png_load (struct frame *f, struct image *img)
#if defined (HAVE_JPEG) || defined (HAVE_NS)
-static int jpeg_image_p P_ ((Lisp_Object object));
-static int jpeg_load P_ ((struct frame *f, struct image *img));
+static int jpeg_image_p (Lisp_Object object);
+static int jpeg_load (struct frame *f, struct image *img);
/* The symbol `jpeg' identifying images of this type. */
@@ -6168,12 +5993,11 @@ static struct image_type jpeg_type =
/* Return non-zero if OBJECT is a valid JPEG image specification. */
static int
-jpeg_image_p (object)
- Lisp_Object object;
+jpeg_image_p (Lisp_Object object)
{
struct image_keyword fmt[JPEG_LAST];
- bcopy (jpeg_format, fmt, sizeof fmt);
+ memcpy (fmt, jpeg_format, sizeof fmt);
if (!parse_image_spec (object, fmt, JPEG_LAST, Qjpeg))
return 0;
@@ -6240,9 +6064,7 @@ init_jpeg_functions (Lisp_Object libraries)
/* Wrapper since we can't directly assign the function pointer
to another function pointer that was declared more completely easily. */
static boolean
-jpeg_resync_to_restart_wrapper (cinfo, desired)
- j_decompress_ptr cinfo;
- int desired;
+jpeg_resync_to_restart_wrapper (j_decompress_ptr cinfo, int desired)
{
return fn_jpeg_resync_to_restart (cinfo, desired);
}
@@ -6268,8 +6090,7 @@ struct my_jpeg_error_mgr
static void
-my_error_exit (cinfo)
- j_common_ptr cinfo;
+my_error_exit (j_common_ptr cinfo)
{
struct my_jpeg_error_mgr *mgr = (struct my_jpeg_error_mgr *) cinfo->err;
longjmp (mgr->setjmp_buffer, 1);
@@ -6281,8 +6102,7 @@ my_error_exit (cinfo)
libjpeg.doc from the JPEG lib distribution. */
static void
-our_common_init_source (cinfo)
- j_decompress_ptr cinfo;
+our_common_init_source (j_decompress_ptr cinfo)
{
}
@@ -6291,8 +6111,7 @@ our_common_init_source (cinfo)
jpeg_finish_decompress() after all data has been processed. */
static void
-our_common_term_source (cinfo)
- j_decompress_ptr cinfo;
+our_common_term_source (j_decompress_ptr cinfo)
{
}
@@ -6304,8 +6123,7 @@ our_common_term_source (cinfo)
static JOCTET our_memory_buffer[2];
static boolean
-our_memory_fill_input_buffer (cinfo)
- j_decompress_ptr cinfo;
+our_memory_fill_input_buffer (j_decompress_ptr cinfo)
{
/* Insert a fake EOI marker. */
struct jpeg_source_mgr *src = cinfo->src;
@@ -6323,9 +6141,7 @@ our_memory_fill_input_buffer (cinfo)
is the JPEG data source manager. */
static void
-our_memory_skip_input_data (cinfo, num_bytes)
- j_decompress_ptr cinfo;
- long num_bytes;
+our_memory_skip_input_data (j_decompress_ptr cinfo, long int num_bytes)
{
struct jpeg_source_mgr *src = (struct jpeg_source_mgr *) cinfo->src;
@@ -6345,10 +6161,7 @@ our_memory_skip_input_data (cinfo, num_bytes)
reading the image. */
static void
-jpeg_memory_src (cinfo, data, len)
- j_decompress_ptr cinfo;
- JOCTET *data;
- unsigned int len;
+jpeg_memory_src (j_decompress_ptr cinfo, JOCTET *data, unsigned int len)
{
struct jpeg_source_mgr *src;
@@ -6391,8 +6204,7 @@ struct jpeg_stdio_mgr
whenever more data is needed. The data is read from a FILE *. */
static boolean
-our_stdio_fill_input_buffer (cinfo)
- j_decompress_ptr cinfo;
+our_stdio_fill_input_buffer (j_decompress_ptr cinfo)
{
struct jpeg_stdio_mgr *src;
@@ -6423,9 +6235,7 @@ our_stdio_fill_input_buffer (cinfo)
is the JPEG data source manager. */
static void
-our_stdio_skip_input_data (cinfo, num_bytes)
- j_decompress_ptr cinfo;
- long num_bytes;
+our_stdio_skip_input_data (j_decompress_ptr cinfo, long int num_bytes)
{
struct jpeg_stdio_mgr *src;
src = (struct jpeg_stdio_mgr *) cinfo->src;
@@ -6455,9 +6265,7 @@ our_stdio_skip_input_data (cinfo, num_bytes)
reading the image. */
static void
-jpeg_file_src (cinfo, fp)
- j_decompress_ptr cinfo;
- FILE *fp;
+jpeg_file_src (j_decompress_ptr cinfo, FILE *fp)
{
struct jpeg_stdio_mgr *src;
@@ -6491,9 +6299,7 @@ jpeg_file_src (cinfo, fp)
from the JPEG lib. */
static int
-jpeg_load (f, img)
- struct frame *f;
- struct image *img;
+jpeg_load (struct frame *f, struct image *img)
{
struct jpeg_decompress_struct cinfo;
struct my_jpeg_error_mgr mgr;
@@ -6669,9 +6475,9 @@ jpeg_load (f, img)
static int
jpeg_load (struct frame *f, struct image *img)
{
- return ns_load_image(f, img,
- image_spec_value (img->spec, QCfile, NULL),
- image_spec_value (img->spec, QCdata, NULL));
+ return ns_load_image (f, img,
+ image_spec_value (img->spec, QCfile, NULL),
+ image_spec_value (img->spec, QCdata, NULL));
}
#endif /* HAVE_NS */
@@ -6685,8 +6491,8 @@ jpeg_load (struct frame *f, struct image *img)
#if defined (HAVE_TIFF) || defined (HAVE_NS)
-static int tiff_image_p P_ ((Lisp_Object object));
-static int tiff_load P_ ((struct frame *f, struct image *img));
+static int tiff_image_p (Lisp_Object object);
+static int tiff_load (struct frame *f, struct image *img);
/* The symbol `tiff' identifying images of this type. */
@@ -6742,11 +6548,10 @@ static struct image_type tiff_type =
/* Return non-zero if OBJECT is a valid TIFF image specification. */
static int
-tiff_image_p (object)
- Lisp_Object object;
+tiff_image_p (Lisp_Object object)
{
struct image_keyword fmt[TIFF_LAST];
- bcopy (tiff_format, fmt, sizeof fmt);
+ memcpy (fmt, tiff_format, sizeof fmt);
if (!parse_image_spec (object, fmt, TIFF_LAST, Qtiff))
return 0;
@@ -6823,34 +6628,25 @@ typedef struct
tiff_memory_source;
static size_t
-tiff_read_from_memory (data, buf, size)
- thandle_t data;
- tdata_t buf;
- tsize_t size;
+tiff_read_from_memory (thandle_t data, tdata_t buf, tsize_t size)
{
tiff_memory_source *src = (tiff_memory_source *) data;
if (size > src->len - src->index)
return (size_t) -1;
- bcopy (src->bytes + src->index, buf, size);
+ memcpy (buf, src->bytes + src->index, size);
src->index += size;
return size;
}
static size_t
-tiff_write_from_memory (data, buf, size)
- thandle_t data;
- tdata_t buf;
- tsize_t size;
+tiff_write_from_memory (thandle_t data, tdata_t buf, tsize_t size)
{
return (size_t) -1;
}
static toff_t
-tiff_seek_in_memory (data, off, whence)
- thandle_t data;
- toff_t off;
- int whence;
+tiff_seek_in_memory (thandle_t data, toff_t off, int whence)
{
tiff_memory_source *src = (tiff_memory_source *) data;
int idx;
@@ -6881,44 +6677,34 @@ tiff_seek_in_memory (data, off, whence)
}
static int
-tiff_close_memory (data)
- thandle_t data;
+tiff_close_memory (thandle_t data)
{
/* NOOP */
return 0;
}
static int
-tiff_mmap_memory (data, pbase, psize)
- thandle_t data;
- tdata_t *pbase;
- toff_t *psize;
+tiff_mmap_memory (thandle_t data, tdata_t *pbase, toff_t *psize)
{
/* It is already _IN_ memory. */
return 0;
}
static void
-tiff_unmap_memory (data, base, size)
- thandle_t data;
- tdata_t base;
- toff_t size;
+tiff_unmap_memory (thandle_t data, tdata_t base, toff_t size)
{
/* We don't need to do this. */
}
static toff_t
-tiff_size_of_memory (data)
- thandle_t data;
+tiff_size_of_memory (thandle_t data)
{
return ((tiff_memory_source *) data)->len;
}
static void
-tiff_error_handler (title, format, ap)
- const char *title, *format;
- va_list ap;
+tiff_error_handler (const char *title, const char *format, va_list ap)
{
char buf[512];
int len;
@@ -6930,9 +6716,7 @@ tiff_error_handler (title, format, ap)
static void
-tiff_warning_handler (title, format, ap)
- const char *title, *format;
- va_list ap;
+tiff_warning_handler (const char *title, const char *format, va_list ap)
{
char buf[512];
int len;
@@ -6947,9 +6731,7 @@ tiff_warning_handler (title, format, ap)
successful. */
static int
-tiff_load (f, img)
- struct frame *f;
- struct image *img;
+tiff_load (struct frame *f, struct image *img)
{
Lisp_Object file, specified_file;
Lisp_Object specified_data;
@@ -7120,9 +6902,9 @@ tiff_load (f, img)
static int
tiff_load (struct frame *f, struct image *img)
{
- return ns_load_image(f, img,
- image_spec_value (img->spec, QCfile, NULL),
- image_spec_value (img->spec, QCdata, NULL));
+ return ns_load_image (f, img,
+ image_spec_value (img->spec, QCfile, NULL),
+ image_spec_value (img->spec, QCdata, NULL));
}
#endif /* HAVE_NS */
@@ -7136,9 +6918,9 @@ tiff_load (struct frame *f, struct image *img)
#if defined (HAVE_GIF) || defined (HAVE_NS)
-static int gif_image_p P_ ((Lisp_Object object));
-static int gif_load P_ ((struct frame *f, struct image *img));
-static void gif_clear_image P_ ((struct frame *f, struct image *img));
+static int gif_image_p (Lisp_Object object);
+static int gif_load (struct frame *f, struct image *img);
+static void gif_clear_image (struct frame *f, struct image *img);
/* The symbol `gif' identifying images of this type. */
@@ -7194,9 +6976,7 @@ static struct image_type gif_type =
/* Free X resources of GIF image IMG which is used on frame F. */
static void
-gif_clear_image (f, img)
- struct frame *f;
- struct image *img;
+gif_clear_image (struct frame *f, struct image *img)
{
/* IMG->data.ptr_val may contain metadata with extension data. */
img->data.lisp_val = Qnil;
@@ -7206,11 +6986,10 @@ gif_clear_image (f, img)
/* Return non-zero if OBJECT is a valid GIF image specification. */
static int
-gif_image_p (object)
- Lisp_Object object;
+gif_image_p (Lisp_Object object)
{
struct image_keyword fmt[GIF_LAST];
- bcopy (gif_format, fmt, sizeof fmt);
+ memcpy (fmt, gif_format, sizeof fmt);
if (!parse_image_spec (object, fmt, GIF_LAST, Qgif))
return 0;
@@ -7290,17 +7069,14 @@ gif_memory_source;
static gif_memory_source *current_gif_memory_src;
static int
-gif_read_from_memory (file, buf, len)
- GifFileType *file;
- GifByteType *buf;
- int len;
+gif_read_from_memory (GifFileType *file, GifByteType *buf, int len)
{
gif_memory_source *src = current_gif_memory_src;
if (len > src->len - src->index)
return -1;
- bcopy (src->bytes + src->index, buf, len);
+ memcpy (buf, src->bytes + src->index, len);
src->index += len;
return len;
}
@@ -7313,9 +7089,7 @@ static const int interlace_start[] = {0, 4, 2, 1};
static const int interlace_increment[] = {8, 8, 4, 2};
static int
-gif_load (f, img)
- struct frame *f;
- struct image *img;
+gif_load (struct frame *f, struct image *img)
{
Lisp_Object file, specified_file;
Lisp_Object specified_data;
@@ -7438,7 +7212,7 @@ gif_load (f, img)
if (!gif_color_map)
gif_color_map = gif->SColorMap;
init_color_table ();
- bzero (pixel_colors, sizeof pixel_colors);
+ memset (pixel_colors, 0, sizeof pixel_colors);
if (gif_color_map)
for (i = 0; i < gif_color_map->ColorCount; ++i)
@@ -7558,9 +7332,9 @@ gif_load (f, img)
static int
gif_load (struct frame *f, struct image *img)
{
- return ns_load_image(f, img,
- image_spec_value (img->spec, QCfile, NULL),
- image_spec_value (img->spec, QCdata, NULL));
+ return ns_load_image (f, img,
+ image_spec_value (img->spec, QCfile, NULL),
+ image_spec_value (img->spec, QCdata, NULL));
}
#endif /* HAVE_NS */
@@ -7576,11 +7350,11 @@ gif_load (struct frame *f, struct image *img)
/* Function prototypes. */
-static int svg_image_p P_ ((Lisp_Object object));
-static int svg_load P_ ((struct frame *f, struct image *img));
+static int svg_image_p (Lisp_Object object);
+static int svg_load (struct frame *f, struct image *img);
-static int svg_load_image P_ ((struct frame *, struct image *,
- unsigned char *, unsigned int));
+static int svg_load_image (struct frame *, struct image *,
+ unsigned char *, unsigned int);
/* The symbol `svg' identifying images of this type. */
@@ -7645,11 +7419,10 @@ static struct image_type svg_type =
identify the SVG format. */
static int
-svg_image_p (object)
- Lisp_Object object;
+svg_image_p (Lisp_Object object)
{
struct image_keyword fmt[SVG_LAST];
- bcopy (svg_format, fmt, sizeof fmt);
+ memcpy (fmt, svg_format, sizeof fmt);
if (!parse_image_spec (object, fmt, SVG_LAST, Qsvg))
return 0;
@@ -7748,9 +7521,7 @@ init_svg_functions (Lisp_Object libraries)
the prototype thus needs to be compatible with that structure. */
static int
-svg_load (f, img)
- struct frame *f;
- struct image *img;
+svg_load (struct frame *f, struct image *img)
{
int success_p = 0;
Lisp_Object file_name;
@@ -7807,15 +7578,10 @@ svg_load (f, img)
Returns non-zero when successful. */
static int
-svg_load_image (f, img, contents, size)
- /* Pointer to emacs frame structure. */
- struct frame *f;
- /* Pointer to emacs image structure. */
- struct image *img;
- /* String containing the SVG XML data to be parsed. */
- unsigned char *contents;
- /* Size of data in bytes. */
- unsigned int size;
+svg_load_image (struct frame *f, /* Pointer to emacs frame structure. */
+ struct image *img, /* Pointer to emacs image structure. */
+ unsigned char *contents, /* String containing the SVG XML data to be parsed. */
+ unsigned int size) /* Size of data in bytes. */
{
RsvgHandle *rsvg_handle;
RsvgDimensionData dimension_data;
@@ -7890,7 +7656,7 @@ svg_load_image (f, img, contents, size)
background.pixel = FRAME_BACKGROUND_PIXEL (f);
x_query_color (f, &background);
#else
- ns_query_color(FRAME_BACKGROUND_COLOR (f), &background, 1);
+ ns_query_color (FRAME_BACKGROUND_COLOR (f), &background, 1);
#endif
}
@@ -7982,9 +7748,9 @@ Lisp_Object Qpostscript;
#ifdef HAVE_GHOSTSCRIPT
-static int gs_image_p P_ ((Lisp_Object object));
-static int gs_load P_ ((struct frame *f, struct image *img));
-static void gs_clear_image P_ ((struct frame *f, struct image *img));
+static int gs_image_p (Lisp_Object object);
+static int gs_load (struct frame *f, struct image *img);
+static void gs_clear_image (struct frame *f, struct image *img);
/* Keyword symbols. */
@@ -8045,9 +7811,7 @@ static struct image_type gs_type =
/* Free X resources of Ghostscript image IMG which is used on frame F. */
static void
-gs_clear_image (f, img)
- struct frame *f;
- struct image *img;
+gs_clear_image (struct frame *f, struct image *img)
{
/* IMG->data.ptr_val may contain a recorded colormap. */
xfree (img->data.ptr_val);
@@ -8059,14 +7823,13 @@ gs_clear_image (f, img)
specification. */
static int
-gs_image_p (object)
- Lisp_Object object;
+gs_image_p (Lisp_Object object)
{
struct image_keyword fmt[GS_LAST];
Lisp_Object tem;
int i;
- bcopy (gs_format, fmt, sizeof fmt);
+ memcpy (fmt, gs_format, sizeof fmt);
if (!parse_image_spec (object, fmt, GS_LAST, Qpostscript))
return 0;
@@ -8100,9 +7863,7 @@ gs_image_p (object)
if successful. */
static int
-gs_load (f, img)
- struct frame *f;
- struct image *img;
+gs_load (struct frame *f, struct image *img)
{
char buffer[100];
Lisp_Object window_and_pixmap_id = Qnil, loader, pt_height, pt_width;
@@ -8180,9 +7941,7 @@ gs_load (f, img)
telling Emacs that Ghostscript has finished drawing. */
void
-x_kill_gs_process (pixmap, f)
- Pixmap pixmap;
- struct frame *f;
+x_kill_gs_process (Pixmap pixmap, struct frame *f)
{
struct image_cache *c = FRAME_IMAGE_CACHE (f);
int class, i;
@@ -8280,16 +8039,14 @@ x_kill_gs_process (pixmap, f)
DEFUN ("imagep", Fimagep, Simagep, 1, 1, 0,
doc: /* Value is non-nil if SPEC is a valid image specification. */)
- (spec)
- Lisp_Object spec;
+ (Lisp_Object spec)
{
return valid_image_p (spec) ? Qt : Qnil;
}
DEFUN ("lookup-image", Flookup_image, Slookup_image, 1, 1, 0, "")
- (spec)
- Lisp_Object spec;
+ (Lisp_Object spec)
{
int id = -1;
@@ -8324,8 +8081,7 @@ Return non-nil if TYPE is a supported image type.
Image types pbm and xbm are prebuilt; other types are loaded here.
Libraries to load are specified in alist LIBRARIES (usually, the value
of `image-library-alist', which see). */)
- (type, libraries)
- Lisp_Object type, libraries;
+ (Lisp_Object type, Lisp_Object libraries)
{
Lisp_Object tested;
@@ -8375,7 +8131,7 @@ of `image-library-alist', which see). */)
}
void
-syms_of_image ()
+syms_of_image (void)
{
extern Lisp_Object Qrisky_local_variable; /* Syms_of_xdisp has already run. */
@@ -8560,7 +8316,7 @@ The function `clear-image-cache' disregards this variable. */);
}
void
-init_image ()
+init_image (void)
{
}
diff --git a/src/indent.c b/src/indent.c
index b64eae1c429..0f71c6d82d7 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -61,8 +61,8 @@ EMACS_INT last_known_column_point;
static int last_known_column_modified;
-static double current_column_1 P_ ((void));
-static double position_indentation P_ ((int));
+static double current_column_1 (void);
+static double position_indentation (int);
/* Cache of beginning of line found by the last call of
current_column. */
@@ -72,7 +72,7 @@ static EMACS_INT current_column_bol_cache;
/* Get the display table to use for the current buffer. */
struct Lisp_Char_Table *
-buffer_display_table ()
+buffer_display_table (void)
{
Lisp_Object thisbuf;
@@ -89,9 +89,7 @@ buffer_display_table ()
/* Return the width of character C under display table DP. */
static int
-character_width (c, dp)
- int c;
- struct Lisp_Char_Table *dp;
+character_width (int c, struct Lisp_Char_Table *dp)
{
Lisp_Object elt;
@@ -125,9 +123,7 @@ character_width (c, dp)
invalidate the buffer's width_run_cache. */
int
-disptab_matches_widthtab (disptab, widthtab)
- struct Lisp_Char_Table *disptab;
- struct Lisp_Vector *widthtab;
+disptab_matches_widthtab (struct Lisp_Char_Table *disptab, struct Lisp_Vector *widthtab)
{
int i;
@@ -145,9 +141,7 @@ disptab_matches_widthtab (disptab, widthtab)
/* Recompute BUF's width table, using the display table DISPTAB. */
void
-recompute_width_table (buf, disptab)
- struct buffer *buf;
- struct Lisp_Char_Table *disptab;
+recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab)
{
int i;
struct Lisp_Vector *widthtab;
@@ -166,7 +160,7 @@ recompute_width_table (buf, disptab)
state of current_buffer's cache_long_line_scans variable. */
static void
-width_run_cache_on_off ()
+width_run_cache_on_off (void)
{
if (NILP (current_buffer->cache_long_line_scans)
/* And, for the moment, this feature doesn't work on multibyte
@@ -217,11 +211,7 @@ width_run_cache_on_off ()
will equal the return value. */
EMACS_INT
-skip_invisible (pos, next_boundary_p, to, window)
- EMACS_INT pos;
- EMACS_INT *next_boundary_p;
- EMACS_INT to;
- Lisp_Object window;
+skip_invisible (EMACS_INT pos, EMACS_INT *next_boundary_p, EMACS_INT to, Lisp_Object window)
{
Lisp_Object prop, position, overlay_limit, proplimit;
Lisp_Object buffer, tmp;
@@ -322,7 +312,7 @@ Whether the line is visible (if `selective-display' is t) has no effect;
however, ^M is treated as end of line when `selective-display' is t.
Text that has an invisible property is considered as having width 0, unless
`buffer-invisibility-spec' specifies that it is replaced by an ellipsis. */)
- ()
+ (void)
{
Lisp_Object temp;
XSETFASTINT (temp, (int) current_column ()); /* iftc */
@@ -332,13 +322,13 @@ Text that has an invisible property is considered as having width 0, unless
/* Cancel any recorded value of the horizontal position. */
void
-invalidate_current_column ()
+invalidate_current_column (void)
{
last_known_column_point = 0;
}
double
-current_column ()
+current_column (void)
{
register int col;
register unsigned char *ptr, *stop;
@@ -556,7 +546,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
w = ! NILP (window) ? XWINDOW (window) : NULL;
if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
- bzero (&cmp_it, sizeof cmp_it);
+ memset (&cmp_it, 0, sizeof cmp_it);
cmp_it.id = -1;
composition_compute_stop_pos (&cmp_it, scan, scan_byte, end, Qnil);
@@ -723,7 +713,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
due to text properties or overlays. */
static double
-current_column_1 ()
+current_column_1 (void)
{
EMACS_INT col = MOST_POSITIVE_FIXNUM;
EMACS_INT opoint = PT;
@@ -822,8 +812,7 @@ Optional second argument MINIMUM says always do at least MINIMUM spaces
even if that goes past COLUMN; by default, MINIMUM is zero.
The return value is COLUMN. */)
- (column, minimum)
- Lisp_Object column, minimum;
+ (Lisp_Object column, Lisp_Object minimum)
{
int mincol;
register int fromcol;
@@ -867,14 +856,14 @@ The return value is COLUMN. */)
}
-static double position_indentation P_ ((int));
+static double position_indentation (int);
DEFUN ("current-indentation", Fcurrent_indentation, Scurrent_indentation,
0, 0, 0,
doc: /* Return the indentation of the current line.
This is the horizontal position of the character
following any initial whitespace. */)
- ()
+ (void)
{
Lisp_Object val;
int opoint = PT, opoint_byte = PT_BYTE;
@@ -887,8 +876,7 @@ following any initial whitespace. */)
}
static double
-position_indentation (pos_byte)
- register int pos_byte;
+position_indentation (register int pos_byte)
{
register EMACS_INT column = 0;
register EMACS_INT tab_width = XINT (current_buffer->tab_width);
@@ -977,9 +965,7 @@ position_indentation (pos_byte)
preceding line. */
int
-indented_beyond_p (pos, pos_byte, column)
- int pos, pos_byte;
- double column;
+indented_beyond_p (int pos, int pos_byte, double column)
{
double val;
int opoint = PT, opoint_byte = PT_BYTE;
@@ -1011,8 +997,7 @@ In addition, if FORCE is t, and the line is too short to reach
COLUMN, add spaces/tabs to get there.
The return value is the current column. */)
- (column, force)
- Lisp_Object column, force;
+ (Lisp_Object column, Lisp_Object force)
{
EMACS_INT pos;
EMACS_INT col, prev_col;
@@ -1137,12 +1122,7 @@ struct position val_compute_motion;
the scroll bars if they are turned on. */
struct position *
-compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, hscroll, tab_offset, win)
- EMACS_INT from, fromvpos, fromhpos, to, tovpos, tohpos;
- int did_motion;
- EMACS_INT width;
- EMACS_INT hscroll, tab_offset;
- struct window *win;
+compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_motion, EMACS_INT to, EMACS_INT tovpos, EMACS_INT tohpos, EMACS_INT width, EMACS_INT hscroll, EMACS_INT tab_offset, struct window *win)
{
register EMACS_INT hpos = fromhpos;
register EMACS_INT vpos = fromvpos;
@@ -1232,7 +1212,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
pos_byte = prev_pos_byte = CHAR_TO_BYTE (from);
contin_hpos = 0;
prev_tab_offset = tab_offset;
- bzero (&cmp_it, sizeof cmp_it);
+ memset (&cmp_it, 0, sizeof cmp_it);
cmp_it.id = -1;
composition_compute_stop_pos (&cmp_it, pos, pos_byte, to, Qnil);
@@ -1775,9 +1755,7 @@ of a certain window, pass the window's starting location as FROM
and the window's upper-left coordinates as FROMPOS.
Pass the buffer's (point-max) as TO, to limit the scan to the end of the
visible section of the buffer, and pass LINE and COL as TOPOS. */)
- (from, frompos, to, topos, width, offsets, window)
- Lisp_Object from, frompos, to, topos;
- Lisp_Object width, offsets, window;
+ (Lisp_Object from, Lisp_Object frompos, Lisp_Object to, Lisp_Object topos, Lisp_Object width, Lisp_Object offsets, Lisp_Object window)
{
struct window *w;
Lisp_Object bufpos, hpos, vpos, prevhpos;
@@ -1856,9 +1834,7 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */)
struct position val_vmotion;
struct position *
-vmotion (from, vtarget, w)
- register EMACS_INT from, vtarget;
- struct window *w;
+vmotion (register EMACS_INT from, register EMACS_INT vtarget, struct window *w)
{
EMACS_INT hscroll = XINT (w->hscroll);
struct position pos;
@@ -2021,8 +1997,7 @@ regardless of which buffer is displayed in WINDOW.
This is consistent with other cursor motion functions
and makes it possible to use `vertical-motion' in any buffer,
whether or not it is currently displayed in some window. */)
- (lines, window)
- Lisp_Object lines, window;
+ (Lisp_Object lines, Lisp_Object window)
{
struct it it;
struct text_pos pt;
@@ -2183,7 +2158,7 @@ whether or not it is currently displayed in some window. */)
/* File's initialization. */
void
-syms_of_indent ()
+syms_of_indent (void)
{
DEFVAR_BOOL ("indent-tabs-mode", &indent_tabs_mode,
doc: /* *Indentation can insert tabs if this is non-nil. */);
diff --git a/src/indent.h b/src/indent.h
index 4d9dbf2d7ff..394d7216b4f 100644
--- a/src/indent.h
+++ b/src/indent.h
@@ -49,16 +49,16 @@ struct position
EMACS_INT tab_offset;
};
-struct position *compute_motion P_ ((EMACS_INT from, EMACS_INT fromvpos,
- EMACS_INT fromhpos, int did_motion,
- EMACS_INT to, EMACS_INT tovpos,
- EMACS_INT tohpos,
- EMACS_INT width, EMACS_INT hscroll,
- EMACS_INT tab_offset, struct window *));
-struct position *vmotion P_ ((EMACS_INT from, EMACS_INT vtarget,
- struct window *));
-EMACS_INT skip_invisible P_ ((EMACS_INT pos, EMACS_INT *next_boundary_p,
- EMACS_INT to, Lisp_Object window));
+struct position *compute_motion (EMACS_INT from, EMACS_INT fromvpos,
+ EMACS_INT fromhpos, int did_motion,
+ EMACS_INT to, EMACS_INT tovpos,
+ EMACS_INT tohpos,
+ EMACS_INT width, EMACS_INT hscroll,
+ EMACS_INT tab_offset, struct window *);
+struct position *vmotion (EMACS_INT from, EMACS_INT vtarget,
+ struct window *);
+EMACS_INT skip_invisible (EMACS_INT pos, EMACS_INT *next_boundary_p,
+ EMACS_INT to, Lisp_Object window);
/* Value of point when current_column was called */
extern EMACS_INT last_known_column_point;
@@ -68,12 +68,12 @@ extern EMACS_INT last_known_column_point;
/* Return true if the display table DISPTAB specifies the same widths
for characters as WIDTHTAB. We use this to decide when to
invalidate the buffer's column_cache. */
-int disptab_matches_widthtab P_ ((struct Lisp_Char_Table *disptab,
- struct Lisp_Vector *widthtab));
+int disptab_matches_widthtab (struct Lisp_Char_Table *disptab,
+ struct Lisp_Vector *widthtab);
/* Recompute BUF's width table, using the display table DISPTAB. */
-void recompute_width_table P_ ((struct buffer *buf,
- struct Lisp_Char_Table *disptab));
+void recompute_width_table (struct buffer *buf,
+ struct Lisp_Char_Table *disptab);
/* arch-tag: f9feb373-5bff-4f4f-9198-94805d00cfd7
diff --git a/src/insdel.c b/src/insdel.c
index 2b00de88711..8b0b2f7ab01 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -51,7 +51,7 @@ static void adjust_markers_for_replace (EMACS_INT, EMACS_INT, EMACS_INT,
EMACS_INT, EMACS_INT, EMACS_INT);
static void adjust_point (EMACS_INT nchars, EMACS_INT nbytes);
-Lisp_Object Fcombine_after_change_execute ();
+Lisp_Object Fcombine_after_change_execute (void);
/* Non-nil means don't call the after-change-functions right away,
just record an element in combine_after_change_list. */
@@ -85,7 +85,7 @@ static int check_markers_debug_flag;
else
void
-check_markers ()
+check_markers (void)
{
register struct Lisp_Marker *tail;
int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
@@ -164,28 +164,9 @@ gap_left (EMACS_INT charpos, EMACS_INT bytepos, int newgap)
/* Move at most 32000 chars before checking again for a quit. */
if (i > 32000)
i = 32000;
-#ifdef GAP_USE_BCOPY
- if (i >= 128
- /* bcopy is safe if the two areas of memory do not overlap
- or on systems where bcopy is always safe for moving upward. */
- && (BCOPY_UPWARD_SAFE
- || to - from >= 128))
- {
- /* If overlap is not safe, avoid it by not moving too many
- characters at once. */
- if (!BCOPY_UPWARD_SAFE && i > to - from)
- i = to - from;
- new_s1 -= i;
- from -= i, to -= i;
- bcopy (from, to, i);
- }
- else
-#endif
- {
- new_s1 -= i;
- while (--i >= 0)
- *--to = *--from;
- }
+ new_s1 -= i;
+ from -= i, to -= i;
+ memmove (to, from, i);
}
/* Adjust markers, and buffer data structure, to put the gap at BYTEPOS.
@@ -238,28 +219,9 @@ gap_right (EMACS_INT charpos, EMACS_INT bytepos)
/* Move at most 32000 chars before checking again for a quit. */
if (i > 32000)
i = 32000;
-#ifdef GAP_USE_BCOPY
- if (i >= 128
- /* bcopy is safe if the two areas of memory do not overlap
- or on systems where bcopy is always safe for moving downward. */
- && (BCOPY_DOWNWARD_SAFE
- || from - to >= 128))
- {
- /* If overlap is not safe, avoid it by not moving too many
- characters at once. */
- if (!BCOPY_DOWNWARD_SAFE && i > from - to)
- i = from - to;
- new_s1 += i;
- bcopy (from, to, i);
- from += i, to += i;
- }
- else
-#endif
- {
- new_s1 += i;
- while (--i >= 0)
- *to++ = *from++;
- }
+ new_s1 += i;
+ memmove (to, from, i);
+ from += i, to += i;
}
adjust_markers_gap_motion (GPT_BYTE + GAP_SIZE, bytepos + GAP_SIZE,
@@ -585,7 +547,7 @@ make_gap_smaller (EMACS_INT nbytes_removed)
/* Pretend that the last unwanted part of the gap is the entire gap,
and that the first desired part of the gap is part of the buffer
text. */
- bzero (GPT_ADDR, new_gap_size);
+ memset (GPT_ADDR, 0, new_gap_size);
GPT += new_gap_size;
GPT_BYTE += new_gap_size;
Z += new_gap_size;
@@ -636,7 +598,7 @@ copy_text (const unsigned char *from_addr, unsigned char *to_addr,
{
if (from_multibyte == to_multibyte)
{
- bcopy (from_addr, to_addr, nbytes);
+ memcpy (to_addr, from_addr, nbytes);
return nbytes;
}
else if (from_multibyte)
@@ -966,7 +928,7 @@ insert_1_both (const unsigned char *string,
MODIFF++;
CHARS_MODIFF = MODIFF;
- bcopy (string, GPT_ADDR, nbytes);
+ memcpy (GPT_ADDR, string, nbytes);
GAP_SIZE -= nbytes;
GPT += nchars;
@@ -1007,7 +969,7 @@ insert_1_both (const unsigned char *string,
copy them into the buffer.
It does not work to use `insert' for this, because a GC could happen
- before we bcopy the stuff into the buffer, and relocate the string
+ before we copy the stuff into the buffer, and relocate the string
without insert noticing. */
void
@@ -1182,7 +1144,7 @@ insert_from_gap (EMACS_INT nchars, EMACS_INT nbytes)
into the current buffer.
It does not work to use `insert' for this, because a malloc could happen
- and relocate BUF's text before the bcopy happens. */
+ and relocate BUF's text before the copy happens. */
void
insert_from_buffer (struct buffer *buf,
@@ -1666,7 +1628,7 @@ replace_range (EMACS_INT from, EMACS_INT to, Lisp_Object new,
void
replace_range_2 (EMACS_INT from, EMACS_INT from_byte,
EMACS_INT to, EMACS_INT to_byte,
- char *ins, EMACS_INT inschars, EMACS_INT insbytes,
+ const char *ins, EMACS_INT inschars, EMACS_INT insbytes,
int markers)
{
EMACS_INT nbytes_del, nchars_del;
@@ -1712,7 +1674,7 @@ replace_range_2 (EMACS_INT from, EMACS_INT from_byte,
make_gap (insbytes - GAP_SIZE);
/* Copy the replacement text into the buffer. */
- bcopy (ins, GPT_ADDR, insbytes);
+ memcpy (GPT_ADDR, ins, insbytes);
#ifdef BYTE_COMBINING_DEBUG
/* We have copied text into the gap, but we have not marked
@@ -2132,8 +2094,7 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end,
NO-ERROR-FLAG is nil if there was an error,
anything else meaning no error (so this function does nothing). */
Lisp_Object
-reset_var_on_error (val)
- Lisp_Object val;
+reset_var_on_error (Lisp_Object val)
{
if (NILP (XCDR (val)))
Fset (XCAR (val), Qnil);
@@ -2297,8 +2258,7 @@ signal_after_change (EMACS_INT charpos, EMACS_INT lendel, EMACS_INT lenins)
}
Lisp_Object
-Fcombine_after_change_execute_1 (val)
- Lisp_Object val;
+Fcombine_after_change_execute_1 (Lisp_Object val)
{
Vcombine_after_change_calls = val;
return val;
@@ -2307,7 +2267,7 @@ Fcombine_after_change_execute_1 (val)
DEFUN ("combine-after-change-execute", Fcombine_after_change_execute,
Scombine_after_change_execute, 0, 0, 0,
doc: /* This function is for use internally in `combine-after-change-calls'. */)
- ()
+ (void)
{
int count = SPECPDL_INDEX ();
EMACS_INT beg, end, change;
@@ -2390,7 +2350,7 @@ DEFUN ("combine-after-change-execute", Fcombine_after_change_execute,
}
void
-syms_of_insdel ()
+syms_of_insdel (void)
{
staticpro (&combine_after_change_list);
staticpro (&combine_after_change_buffer);
diff --git a/src/intervals.c b/src/intervals.c
index 9836f763489..86cbe1effcc 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -52,9 +52,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define TMEM(sym, set) (CONSP (set) ? ! NILP (Fmemq (sym, set)) : ! NILP (set))
-Lisp_Object merge_properties_sticky ();
-static INTERVAL reproduce_tree P_ ((INTERVAL, INTERVAL));
-static INTERVAL reproduce_tree_obj P_ ((INTERVAL, Lisp_Object));
+Lisp_Object merge_properties_sticky (Lisp_Object pleft, Lisp_Object pright);
+static INTERVAL reproduce_tree (INTERVAL, INTERVAL);
+static INTERVAL reproduce_tree_obj (INTERVAL, Lisp_Object);
/* Utility functions for intervals. */
@@ -62,8 +62,7 @@ static INTERVAL reproduce_tree_obj P_ ((INTERVAL, Lisp_Object));
/* Create the root interval of some object, a buffer or string. */
INTERVAL
-create_root_interval (parent)
- Lisp_Object parent;
+create_root_interval (Lisp_Object parent)
{
INTERVAL new;
@@ -95,8 +94,7 @@ create_root_interval (parent)
/* Make the interval TARGET have exactly the properties of SOURCE */
void
-copy_properties (source, target)
- register INTERVAL source, target;
+copy_properties (register INTERVAL source, register INTERVAL target)
{
if (DEFAULT_INTERVAL_P (source) && DEFAULT_INTERVAL_P (target))
return;
@@ -110,8 +108,7 @@ copy_properties (source, target)
is added to TARGET if TARGET has no such property as yet. */
static void
-merge_properties (source, target)
- register INTERVAL source, target;
+merge_properties (register INTERVAL source, register INTERVAL target)
{
register Lisp_Object o, sym, val;
@@ -149,8 +146,7 @@ merge_properties (source, target)
0 otherwise. */
int
-intervals_equal (i0, i1)
- INTERVAL i0, i1;
+intervals_equal (INTERVAL i0, INTERVAL i1)
{
register Lisp_Object i0_cdr, i0_sym;
register Lisp_Object i1_cdr, i1_val;
@@ -206,10 +202,7 @@ intervals_equal (i0, i1)
Pass FUNCTION two args: an interval, and ARG. */
void
-traverse_intervals_noorder (tree, function, arg)
- INTERVAL tree;
- void (* function) P_ ((INTERVAL, Lisp_Object));
- Lisp_Object arg;
+traverse_intervals_noorder (INTERVAL tree, void (*function) (INTERVAL, Lisp_Object), Lisp_Object arg)
{
/* Minimize stack usage. */
while (!NULL_INTERVAL_P (tree))
@@ -229,11 +222,7 @@ traverse_intervals_noorder (tree, function, arg)
Pass FUNCTION two args: an interval, and ARG. */
void
-traverse_intervals (tree, position, function, arg)
- INTERVAL tree;
- int position;
- void (* function) P_ ((INTERVAL, Lisp_Object));
- Lisp_Object arg;
+traverse_intervals (INTERVAL tree, int position, void (*function) (INTERVAL, Lisp_Object), Lisp_Object arg)
{
while (!NULL_INTERVAL_P (tree))
{
@@ -323,8 +312,7 @@ root_interval (interval)
*/
static INLINE INTERVAL
-rotate_right (interval)
- INTERVAL interval;
+rotate_right (INTERVAL interval)
{
INTERVAL i;
INTERVAL B = interval->left;
@@ -371,8 +359,7 @@ rotate_right (interval)
*/
static INLINE INTERVAL
-rotate_left (interval)
- INTERVAL interval;
+rotate_left (INTERVAL interval)
{
INTERVAL i;
INTERVAL B = interval->right;
@@ -413,8 +400,7 @@ rotate_left (interval)
themselves are already balanced. */
static INTERVAL
-balance_an_interval (i)
- INTERVAL i;
+balance_an_interval (INTERVAL i)
{
register int old_diff, new_diff;
@@ -451,8 +437,7 @@ balance_an_interval (i)
Lisp Object. */
static INLINE INTERVAL
-balance_possible_root_interval (interval)
- register INTERVAL interval;
+balance_possible_root_interval (register INTERVAL interval)
{
Lisp_Object parent;
int have_parent = 0;
@@ -482,8 +467,7 @@ balance_possible_root_interval (interval)
(the amount of text). */
static INTERVAL
-balance_intervals_internal (tree)
- register INTERVAL tree;
+balance_intervals_internal (register INTERVAL tree)
{
/* Balance within each side. */
if (tree->left)
@@ -496,8 +480,7 @@ balance_intervals_internal (tree)
/* Advertised interface to balance intervals. */
INTERVAL
-balance_intervals (tree)
- INTERVAL tree;
+balance_intervals (INTERVAL tree)
{
if (tree == NULL_INTERVAL)
return NULL_INTERVAL;
@@ -519,9 +502,7 @@ balance_intervals (tree)
it is still a root after this operation. */
INTERVAL
-split_interval_right (interval, offset)
- INTERVAL interval;
- int offset;
+split_interval_right (INTERVAL interval, int offset)
{
INTERVAL new = make_interval ();
int position = interval->position;
@@ -566,9 +547,7 @@ split_interval_right (interval, offset)
it is still a root after this operation. */
INTERVAL
-split_interval_left (interval, offset)
- INTERVAL interval;
- int offset;
+split_interval_left (INTERVAL interval, int offset)
{
INTERVAL new = make_interval ();
int new_length = offset;
@@ -608,8 +587,7 @@ split_interval_left (interval, offset)
of another interval! */
int
-interval_start_pos (source)
- INTERVAL source;
+interval_start_pos (INTERVAL source)
{
Lisp_Object parent;
@@ -635,9 +613,7 @@ interval_start_pos (source)
will update this cache based on the result of find_interval. */
INTERVAL
-find_interval (tree, position)
- register INTERVAL tree;
- register int position;
+find_interval (register INTERVAL tree, register int position)
{
/* The distance from the left edge of the subtree at TREE
to POSITION. */
@@ -691,8 +667,7 @@ find_interval (tree, position)
find_interval). */
INTERVAL
-next_interval (interval)
- register INTERVAL interval;
+next_interval (register INTERVAL interval)
{
register INTERVAL i = interval;
register int next_position;
@@ -731,8 +706,7 @@ next_interval (interval)
find_interval). */
INTERVAL
-previous_interval (interval)
- register INTERVAL interval;
+previous_interval (register INTERVAL interval)
{
register INTERVAL i;
@@ -771,9 +745,7 @@ previous_interval (interval)
To speed up the process, we assume that the ->position of
I and all its parents is already uptodate. */
INTERVAL
-update_interval (i, pos)
- register INTERVAL i;
- int pos;
+update_interval (register INTERVAL i, int pos)
{
if (NULL_INTERVAL_P (i))
return NULL_INTERVAL;
@@ -892,9 +864,7 @@ adjust_intervals_for_insertion (tree, position, length)
this text, and make it have the merged properties of both ends. */
static INTERVAL
-adjust_intervals_for_insertion (tree, position, length)
- INTERVAL tree;
- int position, length;
+adjust_intervals_for_insertion (INTERVAL tree, int position, int length)
{
register INTERVAL i;
register INTERVAL temp;
@@ -1119,8 +1089,7 @@ FR 8 9 A B
*/
Lisp_Object
-merge_properties_sticky (pleft, pright)
- Lisp_Object pleft, pright;
+merge_properties_sticky (Lisp_Object pleft, Lisp_Object pright)
{
register Lisp_Object props, front, rear;
Lisp_Object lfront, lrear, rfront, rrear;
@@ -1256,8 +1225,7 @@ merge_properties_sticky (pleft, pright)
storing the resulting subtree into its parent. */
static INTERVAL
-delete_node (i)
- register INTERVAL i;
+delete_node (register INTERVAL i)
{
register INTERVAL migrate, this;
register int migrate_amt;
@@ -1290,8 +1258,7 @@ delete_node (i)
for the length of I. */
void
-delete_interval (i)
- register INTERVAL i;
+delete_interval (register INTERVAL i)
{
register INTERVAL parent;
int amt = LENGTH (i);
@@ -1345,9 +1312,7 @@ delete_interval (i)
deleting the appropriate amount of text. */
static int
-interval_deletion_adjustment (tree, from, amount)
- register INTERVAL tree;
- register int from, amount;
+interval_deletion_adjustment (register INTERVAL tree, register int from, register int amount)
{
register int relative_position = from;
@@ -1407,9 +1372,7 @@ interval_deletion_adjustment (tree, from, amount)
buffer position, i.e. origin 1). */
static void
-adjust_intervals_for_deletion (buffer, start, length)
- struct buffer *buffer;
- int start, length;
+adjust_intervals_for_deletion (struct buffer *buffer, int start, int length)
{
register int left_to_delete = length;
register INTERVAL tree = BUF_INTERVALS (buffer);
@@ -1460,9 +1423,7 @@ adjust_intervals_for_deletion (buffer, start, length)
of LENGTH. */
INLINE void
-offset_intervals (buffer, start, length)
- struct buffer *buffer;
- int start, length;
+offset_intervals (struct buffer *buffer, int start, int length)
{
if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0)
return;
@@ -1483,8 +1444,7 @@ offset_intervals (buffer, start, length)
interval. */
INTERVAL
-merge_interval_right (i)
- register INTERVAL i;
+merge_interval_right (register INTERVAL i)
{
register int absorb = LENGTH (i);
register INTERVAL successor;
@@ -1540,8 +1500,7 @@ merge_interval_right (i)
The caller must verify that this is not the first (leftmost) interval. */
INTERVAL
-merge_interval_left (i)
- register INTERVAL i;
+merge_interval_left (register INTERVAL i)
{
register int absorb = LENGTH (i);
register INTERVAL predecessor;
@@ -1595,12 +1554,11 @@ merge_interval_left (i)
the pointers of the copy. */
static INTERVAL
-reproduce_tree (source, parent)
- INTERVAL source, parent;
+reproduce_tree (INTERVAL source, INTERVAL parent)
{
register INTERVAL t = make_interval ();
- bcopy (source, t, INTERVAL_SIZE);
+ memcpy (t, source, INTERVAL_SIZE);
copy_properties (source, t);
SET_INTERVAL_PARENT (t, parent);
if (! NULL_LEFT_CHILD (source))
@@ -1612,13 +1570,11 @@ reproduce_tree (source, parent)
}
static INTERVAL
-reproduce_tree_obj (source, parent)
- INTERVAL source;
- Lisp_Object parent;
+reproduce_tree_obj (INTERVAL source, Lisp_Object parent)
{
register INTERVAL t = make_interval ();
- bcopy (source, t, INTERVAL_SIZE);
+ memcpy (t, source, INTERVAL_SIZE);
copy_properties (source, t);
SET_INTERVAL_OBJECT (t, parent);
if (! NULL_LEFT_CHILD (source))
@@ -1714,11 +1670,7 @@ make_new_interval (intervals, start, length)
text... */
void
-graft_intervals_into_buffer (source, position, length, buffer, inherit)
- INTERVAL source;
- int position, length;
- struct buffer *buffer;
- int inherit;
+graft_intervals_into_buffer (INTERVAL source, int position, int length, struct buffer *buffer, int inherit)
{
register INTERVAL under, over, this, prev;
register INTERVAL tree;
@@ -1876,18 +1828,13 @@ graft_intervals_into_buffer (source, position, length, buffer, inherit)
and for PROP appearing on the default-text-properties list. */
Lisp_Object
-textget (plist, prop)
- Lisp_Object plist;
- register Lisp_Object prop;
+textget (Lisp_Object plist, register Lisp_Object prop)
{
return lookup_char_property (plist, prop, 1);
}
Lisp_Object
-lookup_char_property (plist, prop, textprop)
- Lisp_Object plist;
- register Lisp_Object prop;
- int textprop;
+lookup_char_property (Lisp_Object plist, register Lisp_Object prop, int textprop)
{
register Lisp_Object tail, fallback = Qnil;
@@ -1974,8 +1921,7 @@ set_point (EMACS_INT charpos)
if the invisible property comes from an overlay. */
static int
-adjust_for_invis_intang (pos, test_offs, adj, test_intang)
- int pos, test_offs, adj, test_intang;
+adjust_for_invis_intang (int pos, int test_offs, int adj, int test_intang)
{
Lisp_Object invis_propval, invis_overlay;
Lisp_Object test_pos;
@@ -2237,8 +2183,7 @@ set_point_both (EMACS_INT charpos, EMACS_INT bytepos)
segment that reaches all the way to point. */
void
-move_if_not_intangible (position)
- int position;
+move_if_not_intangible (int position)
{
Lisp_Object pos;
Lisp_Object intangible_propval;
@@ -2301,11 +2246,7 @@ move_if_not_intangible (position)
nil means the current buffer. */
int
-get_property_and_range (pos, prop, val, start, end, object)
- int pos;
- Lisp_Object prop, *val;
- EMACS_INT *start, *end;
- Lisp_Object object;
+get_property_and_range (int pos, Lisp_Object prop, Lisp_Object *val, EMACS_INT *start, EMACS_INT *end, Lisp_Object object)
{
INTERVAL i, prev, next;
@@ -2348,10 +2289,7 @@ get_property_and_range (pos, prop, val, start, end, object)
POSITION must be in the accessible part of BUFFER. */
Lisp_Object
-get_local_map (position, buffer, type)
- register int position;
- register struct buffer *buffer;
- Lisp_Object type;
+get_local_map (register int position, register struct buffer *buffer, Lisp_Object type)
{
Lisp_Object prop, lispy_position, lispy_buffer;
int old_begv, old_zv, old_begv_byte, old_zv_byte;
@@ -2404,9 +2342,7 @@ get_local_map (position, buffer, type)
The new interval tree has no parent and has a starting-position of 0. */
INTERVAL
-copy_intervals (tree, start, length)
- INTERVAL tree;
- int start, length;
+copy_intervals (INTERVAL tree, int start, int length)
{
register INTERVAL i, new, t;
register int got, prevlen;
@@ -2447,10 +2383,7 @@ copy_intervals (tree, start, length)
/* Give STRING the properties of BUFFER from POSITION to LENGTH. */
INLINE void
-copy_intervals_to_string (string, buffer, position, length)
- Lisp_Object string;
- struct buffer *buffer;
- int position, length;
+copy_intervals_to_string (Lisp_Object string, struct buffer *buffer, int position, int length)
{
INTERVAL interval_copy = copy_intervals (BUF_INTERVALS (buffer),
position, length);
@@ -2465,8 +2398,7 @@ copy_intervals_to_string (string, buffer, position, length)
Assume they have identical characters. */
int
-compare_string_intervals (s1, s2)
- Lisp_Object s1, s2;
+compare_string_intervals (Lisp_Object s1, Lisp_Object s2)
{
INTERVAL i1, i2;
int pos = 0;
@@ -2504,10 +2436,7 @@ compare_string_intervals (s1, s2)
START_BYTE ... END_BYTE in bytes. */
static void
-set_intervals_multibyte_1 (i, multi_flag, start, start_byte, end, end_byte)
- INTERVAL i;
- int multi_flag;
- int start, start_byte, end, end_byte;
+set_intervals_multibyte_1 (INTERVAL i, int multi_flag, int start, int start_byte, int end, int end_byte)
{
/* Fix the length of this interval. */
if (multi_flag)
@@ -2617,8 +2546,7 @@ set_intervals_multibyte_1 (i, multi_flag, start, start_byte, end, end_byte)
or to fit them as non-multibyte (if MULTI_FLAG is 0). */
void
-set_intervals_multibyte (multi_flag)
- int multi_flag;
+set_intervals_multibyte (int multi_flag)
{
if (BUF_INTERVALS (current_buffer))
set_intervals_multibyte_1 (BUF_INTERVALS (current_buffer), multi_flag,
diff --git a/src/intervals.h b/src/intervals.h
index 5d1132e11ba..612c1a99848 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -28,8 +28,8 @@ struct interval
{
/* The first group of entries deal with the tree structure. */
- unsigned EMACS_INT total_length; /* Length of myself and both children. */
- unsigned EMACS_INT position; /* Cache of interval's character position. */
+ EMACS_UINT total_length; /* Length of myself and both children. */
+ EMACS_UINT position; /* Cache of interval's character position. */
/* This field is usually updated
simultaneously with an interval
traversal, there is no guarantee
@@ -243,49 +243,49 @@ struct interval
/* Declared in alloc.c */
-extern INTERVAL make_interval P_ ((void));
+extern INTERVAL make_interval (void);
/* Declared in intervals.c */
-extern INTERVAL create_root_interval P_ ((Lisp_Object));
-extern void copy_properties P_ ((INTERVAL, INTERVAL));
-extern int intervals_equal P_ ((INTERVAL, INTERVAL));
-extern void traverse_intervals P_ ((INTERVAL, int,
- void (*) (INTERVAL, Lisp_Object),
- Lisp_Object));
-extern void traverse_intervals_noorder P_ ((INTERVAL,
- void (*) (INTERVAL, Lisp_Object),
- Lisp_Object));
-extern INTERVAL split_interval_right P_ ((INTERVAL, int));
-extern INTERVAL split_interval_left P_ ((INTERVAL, int));
-extern INTERVAL find_interval P_ ((INTERVAL, int));
-extern INTERVAL next_interval P_ ((INTERVAL));
-extern INTERVAL previous_interval P_ ((INTERVAL));
-extern INTERVAL merge_interval_left P_ ((INTERVAL));
-extern INTERVAL merge_interval_right P_ ((INTERVAL));
-extern void delete_interval P_ ((INTERVAL));
-extern INLINE void offset_intervals P_ ((struct buffer *, int, int));
-extern void graft_intervals_into_buffer P_ ((INTERVAL, int, int,
- struct buffer *, int));
-extern void verify_interval_modification P_ ((struct buffer *, int, int));
-extern INTERVAL balance_intervals P_ ((INTERVAL));
-extern INLINE void copy_intervals_to_string P_ ((Lisp_Object, struct buffer *,
- int, int));
-extern INTERVAL copy_intervals P_ ((INTERVAL, int, int));
-extern int compare_string_intervals P_ ((Lisp_Object, Lisp_Object));
-extern Lisp_Object textget P_ ((Lisp_Object, Lisp_Object));
-extern Lisp_Object lookup_char_property P_ ((Lisp_Object, Lisp_Object, int));
-extern void move_if_not_intangible P_ ((int));
-extern int get_property_and_range P_ ((int, Lisp_Object, Lisp_Object *,
- EMACS_INT *, EMACS_INT *, Lisp_Object));
-extern Lisp_Object get_local_map P_ ((int, struct buffer *, Lisp_Object));
-extern INTERVAL update_interval P_ ((INTERVAL, int));
-extern void set_intervals_multibyte P_ ((int));
-extern INTERVAL validate_interval_range P_ ((Lisp_Object, Lisp_Object *,
- Lisp_Object *, int));
+extern INTERVAL create_root_interval (Lisp_Object);
+extern void copy_properties (INTERVAL, INTERVAL);
+extern int intervals_equal (INTERVAL, INTERVAL);
+extern void traverse_intervals (INTERVAL, int,
+ void (*) (INTERVAL, Lisp_Object),
+ Lisp_Object);
+extern void traverse_intervals_noorder (INTERVAL,
+ void (*) (INTERVAL, Lisp_Object),
+ Lisp_Object);
+extern INTERVAL split_interval_right (INTERVAL, int);
+extern INTERVAL split_interval_left (INTERVAL, int);
+extern INTERVAL find_interval (INTERVAL, int);
+extern INTERVAL next_interval (INTERVAL);
+extern INTERVAL previous_interval (INTERVAL);
+extern INTERVAL merge_interval_left (INTERVAL);
+extern INTERVAL merge_interval_right (INTERVAL);
+extern void delete_interval (INTERVAL);
+extern INLINE void offset_intervals (struct buffer *, int, int);
+extern void graft_intervals_into_buffer (INTERVAL, int, int,
+ struct buffer *, int);
+extern void verify_interval_modification (struct buffer *, int, int);
+extern INTERVAL balance_intervals (INTERVAL);
+extern INLINE void copy_intervals_to_string (Lisp_Object, struct buffer *,
+ int, int);
+extern INTERVAL copy_intervals (INTERVAL, int, int);
+extern int compare_string_intervals (Lisp_Object, Lisp_Object);
+extern Lisp_Object textget (Lisp_Object, Lisp_Object);
+extern Lisp_Object lookup_char_property (Lisp_Object, Lisp_Object, int);
+extern void move_if_not_intangible (int);
+extern int get_property_and_range (int, Lisp_Object, Lisp_Object *,
+ EMACS_INT *, EMACS_INT *, Lisp_Object);
+extern Lisp_Object get_local_map (int, struct buffer *, Lisp_Object);
+extern INTERVAL update_interval (INTERVAL, int);
+extern void set_intervals_multibyte (int);
+extern INTERVAL validate_interval_range (Lisp_Object, Lisp_Object *,
+ Lisp_Object *, int);
/* Defined in xdisp.c */
-extern int invisible_p P_ ((Lisp_Object, Lisp_Object));
+extern int invisible_p (Lisp_Object, Lisp_Object);
/* Declared in textprop.c */
@@ -323,27 +323,27 @@ EXFUN (Fremove_text_properties, 4);
EXFUN (Ftext_property_any, 5);
EXFUN (Ftext_property_not_all, 5);
EXFUN (Fprevious_single_char_property_change, 4);
-extern Lisp_Object copy_text_properties P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object));
-extern Lisp_Object set_text_properties P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object,
- Lisp_Object));
-extern void set_text_properties_1 P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object, INTERVAL));
-
-Lisp_Object text_property_list P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
- Lisp_Object));
-int add_text_properties_from_list P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
-Lisp_Object extend_property_ranges P_ ((Lisp_Object, Lisp_Object));
-Lisp_Object get_char_property_and_overlay P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object*));
-extern int text_property_stickiness P_ ((Lisp_Object prop, Lisp_Object pos,
- Lisp_Object buffer));
-extern Lisp_Object get_pos_property P_ ((Lisp_Object pos, Lisp_Object prop,
- Lisp_Object object));
-
-extern void syms_of_textprop P_ ((void));
+extern Lisp_Object copy_text_properties (Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object);
+extern Lisp_Object set_text_properties (Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object,
+ Lisp_Object);
+extern void set_text_properties_1 (Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object, INTERVAL);
+
+Lisp_Object text_property_list (Lisp_Object, Lisp_Object, Lisp_Object,
+ Lisp_Object);
+int add_text_properties_from_list (Lisp_Object, Lisp_Object, Lisp_Object);
+Lisp_Object extend_property_ranges (Lisp_Object, Lisp_Object);
+Lisp_Object get_char_property_and_overlay (Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object*);
+extern int text_property_stickiness (Lisp_Object prop, Lisp_Object pos,
+ Lisp_Object buffer);
+extern Lisp_Object get_pos_property (Lisp_Object pos, Lisp_Object prop,
+ Lisp_Object object);
+
+extern void syms_of_textprop (void);
#include "composite.h"
diff --git a/src/keyboard.c b/src/keyboard.c
index 18d75f9b01c..ce80bb9d641 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -42,7 +42,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "puresize.h"
#include "systime.h"
#include "atimer.h"
-#include <setjmp.h>
+#include "process.h"
#include <errno.h>
#ifdef HAVE_GTK_AND_PTHREAD
@@ -521,17 +521,15 @@ extern Lisp_Object Qleft_margin, Qright_margin;
extern Lisp_Object Qleft_fringe, Qright_fringe;
extern Lisp_Object QCmap;
-Lisp_Object recursive_edit_unwind (), command_loop ();
-Lisp_Object Fthis_command_keys ();
+Lisp_Object recursive_edit_unwind (Lisp_Object buffer), command_loop (void);
+Lisp_Object Fthis_command_keys (void);
Lisp_Object Qextended_command_history;
-EMACS_TIME timer_check ();
+EMACS_TIME timer_check (int do_it_now);
extern Lisp_Object Vhistory_length, Vtranslation_table_for_input;
-extern char *x_get_keysym_name ();
-
-static void record_menu_key ();
-static int echo_length ();
+static void record_menu_key (Lisp_Object c);
+static int echo_length (void);
Lisp_Object Qpolling_period;
@@ -611,41 +609,40 @@ Lisp_Object Venable_disabled_menus_and_buttons;
#define READABLE_EVENTS_IGNORE_SQUEEZABLES (1 << 2)
/* Function for init_keyboard to call with no args (if nonzero). */
-void (*keyboard_init_hook) ();
-
-static int read_avail_input P_ ((int));
-static void get_input_pending P_ ((int *, int));
-static int readable_events P_ ((int));
-static Lisp_Object read_char_x_menu_prompt P_ ((int, Lisp_Object *,
- Lisp_Object, int *));
-static Lisp_Object read_char_x_menu_prompt ();
-static Lisp_Object read_char_minibuf_menu_prompt P_ ((int, int,
- Lisp_Object *));
-static Lisp_Object make_lispy_event P_ ((struct input_event *));
+void (*keyboard_init_hook) (void);
+
+static int read_avail_input (int);
+static void get_input_pending (int *, int);
+static int readable_events (int);
+static Lisp_Object read_char_x_menu_prompt (int, Lisp_Object *,
+ Lisp_Object, int *);
+static Lisp_Object read_char_minibuf_menu_prompt (int, int,
+ Lisp_Object *);
+static Lisp_Object make_lispy_event (struct input_event *);
#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
-static Lisp_Object make_lispy_movement P_ ((struct frame *, Lisp_Object,
- enum scroll_bar_part,
- Lisp_Object, Lisp_Object,
- unsigned long));
-#endif
-static Lisp_Object modify_event_symbol P_ ((int, unsigned, Lisp_Object,
- Lisp_Object, char **,
- Lisp_Object *, unsigned));
-static Lisp_Object make_lispy_switch_frame P_ ((Lisp_Object));
-static void save_getcjmp P_ ((jmp_buf));
-static void save_getcjmp ();
-static void restore_getcjmp P_ ((jmp_buf));
-static Lisp_Object apply_modifiers P_ ((int, Lisp_Object));
-static void clear_event P_ ((struct input_event *));
-static Lisp_Object restore_kboard_configuration P_ ((Lisp_Object));
-static SIGTYPE interrupt_signal P_ ((int signalnum));
-static void handle_interrupt P_ ((void));
-static void timer_start_idle P_ ((void));
-static void timer_stop_idle P_ ((void));
-static void timer_resume_idle P_ ((void));
-static SIGTYPE handle_user_signal P_ ((int));
-static char *find_user_signal_name P_ ((int));
-static int store_user_signal_events P_ ((void));
+static Lisp_Object make_lispy_movement (struct frame *, Lisp_Object,
+ enum scroll_bar_part,
+ Lisp_Object, Lisp_Object,
+ unsigned long);
+#endif
+static Lisp_Object modify_event_symbol (int, unsigned, Lisp_Object,
+ Lisp_Object, char **,
+ Lisp_Object *, unsigned);
+static Lisp_Object make_lispy_switch_frame (Lisp_Object);
+static void save_getcjmp (jmp_buf);
+static void restore_getcjmp (jmp_buf);
+static Lisp_Object apply_modifiers (int, Lisp_Object);
+static void clear_event (struct input_event *);
+static Lisp_Object restore_kboard_configuration (Lisp_Object);
+static SIGTYPE interrupt_signal (int signalnum);
+static SIGTYPE input_available_signal (int signo);
+static void handle_interrupt (void);
+static void timer_start_idle (void);
+static void timer_stop_idle (void);
+static void timer_resume_idle (void);
+static SIGTYPE handle_user_signal (int);
+static char *find_user_signal_name (int);
+static int store_user_signal_events (void);
/* Nonzero means don't try to suspend even if the operating system seems
to support it. */
@@ -658,8 +655,7 @@ extern Lisp_Object Qidentity, Qonly;
Also start echoing. */
void
-echo_prompt (str)
- Lisp_Object str;
+echo_prompt (Lisp_Object str)
{
current_kboard->echo_string = str;
current_kboard->echo_after_prompt = SCHARS (str);
@@ -671,8 +667,7 @@ echo_prompt (str)
jazz), or a symbol, whose name is printed. */
void
-echo_char (c)
- Lisp_Object c;
+echo_char (Lisp_Object c)
{
if (current_kboard->immediate_echo)
{
@@ -721,7 +716,7 @@ echo_char (c)
ptr = buffer + offset;
}
- bcopy (text, ptr, len);
+ memcpy (ptr, text, len);
ptr += len;
}
@@ -759,7 +754,7 @@ echo_char (c)
empty, so that it serves as a mini-prompt for the very next character. */
void
-echo_dash ()
+echo_dash (void)
{
/* Do nothing if not echoing at all. */
if (NILP (current_kboard->echo_string))
@@ -800,7 +795,7 @@ echo_dash ()
doing so. */
void
-echo_now ()
+echo_now (void)
{
if (!current_kboard->immediate_echo)
{
@@ -850,7 +845,7 @@ echo_now ()
/* Turn off echoing, for the start of a new command. */
void
-cancel_echoing ()
+cancel_echoing (void)
{
current_kboard->immediate_echo = 0;
current_kboard->echo_after_prompt = -1;
@@ -863,7 +858,7 @@ cancel_echoing ()
/* Return the length of the current echo string. */
static int
-echo_length ()
+echo_length (void)
{
return (STRINGP (current_kboard->echo_string)
? SCHARS (current_kboard->echo_string)
@@ -875,8 +870,7 @@ echo_length ()
switches frames while entering a key sequence. */
static void
-echo_truncate (nchars)
- int nchars;
+echo_truncate (int nchars)
{
if (STRINGP (current_kboard->echo_string))
current_kboard->echo_string
@@ -888,8 +882,7 @@ echo_truncate (nchars)
/* Functions for manipulating this_command_keys. */
static void
-add_command_key (key)
- Lisp_Object key;
+add_command_key (Lisp_Object key)
{
#if 0 /* Not needed after we made Freset_this_command_lengths
do the job immediately. */
@@ -916,7 +909,7 @@ add_command_key (key)
Lisp_Object
-recursive_edit_1 ()
+recursive_edit_1 (void)
{
int count = SPECPDL_INDEX ();
Lisp_Object val;
@@ -961,7 +954,7 @@ recursive_edit_1 ()
/* When an auto-save happens, record the "time", and don't do again soon. */
void
-record_auto_save ()
+record_auto_save (void)
{
last_auto_save = num_nonmacro_input_events;
}
@@ -969,7 +962,7 @@ record_auto_save ()
/* Make an auto save happen as soon as possible at command level. */
void
-force_auto_save_soon ()
+force_auto_save_soon (void)
{
last_auto_save = - auto_save_interval - 1;
@@ -982,7 +975,7 @@ To get out of the recursive edit, a command can do `(throw 'exit nil)';
that tells this function to return.
Alternatively, `(throw 'exit t)' makes this function signal an error.
This function is called by the editor initialization to begin editing. */)
- ()
+ (void)
{
int count = SPECPDL_INDEX ();
Lisp_Object buffer;
@@ -1014,8 +1007,7 @@ This function is called by the editor initialization to begin editing. */)
}
Lisp_Object
-recursive_edit_unwind (buffer)
- Lisp_Object buffer;
+recursive_edit_unwind (Lisp_Object buffer)
{
if (BUFFERP (buffer))
Fset_buffer (buffer);
@@ -1060,8 +1052,7 @@ single_kboard_state ()
get out of it. */
void
-not_single_kboard_state (kboard)
- KBOARD *kboard;
+not_single_kboard_state (KBOARD *kboard)
{
if (kboard == current_kboard)
single_kboard = 0;
@@ -1080,8 +1071,7 @@ struct kboard_stack
static struct kboard_stack *kboard_stack;
void
-push_kboard (k)
- struct kboard *k;
+push_kboard (struct kboard *k)
{
struct kboard_stack *p
= (struct kboard_stack *) xmalloc (sizeof (struct kboard_stack));
@@ -1094,7 +1084,7 @@ push_kboard (k)
}
void
-pop_kboard ()
+pop_kboard (void)
{
struct terminal *t;
struct kboard_stack *p = kboard_stack;
@@ -1129,8 +1119,7 @@ pop_kboard ()
locked, then this function will throw an errow. */
void
-temporarily_switch_to_single_kboard (f)
- struct frame *f;
+temporarily_switch_to_single_kboard (struct frame *f)
{
int was_locked = single_kboard;
if (was_locked)
@@ -1170,8 +1159,7 @@ record_single_kboard_state ()
#endif
static Lisp_Object
-restore_kboard_configuration (was_locked)
- Lisp_Object was_locked;
+restore_kboard_configuration (Lisp_Object was_locked)
{
if (NILP (was_locked))
single_kboard = 0;
@@ -1192,8 +1180,7 @@ restore_kboard_configuration (was_locked)
by printing an error message and returning to the editor command loop. */
Lisp_Object
-cmd_error (data)
- Lisp_Object data;
+cmd_error (Lisp_Object data)
{
Lisp_Object old_level, old_length;
char macroerror[50];
@@ -1251,9 +1238,7 @@ cmd_error (data)
string. */
void
-cmd_error_internal (data, context)
- Lisp_Object data;
- char *context;
+cmd_error_internal (Lisp_Object data, const char *context)
{
struct frame *sf = SELECTED_FRAME ();
@@ -1304,16 +1289,16 @@ cmd_error_internal (data, context)
Vsignaling_function = Qnil;
}
-Lisp_Object command_loop_1 ();
-Lisp_Object command_loop_2 ();
-Lisp_Object top_level_1 ();
+Lisp_Object command_loop_1 (void);
+Lisp_Object command_loop_2 (Lisp_Object);
+Lisp_Object top_level_1 (Lisp_Object);
/* Entry to editor-command-loop.
This level has the catches for exiting/returning to editor command loop.
It returns nil to exit recursive edit, t to abort it. */
Lisp_Object
-command_loop ()
+command_loop (void)
{
if (command_loop_level > 0 || minibuf_level > 0)
{
@@ -1348,7 +1333,7 @@ command_loop ()
returned due to end of file (or end of kbd macro). */
Lisp_Object
-command_loop_2 ()
+command_loop_2 (Lisp_Object ignore)
{
register Lisp_Object val;
@@ -1360,13 +1345,13 @@ command_loop_2 ()
}
Lisp_Object
-top_level_2 ()
+top_level_2 (void)
{
return Feval (Vtop_level);
}
Lisp_Object
-top_level_1 ()
+top_level_1 (Lisp_Object ignore)
{
/* On entry to the outer level, run the startup file */
if (!NILP (Vtop_level))
@@ -1381,7 +1366,7 @@ top_level_1 ()
DEFUN ("top-level", Ftop_level, Stop_level, 0, 0, "",
doc: /* Exit all recursive editing levels.
This also exits all active minibuffers. */)
- ()
+ (void)
{
#ifdef HAVE_WINDOW_SYSTEM
if (display_hourglass_p)
@@ -1398,7 +1383,7 @@ This also exits all active minibuffers. */)
DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "",
doc: /* Exit from the innermost recursive edit or minibuffer. */)
- ()
+ (void)
{
if (command_loop_level > 0 || minibuf_level > 0)
Fthrow (Qexit, Qnil);
@@ -1409,7 +1394,7 @@ DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0,
DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "",
doc: /* Abort the command that requested this recursive edit or minibuffer input. */)
- ()
+ (void)
{
if (command_loop_level > 0 || minibuf_level > 0)
Fthrow (Qexit, Qt);
@@ -1424,8 +1409,7 @@ DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0,
of this function. */
static Lisp_Object
-tracking_off (old_value)
- Lisp_Object old_value;
+tracking_off (Lisp_Object old_value)
{
do_mouse_tracking = old_value;
if (NILP (old_value))
@@ -1451,8 +1435,7 @@ Within a `track-mouse' form, mouse motion generates input events that
you can read with `read-event'.
Normally, mouse motion is ignored.
usage: (track-mouse BODY...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
int count = SPECPDL_INDEX ();
Lisp_Object val;
@@ -1475,7 +1458,7 @@ usage: (track-mouse BODY...) */)
int ignore_mouse_drag_p;
static FRAME_PTR
-some_mouse_moved ()
+some_mouse_moved (void)
{
Lisp_Object tail, frame;
@@ -1499,17 +1482,16 @@ some_mouse_moved ()
/* This is the actual command reading loop,
sans error-handling encapsulation. */
-static int read_key_sequence P_ ((Lisp_Object *, int, Lisp_Object,
- int, int, int));
-void safe_run_hooks P_ ((Lisp_Object));
-static void adjust_point_for_property P_ ((int, int));
+static int read_key_sequence (Lisp_Object *, int, Lisp_Object,
+ int, int, int);
+void safe_run_hooks (Lisp_Object);
+static void adjust_point_for_property (int, int);
/* Cancel hourglass from protect_unwind.
ARG is not used. */
#ifdef HAVE_WINDOW_SYSTEM
static Lisp_Object
-cancel_hourglass_unwind (arg)
- Lisp_Object arg;
+cancel_hourglass_unwind (Lisp_Object arg)
{
cancel_hourglass ();
return Qnil;
@@ -1517,7 +1499,7 @@ cancel_hourglass_unwind (arg)
#endif
Lisp_Object
-command_loop_1 ()
+command_loop_1 (void)
{
Lisp_Object cmd;
Lisp_Object keybuf[30];
@@ -1862,12 +1844,10 @@ extern Lisp_Object Qcomposition, Qdisplay;
LAST_PT is the last position of point. */
extern Lisp_Object Qafter_string, Qbefore_string;
-extern Lisp_Object get_pos_property P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
+extern Lisp_Object get_pos_property (Lisp_Object, Lisp_Object, Lisp_Object);
static void
-adjust_point_for_property (last_pt, modified)
- int last_pt;
- int modified;
+adjust_point_for_property (int last_pt, int modified)
{
EMACS_INT beg, end;
Lisp_Object val, overlay, tmp;
@@ -2017,8 +1997,7 @@ adjust_point_for_property (last_pt, modified)
/* Subroutine for safe_run_hooks: run the hook HOOK. */
static Lisp_Object
-safe_run_hooks_1 (hook)
- Lisp_Object hook;
+safe_run_hooks_1 (void)
{
if (NILP (Vrun_hooks))
return Qnil;
@@ -2028,8 +2007,7 @@ safe_run_hooks_1 (hook)
/* Subroutine for safe_run_hooks: handle an error by clearing out the hook. */
static Lisp_Object
-safe_run_hooks_error (data)
- Lisp_Object data;
+safe_run_hooks_error (Lisp_Object data)
{
Lisp_Object args[3];
args[0] = build_string ("Error in %s: %s");
@@ -2044,8 +2022,7 @@ safe_run_hooks_error (data)
to mysteriously evaporate. */
void
-safe_run_hooks (hook)
- Lisp_Object hook;
+safe_run_hooks (Lisp_Object hook)
{
int count = SPECPDL_INDEX ();
specbind (Qinhibit_quit, hook);
@@ -2077,7 +2054,7 @@ struct atimer *poll_timer;
there. */
void
-poll_for_input_1 ()
+poll_for_input_1 (void)
{
/* Tell ns_read_socket() it is being called asynchronously so it can avoid
doing anything dangerous. */
@@ -2096,8 +2073,7 @@ poll_for_input_1 ()
poll_timer. */
void
-poll_for_input (timer)
- struct atimer *timer;
+poll_for_input (struct atimer *timer)
{
if (poll_suppress_count == 0)
{
@@ -2116,7 +2092,7 @@ poll_for_input (timer)
This function is called unconditionally from various places. */
void
-start_polling ()
+start_polling (void)
{
#ifdef POLL_FOR_INPUT
/* XXX This condition was (read_socket_hook && !interrupt_input),
@@ -2153,7 +2129,7 @@ start_polling ()
/* Nonzero if we are using polling to handle input asynchronously. */
int
-input_polling_used ()
+input_polling_used (void)
{
#ifdef POLL_FOR_INPUT
/* XXX This condition was (read_socket_hook && !interrupt_input),
@@ -2168,7 +2144,7 @@ input_polling_used ()
/* Turn off polling. */
void
-stop_polling ()
+stop_polling (void)
{
#ifdef POLL_FOR_INPUT
/* XXX This condition was (read_socket_hook && !interrupt_input),
@@ -2183,8 +2159,7 @@ stop_polling ()
and start or stop polling accordingly. */
void
-set_poll_suppress_count (count)
- int count;
+set_poll_suppress_count (int count)
{
#ifdef POLL_FOR_INPUT
if (count == 0 && poll_suppress_count != 0)
@@ -2204,8 +2179,7 @@ set_poll_suppress_count (count)
But don't decrease it. */
void
-bind_polling_period (n)
- int n;
+bind_polling_period (int n)
{
#ifdef POLL_FOR_INPUT
int new = polling_period;
@@ -2224,8 +2198,7 @@ bind_polling_period (n)
/* Apply the control modifier to CHARACTER. */
int
-make_ctrl_char (c)
- int c;
+make_ctrl_char (int c)
{
/* Save the upper bits here. */
int upper = c & ~0177;
@@ -2294,9 +2267,8 @@ make_ctrl_char (c)
from X code running asynchronously. */
void
-show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo)
- Lisp_Object help, window, object, pos;
- int ok_to_overwrite_keystroke_echo;
+show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object,
+ Lisp_Object pos, int ok_to_overwrite_keystroke_echo)
{
if (!NILP (help) && !STRINGP (help))
{
@@ -2343,9 +2315,10 @@ show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo)
/* Input of single characters from keyboard */
-Lisp_Object print_help ();
-static Lisp_Object kbd_buffer_get_event ();
-static void record_char ();
+Lisp_Object print_help (Lisp_Object object);
+static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, int *used_mouse_menu,
+ struct timeval *end_time);
+static void record_char (Lisp_Object c);
static Lisp_Object help_form_saved_window_configs;
static Lisp_Object
@@ -2394,13 +2367,8 @@ do { if (polling_stopped_here) start_polling (); \
Value is t if we showed a menu and the user rejected it. */
Lisp_Object
-read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
- int commandflag;
- int nmaps;
- Lisp_Object *maps;
- Lisp_Object prev_event;
- int *used_mouse_menu;
- EMACS_TIME *end_time;
+read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event,
+ int *used_mouse_menu, struct timeval *end_time)
{
volatile Lisp_Object c;
int count, jmpcount;
@@ -3311,8 +3279,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
Record it for echoing, for this-command-keys, and so on. */
static void
-record_menu_key (c)
- Lisp_Object c;
+record_menu_key (Lisp_Object c)
{
/* Wipe the echo area. */
clear_message (1, 0);
@@ -3346,8 +3313,7 @@ record_menu_key (c)
/* Return 1 if should recognize C as "the help character". */
int
-help_char_p (c)
- Lisp_Object c;
+help_char_p (Lisp_Object c)
{
Lisp_Object tail;
@@ -3362,8 +3328,7 @@ help_char_p (c)
/* Record the input event C in various ways. */
static void
-record_char (c)
- Lisp_Object c;
+record_char (Lisp_Object c)
{
int recorded = 0;
@@ -3497,8 +3462,7 @@ record_char (c)
}
Lisp_Object
-print_help (object)
- Lisp_Object object;
+print_help (Lisp_Object object)
{
struct buffer *old = current_buffer;
Fprinc (object, Qnil);
@@ -3514,17 +3478,15 @@ print_help (object)
See read_process_output. */
static void
-save_getcjmp (temp)
- jmp_buf temp;
+save_getcjmp (jmp_buf temp)
{
- bcopy (getcjmp, temp, sizeof getcjmp);
+ memcpy (temp, getcjmp, sizeof getcjmp);
}
static void
-restore_getcjmp (temp)
- jmp_buf temp;
+restore_getcjmp (jmp_buf temp)
{
- bcopy (temp, getcjmp, sizeof getcjmp);
+ memcpy (getcjmp, temp, sizeof getcjmp);
}
/* Low level keyboard/mouse input.
@@ -3534,8 +3496,7 @@ restore_getcjmp (temp)
/* Return true if there are any events in the queue that read-char
would return. If this returns false, a read-char would block. */
static int
-readable_events (flags)
- int flags;
+readable_events (int flags)
{
#ifdef HAVE_DBUS
/* Check whether a D-Bus message has arrived. */
@@ -3611,8 +3572,7 @@ readable_events (flags)
int stop_character;
static KBOARD *
-event_to_kboard (event)
- struct input_event *event;
+event_to_kboard (struct input_event *event)
{
Lisp_Object frame;
frame = event->frame_or_window;
@@ -3630,14 +3590,25 @@ event_to_kboard (event)
return FRAME_KBOARD (XFRAME (frame));
}
+/* Return the number of slots occupied in kbd_buffer. */
+
+static int
+kbd_buffer_nr_stored (void)
+{
+ return kbd_fetch_ptr == kbd_store_ptr
+ ? 0
+ : (kbd_fetch_ptr < kbd_store_ptr
+ ? kbd_store_ptr - kbd_fetch_ptr
+ : ((kbd_buffer + KBD_BUFFER_SIZE) - kbd_fetch_ptr
+ + (kbd_store_ptr - kbd_buffer)));
+}
Lisp_Object Vthrow_on_input;
/* Store an event obtained at interrupt level into kbd_buffer, fifo */
void
-kbd_buffer_store_event (event)
- register struct input_event *event;
+kbd_buffer_store_event (register struct input_event *event)
{
kbd_buffer_store_event_hold (event, 0);
}
@@ -3655,9 +3626,8 @@ kbd_buffer_store_event (event)
*/
void
-kbd_buffer_store_event_hold (event, hold_quit)
- register struct input_event *event;
- struct input_event *hold_quit;
+kbd_buffer_store_event_hold (register struct input_event *event,
+ struct input_event *hold_quit)
{
if (event->kind == NO_EVENT)
abort ();
@@ -3704,7 +3674,7 @@ kbd_buffer_store_event_hold (event, hold_quit)
if (hold_quit)
{
- bcopy (event, (char *) hold_quit, sizeof (*event));
+ memcpy (hold_quit, event, sizeof (*event));
return;
}
@@ -3753,6 +3723,17 @@ kbd_buffer_store_event_hold (event, hold_quit)
{
*kbd_store_ptr = *event;
++kbd_store_ptr;
+ if (kbd_buffer_nr_stored () > KBD_BUFFER_SIZE/2 && ! kbd_on_hold_p ())
+ {
+ /* Don't read keyboard input until we have processed kbd_buffer.
+ This happens when pasting text longer than KBD_BUFFER_SIZE/2. */
+ hold_keyboard_input ();
+#ifdef SIGIO
+ if (!noninteractive)
+ signal (SIGIO, SIG_IGN);
+#endif
+ stop_polling ();
+ }
}
/* If we're inside while-no-input, and this event qualifies
@@ -3778,8 +3759,7 @@ kbd_buffer_store_event_hold (event, hold_quit)
/* Put an input event back in the head of the event queue. */
void
-kbd_buffer_unget_event (event)
- register struct input_event *event;
+kbd_buffer_unget_event (register struct input_event *event)
{
if (kbd_fetch_ptr == kbd_buffer)
kbd_fetch_ptr = kbd_buffer + KBD_BUFFER_SIZE;
@@ -3807,9 +3787,8 @@ kbd_buffer_unget_event (event)
Value is the number of input_events generated. */
void
-gen_help_event (help, frame, window, object, pos)
- Lisp_Object help, frame, object, window;
- int pos;
+gen_help_event (Lisp_Object help, Lisp_Object frame, Lisp_Object window,
+ Lisp_Object object, int pos)
{
struct input_event event;
@@ -3828,8 +3807,7 @@ gen_help_event (help, frame, window, object, pos)
/* Store HELP_EVENTs for HELP on FRAME in the input queue. */
void
-kbd_buffer_store_help_event (frame, help)
- Lisp_Object frame, help;
+kbd_buffer_store_help_event (Lisp_Object frame, Lisp_Object help)
{
struct input_event event;
@@ -3846,7 +3824,7 @@ kbd_buffer_store_help_event (frame, help)
/* Discard any mouse events in the event buffer by setting them to
NO_EVENT. */
void
-discard_mouse_events ()
+discard_mouse_events (void)
{
struct input_event *sp;
for (sp = kbd_fetch_ptr; sp != kbd_store_ptr; sp++)
@@ -3876,8 +3854,7 @@ discard_mouse_events ()
are no real input events. */
int
-kbd_buffer_events_waiting (discard)
- int discard;
+kbd_buffer_events_waiting (int discard)
{
struct input_event *sp;
@@ -3899,8 +3876,7 @@ kbd_buffer_events_waiting (discard)
/* Clear input event EVENT. */
static INLINE void
-clear_event (event)
- struct input_event *event;
+clear_event (struct input_event *event)
{
event->kind = NO_EVENT;
}
@@ -3913,13 +3889,24 @@ clear_event (event)
We always read and discard one event. */
static Lisp_Object
-kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
- KBOARD **kbp;
- int *used_mouse_menu;
- EMACS_TIME *end_time;
+kbd_buffer_get_event (KBOARD **kbp,
+ int *used_mouse_menu,
+ struct timeval *end_time)
{
register int c;
Lisp_Object obj;
+
+ if (kbd_on_hold_p () && kbd_buffer_nr_stored () < KBD_BUFFER_SIZE/4)
+ {
+ /* Start reading input again, we have processed enough so we can
+ accept new events again. */
+ unhold_keyboard_input ();
+#ifdef SIGIO
+ if (!noninteractive)
+ signal (SIGIO, input_available_signal);
+#endif /* SIGIO */
+ start_polling ();
+ }
if (noninteractive
/* In case we are running as a daemon, only do this before
@@ -4283,8 +4270,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
then return, without reading any user-visible events. */
void
-swallow_events (do_display)
- int do_display;
+swallow_events (int do_display)
{
int old_timers_run;
@@ -4334,7 +4320,7 @@ swallow_events (do_display)
for the sake of running idle-time timers. */
static void
-timer_start_idle ()
+timer_start_idle (void)
{
Lisp_Object timers;
@@ -4362,7 +4348,7 @@ timer_start_idle ()
/* Record that Emacs is no longer idle, so stop running idle-time timers. */
static void
-timer_stop_idle ()
+timer_stop_idle (void)
{
EMACS_SET_SECS_USECS (timer_idleness_start_time, -1, -1);
}
@@ -4370,7 +4356,7 @@ timer_stop_idle ()
/* Resume idle timer from last idle start time. */
static void
-timer_resume_idle ()
+timer_resume_idle (void)
{
if (! EMACS_TIME_NEG_P (timer_idleness_start_time))
return;
@@ -4401,7 +4387,7 @@ extern Lisp_Object Qapply;
should be done. */
static EMACS_TIME
-timer_check_2 ()
+timer_check_2 (void)
{
EMACS_TIME nexttime;
EMACS_TIME now, idleness_now;
@@ -4602,12 +4588,11 @@ timer_check_2 ()
Now we always run timers directly. */
EMACS_TIME
-timer_check (do_it_now)
- int do_it_now;
+timer_check (int do_it_now)
{
EMACS_TIME nexttime;
- do
+ do
{
nexttime = timer_check_2 ();
}
@@ -4626,7 +4611,7 @@ The value when Emacs is not idle is nil.
The microsecond count is zero on systems that do not provide
resolution finer than a second. */)
- ()
+ (void)
{
if (! EMACS_TIME_NEG_P (timer_idleness_start_time))
{
@@ -5254,10 +5239,8 @@ int double_click_count;
/* Return position of a mouse click or wheel event */
static Lisp_Object
-make_lispy_position (f, x, y, time)
- struct frame *f;
- Lisp_Object *x, *y;
- unsigned long time;
+make_lispy_position (struct frame *f, Lisp_Object *x, Lisp_Object *y,
+ unsigned long time)
{
Lisp_Object window;
enum window_part part;
@@ -5444,8 +5427,7 @@ make_lispy_position (f, x, y, time)
in order to build drag events when the button is released. */
static Lisp_Object
-make_lispy_event (event)
- struct input_event *event;
+make_lispy_event (struct input_event *event)
{
int i;
@@ -6152,12 +6134,8 @@ make_lispy_event (event)
#if defined(HAVE_MOUSE) || defined(HAVE_GPM)
static Lisp_Object
-make_lispy_movement (frame, bar_window, part, x, y, time)
- FRAME_PTR frame;
- Lisp_Object bar_window;
- enum scroll_bar_part part;
- Lisp_Object x, y;
- unsigned long time;
+make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_part part,
+ Lisp_Object x, Lisp_Object y, unsigned long time)
{
/* Is it a scroll bar movement? */
if (frame && ! NILP (bar_window))
@@ -6192,8 +6170,7 @@ make_lispy_movement (frame, bar_window, part, x, y, time)
/* Construct a switch frame event. */
static Lisp_Object
-make_lispy_switch_frame (frame)
- Lisp_Object frame;
+make_lispy_switch_frame (Lisp_Object frame)
{
return Fcons (Qswitch_frame, Fcons (frame, Qnil));
}
@@ -6209,9 +6186,7 @@ make_lispy_switch_frame (frame)
This doesn't use any caches. */
static int
-parse_modifiers_uncached (symbol, modifier_end)
- Lisp_Object symbol;
- int *modifier_end;
+parse_modifiers_uncached (Lisp_Object symbol, int *modifier_end)
{
Lisp_Object name;
int i;
@@ -6321,10 +6296,7 @@ parse_modifiers_uncached (symbol, modifier_end)
prepended to the string BASE[0..BASE_LEN-1].
This doesn't use any caches. */
static Lisp_Object
-apply_modifiers_uncached (modifiers, base, base_len, base_len_byte)
- int modifiers;
- char *base;
- int base_len, base_len_byte;
+apply_modifiers_uncached (int modifiers, char *base, int base_len, int base_len_byte)
{
/* Since BASE could contain nulls, we can't use intern here; we have
to use Fintern, which expects a genuine Lisp_String, and keeps a
@@ -6363,8 +6335,8 @@ apply_modifiers_uncached (modifiers, base, base_len, base_len_byte)
new_name = make_uninit_multibyte_string (mod_len + base_len,
mod_len + base_len_byte);
- bcopy (new_mods, SDATA (new_name), mod_len);
- bcopy (base, SDATA (new_name) + mod_len, base_len_byte);
+ memcpy (SDATA (new_name), new_mods, mod_len);
+ memcpy (SDATA (new_name) + mod_len, base, base_len_byte);
return Fintern (new_name, Qnil);
}
@@ -6383,8 +6355,7 @@ static Lisp_Object modifier_symbols;
/* Return the list of modifier symbols corresponding to the mask MODIFIERS. */
static Lisp_Object
-lispy_modifier_list (modifiers)
- int modifiers;
+lispy_modifier_list (int modifiers)
{
Lisp_Object modifier_list;
int i;
@@ -6409,8 +6380,7 @@ lispy_modifier_list (modifiers)
#define KEY_TO_CHAR(k) (XINT (k) & ((1 << CHARACTERBITS) - 1))
Lisp_Object
-parse_modifiers (symbol)
- Lisp_Object symbol;
+parse_modifiers (Lisp_Object symbol)
{
Lisp_Object elements;
@@ -6458,8 +6428,7 @@ parse_modifiers (symbol)
DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,
Sevent_symbol_parse_modifiers, 1, 1, 0,
doc: /* Parse the event symbol. For internal use. */)
- (symbol)
- Lisp_Object symbol;
+ (Lisp_Object symbol)
{
/* Fill the cache if needed. */
parse_modifiers (symbol);
@@ -6479,9 +6448,7 @@ DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,
apply_modifiers copies the value of BASE's Qevent_kind property to
the modified symbol. */
static Lisp_Object
-apply_modifiers (modifiers, base)
- int modifiers;
- Lisp_Object base;
+apply_modifiers (int modifiers, Lisp_Object base)
{
Lisp_Object cache, index, entry, new_symbol;
@@ -6550,8 +6517,7 @@ apply_modifiers (modifiers, base)
and M-C-foo end up being equivalent in the keymap. */
Lisp_Object
-reorder_modifiers (symbol)
- Lisp_Object symbol;
+reorder_modifiers (Lisp_Object symbol)
{
/* It's hopefully okay to write the code this way, since everything
will soon be in caches, and no consing will be done at all. */
@@ -6596,15 +6562,9 @@ reorder_modifiers (symbol)
in the symbol's name. */
static Lisp_Object
-modify_event_symbol (symbol_num, modifiers, symbol_kind, name_alist_or_stem,
- name_table, symbol_table, table_size)
- int symbol_num;
- unsigned modifiers;
- Lisp_Object symbol_kind;
- Lisp_Object name_alist_or_stem;
- char **name_table;
- Lisp_Object *symbol_table;
- unsigned int table_size;
+modify_event_symbol (int symbol_num, unsigned int modifiers, Lisp_Object symbol_kind,
+ Lisp_Object name_alist_or_stem, char **name_table,
+ Lisp_Object *symbol_table, unsigned int table_size)
{
Lisp_Object value;
Lisp_Object symbol_int;
@@ -6697,8 +6657,7 @@ and zero or more modifier names (control, meta, hyper, super, shift, alt,
drag, down, double or triple). The base must be last.
The return value is an event type (a character or symbol) which
has the same base event type and all the specified modifiers. */)
- (event_desc)
- Lisp_Object event_desc;
+ (Lisp_Object event_desc)
{
Lisp_Object base;
int modifiers = 0;
@@ -6841,8 +6800,7 @@ parse_solitary_modifier (Lisp_Object symbol)
but it can be a Lucid-style event type list. */
int
-lucid_event_type_list_p (object)
- Lisp_Object object;
+lucid_event_type_list_p (Lisp_Object object)
{
Lisp_Object tail;
@@ -6879,9 +6837,7 @@ lucid_event_type_list_p (object)
movements and toolkit scroll bar thumb drags. */
static void
-get_input_pending (addr, flags)
- int *addr;
- int flags;
+get_input_pending (int *addr, int flags)
{
/* First of all, have we already counted some input? */
*addr = (!NILP (Vquit_flag) || readable_events (flags));
@@ -6898,8 +6854,7 @@ get_input_pending (addr, flags)
/* Interface to read_avail_input, blocking SIGIO or SIGALRM if necessary. */
void
-gobble_input (expected)
- int expected;
+gobble_input (int expected)
{
#ifdef HAVE_DBUS
/* Read D-Bus messages. */
@@ -6936,7 +6891,7 @@ gobble_input (expected)
so that read_key_sequence will notice the new current buffer. */
void
-record_asynch_buffer_change ()
+record_asynch_buffer_change (void)
{
struct input_event event;
Lisp_Object tem;
@@ -6946,18 +6901,15 @@ record_asynch_buffer_change ()
event.frame_or_window = Qnil;
event.arg = Qnil;
-#ifdef subprocesses
/* We don't need a buffer-switch event unless Emacs is waiting for input.
The purpose of the event is to make read_key_sequence look up the
keymaps again. If we aren't in read_key_sequence, we don't need one,
- and the event could cause trouble by messing up (input-pending-p). */
+ and the event could cause trouble by messing up (input-pending-p).
+ Note: Fwaiting_for_user_input_p always returns nil when async
+ subprocesses aren't supported. */
tem = Fwaiting_for_user_input_p ();
if (NILP (tem))
return;
-#else
- /* We never need these events if we have no asynchronous subprocesses. */
- return;
-#endif
/* Make sure no interrupt happens while storing the event. */
#ifdef SIGIO
@@ -6986,8 +6938,7 @@ record_asynch_buffer_change ()
this is a bad time to try to read input. */
static int
-read_avail_input (expected)
- int expected;
+read_avail_input (int expected)
{
int nread = 0;
int err = 0;
@@ -7120,6 +7071,10 @@ tty_read_avail_input (struct terminal *terminal,
int n_to_read, i;
struct tty_display_info *tty = terminal->display_info.tty;
int nread = 0;
+ int buffer_free = KBD_BUFFER_SIZE - kbd_buffer_nr_stored () - 1;
+
+ if (kbd_on_hold_p () || buffer_free <= 0)
+ return 0;
if (!terminal->name) /* Don't read from a dead terminal. */
return 0;
@@ -7201,6 +7156,10 @@ tty_read_avail_input (struct terminal *terminal,
#endif
#endif
+ /* Don't read more than we can store. */
+ if (n_to_read > buffer_free)
+ n_to_read = buffer_free;
+
/* Now read; for one reason or another, this will not block.
NREAD is set to the number of chars read. */
do
@@ -7313,7 +7272,7 @@ tty_read_avail_input (struct terminal *terminal,
}
void
-handle_async_input ()
+handle_async_input (void)
{
interrupt_input_pending = 0;
#ifdef SYNC_INPUT
@@ -7340,7 +7299,7 @@ handle_async_input ()
}
void
-process_pending_signals ()
+process_pending_signals (void)
{
if (interrupt_input_pending)
handle_async_input ();
@@ -7351,8 +7310,7 @@ process_pending_signals ()
/* Note SIGIO has been undef'd if FIONREAD is missing. */
static SIGTYPE
-input_available_signal (signo)
- int signo;
+input_available_signal (int signo)
{
/* Must preserve main program's value of errno. */
int old_errno = errno;
@@ -7381,7 +7339,7 @@ input_available_signal (signo)
dealing with, without assuming that every file which uses
UNBLOCK_INPUT also has #included the files necessary to get SIGIO. */
void
-reinvoke_input_signal ()
+reinvoke_input_signal (void)
{
#ifdef SIGIO
handle_async_input ();
@@ -7410,9 +7368,7 @@ struct user_signal_info
static struct user_signal_info *user_signals = NULL;
void
-add_user_signal (sig, name)
- int sig;
- const char *name;
+add_user_signal (int sig, const char *name)
{
struct user_signal_info *p;
@@ -7432,8 +7388,7 @@ add_user_signal (sig, name)
}
static SIGTYPE
-handle_user_signal (sig)
- int sig;
+handle_user_signal (int sig)
{
int old_errno = errno;
struct user_signal_info *p;
@@ -7462,8 +7417,7 @@ handle_user_signal (sig)
}
static char *
-find_user_signal_name (sig)
- int sig;
+find_user_signal_name (int sig)
{
struct user_signal_info *p;
@@ -7475,7 +7429,7 @@ find_user_signal_name (sig)
}
static int
-store_user_signal_events ()
+store_user_signal_events (void)
{
struct user_signal_info *p;
struct input_event buf;
@@ -7488,7 +7442,7 @@ store_user_signal_events ()
if (nstored == 0)
{
- bzero (&buf, sizeof buf);
+ memset (&buf, 0, sizeof buf);
buf.kind = USER_SIGNAL_EVENT;
buf.frame_or_window = selected_frame;
}
@@ -7509,7 +7463,7 @@ store_user_signal_events ()
}
-static void menu_bar_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object, void*));
+static void menu_bar_item (Lisp_Object, Lisp_Object, Lisp_Object, void*);
static Lisp_Object menu_bar_one_keymap_changed_items;
/* These variables hold the vector under construction within
@@ -7525,8 +7479,7 @@ static int menu_bar_items_index;
OLD is an old vector we can optionally reuse, or nil. */
Lisp_Object
-menu_bar_items (old)
- Lisp_Object old;
+menu_bar_items (Lisp_Object old)
{
/* The number of keymaps we're scanning right now, and the number of
keymaps we have allocated space for. */
@@ -7593,7 +7546,7 @@ menu_bar_items (old)
nmaps = 0;
if (tem = get_local_map (PT, current_buffer, Qkeymap), !NILP (tem))
maps[nmaps++] = tem;
- bcopy (tmaps, (void *) (maps + nmaps), nminor * sizeof (maps[0]));
+ memcpy (maps + nmaps, tmaps, nminor * sizeof (maps[0]));
nmaps += nminor;
maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map);
}
@@ -7634,9 +7587,9 @@ menu_bar_items (old)
tem2 = XVECTOR (menu_bar_items_vector)->contents[i + 2];
tem3 = XVECTOR (menu_bar_items_vector)->contents[i + 3];
if (end > i + 4)
- bcopy (&XVECTOR (menu_bar_items_vector)->contents[i + 4],
- &XVECTOR (menu_bar_items_vector)->contents[i],
- (end - i - 4) * sizeof (Lisp_Object));
+ memmove (&XVECTOR (menu_bar_items_vector)->contents[i],
+ &XVECTOR (menu_bar_items_vector)->contents[i + 4],
+ (end - i - 4) * sizeof (Lisp_Object));
XVECTOR (menu_bar_items_vector)->contents[end - 4] = tem0;
XVECTOR (menu_bar_items_vector)->contents[end - 3] = tem1;
XVECTOR (menu_bar_items_vector)->contents[end - 2] = tem2;
@@ -7666,9 +7619,7 @@ menu_bar_items (old)
Lisp_Object item_properties;
static void
-menu_bar_item (key, item, dummy1, dummy2)
- Lisp_Object key, item, dummy1;
- void *dummy2;
+menu_bar_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy1, void *dummy2)
{
struct gcpro gcpro1;
int i;
@@ -7683,9 +7634,9 @@ menu_bar_item (key, item, dummy1, dummy2)
if (EQ (key, XVECTOR (menu_bar_items_vector)->contents[i]))
{
if (menu_bar_items_index > i + 4)
- bcopy (&XVECTOR (menu_bar_items_vector)->contents[i + 4],
- &XVECTOR (menu_bar_items_vector)->contents[i],
- (menu_bar_items_index - i - 4) * sizeof (Lisp_Object));
+ memmove (&XVECTOR (menu_bar_items_vector)->contents[i],
+ &XVECTOR (menu_bar_items_vector)->contents[i + 4],
+ (menu_bar_items_index - i - 4) * sizeof (Lisp_Object));
menu_bar_items_index -= 4;
}
}
@@ -7743,8 +7694,7 @@ menu_bar_item (key, item, dummy1, dummy2)
/* This is used as the handler when calling menu_item_eval_property. */
static Lisp_Object
-menu_item_eval_property_1 (arg)
- Lisp_Object arg;
+menu_item_eval_property_1 (Lisp_Object arg)
{
/* If we got a quit from within the menu computation,
quit all the way out of it. This takes care of C-] in the debugger. */
@@ -7757,8 +7707,7 @@ menu_item_eval_property_1 (arg)
/* Evaluate an expression and return the result (or nil if something
went wrong). Used to evaluate dynamic parts of menu items. */
Lisp_Object
-menu_item_eval_property (sexpr)
- Lisp_Object sexpr;
+menu_item_eval_property (Lisp_Object sexpr)
{
int count = SPECPDL_INDEX ();
Lisp_Object val;
@@ -7778,9 +7727,7 @@ menu_item_eval_property (sexpr)
otherwise. */
int
-parse_menu_item (item, inmenubar)
- Lisp_Object item;
- int inmenubar;
+parse_menu_item (Lisp_Object item, int inmenubar)
{
Lisp_Object def, tem, item_string, start;
Lisp_Object filter;
@@ -8077,10 +8024,10 @@ Lisp_Object Qrtl;
/* Function prototypes. */
-static void init_tool_bar_items P_ ((Lisp_Object));
-static void process_tool_bar_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object, void*));
-static int parse_tool_bar_item P_ ((Lisp_Object, Lisp_Object));
-static void append_tool_bar_item P_ ((void));
+static void init_tool_bar_items (Lisp_Object);
+static void process_tool_bar_item (Lisp_Object, Lisp_Object, Lisp_Object, void*);
+static int parse_tool_bar_item (Lisp_Object, Lisp_Object);
+static void append_tool_bar_item (void);
/* Return a vector of tool bar items for keymaps currently in effect.
@@ -8088,9 +8035,7 @@ static void append_tool_bar_item P_ ((void));
tool bar items found. */
Lisp_Object
-tool_bar_items (reuse, nitems)
- Lisp_Object reuse;
- int *nitems;
+tool_bar_items (Lisp_Object reuse, int *nitems)
{
Lisp_Object *maps;
int nmaps, i;
@@ -8139,7 +8084,7 @@ tool_bar_items (reuse, nitems)
nmaps = 0;
if (tem = get_local_map (PT, current_buffer, Qkeymap), !NILP (tem))
maps[nmaps++] = tem;
- bcopy (tmaps, (void *) (maps + nmaps), nminor * sizeof (maps[0]));
+ memcpy (maps + nmaps, tmaps, nminor * sizeof (maps[0]));
nmaps += nminor;
maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map);
}
@@ -8168,9 +8113,7 @@ tool_bar_items (reuse, nitems)
/* Process the definition of KEY which is DEF. */
static void
-process_tool_bar_item (key, def, data, args)
- Lisp_Object key, def, data;
- void *args;
+process_tool_bar_item (Lisp_Object key, Lisp_Object def, Lisp_Object data, void *args)
{
int i;
extern Lisp_Object Qundefined;
@@ -8191,9 +8134,9 @@ process_tool_bar_item (key, def, data, args)
if (EQ (key, v[TOOL_BAR_ITEM_KEY]))
{
if (ntool_bar_items > i + TOOL_BAR_ITEM_NSLOTS)
- bcopy (v + TOOL_BAR_ITEM_NSLOTS, v,
- ((ntool_bar_items - i - TOOL_BAR_ITEM_NSLOTS)
- * sizeof (Lisp_Object)));
+ memmove (v, v + TOOL_BAR_ITEM_NSLOTS,
+ ((ntool_bar_items - i - TOOL_BAR_ITEM_NSLOTS)
+ * sizeof (Lisp_Object)));
ntool_bar_items -= TOOL_BAR_ITEM_NSLOTS;
break;
}
@@ -8255,8 +8198,7 @@ process_tool_bar_item (key, def, data, args)
A text label to show with the tool bar button if labels are enabled. */
static int
-parse_tool_bar_item (key, item)
- Lisp_Object key, item;
+parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
{
/* Access slot with index IDX of vector tool_bar_item_properties. */
#define PROP(IDX) XVECTOR (tool_bar_item_properties)->contents[IDX]
@@ -8386,7 +8328,7 @@ parse_tool_bar_item (key, item)
EMACS_INT max_lbl = 2*tool_bar_max_label_size;
Lisp_Object new_lbl;
- if (strlen (caption) < max_lbl && caption[0] != '\0')
+ if (strlen (caption) < max_lbl && caption[0] != '\0')
{
strcpy (buf, caption);
while (buf[0] != '\0' && buf[strlen (buf) -1] == '.')
@@ -8398,17 +8340,17 @@ parse_tool_bar_item (key, item)
if (strlen (caption) <= max_lbl)
label = caption;
- if (strlen (label) <= max_lbl && label[0] != '\0')
+ if (strlen (label) <= max_lbl && label[0] != '\0')
{
int i;
if (label != buf) strcpy (buf, label);
- for (i = 0; i < strlen (buf); ++i)
+ for (i = 0; i < strlen (buf); ++i)
{
if (buf[i] == '-') buf[i] = ' ';
}
label = buf;
-
+
}
else label = "";
@@ -8448,8 +8390,7 @@ parse_tool_bar_item (key, item)
that can be reused. */
static void
-init_tool_bar_items (reuse)
- Lisp_Object reuse;
+init_tool_bar_items (Lisp_Object reuse)
{
if (VECTORP (reuse))
tool_bar_items_vector = reuse;
@@ -8463,7 +8404,7 @@ init_tool_bar_items (reuse)
tool_bar_item_properties */
static void
-append_tool_bar_item ()
+append_tool_bar_item (void)
{
Lisp_Object *to, *from;
@@ -8478,7 +8419,7 @@ append_tool_bar_item ()
tool_bar_items_vector. */
to = XVECTOR (tool_bar_items_vector)->contents + ntool_bar_items;
from = XVECTOR (tool_bar_item_properties)->contents;
- bcopy (from, to, TOOL_BAR_ITEM_NSLOTS * sizeof *to);
+ memcpy (to, from, TOOL_BAR_ITEM_NSLOTS * sizeof *to);
ntool_bar_items += TOOL_BAR_ITEM_NSLOTS;
}
@@ -8507,11 +8448,8 @@ append_tool_bar_item ()
and do auto-saving in the inner call of read_char. */
static Lisp_Object
-read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu)
- int nmaps;
- Lisp_Object *maps;
- Lisp_Object prev_event;
- int *used_mouse_menu;
+read_char_x_menu_prompt (int nmaps, Lisp_Object *maps, Lisp_Object prev_event,
+ int *used_mouse_menu)
{
int mapno;
@@ -8595,10 +8533,7 @@ static char *read_char_minibuf_menu_text;
static int read_char_minibuf_menu_width;
static Lisp_Object
-read_char_minibuf_menu_prompt (commandflag, nmaps, maps)
- int commandflag ;
- int nmaps;
- Lisp_Object *maps;
+read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps)
{
int mapno;
register Lisp_Object name;
@@ -8777,7 +8712,7 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps)
thiswidth = SCHARS (desc);
if (thiswidth + i > width)
thiswidth = width - i;
- bcopy (SDATA (desc), menu + i, thiswidth);
+ memcpy (menu + i, SDATA (desc), thiswidth);
i += thiswidth;
strcpy (menu + i, " = ");
i += 3;
@@ -8787,7 +8722,7 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps)
thiswidth = SCHARS (s);
if (thiswidth + i > width)
thiswidth = width - i;
- bcopy (SDATA (s), menu + i, thiswidth);
+ memcpy (menu + i, SDATA (s), thiswidth);
i += thiswidth;
menu[i] = 0;
}
@@ -8863,10 +8798,8 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps)
NEXT may be the same array as CURRENT. */
static int
-follow_key (key, nmaps, current, defs, next)
- Lisp_Object key;
- Lisp_Object *current, *defs, *next;
- int nmaps;
+follow_key (Lisp_Object key, int nmaps, Lisp_Object *current, Lisp_Object *defs,
+ Lisp_Object *next)
{
int i, first_binding;
@@ -8915,9 +8848,8 @@ typedef struct keyremap
that it is indeed a vector). */
static Lisp_Object
-access_keymap_keyremap (map, key, prompt, do_funcall)
- Lisp_Object map, key, prompt;
- int do_funcall;
+access_keymap_keyremap (Lisp_Object map, Lisp_Object key, Lisp_Object prompt,
+ int do_funcall)
{
Lisp_Object next;
@@ -8968,10 +8900,8 @@ access_keymap_keyremap (map, key, prompt, do_funcall)
The return value is non-zero if the remapping actually took place. */
static int
-keyremap_step (keybuf, bufsize, fkey, input, doit, diff, prompt)
- Lisp_Object *keybuf, prompt;
- keyremap *fkey;
- int input, doit, *diff, bufsize;
+keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey,
+ int input, int doit, int *diff, Lisp_Object prompt)
{
Lisp_Object next, key;
@@ -9063,57 +8993,52 @@ keyremap_step (keybuf, bufsize, fkey, input, doit, diff, prompt)
from the selected window's buffer. */
static int
-read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
- can_return_switch_frame, fix_current_buffer)
- Lisp_Object *keybuf;
- int bufsize;
- Lisp_Object prompt;
- int dont_downcase_last;
- int can_return_switch_frame;
- int fix_current_buffer;
-{
- volatile Lisp_Object from_string;
- volatile int count = SPECPDL_INDEX ();
+read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
+ int dont_downcase_last, int can_return_switch_frame,
+ int fix_current_buffer)
+{
+ Lisp_Object from_string;
+ int count = SPECPDL_INDEX ();
/* How many keys there are in the current key sequence. */
- volatile int t;
+ int t;
/* The length of the echo buffer when we started reading, and
the length of this_command_keys when we started reading. */
- volatile int echo_start;
- volatile int keys_start;
+ int echo_start;
+ int keys_start;
/* The number of keymaps we're scanning right now, and the number of
keymaps we have allocated space for. */
- volatile int nmaps;
- volatile int nmaps_allocated = 0;
+ int nmaps;
+ int nmaps_allocated = 0;
/* defs[0..nmaps-1] are the definitions of KEYBUF[0..t-1] in
the current keymaps. */
- Lisp_Object *volatile defs = NULL;
+ Lisp_Object *defs = NULL;
/* submaps[0..nmaps-1] are the prefix definitions of KEYBUF[0..t-1]
in the current keymaps, or nil where it is not a prefix. */
- Lisp_Object *volatile submaps = NULL;
+ Lisp_Object *submaps = NULL;
/* The local map to start out with at start of key sequence. */
- volatile Lisp_Object orig_local_map;
+ Lisp_Object orig_local_map;
/* The map from the `keymap' property to start out with at start of
key sequence. */
- volatile Lisp_Object orig_keymap;
+ Lisp_Object orig_keymap;
/* 1 if we have already considered switching to the local-map property
of the place where a mouse click occurred. */
- volatile int localized_local_map = 0;
+ int localized_local_map = 0;
/* The index in submaps[] of the first keymap that has a binding for
this key sequence. In other words, the lowest i such that
submaps[i] is non-nil. */
- volatile int first_binding;
+ int first_binding;
/* Index of the first key that has no binding.
It is useless to try fkey.start larger than that. */
- volatile int first_unbound;
+ int first_unbound;
/* If t < mock_input, then KEYBUF[t] should be read as the next
input key.
@@ -9128,7 +9053,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
restart_sequence; the loop will read keys from keybuf up until
mock_input, thus rebuilding the state; and then it will resume
reading characters from the keyboard. */
- volatile int mock_input = 0;
+ int mock_input = 0;
/* If the sequence is unbound in submaps[], then
keybuf[fkey.start..fkey.end-1] is a prefix in Vfunction_key_map,
@@ -9138,28 +9063,28 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
should hold off until t reaches them. We do this when we've just
recognized a function key, to avoid searching for the function
key's again in Vfunction_key_map. */
- volatile keyremap fkey;
+ keyremap fkey;
/* Likewise, for key_translation_map and input-decode-map. */
- volatile keyremap keytran, indec;
+ keyremap keytran, indec;
/* Non-zero if we are trying to map a key by changing an upper-case
letter to lower case, or a shifted function key to an unshifted
one. */
- volatile int shift_translated = 0;
+ int shift_translated = 0;
/* If we receive a `switch-frame' or `select-window' event in the middle of
a key sequence, we put it off for later.
While we're reading, we keep the event here. */
- volatile Lisp_Object delayed_switch_frame;
+ Lisp_Object delayed_switch_frame;
/* See the comment below... */
#if defined (GOBBLE_FIRST_EVENT)
Lisp_Object first_event;
#endif
- volatile Lisp_Object original_uppercase;
- volatile int original_uppercase_position = -1;
+ Lisp_Object original_uppercase;
+ int original_uppercase_position = -1;
/* Gets around Microsoft compiler limitations. */
int dummyflag = 0;
@@ -9167,7 +9092,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
struct buffer *starting_buffer;
/* List of events for which a fake prefix key has been generated. */
- volatile Lisp_Object fake_prefixed_keys = Qnil;
+ Lisp_Object fake_prefixed_keys = Qnil;
#if defined (GOBBLE_FIRST_EVENT)
int junk;
@@ -9281,8 +9206,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
if (!NILP (orig_keymap))
submaps[nmaps++] = orig_keymap;
- bcopy (maps, (void *) (submaps + nmaps),
- nminor * sizeof (submaps[0]));
+ memcpy (submaps + nmaps, maps, nminor * sizeof (submaps[0]));
nmaps += nminor;
@@ -9325,13 +9249,13 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
(say, a mouse click on the mode line which is being treated
as [mode-line (mouse-...)], then we backtrack to this point
of keybuf. */
- volatile int last_real_key_start;
+ int last_real_key_start;
/* These variables are analogous to echo_start and keys_start;
while those allow us to restart the entire key sequence,
echo_local_start and keys_local_start allow us to throw away
just one key. */
- volatile int echo_local_start, keys_local_start, local_first_binding;
+ int echo_local_start, keys_local_start, local_first_binding;
eassert (indec.end == t || (indec.end > t && indec.end <= mock_input));
eassert (indec.start <= indec.end);
@@ -10197,10 +10121,7 @@ The optional fifth argument COMMAND-LOOP, if non-nil, means
that this key sequence is being read by something that will
read commands one after another. It should be nil if the caller
will read just one key sequence. */)
- (prompt, continue_echo, dont_downcase_last, can_return_switch_frame,
- command_loop)
- Lisp_Object prompt, continue_echo, dont_downcase_last;
- Lisp_Object can_return_switch_frame, command_loop;
+ (Lisp_Object prompt, Lisp_Object continue_echo, Lisp_Object dont_downcase_last, Lisp_Object can_return_switch_frame, Lisp_Object command_loop)
{
Lisp_Object keybuf[30];
register int i;
@@ -10216,7 +10137,7 @@ will read just one key sequence. */)
specbind (Qinput_method_use_echo_area,
(NILP (command_loop) ? Qt : Qnil));
- bzero (keybuf, sizeof keybuf);
+ memset (keybuf, 0, sizeof keybuf);
GCPRO1 (keybuf[0]);
gcpro1.nvars = (sizeof keybuf/sizeof (keybuf[0]));
@@ -10257,10 +10178,7 @@ will read just one key sequence. */)
DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
Sread_key_sequence_vector, 1, 5, 0,
doc: /* Like `read-key-sequence' but always return a vector. */)
- (prompt, continue_echo, dont_downcase_last, can_return_switch_frame,
- command_loop)
- Lisp_Object prompt, continue_echo, dont_downcase_last;
- Lisp_Object can_return_switch_frame, command_loop;
+ (Lisp_Object prompt, Lisp_Object continue_echo, Lisp_Object dont_downcase_last, Lisp_Object can_return_switch_frame, Lisp_Object command_loop)
{
Lisp_Object keybuf[30];
register int i;
@@ -10276,7 +10194,7 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
specbind (Qinput_method_use_echo_area,
(NILP (command_loop) ? Qt : Qnil));
- bzero (keybuf, sizeof keybuf);
+ memset (keybuf, 0, sizeof keybuf);
GCPRO1 (keybuf[0]);
gcpro1.nvars = (sizeof keybuf/sizeof (keybuf[0]));
@@ -10320,8 +10238,7 @@ The argument KEYS specifies the value to use instead of (this-command-keys)
when reading the arguments; if it is nil, (this-command-keys) is used.
The argument SPECIAL, if non-nil, means that this command is executing
a special event, so ignore the prefix argument and don't clear it. */)
- (cmd, record_flag, keys, special)
- Lisp_Object cmd, record_flag, keys, special;
+ (Lisp_Object cmd, Lisp_Object record_flag, Lisp_Object keys, Lisp_Object special)
{
register Lisp_Object final;
register Lisp_Object tem;
@@ -10410,8 +10327,7 @@ the numeric argument to this command.
Noninteractively, the argument PREFIXARG is the prefix argument to
give to the command you invoke, if it asks for an argument. */)
- (prefixarg)
- Lisp_Object prefixarg;
+ (Lisp_Object prefixarg)
{
Lisp_Object function;
char buf[40];
@@ -10565,7 +10481,7 @@ give to the command you invoke, if it asks for an argument. */)
/* Return nonzero if input events are pending. */
int
-detect_input_pending ()
+detect_input_pending (void)
{
if (!input_pending)
get_input_pending (&input_pending, 0);
@@ -10577,7 +10493,7 @@ detect_input_pending ()
pending. */
int
-detect_input_pending_ignore_squeezables ()
+detect_input_pending_ignore_squeezables (void)
{
if (!input_pending)
get_input_pending (&input_pending, READABLE_EVENTS_IGNORE_SQUEEZABLES);
@@ -10588,8 +10504,7 @@ detect_input_pending_ignore_squeezables ()
/* Return nonzero if input events are pending, and run any pending timers. */
int
-detect_input_pending_run_timers (do_display)
- int do_display;
+detect_input_pending_run_timers (int do_display)
{
int old_timers_run = timers_run;
@@ -10620,7 +10535,7 @@ detect_input_pending_run_timers (do_display)
So calling this function unnecessarily can't do any harm. */
void
-clear_input_pending ()
+clear_input_pending (void)
{
input_pending = 0;
}
@@ -10632,7 +10547,7 @@ clear_input_pending ()
to do in that case. It isn't trivial. */
int
-requeued_events_pending_p ()
+requeued_events_pending_p (void)
{
return (!NILP (Vunread_command_events) || unread_command_char != -1);
}
@@ -10642,7 +10557,7 @@ DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 0, 0,
doc: /* Return t if command input is currently available with no wait.
Actually, the value is nil only if we can be sure that no input is available;
if there is a doubt, the value is t. */)
- ()
+ (void)
{
if (!NILP (Vunread_command_events) || unread_command_char != -1
|| !NILP (Vunread_post_input_method_events)
@@ -10657,7 +10572,7 @@ if there is a doubt, the value is t. */)
DEFUN ("recent-keys", Frecent_keys, Srecent_keys, 0, 0, 0,
doc: /* Return vector of last 300 events, not counting those from keyboard macros. */)
- ()
+ (void)
{
Lisp_Object *keys = XVECTOR (recent_keys)->contents;
Lisp_Object val;
@@ -10667,12 +10582,10 @@ DEFUN ("recent-keys", Frecent_keys, Srecent_keys, 0, 0, 0,
else
{
val = Fvector (NUM_RECENT_KEYS, keys);
- bcopy (keys + recent_keys_index,
- XVECTOR (val)->contents,
- (NUM_RECENT_KEYS - recent_keys_index) * sizeof (Lisp_Object));
- bcopy (keys,
- XVECTOR (val)->contents + NUM_RECENT_KEYS - recent_keys_index,
- recent_keys_index * sizeof (Lisp_Object));
+ memcpy (XVECTOR (val)->contents, keys + recent_keys_index,
+ (NUM_RECENT_KEYS - recent_keys_index) * sizeof (Lisp_Object));
+ memcpy (XVECTOR (val)->contents + NUM_RECENT_KEYS - recent_keys_index,
+ keys, recent_keys_index * sizeof (Lisp_Object));
return val;
}
}
@@ -10684,7 +10597,7 @@ the last key sequence that has been read.
The value is a string or a vector.
See also `this-command-keys-vector'. */)
- ()
+ (void)
{
return make_event_array (this_command_key_count,
XVECTOR (this_command_keys)->contents);
@@ -10696,7 +10609,7 @@ However, if the command has called `read-key-sequence', it returns
the last key sequence that has been read.
See also `this-command-keys'. */)
- ()
+ (void)
{
return Fvector (this_command_key_count,
XVECTOR (this_command_keys)->contents);
@@ -10710,7 +10623,7 @@ the command loop or by `read-key-sequence'.
Unlike `this-command-keys', this function's value
does not include prefix arguments.
The value is always a vector. */)
- ()
+ (void)
{
return Fvector (this_command_key_count
- this_single_command_key_start,
@@ -10726,7 +10639,7 @@ the command loop or by `read-key-sequence'.
Unlike `this-single-command-keys', this function's value
shows the events before all translations (except for input methods).
The value is always a vector. */)
- ()
+ (void)
{
return Fvector (raw_keybuf_count,
(XVECTOR (raw_keybuf)->contents));
@@ -10744,7 +10657,7 @@ both in the value of (this-command-keys) and in echoing.
To achieve this, `universal-argument-other-key' calls
`reset-this-command-lengths', which discards the record of reading
these events the first time. */)
- ()
+ (void)
{
this_command_key_count = before_command_key_count;
if (this_command_key_count < this_single_command_key_start)
@@ -10764,8 +10677,7 @@ DEFUN ("clear-this-command-keys", Fclear_this_command_keys,
doc: /* Clear out the vector that `this-command-keys' returns.
Also clear the record of the last 100 events, unless optional arg
KEEP-RECORD is non-nil. */)
- (keep_record)
- Lisp_Object keep_record;
+ (Lisp_Object keep_record)
{
int i;
@@ -10784,7 +10696,7 @@ KEEP-RECORD is non-nil. */)
DEFUN ("recursion-depth", Frecursion_depth, Srecursion_depth, 0, 0, 0,
doc: /* Return the current depth in recursive edits. */)
- ()
+ (void)
{
Lisp_Object temp;
XSETFASTINT (temp, command_loop_level + minibuf_level);
@@ -10795,8 +10707,7 @@ DEFUN ("open-dribble-file", Fopen_dribble_file, Sopen_dribble_file, 1, 1,
"FOpen dribble file: ",
doc: /* Start writing all keyboard characters to a dribble file called FILE.
If FILE is nil, close any open dribble file. */)
- (file)
- Lisp_Object file;
+ (Lisp_Object file)
{
if (dribble)
{
@@ -10818,7 +10729,7 @@ If FILE is nil, close any open dribble file. */)
DEFUN ("discard-input", Fdiscard_input, Sdiscard_input, 0, 0, 0,
doc: /* Discard the contents of the terminal input buffer.
Also end any kbd macro being defined. */)
- ()
+ (void)
{
if (!NILP (current_kboard->defining_kbd_macro))
{
@@ -10853,8 +10764,7 @@ After resumption run the normal hook `suspend-resume-hook'.
Some operating systems cannot stop the Emacs process and resume it later.
On such systems, Emacs starts a subshell instead of suspending. */)
- (stuffstring)
- Lisp_Object stuffstring;
+ (Lisp_Object stuffstring)
{
int count = SPECPDL_INDEX ();
int old_height, old_width;
@@ -10876,7 +10786,7 @@ On such systems, Emacs starts a subshell instead of suspending. */)
reset_all_sys_modes ();
/* sys_suspend can get an error if it tries to fork a subshell
and the system resources aren't available for that. */
- record_unwind_protect ((Lisp_Object (*) P_ ((Lisp_Object))) init_all_sys_modes,
+ record_unwind_protect ((Lisp_Object (*) (Lisp_Object)) init_all_sys_modes,
Qnil);
stuff_buffered_input (stuffstring);
if (cannot_suspend)
@@ -10904,8 +10814,7 @@ On such systems, Emacs starts a subshell instead of suspending. */)
Then in any case stuff anything Emacs has read ahead and not used. */
void
-stuff_buffered_input (stuffstring)
- Lisp_Object stuffstring;
+stuff_buffered_input (Lisp_Object stuffstring)
{
#ifdef SIGTSTP /* stuff_char is defined if SIGTSTP. */
register unsigned char *p;
@@ -10943,8 +10852,7 @@ stuff_buffered_input (stuffstring)
}
void
-set_waiting_for_input (time_to_clear)
- EMACS_TIME *time_to_clear;
+set_waiting_for_input (struct timeval *time_to_clear)
{
input_available_clear_time = time_to_clear;
@@ -10958,7 +10866,7 @@ set_waiting_for_input (time_to_clear)
}
void
-clear_waiting_for_input ()
+clear_waiting_for_input (void)
{
/* Tell handle_interrupt not to throw back to read_char, */
waiting_for_input = 0;
@@ -10972,8 +10880,8 @@ clear_waiting_for_input ()
Otherwise, the handler kills Emacs. */
static SIGTYPE
-interrupt_signal (signalnum) /* If we don't have an argument, */
- int signalnum; /* some compilers complain in signal calls. */
+interrupt_signal (int signalnum) /* If we don't have an argument, some */
+ /* compilers complain in signal calls. */
{
/* Must preserve main program's value of errno. */
int old_errno = errno;
@@ -11017,7 +10925,7 @@ interrupt_signal (signalnum) /* If we don't have an argument, */
non-nil, it stops the job right away. */
static void
-handle_interrupt ()
+handle_interrupt (void)
{
char c;
@@ -11143,7 +11051,7 @@ handle_interrupt ()
/* Handle a C-g by making read_char return C-g. */
void
-quit_throw_to_read_char ()
+quit_throw_to_read_char (void)
{
sigfree ();
/* Prevent another signal from doing this before we finish. */
@@ -11176,8 +11084,7 @@ If INTERRUPT is non-nil, Emacs will use input interrupts;
otherwise Emacs uses CBREAK mode.
See also `current-input-mode'. */)
- (interrupt)
- Lisp_Object interrupt;
+ (Lisp_Object interrupt)
{
int new_interrupt_input;
#ifdef SIGIO
@@ -11227,8 +11134,7 @@ This setting only has an effect on tty terminals and only when
Emacs reads input in CBREAK mode; see `set-input-interrupt-mode'.
See also `current-input-mode'. */)
- (flow, terminal)
- Lisp_Object flow, terminal;
+ (Lisp_Object flow, Lisp_Object terminal)
{
struct terminal *t = get_terminal (terminal, 1);
struct tty_display_info *tty;
@@ -11270,8 +11176,7 @@ It may be a terminal object, a frame, or nil for the terminal used by
the currently selected frame.
See also `current-input-mode'. */)
- (meta, terminal)
- Lisp_Object meta, terminal;
+ (Lisp_Object meta, Lisp_Object terminal)
{
struct terminal *t = get_terminal (terminal, 1);
struct tty_display_info *tty;
@@ -11312,8 +11217,7 @@ This function only has an effect on the controlling tty of the Emacs
process.
See also `current-input-mode'. */)
- (quit)
- Lisp_Object quit;
+ (Lisp_Object quit)
{
struct terminal *t = get_named_tty ("/dev/tty");
struct tty_display_info *tty;
@@ -11350,8 +11254,7 @@ Third arg META t means accept 8-bit input (for a Meta key).
Otherwise, accept 8-bit input and don't use the top bit for Meta.
Optional fourth arg QUIT if non-nil specifies character to use for quitting.
See also `current-input-mode'. */)
- (interrupt, flow, meta, quit)
- Lisp_Object interrupt, flow, meta, quit;
+ (Lisp_Object interrupt, Lisp_Object flow, Lisp_Object meta, Lisp_Object quit)
{
Fset_input_interrupt_mode (interrupt);
Fset_output_flow_control (flow, Qnil);
@@ -11375,7 +11278,7 @@ The value is a list of the form (INTERRUPT FLOW META QUIT), where
QUIT is the character Emacs currently uses to quit.
The elements of this list correspond to the arguments of
`set-input-mode'. */)
- ()
+ (void)
{
Lisp_Object val[4];
struct frame *sf = XFRAME (selected_frame);
@@ -11409,8 +11312,7 @@ The return value is similar to a mouse click position:
(WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW)
IMAGE (DX . DY) (WIDTH . HEIGHT))
The `posn-' functions access elements of such lists. */)
- (x, y, frame_or_window, whole)
- Lisp_Object x, y, frame_or_window, whole;
+ (Lisp_Object x, Lisp_Object y, Lisp_Object frame_or_window, Lisp_Object whole)
{
CHECK_NATNUM (x);
CHECK_NATNUM (y);
@@ -11450,8 +11352,7 @@ to the given buffer position:
(WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW)
IMAGE (DX . DY) (WIDTH . HEIGHT))
The `posn-' functions access elements of such lists. */)
- (pos, window)
- Lisp_Object pos, window;
+ (Lisp_Object pos, Lisp_Object window)
{
Lisp_Object tem;
@@ -11478,8 +11379,7 @@ The `posn-' functions access elements of such lists. */)
* Set up a new kboard object with reasonable initial values.
*/
void
-init_kboard (kb)
- KBOARD *kb;
+init_kboard (KBOARD *kb)
{
kb->Voverriding_terminal_local_map = Qnil;
kb->Vlast_command = Qnil;
@@ -11513,8 +11413,7 @@ init_kboard (kb)
* it a second time.
*/
static void
-wipe_kboard (kb)
- KBOARD *kb;
+wipe_kboard (KBOARD *kb)
{
xfree (kb->kbd_macro_buffer);
}
@@ -11522,8 +11421,7 @@ wipe_kboard (kb)
/* Free KB and memory referenced from it. */
void
-delete_kboard (kb)
- KBOARD *kb;
+delete_kboard (KBOARD *kb)
{
KBOARD **kbp;
@@ -11548,7 +11446,7 @@ delete_kboard (kb)
}
void
-init_keyboard ()
+init_keyboard (void)
{
/* This is correct before outermost invocation of the editor loop */
command_loop_level = -1;
@@ -11635,7 +11533,7 @@ struct event_head {
Lisp_Object *kind;
};
-struct event_head head_table[] = {
+static const struct event_head head_table[] = {
{&Qmouse_movement, "mouse-movement", &Qmouse_movement},
{&Qscroll_bar_movement, "scroll-bar-movement", &Qmouse_movement},
{&Qswitch_frame, "switch-frame", &Qswitch_frame},
@@ -11648,7 +11546,7 @@ struct event_head head_table[] = {
};
void
-syms_of_keyboard ()
+syms_of_keyboard (void)
{
pending_funcalls = Qnil;
staticpro (&pending_funcalls);
@@ -11820,7 +11718,7 @@ syms_of_keyboard ()
last_point_position_window = Qnil;
{
- struct event_head *p;
+ const struct event_head *p;
for (p = head_table;
p < head_table + (sizeof (head_table) / sizeof (head_table[0]));
@@ -12424,7 +12322,7 @@ and tool-bar buttons. */);
}
void
-keys_of_keyboard ()
+keys_of_keyboard (void)
{
initial_define_key (global_map, Ctl ('Z'), "suspend-emacs");
initial_define_key (control_x_map, Ctl ('Z'), "suspend-emacs");
@@ -12484,7 +12382,7 @@ keys_of_keyboard ()
/* Mark the pointers in the kboard objects.
Called by the Fgarbage_collector. */
void
-mark_kboards ()
+mark_kboards (void)
{
KBOARD *kb;
Lisp_Object *p;
diff --git a/src/keyboard.h b/src/keyboard.h
index 27fc0e5eb6a..a6eb750c373 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -300,7 +300,7 @@ enum menu_item_idx
MENU_ITEMS_ITEM_LENGTH
};
-extern Lisp_Object unuse_menu_items P_ ((Lisp_Object dummy));
+extern Lisp_Object unuse_menu_items (Lisp_Object dummy);
/* This is how to deal with multibyte text if HAVE_MULTILINGUAL_MENU
isn't defined. The use of HAVE_MULTILINGUAL_MENU could probably be
@@ -366,8 +366,8 @@ typedef struct _widget_value
struct _widget_value* next;
} widget_value;
-extern widget_value *xmalloc_widget_value P_ ((void));
-extern widget_value *digest_single_submenu P_ ((int, int, int));
+extern widget_value *xmalloc_widget_value (void);
+extern widget_value *digest_single_submenu (int, int, int);
#endif /* HAVE_NS || HAVE_NTGUI */
@@ -430,10 +430,10 @@ extern Lisp_Object Qmode_line, Qvertical_line, Qheader_line;
/* Forward declaration for prototypes. */
struct input_event;
-extern Lisp_Object parse_modifiers P_ ((Lisp_Object));
-extern Lisp_Object reorder_modifiers P_ ((Lisp_Object));
-extern Lisp_Object read_char P_ ((int, int, Lisp_Object *, Lisp_Object,
- int *, EMACS_TIME *));
+extern Lisp_Object parse_modifiers (Lisp_Object);
+extern Lisp_Object reorder_modifiers (Lisp_Object);
+extern Lisp_Object read_char (int, int, Lisp_Object *, Lisp_Object,
+ int *, EMACS_TIME *);
extern int parse_solitary_modifier (Lisp_Object symbol);
@@ -445,50 +445,49 @@ extern Lisp_Object Vkey_translation_map;
extern int parse_menu_item (Lisp_Object, int);
-extern void echo_now P_ ((void));
-extern void init_kboard P_ ((KBOARD *));
-extern void delete_kboard P_ ((KBOARD *));
-extern void not_single_kboard_state P_ ((KBOARD *));
-extern void push_kboard P_ ((struct kboard *));
-extern void push_frame_kboard P_ ((struct frame *));
-extern void pop_kboard P_ ((void));
-extern void temporarily_switch_to_single_kboard P_ ((struct frame *));
-extern void record_asynch_buffer_change P_ ((void));
-extern SIGTYPE input_poll_signal P_ ((int));
-extern void start_polling P_ ((void));
-extern void stop_polling P_ ((void));
-extern void set_poll_suppress_count P_ ((int));
-extern void gobble_input P_ ((int));
-extern int input_polling_used P_ ((void));
-extern void clear_input_pending P_ ((void));
-extern int requeued_events_pending_p P_ ((void));
-extern void bind_polling_period P_ ((int));
-extern void stuff_buffered_input P_ ((Lisp_Object));
-extern void clear_waiting_for_input P_ ((void));
-extern void swallow_events P_ ((int));
-extern int help_char_p P_ ((Lisp_Object));
-extern void quit_throw_to_read_char P_ ((void)) NO_RETURN;
-extern void cmd_error_internal P_ ((Lisp_Object, char *));
-extern int lucid_event_type_list_p P_ ((Lisp_Object));
-extern void kbd_buffer_store_event P_ ((struct input_event *));
-extern void kbd_buffer_store_event_hold P_ ((struct input_event *,
- struct input_event *));
-extern void kbd_buffer_unget_event P_ ((struct input_event *));
+extern void echo_now (void);
+extern void init_kboard (KBOARD *);
+extern void delete_kboard (KBOARD *);
+extern void not_single_kboard_state (KBOARD *);
+extern void push_kboard (struct kboard *);
+extern void push_frame_kboard (struct frame *);
+extern void pop_kboard (void);
+extern void temporarily_switch_to_single_kboard (struct frame *);
+extern void record_asynch_buffer_change (void);
+extern SIGTYPE input_poll_signal (int);
+extern void start_polling (void);
+extern void stop_polling (void);
+extern void set_poll_suppress_count (int);
+extern void gobble_input (int);
+extern int input_polling_used (void);
+extern void clear_input_pending (void);
+extern int requeued_events_pending_p (void);
+extern void bind_polling_period (int);
+extern void stuff_buffered_input (Lisp_Object);
+extern void clear_waiting_for_input (void);
+extern void swallow_events (int);
+extern int help_char_p (Lisp_Object);
+extern void quit_throw_to_read_char (void) NO_RETURN;
+extern int lucid_event_type_list_p (Lisp_Object);
+extern void kbd_buffer_store_event (struct input_event *);
+extern void kbd_buffer_store_event_hold (struct input_event *,
+ struct input_event *);
+extern void kbd_buffer_unget_event (struct input_event *);
#ifdef POLL_FOR_INPUT
-extern void poll_for_input_1 P_ ((void));
+extern void poll_for_input_1 (void);
#endif
-extern void show_help_echo P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
- Lisp_Object, int));
-extern void gen_help_event P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
- Lisp_Object, int));
-extern void kbd_buffer_store_help_event P_ ((Lisp_Object, Lisp_Object));
-extern Lisp_Object menu_item_eval_property P_ ((Lisp_Object));
-extern int kbd_buffer_events_waiting P_ ((int));
-extern void add_user_signal P_ ((int, const char *));
-
-extern int tty_read_avail_input P_ ((struct terminal *, int,
- struct input_event *));
-extern EMACS_TIME timer_check P_ ((int));
+extern void show_help_echo (Lisp_Object, Lisp_Object, Lisp_Object,
+ Lisp_Object, int);
+extern void gen_help_event (Lisp_Object, Lisp_Object, Lisp_Object,
+ Lisp_Object, int);
+extern void kbd_buffer_store_help_event (Lisp_Object, Lisp_Object);
+extern Lisp_Object menu_item_eval_property (Lisp_Object);
+extern int kbd_buffer_events_waiting (int);
+extern void add_user_signal (int, const char *);
+
+extern int tty_read_avail_input (struct terminal *, int,
+ struct input_event *);
+extern EMACS_TIME timer_check (int);
/* arch-tag: 769cbade-1ba9-4950-b886-db265b061aa3
(do not change this comment) */
diff --git a/src/keymap.c b/src/keymap.c
index c3a9d9e5cc0..8a0c855e0dc 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -115,20 +115,20 @@ static Lisp_Object where_is_cache;
/* Which keymaps are reverse-stored in the cache. */
static Lisp_Object where_is_cache_keymaps;
-static Lisp_Object store_in_keymap P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
-static void fix_submap_inheritance P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
-
-static Lisp_Object define_as_prefix P_ ((Lisp_Object, Lisp_Object));
-static void describe_command P_ ((Lisp_Object, Lisp_Object));
-static void describe_translation P_ ((Lisp_Object, Lisp_Object));
-static void describe_map P_ ((Lisp_Object, Lisp_Object,
- void (*) P_ ((Lisp_Object, Lisp_Object)),
- int, Lisp_Object, Lisp_Object*, int, int));
-static void describe_vector P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
- void (*) (Lisp_Object, Lisp_Object), int,
- Lisp_Object, Lisp_Object, int *,
- int, int, int));
-static void silly_event_symbol_error P_ ((Lisp_Object));
+static Lisp_Object store_in_keymap (Lisp_Object, Lisp_Object, Lisp_Object);
+static void fix_submap_inheritance (Lisp_Object, Lisp_Object, Lisp_Object);
+
+static Lisp_Object define_as_prefix (Lisp_Object, Lisp_Object);
+static void describe_command (Lisp_Object, Lisp_Object);
+static void describe_translation (Lisp_Object, Lisp_Object);
+static void describe_map (Lisp_Object, Lisp_Object,
+ void (*) (Lisp_Object, Lisp_Object),
+ int, Lisp_Object, Lisp_Object*, int, int);
+static void describe_vector (Lisp_Object, Lisp_Object, Lisp_Object,
+ void (*) (Lisp_Object, Lisp_Object), int,
+ Lisp_Object, Lisp_Object, int *,
+ int, int, int);
+static void silly_event_symbol_error (Lisp_Object);
/* Keymap object support - constructors and predicates. */
@@ -142,8 +142,7 @@ input stream. Initially, ALIST is nil.
The optional arg STRING supplies a menu name for the keymap
in case you use it as a menu with `x-popup-menu'. */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
Lisp_Object tail;
if (!NILP (string))
@@ -163,8 +162,7 @@ Initially the alist is nil.
The optional arg STRING supplies a menu name for the keymap
in case you use it as a menu with `x-popup-menu'. */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
if (!NILP (string))
{
@@ -183,19 +181,13 @@ in case you use it as a menu with `x-popup-menu'. */)
initial_define_key (control_x_map, Ctl('X'), "exchange-point-and-mark"); */
void
-initial_define_key (keymap, key, defname)
- Lisp_Object keymap;
- int key;
- char *defname;
+initial_define_key (Lisp_Object keymap, int key, char *defname)
{
store_in_keymap (keymap, make_number (key), intern_c_string (defname));
}
void
-initial_define_lispy_key (keymap, keyname, defname)
- Lisp_Object keymap;
- char *keyname;
- char *defname;
+initial_define_lispy_key (Lisp_Object keymap, char *keyname, char *defname)
{
store_in_keymap (keymap, intern_c_string (keyname), intern_c_string (defname));
}
@@ -208,8 +200,7 @@ or a symbol whose function definition is itself a keymap.
ALIST elements look like (CHAR . DEFN) or (SYMBOL . DEFN);
a vector of densely packed bindings for small character codes
is also allowed as an element. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
return (KEYMAPP (object) ? Qt : Qnil);
}
@@ -218,8 +209,7 @@ DEFUN ("keymap-prompt", Fkeymap_prompt, Skeymap_prompt, 1, 1, 0,
doc: /* Return the prompt-string of a keymap MAP.
If non-nil, the prompt is shown in the echo-area
when reading a key-sequence to be looked-up in this keymap. */)
- (map)
- Lisp_Object map;
+ (Lisp_Object map)
{
map = get_keymap (map, 0, 0);
while (CONSP (map))
@@ -255,9 +245,7 @@ when reading a key-sequence to be looked-up in this keymap. */)
do_autoload which can GC. */
Lisp_Object
-get_keymap (object, error, autoload)
- Lisp_Object object;
- int error, autoload;
+get_keymap (Lisp_Object object, int error, int autoload)
{
Lisp_Object tem;
@@ -309,9 +297,7 @@ get_keymap (object, error, autoload)
We assume that KEYMAP is a valid keymap. */
Lisp_Object
-keymap_parent (keymap, autoload)
- Lisp_Object keymap;
- int autoload;
+keymap_parent (Lisp_Object keymap, int autoload)
{
Lisp_Object list;
@@ -332,16 +318,14 @@ keymap_parent (keymap, autoload)
DEFUN ("keymap-parent", Fkeymap_parent, Skeymap_parent, 1, 1, 0,
doc: /* Return the parent keymap of KEYMAP.
If KEYMAP has no parent, return nil. */)
- (keymap)
- Lisp_Object keymap;
+ (Lisp_Object keymap)
{
return keymap_parent (keymap, 1);
}
/* Check whether MAP is one of MAPS parents. */
int
-keymap_memberp (map, maps)
- Lisp_Object map, maps;
+keymap_memberp (Lisp_Object map, Lisp_Object maps)
{
if (NILP (map)) return 0;
while (KEYMAPP (maps) && !EQ (map, maps))
@@ -354,8 +338,7 @@ keymap_memberp (map, maps)
DEFUN ("set-keymap-parent", Fset_keymap_parent, Sset_keymap_parent, 2, 2, 0,
doc: /* Modify KEYMAP to set its parent map to PARENT.
Return PARENT. PARENT should be nil or another keymap. */)
- (keymap, parent)
- Lisp_Object keymap, parent;
+ (Lisp_Object keymap, Lisp_Object parent)
{
Lisp_Object list, prev;
struct gcpro gcpro1, gcpro2;
@@ -437,8 +420,7 @@ Return PARENT. PARENT should be nil or another keymap. */)
make sure that SUBMAP inherits that definition as its own parent. */
static void
-fix_submap_inheritance (map, event, submap)
- Lisp_Object map, event, submap;
+fix_submap_inheritance (Lisp_Object map, Lisp_Object event, Lisp_Object submap)
{
Lisp_Object map_parent, parent_entry;
@@ -500,12 +482,7 @@ fix_submap_inheritance (map, event, submap)
If NOINHERIT, don't accept a subkeymap found in an inherited keymap. */
Lisp_Object
-access_keymap (map, idx, t_ok, noinherit, autoload)
- Lisp_Object map;
- Lisp_Object idx;
- int t_ok;
- int noinherit;
- int autoload;
+access_keymap (Lisp_Object map, Lisp_Object idx, int t_ok, int noinherit, int autoload)
{
Lisp_Object val;
@@ -634,10 +611,7 @@ access_keymap (map, idx, t_ok, noinherit, autoload)
}
static void
-map_keymap_item (fun, args, key, val, data)
- map_keymap_function_t fun;
- Lisp_Object args, key, val;
- void *data;
+map_keymap_item (map_keymap_function_t fun, Lisp_Object args, Lisp_Object key, Lisp_Object val, void *data)
{
/* We should maybe try to detect bindings shadowed by previous
ones and things like that. */
@@ -647,8 +621,7 @@ map_keymap_item (fun, args, key, val, data)
}
static void
-map_keymap_char_table_item (args, key, val)
- Lisp_Object args, key, val;
+map_keymap_char_table_item (Lisp_Object args, Lisp_Object key, Lisp_Object val)
{
if (!NILP (val))
{
@@ -707,9 +680,7 @@ map_keymap_internal (Lisp_Object map,
}
static void
-map_keymap_call (key, val, fun, dummy)
- Lisp_Object key, val, fun;
- void *dummy;
+map_keymap_call (Lisp_Object key, Lisp_Object val, Lisp_Object fun, void *dummy)
{
call2 (fun, key, val);
}
@@ -717,11 +688,7 @@ map_keymap_call (key, val, fun, dummy)
/* Same as map_keymap_internal, but doesn't traverses parent keymaps as well.
A non-zero AUTOLOAD indicates that autoloaded keymaps should be loaded. */
void
-map_keymap (map, fun, args, data, autoload)
- map_keymap_function_t fun;
- Lisp_Object map, args;
- void *data;
- int autoload;
+map_keymap (Lisp_Object map, map_keymap_function_t fun, Lisp_Object args, void *data, int autoload)
{
struct gcpro gcpro1;
GCPRO1 (args);
@@ -739,10 +706,7 @@ Lisp_Object Qkeymap_canonicalize;
/* Same as map_keymap, but does it right, properly eliminating duplicate
bindings due to inheritance. */
void
-map_keymap_canonical (map, fun, args, data)
- map_keymap_function_t fun;
- Lisp_Object map, args;
- void *data;
+map_keymap_canonical (Lisp_Object map, map_keymap_function_t fun, Lisp_Object args, void *data)
{
struct gcpro gcpro1;
GCPRO1 (args);
@@ -759,8 +723,7 @@ DEFUN ("map-keymap-internal", Fmap_keymap_internal, Smap_keymap_internal, 2, 2,
FUNCTION is called with two arguments: the event that is bound, and
the definition it is bound to. The event may be a character range.
If KEYMAP has a parent, this function returns it without processing it. */)
- (function, keymap)
- Lisp_Object function, keymap;
+ (Lisp_Object function, Lisp_Object keymap)
{
struct gcpro gcpro1;
GCPRO1 (function);
@@ -779,8 +742,7 @@ If KEYMAP has a parent, the parent's bindings are included as well.
This works recursively: if the parent has itself a parent, then the
grandparent's bindings are also included and so on.
usage: (map-keymap FUNCTION KEYMAP) */)
- (function, keymap, sort_first)
- Lisp_Object function, keymap, sort_first;
+ (Lisp_Object function, Lisp_Object keymap, Lisp_Object sort_first)
{
if (! NILP (sort_first))
return call2 (intern ("map-keymap-sorted"), function, keymap);
@@ -804,9 +766,7 @@ usage: (map-keymap FUNCTION KEYMAP) */)
This can GC because menu_item_eval_property calls Feval. */
Lisp_Object
-get_keyelt (object, autoload)
- Lisp_Object object;
- int autoload;
+get_keyelt (Lisp_Object object, int autoload)
{
while (1)
{
@@ -886,10 +846,7 @@ get_keyelt (object, autoload)
}
static Lisp_Object
-store_in_keymap (keymap, idx, def)
- Lisp_Object keymap;
- register Lisp_Object idx;
- Lisp_Object def;
+store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def)
{
/* Flush any reverse-map cache. */
where_is_cache = Qnil;
@@ -1044,8 +1001,7 @@ store_in_keymap (keymap, idx, def)
EXFUN (Fcopy_keymap, 1);
Lisp_Object
-copy_keymap_item (elt)
- Lisp_Object elt;
+copy_keymap_item (Lisp_Object elt)
{
Lisp_Object res, tem;
@@ -1118,8 +1074,7 @@ copy_keymap_item (elt)
}
static void
-copy_keymap_1 (chartable, idx, elt)
- Lisp_Object chartable, idx, elt;
+copy_keymap_1 (Lisp_Object chartable, Lisp_Object idx, Lisp_Object elt)
{
Fset_char_table_range (chartable, idx, copy_keymap_item (elt));
}
@@ -1131,8 +1086,7 @@ but changing either the copy or KEYMAP does not affect the other.
Any key definitions that are subkeymaps are recursively copied.
However, a key definition which is a symbol whose definition is a keymap
is not copied. */)
- (keymap)
- Lisp_Object keymap;
+ (Lisp_Object keymap)
{
register Lisp_Object copy, tail;
keymap = get_keymap (keymap, 1, 0);
@@ -1172,11 +1126,13 @@ DEFUN ("define-key", Fdefine_key, Sdefine_key, 3, 3, 0,
doc: /* In KEYMAP, define key sequence KEY as DEF.
KEYMAP is a keymap.
-KEY is a string or a vector of symbols and characters meaning a
+KEY is a string or a vector of symbols and characters, representing a
sequence of keystrokes and events. Non-ASCII characters with codes
-above 127 (such as ISO Latin-1) can be included if you use a vector.
-Using [t] for KEY creates a default definition, which applies to any
-event type that has no other definition in this keymap.
+above 127 (such as ISO Latin-1) can be represented by vectors.
+Two types of vector have special meanings:
+ [remap COMMAND] remaps any key binding for COMMAND.
+ [t] creates a default definition, which applies to any event with no
+ other definition in KEYMAP.
DEF is anything that can be a key's definition:
nil (means key is undefined in this keymap),
@@ -1195,10 +1151,7 @@ DEF is anything that can be a key's definition:
If KEYMAP is a sparse keymap with a binding for KEY, the existing
binding is altered. If there is no binding for KEY, the new pair
binding KEY to DEF is added at the front of KEYMAP. */)
- (keymap, key, def)
- Lisp_Object keymap;
- Lisp_Object key;
- Lisp_Object def;
+ (Lisp_Object keymap, Lisp_Object key, Lisp_Object def)
{
register int idx;
register Lisp_Object c;
@@ -1314,8 +1267,7 @@ ignored if POSITION is non-nil.
If the optional argument KEYMAPS is non-nil, it should be a list of
keymaps to search for command remapping. Otherwise, search for the
remapping in all currently active keymaps. */)
- (command, position, keymaps)
- Lisp_Object command, position, keymaps;
+ (Lisp_Object command, Lisp_Object position, Lisp_Object keymaps)
{
if (!SYMBOLP (command))
return Qnil;
@@ -1357,10 +1309,7 @@ bindings, used when nothing else in the keymap applies; this makes it
usable as a general function for probing keymaps. However, if the
third optional argument ACCEPT-DEFAULT is non-nil, `lookup-key' will
recognize the default bindings, just as `read-key-sequence' does. */)
- (keymap, key, accept_default)
- Lisp_Object keymap;
- Lisp_Object key;
- Lisp_Object accept_default;
+ (Lisp_Object keymap, Lisp_Object key, Lisp_Object accept_default)
{
register int idx;
register Lisp_Object cmd;
@@ -1412,8 +1361,7 @@ recognize the default bindings, just as `read-key-sequence' does. */)
Return the keymap. */
static Lisp_Object
-define_as_prefix (keymap, c)
- Lisp_Object keymap, c;
+define_as_prefix (Lisp_Object keymap, Lisp_Object c)
{
Lisp_Object cmd;
@@ -1430,8 +1378,7 @@ define_as_prefix (keymap, c)
/* Append a key to the end of a key sequence. We always make a vector. */
Lisp_Object
-append_key (key_sequence, key)
- Lisp_Object key_sequence, key;
+append_key (Lisp_Object key_sequence, Lisp_Object key)
{
Lisp_Object args[2];
@@ -1445,8 +1392,7 @@ append_key (key_sequence, key)
signal an error if is a mistake such as RET or M-RET or C-DEL, etc. */
static void
-silly_event_symbol_error (c)
- Lisp_Object c;
+silly_event_symbol_error (Lisp_Object c)
{
Lisp_Object parsed, base, name, assoc;
int modifiers;
@@ -1515,8 +1461,7 @@ static int cmm_size = 0;
list, let the key sequence be read, and hope some other piece of
code signals the error. */
int
-current_minor_maps (modeptr, mapptr)
- Lisp_Object **modeptr, **mapptr;
+current_minor_maps (Lisp_Object **modeptr, Lisp_Object **mapptr)
{
int i = 0;
int list_number = 0;
@@ -1575,7 +1520,8 @@ current_minor_maps (modeptr, mapptr)
{
if (cmm_modes)
{
- bcopy (cmm_modes, newmodes, cmm_size * sizeof cmm_modes[0]);
+ memcpy (newmodes, cmm_modes,
+ cmm_size * sizeof cmm_modes[0]);
free (cmm_modes);
}
cmm_modes = newmodes;
@@ -1586,7 +1532,8 @@ current_minor_maps (modeptr, mapptr)
{
if (cmm_maps)
{
- bcopy (cmm_maps, newmaps, cmm_size * sizeof cmm_maps[0]);
+ memcpy (newmaps, cmm_maps,
+ cmm_size * sizeof cmm_maps[0]);
free (cmm_maps);
}
cmm_maps = newmaps;
@@ -1620,8 +1567,7 @@ DEFUN ("current-active-maps", Fcurrent_active_maps, Scurrent_active_maps,
OLP if non-nil indicates that we should obey `overriding-local-map' and
`overriding-terminal-local-map'. POSITION can specify a click position
like in the respective argument of `key-binding'. */)
- (olp, position)
- Lisp_Object olp, position;
+ (Lisp_Object olp, Lisp_Object position)
{
int count = SPECPDL_INDEX ();
@@ -1784,8 +1730,7 @@ occurs in the keymaps associated with it instead of KEY. It can also
be a number or marker, in which case the keymap properties at the
specified buffer position instead of point are used.
*/)
- (key, accept_default, no_remap, position)
- Lisp_Object key, accept_default, no_remap, position;
+ (Lisp_Object key, Lisp_Object accept_default, Lisp_Object no_remap, Lisp_Object position)
{
Lisp_Object *maps, value;
int nmaps, i;
@@ -1975,8 +1920,7 @@ The binding is probably a symbol with a function definition.
If optional argument ACCEPT-DEFAULT is non-nil, recognize default
bindings; see the description of `lookup-key' for more details about this. */)
- (keys, accept_default)
- Lisp_Object keys, accept_default;
+ (Lisp_Object keys, Lisp_Object accept_default)
{
register Lisp_Object map;
map = current_buffer->keymap;
@@ -1996,8 +1940,7 @@ This function's return values are the same as those of `lookup-key'
If optional argument ACCEPT-DEFAULT is non-nil, recognize default
bindings; see the description of `lookup-key' for more details about this. */)
- (keys, accept_default)
- Lisp_Object keys, accept_default;
+ (Lisp_Object keys, Lisp_Object accept_default)
{
return Flookup_key (current_global_map, keys, accept_default);
}
@@ -2016,8 +1959,7 @@ that come after prefix bindings.
If optional argument ACCEPT-DEFAULT is non-nil, recognize default
bindings; see the description of `lookup-key' for more details about this. */)
- (key, accept_default)
- Lisp_Object key, accept_default;
+ (Lisp_Object key, Lisp_Object accept_default)
{
Lisp_Object *modes, *maps;
int nmaps;
@@ -2056,8 +1998,7 @@ as a function.
The third optional argument NAME, if given, supplies a menu name
string for the map. This is required to use the keymap as a menu.
This function returns COMMAND. */)
- (command, mapvar, name)
- Lisp_Object command, mapvar, name;
+ (Lisp_Object command, Lisp_Object mapvar, Lisp_Object name)
{
Lisp_Object map;
map = Fmake_sparse_keymap (name);
@@ -2071,8 +2012,7 @@ This function returns COMMAND. */)
DEFUN ("use-global-map", Fuse_global_map, Suse_global_map, 1, 1, 0,
doc: /* Select KEYMAP as the global keymap. */)
- (keymap)
- Lisp_Object keymap;
+ (Lisp_Object keymap)
{
keymap = get_keymap (keymap, 1, 1);
current_global_map = keymap;
@@ -2083,8 +2023,7 @@ DEFUN ("use-global-map", Fuse_global_map, Suse_global_map, 1, 1, 0,
DEFUN ("use-local-map", Fuse_local_map, Suse_local_map, 1, 1, 0,
doc: /* Select KEYMAP as the local keymap.
If KEYMAP is nil, that means no local keymap. */)
- (keymap)
- Lisp_Object keymap;
+ (Lisp_Object keymap)
{
if (!NILP (keymap))
keymap = get_keymap (keymap, 1, 1);
@@ -2097,21 +2036,21 @@ If KEYMAP is nil, that means no local keymap. */)
DEFUN ("current-local-map", Fcurrent_local_map, Scurrent_local_map, 0, 0, 0,
doc: /* Return current buffer's local keymap, or nil if it has none.
Normally the local keymap is set by the major mode with `use-local-map'. */)
- ()
+ (void)
{
return current_buffer->keymap;
}
DEFUN ("current-global-map", Fcurrent_global_map, Scurrent_global_map, 0, 0, 0,
doc: /* Return the current global keymap. */)
- ()
+ (void)
{
return current_global_map;
}
DEFUN ("current-minor-mode-maps", Fcurrent_minor_mode_maps, Scurrent_minor_mode_maps, 0, 0, 0,
doc: /* Return a list of keymaps for the minor modes of the current buffer. */)
- ()
+ (void)
{
Lisp_Object *maps;
int nmaps = current_minor_maps (0, &maps);
@@ -2128,10 +2067,8 @@ struct accessible_keymaps_data {
};
static void
-accessible_keymaps_1 (key, cmd, args, data)
- Lisp_Object key, cmd, args;
- /* Use void* to be compatible with map_keymap_function_t. */
- void *data;
+accessible_keymaps_1 (Lisp_Object key, Lisp_Object cmd, Lisp_Object args, void *data)
+/* Use void* data to be compatible with map_keymap_function_t. */
{
struct accessible_keymaps_data *d = data; /* Cast! */
Lisp_Object maps = d->maps;
@@ -2201,8 +2138,7 @@ KEYS starting from KEYMAP gets you to MAP. These elements are ordered
so that the KEYS increase in length. The first element is ([] . KEYMAP).
An optional argument PREFIX, if non-nil, should be a key sequence;
then the value includes only maps for prefixes that start with PREFIX. */)
- (keymap, prefix)
- Lisp_Object keymap, prefix;
+ (Lisp_Object keymap, Lisp_Object prefix)
{
Lisp_Object maps, tail;
int prefixlen = XINT (Flength (prefix));
@@ -2290,8 +2226,7 @@ DEFUN ("key-description", Fkey_description, Skey_description, 1, 2, 0,
Optional arg PREFIX is the sequence of keys leading up to KEYS.
Control characters turn into "C-foo" sequences, meta into "M-foo",
spaces are put between sequence elements, etc. */)
- (keys, prefix)
- Lisp_Object keys, prefix;
+ (Lisp_Object keys, Lisp_Object prefix)
{
int len = 0;
int i, i_byte;
@@ -2389,10 +2324,7 @@ spaces are put between sequence elements, etc. */)
char *
-push_key_description (c, p, force_multibyte)
- register unsigned int c;
- register char *p;
- int force_multibyte;
+push_key_description (register unsigned int c, register char *p, int force_multibyte)
{
unsigned c2;
@@ -2514,8 +2446,7 @@ DEFUN ("single-key-description", Fsingle_key_description,
Control characters turn into C-whatever, etc.
Optional argument NO-ANGLES non-nil means don't put angle brackets
around function keys and event symbols. */)
- (key, no_angles)
- Lisp_Object key, no_angles;
+ (Lisp_Object key, Lisp_Object no_angles)
{
if (CONSP (key) && lucid_event_type_list_p (key))
key = Fevent_convert_list (key);
@@ -2549,9 +2480,7 @@ around function keys and event symbols. */)
}
char *
-push_text_char_description (c, p)
- register unsigned int c;
- register char *p;
+push_text_char_description (register unsigned int c, register char *p)
{
if (c >= 0200)
{
@@ -2583,8 +2512,7 @@ Control characters turn into "^char", etc. This differs from
Also, this function recognizes the 2**7 bit as the Meta character,
whereas `single-key-description' uses the 2**27 bit for Meta.
See Info node `(elisp)Describing Characters' for examples. */)
- (character)
- Lisp_Object character;
+ (Lisp_Object character)
{
/* Currently MAX_MULTIBYTE_LENGTH is 4 (< 6). */
unsigned char str[6];
@@ -2611,8 +2539,7 @@ static int where_is_preferred_modifier;
Else, return 2 if SEQ uses the where_is_preferred_modifier,
and 1 otherwise. */
static int
-preferred_sequence_p (seq)
- Lisp_Object seq;
+preferred_sequence_p (Lisp_Object seq)
{
int i;
int len = XINT (Flength (seq));
@@ -2643,8 +2570,8 @@ preferred_sequence_p (seq)
/* where-is - finding a command in a set of keymaps. */
-static void where_is_internal_1 P_ ((Lisp_Object key, Lisp_Object binding,
- Lisp_Object args, void *data));
+static void where_is_internal_1 (Lisp_Object key, Lisp_Object binding,
+ Lisp_Object args, void *data);
/* Like Flookup_key, but uses a list of keymaps SHADOW instead of a single map.
Returns the first non-nil binding found in any of those maps.
@@ -2814,9 +2741,7 @@ indirect definition itself.
If optional 5th arg NO-REMAP is non-nil, don't search for key sequences
that invoke a command which is remapped to DEFINITION, but include the
remapped command in the returned list. */)
- (definition, keymap, firstonly, noindirect, no_remap)
- Lisp_Object definition, keymap;
- Lisp_Object firstonly, noindirect, no_remap;
+ (Lisp_Object definition, Lisp_Object keymap, Lisp_Object firstonly, Lisp_Object noindirect, Lisp_Object no_remap)
{
/* The keymaps in which to search. */
Lisp_Object keymaps;
@@ -2982,9 +2907,7 @@ remapped command in the returned list. */)
/* This function can GC because get_keyelt can. */
static void
-where_is_internal_1 (key, binding, args, data)
- Lisp_Object key, binding, args;
- void *data;
+where_is_internal_1 (Lisp_Object key, Lisp_Object binding, Lisp_Object args, void *data)
{
struct where_is_internal_data *d = data; /* Cast! */
Lisp_Object definition = d->definition;
@@ -3039,8 +2962,7 @@ The optional argument PREFIX, if non-nil, should be a key sequence;
then we display only bindings that start with that prefix.
The optional argument MENUS, if non-nil, says to mention menu bindings.
\(Ordinarily these are omitted from the output.) */)
- (buffer, prefix, menus)
- Lisp_Object buffer, prefix, menus;
+ (Lisp_Object buffer, Lisp_Object prefix, Lisp_Object menus)
{
Lisp_Object outbuf, shadow;
int nomenu = NILP (menus);
@@ -3151,12 +3073,12 @@ You type Translation\n\
*p++ = '\f';
*p++ = '\n';
*p++ = '`';
- bcopy (SDATA (SYMBOL_NAME (modes[i])), p,
- SCHARS (SYMBOL_NAME (modes[i])));
+ memcpy (p, SDATA (SYMBOL_NAME (modes[i])),
+ SCHARS (SYMBOL_NAME (modes[i])));
p += SCHARS (SYMBOL_NAME (modes[i]));
*p++ = '\'';
- bcopy (" Minor Mode Bindings", p, sizeof (" Minor Mode Bindings") - 1);
- p += sizeof (" Minor Mode Bindings") - 1;
+ memcpy (p, " Minor Mode Bindings", strlen (" Minor Mode Bindings"));
+ p += strlen (" Minor Mode Bindings");
*p = 0;
describe_map_tree (maps[i], 1, shadow, prefix,
@@ -3218,15 +3140,9 @@ You type Translation\n\
don't omit it; instead, mention it but say it is shadowed. */
void
-describe_map_tree (startmap, partial, shadow, prefix, title, nomenu, transl,
- always_title, mention_shadow)
- Lisp_Object startmap, shadow, prefix;
- int partial;
- char *title;
- int nomenu;
- int transl;
- int always_title;
- int mention_shadow;
+describe_map_tree (Lisp_Object startmap, int partial, Lisp_Object shadow,
+ Lisp_Object prefix, char *title, int nomenu, int transl,
+ int always_title, int mention_shadow)
{
Lisp_Object maps, orig_maps, seen, sub_shadows;
struct gcpro gcpro1, gcpro2, gcpro3;
@@ -3342,8 +3258,7 @@ key binding\n\
static int previous_description_column;
static void
-describe_command (definition, args)
- Lisp_Object definition, args;
+describe_command (Lisp_Object definition, Lisp_Object args)
{
register Lisp_Object tem1;
int column = (int) current_column (); /* iftc */
@@ -3379,8 +3294,7 @@ describe_command (definition, args)
}
static void
-describe_translation (definition, args)
- Lisp_Object definition, args;
+describe_translation (Lisp_Object definition, Lisp_Object args)
{
register Lisp_Object tem1;
@@ -3413,8 +3327,7 @@ struct describe_map_elt { Lisp_Object event; Lisp_Object definition; int shadowe
the event field. */
static int
-describe_map_compare (aa, bb)
- const void *aa, *bb;
+describe_map_compare (const void *aa, const void *bb)
{
const struct describe_map_elt *a = aa, *b = bb;
if (INTEGERP (a->event) && INTEGERP (b->event))
@@ -3436,16 +3349,10 @@ describe_map_compare (aa, bb)
PARTIAL, SHADOW, NOMENU are as in `describe_map_tree' above. */
static void
-describe_map (map, prefix, elt_describer, partial, shadow,
- seen, nomenu, mention_shadow)
- register Lisp_Object map;
- Lisp_Object prefix;
- void (*elt_describer) P_ ((Lisp_Object, Lisp_Object));
- int partial;
- Lisp_Object shadow;
- Lisp_Object *seen;
- int nomenu;
- int mention_shadow;
+describe_map (Lisp_Object map, Lisp_Object prefix,
+ void (*elt_describer) (Lisp_Object, Lisp_Object),
+ int partial, Lisp_Object shadow,
+ Lisp_Object *seen, int nomenu, int mention_shadow)
{
Lisp_Object tail, definition, event;
Lisp_Object tem;
@@ -3624,8 +3531,7 @@ describe_map (map, prefix, elt_describer, partial, shadow,
}
static void
-describe_vector_princ (elt, fun)
- Lisp_Object elt, fun;
+describe_vector_princ (Lisp_Object elt, Lisp_Object fun)
{
Findent_to (make_number (16), make_number (1));
call1 (fun, elt);
@@ -3636,8 +3542,7 @@ DEFUN ("describe-vector", Fdescribe_vector, Sdescribe_vector, 1, 2, 0,
doc: /* Insert a description of contents of VECTOR.
This is text showing the elements of vector matched against indices.
DESCRIBER is the output function used; nil means use `princ'. */)
- (vector, describer)
- Lisp_Object vector, describer;
+ (Lisp_Object vector, Lisp_Object describer)
{
int count = SPECPDL_INDEX ();
if (NILP (describer))
@@ -3686,20 +3591,11 @@ DESCRIBER is the output function used; nil means use `princ'. */)
ARGS is simply passed as the second argument to ELT_DESCRIBER. */
static void
-describe_vector (vector, prefix, args, elt_describer,
- partial, shadow, entire_map,
- indices, char_table_depth, keymap_p,
- mention_shadow)
- register Lisp_Object vector;
- Lisp_Object prefix, args;
- void (*elt_describer) P_ ((Lisp_Object, Lisp_Object));
- int partial;
- Lisp_Object shadow;
- Lisp_Object entire_map;
- int *indices;
- int char_table_depth;
- int keymap_p;
- int mention_shadow;
+describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
+ void (*elt_describer) (Lisp_Object, Lisp_Object),
+ int partial, Lisp_Object shadow, Lisp_Object entire_map,
+ int *indices, int char_table_depth, int keymap_p,
+ int mention_shadow)
{
Lisp_Object definition;
Lisp_Object tem2;
@@ -3893,8 +3789,7 @@ static Lisp_Object apropos_predicate;
static Lisp_Object apropos_accumulate;
static void
-apropos_accum (symbol, string)
- Lisp_Object symbol, string;
+apropos_accum (Lisp_Object symbol, Lisp_Object string)
{
register Lisp_Object tem;
@@ -3910,8 +3805,7 @@ DEFUN ("apropos-internal", Fapropos_internal, Sapropos_internal, 1, 2, 0,
If optional 2nd arg PREDICATE is non-nil, (funcall PREDICATE SYMBOL) is done
for each symbol and a symbol is mentioned only if that returns non-nil.
Return list of symbols found. */)
- (regexp, predicate)
- Lisp_Object regexp, predicate;
+ (Lisp_Object regexp, Lisp_Object predicate)
{
Lisp_Object tem;
CHECK_STRING (regexp);
@@ -3925,7 +3819,7 @@ Return list of symbols found. */)
}
void
-syms_of_keymap ()
+syms_of_keymap (void)
{
Qkeymap = intern_c_string ("keymap");
staticpro (&Qkeymap);
@@ -4119,7 +4013,7 @@ preferred. */);
}
void
-keys_of_keymap ()
+keys_of_keymap (void)
{
initial_define_key (global_map, 033, "ESC-prefix");
initial_define_key (global_map, Ctl ('X'), "Control-X-prefix");
diff --git a/src/keymap.h b/src/keymap.h
index ed9bf7f192c..024b03dd1c3 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -33,21 +33,21 @@ EXFUN (Fkey_description, 2);
EXFUN (Fsingle_key_description, 2);
EXFUN (Fwhere_is_internal, 5);
EXFUN (Fcurrent_active_maps, 2);
-extern Lisp_Object access_keymap P_ ((Lisp_Object, Lisp_Object, int, int, int));
-extern Lisp_Object get_keyelt P_ ((Lisp_Object, int));
-extern Lisp_Object get_keymap P_ ((Lisp_Object, int, int));
+extern Lisp_Object access_keymap (Lisp_Object, Lisp_Object, int, int, int);
+extern Lisp_Object get_keyelt (Lisp_Object, int);
+extern Lisp_Object get_keymap (Lisp_Object, int, int);
EXFUN (Fset_keymap_parent, 2);
-extern void describe_map_tree P_ ((Lisp_Object, int, Lisp_Object, Lisp_Object,
- char *, int, int, int, int));
-extern int current_minor_maps P_ ((Lisp_Object **, Lisp_Object **));
-extern void initial_define_key P_ ((Lisp_Object, int, char *));
-extern void initial_define_lispy_key P_ ((Lisp_Object, char *, char *));
-extern void syms_of_keymap P_ ((void));
-extern void keys_of_keymap P_ ((void));
+extern void describe_map_tree (Lisp_Object, int, Lisp_Object, Lisp_Object,
+ char *, int, int, int, int);
+extern int current_minor_maps (Lisp_Object **, Lisp_Object **);
+extern void initial_define_key (Lisp_Object, int, char *);
+extern void initial_define_lispy_key (Lisp_Object, char *, char *);
+extern void syms_of_keymap (void);
+extern void keys_of_keymap (void);
typedef void (*map_keymap_function_t)
- P_ ((Lisp_Object key, Lisp_Object val, Lisp_Object args, void* data));
-extern void map_keymap P_ ((Lisp_Object map, map_keymap_function_t fun, Lisp_Object largs, void* cargs, int autoload));
+ (Lisp_Object key, Lisp_Object val, Lisp_Object args, void* data);
+extern void map_keymap (Lisp_Object map, map_keymap_function_t fun, Lisp_Object largs, void* cargs, int autoload);
extern void map_keymap_canonical (Lisp_Object map,
map_keymap_function_t fun,
Lisp_Object args, void *data);
diff --git a/src/lisp.h b/src/lisp.h
index c7e8ea0fb8b..0559503c890 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -21,8 +21,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef EMACS_LISP_H
#define EMACS_LISP_H
-/* Declare the prototype for a general external function. */
-#define P_(proto) proto
+#include <stdarg.h>
+#include <stddef.h>
/* Use the configure flag --enable-checking[=LIST] to enable various
types of run time checks for Lisp objects. */
@@ -54,7 +54,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Extra internal type checking? */
extern int suppress_checking;
-extern void die P_((const char *, const char *, int)) NO_RETURN;
+extern void die (const char *, const char *, int) NO_RETURN;
#ifdef ENABLE_CHECKING
@@ -95,10 +95,9 @@ extern void die P_((const char *, const char *, int)) NO_RETURN;
#endif
#endif /* ENABLE_CHECKING */
-/* Define this to make Lisp_Object use a union type instead of the
- default int. FIXME: It might be better to add a flag to configure
- to do this. */
-/* #define USE_LISP_UNION_TYPE */
+/* Use the configure flag --enable-use-lisp-union-type to make
+ Lisp_Object use a union type instead of the default int. The flag
+ causes USE_LISP_UNION_TYPE to be defined. */
/***** Select the tagging scheme. *****/
/* There are basically two options that control the tagging scheme:
@@ -493,7 +492,7 @@ enum pvec_type
#define make_number(N) \
(__extension__ ({ Lisp_Object _l; _l.s.val = (N); _l.s.type = Lisp_Int; _l; }))
#else
-extern Lisp_Object make_number P_ ((EMACS_INT));
+extern Lisp_Object make_number (EMACS_INT);
#endif
#endif /* USE_LISP_UNION_TYPE */
@@ -654,7 +653,7 @@ extern size_t pure_size;
(XSTRING (string)->size = (newsize))
#define STRING_COPYIN(string, index, new, count) \
- bcopy (new, SDATA (string) + index, count)
+ memcpy (SDATA (string) + index, new, count)
/* Type checking. */
@@ -750,7 +749,7 @@ struct Lisp_Cons
#ifdef GC_CHECK_STRING_BYTES
struct Lisp_String;
-extern int string_bytes P_ ((struct Lisp_String *));
+extern int string_bytes (struct Lisp_String *);
#define STRING_BYTES(S) string_bytes ((S))
#else /* not GC_CHECK_STRING_BYTES */
@@ -789,13 +788,6 @@ struct Lisp_String
unsigned char *data;
};
-#ifdef offsetof
-#define OFFSETOF(type,field) offsetof(type,field)
-#else
-#define OFFSETOF(type,field) \
- ((int)((char*)&((type*)0)->field - (char*)0))
-#endif
-
struct Lisp_Vector
{
EMACS_UINT size;
@@ -806,7 +798,7 @@ struct Lisp_Vector
/* If a struct is made to look like a vector, this macro returns the length
of the shortest vector that would hold that struct. */
#define VECSIZE(type) ((sizeof (type) \
- - OFFSETOF (struct Lisp_Vector, contents[0]) \
+ - offsetof (struct Lisp_Vector, contents[0]) \
+ sizeof(Lisp_Object) - 1) /* round up */ \
/ sizeof (Lisp_Object))
@@ -814,7 +806,7 @@ struct Lisp_Vector
at the end and we need to compute the number of Lisp_Object fields (the
ones that the GC needs to trace). */
#define PSEUDOVECSIZE(type, nonlispfield) \
- ((OFFSETOF(type, nonlispfield) - OFFSETOF(struct Lisp_Vector, contents[0])) \
+ ((offsetof(type, nonlispfield) - offsetof(struct Lisp_Vector, contents[0])) \
/ sizeof (Lisp_Object))
/* A char-table is a kind of vectorlike, with contents are like a
@@ -972,7 +964,19 @@ struct Lisp_Bool_Vector
struct Lisp_Subr
{
EMACS_UINT size;
- Lisp_Object (*function) ();
+ union {
+ Lisp_Object (*a0) (void);
+ Lisp_Object (*a1) (Lisp_Object);
+ Lisp_Object (*a2) (Lisp_Object, Lisp_Object);
+ Lisp_Object (*a3) (Lisp_Object, Lisp_Object, Lisp_Object);
+ Lisp_Object (*a4) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
+ Lisp_Object (*a5) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
+ Lisp_Object (*a6) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
+ Lisp_Object (*a7) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
+ Lisp_Object (*a8) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
+ Lisp_Object (*aUNEVALLED) (Lisp_Object args);
+ Lisp_Object (*aMANY) (int, Lisp_Object *);
+ } function;
short min_args, max_args;
const char *symbol_name;
char *intspec;
@@ -1162,11 +1166,11 @@ struct Lisp_Hash_Table
struct Lisp_Hash_Table *next_weak;
/* C function to compare two keys. */
- int (* cmpfn) P_ ((struct Lisp_Hash_Table *, Lisp_Object,
- unsigned, Lisp_Object, unsigned));
+ int (* cmpfn) (struct Lisp_Hash_Table *, Lisp_Object,
+ unsigned, Lisp_Object, unsigned);
/* C function to compute hash code. */
- unsigned (* hashfn) P_ ((struct Lisp_Hash_Table *, Lisp_Object));
+ unsigned (* hashfn) (struct Lisp_Hash_Table *, Lisp_Object);
};
@@ -1798,7 +1802,8 @@ typedef struct {
Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \
DECL_ALIGN (struct Lisp_Subr, sname) = \
{ PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \
- fnname, minargs, maxargs, lname, intspec, 0}; \
+ { .a ## maxargs = fnname }, \
+ minargs, maxargs, lname, intspec, 0}; \
Lisp_Object fnname
/* Note that the weird token-substitution semantics of ANSI C makes
@@ -1828,7 +1833,7 @@ typedef struct {
/* defsubr (Sname);
is how we define the symbol for function `name' at start-up time. */
-extern void defsubr P_ ((struct Lisp_Subr *));
+extern void defsubr (struct Lisp_Subr *);
#define MANY -2
#define UNEVALLED -1
@@ -1894,7 +1899,7 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
WHERE being a buffer or frame means we saw a buffer-local or frame-local
value. Other values of WHERE mean an internal error. */
-typedef Lisp_Object (*specbinding_func) P_ ((Lisp_Object));
+typedef Lisp_Object (*specbinding_func) (Lisp_Object);
struct specbinding
{
@@ -1994,7 +1999,7 @@ extern char *stack_bottom;
and (in particular) cannot call arbitrary Lisp code. */
#ifdef SYNC_INPUT
-extern void process_pending_signals P_ ((void));
+extern void process_pending_signals (void);
extern int pending_signals;
#define ELSE_PENDING_SIGNALS \
else if (pending_signals) \
@@ -2267,7 +2272,7 @@ while (0)
/* Call staticpro (&var) to protect static variable `var'. */
-void staticpro P_ ((Lisp_Object *));
+void staticpro (Lisp_Object *);
/* Declare a Lisp-callable function. The MAXARGS parameter has the same
meaning as in the DEFUN macro, and is used to construct a prototype. */
@@ -2310,7 +2315,7 @@ extern Lisp_Object Qinteger;
extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;
-extern void circular_list_error P_ ((Lisp_Object)) NO_RETURN;
+extern void circular_list_error (Lisp_Object) NO_RETURN;
EXFUN (Finteractive_form, 1);
EXFUN (Fbyteorder, 0);
@@ -2353,12 +2358,12 @@ EXFUN (Ffmakunbound, 1);
EXFUN (Fsymbol_function, 1);
EXFUN (Fsymbol_plist, 1);
EXFUN (Fsymbol_name, 1);
-extern Lisp_Object indirect_function P_ ((Lisp_Object));
+extern Lisp_Object indirect_function (Lisp_Object);
EXFUN (Findirect_function, 2);
EXFUN (Ffset, 2);
EXFUN (Fsetplist, 2);
EXFUN (Fsymbol_value, 1);
-extern Lisp_Object find_symbol_value P_ ((Lisp_Object));
+extern Lisp_Object find_symbol_value (Lisp_Object);
EXFUN (Fset, 2);
EXFUN (Fdefault_value, 1);
EXFUN (Fset_default, 2);
@@ -2398,25 +2403,25 @@ EXFUN (Fsub1, 1);
EXFUN (Fmake_variable_buffer_local, 1);
extern struct Lisp_Symbol *indirect_variable (struct Lisp_Symbol *);
-extern Lisp_Object long_to_cons P_ ((unsigned long));
-extern unsigned long cons_to_long P_ ((Lisp_Object));
-extern void args_out_of_range P_ ((Lisp_Object, Lisp_Object)) NO_RETURN;
-extern void args_out_of_range_3 P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object)) NO_RETURN;
-extern Lisp_Object wrong_type_argument P_ ((Lisp_Object, Lisp_Object)) NO_RETURN;
+extern Lisp_Object long_to_cons (unsigned long);
+extern unsigned long cons_to_long (Lisp_Object);
+extern void args_out_of_range (Lisp_Object, Lisp_Object) NO_RETURN;
+extern void args_out_of_range_3 (Lisp_Object, Lisp_Object,
+ Lisp_Object) NO_RETURN;
+extern Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object) NO_RETURN;
extern Lisp_Object do_symval_forwarding (union Lisp_Fwd *);
extern void set_internal (Lisp_Object, Lisp_Object, Lisp_Object, int);
-extern void syms_of_data P_ ((void));
-extern void init_data P_ ((void));
-extern void swap_in_global_binding P_ ((struct Lisp_Symbol *));
+extern void syms_of_data (void);
+extern void init_data (void);
+extern void swap_in_global_binding (struct Lisp_Symbol *);
/* Defined in cmds.c */
EXFUN (Fend_of_line, 1);
EXFUN (Fforward_char, 1);
EXFUN (Fforward_line, 1);
-extern int internal_self_insert P_ ((int, int));
-extern void syms_of_cmds P_ ((void));
-extern void keys_of_cmds P_ ((void));
+extern int internal_self_insert (int, int);
+extern void syms_of_cmds (void);
+extern void keys_of_cmds (void);
/* Defined in coding.c */
EXFUN (Fcoding_system_p, 1);
@@ -2430,34 +2435,34 @@ EXFUN (Ffind_operation_coding_system, MANY);
EXFUN (Fupdate_coding_systems_internal, 0);
EXFUN (Fencode_coding_string, 4);
EXFUN (Fdecode_coding_string, 4);
-extern Lisp_Object detect_coding_system P_ ((const unsigned char *, EMACS_INT,
- EMACS_INT, int, int, Lisp_Object));
-extern void init_coding P_ ((void));
-extern void init_coding_once P_ ((void));
-extern void syms_of_coding P_ ((void));
+extern Lisp_Object detect_coding_system (const unsigned char *, EMACS_INT,
+ EMACS_INT, int, int, Lisp_Object);
+extern void init_coding (void);
+extern void init_coding_once (void);
+extern void syms_of_coding (void);
/* Defined in character.c */
-extern void init_character_once P_ ((void));
-extern void syms_of_character P_ ((void));
+extern void init_character_once (void);
+extern void syms_of_character (void);
EXFUN (Funibyte_char_to_multibyte, 1);
/* Defined in charset.c */
EXFUN (Fchar_bytes, 1);
EXFUN (Fchar_width, 1);
EXFUN (Fstring, MANY);
-extern EMACS_INT chars_in_text P_ ((const unsigned char *, EMACS_INT));
-extern EMACS_INT multibyte_chars_in_text P_ ((const unsigned char *, EMACS_INT));
-extern int multibyte_char_to_unibyte P_ ((int, Lisp_Object));
-extern int multibyte_char_to_unibyte_safe P_ ((int));
+extern EMACS_INT chars_in_text (const unsigned char *, EMACS_INT);
+extern EMACS_INT multibyte_chars_in_text (const unsigned char *, EMACS_INT);
+extern int multibyte_char_to_unibyte (int, Lisp_Object);
+extern int multibyte_char_to_unibyte_safe (int);
extern Lisp_Object Qcharset;
-extern void init_charset P_ ((void));
-extern void init_charset_once P_ ((void));
-extern void syms_of_charset P_ ((void));
+extern void init_charset (void);
+extern void init_charset_once (void);
+extern void syms_of_charset (void);
/* Structure forward declarations. */
struct charset;
/* Defined in composite.c */
-extern void syms_of_composite P_ ((void));
+extern void syms_of_composite (void);
/* Defined in syntax.c */
EXFUN (Fforward_word, 1);
@@ -2466,28 +2471,28 @@ EXFUN (Fskip_chars_backward, 2);
EXFUN (Fsyntax_table_p, 1);
EXFUN (Fsyntax_table, 0);
EXFUN (Fset_syntax_table, 1);
-extern void init_syntax_once P_ ((void));
-extern void syms_of_syntax P_ ((void));
+extern void init_syntax_once (void);
+extern void syms_of_syntax (void);
/* Defined in fns.c */
extern int use_dialog_box;
-extern int next_almost_prime P_ ((int));
-extern Lisp_Object larger_vector P_ ((Lisp_Object, int, Lisp_Object));
-extern void sweep_weak_hash_tables P_ ((void));
+extern int next_almost_prime (int);
+extern Lisp_Object larger_vector (Lisp_Object, int, Lisp_Object);
+extern void sweep_weak_hash_tables (void);
extern Lisp_Object Qstring_lessp;
extern Lisp_Object Vfeatures;
extern Lisp_Object QCtest, QCweakness, Qequal, Qeq;
-unsigned sxhash P_ ((Lisp_Object, int));
-Lisp_Object make_hash_table P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object, Lisp_Object,
- Lisp_Object));
-Lisp_Object copy_hash_table P_ ((struct Lisp_Hash_Table *));
-int hash_lookup P_ ((struct Lisp_Hash_Table *, Lisp_Object, unsigned *));
-int hash_put P_ ((struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object,
- unsigned));
-void hash_clear P_ ((struct Lisp_Hash_Table *));
-void init_weak_hash_tables P_ ((void));
-extern void init_fns P_ ((void));
+unsigned sxhash (Lisp_Object, int);
+Lisp_Object make_hash_table (Lisp_Object, Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object, Lisp_Object,
+ Lisp_Object);
+Lisp_Object copy_hash_table (struct Lisp_Hash_Table *);
+int hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, unsigned *);
+int hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object,
+ unsigned);
+void hash_clear (struct Lisp_Hash_Table *);
+void init_weak_hash_tables (void);
+extern void init_fns (void);
EXFUN (Fsxhash, 1);
EXFUN (Fmake_hash_table, MANY);
EXFUN (Fmakehash, 1);
@@ -2521,7 +2526,7 @@ EXFUN (Fstring_as_unibyte, 1);
EXFUN (Fstring_to_multibyte, 1);
EXFUN (Fstring_to_unibyte, 1);
EXFUN (Fsubstring, 3);
-extern Lisp_Object substring_both P_ ((Lisp_Object, int, int, int, int));
+extern Lisp_Object substring_both (Lisp_Object, int, int, int, int);
EXFUN (Fnth, 2);
EXFUN (Fnthcdr, 2);
EXFUN (Fmemq, 2);
@@ -2543,20 +2548,20 @@ EXFUN (Fnconc, MANY);
EXFUN (Fmapcar, 2);
EXFUN (Fmapconcat, 3);
EXFUN (Fy_or_n_p, 1);
-extern Lisp_Object do_yes_or_no_p P_ ((Lisp_Object));
+extern Lisp_Object do_yes_or_no_p (Lisp_Object);
EXFUN (Frequire, 3);
EXFUN (Fprovide, 2);
-extern Lisp_Object concat2 P_ ((Lisp_Object, Lisp_Object));
-extern Lisp_Object concat3 P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
-extern Lisp_Object nconc2 P_ ((Lisp_Object, Lisp_Object));
-extern Lisp_Object assq_no_quit P_ ((Lisp_Object, Lisp_Object));
-extern Lisp_Object assoc_no_quit P_ ((Lisp_Object, Lisp_Object));
-extern void clear_string_char_byte_cache P_ ((void));
-extern EMACS_INT string_char_to_byte P_ ((Lisp_Object, EMACS_INT));
-extern EMACS_INT string_byte_to_char P_ ((Lisp_Object, EMACS_INT));
-extern Lisp_Object string_make_multibyte P_ ((Lisp_Object));
-extern Lisp_Object string_to_multibyte P_ ((Lisp_Object));
-extern Lisp_Object string_make_unibyte P_ ((Lisp_Object));
+extern Lisp_Object concat2 (Lisp_Object, Lisp_Object);
+extern Lisp_Object concat3 (Lisp_Object, Lisp_Object, Lisp_Object);
+extern Lisp_Object nconc2 (Lisp_Object, Lisp_Object);
+extern Lisp_Object assq_no_quit (Lisp_Object, Lisp_Object);
+extern Lisp_Object assoc_no_quit (Lisp_Object, Lisp_Object);
+extern void clear_string_char_byte_cache (void);
+extern EMACS_INT string_char_to_byte (Lisp_Object, EMACS_INT);
+extern EMACS_INT string_byte_to_char (Lisp_Object, EMACS_INT);
+extern Lisp_Object string_make_multibyte (Lisp_Object);
+extern Lisp_Object string_to_multibyte (Lisp_Object);
+extern Lisp_Object string_make_unibyte (Lisp_Object);
EXFUN (Fcopy_alist, 1);
EXFUN (Fplist_get, 2);
EXFUN (Fplist_put, 3);
@@ -2565,24 +2570,24 @@ EXFUN (Frassoc, 2);
EXFUN (Fstring_equal, 2);
EXFUN (Fcompare_strings, 7);
EXFUN (Fstring_lessp, 2);
-extern void syms_of_fns P_ ((void));
+extern void syms_of_fns (void);
/* Defined in floatfns.c */
-extern double extract_float P_ ((Lisp_Object));
+extern double extract_float (Lisp_Object);
EXFUN (Ffloat, 1);
EXFUN (Ftruncate, 2);
-extern void init_floatfns P_ ((void));
-extern void syms_of_floatfns P_ ((void));
+extern void init_floatfns (void);
+extern void syms_of_floatfns (void);
/* Defined in fringe.c */
-extern void syms_of_fringe P_ ((void));
-extern void init_fringe P_ ((void));
-extern void init_fringe_once P_ ((void));
+extern void syms_of_fringe (void);
+extern void init_fringe (void);
+extern void init_fringe_once (void);
/* Defined in image.c */
EXFUN (Finit_image_library, 2);
-extern void syms_of_image P_ ((void));
-extern void init_image P_ ((void));
+extern void syms_of_image (void);
+extern void init_image (void);
/* Defined in insdel.c */
extern Lisp_Object Qinhibit_modification_hooks;
@@ -2633,7 +2638,7 @@ extern void adjust_markers_for_delete (EMACS_INT, EMACS_INT,
EMACS_INT, EMACS_INT);
extern void replace_range (EMACS_INT, EMACS_INT, Lisp_Object, int, int, int);
extern void replace_range_2 (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT,
- char *, EMACS_INT, EMACS_INT, int);
+ const char *, EMACS_INT, EMACS_INT, int);
extern void syms_of_insdel (void);
/* Defined in dispnew.c */
@@ -2644,10 +2649,9 @@ EXFUN (Fredraw_frame, 1);
EXFUN (Fredraw_display, 0);
EXFUN (Fsleep_for, 2);
EXFUN (Fredisplay, 1);
-extern Lisp_Object sit_for P_ ((Lisp_Object, int, int));
-extern void init_display P_ ((void));
-extern void syms_of_display P_ ((void));
-extern void safe_bcopy P_ ((const char *, char *, int));
+extern Lisp_Object sit_for (Lisp_Object, int, int);
+extern void init_display (void);
+extern void syms_of_display (void);
/* Defined in xdisp.c */
extern Lisp_Object Qinhibit_point_motion_hooks;
@@ -2658,58 +2662,58 @@ extern Lisp_Object Qimage, Qtext, Qboth, Qboth_horiz;
extern Lisp_Object Vmessage_log_max;
extern int message_enable_multibyte;
extern Lisp_Object echo_area_buffer[2];
-extern void check_message_stack P_ ((void));
-extern void setup_echo_area_for_printing P_ ((int));
-extern int push_message P_ ((void));
-extern Lisp_Object pop_message_unwind P_ ((Lisp_Object));
-extern Lisp_Object restore_message_unwind P_ ((Lisp_Object));
-extern void pop_message P_ ((void));
-extern void restore_message P_ ((void));
-extern Lisp_Object current_message P_ ((void));
-extern void set_message P_ ((const char *s, Lisp_Object, int, int));
-extern void clear_message P_ ((int, int));
-extern void message P_ ((/* char *, ... */));
-extern void message_nolog P_ ((/* char *, ... */));
-extern void message1 P_ ((char *));
-extern void message1_nolog P_ ((char *));
-extern void message2 P_ ((const char *, int, int));
-extern void message2_nolog P_ ((const char *, int, int));
-extern void message3 P_ ((Lisp_Object, int, int));
-extern void message3_nolog P_ ((Lisp_Object, int, int));
-extern void message_dolog P_ ((const char *, int, int, int));
-extern void message_with_string P_ ((char *, Lisp_Object, int));
-extern void message_log_maybe_newline P_ ((void));
-extern void update_echo_area P_ ((void));
-extern void truncate_echo_area P_ ((int));
-extern void redisplay P_ ((void));
+extern void check_message_stack (void);
+extern void setup_echo_area_for_printing (int);
+extern int push_message (void);
+extern Lisp_Object pop_message_unwind (Lisp_Object);
+extern Lisp_Object restore_message_unwind (Lisp_Object);
+extern void pop_message (void);
+extern void restore_message (void);
+extern Lisp_Object current_message (void);
+extern void set_message (const char *s, Lisp_Object, int, int);
+extern void clear_message (int, int);
+extern void message (const char *, ...);
+extern void message_nolog (const char *, ...);
+extern void message1 (const char *);
+extern void message1_nolog (const char *);
+extern void message2 (const char *, int, int);
+extern void message2_nolog (const char *, int, int);
+extern void message3 (Lisp_Object, int, int);
+extern void message3_nolog (Lisp_Object, int, int);
+extern void message_dolog (const char *, int, int, int);
+extern void message_with_string (const char *, Lisp_Object, int);
+extern void message_log_maybe_newline (void);
+extern void update_echo_area (void);
+extern void truncate_echo_area (int);
+extern void redisplay (void);
extern int check_point_in_composition
- P_ ((struct buffer *, int, struct buffer *, int));
-extern void redisplay_preserve_echo_area P_ ((int));
-extern void prepare_menu_bars P_ ((void));
+ (struct buffer *, int, struct buffer *, int);
+extern void redisplay_preserve_echo_area (int);
+extern void prepare_menu_bars (void);
-void set_frame_cursor_types P_ ((struct frame *, Lisp_Object));
-extern void syms_of_xdisp P_ ((void));
-extern void init_xdisp P_ ((void));
-extern Lisp_Object safe_eval P_ ((Lisp_Object));
-extern int pos_visible_p P_ ((struct window *, int, int *,
- int *, int *, int *, int *, int *));
+void set_frame_cursor_types (struct frame *, Lisp_Object);
+extern void syms_of_xdisp (void);
+extern void init_xdisp (void);
+extern Lisp_Object safe_eval (Lisp_Object);
+extern int pos_visible_p (struct window *, int, int *,
+ int *, int *, int *, int *, int *);
/* Defined in xsettings.c */
-extern void syms_of_xsettings P_ ((void));
+extern void syms_of_xsettings (void);
/* Defined in vm-limit.c. */
-extern void memory_warnings P_ ((POINTER_TYPE *, void (*warnfun) ()));
+extern void memory_warnings (POINTER_TYPE *, void (*warnfun) (const char *));
/* Defined in alloc.c */
-extern void check_pure_size P_ ((void));
-extern void allocate_string_data P_ ((struct Lisp_String *, int, int));
-extern void reset_malloc_hooks P_ ((void));
-extern void uninterrupt_malloc P_ ((void));
-extern void malloc_warning P_ ((char *));
-extern void memory_full P_ ((void)) NO_RETURN;
-extern void buffer_memory_full P_ ((void)) NO_RETURN;
-extern int survives_gc_p P_ ((Lisp_Object));
-extern void mark_object P_ ((Lisp_Object));
+extern void check_pure_size (void);
+extern void allocate_string_data (struct Lisp_String *, int, int);
+extern void reset_malloc_hooks (void);
+extern void uninterrupt_malloc (void);
+extern void malloc_warning (const char *);
+extern void memory_full (void) NO_RETURN;
+extern void buffer_memory_full (void) NO_RETURN;
+extern int survives_gc_p (Lisp_Object);
+extern void mark_object (Lisp_Object);
extern Lisp_Object Vpurify_flag;
extern Lisp_Object Vmemory_full;
EXFUN (Fcons, 2);
@@ -2720,57 +2724,57 @@ EXFUN (list4, 4);
EXFUN (list5, 5);
EXFUN (Flist, MANY);
EXFUN (Fmake_list, 2);
-extern Lisp_Object allocate_misc P_ ((void));
+extern Lisp_Object allocate_misc (void);
EXFUN (Fmake_vector, 2);
EXFUN (Fvector, MANY);
EXFUN (Ffunvec, MANY);
EXFUN (Fmake_symbol, 1);
EXFUN (Fmake_marker, 0);
EXFUN (Fmake_string, 2);
-extern Lisp_Object build_string P_ ((const char *));
-extern Lisp_Object make_string P_ ((const char *, int));
-extern Lisp_Object make_unibyte_string P_ ((const char *, int));
-extern Lisp_Object make_multibyte_string P_ ((const char *, int, int));
-extern Lisp_Object make_event_array P_ ((int, Lisp_Object *));
-extern Lisp_Object make_uninit_string P_ ((int));
-extern Lisp_Object make_uninit_multibyte_string P_ ((int, int));
-extern Lisp_Object make_string_from_bytes P_ ((const char *, int, int));
-extern Lisp_Object make_specified_string P_ ((const char *, int, int, int));
+extern Lisp_Object build_string (const char *);
+extern Lisp_Object make_string (const char *, int);
+extern Lisp_Object make_unibyte_string (const char *, int);
+extern Lisp_Object make_multibyte_string (const char *, int, int);
+extern Lisp_Object make_event_array (int, Lisp_Object *);
+extern Lisp_Object make_uninit_string (int);
+extern Lisp_Object make_uninit_multibyte_string (int, int);
+extern Lisp_Object make_string_from_bytes (const char *, int, int);
+extern Lisp_Object make_specified_string (const char *, int, int, int);
EXFUN (Fpurecopy, 1);
-extern Lisp_Object make_pure_string P_ ((const char *, int, int, int));
+extern Lisp_Object make_pure_string (const char *, int, int, int);
extern Lisp_Object make_pure_c_string (const char *data);
-extern Lisp_Object pure_cons P_ ((Lisp_Object, Lisp_Object));
-extern Lisp_Object make_pure_vector P_ ((EMACS_INT));
+extern Lisp_Object pure_cons (Lisp_Object, Lisp_Object);
+extern Lisp_Object make_pure_vector (EMACS_INT);
EXFUN (Fgarbage_collect, 0);
-extern Lisp_Object make_funvec P_ ((Lisp_Object, int, int, Lisp_Object *));
+extern Lisp_Object make_funvec (Lisp_Object, int, int, Lisp_Object *);
EXFUN (Fmake_byte_code, MANY);
EXFUN (Fmake_bool_vector, 2);
extern Lisp_Object Qchar_table_extra_slots;
-extern struct Lisp_Vector *allocate_vector P_ ((EMACS_INT));
-extern struct Lisp_Vector *allocate_pseudovector P_ ((int memlen, int lisplen, EMACS_INT tag));
+extern struct Lisp_Vector *allocate_vector (EMACS_INT);
+extern struct Lisp_Vector *allocate_pseudovector (int memlen, int lisplen, EMACS_INT tag);
#define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \
((typ*) \
allocate_pseudovector \
(VECSIZE (typ), PSEUDOVECSIZE (typ, field), tag))
-extern struct Lisp_Hash_Table *allocate_hash_table P_ ((void));
-extern struct window *allocate_window P_ ((void));
-extern struct frame *allocate_frame P_ ((void));
-extern struct Lisp_Process *allocate_process P_ ((void));
-extern struct terminal *allocate_terminal P_ ((void));
+extern struct Lisp_Hash_Table *allocate_hash_table (void);
+extern struct window *allocate_window (void);
+extern struct frame *allocate_frame (void);
+extern struct Lisp_Process *allocate_process (void);
+extern struct terminal *allocate_terminal (void);
extern int gc_in_progress;
extern int abort_on_gc;
-extern Lisp_Object make_float P_ ((double));
-extern void display_malloc_warning P_ ((void));
-extern int inhibit_garbage_collection P_ ((void));
-extern Lisp_Object make_save_value P_ ((void *, int));
-extern void free_misc P_ ((Lisp_Object));
-extern void free_marker P_ ((Lisp_Object));
-extern void free_cons P_ ((struct Lisp_Cons *));
-extern void init_alloc_once P_ ((void));
-extern void init_alloc P_ ((void));
-extern void syms_of_alloc P_ ((void));
-extern struct buffer * allocate_buffer P_ ((void));
-extern int valid_lisp_object_p P_ ((Lisp_Object));
+extern Lisp_Object make_float (double);
+extern void display_malloc_warning (void);
+extern int inhibit_garbage_collection (void);
+extern Lisp_Object make_save_value (void *, int);
+extern void free_misc (Lisp_Object);
+extern void free_marker (Lisp_Object);
+extern void free_cons (struct Lisp_Cons *);
+extern void init_alloc_once (void);
+extern void init_alloc (void);
+extern void syms_of_alloc (void);
+extern struct buffer * allocate_buffer (void);
+extern int valid_lisp_object_p (Lisp_Object);
/* Defined in chartab.c */
EXFUN (Fmake_char_table, 2);
@@ -2783,23 +2787,23 @@ EXFUN (Fset_char_table_range, 3);
EXFUN (Fset_char_table_default, 3);
EXFUN (Foptimize_char_table, 2);
EXFUN (Fmap_char_table, 2);
-extern Lisp_Object copy_char_table P_ ((Lisp_Object));
-extern Lisp_Object sub_char_table_ref P_ ((Lisp_Object, int));
-extern Lisp_Object char_table_ref P_ ((Lisp_Object, int));
-extern Lisp_Object char_table_ref_and_range P_ ((Lisp_Object, int,
- int *, int *));
-extern Lisp_Object char_table_set P_ ((Lisp_Object, int, Lisp_Object));
-extern Lisp_Object char_table_set_range P_ ((Lisp_Object, int, int,
- Lisp_Object));
-extern int char_table_translate P_ ((Lisp_Object, int));
-extern void map_char_table P_ ((void (*) (Lisp_Object, Lisp_Object,
- Lisp_Object),
- Lisp_Object, Lisp_Object, Lisp_Object));
-extern void syms_of_chartab P_ ((void));
+extern Lisp_Object copy_char_table (Lisp_Object);
+extern Lisp_Object sub_char_table_ref (Lisp_Object, int);
+extern Lisp_Object char_table_ref (Lisp_Object, int);
+extern Lisp_Object char_table_ref_and_range (Lisp_Object, int,
+ int *, int *);
+extern Lisp_Object char_table_set (Lisp_Object, int, Lisp_Object);
+extern Lisp_Object char_table_set_range (Lisp_Object, int, int,
+ Lisp_Object);
+extern int char_table_translate (Lisp_Object, int);
+extern void map_char_table (void (*) (Lisp_Object, Lisp_Object,
+ Lisp_Object),
+ Lisp_Object, Lisp_Object, Lisp_Object);
+extern void syms_of_chartab (void);
/* Defined in print.c */
extern Lisp_Object Vprin1_to_string_buffer;
-extern void debug_print P_ ((Lisp_Object));
+extern void debug_print (Lisp_Object);
EXFUN (Fprin1, 2);
EXFUN (Fprin1_to_string, 2);
EXFUN (Fprinc, 2);
@@ -2808,19 +2812,20 @@ EXFUN (Fprint, 2);
EXFUN (Ferror_message_string, 1);
extern Lisp_Object Vstandard_output, Qstandard_output;
extern Lisp_Object Qexternal_debugging_output;
-extern void temp_output_buffer_setup P_ ((const char *));
+extern void temp_output_buffer_setup (const char *);
extern int print_level, print_escape_newlines;
extern Lisp_Object Qprint_escape_newlines;
-extern void write_string P_ ((char *, int));
-extern void write_string_1 P_ ((char *, int, Lisp_Object));
-extern void print_error_message P_ ((Lisp_Object, Lisp_Object, char *, Lisp_Object));
+extern void write_string (const char *, int);
+extern void write_string_1 (const char *, int, Lisp_Object);
+extern void print_error_message (Lisp_Object, Lisp_Object, const char *,
+ Lisp_Object);
extern Lisp_Object internal_with_output_to_temp_buffer
- P_ ((const char *, Lisp_Object (*) (Lisp_Object), Lisp_Object));
-extern void float_to_string P_ ((unsigned char *, double));
-extern void syms_of_print P_ ((void));
+ (const char *, Lisp_Object (*) (Lisp_Object), Lisp_Object);
+extern void float_to_string (unsigned char *, double);
+extern void syms_of_print (void);
/* Defined in doprnt.c */
-extern int doprnt P_ ((char *, int, char *, char *, int, char **));
+extern int doprnt (char *, int, const char *, const char *, va_list);
/* Defined in lread.c */
extern Lisp_Object Qvariable_documentation, Qstandard_input;
@@ -2834,29 +2839,29 @@ EXFUN (Fget_load_suffixes, 0);
EXFUN (Fget_file_char, 0);
EXFUN (Fread_char, 3);
EXFUN (Fread_event, 3);
-extern Lisp_Object read_filtered_event P_ ((int, int, int, int, Lisp_Object));
+extern Lisp_Object read_filtered_event (int, int, int, int, Lisp_Object);
EXFUN (Feval_region, 4);
-extern Lisp_Object check_obarray P_ ((Lisp_Object));
-extern Lisp_Object intern P_ ((const char *));
+extern Lisp_Object check_obarray (Lisp_Object);
+extern Lisp_Object intern (const char *);
extern Lisp_Object intern_c_string (const char *);
-extern Lisp_Object make_symbol P_ ((char *));
-extern Lisp_Object oblookup P_ ((Lisp_Object, const char *, int, int));
+extern Lisp_Object make_symbol (const char *);
+extern Lisp_Object oblookup (Lisp_Object, const char *, int, int);
#define LOADHIST_ATTACH(x) \
do { \
if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list); \
} while (0)
extern Lisp_Object Vcurrent_load_list;
extern Lisp_Object Vload_history, Vload_suffixes, Vload_file_rep_suffixes;
-extern int openp P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
- Lisp_Object *, Lisp_Object));
-extern int isfloat_string P_ ((char *, int));
-extern void map_obarray P_ ((Lisp_Object, void (*) (Lisp_Object, Lisp_Object),
- Lisp_Object));
-extern void dir_warning P_ ((char *, Lisp_Object));
-extern void close_load_descs P_ ((void));
-extern void init_obarray P_ ((void));
-extern void init_lread P_ ((void));
-extern void syms_of_lread P_ ((void));
+extern int openp (Lisp_Object, Lisp_Object, Lisp_Object,
+ Lisp_Object *, Lisp_Object);
+extern int isfloat_string (const char *, int);
+extern void map_obarray (Lisp_Object, void (*) (Lisp_Object, Lisp_Object),
+ Lisp_Object);
+extern void dir_warning (const char *, Lisp_Object);
+extern void close_load_descs (void);
+extern void init_obarray (void);
+extern void init_lread (void);
+extern void syms_of_lread (void);
/* Defined in eval.c */
extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qdefun, Qmacro;
@@ -2865,7 +2870,7 @@ extern Lisp_Object Vautoload_queue;
extern Lisp_Object Vdebug_on_error;
extern Lisp_Object Vsignaling_function;
extern int handling_signal;
-extern int interactive_p P_ ((int));
+extern int interactive_p (int);
/* To run a normal hook, use the appropriate function from the list below.
The calling convention:
@@ -2879,8 +2884,8 @@ EXFUN (Frun_hooks, MANY);
EXFUN (Frun_hook_with_args, MANY);
EXFUN (Frun_hook_with_args_until_success, MANY);
EXFUN (Frun_hook_with_args_until_failure, MANY);
-extern Lisp_Object run_hook_list_with_args P_ ((Lisp_Object, int, Lisp_Object *));
-extern void run_hook_with_args_2 P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
+extern Lisp_Object run_hook_list_with_args (Lisp_Object, int, Lisp_Object *);
+extern void run_hook_with_args_2 (Lisp_Object, Lisp_Object, Lisp_Object);
EXFUN (Fand, UNEVALLED);
EXFUN (For, UNEVALLED);
EXFUN (Fif, UNEVALLED);
@@ -2900,48 +2905,49 @@ EXFUN (Fthrow, 2) NO_RETURN;
EXFUN (Funwind_protect, UNEVALLED);
EXFUN (Fcondition_case, UNEVALLED);
EXFUN (Fsignal, 2);
-extern void xsignal P_ ((Lisp_Object, Lisp_Object)) NO_RETURN;
-extern void xsignal0 P_ ((Lisp_Object)) NO_RETURN;
-extern void xsignal1 P_ ((Lisp_Object, Lisp_Object)) NO_RETURN;
-extern void xsignal2 P_ ((Lisp_Object, Lisp_Object, Lisp_Object)) NO_RETURN;
-extern void xsignal3 P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object)) NO_RETURN;
-extern void signal_error P_ ((char *, Lisp_Object)) NO_RETURN;
+extern void xsignal (Lisp_Object, Lisp_Object) NO_RETURN;
+extern void xsignal0 (Lisp_Object) NO_RETURN;
+extern void xsignal1 (Lisp_Object, Lisp_Object) NO_RETURN;
+extern void xsignal2 (Lisp_Object, Lisp_Object, Lisp_Object) NO_RETURN;
+extern void xsignal3 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object) NO_RETURN;
+extern void signal_error (const char *, Lisp_Object) NO_RETURN;
EXFUN (Fautoload, 5);
EXFUN (Fcommandp, 2);
EXFUN (Feval, 1);
EXFUN (Fapply, MANY);
EXFUN (Ffuncall, MANY);
EXFUN (Fbacktrace, 0);
-extern Lisp_Object apply1 P_ ((Lisp_Object, Lisp_Object));
-extern Lisp_Object call0 P_ ((Lisp_Object));
-extern Lisp_Object call1 P_ ((Lisp_Object, Lisp_Object));
-extern Lisp_Object call2 P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
-extern Lisp_Object call3 P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
-extern Lisp_Object call4 P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
-extern Lisp_Object call5 P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
-extern Lisp_Object call6 P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
-extern Lisp_Object call7 P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
+extern Lisp_Object apply1 (Lisp_Object, Lisp_Object);
+extern Lisp_Object call0 (Lisp_Object);
+extern Lisp_Object call1 (Lisp_Object, Lisp_Object);
+extern Lisp_Object call2 (Lisp_Object, Lisp_Object, Lisp_Object);
+extern Lisp_Object call3 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
+extern Lisp_Object call4 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
+extern Lisp_Object call5 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
+extern Lisp_Object call6 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
+extern Lisp_Object call7 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
EXFUN (Fdo_auto_save, 2);
-extern Lisp_Object apply_lambda P_ ((Lisp_Object, Lisp_Object, int, Lisp_Object));
-extern Lisp_Object internal_catch P_ ((Lisp_Object, Lisp_Object (*) (Lisp_Object), Lisp_Object));
-extern Lisp_Object internal_lisp_condition_case P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
-extern Lisp_Object internal_condition_case P_ ((Lisp_Object (*) (void), Lisp_Object, Lisp_Object (*) (Lisp_Object)));
-extern Lisp_Object internal_condition_case_1 P_ ((Lisp_Object (*) (Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)));
-extern Lisp_Object internal_condition_case_2 P_ ((Lisp_Object (*) (Lisp_Object, Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)));
-extern Lisp_Object internal_condition_case_n P_ ((Lisp_Object (*) (int, Lisp_Object *), int, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object)));
-extern void specbind P_ ((Lisp_Object, Lisp_Object));
-extern void record_unwind_protect P_ ((Lisp_Object (*) (Lisp_Object), Lisp_Object));
-extern Lisp_Object unbind_to P_ ((int, Lisp_Object));
-extern void error P_ ((/* char *, ... */)) NO_RETURN;
-extern void do_autoload P_ ((Lisp_Object, Lisp_Object));
-extern Lisp_Object un_autoload P_ ((Lisp_Object));
+extern Lisp_Object apply_lambda (Lisp_Object, Lisp_Object, int, Lisp_Object);
+extern Lisp_Object internal_catch (Lisp_Object, Lisp_Object (*) (Lisp_Object), Lisp_Object);
+extern Lisp_Object internal_lisp_condition_case (Lisp_Object, Lisp_Object, Lisp_Object);
+extern Lisp_Object internal_condition_case (Lisp_Object (*) (void), Lisp_Object, Lisp_Object (*) (Lisp_Object));
+extern Lisp_Object internal_condition_case_1 (Lisp_Object (*) (Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object));
+extern Lisp_Object internal_condition_case_2 (Lisp_Object (*) (Lisp_Object, Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object));
+extern Lisp_Object internal_condition_case_n (Lisp_Object (*) (int, Lisp_Object *), int, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object));
+extern void specbind (Lisp_Object, Lisp_Object);
+extern void record_unwind_protect (Lisp_Object (*) (Lisp_Object), Lisp_Object);
+extern Lisp_Object unbind_to (int, Lisp_Object);
+extern void error (const char *, ...) NO_RETURN;
+extern void verror (const char *, va_list) NO_RETURN;
+extern void do_autoload (Lisp_Object, Lisp_Object);
+extern Lisp_Object un_autoload (Lisp_Object);
EXFUN (Ffetch_bytecode, 1);
-extern void init_eval_once P_ ((void));
-extern Lisp_Object safe_call P_ ((int, Lisp_Object *));
-extern Lisp_Object safe_call1 P_ ((Lisp_Object, Lisp_Object));
+extern void init_eval_once (void);
+extern Lisp_Object safe_call (int, Lisp_Object *);
+extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object);
extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object);
-extern void init_eval P_ ((void));
-extern void syms_of_eval P_ ((void));
+extern void init_eval (void);
+extern void syms_of_eval (void);
/* Defined in editfns.c */
EXFUN (Fpropertize, MANY);
@@ -2964,20 +2970,20 @@ EXFUN (Finsert_and_inherit, MANY);
EXFUN (Finsert_before_markers, MANY);
EXFUN (Finsert_buffer_substring, 3);
EXFUN (Finsert_char, 3);
-extern void insert1 P_ ((Lisp_Object));
+extern void insert1 (Lisp_Object);
EXFUN (Feolp, 0);
EXFUN (Feobp, 0);
EXFUN (Fbolp, 0);
EXFUN (Fbobp, 0);
EXFUN (Fformat, MANY);
EXFUN (Fmessage, MANY);
-extern Lisp_Object format2 P_ ((char *, Lisp_Object, Lisp_Object));
+extern Lisp_Object format2 (const char *, Lisp_Object, Lisp_Object);
EXFUN (Fbuffer_substring, 2);
EXFUN (Fbuffer_string, 0);
-extern Lisp_Object save_excursion_save P_ ((void));
-extern Lisp_Object save_restriction_save P_ ((void));
-extern Lisp_Object save_excursion_restore P_ ((Lisp_Object));
-extern Lisp_Object save_restriction_restore P_ ((Lisp_Object));
+extern Lisp_Object save_excursion_save (void);
+extern Lisp_Object save_restriction_save (void);
+extern Lisp_Object save_excursion_restore (Lisp_Object);
+extern Lisp_Object save_restriction_restore (Lisp_Object);
EXFUN (Fchar_to_string, 1);
EXFUN (Fdelete_region, 2);
EXFUN (Fnarrow_to_region, 2);
@@ -2985,11 +2991,11 @@ EXFUN (Fwiden, 0);
EXFUN (Fuser_login_name, 1);
EXFUN (Fsystem_name, 0);
EXFUN (Fcurrent_time, 0);
-extern int clip_to_bounds P_ ((int, int, int));
-extern Lisp_Object make_buffer_string P_ ((int, int, int));
-extern Lisp_Object make_buffer_string_both P_ ((int, int, int, int, int));
-extern void init_editfns P_ ((void));
-extern void syms_of_editfns P_ ((void));
+extern int clip_to_bounds (int, int, int);
+extern Lisp_Object make_buffer_string (int, int, int);
+extern Lisp_Object make_buffer_string_both (int, int, int, int, int);
+extern void init_editfns (void);
+extern void syms_of_editfns (void);
extern Lisp_Object Vinhibit_field_text_motion;
EXFUN (Fconstrain_to_field, 5);
EXFUN (Ffield_string, 1);
@@ -2997,21 +3003,21 @@ EXFUN (Fdelete_field, 1);
EXFUN (Ffield_beginning, 3);
EXFUN (Ffield_end, 3);
EXFUN (Ffield_string_no_properties, 1);
-extern void set_time_zone_rule P_ ((char *));
+extern void set_time_zone_rule (const char *);
/* Defined in buffer.c */
-extern int mouse_face_overlay_overlaps P_ ((Lisp_Object));
-extern void nsberror P_ ((Lisp_Object)) NO_RETURN;
+extern int mouse_face_overlay_overlaps (Lisp_Object);
+extern void nsberror (Lisp_Object) NO_RETURN;
EXFUN (Fset_buffer_multibyte, 1);
EXFUN (Foverlay_start, 1);
EXFUN (Foverlay_end, 1);
EXFUN (Foverlay_buffer, 1);
-extern void adjust_overlays_for_insert P_ ((EMACS_INT, EMACS_INT));
-extern void adjust_overlays_for_delete P_ ((EMACS_INT, EMACS_INT));
-extern void fix_start_end_in_overlays P_ ((int, int));
-extern void report_overlay_modification P_ ((Lisp_Object, Lisp_Object, int,
- Lisp_Object, Lisp_Object, Lisp_Object));
-extern int overlay_touches_p P_ ((int));
+extern void adjust_overlays_for_insert (EMACS_INT, EMACS_INT);
+extern void adjust_overlays_for_delete (EMACS_INT, EMACS_INT);
+extern void fix_start_end_in_overlays (int, int);
+extern void report_overlay_modification (Lisp_Object, Lisp_Object, int,
+ Lisp_Object, Lisp_Object, Lisp_Object);
+extern int overlay_touches_p (int);
extern Lisp_Object Vbuffer_alist, Vinhibit_read_only;
EXFUN (Fbuffer_list, 1);
EXFUN (Fget_buffer, 1);
@@ -3033,14 +3039,14 @@ EXFUN (Fbuffer_enable_undo, 1);
EXFUN (Ferase_buffer, 0);
extern Lisp_Object Qoverlayp;
extern Lisp_Object Qevaporate;
-extern Lisp_Object get_truename_buffer P_ ((Lisp_Object));
+extern Lisp_Object get_truename_buffer (Lisp_Object);
extern struct buffer *all_buffers;
EXFUN (Fprevious_overlay_change, 1);
EXFUN (Fbuffer_file_name, 1);
-extern void init_buffer_once P_ ((void));
-extern void init_buffer P_ ((void));
-extern void syms_of_buffer P_ ((void));
-extern void keys_of_buffer P_ ((void));
+extern void init_buffer_once (void);
+extern void init_buffer (void);
+extern void syms_of_buffer (void);
+extern void keys_of_buffer (void);
/* Defined in marker.c */
@@ -3048,18 +3054,18 @@ EXFUN (Fmarker_position, 1);
EXFUN (Fmarker_buffer, 1);
EXFUN (Fcopy_marker, 2);
EXFUN (Fset_marker, 3);
-extern int marker_position P_ ((Lisp_Object));
-extern int marker_byte_position P_ ((Lisp_Object));
-extern void clear_charpos_cache P_ ((struct buffer *));
-extern int charpos_to_bytepos P_ ((int));
-extern int buf_charpos_to_bytepos P_ ((struct buffer *, int));
-extern int buf_bytepos_to_charpos P_ ((struct buffer *, int));
-extern void unchain_marker P_ ((struct Lisp_Marker *marker));
-extern Lisp_Object set_marker_restricted P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
-extern Lisp_Object set_marker_both P_ ((Lisp_Object, Lisp_Object, int, int));
-extern Lisp_Object set_marker_restricted_both P_ ((Lisp_Object, Lisp_Object,
- int, int));
-extern void syms_of_marker P_ ((void));
+extern int marker_position (Lisp_Object);
+extern int marker_byte_position (Lisp_Object);
+extern void clear_charpos_cache (struct buffer *);
+extern int charpos_to_bytepos (int);
+extern int buf_charpos_to_bytepos (struct buffer *, int);
+extern int buf_bytepos_to_charpos (struct buffer *, int);
+extern void unchain_marker (struct Lisp_Marker *marker);
+extern Lisp_Object set_marker_restricted (Lisp_Object, Lisp_Object, Lisp_Object);
+extern Lisp_Object set_marker_both (Lisp_Object, Lisp_Object, int, int);
+extern Lisp_Object set_marker_restricted_both (Lisp_Object, Lisp_Object,
+ int, int);
+extern void syms_of_marker (void);
/* Defined in fileio.c */
@@ -3076,7 +3082,7 @@ EXFUN (Ffile_exists_p, 1);
EXFUN (Ffile_name_absolute_p, 1);
EXFUN (Fdirectory_file_name, 1);
EXFUN (Ffile_name_directory, 1);
-extern Lisp_Object expand_and_dir_to_file P_ ((Lisp_Object, Lisp_Object));
+extern Lisp_Object expand_and_dir_to_file (Lisp_Object, Lisp_Object);
EXFUN (Ffile_accessible_directory_p, 1);
EXFUN (Funhandled_file_name_directory, 1);
EXFUN (Ffile_directory_p, 1);
@@ -3084,47 +3090,47 @@ EXFUN (Fwrite_region, 7);
EXFUN (Ffile_readable_p, 1);
EXFUN (Ffile_executable_p, 1);
EXFUN (Fread_file_name, 6);
-extern Lisp_Object close_file_unwind P_ ((Lisp_Object));
-extern Lisp_Object restore_point_unwind P_ ((Lisp_Object));
-extern void report_file_error P_ ((const char *, Lisp_Object)) NO_RETURN;
-extern int internal_delete_file P_ ((Lisp_Object));
-extern void syms_of_fileio P_ ((void));
-extern Lisp_Object make_temp_name P_ ((Lisp_Object, int));
+extern Lisp_Object close_file_unwind (Lisp_Object);
+extern Lisp_Object restore_point_unwind (Lisp_Object);
+extern void report_file_error (const char *, Lisp_Object) NO_RETURN;
+extern int internal_delete_file (Lisp_Object);
+extern void syms_of_fileio (void);
+extern Lisp_Object make_temp_name (Lisp_Object, int);
EXFUN (Fmake_symbolic_link, 3);
extern Lisp_Object Qdelete_file;
/* Defined in abbrev.c */
-extern void syms_of_abbrev P_ ((void));
+extern void syms_of_abbrev (void);
/* Defined in search.c */
-extern void shrink_regexp_cache P_ ((void));
+extern void shrink_regexp_cache (void);
EXFUN (Fstring_match, 3);
-extern void restore_search_regs P_ ((void));
+extern void restore_search_regs (void);
EXFUN (Fmatch_data, 3);
EXFUN (Fset_match_data, 2);
EXFUN (Fmatch_beginning, 1);
EXFUN (Fmatch_end, 1);
-extern void record_unwind_save_match_data P_ ((void));
+extern void record_unwind_save_match_data (void);
EXFUN (Flooking_at, 1);
-extern int fast_string_match P_ ((Lisp_Object, Lisp_Object));
-extern int fast_c_string_match_ignore_case P_ ((Lisp_Object, const char *));
-extern int fast_string_match_ignore_case P_ ((Lisp_Object, Lisp_Object));
-extern EMACS_INT fast_looking_at P_ ((Lisp_Object, EMACS_INT, EMACS_INT,
- EMACS_INT, EMACS_INT, Lisp_Object));
-extern int scan_buffer P_ ((int, EMACS_INT, EMACS_INT, int, int *, int));
-extern int scan_newline P_ ((EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT,
- int, int));
-extern int find_next_newline P_ ((EMACS_INT, int));
-extern int find_next_newline_no_quit P_ ((EMACS_INT, int));
-extern int find_before_next_newline P_ ((EMACS_INT, EMACS_INT, int));
-extern void syms_of_search P_ ((void));
-extern void clear_regexp_cache P_ ((void));
+extern int fast_string_match (Lisp_Object, Lisp_Object);
+extern int fast_c_string_match_ignore_case (Lisp_Object, const char *);
+extern int fast_string_match_ignore_case (Lisp_Object, Lisp_Object);
+extern EMACS_INT fast_looking_at (Lisp_Object, EMACS_INT, EMACS_INT,
+ EMACS_INT, EMACS_INT, Lisp_Object);
+extern int scan_buffer (int, EMACS_INT, EMACS_INT, int, int *, int);
+extern int scan_newline (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT,
+ int, int);
+extern int find_next_newline (EMACS_INT, int);
+extern int find_next_newline_no_quit (EMACS_INT, int);
+extern int find_before_next_newline (EMACS_INT, EMACS_INT, int);
+extern void syms_of_search (void);
+extern void clear_regexp_cache (void);
/* Defined in minibuf.c */
extern Lisp_Object last_minibuf_string;
-extern void choose_minibuf_frame P_ ((void));
+extern void choose_minibuf_frame (void);
EXFUN (Fcompleting_read, 8);
EXFUN (Fread_from_minibuffer, 7);
EXFUN (Fread_variable, 2);
@@ -3134,10 +3140,10 @@ EXFUN (Feval_minibuffer, 2);
EXFUN (Fread_string, 5);
EXFUN (Fread_no_blanks_input, 3);
EXFUN (Fassoc_string, 3);
-extern Lisp_Object get_minibuffer P_ ((int));
-extern void temp_echo_area_glyphs P_ ((Lisp_Object));
-extern void init_minibuf_once P_ ((void));
-extern void syms_of_minibuf P_ ((void));
+extern Lisp_Object get_minibuffer (int);
+extern void temp_echo_area_glyphs (Lisp_Object);
+extern void init_minibuf_once (void);
+extern void syms_of_minibuf (void);
/* Defined in callint.c */
@@ -3146,7 +3152,7 @@ extern Lisp_Object Vcommand_history;
extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook;
EXFUN (Fcall_interactively, 3);
EXFUN (Fprefix_numeric_value, 1);
-extern void syms_of_callint P_ ((void));
+extern void syms_of_callint (void);
/* Defined in casefiddle.c */
@@ -3156,22 +3162,22 @@ EXFUN (Fcapitalize, 1);
EXFUN (Fupcase_region, 2);
EXFUN (Fupcase_initials, 1);
EXFUN (Fupcase_initials_region, 2);
-extern void syms_of_casefiddle P_ ((void));
-extern void keys_of_casefiddle P_ ((void));
+extern void syms_of_casefiddle (void);
+extern void keys_of_casefiddle (void);
/* Defined in casetab.c */
EXFUN (Fset_case_table, 1);
EXFUN (Fset_standard_case_table, 1);
-extern void init_casetab_once P_ ((void));
-extern void syms_of_casetab P_ ((void));
+extern void init_casetab_once (void);
+extern void syms_of_casetab (void);
/* Defined in keyboard.c */
extern int echoing;
extern Lisp_Object echo_message_buffer;
extern struct kboard *echo_kboard;
-extern void cancel_echoing P_ ((void));
+extern void cancel_echoing (void);
extern Lisp_Object Qdisabled, QCfilter;
extern Lisp_Object Vtty_erase_char, Vhelp_form, Vtop_level;
extern Lisp_Object Vthrow_on_input;
@@ -3181,10 +3187,10 @@ EXFUN (Frecursive_edit, 0);
EXFUN (Ftop_level, 0);
EXFUN (Fcommand_execute, 4);
EXFUN (Finput_pending_p, 0);
-extern Lisp_Object menu_bar_items P_ ((Lisp_Object));
-extern Lisp_Object tool_bar_items P_ ((Lisp_Object, int *));
+extern Lisp_Object menu_bar_items (Lisp_Object);
+extern Lisp_Object tool_bar_items (Lisp_Object, int *);
extern Lisp_Object Qvertical_scroll_bar;
-extern void discard_mouse_events P_ ((void));
+extern void discard_mouse_events (void);
EXFUN (Fevent_convert_list, 1);
EXFUN (Fread_key_sequence, 5);
EXFUN (Fset_input_interrupt_mode, 1);
@@ -3193,18 +3199,18 @@ EXFUN (Fset_input_meta_mode, 2);
EXFUN (Fset_quit_char, 1);
EXFUN (Fset_input_mode, 4);
extern Lisp_Object pending_funcalls;
-extern int detect_input_pending P_ ((void));
-extern int detect_input_pending_ignore_squeezables P_ ((void));
-extern int detect_input_pending_run_timers P_ ((int));
-extern void safe_run_hooks P_ ((Lisp_Object));
-extern void cmd_error_internal P_ ((Lisp_Object, char *));
-extern Lisp_Object command_loop_1 P_ ((void));
-extern Lisp_Object recursive_edit_1 P_ ((void));
-extern void record_auto_save P_ ((void));
-extern void init_keyboard P_ ((void));
-extern void syms_of_keyboard P_ ((void));
-extern void keys_of_keyboard P_ ((void));
-extern char *push_key_description P_ ((unsigned int, char *, int));
+extern int detect_input_pending (void);
+extern int detect_input_pending_ignore_squeezables (void);
+extern int detect_input_pending_run_timers (int);
+extern void safe_run_hooks (Lisp_Object);
+extern void cmd_error_internal (Lisp_Object, const char *);
+extern Lisp_Object command_loop_1 (void);
+extern Lisp_Object recursive_edit_1 (void);
+extern void record_auto_save (void);
+extern void init_keyboard (void);
+extern void syms_of_keyboard (void);
+extern void keys_of_keyboard (void);
+extern char *push_key_description (unsigned int, char *, int);
/* Defined in indent.c */
@@ -3212,10 +3218,10 @@ EXFUN (Fvertical_motion, 2);
EXFUN (Findent_to, 2);
EXFUN (Fcurrent_column, 0);
EXFUN (Fmove_to_column, 2);
-extern double current_column P_ ((void));
-extern void invalidate_current_column P_ ((void));
-extern int indented_beyond_p P_ ((int, int, double));
-extern void syms_of_indent P_ ((void));
+extern double current_column (void);
+extern void invalidate_current_column (void);
+extern int indented_beyond_p (int, int, double);
+extern void syms_of_indent (void);
/* Defined in frame.c */
#ifdef HAVE_WINDOW_SYSTEM
@@ -3223,11 +3229,11 @@ extern Lisp_Object Vx_resource_name;
extern Lisp_Object Vx_resource_class;
#endif /* HAVE_WINDOW_SYSTEM */
extern Lisp_Object Qvisible;
-extern void store_frame_param P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void store_in_alist P_ ((Lisp_Object *, Lisp_Object, Lisp_Object));
-extern Lisp_Object do_switch_frame P_ ((Lisp_Object, int, int, Lisp_Object));
-extern Lisp_Object get_frame_param P_ ((struct frame *, Lisp_Object));
-extern Lisp_Object frame_buffer_predicate P_ ((Lisp_Object));
+extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object);
+extern void store_in_alist (Lisp_Object *, Lisp_Object, Lisp_Object);
+extern Lisp_Object do_switch_frame (Lisp_Object, int, int, Lisp_Object);
+extern Lisp_Object get_frame_param (struct frame *, Lisp_Object);
+extern Lisp_Object frame_buffer_predicate (Lisp_Object);
EXFUN (Fframep, 1);
EXFUN (Fselect_frame, 2);
EXFUN (Fselected_frame, 0);
@@ -3254,30 +3260,30 @@ EXFUN (Fset_frame_position, 3);
EXFUN (Fraise_frame, 1);
EXFUN (Fredirect_frame_focus, 2);
EXFUN (Fset_frame_selected_window, 3);
-extern Lisp_Object frame_buffer_list P_ ((Lisp_Object));
-extern void frames_discard_buffer P_ ((Lisp_Object));
-extern void set_frame_buffer_list P_ ((Lisp_Object, Lisp_Object));
-extern void frames_bury_buffer P_ ((Lisp_Object));
-extern void syms_of_frame P_ ((void));
+extern Lisp_Object frame_buffer_list (Lisp_Object);
+extern void frames_discard_buffer (Lisp_Object);
+extern void set_frame_buffer_list (Lisp_Object, Lisp_Object);
+extern void frames_bury_buffer (Lisp_Object);
+extern void syms_of_frame (void);
/* Defined in emacs.c */
-extern Lisp_Object decode_env_path P_ ((char *, char *));
+extern Lisp_Object decode_env_path (const char *, const char *);
extern Lisp_Object Vinvocation_name, Vinvocation_directory;
extern Lisp_Object Vbefore_init_time, Vafter_init_time;
extern Lisp_Object Vinstallation_directory;
extern Lisp_Object empty_unibyte_string, empty_multibyte_string;
EXFUN (Fkill_emacs, 1);
#if HAVE_SETLOCALE
-void fixup_locale P_ ((void));
-void synchronize_system_messages_locale P_ ((void));
-void synchronize_system_time_locale P_ ((void));
+void fixup_locale (void);
+void synchronize_system_messages_locale (void);
+void synchronize_system_time_locale (void);
#else
#define setlocale(category, locale)
#define fixup_locale()
#define synchronize_system_messages_locale()
#define synchronize_system_time_locale()
#endif
-void shut_down_emacs P_ ((int, int, Lisp_Object));
+void shut_down_emacs (int, int, Lisp_Object);
/* Nonzero means don't do interactive redisplay and don't change tty modes. */
extern int noninteractive;
@@ -3303,70 +3309,70 @@ EXFUN (Fkill_process, 2);
EXFUN (Fprocess_send_eof, 1);
EXFUN (Fwaiting_for_user_input_p, 0);
extern Lisp_Object Qprocessp;
-extern void kill_buffer_processes P_ ((Lisp_Object));
-extern int wait_reading_process_output P_ ((int, int, int, int,
- Lisp_Object,
- struct Lisp_Process *,
- int));
-extern void add_keyboard_wait_descriptor P_ ((int));
-extern void delete_keyboard_wait_descriptor P_ ((int));
-extern void add_gpm_wait_descriptor P_ ((int));
-extern void delete_gpm_wait_descriptor P_ ((int));
-extern void close_process_descs P_ ((void));
-extern void init_process P_ ((void));
-extern void syms_of_process P_ ((void));
-extern void setup_process_coding_systems P_ ((Lisp_Object));
+extern void kill_buffer_processes (Lisp_Object);
+extern int wait_reading_process_output (int, int, int, int,
+ Lisp_Object,
+ struct Lisp_Process *,
+ int);
+extern void add_keyboard_wait_descriptor (int);
+extern void delete_keyboard_wait_descriptor (int);
+extern void add_gpm_wait_descriptor (int);
+extern void delete_gpm_wait_descriptor (int);
+extern void close_process_descs (void);
+extern void init_process (void);
+extern void syms_of_process (void);
+extern void setup_process_coding_systems (Lisp_Object);
/* Defined in callproc.c */
extern Lisp_Object Vexec_path, Vexec_suffixes,
Vexec_directory, Vdata_directory;
extern Lisp_Object Vdoc_directory;
EXFUN (Fcall_process, MANY);
-extern int child_setup P_ ((int, int, int, char **, int, Lisp_Object));
-extern void init_callproc_1 P_ ((void));
-extern void init_callproc P_ ((void));
-extern void set_initial_environment P_ ((void));
-extern void syms_of_callproc P_ ((void));
+extern int child_setup (int, int, int, char **, int, Lisp_Object);
+extern void init_callproc_1 (void);
+extern void init_callproc (void);
+extern void set_initial_environment (void);
+extern void syms_of_callproc (void);
/* Defined in doc.c */
extern Lisp_Object Vdoc_file_name;
EXFUN (Fsubstitute_command_keys, 1);
EXFUN (Fdocumentation, 2);
EXFUN (Fdocumentation_property, 3);
-extern Lisp_Object read_doc_string P_ ((Lisp_Object));
-extern Lisp_Object get_doc_string P_ ((Lisp_Object, int, int));
-extern void syms_of_doc P_ ((void));
-extern int read_bytecode_char P_ ((int));
+extern Lisp_Object read_doc_string (Lisp_Object);
+extern Lisp_Object get_doc_string (Lisp_Object, int, int);
+extern void syms_of_doc (void);
+extern int read_bytecode_char (int);
/* Defined in bytecode.c */
extern Lisp_Object Qbytecode;
EXFUN (Fbyte_code, MANY);
-extern void syms_of_bytecode P_ ((void));
+extern void syms_of_bytecode (void);
extern struct byte_stack *byte_stack_list;
-extern void mark_byte_stack P_ ((void));
-extern void unmark_byte_stack P_ ((void));
-extern Lisp_Object exec_byte_code P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
- Lisp_Object, int, Lisp_Object *));
+extern void mark_byte_stack (void);
+extern void unmark_byte_stack (void);
+extern Lisp_Object exec_byte_code (Lisp_Object, Lisp_Object, Lisp_Object,
+ Lisp_Object, int, Lisp_Object *);
/* Defined in macros.c */
extern Lisp_Object Qexecute_kbd_macro;
EXFUN (Fexecute_kbd_macro, 3);
EXFUN (Fcancel_kbd_macro_events, 0);
-extern void init_macros P_ ((void));
-extern void syms_of_macros P_ ((void));
+extern void init_macros (void);
+extern void syms_of_macros (void);
/* Defined in undo.c */
extern Lisp_Object Qinhibit_read_only;
EXFUN (Fundo_boundary, 0);
-extern void truncate_undo_list P_ ((struct buffer *));
-extern void record_marker_adjustment P_ ((Lisp_Object, int));
-extern void record_insert P_ ((int, int));
-extern void record_delete P_ ((int, Lisp_Object));
-extern void record_first_change P_ ((void));
-extern void record_change P_ ((int, int));
-extern void record_property_change P_ ((int, int, Lisp_Object, Lisp_Object,
- Lisp_Object));
-extern void syms_of_undo P_ ((void));
+extern void truncate_undo_list (struct buffer *);
+extern void record_marker_adjustment (Lisp_Object, int);
+extern void record_insert (int, int);
+extern void record_delete (int, Lisp_Object);
+extern void record_first_change (void);
+extern void record_change (int, int);
+extern void record_property_change (int, int, Lisp_Object, Lisp_Object,
+ Lisp_Object);
+extern void syms_of_undo (void);
extern Lisp_Object Vundo_outer_limit;
/* Defined in textprop.c */
@@ -3380,19 +3386,19 @@ EXFUN (Fput_text_property, 5);
EXFUN (Fget_text_property, 3);
EXFUN (Fprevious_char_property_change, 2);
EXFUN (Fnext_char_property_change, 2);
-extern void report_interval_modification P_ ((Lisp_Object, Lisp_Object));
-extern Lisp_Object next_single_char_property_change P_ ((Lisp_Object,
- Lisp_Object,
- Lisp_Object,
- Lisp_Object));
+extern void report_interval_modification (Lisp_Object, Lisp_Object);
+extern Lisp_Object next_single_char_property_change (Lisp_Object,
+ Lisp_Object,
+ Lisp_Object,
+ Lisp_Object);
/* Defined in menu.c */
-extern void syms_of_menu P_ ((void));
+extern void syms_of_menu (void);
/* Defined in xmenu.c */
EXFUN (Fx_popup_menu, 2);
EXFUN (Fx_popup_dialog, 3);
-extern void syms_of_xmenu P_ ((void));
+extern void syms_of_xmenu (void);
/* Defined in termchar.h */
struct tty_display_info;
@@ -3402,73 +3408,85 @@ struct terminal;
/* Defined in sysdep.c */
#ifndef HAVE_GET_CURRENT_DIR_NAME
-extern char *get_current_dir_name P_ ((void));
+extern char *get_current_dir_name (void);
+#endif
+extern void stuff_char (char c);
+extern void init_sigio (int);
+extern void sys_subshell (void);
+extern void sys_suspend (void);
+extern void discard_tty_input (void);
+extern void init_sys_modes (struct tty_display_info *);
+extern void reset_sys_modes (struct tty_display_info *);
+extern void init_all_sys_modes (void);
+extern void reset_all_sys_modes (void);
+extern void wait_for_termination (int);
+extern void flush_pending_output (int);
+extern void child_setup_tty (int);
+extern void setup_pty (int);
+extern int set_window_size (int, int, int);
+extern void create_process (Lisp_Object, char **, Lisp_Object);
+extern int emacs_open (const char *, int, int);
+extern int emacs_close (int);
+extern int emacs_read (int, char *, unsigned int);
+extern int emacs_write (int, const char *, unsigned int);
+#ifndef HAVE_MEMSET
+extern void *memset (void *, int, size_t);
+#endif
+#ifndef HAVE_MEMCPY
+extern void *memcpy (void *, void *, size_t);
+#endif
+#ifndef HAVE_MEMMOVE
+extern void *memmove (void *, void *, size_t);
+#endif
+#ifndef HAVE_MEMCMP
+extern int memcmp (void *, void *, size_t);
#endif
-extern void stuff_char P_ ((char c));
-extern void init_sigio P_ ((int));
-extern void sys_subshell P_ ((void));
-extern void sys_suspend P_ ((void));
-extern void discard_tty_input P_ ((void));
-extern void init_sys_modes P_ ((struct tty_display_info *));
-extern void reset_sys_modes P_ ((struct tty_display_info *));
-extern void init_all_sys_modes P_ ((void));
-extern void reset_all_sys_modes P_ ((void));
-extern void wait_for_termination P_ ((int));
-extern void flush_pending_output P_ ((int));
-extern void child_setup_tty P_ ((int));
-extern void setup_pty P_ ((int));
-extern int set_window_size P_ ((int, int, int));
-extern void create_process P_ ((Lisp_Object, char **, Lisp_Object));
-extern int emacs_open P_ ((const char *, int, int));
-extern int emacs_close P_ ((int));
-extern int emacs_read P_ ((int, char *, unsigned int));
-extern int emacs_write P_ ((int, const char *, unsigned int));
/* Defined in filelock.c */
EXFUN (Funlock_buffer, 0);
EXFUN (Ffile_locked_p, 1);
-extern void unlock_all_files P_ ((void));
-extern void lock_file P_ ((Lisp_Object));
-extern void unlock_file P_ ((Lisp_Object));
-extern void unlock_buffer P_ ((struct buffer *));
-extern void syms_of_filelock P_ ((void));
-extern void init_filelock P_ ((void));
+extern void unlock_all_files (void);
+extern void lock_file (Lisp_Object);
+extern void unlock_file (Lisp_Object);
+extern void unlock_buffer (struct buffer *);
+extern void syms_of_filelock (void);
+extern void init_filelock (void);
/* Defined in sound.c */
-extern void syms_of_sound P_ ((void));
-extern void init_sound P_ ((void));
+extern void syms_of_sound (void);
+extern void init_sound (void);
/* Defined in category.c */
-extern void init_category_once P_ ((void));
-extern Lisp_Object char_category_set P_ ((int));
-extern void syms_of_category P_ ((void));
+extern void init_category_once (void);
+extern Lisp_Object char_category_set (int);
+extern void syms_of_category (void);
/* Defined in ccl.c */
-extern void syms_of_ccl P_ ((void));
+extern void syms_of_ccl (void);
/* Defined in dired.c */
EXFUN (Ffile_attributes, 2);
-extern void syms_of_dired P_ ((void));
-extern Lisp_Object directory_files_internal P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object,
- int, Lisp_Object));
+extern void syms_of_dired (void);
+extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object,
+ int, Lisp_Object);
/* Defined in term.c */
-extern void syms_of_term P_ ((void));
-extern void fatal P_ ((const char *msgid, ...)) NO_RETURN;
+extern void syms_of_term (void);
+extern void fatal (const char *msgid, ...) NO_RETURN;
/* Defined in terminal.c */
EXFUN (Fframe_terminal, 1);
EXFUN (Fdelete_terminal, 2);
-extern void syms_of_terminal P_ ((void));
+extern void syms_of_terminal (void);
/* Defined in font.c */
-extern void syms_of_font P_ ((void));
-extern void init_font P_ ((void));
+extern void syms_of_font (void);
+extern void init_font (void);
#ifdef HAVE_WINDOW_SYSTEM
/* Defined in fontset.c */
-extern void syms_of_fontset P_ ((void));
+extern void syms_of_fontset (void);
EXFUN (Fset_fontset_font, 5);
EXFUN (Fnew_fontset, 2);
@@ -3481,28 +3499,33 @@ EXFUN (Fx_focus_frame, 1);
/* Defined in xfaces.c */
EXFUN (Fclear_face_cache, 1);
EXFUN (Fx_load_color_file, 1);
-extern void syms_of_xfaces P_ ((void));
+extern void syms_of_xfaces (void);
#ifndef HAVE_GETLOADAVG
/* Defined in getloadavg.c */
-extern int getloadavg P_ ((double *, int));
+extern int getloadavg (double *, int);
#endif
#ifdef HAVE_X_WINDOWS
/* Defined in xfns.c */
-extern void syms_of_xfns P_ ((void));
+extern void syms_of_xfns (void);
/* Defined in xsmfns.c */
-extern void syms_of_xsmfns P_ ((void));
+extern void syms_of_xsmfns (void);
/* Defined in xselect.c */
EXFUN (Fx_send_client_event, 6);
-extern void syms_of_xselect P_ ((void));
+extern void syms_of_xselect (void);
/* Defined in xterm.c */
-extern void syms_of_xterm P_ ((void));
+extern void syms_of_xterm (void);
#endif /* HAVE_X_WINDOWS */
+#ifdef HAVE_WINDOW_SYSTEM
+/* Defined in xterm.c, nsterm.m, w32term.c */
+extern char *x_get_keysym_name (int);
+#endif /* HAVE_WINDOW_SYSTEM */
+
#ifdef MSDOS
/* Defined in msdos.c */
EXFUN (Fmsdos_downcase_filename, 1);
@@ -3510,14 +3533,14 @@ EXFUN (Fmsdos_downcase_filename, 1);
#ifdef HAVE_MENUS
/* Defined in (x|w32)fns.c, nsfns.m... */
-extern int have_menus_p P_ ((void));
+extern int have_menus_p (void);
#endif
#ifdef HAVE_DBUS
/* Defined in dbusbind.c */
-int xd_pending_messages P_ ((void));
-void xd_read_queued_messages P_ ((void));
-void syms_of_dbusbind P_ ((void));
+int xd_pending_messages (void);
+void xd_read_queued_messages (void);
+void syms_of_dbusbind (void);
#endif
/* Nonzero means Emacs has already been initialized.
@@ -3526,16 +3549,16 @@ extern int initialized;
extern int immediate_quit; /* Nonzero means ^G can quit instantly */
-extern POINTER_TYPE *xmalloc P_ ((size_t));
-extern POINTER_TYPE *xrealloc P_ ((POINTER_TYPE *, size_t));
-extern void xfree P_ ((POINTER_TYPE *));
+extern POINTER_TYPE *xmalloc (size_t);
+extern POINTER_TYPE *xrealloc (POINTER_TYPE *, size_t);
+extern void xfree (POINTER_TYPE *);
-extern char *xstrdup P_ ((const char *));
+extern char *xstrdup (const char *);
-extern char *egetenv P_ ((char *));
+extern char *egetenv (const char *);
/* Set up the name of the machine we're running on. */
-extern void init_system_name P_ ((void));
+extern void init_system_name (void);
/* Some systems (e.g., NT) use a different path separator than Unix,
in addition to a device separator. Set the path separator
diff --git a/src/lread.c b/src/lread.c
index 95b5dcd45ed..96c425850e4 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -224,18 +224,18 @@ int force_load_messages;
static Lisp_Object Vbytecomp_version_regexp;
-static int read_emacs_mule_char P_ ((int, int (*) (int, Lisp_Object),
- Lisp_Object));
+static int read_emacs_mule_char (int, int (*) (int, Lisp_Object),
+ Lisp_Object);
-static void readevalloop P_ ((Lisp_Object, FILE*, Lisp_Object,
- Lisp_Object (*) (), int,
- Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object));
-static Lisp_Object load_unwind P_ ((Lisp_Object));
-static Lisp_Object load_descriptor_unwind P_ ((Lisp_Object));
+static void readevalloop (Lisp_Object, FILE*, Lisp_Object,
+ Lisp_Object (*) (Lisp_Object), int,
+ Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object);
+static Lisp_Object load_unwind (Lisp_Object);
+static Lisp_Object load_descriptor_unwind (Lisp_Object);
-static void invalid_syntax P_ ((const char *, int)) NO_RETURN;
-static void end_of_file_error P_ (()) NO_RETURN;
+static void invalid_syntax (const char *, int) NO_RETURN;
+static void end_of_file_error (void) NO_RETURN;
/* Functions that read one byte from the current source READCHARFUN
@@ -244,9 +244,9 @@ static void end_of_file_error P_ (()) NO_RETURN;
is 0 or positive, it unreads C, and the return value is not
interesting. */
-static int readbyte_for_lambda P_ ((int, Lisp_Object));
-static int readbyte_from_file P_ ((int, Lisp_Object));
-static int readbyte_from_string P_ ((int, Lisp_Object));
+static int readbyte_for_lambda (int, Lisp_Object);
+static int readbyte_from_file (int, Lisp_Object);
+static int readbyte_from_string (int, Lisp_Object);
/* Handle unreading and rereading of characters.
Write READCHAR to read a character,
@@ -267,13 +267,11 @@ static int readbyte_from_string P_ ((int, Lisp_Object));
static int unread_char;
static int
-readchar (readcharfun, multibyte)
- Lisp_Object readcharfun;
- int *multibyte;
+readchar (Lisp_Object readcharfun, int *multibyte)
{
Lisp_Object tem;
register int c;
- int (*readbyte) P_ ((int, Lisp_Object));
+ int (*readbyte) (int, Lisp_Object);
unsigned char buf[MAX_MULTIBYTE_LENGTH];
int i, len;
int emacs_mule_encoding = 0;
@@ -440,9 +438,7 @@ readchar (readcharfun, multibyte)
If the stream is a user function, call it with the char as argument. */
static void
-unreadchar (readcharfun, c)
- Lisp_Object readcharfun;
- int c;
+unreadchar (Lisp_Object readcharfun, int c)
{
readchar_count--;
if (c == -1)
@@ -506,18 +502,14 @@ unreadchar (readcharfun, c)
}
static int
-readbyte_for_lambda (c, readcharfun)
- int c;
- Lisp_Object readcharfun;
+readbyte_for_lambda (int c, Lisp_Object readcharfun)
{
return read_bytecode_char (c >= 0);
}
static int
-readbyte_from_file (c, readcharfun)
- int c;
- Lisp_Object readcharfun;
+readbyte_from_file (int c, Lisp_Object readcharfun)
{
if (c >= 0)
{
@@ -548,9 +540,7 @@ readbyte_from_file (c, readcharfun)
}
static int
-readbyte_from_string (c, readcharfun)
- int c;
- Lisp_Object readcharfun;
+readbyte_from_string (int c, Lisp_Object readcharfun)
{
Lisp_Object string = XCAR (readcharfun);
@@ -578,10 +568,7 @@ readbyte_from_string (c, readcharfun)
extern char emacs_mule_bytes[256];
static int
-read_emacs_mule_char (c, readbyte, readcharfun)
- int c;
- int (*readbyte) P_ ((int, Lisp_Object));
- Lisp_Object readcharfun;
+read_emacs_mule_char (int c, int (*readbyte) (int, Lisp_Object), Lisp_Object readcharfun)
{
/* Emacs-mule coding uses at most 4-byte for one character. */
unsigned char buf[4];
@@ -640,19 +627,19 @@ read_emacs_mule_char (c, readbyte, readcharfun)
}
-static Lisp_Object read_internal_start P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object));
-static Lisp_Object read0 P_ ((Lisp_Object));
-static Lisp_Object read1 P_ ((Lisp_Object, int *, int));
+static Lisp_Object read_internal_start (Lisp_Object, Lisp_Object,
+ Lisp_Object);
+static Lisp_Object read0 (Lisp_Object);
+static Lisp_Object read1 (Lisp_Object, int *, int);
-static Lisp_Object read_list P_ ((int, Lisp_Object));
-static Lisp_Object read_vector P_ ((Lisp_Object, int));
+static Lisp_Object read_list (int, Lisp_Object);
+static Lisp_Object read_vector (Lisp_Object, int);
-static Lisp_Object substitute_object_recurse P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object));
-static void substitute_object_in_subtree P_ ((Lisp_Object,
- Lisp_Object));
-static void substitute_in_interval P_ ((INTERVAL, Lisp_Object));
+static Lisp_Object substitute_object_recurse (Lisp_Object, Lisp_Object,
+ Lisp_Object);
+static void substitute_object_in_subtree (Lisp_Object,
+ Lisp_Object);
+static void substitute_in_interval (INTERVAL, Lisp_Object);
/* Get a character from the tty. */
@@ -679,10 +666,8 @@ static void substitute_in_interval P_ ((INTERVAL, Lisp_Object));
return Qnil if no input arrives within that time. */
Lisp_Object
-read_filtered_event (no_switch_frame, ascii_required, error_nonascii,
- input_method, seconds)
- int no_switch_frame, ascii_required, error_nonascii, input_method;
- Lisp_Object seconds;
+read_filtered_event (int no_switch_frame, int ascii_required,
+ int error_nonascii, int input_method, Lisp_Object seconds)
{
Lisp_Object val, delayed_switch_frame;
EMACS_TIME end_time;
@@ -797,8 +782,7 @@ If the optional argument SECONDS is non-nil, it should be a number
specifying the maximum number of seconds to wait for input. If no
input arrives in that time, return nil. SECONDS may be a
floating-point value. */)
- (prompt, inherit_input_method, seconds)
- Lisp_Object prompt, inherit_input_method, seconds;
+ (Lisp_Object prompt, Lisp_Object inherit_input_method, Lisp_Object seconds)
{
Lisp_Object val;
@@ -820,8 +804,7 @@ If the optional argument SECONDS is non-nil, it should be a number
specifying the maximum number of seconds to wait for input. If no
input arrives in that time, return nil. SECONDS may be a
floating-point value. */)
- (prompt, inherit_input_method, seconds)
- Lisp_Object prompt, inherit_input_method, seconds;
+ (Lisp_Object prompt, Lisp_Object inherit_input_method, Lisp_Object seconds)
{
if (! NILP (prompt))
message_with_string ("%s", prompt, 0);
@@ -842,8 +825,7 @@ If the optional argument SECONDS is non-nil, it should be a number
specifying the maximum number of seconds to wait for input. If no
input arrives in that time, return nil. SECONDS may be a
floating-point value. */)
- (prompt, inherit_input_method, seconds)
- Lisp_Object prompt, inherit_input_method, seconds;
+ (Lisp_Object prompt, Lisp_Object inherit_input_method, Lisp_Object seconds)
{
Lisp_Object val;
@@ -858,7 +840,7 @@ floating-point value. */)
DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0,
doc: /* Don't use this yourself. */)
- ()
+ (void)
{
register Lisp_Object val;
BLOCK_INPUT;
@@ -988,8 +970,7 @@ lisp_file_lexically_bound_p (readcharfun)
because of an incompatible change in the byte compiler. */
static int
-safe_to_load_p (fd)
- int fd;
+safe_to_load_p (int fd)
{
char buf[512];
int nbytes, i;
@@ -1026,8 +1007,7 @@ safe_to_load_p (fd)
after loading a file successfully. */
static Lisp_Object
-record_load_unwind (old)
- Lisp_Object old;
+record_load_unwind (Lisp_Object old)
{
return Vloads_in_progress = old;
}
@@ -1035,15 +1015,13 @@ record_load_unwind (old)
/* This handler function is used via internal_condition_case_1. */
static Lisp_Object
-load_error_handler (data)
- Lisp_Object data;
+load_error_handler (Lisp_Object data)
{
return Qnil;
}
static Lisp_Object
-load_warn_old_style_backquotes (file)
- Lisp_Object file;
+load_warn_old_style_backquotes (Lisp_Object file)
{
if (!NILP (Vold_style_backquotes))
{
@@ -1059,7 +1037,7 @@ DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0,
doc: /* Return the suffixes that `load' should try if a suffix is \
required.
This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */)
- ()
+ (void)
{
Lisp_Object lst = Qnil, suffixes = Vload_suffixes, suffix, ext;
while (CONSP (suffixes))
@@ -1114,8 +1092,7 @@ Loading a file records its definitions, and its `provide' and
car is the file name loaded. See `load-history'.
Return t if the file exists and loads successfully. */)
- (file, noerror, nomessage, nosuffix, must_suffix)
- Lisp_Object file, noerror, nomessage, nosuffix, must_suffix;
+ (Lisp_Object file, Lisp_Object noerror, Lisp_Object nomessage, Lisp_Object nosuffix, Lisp_Object must_suffix)
{
register FILE *stream;
register int fd = -1;
@@ -1265,8 +1242,7 @@ Return t if the file exists and loads successfully. */)
specbind (Qold_style_backquotes, Qnil);
record_unwind_protect (load_warn_old_style_backquotes, file);
- if (!bcmp (SDATA (found) + SBYTES (found) - 4,
- ".elc", 4)
+ if (!memcmp (SDATA (found) + SBYTES (found) - 4, ".elc", 4)
|| (fd >= 0 && (version = safe_to_load_p (fd)) > 0))
/* Load .elc files directly, but not when they are
remote and have no handler! */
@@ -1428,8 +1404,8 @@ Return t if the file exists and loads successfully. */)
}
static Lisp_Object
-load_unwind (arg) /* used as unwind-protect function in load */
- Lisp_Object arg;
+load_unwind (Lisp_Object arg) /* used as unwind-protect function in load */
+
{
FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer;
if (stream != NULL)
@@ -1442,8 +1418,7 @@ load_unwind (arg) /* used as unwind-protect function in load */
}
static Lisp_Object
-load_descriptor_unwind (oldlist)
- Lisp_Object oldlist;
+load_descriptor_unwind (Lisp_Object oldlist)
{
load_descriptor_list = oldlist;
return Qnil;
@@ -1453,7 +1428,7 @@ load_descriptor_unwind (oldlist)
This is used when starting a subprocess. */
void
-close_load_descs ()
+close_load_descs (void)
{
#ifndef WINDOWSNT
Lisp_Object tail;
@@ -1463,8 +1438,7 @@ close_load_descs ()
}
static int
-complete_filename_p (pathname)
- Lisp_Object pathname;
+complete_filename_p (Lisp_Object pathname)
{
register const unsigned char *s = SDATA (pathname);
return (IS_DIRECTORY_SEP (s[0])
@@ -1480,8 +1454,7 @@ file name when searching.
If non-nil, PREDICATE is used instead of `file-readable-p'.
PREDICATE can also be an integer to pass to the access(2) function,
in which case file-name-handlers are ignored. */)
- (filename, path, suffixes, predicate)
- Lisp_Object filename, path, suffixes, predicate;
+ (Lisp_Object filename, Lisp_Object path, Lisp_Object suffixes, Lisp_Object predicate)
{
Lisp_Object file;
int fd = openp (path, filename, suffixes, &file, predicate);
@@ -1512,11 +1485,7 @@ in which case file-name-handlers are ignored. */)
but store the found remote file name in *STOREPTR. */
int
-openp (path, str, suffixes, storeptr, predicate)
- Lisp_Object path, str;
- Lisp_Object suffixes;
- Lisp_Object *storeptr;
- Lisp_Object predicate;
+openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *storeptr, Lisp_Object predicate)
{
register int fd;
int fn_size = 100;
@@ -1668,9 +1637,7 @@ openp (path, str, suffixes, storeptr, predicate)
ENTIRE is 1 if loading that entire file, 0 if evaluating part of it. */
static void
-build_load_history (filename, entire)
- Lisp_Object filename;
- int entire;
+build_load_history (Lisp_Object filename, int entire)
{
register Lisp_Object tail, prev, newelt;
register Lisp_Object tem, tem2;
@@ -1730,16 +1697,15 @@ build_load_history (filename, entire)
}
Lisp_Object
-unreadpure (junk) /* Used as unwind-protect function in readevalloop */
- Lisp_Object junk;
+unreadpure (Lisp_Object junk) /* Used as unwind-protect function in readevalloop */
+
{
read_pure = 0;
return Qnil;
}
static Lisp_Object
-readevalloop_1 (old)
- Lisp_Object old;
+readevalloop_1 (Lisp_Object old)
{
load_convert_to_unibyte = ! NILP (old);
return Qnil;
@@ -1749,7 +1715,7 @@ readevalloop_1 (old)
information. */
static void
-end_of_file_error ()
+end_of_file_error (void)
{
if (STRINGP (Vload_file_name))
xsignal1 (Qend_of_file, Vload_file_name);
@@ -1765,15 +1731,13 @@ end_of_file_error ()
If the input is not from a buffer, they must be nil. */
static void
-readevalloop (readcharfun, stream, sourcename, evalfun,
- printflag, unibyte, readfun, start, end)
- Lisp_Object readcharfun;
- FILE *stream;
- Lisp_Object sourcename;
- Lisp_Object (*evalfun) ();
- int printflag;
- Lisp_Object unibyte, readfun;
- Lisp_Object start, end;
+readevalloop (Lisp_Object readcharfun,
+ FILE *stream,
+ Lisp_Object sourcename,
+ Lisp_Object (*evalfun) (Lisp_Object),
+ int printflag,
+ Lisp_Object unibyte, Lisp_Object readfun,
+ Lisp_Object start, Lisp_Object end)
{
register int c;
register Lisp_Object val;
@@ -1953,8 +1917,7 @@ DO-ALLOW-PRINT, if non-nil, specifies that `print' and related
functions should work normally even if PRINTFLAG is nil.
This function preserves the position of point. */)
- (buffer, printflag, filename, unibyte, do_allow_print)
- Lisp_Object buffer, printflag, filename, unibyte, do_allow_print;
+ (Lisp_Object buffer, Lisp_Object printflag, Lisp_Object filename, Lisp_Object unibyte, Lisp_Object do_allow_print)
{
int count = SPECPDL_INDEX ();
Lisp_Object tem, buf;
@@ -2000,8 +1963,7 @@ instead of `read' to read each expression. It gets one argument
which is the input stream for reading characters.
This function does not move point. */)
- (start, end, printflag, read_function)
- Lisp_Object start, end, printflag, read_function;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object printflag, Lisp_Object read_function)
{
int count = SPECPDL_INDEX ();
Lisp_Object tem, cbuf;
@@ -2035,8 +1997,7 @@ STREAM or the value of `standard-input' may be:
a string (takes text from string, starting at the beginning)
t (read text line using minibuffer and use it, or read from
standard input in batch mode). */)
- (stream)
- Lisp_Object stream;
+ (Lisp_Object stream)
{
if (NILP (stream))
stream = Vstandard_input;
@@ -2053,8 +2014,7 @@ DEFUN ("read-from-string", Fread_from_string, Sread_from_string, 1, 3, 0,
Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX).
START and END optionally delimit a substring of STRING from which to read;
they default to 0 and (length STRING) respectively. */)
- (string, start, end)
- Lisp_Object string, start, end;
+ (Lisp_Object string, Lisp_Object start, Lisp_Object end)
{
Lisp_Object ret;
CHECK_STRING (string);
@@ -2066,10 +2026,8 @@ START and END optionally delimit a substring of STRING from which to read;
/* Function to set up the global context we need in toplevel read
calls. */
static Lisp_Object
-read_internal_start (stream, start, end)
- Lisp_Object stream;
- Lisp_Object start; /* Only used when stream is a string. */
- Lisp_Object end; /* Only used when stream is a string. */
+read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end)
+/* start, end only used when stream is a string. */
{
Lisp_Object retval;
@@ -2127,9 +2085,7 @@ read_internal_start (stream, start, end)
S is error string of length N (if > 0) */
static void
-invalid_syntax (s, n)
- const char *s;
- int n;
+invalid_syntax (const char *s, int n)
{
if (!n)
n = strlen (s);
@@ -2141,8 +2097,7 @@ invalid_syntax (s, n)
are not allowed. */
static Lisp_Object
-read0 (readcharfun)
- Lisp_Object readcharfun;
+read0 (Lisp_Object readcharfun)
{
register Lisp_Object val;
int c;
@@ -2162,9 +2117,7 @@ static char *read_buffer;
If the escape sequence forces unibyte, return eight-bit char. */
static int
-read_escape (readcharfun, stringp)
- Lisp_Object readcharfun;
- int stringp;
+read_escape (Lisp_Object readcharfun, int stringp)
{
register int c = READCHAR;
/* \u allows up to four hex digits, \U up to eight. Default to the
@@ -2378,9 +2331,7 @@ read_escape (readcharfun, stringp)
range. */
static Lisp_Object
-read_integer (readcharfun, radix)
- Lisp_Object readcharfun;
- int radix;
+read_integer (Lisp_Object readcharfun, int radix)
{
int ndigits = 0, invalid_p, c, sign = 0;
/* We use a floating point number because */
@@ -2445,10 +2396,7 @@ read_integer (readcharfun, radix)
FIRST_IN_LIST is nonzero if this is the first element of a list. */
static Lisp_Object
-read1 (readcharfun, pch, first_in_list)
- register Lisp_Object readcharfun;
- int *pch;
- int first_in_list;
+read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
{
register int c;
int uninterned_symbol = 0;
@@ -2508,28 +2456,28 @@ read1 (readcharfun, pch, first_in_list)
/* This is repetitive but fast and simple. */
params[param_count] = QCsize;
params[param_count+1] = Fplist_get (tmp, Qsize);
- if (!NILP (params[param_count+1]))
- param_count+=2;
+ if (!NILP (params[param_count + 1]))
+ param_count += 2;
params[param_count] = QCtest;
params[param_count+1] = Fplist_get (tmp, Qtest);
- if (!NILP (params[param_count+1]))
- param_count+=2;
+ if (!NILP (params[param_count + 1]))
+ param_count += 2;
params[param_count] = QCweakness;
params[param_count+1] = Fplist_get (tmp, Qweakness);
- if (!NILP (params[param_count+1]))
- param_count+=2;
+ if (!NILP (params[param_count + 1]))
+ param_count += 2;
params[param_count] = QCrehash_size;
params[param_count+1] = Fplist_get (tmp, Qrehash_size);
- if (!NILP (params[param_count+1]))
- param_count+=2;
+ if (!NILP (params[param_count + 1]))
+ param_count += 2;
params[param_count] = QCrehash_threshold;
params[param_count+1] = Fplist_get (tmp, Qrehash_threshold);
- if (!NILP (params[param_count+1]))
- param_count+=2;
+ if (!NILP (params[param_count + 1]))
+ param_count += 2;
/* This is the hashtable data. */
data = Fplist_get (tmp, Qdata);
@@ -2550,6 +2498,8 @@ read1 (readcharfun, pch, first_in_list)
return ht;
}
+ UNREAD (c);
+ invalid_syntax ("#", 1);
}
if (c == '^')
{
@@ -2612,8 +2562,7 @@ read1 (readcharfun, pch, first_in_list)
invalid_syntax ("#&...", 5);
val = Fmake_bool_vector (length, Qnil);
- bcopy (SDATA (tmp), XBOOL_VECTOR (val)->data,
- size_in_chars);
+ memcpy (XBOOL_VECTOR (val)->data, SDATA (tmp), size_in_chars);
/* Clear the extraneous bits in the last byte. */
if (XINT (length) != size_in_chars * BOOL_VECTOR_BITS_PER_CHAR)
XBOOL_VECTOR (val)->data[size_in_chars - 1]
@@ -2819,32 +2768,35 @@ read1 (readcharfun, pch, first_in_list)
}
case '`':
- /* Transition from old-style to new-style:
- If we see "(`" it used to mean old-style, which usually works
- fine because ` should almost never appear in such a position
- for new-style. But occasionally we need "(`" to mean new
- style, so we try to distinguish the two by the fact that we
- can either write "( `foo" or "(` foo", where the first
- intends to use new-style whereas the second intends to use
- old-style. For Emacs-25, we should completely remove this
- first_in_list exception (old-style can still be obtained via
- "(\`" anyway). */
- if (first_in_list && (c = READCHAR, UNREAD (c), c == ' '))
- {
- Vold_style_backquotes = Qt;
- goto default_label;
- }
- else
- {
- Lisp_Object value;
-
- new_backquote_flag++;
- value = read0 (readcharfun);
- new_backquote_flag--;
+ {
+ int next_char = READCHAR;
+ UNREAD (next_char);
+ /* Transition from old-style to new-style:
+ If we see "(`" it used to mean old-style, which usually works
+ fine because ` should almost never appear in such a position
+ for new-style. But occasionally we need "(`" to mean new
+ style, so we try to distinguish the two by the fact that we
+ can either write "( `foo" or "(` foo", where the first
+ intends to use new-style whereas the second intends to use
+ old-style. For Emacs-25, we should completely remove this
+ first_in_list exception (old-style can still be obtained via
+ "(\`" anyway). */
+ if (first_in_list && next_char == ' ')
+ {
+ Vold_style_backquotes = Qt;
+ goto default_label;
+ }
+ else
+ {
+ Lisp_Object value;
- return Fcons (Qbackquote, Fcons (value, Qnil));
- }
+ new_backquote_flag++;
+ value = read0 (readcharfun);
+ new_backquote_flag--;
+ return Fcons (Qbackquote, Fcons (value, Qnil));
+ }
+ }
case ',':
if (new_backquote_flag)
{
@@ -2907,7 +2859,7 @@ read1 (readcharfun, pch, first_in_list)
ok = (next_next_char <= 040
|| (next_next_char < 0200
- && (index ("\"';([#?", next_next_char)
+ && (strchr ("\"';([#?", next_next_char)
|| (!first_in_list && next_next_char == '`')
|| (new_backquote_flag && next_next_char == ','))));
}
@@ -2915,7 +2867,7 @@ read1 (readcharfun, pch, first_in_list)
{
ok = (next_char <= 040
|| (next_char < 0200
- && (index ("\"';()[]#?", next_char)
+ && (strchr ("\"';()[]#?", next_char)
|| (!first_in_list && next_char == '`')
|| (new_backquote_flag && next_char == ','))));
}
@@ -3060,7 +3012,7 @@ read1 (readcharfun, pch, first_in_list)
if (next_char <= 040
|| (next_char < 0200
- && (index ("\"';([#?", next_char)
+ && (strchr ("\"';([#?", next_char)
|| (!first_in_list && next_char == '`')
|| (new_backquote_flag && next_char == ','))))
{
@@ -3087,7 +3039,7 @@ read1 (readcharfun, pch, first_in_list)
while (c > 040
&& c != 0x8a0 /* NBSP */
&& (c >= 0200
- || (!index ("\"';()[]#", c)
+ || (!strchr ("\"';()[]#", c)
&& !(!first_in_list && c == '`')
&& !(new_backquote_flag && c == ','))))
{
@@ -3246,9 +3198,7 @@ read1 (readcharfun, pch, first_in_list)
static Lisp_Object seen_list;
static void
-substitute_object_in_subtree (object, placeholder)
- Lisp_Object object;
- Lisp_Object placeholder;
+substitute_object_in_subtree (Lisp_Object object, Lisp_Object placeholder)
{
Lisp_Object check_object;
@@ -3283,10 +3233,7 @@ substitute_object_in_subtree (object, placeholder)
} while (0)
static Lisp_Object
-substitute_object_recurse (object, placeholder, subtree)
- Lisp_Object object;
- Lisp_Object placeholder;
- Lisp_Object subtree;
+substitute_object_recurse (Lisp_Object object, Lisp_Object placeholder, Lisp_Object subtree)
{
/* If we find the placeholder, return the target object. */
if (EQ (placeholder, subtree))
@@ -3361,9 +3308,7 @@ substitute_object_recurse (object, placeholder, subtree)
/* Helper function for substitute_object_recurse. */
static void
-substitute_in_interval (interval, arg)
- INTERVAL interval;
- Lisp_Object arg;
+substitute_in_interval (INTERVAL interval, Lisp_Object arg)
{
Lisp_Object object = Fcar (arg);
Lisp_Object placeholder = Fcdr (arg);
@@ -3379,13 +3324,10 @@ substitute_in_interval (interval, arg)
#define EXP_INT 16
int
-isfloat_string (cp, ignore_trailing)
- register char *cp;
- int ignore_trailing;
+isfloat_string (const char *cp, int ignore_trailing)
{
- register int state;
-
- char *start = cp;
+ int state;
+ const char *start = cp;
state = 0;
if (*cp == '+' || *cp == '-')
@@ -3436,7 +3378,8 @@ isfloat_string (cp, ignore_trailing)
}
return ((ignore_trailing
- || (*cp == 0) || (*cp == ' ') || (*cp == '\t') || (*cp == '\n') || (*cp == '\r') || (*cp == '\f'))
+ || *cp == 0 || *cp == ' ' || *cp == '\t' || *cp == '\n'
+ || *cp == '\r' || *cp == '\f')
&& (state == (LEAD_INT|DOT_CHAR|TRAIL_INT)
|| state == (DOT_CHAR|TRAIL_INT)
|| state == (LEAD_INT|E_CHAR|EXP_INT)
@@ -3446,9 +3389,7 @@ isfloat_string (cp, ignore_trailing)
static Lisp_Object
-read_vector (readcharfun, read_funvec)
- Lisp_Object readcharfun;
- int read_funvec;
+read_vector (Lisp_Object readcharfun, int read_funvec)
{
register int i;
register int size;
@@ -3552,9 +3493,7 @@ read_vector (readcharfun, read_funvec)
and make structure pure. */
static Lisp_Object
-read_list (flag, readcharfun)
- int flag;
- register Lisp_Object readcharfun;
+read_list (int flag, register Lisp_Object readcharfun)
{
/* -1 means check next element for defun,
0 means don't check,
@@ -3742,14 +3681,13 @@ Lisp_Object initial_obarray;
int oblookup_last_bucket_number;
-static int hash_string ();
+static int hash_string (const unsigned char *ptr, int len);
/* Get an error if OBARRAY is not an obarray.
If it is one, return it. */
Lisp_Object
-check_obarray (obarray)
- Lisp_Object obarray;
+check_obarray (Lisp_Object obarray)
{
if (!VECTORP (obarray) || XVECTOR (obarray)->size == 0)
{
@@ -3764,8 +3702,7 @@ check_obarray (obarray)
interned in the current obarray. */
Lisp_Object
-intern (str)
- const char *str;
+intern (const char *str)
{
Lisp_Object tem;
int len = strlen (str);
@@ -3806,14 +3743,13 @@ intern_c_string (const char *str)
/* Create an uninterned symbol with name STR. */
Lisp_Object
-make_symbol (str)
- char *str;
+make_symbol (const char *str)
{
int len = strlen (str);
- return Fmake_symbol ((!NILP (Vpurify_flag)
- ? make_pure_string (str, len, len, 0)
- : make_string (str, len)));
+ return Fmake_symbol (!NILP (Vpurify_flag)
+ ? make_pure_string (str, len, len, 0)
+ : make_string (str, len));
}
DEFUN ("intern", Fintern, Sintern, 1, 2, 0,
@@ -3821,8 +3757,7 @@ DEFUN ("intern", Fintern, Sintern, 1, 2, 0,
If there is none, one is created by this function and returned.
A second optional argument specifies the obarray to use;
it defaults to the value of `obarray'. */)
- (string, obarray)
- Lisp_Object string, obarray;
+ (Lisp_Object string, Lisp_Object obarray)
{
register Lisp_Object tem, sym, *ptr;
@@ -3869,8 +3804,7 @@ NAME may be a string or a symbol. If it is a symbol, that exact
symbol is searched for.
A second optional argument specifies the obarray to use;
it defaults to the value of `obarray'. */)
- (name, obarray)
- Lisp_Object name, obarray;
+ (Lisp_Object name, Lisp_Object obarray)
{
register Lisp_Object tem, string;
@@ -3898,8 +3832,7 @@ The value is t if a symbol was found and deleted, nil otherwise.
NAME may be a string or a symbol. If it is a symbol, that symbol
is deleted, if it belongs to OBARRAY--no other symbol is deleted.
OBARRAY defaults to the value of the variable `obarray'. */)
- (name, obarray)
- Lisp_Object name, obarray;
+ (Lisp_Object name, Lisp_Object obarray)
{
register Lisp_Object string, tem;
int hash;
@@ -3969,10 +3902,7 @@ OBARRAY defaults to the value of the variable `obarray'. */)
Also store the bucket number in oblookup_last_bucket_number. */
Lisp_Object
-oblookup (obarray, ptr, size, size_byte)
- Lisp_Object obarray;
- register const char *ptr;
- int size, size_byte;
+oblookup (Lisp_Object obarray, register const char *ptr, int size, int size_byte)
{
int hash;
int obsize;
@@ -3999,7 +3929,7 @@ oblookup (obarray, ptr, size, size_byte)
{
if (SBYTES (SYMBOL_NAME (tail)) == size_byte
&& SCHARS (SYMBOL_NAME (tail)) == size
- && !bcmp (SDATA (SYMBOL_NAME (tail)), ptr, size_byte))
+ && !memcmp (SDATA (SYMBOL_NAME (tail)), ptr, size_byte))
return tail;
else if (XSYMBOL (tail)->next == 0)
break;
@@ -4009,9 +3939,7 @@ oblookup (obarray, ptr, size, size_byte)
}
static int
-hash_string (ptr, len)
- const unsigned char *ptr;
- int len;
+hash_string (const unsigned char *ptr, int len)
{
register const unsigned char *p = ptr;
register const unsigned char *end = p + len;
@@ -4028,10 +3956,7 @@ hash_string (ptr, len)
}
void
-map_obarray (obarray, fn, arg)
- Lisp_Object obarray;
- void (*fn) P_ ((Lisp_Object, Lisp_Object));
- Lisp_Object arg;
+map_obarray (Lisp_Object obarray, void (*fn) (Lisp_Object, Lisp_Object), Lisp_Object arg)
{
register int i;
register Lisp_Object tail;
@@ -4051,8 +3976,7 @@ map_obarray (obarray, fn, arg)
}
void
-mapatoms_1 (sym, function)
- Lisp_Object sym, function;
+mapatoms_1 (Lisp_Object sym, Lisp_Object function)
{
call1 (function, sym);
}
@@ -4060,8 +3984,7 @@ mapatoms_1 (sym, function)
DEFUN ("mapatoms", Fmapatoms, Smapatoms, 1, 2, 0,
doc: /* Call FUNCTION on every symbol in OBARRAY.
OBARRAY defaults to the value of `obarray'. */)
- (function, obarray)
- Lisp_Object function, obarray;
+ (Lisp_Object function, Lisp_Object obarray)
{
if (NILP (obarray)) obarray = Vobarray;
obarray = check_obarray (obarray);
@@ -4073,7 +3996,7 @@ OBARRAY defaults to the value of `obarray'. */)
#define OBARRAY_SIZE 1511
void
-init_obarray ()
+init_obarray (void)
{
Lisp_Object oblength;
@@ -4114,8 +4037,7 @@ init_obarray ()
}
void
-defsubr (sname)
- struct Lisp_Subr *sname;
+defsubr (struct Lisp_Subr *sname)
{
Lisp_Object sym;
sym = intern_c_string (sname->symbol_name);
@@ -4215,7 +4137,7 @@ defvar_kboard (struct Lisp_Kboard_Objfwd *ko_fwd,
static Lisp_Object dump_path;
void
-init_lread ()
+init_lread (void)
{
char *normal;
int turn_off_warning = 0;
@@ -4408,9 +4330,7 @@ init_lread ()
does not exist. Print it on stderr and put it in *Messages*. */
void
-dir_warning (format, dirname)
- char *format;
- Lisp_Object dirname;
+dir_warning (const char *format, Lisp_Object dirname)
{
char *buffer
= (char *) alloca (SCHARS (dirname) + strlen (format) + 5);
@@ -4423,7 +4343,7 @@ dir_warning (format, dirname)
}
void
-syms_of_lread ()
+syms_of_lread (void)
{
defsubr (&Sread);
defsubr (&Sread_from_string);
diff --git a/src/m/alpha.h b/src/m/alpha.h
index c57fd0d9821..ae8fd62d6f8 100644
--- a/src/m/alpha.h
+++ b/src/m/alpha.h
@@ -47,33 +47,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Convert that into an integer that is 100 for a load average of 1.0 */
#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
-/* GNU malloc and the relocating allocator do not work together
- with X. [Who wrote that?] */
-
-/* May 1995: reportedly [Rainer Schoepf <schoepf@uni-mainz.de>] both the
- system and the gnu malloc system work with "alpha-dec-osf3.0" and
- "alpha-dec-osf3.2". */
-
-/* May 1995: it seems to me [Morten Welinder <terra@diku.dk>] that both
- mallocs work with "alpha-dec-osf2.0", but I daren't break anything
- right now. Feel free to play if you want. */
-
-/* #define SYSTEM_MALLOC */
-
#ifdef __ELF__
#if !defined(GNU_LINUX) && !defined(__NetBSD__)
#define DATA_START 0x140000000
#endif
-#if (defined (__NetBSD__) || defined (__OpenBSD__))
-#define HAVE_TEXT_START
-#endif
-
#else /* not __ELF__ */
/* Describe layout of the address space in an executing process. */
-#define TEXT_START 0x120000000
#define DATA_START 0x140000000
#endif /* __ELF__ */
diff --git a/src/m/ia64.h b/src/m/ia64.h
index 76e2bb87d80..5266c682c78 100644
--- a/src/m/ia64.h
+++ b/src/m/ia64.h
@@ -58,7 +58,5 @@ extern void r_alloc_free ();
#endif /* not _MALLOC_INTERNAL */
#endif /* REL_ALLOC */
-#define HAVE_TEXT_START
-
/* arch-tag: 9b8e9fb2-2e49-4c22-b68f-11a488e77c66
(do not change this comment) */
diff --git a/src/m/ibmrs6000.h b/src/m/ibmrs6000.h
index 3831e500641..a44b2c4ec3b 100644
--- a/src/m/ibmrs6000.h
+++ b/src/m/ibmrs6000.h
@@ -22,7 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* The data segment in this machine always starts at address 0x20000000.
An address of data cannot be stored correctly in a Lisp object;
we always lose the high bits. We must tell XPNTR to add them back. */
-#define TEXT_START 0x10000000
#define DATA_START 0x20000000
#define WORDS_BIG_ENDIAN
#define DATA_SEG_BITS 0x20000000
diff --git a/src/m/intel386.h b/src/m/intel386.h
index 984a9959736..76e5929e4e6 100644
--- a/src/m/intel386.h
+++ b/src/m/intel386.h
@@ -23,10 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
is the most significant byte. */
#undef WORDS_BIG_ENDIAN
-#ifdef USG
-#define TEXT_START 0
-#endif /* USG */
-
#ifdef WINDOWSNT
#define VIRT_ADDR_VARIES
#define DATA_START get_data_start ()
diff --git a/src/m/iris4d.h b/src/m/iris4d.h
index e7f332057e5..2ba6b5ba7ce 100644
--- a/src/m/iris4d.h
+++ b/src/m/iris4d.h
@@ -30,8 +30,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
This flag only matters if you use USE_LISP_UNION_TYPE. */
#define EXPLICIT_SIGN_EXTEND
-#define TEXT_START 0x400000
-
/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers which
were stored in a Lisp_Object (as Emacs uses fewer than 32 bits for
the value field of a LISP_OBJECT). */
diff --git a/src/m/m68k.h b/src/m/m68k.h
index 668db282593..5a083205e50 100644
--- a/src/m/m68k.h
+++ b/src/m/m68k.h
@@ -41,7 +41,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#define NO_REMAP
-#define TEXT_START 0
#endif
/* arch-tag: 4eadd161-b4e8-4b82-82a1-e4ce7f42969d
diff --git a/src/m/macppc.h b/src/m/macppc.h
index f348286030c..2764ae56115 100644
--- a/src/m/macppc.h
+++ b/src/m/macppc.h
@@ -28,10 +28,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Convert that into an integer that is 100 for a load average of 1.0 */
#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
-#if (defined (__NetBSD__) || defined (__OpenBSD__)) && defined (__ELF__)
-#define HAVE_TEXT_START
-#endif
-
#ifdef _ARCH_PPC64
#ifndef _LP64
#define _LP64
diff --git a/src/m/mips.h b/src/m/mips.h
index 8e81c077426..39a948c0cde 100644
--- a/src/m/mips.h
+++ b/src/m/mips.h
@@ -31,8 +31,5 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
This flag only matters if you use USE_LISP_UNION_TYPE. */
#define EXPLICIT_SIGN_EXTEND
-/* Describe layout of the address space in an executing process. */
-#define TEXT_START 0x00400000
-
/* arch-tag: 8fd020ee-78a7-4d87-96ce-6129f52f7bee
(do not change this comment) */
diff --git a/src/m/template.h b/src/m/template.h
index 3beac1a7808..0b149411a0a 100644
--- a/src/m/template.h
+++ b/src/m/template.h
@@ -39,11 +39,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Convert that into an integer that is 100 for a load average of 1.0 */
#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
-/* Define CANNOT_DUMP on machines where unexec does not work.
- Then the function dump-emacs will not be defined
- and temacs will do (load "loadup") automatically unless told otherwise. */
-#define CANNOT_DUMP
-
/* Define VIRT_ADDR_VARIES if the virtual addresses of
pure and impure space as loaded can vary, and even their
relative order cannot be relied on.
diff --git a/src/macros.c b/src/macros.c
index 62aeb0fa635..0e0d3f3597e 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -53,7 +53,7 @@ Lisp_Object executing_kbd_macro;
extern Lisp_Object real_this_command;
-Lisp_Object Fexecute_kbd_macro ();
+Lisp_Object Fexecute_kbd_macro (Lisp_Object macro, Lisp_Object count, Lisp_Object loopfunc);
DEFUN ("start-kbd-macro", Fstart_kbd_macro, Sstart_kbd_macro, 1, 2, "P",
doc: /* Record subsequent keyboard input, defining a keyboard macro.
@@ -64,8 +64,7 @@ Non-nil arg (prefix arg) means append to last macro defined;
this begins by re-executing that macro as if you typed it again.
If optional second arg, NO-EXEC, is non-nil, do not re-execute last
macro before appending to it. */)
- (append, no_exec)
- Lisp_Object append, no_exec;
+ (Lisp_Object append, Lisp_Object no_exec)
{
if (!NILP (current_kboard->defining_kbd_macro))
error ("Already defining kbd macro");
@@ -140,7 +139,7 @@ macro before appending to it. */)
/* Finish defining the current keyboard macro. */
void
-end_kbd_macro ()
+end_kbd_macro (void)
{
current_kboard->defining_kbd_macro = Qnil;
update_mode_lines++;
@@ -163,8 +162,7 @@ An argument of zero means repeat until error.
In Lisp, optional second arg LOOPFUNC may be a function that is called prior to
each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
- (repeat, loopfunc)
- Lisp_Object repeat, loopfunc;
+ (Lisp_Object repeat, Lisp_Object loopfunc)
{
if (NILP (current_kboard->defining_kbd_macro))
error ("Not defining kbd macro");
@@ -194,8 +192,7 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
/* Store character c into kbd macro being defined */
void
-store_kbd_macro_char (c)
- Lisp_Object c;
+store_kbd_macro_char (Lisp_Object c)
{
struct kboard *kb = current_kboard;
@@ -223,7 +220,7 @@ store_kbd_macro_char (c)
really belong to it. This is done in between editor commands. */
void
-finalize_kbd_macro_chars ()
+finalize_kbd_macro_chars (void)
{
current_kboard->kbd_macro_end = current_kboard->kbd_macro_ptr;
}
@@ -231,7 +228,7 @@ finalize_kbd_macro_chars ()
DEFUN ("cancel-kbd-macro-events", Fcancel_kbd_macro_events,
Scancel_kbd_macro_events, 0, 0, 0,
doc: /* Cancel the events added to a keyboard macro for this command. */)
- ()
+ (void)
{
current_kboard->kbd_macro_ptr = current_kboard->kbd_macro_end;
return Qnil;
@@ -240,8 +237,7 @@ DEFUN ("cancel-kbd-macro-events", Fcancel_kbd_macro_events,
DEFUN ("store-kbd-macro-event", Fstore_kbd_macro_event,
Sstore_kbd_macro_event, 1, 1, 0,
doc: /* Store EVENT into the keyboard macro being defined. */)
- (event)
- Lisp_Object event;
+ (Lisp_Object event)
{
store_kbd_macro_char (event);
return Qnil;
@@ -258,8 +254,7 @@ defining others, use \\[name-last-kbd-macro].
In Lisp, optional second arg LOOPFUNC may be a function that is called prior to
each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
- (prefix, loopfunc)
- Lisp_Object prefix, loopfunc;
+ (Lisp_Object prefix, Lisp_Object loopfunc)
{
/* Don't interfere with recognition of the previous command
from before this macro started. */
@@ -286,8 +281,7 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
Called when the unwind-protect in Fexecute_kbd_macro gets invoked. */
static Lisp_Object
-pop_kbd_macro (info)
- Lisp_Object info;
+pop_kbd_macro (Lisp_Object info)
{
Lisp_Object tem;
Vexecuting_kbd_macro = XCAR (info);
@@ -305,8 +299,7 @@ COUNT is a repeat count, or nil for once, or 0 for infinite loop.
Optional third arg LOOPFUNC may be a function that is called prior to
each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
- (macro, count, loopfunc)
- Lisp_Object macro, count, loopfunc;
+ (Lisp_Object macro, Lisp_Object count, Lisp_Object loopfunc)
{
Lisp_Object final;
Lisp_Object tem;
@@ -367,14 +360,14 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
}
void
-init_macros ()
+init_macros (void)
{
Vexecuting_kbd_macro = Qnil;
executing_kbd_macro = Qnil;
}
void
-syms_of_macros ()
+syms_of_macros (void)
{
Qexecute_kbd_macro = intern_c_string ("execute-kbd-macro");
staticpro (&Qexecute_kbd_macro);
diff --git a/src/macros.h b/src/macros.h
index 00b7b5ba421..761b5fdf514 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -41,16 +41,16 @@ extern Lisp_Object executing_kbd_macro;
/* Finish defining the current keyboard macro. */
-extern void end_kbd_macro P_ ((void));
+extern void end_kbd_macro (void);
/* Declare that all chars stored so far in the kbd macro being defined
really belong to it. This is done in between editor commands. */
-extern void finalize_kbd_macro_chars P_ ((void));
+extern void finalize_kbd_macro_chars (void);
/* Store a character into kbd macro being defined */
-extern void store_kbd_macro_char P_ ((Lisp_Object));
+extern void store_kbd_macro_char (Lisp_Object);
/* arch-tag: 8edb7088-682f-4d1f-a4d9-0fbb7284234e
(do not change this comment) */
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index e8d08727915..c938ae752bf 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -965,6 +965,7 @@ $(BLD)/keyboard.$(O) : \
$(SRC)/keyboard.h \
$(SRC)/keymap.h \
$(SRC)/macros.h \
+ $(SRC)/process.h \
$(SRC)/puresize.h \
$(SRC)/syntax.h \
$(SRC)/syssignal.h \
diff --git a/src/marker.c b/src/marker.c
index b3381f9c369..911d2e57706 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -32,15 +32,14 @@ static int cached_bytepos;
static struct buffer *cached_buffer;
static int cached_modiff;
-static void byte_char_debug_check P_ ((struct buffer *, int, int));
+static void byte_char_debug_check (struct buffer *, int, int);
/* Nonzero means enable debugging checks on byte/char correspondences. */
static int byte_debug_flag;
void
-clear_charpos_cache (b)
- struct buffer *b;
+clear_charpos_cache (struct buffer *b)
{
if (cached_buffer == b)
cached_buffer = 0;
@@ -100,9 +99,7 @@ clear_charpos_cache (b)
}
static void
-byte_char_debug_check (b, charpos, bytepos)
- struct buffer *b;
- int charpos, bytepos;
+byte_char_debug_check (struct buffer *b, int charpos, int bytepos)
{
int nchars = 0;
@@ -122,16 +119,13 @@ byte_char_debug_check (b, charpos, bytepos)
}
int
-charpos_to_bytepos (charpos)
- int charpos;
+charpos_to_bytepos (int charpos)
{
return buf_charpos_to_bytepos (current_buffer, charpos);
}
int
-buf_charpos_to_bytepos (b, charpos)
- struct buffer *b;
- int charpos;
+buf_charpos_to_bytepos (struct buffer *b, int charpos)
{
struct Lisp_Marker *tail;
int best_above, best_above_byte;
@@ -254,8 +248,7 @@ buf_charpos_to_bytepos (b, charpos)
in the simplest, most reliable way. */
int
-verify_bytepos (charpos)
- int charpos;
+verify_bytepos (int charpos)
{
int below = 1;
int below_byte = 1;
@@ -315,16 +308,13 @@ verify_bytepos (charpos)
}
int
-bytepos_to_charpos (bytepos)
- int bytepos;
+bytepos_to_charpos (int bytepos)
{
return buf_bytepos_to_charpos (current_buffer, bytepos);
}
int
-buf_bytepos_to_charpos (b, bytepos)
- struct buffer *b;
- int bytepos;
+buf_bytepos_to_charpos (struct buffer *b, int bytepos)
{
struct Lisp_Marker *tail;
int best_above, best_above_byte;
@@ -443,8 +433,7 @@ buf_bytepos_to_charpos (b, bytepos)
DEFUN ("marker-buffer", Fmarker_buffer, Smarker_buffer, 1, 1, 0,
doc: /* Return the buffer that MARKER points into, or nil if none.
Returns nil if MARKER points into a dead buffer. */)
- (marker)
- register Lisp_Object marker;
+ (register Lisp_Object marker)
{
register Lisp_Object buf;
CHECK_MARKER (marker);
@@ -464,8 +453,7 @@ Returns nil if MARKER points into a dead buffer. */)
DEFUN ("marker-position", Fmarker_position, Smarker_position, 1, 1, 0,
doc: /* Return the position MARKER points at, as a character number.
Returns nil if MARKER points nowhere. */)
- (marker)
- Lisp_Object marker;
+ (Lisp_Object marker)
{
CHECK_MARKER (marker);
if (XMARKER (marker)->buffer)
@@ -480,8 +468,7 @@ BUFFER defaults to the current buffer.
If POSITION is nil, makes marker point nowhere.
Then it no longer slows down editing in any buffer.
Returns MARKER. */)
- (marker, position, buffer)
- Lisp_Object marker, position, buffer;
+ (Lisp_Object marker, Lisp_Object position, Lisp_Object buffer)
{
register int charno, bytepos;
register struct buffer *b;
@@ -556,8 +543,7 @@ Returns MARKER. */)
be outside the visible part. */
Lisp_Object
-set_marker_restricted (marker, pos, buffer)
- Lisp_Object marker, pos, buffer;
+set_marker_restricted (Lisp_Object marker, Lisp_Object pos, Lisp_Object buffer)
{
register int charno, bytepos;
register struct buffer *b;
@@ -632,9 +618,7 @@ set_marker_restricted (marker, pos, buffer)
character position and the corresponding byte position. */
Lisp_Object
-set_marker_both (marker, buffer, charpos, bytepos)
- Lisp_Object marker, buffer;
- int charpos, bytepos;
+set_marker_both (Lisp_Object marker, Lisp_Object buffer, int charpos, int bytepos)
{
register struct buffer *b;
register struct Lisp_Marker *m;
@@ -682,9 +666,7 @@ set_marker_both (marker, buffer, charpos, bytepos)
be outside the visible part. */
Lisp_Object
-set_marker_restricted_both (marker, buffer, charpos, bytepos)
- Lisp_Object marker, buffer;
- int charpos, bytepos;
+set_marker_restricted_both (Lisp_Object marker, Lisp_Object buffer, int charpos, int bytepos)
{
register struct buffer *b;
register struct Lisp_Marker *m;
@@ -745,8 +727,7 @@ set_marker_restricted_both (marker, buffer, charpos, bytepos)
including those in chain fields of markers. */
void
-unchain_marker (marker)
- register struct Lisp_Marker *marker;
+unchain_marker (register struct Lisp_Marker *marker)
{
register struct Lisp_Marker *tail, *prev, *next;
register struct buffer *b;
@@ -796,8 +777,7 @@ unchain_marker (marker)
/* Return the char position of marker MARKER, as a C integer. */
int
-marker_position (marker)
- Lisp_Object marker;
+marker_position (Lisp_Object marker)
{
register struct Lisp_Marker *m = XMARKER (marker);
register struct buffer *buf = m->buffer;
@@ -811,8 +791,7 @@ marker_position (marker)
/* Return the byte position of marker MARKER, as a C integer. */
int
-marker_byte_position (marker)
- Lisp_Object marker;
+marker_byte_position (Lisp_Object marker)
{
register struct Lisp_Marker *m = XMARKER (marker);
register struct buffer *buf = m->buffer;
@@ -833,8 +812,7 @@ If argument is a number, makes a new marker pointing
at that position in the current buffer.
The optional argument TYPE specifies the insertion type of the new marker;
see `marker-insertion-type'. */)
- (marker, type)
- register Lisp_Object marker, type;
+ (register Lisp_Object marker, Lisp_Object type)
{
register Lisp_Object new;
@@ -851,8 +829,7 @@ DEFUN ("marker-insertion-type", Fmarker_insertion_type,
Smarker_insertion_type, 1, 1, 0,
doc: /* Return insertion type of MARKER: t if it stays after inserted text.
The value nil means the marker stays before text inserted there. */)
- (marker)
- register Lisp_Object marker;
+ (register Lisp_Object marker)
{
CHECK_MARKER (marker);
return XMARKER (marker)->insertion_type ? Qt : Qnil;
@@ -863,8 +840,7 @@ DEFUN ("set-marker-insertion-type", Fset_marker_insertion_type,
doc: /* Set the insertion-type of MARKER to TYPE.
If TYPE is t, it means the marker advances when you insert text at it.
If TYPE is nil, it means the marker stays behind when you insert text at it. */)
- (marker, type)
- Lisp_Object marker, type;
+ (Lisp_Object marker, Lisp_Object type)
{
CHECK_MARKER (marker);
@@ -875,8 +851,7 @@ If TYPE is nil, it means the marker stays behind when you insert text at it. */
DEFUN ("buffer-has-markers-at", Fbuffer_has_markers_at, Sbuffer_has_markers_at,
1, 1, 0,
doc: /* Return t if there are markers pointing at POSITION in the current buffer. */)
- (position)
- Lisp_Object position;
+ (Lisp_Object position)
{
register struct Lisp_Marker *tail;
register int charno;
@@ -898,8 +873,7 @@ DEFUN ("buffer-has-markers-at", Fbuffer_has_markers_at, Sbuffer_has_markers_at,
/* For debugging -- count the markers in buffer BUF. */
int
-count_markers (buf)
- struct buffer *buf;
+count_markers (struct buffer *buf)
{
int total = 0;
struct Lisp_Marker *tail;
@@ -911,7 +885,7 @@ count_markers (buf)
}
void
-syms_of_marker ()
+syms_of_marker (void)
{
defsubr (&Smarker_position);
defsubr (&Smarker_buffer);
diff --git a/src/md5.c b/src/md5.c
index 37ae2e6acb5..1840c2ac92b 100644
--- a/src/md5.c
+++ b/src/md5.c
@@ -71,8 +71,7 @@ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
/* Initialize structure containing state of computation.
(RFC 1321, 3.3: Step 3) */
void
-md5_init_ctx (ctx)
- struct md5_ctx *ctx;
+md5_init_ctx (struct md5_ctx *ctx)
{
ctx->A = 0x67452301;
ctx->B = 0xefcdab89;
@@ -89,9 +88,7 @@ md5_init_ctx (ctx)
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
void *
-md5_read_ctx (ctx, resbuf)
- const struct md5_ctx *ctx;
- void *resbuf;
+md5_read_ctx (const struct md5_ctx *ctx, void *resbuf)
{
((md5_uint32 *) resbuf)[0] = SWAP (ctx->A);
((md5_uint32 *) resbuf)[1] = SWAP (ctx->B);
@@ -107,9 +104,7 @@ md5_read_ctx (ctx, resbuf)
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
void *
-md5_finish_ctx (ctx, resbuf)
- struct md5_ctx *ctx;
- void *resbuf;
+md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
{
/* Take yet unprocessed bytes into account. */
md5_uint32 bytes = ctx->buflen;
@@ -138,9 +133,7 @@ md5_finish_ctx (ctx, resbuf)
resulting message digest number will be written into the 16 bytes
beginning at RESBLOCK. */
int
-md5_stream (stream, resblock)
- FILE *stream;
- void *resblock;
+md5_stream (FILE *stream, void *resblock)
{
/* Important: BLOCKSIZE must be a multiple of 64. */
#define BLOCKSIZE 4096
@@ -195,10 +188,7 @@ md5_stream (stream, resblock)
output yields to the wanted ASCII representation of the message
digest. */
void *
-md5_buffer (buffer, len, resblock)
- const char *buffer;
- size_t len;
- void *resblock;
+md5_buffer (const char *buffer, size_t len, void *resblock)
{
struct md5_ctx ctx;
@@ -214,10 +204,7 @@ md5_buffer (buffer, len, resblock)
void
-md5_process_bytes (buffer, len, ctx)
- const void *buffer;
- size_t len;
- struct md5_ctx *ctx;
+md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
{
/* const void aligned_buffer = buffer; */
@@ -287,10 +274,7 @@ md5_process_bytes (buffer, len, ctx)
It is assumed that LEN % 64 == 0. */
void
-md5_process_block (buffer, len, ctx)
- const void *buffer;
- size_t len;
- struct md5_ctx *ctx;
+md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
{
md5_uint32 correct_words[16];
const md5_uint32 *words = buffer;
diff --git a/src/md5.h b/src/md5.h
index a23dbd089ba..cf9566b864b 100644
--- a/src/md5.h
+++ b/src/md5.h
@@ -97,21 +97,21 @@ struct md5_ctx
/* Initialize structure containing state of computation.
(RFC 1321, 3.3: Step 3) */
-extern void md5_init_ctx __P ((struct md5_ctx *ctx));
+extern void md5_init_ctx (struct md5_ctx *ctx);
/* Starting with the result of former calls of this function (or the
initialization function update the context for the next LEN bytes
starting at BUFFER.
It is necessary that LEN is a multiple of 64!!! */
-extern void md5_process_block __P ((const void *buffer, size_t len,
- struct md5_ctx *ctx));
+extern void md5_process_block (const void *buffer, size_t len,
+ struct md5_ctx *ctx);
/* Starting with the result of former calls of this function (or the
initialization function update the context for the next LEN bytes
starting at BUFFER.
It is NOT required that LEN is a multiple of 64. */
-extern void md5_process_bytes __P ((const void *buffer, size_t len,
- struct md5_ctx *ctx));
+extern void md5_process_bytes (const void *buffer, size_t len,
+ struct md5_ctx *ctx);
/* Process the remaining bytes in the buffer and put result from CTX
in first 16 bytes following RESBUF. The result is always in little
@@ -120,7 +120,7 @@ extern void md5_process_bytes __P ((const void *buffer, size_t len,
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
-extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf));
+extern void *md5_finish_ctx (struct md5_ctx *ctx, void *resbuf);
/* Put result from CTX in first 16 bytes following RESBUF. The result is
@@ -129,20 +129,20 @@ extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf));
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
-extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf));
+extern void *md5_read_ctx (const struct md5_ctx *ctx, void *resbuf);
/* Compute MD5 message digest for bytes read from STREAM. The
resulting message digest number will be written into the 16 bytes
beginning at RESBLOCK. */
-extern int md5_stream __P ((FILE *stream, void *resblock));
+extern int md5_stream (FILE *stream, void *resblock);
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
result is always in little endian byte order, so that a byte-wise
output yields to the wanted ASCII representation of the message
digest. */
-extern void *md5_buffer __P ((const char *buffer, size_t len,
- void *resblock));
+extern void *md5_buffer (const char *buffer, size_t len,
+ void *resblock);
#endif /* md5.h */
diff --git a/src/mem-limits.h b/src/mem-limits.h
index d811968b13f..a550e1464b8 100644
--- a/src/mem-limits.h
+++ b/src/mem-limits.h
@@ -25,17 +25,6 @@ extern int etext;
/* Some systems need this before <sys/resource.h>. */
#include <sys/types.h>
-#ifdef _LIBC
-
-#include <sys/resource.h>
-#define BSD4_2 /* Tell code below to use getrlimit. */
-
-/* Old Linux startup code won't define __data_start. */
-extern int etext, __data_start; weak_extern (__data_start)
-#define start_of_data() (&__data_start ?: &etext)
-
-#else /* not _LIBC */
-
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/time.h>
# include <sys/resource.h>
@@ -49,20 +38,11 @@ extern int etext, __data_start; weak_extern (__data_start)
#define BSD4_2
#endif
-#ifndef BSD4_2
-#ifndef USG
-#ifndef MSDOS
-#ifndef WINDOWSNT
-#include <sys/vlimit.h>
-#endif /* not WINDOWSNT */
-#endif /* not MSDOS */
-#endif /* not USG */
-#else /* if BSD4_2 */
+#ifdef BSD4_2
#include <sys/time.h>
#include <sys/resource.h>
#endif /* BSD4_2 */
-#ifdef emacs
/* The important properties of this type are that 1) it's a pointer, and
2) arithmetic on it should work as if the size of the object pointed
to has a size of 1. */
@@ -75,7 +55,7 @@ typedef unsigned long SIZE;
#endif
#define NULL ((POINTER) 0)
-extern POINTER start_of_data ();
+extern POINTER start_of_data (void);
#if defined USE_LSB_TAG
#define EXCEEDS_LISP_PTR(ptr) 0
#elif defined DATA_SEG_BITS
@@ -85,26 +65,5 @@ extern POINTER start_of_data ();
#define EXCEEDS_LISP_PTR(ptr) ((EMACS_UINT) (ptr) >> VALBITS)
#endif
-#ifdef DATA_START
-#define start_of_data() ((char *)DATA_START)
-#endif
-
-#ifdef BSD_SYSTEM
-#ifndef DATA_SEG_BITS
-#ifndef DATA_START
-extern char etext;
-#define start_of_data() &etext
-#endif
-#endif
-#endif
-
-#else /* not emacs */
-extern char etext;
-#define start_of_data() &etext
-#endif /* not emacs */
-
-#endif /* not _LIBC */
-
-
/* arch-tag: fe39244e-e54f-4208-b7aa-02556f7841c5
(do not change this comment) */
diff --git a/src/menu.c b/src/menu.c
index ca00c06a98b..321dc2677a1 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -87,7 +87,7 @@ int menu_items_n_panes;
static int menu_items_submenu_depth;
void
-init_menu_items ()
+init_menu_items (void)
{
if (!NILP (menu_items_inuse))
error ("Trying to use a menu from within a menu-entry");
@@ -107,13 +107,12 @@ init_menu_items ()
/* Call at the end of generating the data in menu_items. */
void
-finish_menu_items ()
+finish_menu_items (void)
{
}
Lisp_Object
-unuse_menu_items (dummy)
- Lisp_Object dummy;
+unuse_menu_items (Lisp_Object dummy)
{
return menu_items_inuse = Qnil;
}
@@ -122,7 +121,7 @@ unuse_menu_items (dummy)
in menu_items. */
void
-discard_menu_items ()
+discard_menu_items (void)
{
/* Free the structure if it is especially large.
Otherwise, hold on to it, to save time. */
@@ -134,19 +133,20 @@ discard_menu_items ()
xassert (NILP (menu_items_inuse));
}
+#ifdef HAVE_NS
static Lisp_Object
cleanup_popup_menu (Lisp_Object arg)
{
discard_menu_items ();
return Qnil;
}
+#endif
/* This undoes save_menu_items, and it is called by the specpdl unwind
mechanism. */
static Lisp_Object
-restore_menu_items (saved)
- Lisp_Object saved;
+restore_menu_items (Lisp_Object saved)
{
menu_items = XCAR (saved);
menu_items_inuse = (! NILP (menu_items) ? Qt : Qnil);
@@ -164,7 +164,7 @@ restore_menu_items (saved)
It will be restored when the specpdl is unwound. */
void
-save_menu_items ()
+save_menu_items (void)
{
Lisp_Object saved = list4 (!NILP (menu_items_inuse) ? menu_items : Qnil,
make_number (menu_items_used),
@@ -179,7 +179,7 @@ save_menu_items ()
/* Make the menu_items vector twice as large. */
static void
-grow_menu_items ()
+grow_menu_items (void)
{
menu_items_allocated *= 2;
menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
@@ -188,7 +188,7 @@ grow_menu_items ()
/* Begin a submenu. */
static void
-push_submenu_start ()
+push_submenu_start (void)
{
if (menu_items_used + 1 > menu_items_allocated)
grow_menu_items ();
@@ -200,7 +200,7 @@ push_submenu_start ()
/* End a submenu. */
static void
-push_submenu_end ()
+push_submenu_end (void)
{
if (menu_items_used + 1 > menu_items_allocated)
grow_menu_items ();
@@ -212,7 +212,7 @@ push_submenu_end ()
/* Indicate boundary between left and right. */
static void
-push_left_right_boundary ()
+push_left_right_boundary (void)
{
if (menu_items_used + 1 > menu_items_allocated)
grow_menu_items ();
@@ -224,8 +224,7 @@ push_left_right_boundary ()
NAME is the pane name. PREFIX_VEC is a prefix key for this pane. */
static void
-push_menu_pane (name, prefix_vec)
- Lisp_Object name, prefix_vec;
+push_menu_pane (Lisp_Object name, Lisp_Object prefix_vec)
{
if (menu_items_used + MENU_ITEMS_PANE_LENGTH > menu_items_allocated)
grow_menu_items ();
@@ -246,8 +245,7 @@ push_menu_pane (name, prefix_vec)
item, one of nil, `toggle' or `radio'. */
static void
-push_menu_item (name, enable, key, def, equiv, type, selected, help)
- Lisp_Object name, enable, key, def, equiv, type, selected, help;
+push_menu_item (Lisp_Object name, Lisp_Object enable, Lisp_Object key, Lisp_Object def, Lisp_Object equiv, Lisp_Object type, Lisp_Object selected, Lisp_Object help)
{
if (menu_items_used + MENU_ITEMS_ITEM_LENGTH > menu_items_allocated)
grow_menu_items ();
@@ -272,8 +270,8 @@ struct skp
int notbuttons;
};
-static void single_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
- void *));
+static void single_menu_item (Lisp_Object, Lisp_Object, Lisp_Object,
+ void *);
/* This is a recursive subroutine of keymap_panes.
It handles one keymap, KEYMAP.
@@ -332,9 +330,7 @@ single_keymap_panes (Lisp_Object keymap, Lisp_Object pane_name,
If we encounter submenus deeper than SKP->MAXDEPTH levels, ignore them. */
static void
-single_menu_item (key, item, dummy, skp_v)
- Lisp_Object key, item, dummy;
- void *skp_v;
+single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *skp_v)
{
Lisp_Object map, item_string, enabled;
struct gcpro gcpro1, gcpro2;
@@ -456,9 +452,7 @@ single_menu_item (key, item, dummy, skp_v)
and generate menu panes for them in menu_items. */
static void
-keymap_panes (keymaps, nmaps)
- Lisp_Object *keymaps;
- int nmaps;
+keymap_panes (Lisp_Object *keymaps, int nmaps)
{
int mapno;
@@ -477,8 +471,7 @@ keymap_panes (keymaps, nmaps)
/* Push the items in a single pane defined by the alist PANE. */
static void
-list_of_items (pane)
- Lisp_Object pane;
+list_of_items (Lisp_Object pane)
{
Lisp_Object tail, item, item1;
@@ -505,8 +498,7 @@ list_of_items (pane)
alist-of-alists MENU.
This handles old-fashioned calls to x-popup-menu. */
void
-list_of_panes (menu)
- Lisp_Object menu;
+list_of_panes (Lisp_Object menu)
{
Lisp_Object tail;
@@ -531,8 +523,7 @@ list_of_panes (menu)
whose event type is ITEM_KEY (with string ITEM_NAME)
and whose contents come from the list of keymaps MAPS. */
int
-parse_single_submenu (item_key, item_name, maps)
- Lisp_Object item_key, item_name, maps;
+parse_single_submenu (Lisp_Object item_key, Lisp_Object item_name, Lisp_Object maps)
{
Lisp_Object length;
int len;
@@ -583,7 +574,7 @@ parse_single_submenu (item_key, item_name, maps)
/* Allocate a widget_value, blocking input. */
widget_value *
-xmalloc_widget_value ()
+xmalloc_widget_value (void)
{
widget_value *value;
@@ -600,8 +591,7 @@ xmalloc_widget_value ()
must be left alone. */
void
-free_menubar_widget_value_tree (wv)
- widget_value *wv;
+free_menubar_widget_value_tree (widget_value *wv)
{
if (! wv) return;
@@ -627,8 +617,7 @@ free_menubar_widget_value_tree (wv)
in menu_items starting at index START, up to index END. */
widget_value *
-digest_single_submenu (start, end, top_level_items)
- int start, end, top_level_items;
+digest_single_submenu (int start, int end, int top_level_items)
{
widget_value *wv, *prev_wv, *save_wv, *first_wv;
int i;
@@ -856,8 +845,7 @@ digest_single_submenu (start, end, top_level_items)
tree is constructed, and small strings are relocated. So we must wait
until no GC can happen before storing pointers into lisp values. */
void
-update_submenu_strings (first_wv)
- widget_value *first_wv;
+update_submenu_strings (widget_value *first_wv)
{
widget_value *wv;
@@ -891,11 +879,7 @@ update_submenu_strings (first_wv)
VECTOR is an array of menu events for the whole menu. */
void
-find_and_call_menu_selection (f, menu_bar_items_used, vector, client_data)
- FRAME_PTR f;
- int menu_bar_items_used;
- Lisp_Object vector;
- void *client_data;
+find_and_call_menu_selection (FRAME_PTR f, int menu_bar_items_used, Lisp_Object vector, void *client_data)
{
Lisp_Object prefix, entry;
Lisp_Object *subprefix_stack;
@@ -1082,8 +1066,7 @@ keyboard input, then this normally results in a quit and
`x-popup-menu' does not return. But if POSITION is a mouse button
event (indicating that the user invoked the menu with the mouse) then
no quit occurs and `x-popup-menu' returns nil. */)
- (position, menu)
- Lisp_Object position, menu;
+ (Lisp_Object position, Lisp_Object menu)
{
Lisp_Object keymap, tem;
int xpos = 0, ypos = 0;
@@ -1164,12 +1147,12 @@ no quit occurs and `x-popup-menu' returns nil. */)
Lisp_Object bar_window;
enum scroll_bar_part part;
unsigned long time;
- void (*mouse_position_hook) P_ ((struct frame **, int,
- Lisp_Object *,
- enum scroll_bar_part *,
- Lisp_Object *,
- Lisp_Object *,
- unsigned long *)) =
+ void (*mouse_position_hook) (struct frame **, int,
+ Lisp_Object *,
+ enum scroll_bar_part *,
+ Lisp_Object *,
+ Lisp_Object *,
+ unsigned long *) =
FRAME_TERMINAL (new_f)->mouse_position_hook;
if (mouse_position_hook)
@@ -1368,7 +1351,7 @@ no quit occurs and `x-popup-menu' returns nil. */)
}
void
-syms_of_menu ()
+syms_of_menu (void)
{
staticpro (&menu_items);
menu_items = Qnil;
diff --git a/src/menu.h b/src/menu.h
index 5f3c3d24e22..eff6f5ddf70 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -21,17 +21,17 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
extern Lisp_Object Vmenu_updating_frame;
-extern void init_menu_items P_ ((void));
-extern void finish_menu_items P_ ((void));
-extern void discard_menu_items P_ ((void));
-extern void save_menu_items P_ ((void));
-extern int parse_single_submenu P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
-extern void list_of_panes P_ ((Lisp_Object));
+extern void init_menu_items (void);
+extern void finish_menu_items (void);
+extern void discard_menu_items (void);
+extern void save_menu_items (void);
+extern int parse_single_submenu (Lisp_Object, Lisp_Object, Lisp_Object);
+extern void list_of_panes (Lisp_Object);
#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI)
-extern void free_menubar_widget_value_tree P_ ((widget_value *));
-extern void update_submenu_strings P_ ((widget_value *));
-extern void find_and_call_menu_selection P_ ((FRAME_PTR, int,
- Lisp_Object, void *));
+extern void free_menubar_widget_value_tree (widget_value *);
+extern void update_submenu_strings (widget_value *);
+extern void find_and_call_menu_selection (FRAME_PTR, int,
+ Lisp_Object, void *);
#endif
#ifdef HAVE_X_WINDOWS
diff --git a/src/minibuf.c b/src/minibuf.c
index 539a953f7ee..5dc7b0b1f06 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -154,7 +154,7 @@ extern Lisp_Object Qfield;
or when a minibuffer exits. */
void
-choose_minibuf_frame ()
+choose_minibuf_frame (void)
{
if (FRAMEP (selected_frame)
&& FRAME_LIVE_P (XFRAME (selected_frame))
@@ -193,8 +193,7 @@ choose_minibuf_frame ()
}
Lisp_Object
-choose_minibuf_frame_1 (ignore)
- Lisp_Object ignore;
+choose_minibuf_frame_1 (Lisp_Object ignore)
{
choose_minibuf_frame ();
return Qnil;
@@ -205,8 +204,7 @@ DEFUN ("set-minibuffer-window", Fset_minibuffer_window,
doc: /* Specify which minibuffer window to use for the minibuffer.
This affects where the minibuffer is displayed if you put text in it
without invoking the usual minibuffer commands. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
CHECK_WINDOW (window);
if (! MINI_WINDOW_P (XWINDOW (window)))
@@ -220,27 +218,26 @@ without invoking the usual minibuffer commands. */)
/* Actual minibuffer invocation. */
-static Lisp_Object read_minibuf_unwind P_ ((Lisp_Object));
-static Lisp_Object run_exit_minibuf_hook P_ ((Lisp_Object));
-static Lisp_Object read_minibuf P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object,
- int, Lisp_Object,
- Lisp_Object, Lisp_Object,
- int, int));
-static Lisp_Object read_minibuf_noninteractive P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object,
- int, Lisp_Object,
- Lisp_Object, Lisp_Object,
- int, int));
-static Lisp_Object string_to_object P_ ((Lisp_Object, Lisp_Object));
+static Lisp_Object read_minibuf_unwind (Lisp_Object);
+static Lisp_Object run_exit_minibuf_hook (Lisp_Object);
+static Lisp_Object read_minibuf (Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object,
+ int, Lisp_Object,
+ Lisp_Object, Lisp_Object,
+ int, int);
+static Lisp_Object read_minibuf_noninteractive (Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object,
+ int, Lisp_Object,
+ Lisp_Object, Lisp_Object,
+ int, int);
+static Lisp_Object string_to_object (Lisp_Object, Lisp_Object);
/* Read a Lisp object from VAL and return it. If VAL is an empty
string, and DEFALT is a string, read from DEFALT instead of VAL. */
static Lisp_Object
-string_to_object (val, defalt)
- Lisp_Object val, defalt;
+string_to_object (Lisp_Object val, Lisp_Object defalt)
{
struct gcpro gcpro1, gcpro2;
Lisp_Object expr_and_pos;
@@ -281,19 +278,12 @@ string_to_object (val, defalt)
from read_minibuf to do the job if noninteractive. */
static Lisp_Object
-read_minibuf_noninteractive (map, initial, prompt, backup_n, expflag,
- histvar, histpos, defalt, allow_props,
- inherit_input_method)
- Lisp_Object map;
- Lisp_Object initial;
- Lisp_Object prompt;
- Lisp_Object backup_n;
- int expflag;
- Lisp_Object histvar;
- Lisp_Object histpos;
- Lisp_Object defalt;
- int allow_props;
- int inherit_input_method;
+read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
+ Lisp_Object prompt, Lisp_Object backup_n,
+ int expflag,
+ Lisp_Object histvar, Lisp_Object histpos,
+ Lisp_Object defalt,
+ int allow_props, int inherit_input_method)
{
int size, len;
char *line, *s;
@@ -342,8 +332,7 @@ DEFUN ("minibufferp", Fminibufferp,
doc: /* Return t if BUFFER is a minibuffer.
No argument or nil as argument means use current buffer as BUFFER.
BUFFER can be a buffer or a buffer name. */)
- (buffer)
- Lisp_Object buffer;
+ (Lisp_Object buffer)
{
Lisp_Object tem;
@@ -362,7 +351,7 @@ DEFUN ("minibuffer-prompt-end", Fminibuffer_prompt_end,
Sminibuffer_prompt_end, 0, 0, 0,
doc: /* Return the buffer position of the end of the minibuffer prompt.
Return (point-min) if current buffer is not a minibuffer. */)
- ()
+ (void)
{
/* This function is written to be most efficient when there's a prompt. */
Lisp_Object beg, end, tem;
@@ -384,7 +373,7 @@ DEFUN ("minibuffer-contents", Fminibuffer_contents,
Sminibuffer_contents, 0, 0, 0,
doc: /* Return the user input in a minibuffer as a string.
If the current buffer is not a minibuffer, return its entire contents. */)
- ()
+ (void)
{
int prompt_end = XINT (Fminibuffer_prompt_end ());
return make_buffer_string (prompt_end, ZV, 1);
@@ -394,7 +383,7 @@ DEFUN ("minibuffer-contents-no-properties", Fminibuffer_contents_no_properties,
Sminibuffer_contents_no_properties, 0, 0, 0,
doc: /* Return the user input in a minibuffer as a string, without text-properties.
If the current buffer is not a minibuffer, return its entire contents. */)
- ()
+ (void)
{
int prompt_end = XINT (Fminibuffer_prompt_end ());
return make_buffer_string (prompt_end, ZV, 0);
@@ -405,7 +394,7 @@ DEFUN ("minibuffer-completion-contents", Fminibuffer_completion_contents,
doc: /* Return the user input in a minibuffer before point as a string.
That is what completion commands operate on.
If the current buffer is not a minibuffer, return its entire contents. */)
- ()
+ (void)
{
int prompt_end = XINT (Fminibuffer_prompt_end ());
if (PT < prompt_end)
@@ -438,18 +427,10 @@ If the current buffer is not a minibuffer, return its entire contents. */)
current input method. */
static Lisp_Object
-read_minibuf (map, initial, prompt, backup_n, expflag,
- histvar, histpos, defalt, allow_props, inherit_input_method)
- Lisp_Object map;
- Lisp_Object initial;
- Lisp_Object prompt;
- Lisp_Object backup_n;
- int expflag;
- Lisp_Object histvar;
- Lisp_Object histpos;
- Lisp_Object defalt;
- int allow_props;
- int inherit_input_method;
+read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
+ Lisp_Object backup_n, int expflag,
+ Lisp_Object histvar, Lisp_Object histpos, Lisp_Object defalt,
+ int allow_props, int inherit_input_method)
{
Lisp_Object val;
int count = SPECPDL_INDEX ();
@@ -839,12 +820,11 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
used for nonrecursive minibuffer invocations */
Lisp_Object
-get_minibuffer (depth)
- int depth;
+get_minibuffer (int depth)
{
Lisp_Object tail, num, buf;
char name[24];
- extern Lisp_Object nconc2 ();
+ extern Lisp_Object nconc2 (Lisp_Object, Lisp_Object);
XSETFASTINT (num, depth);
tail = Fnthcdr (num, Vminibuffer_list);
@@ -884,8 +864,7 @@ get_minibuffer (depth)
}
static Lisp_Object
-run_exit_minibuf_hook (data)
- Lisp_Object data;
+run_exit_minibuf_hook (Lisp_Object data)
{
if (!NILP (Vminibuffer_exit_hook) && !EQ (Vminibuffer_exit_hook, Qunbound)
&& !NILP (Vrun_hooks))
@@ -898,8 +877,7 @@ run_exit_minibuf_hook (data)
not, and it restores the current window, buffer, etc. */
static Lisp_Object
-read_minibuf_unwind (data)
- Lisp_Object data;
+read_minibuf_unwind (Lisp_Object data)
{
Lisp_Object old_deactivate_mark;
Lisp_Object window;
@@ -1001,9 +979,7 @@ POSITION in the minibuffer. Any integer value less than or equal to
one puts point at the beginning of the string. *Note* that this
behavior differs from the way such arguments are used in `completing-read'
and some related functions, which use zero-indexing for POSITION. */)
- (prompt, initial_contents, keymap, read, hist, default_value, inherit_input_method)
- Lisp_Object prompt, initial_contents, keymap, read, hist, default_value;
- Lisp_Object inherit_input_method;
+ (Lisp_Object prompt, Lisp_Object initial_contents, Lisp_Object keymap, Lisp_Object read, Lisp_Object hist, Lisp_Object default_value, Lisp_Object inherit_input_method)
{
Lisp_Object histvar, histpos, val;
struct gcpro gcpro1;
@@ -1045,8 +1021,7 @@ Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS
is a string to insert in the minibuffer before reading.
\(INITIAL-CONTENTS can also be a cons of a string and an integer.
Such arguments are used as in `read-from-minibuffer'.) */)
- (prompt, initial_contents)
- Lisp_Object prompt, initial_contents;
+ (Lisp_Object prompt, Lisp_Object initial_contents)
{
CHECK_STRING (prompt);
return read_minibuf (Vminibuffer_local_map, initial_contents,
@@ -1060,8 +1035,7 @@ Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS
is a string to insert in the minibuffer before reading.
\(INITIAL-CONTENTS can also be a cons of a string and an integer.
Such arguments are used as in `read-from-minibuffer'.) */)
- (prompt, initial_contents)
- Lisp_Object prompt, initial_contents;
+ (Lisp_Object prompt, Lisp_Object initial_contents)
{
return Feval (read_minibuf (Vread_expression_map, initial_contents,
prompt, Qnil, 1, Qread_expression_history,
@@ -1085,9 +1059,7 @@ Fourth arg DEFAULT-VALUE is the default value or the list of default values.
empty string.
Fifth arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits
the current input method and the setting of `enable-multibyte-characters'. */)
- (prompt, initial_input, history, default_value, inherit_input_method)
- Lisp_Object prompt, initial_input, history, default_value;
- Lisp_Object inherit_input_method;
+ (Lisp_Object prompt, Lisp_Object initial_input, Lisp_Object history, Lisp_Object default_value, Lisp_Object inherit_input_method)
{
Lisp_Object val;
val = Fread_from_minibuffer (prompt, initial_input, Qnil,
@@ -1108,8 +1080,7 @@ Such values are treated as in `read-from-minibuffer', but are normally
not useful in this function.)
Third arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits
the current input method and the setting of`enable-multibyte-characters'. */)
- (prompt, initial, inherit_input_method)
- Lisp_Object prompt, initial, inherit_input_method;
+ (Lisp_Object prompt, Lisp_Object initial, Lisp_Object inherit_input_method)
{
CHECK_STRING (prompt);
return read_minibuf (Vminibuffer_local_ns_map, initial, prompt, Qnil,
@@ -1121,8 +1092,7 @@ DEFUN ("read-command", Fread_command, Sread_command, 1, 2, 0,
doc: /* Read the name of a command and return as a symbol.
Prompt with PROMPT. By default, return DEFAULT-VALUE or its first element
if it is a list. */)
- (prompt, default_value)
- Lisp_Object prompt, default_value;
+ (Lisp_Object prompt, Lisp_Object default_value)
{
Lisp_Object name, default_string;
@@ -1144,8 +1114,7 @@ if it is a list. */)
DEFUN ("read-function", Fread_function, Sread_function, 1, 1, 0,
doc: /* One arg PROMPT, a string. Read the name of a function and return as a symbol.
Prompt with PROMPT. */)
- (prompt)
- Lisp_Object prompt;
+ (Lisp_Object prompt)
{
return Fintern (Fcompleting_read (prompt, Vobarray, Qfboundp, Qt, Qnil, Qnil, Qnil, Qnil),
Qnil);
@@ -1157,8 +1126,7 @@ DEFUN ("read-variable", Fread_variable, Sread_variable, 1, 2, 0,
Prompt with PROMPT. By default, return DEFAULT-VALUE or its first element
if it is a list.
A user variable is one for which `user-variable-p' returns non-nil. */)
- (prompt, default_value)
- Lisp_Object prompt, default_value;
+ (Lisp_Object prompt, Lisp_Object default_value)
{
Lisp_Object name, default_string;
@@ -1190,8 +1158,7 @@ If `read-buffer-completion-ignore-case' is non-nil, completion ignores
case while reading the buffer name.
If `read-buffer-function' is non-nil, this works by calling it as a
function, instead of the usual behavior. */)
- (prompt, def, require_match)
- Lisp_Object prompt, def, require_match;
+ (Lisp_Object prompt, Lisp_Object def, Lisp_Object require_match)
{
Lisp_Object args[4], result;
unsigned char *s;
@@ -1249,8 +1216,7 @@ function, instead of the usual behavior. */)
}
static Lisp_Object
-minibuf_conform_representation (string, basis)
- Lisp_Object string, basis;
+minibuf_conform_representation (Lisp_Object string, Lisp_Object basis)
{
if (STRING_MULTIBYTE (string) == STRING_MULTIBYTE (basis))
return string;
@@ -1292,8 +1258,7 @@ or the symbol from the obarray. If COLLECTION is a hash-table,
predicate is called with two arguments: the key and the value.
Additionally to this predicate, `completion-regexp-list'
is used to further constrain the set of candidates. */)
- (string, collection, predicate)
- Lisp_Object string, collection, predicate;
+ (Lisp_Object string, Lisp_Object collection, Lisp_Object predicate)
{
Lisp_Object bestmatch, tail, elt, eltstring;
/* Size in bytes of BESTMATCH. */
@@ -1564,8 +1529,7 @@ is used to further constrain the set of candidates.
An obsolete optional fourth argument HIDE-SPACES is still accepted for
backward compatibility. If non-nil, strings in COLLECTION that start
with a space are ignored unless STRING itself starts with a space. */)
- (string, collection, predicate, hide_spaces)
- Lisp_Object string, collection, predicate, hide_spaces;
+ (Lisp_Object string, Lisp_Object collection, Lisp_Object predicate, Lisp_Object hide_spaces)
{
Lisp_Object tail, elt, eltstring;
Lisp_Object allmatches;
@@ -1774,9 +1738,7 @@ If INHERIT-INPUT-METHOD is non-nil, the minibuffer inherits
Completion ignores case if the ambient value of
`completion-ignore-case' is non-nil. */)
- (prompt, collection, predicate, require_match, initial_input, hist, def, inherit_input_method)
- Lisp_Object prompt, collection, predicate, require_match, initial_input;
- Lisp_Object hist, def, inherit_input_method;
+ (Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method)
{
Lisp_Object val, histvar, histpos, position;
Lisp_Object init;
@@ -1843,7 +1805,7 @@ Completion ignores case if the ambient value of
RETURN_UNGCPRO (unbind_to (count, val));
}
-Lisp_Object Fassoc_string ();
+Lisp_Object Fassoc_string (register Lisp_Object key, Lisp_Object list, Lisp_Object case_fold);
/* Test whether TXT is an exact completion. */
DEFUN ("test-completion", Ftest_completion, Stest_completion, 2, 3, 0,
@@ -1851,8 +1813,7 @@ DEFUN ("test-completion", Ftest_completion, Stest_completion, 2, 3, 0,
Takes the same arguments as `all-completions' and `try-completion'.
If COLLECTION is a function, it is called with three arguments:
the values STRING, PREDICATE and `lambda'. */)
- (string, collection, predicate)
- Lisp_Object string, collection, predicate;
+ (Lisp_Object string, Lisp_Object collection, Lisp_Object predicate)
{
Lisp_Object regexps, tail, tem = Qnil;
int i = 0;
@@ -1970,8 +1931,7 @@ If the argument FLAG is nil, invoke `try-completion', if it's t, invoke
The arguments STRING and PREDICATE are as in `try-completion',
`all-completions', and `test-completion'. */)
- (string, predicate, flag)
- Lisp_Object string, predicate, flag;
+ (Lisp_Object string, Lisp_Object predicate, Lisp_Object flag)
{
if (NILP (flag))
return Ftry_completion (string, Vbuffer_alist, predicate);
@@ -2015,9 +1975,7 @@ is ignored.
Unlike `assoc', KEY can also match an entry in LIST consisting of a
single string, rather than a cons cell whose car is a string. */)
- (key, list, case_fold)
- register Lisp_Object key;
- Lisp_Object list, case_fold;
+ (register Lisp_Object key, Lisp_Object list, Lisp_Object case_fold)
{
register Lisp_Object tail;
@@ -2046,7 +2004,7 @@ single string, rather than a cons cell whose car is a string. */)
DEFUN ("minibuffer-depth", Fminibuffer_depth, Sminibuffer_depth, 0, 0, 0,
doc: /* Return current depth of activations of minibuffer, a nonnegative integer. */)
- ()
+ (void)
{
return make_number (minibuf_level);
}
@@ -2054,21 +2012,21 @@ DEFUN ("minibuffer-depth", Fminibuffer_depth, Sminibuffer_depth, 0, 0, 0,
DEFUN ("minibuffer-prompt", Fminibuffer_prompt, Sminibuffer_prompt, 0, 0, 0,
doc: /* Return the prompt string of the currently-active minibuffer.
If no minibuffer is active, return nil. */)
- ()
+ (void)
{
return Fcopy_sequence (minibuf_prompt);
}
void
-init_minibuf_once ()
+init_minibuf_once (void)
{
Vminibuffer_list = Qnil;
staticpro (&Vminibuffer_list);
}
void
-syms_of_minibuf ()
+syms_of_minibuf (void)
{
minibuf_level = 0;
minibuf_prompt = Qnil;
diff --git a/src/mktime.c b/src/mktime.c
index 20c1092a62a..3570cecd451 100644
--- a/src/mktime.c
+++ b/src/mktime.c
@@ -57,14 +57,6 @@
# define mktime my_mktime
#endif /* DEBUG */
-#ifndef __P
-# if defined __GNUC__ || (defined __STDC__ && __STDC__)
-# define __P(args) args
-# else
-# define __P(args) ()
-# endif /* GCC. */
-#endif /* Not __P. */
-
#ifndef CHAR_BIT
# define CHAR_BIT 8
#endif
diff --git a/src/msdos.c b/src/msdos.c
index ea604d29992..8bfdce22fcd 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -35,7 +35,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/time.h>
#include <dos.h>
#include <errno.h>
-#include <string.h> /* for bzero and string functions */
+#include <string.h> /* for memset and string functions */
#include <sys/stat.h> /* for _fixpath */
#include <unistd.h> /* for chdir, dup, dup2, etc. */
#include <dir.h> /* for getdisk */
@@ -102,7 +102,7 @@ int _crt0_startup_flags = (_CRT0_FLAG_UNIX_SBRK | _CRT0_FLAG_FILL_SBRK_MEMORY);
#endif /* not SYSTEM_MALLOC */
static unsigned long
-event_timestamp ()
+event_timestamp (void)
{
struct time t;
unsigned long s;
@@ -138,7 +138,7 @@ static int mouse_button_translate[NUM_MOUSE_BUTTONS];
static int mouse_button_count;
void
-mouse_on ()
+mouse_on (void)
{
union REGS regs;
@@ -155,7 +155,7 @@ mouse_on ()
}
void
-mouse_off ()
+mouse_off (void)
{
union REGS regs;
@@ -195,8 +195,7 @@ DEFUN ("msdos-set-mouse-buttons", Fmsdos_set_mouse_buttons, Smsdos_set_mouse_but
This is useful with mice that report the number of buttons inconsistently,
e.g., if the number of buttons is reported as 3, but Emacs only sees 2 of
them. This happens with wheeled mice on Windows 9X, for example. */)
- (nbuttons)
- Lisp_Object nbuttons;
+ (Lisp_Object nbuttons)
{
int n;
@@ -222,8 +221,7 @@ mouse_get_xy (int *x, int *y)
}
void
-mouse_moveto (x, y)
- int x, y;
+mouse_moveto (int x, int y)
{
union REGS regs;
struct tty_display_info *tty = CURTTY ();
@@ -237,8 +235,7 @@ mouse_moveto (x, y)
}
static int
-mouse_pressed (b, xp, yp)
- int b, *xp, *yp;
+mouse_pressed (int b, int *xp, int *yp)
{
union REGS regs;
@@ -253,8 +250,7 @@ mouse_pressed (b, xp, yp)
}
static int
-mouse_released (b, xp, yp)
- int b, *xp, *yp;
+mouse_released (int b, int *xp, int *yp)
{
union REGS regs;
@@ -269,8 +265,7 @@ mouse_released (b, xp, yp)
}
static int
-mouse_button_depressed (b, xp, yp)
- int b, *xp, *yp;
+mouse_button_depressed (int b, int *xp, int *yp)
{
union REGS regs;
@@ -288,12 +283,9 @@ mouse_button_depressed (b, xp, yp)
}
void
-mouse_get_pos (f, insist, bar_window, part, x, y, time)
- FRAME_PTR *f;
- int insist;
- Lisp_Object *bar_window, *x, *y;
- enum scroll_bar_part *part;
- unsigned long *time;
+mouse_get_pos (FRAME_PTR *f, int insist, Lisp_Object *bar_window,
+ enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y,
+ unsigned long *time)
{
int ix, iy;
Lisp_Object frame, tail;
@@ -311,7 +303,7 @@ mouse_get_pos (f, insist, bar_window, part, x, y, time)
}
static void
-mouse_check_moved ()
+mouse_check_moved (void)
{
int x, y;
@@ -338,7 +330,7 @@ mouse_clear_clicks (void)
}
void
-mouse_init ()
+mouse_init (void)
{
union REGS regs;
struct tty_display_info *tty = CURTTY ();
@@ -440,10 +432,7 @@ dosv_refresh_virtual_screen (int offset, int count)
}
static void
-dos_direct_output (y, x, buf, len)
- int x, y;
- char *buf;
- int len;
+dos_direct_output (int y, int x, char *buf, int len)
{
int t0 = 2 * (x + y * screen_size_X);
int t = t0 + (int) ScreenPrimary;
@@ -510,8 +499,7 @@ vga_installed (void)
ROWS x COLS frame. */
void
-dos_set_window_size (rows, cols)
- int *rows, *cols;
+dos_set_window_size (int *rows, int *cols)
{
char video_name[30];
union REGS regs;
@@ -620,7 +608,7 @@ dos_set_window_size (rows, cols)
the mouse cursor may need to be refreshed. */
static void
-mouse_off_maybe ()
+mouse_off_maybe (void)
{
int x, y;
@@ -1864,10 +1852,7 @@ IT_copy_glyphs (int xfrom, int xto, size_t len, int ypos)
/* Insert and delete glyphs. */
static void
-IT_insert_glyphs (f, start, len)
- struct frame *f;
- register struct glyph *start;
- register int len;
+IT_insert_glyphs (struct frame *f, struct glyph *start, int len)
{
int shift_by_width = screen_size_X - (new_pos_X + len);
@@ -1880,18 +1865,14 @@ IT_insert_glyphs (f, start, len)
}
static void
-IT_delete_glyphs (f, n)
- struct frame *f;
- register int n;
+IT_delete_glyphs (struct frame *f, int n)
{
abort ();
}
/* set-window-configuration on window.c needs this. */
void
-x_set_menu_bar_lines (f, value, oldval)
- struct frame *f;
- Lisp_Object value, oldval;
+x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
set_menu_bar_lines (f, value, oldval);
}
@@ -2063,8 +2044,7 @@ IT_set_terminal_window (struct frame *f, int foo)
DEFUN ("msdos-remember-default-colors", Fmsdos_remember_default_colors,
Smsdos_remember_default_colors, 1, 1, 0,
doc: /* Remember the screen colors of the current frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct frame *f;
@@ -2080,9 +2060,7 @@ DEFUN ("msdos-remember-default-colors", Fmsdos_remember_default_colors,
}
void
-IT_set_frame_parameters (f, alist)
- struct frame *f;
- Lisp_Object alist;
+IT_set_frame_parameters (struct frame *f, Lisp_Object alist)
{
Lisp_Object tail;
int i, j, length = XINT (Flength (alist));
@@ -2092,33 +2070,23 @@ IT_set_frame_parameters (f, alist)
= (Lisp_Object *) alloca (length * sizeof (Lisp_Object));
/* Do we have to reverse the foreground and background colors? */
int reverse = EQ (Fcdr (Fassq (Qreverse, f->param_alist)), Qt);
- int need_to_reverse, was_reverse = reverse;
int redraw = 0, fg_set = 0, bg_set = 0;
unsigned long orig_fg, orig_bg;
Lisp_Object frame_bg, frame_fg;
- extern Lisp_Object Qdefault, QCforeground, QCbackground;
struct tty_display_info *tty = FRAME_TTY (f);
/* If we are creating a new frame, begin with the original screen colors
used for the initial frame. */
- if (EQ (alist, Vdefault_frame_alist)
+ if (!f->default_face_done_p
&& initial_screen_colors[0] != -1 && initial_screen_colors[1] != -1)
{
FRAME_FOREGROUND_PIXEL (f) = initial_screen_colors[0];
FRAME_BACKGROUND_PIXEL (f) = initial_screen_colors[1];
init_frame_faces (f);
+ f->default_face_done_p = 1;
}
- orig_fg = FRAME_FOREGROUND_PIXEL (f);
- orig_bg = FRAME_BACKGROUND_PIXEL (f);
- frame_fg = Fcdr (Fassq (Qforeground_color, f->param_alist));
- frame_bg = Fcdr (Fassq (Qbackground_color, f->param_alist));
- /* frame_fg and frame_bg could be nil if, for example,
- f->param_alist is nil, e.g. if we are called from
- Fmake_terminal_frame. */
- if (NILP (frame_fg))
- frame_fg = build_string (unspecified_fg);
- if (NILP (frame_bg))
- frame_bg = build_string (unspecified_bg);
+ orig_fg = reverse ? FRAME_BACKGROUND_PIXEL (f) : FRAME_FOREGROUND_PIXEL (f);
+ orig_bg = reverse ? FRAME_FOREGROUND_PIXEL (f) : FRAME_BACKGROUND_PIXEL (f);
/* Extract parm names and values into those vectors. */
i = 0;
@@ -2146,58 +2114,75 @@ IT_set_frame_parameters (f, alist)
reverse = EQ (val, Qt);
}
- need_to_reverse = reverse && !was_reverse;
- if (tty->termscript && need_to_reverse)
+ if (tty->termscript && reverse)
fprintf (tty->termscript, "<INVERSE-VIDEO>\n");
/* Now process the alist elements in reverse of specified order. */
for (i--; i >= 0; i--)
{
- Lisp_Object prop, val, frame;
+ Lisp_Object prop, val;
prop = parms[i];
val = values[i];
if (EQ (prop, Qforeground_color))
{
- unsigned long new_color = load_color (f, NULL, val, need_to_reverse
+ unsigned long new_color = load_color (f, NULL, val, reverse
? LFACE_BACKGROUND_INDEX
: LFACE_FOREGROUND_INDEX);
if (new_color != FACE_TTY_DEFAULT_COLOR
&& new_color != FACE_TTY_DEFAULT_FG_COLOR
&& new_color != FACE_TTY_DEFAULT_BG_COLOR)
{
- FRAME_FOREGROUND_PIXEL (f) = new_color;
- /* Make sure the foreground of the default face for this
- frame is changed as well. */
- XSETFRAME (frame, f);
- Finternal_set_lisp_face_attribute (Qdefault, QCforeground,
- val, frame);
- fg_set = 1;
+ if (!reverse)
+ {
+ FRAME_FOREGROUND_PIXEL (f) = new_color;
+ /* Make sure the foreground of the default face for
+ this frame is changed as well. */
+ update_face_from_frame_parameter (f, Qforeground_color, val);
+ fg_set = 1;
+ if (tty->termscript)
+ fprintf (tty->termscript, "<FGCOLOR %lu>\n", new_color);
+ }
+ else
+ {
+ FRAME_BACKGROUND_PIXEL (f) = new_color;
+ update_face_from_frame_parameter (f, Qbackground_color, val);
+ bg_set = 1;
+ if (tty->termscript)
+ fprintf (tty->termscript, "<BGCOLOR %lu>\n", new_color);
+ }
redraw = 1;
- if (tty->termscript)
- fprintf (tty->termscript, "<FGCOLOR %lu>\n", new_color);
}
}
else if (EQ (prop, Qbackground_color))
{
- unsigned long new_color = load_color (f, NULL, val, need_to_reverse
+ unsigned long new_color = load_color (f, NULL, val, reverse
? LFACE_FOREGROUND_INDEX
: LFACE_BACKGROUND_INDEX);
if (new_color != FACE_TTY_DEFAULT_COLOR
&& new_color != FACE_TTY_DEFAULT_FG_COLOR
&& new_color != FACE_TTY_DEFAULT_BG_COLOR)
{
- FRAME_BACKGROUND_PIXEL (f) = new_color;
- /* Make sure the background of the default face for this
- frame is changed as well. */
- XSETFRAME (frame, f);
- Finternal_set_lisp_face_attribute (Qdefault, QCbackground,
- val, frame);
- bg_set = 1;
+ if (!reverse)
+ {
+ FRAME_BACKGROUND_PIXEL (f) = new_color;
+ /* Make sure the background of the default face for
+ this frame is changed as well. */
+ bg_set = 1;
+ update_face_from_frame_parameter (f, Qbackground_color, val);
+ if (tty->termscript)
+ fprintf (tty->termscript, "<BGCOLOR %lu>\n", new_color);
+ }
+ else
+ {
+ FRAME_FOREGROUND_PIXEL (f) = new_color;
+ fg_set = 1;
+ update_face_from_frame_parameter (f, Qforeground_color, val);
+ if (tty->termscript)
+ fprintf (tty->termscript, "<FGCOLOR %lu>\n", new_color);
+ }
redraw = 1;
- if (tty->termscript)
- fprintf (tty->termscript, "<BGCOLOR %lu>\n", new_color);
}
}
else if (EQ (prop, Qtitle))
@@ -2228,24 +2213,22 @@ IT_set_frame_parameters (f, alist)
/* If they specified "reverse", but not the colors, we need to swap
the current frame colors. */
- if (need_to_reverse)
+ if (reverse)
{
Lisp_Object frame;
if (!fg_set)
{
- XSETFRAME (frame, f);
- Finternal_set_lisp_face_attribute (Qdefault, QCforeground,
- tty_color_name (f, orig_bg),
- frame);
+ FRAME_FOREGROUND_PIXEL (f) = orig_bg;
+ update_face_from_frame_parameter (f, Qforeground_color,
+ tty_color_name (f, orig_bg));
redraw = 1;
}
if (!bg_set)
{
- XSETFRAME (frame, f);
- Finternal_set_lisp_face_attribute (Qdefault, QCbackground,
- tty_color_name (f, orig_fg),
- frame);
+ FRAME_BACKGROUND_PIXEL (f) = orig_fg;
+ update_face_from_frame_parameter (f, Qbackground_color,
+ tty_color_name (f, orig_fg));
redraw = 1;
}
}
@@ -2266,7 +2249,7 @@ extern void init_frame_faces (FRAME_PTR);
/* Do we need the internal terminal? */
void
-internal_terminal_init ()
+internal_terminal_init (void)
{
static int init_needed = 1;
char *term = getenv ("TERM"), *colors;
@@ -2402,10 +2385,8 @@ initialize_msdos_display (struct terminal *term)
term->read_socket_hook = &tty_read_avail_input; /* from keyboard.c */
}
-dos_get_saved_screen (screen, rows, cols)
- char **screen;
- int *rows;
- int *cols;
+int
+dos_get_saved_screen (char **screen, int *rows, int *cols)
{
#ifndef HAVE_X_WINDOWS
*screen = startup_screen_buffer;
@@ -2564,9 +2545,7 @@ static int keyboard_map_all;
static int international_keyboard;
int
-dos_set_keyboard (code, always)
- int code;
- int always;
+dos_set_keyboard (int code, int always)
{
int i;
_go32_dpmi_registers regs;
@@ -2833,8 +2812,7 @@ ibmpc_translate_map[] =
#define HYPER_P 0x8000 /* pseudo */
static int
-dos_get_modifiers (keymask)
- int *keymask;
+dos_get_modifiers (int *keymask)
{
union REGS regs;
int mask, modifiers = 0;
@@ -2916,13 +2894,13 @@ dos_get_modifiers (keymask)
#define NUM_RECENT_DOSKEYS (100)
int recent_doskeys_index; /* Index for storing next element into recent_doskeys */
int total_doskeys; /* Total number of elements stored into recent_doskeys */
-Lisp_Object recent_doskeys; /* A vector, holding the last 100 keystrokes */
+Lisp_Object recent_doskeys; /* A vector, holding the last 100 keystrokes */
DEFUN ("recent-doskeys", Frecent_doskeys, Srecent_doskeys, 0, 0, 0,
doc: /* Return vector of last 100 keyboard input values seen in dos_rawgetc.
Each input key receives two values in this vector: first the ASCII code,
and then the scan code. */)
- ()
+ (void)
{
Lisp_Object val, *keys = XVECTOR (recent_doskeys)->contents;
@@ -2931,19 +2909,17 @@ and then the scan code. */)
else
{
val = Fvector (NUM_RECENT_DOSKEYS, keys);
- bcopy (keys + recent_doskeys_index,
- XVECTOR (val)->contents,
- (NUM_RECENT_DOSKEYS - recent_doskeys_index) * sizeof (Lisp_Object));
- bcopy (keys,
- XVECTOR (val)->contents + NUM_RECENT_DOSKEYS - recent_doskeys_index,
- recent_doskeys_index * sizeof (Lisp_Object));
+ memcpy (XVECTOR (val)->contents, keys + recent_doskeys_index,
+ (NUM_RECENT_DOSKEYS - recent_doskeys_index) * sizeof (Lisp_Object));
+ memcpy (XVECTOR (val)->contents + NUM_RECENT_DOSKEYS - recent_doskeys_index,
+ keys, recent_doskeys_index * sizeof (Lisp_Object));
return val;
}
}
/* Get a char from keyboard. Function keys are put into the event queue. */
static int
-dos_rawgetc ()
+dos_rawgetc (void)
{
struct input_event event;
union REGS regs;
@@ -3294,8 +3270,8 @@ dos_rawgetc ()
static int prev_get_char = -1;
/* Return 1 if a key is ready to be read without suspending execution. */
-
-dos_keysns ()
+int
+dos_keysns (void)
{
if (prev_get_char != -1)
return 1;
@@ -3304,8 +3280,8 @@ dos_keysns ()
}
/* Read a key. Return -1 if no key is ready. */
-
-dos_keyread ()
+int
+dos_keyread (void)
{
if (prev_get_char != -1)
{
@@ -3334,7 +3310,7 @@ static char *menu_help_message, *prev_menu_help_message;
static int menu_help_paneno, menu_help_itemno;
static XMenu *
-IT_menu_create ()
+IT_menu_create (void)
{
XMenu *menu;
@@ -3503,7 +3479,7 @@ IT_menu_display (XMenu *menu, int y, int x, int pn, int *faces, int disp_help)
/* Report availability of menus. */
int
-have_menus_p () { return 1; }
+have_menus_p (void) { return 1; }
/* Create a brand new menu structure. */
@@ -3861,8 +3837,7 @@ void msdos_downcase_filename (unsigned char *);
/* Destructively turn backslashes into slashes. */
void
-dostounix_filename (p)
- register char *p;
+dostounix_filename (char *p)
{
msdos_downcase_filename (p);
@@ -3877,8 +3852,7 @@ dostounix_filename (p)
/* Destructively turn slashes into backslashes. */
void
-unixtodos_filename (p)
- register char *p;
+unixtodos_filename (char *p)
{
if (p[1] == ':' && *p >= 'A' && *p <= 'Z')
{
@@ -3897,9 +3871,7 @@ unixtodos_filename (p)
/* Get the default directory for a given drive. 0=def, 1=A, 2=B, ... */
int
-getdefdir (drive, dst)
- int drive;
- char *dst;
+getdefdir (int drive, char *dst)
{
char in_path[4], *p = in_path, e = errno;
@@ -3938,9 +3910,7 @@ emacs_root_dir (void)
/* Remove all CR's that are followed by a LF. */
int
-crlf_to_lf (n, buf)
- register int n;
- register unsigned char *buf;
+crlf_to_lf (int n, unsigned char *buf)
{
unsigned char *np = buf, *startp = buf, *endp = buf + n;
@@ -3964,7 +3934,7 @@ crlf_to_lf (n, buf)
DEFUN ("msdos-long-file-names", Fmsdos_long_file_names, Smsdos_long_file_names,
0, 0, 0,
doc: /* Return non-nil if long file names are supported on MS-DOS. */)
- ()
+ (void)
{
return (_USE_LFN ? Qt : Qnil);
}
@@ -3972,8 +3942,7 @@ DEFUN ("msdos-long-file-names", Fmsdos_long_file_names, Smsdos_long_file_names,
/* Convert alphabetic characters in a filename to lower-case. */
void
-msdos_downcase_filename (p)
- register unsigned char *p;
+msdos_downcase_filename (unsigned char *p)
{
/* Always lower-case drive letters a-z, even if the filesystem
preserves case in filenames.
@@ -3999,8 +3968,7 @@ DEFUN ("msdos-downcase-filename", Fmsdos_downcase_filename, Smsdos_downcase_file
When long filenames are supported, doesn't change FILENAME.
If FILENAME is not a string, returns nil.
The argument object is never altered--the value is a copy. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
Lisp_Object tem;
@@ -4017,8 +3985,7 @@ The argument object is never altered--the value is a copy. */)
static char emacsroot[MAXPATHLEN];
char *
-rootrelativepath (rel)
- char *rel;
+rootrelativepath (char *rel)
{
static char result[MAXPATHLEN + 10];
@@ -4033,10 +4000,7 @@ rootrelativepath (rel)
break if one or more of these are missing. */
void
-init_environment (argc, argv, skip_args)
- int argc;
- char **argv;
- int skip_args;
+init_environment (int argc, char **argv, int skip_args)
{
char *s, *t, *root;
int len, i;
@@ -4270,7 +4234,7 @@ dos_ttraw (struct tty_display_info *tty)
/* Restore status of standard input and Ctrl-C checking. */
int
-dos_ttcooked ()
+dos_ttcooked (void)
{
union REGS inregs, outregs;
@@ -4296,11 +4260,8 @@ dos_ttcooked ()
file TEMPOUT and stderr to TEMPERR. */
int
-run_msdos_command (argv, working_dir, tempin, tempout, temperr, envv)
- unsigned char **argv;
- const char *working_dir;
- int tempin, tempout, temperr;
- char **envv;
+run_msdos_command (unsigned char **argv, const char *working_dir,
+ int tempin, int tempout, int temperr, char **envv)
{
char *saveargv1, *saveargv2, *lowcase_argv0, *pa, *pl;
char oldwd[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */
@@ -4441,8 +4402,7 @@ run_msdos_command (argv, working_dir, tempin, tempout, temperr, envv)
}
void
-croak (badfunc)
- char *badfunc;
+croak (char *badfunc)
{
fprintf (stderr, "%s not yet implemented\r\n", badfunc);
reset_all_sys_modes ();
@@ -4452,8 +4412,8 @@ croak (badfunc)
/*
* A few unimplemented functions that we silently ignore.
*/
-setpgrp () {return 0; }
-setpriority (x,y,z) int x,y,z; { return 0; }
+int setpgrp (void) {return 0; }
+int setpriority (int x, int y, int z) { return 0; }
#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2
@@ -4478,17 +4438,13 @@ static sighandler_t prev_handlers[320];
/* A signal handler which just records that a signal occurred
(it will be raised later, if and when the signal is unblocked). */
static void
-sig_suspender (signo)
- int signo;
+sig_suspender (int signo)
{
sigaddset (&msdos_pending_signals, signo);
}
int
-sigprocmask (how, new_set, old_set)
- int how;
- const sigset_t *new_set;
- sigset_t *old_set;
+sigprocmask (int how, const sigset_t *new_set, sigset_t *old_set)
{
int signo;
sigset_t new_mask;
@@ -4590,10 +4546,8 @@ dos_yield_time_slice (void)
/* We don't have to call timer_check here
because wait_reading_process_output takes care of that. */
int
-sys_select (nfds, rfds, wfds, efds, timeout)
- int nfds;
- SELECT_TYPE *rfds, *wfds, *efds;
- EMACS_TIME *timeout;
+sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
+ EMACS_TIME *timeout)
{
int check_input;
struct time t;
@@ -4663,11 +4617,10 @@ sys_select (nfds, rfds, wfds, efds, timeout)
#ifdef chdir
#undef chdir
-extern int chdir ();
+extern int chdir (const char *);
int
-sys_chdir (path)
- const char* path;
+sys_chdir (const char *path)
{
int len = strlen (path);
char *tmp = (char *)path;
@@ -4696,7 +4649,7 @@ sys_chdir (path)
extern void tzset (void);
void
-init_gettimeofday ()
+init_gettimeofday (void)
{
time_t ltm, gtm;
struct tm *lstm;
@@ -4714,9 +4667,7 @@ init_gettimeofday ()
#ifdef abort
#undef abort
void
-dos_abort (file, line)
- char *file;
- int line;
+dos_abort (char *file, int line)
{
char buffer1[200], buffer2[400];
int i, j;
@@ -4732,7 +4683,7 @@ dos_abort (file, line)
}
#else
void
-abort ()
+abort (void)
{
dos_ttcooked ();
ScreenSetCursor (10, 0);
@@ -4750,14 +4701,8 @@ abort ()
}
#endif
-/* The following variables are required so that cus-start.el won't
- complain about unbound variables. */
-#ifndef subprocesses
-/* Nonzero means delete a process right away if it exits (process.c). */
-static int delete_exited_processes;
-#endif
-
-syms_of_msdos ()
+void
+syms_of_msdos (void)
{
recent_doskeys = Fmake_vector (make_number (NUM_RECENT_DOSKEYS), Qnil);
staticpro (&recent_doskeys);
@@ -4774,12 +4719,6 @@ This variable is used only by MS-DOS terminals. */);
Vdos_unsupported_char_glyph = make_number ('\177');
#endif
-#ifndef subprocesses
- DEFVAR_BOOL ("delete-exited-processes", &delete_exited_processes,
- doc: /* *Non-nil means delete processes immediately when they exit.
-A value of nil means don't delete them until `list-processes' is run. */);
- delete_exited_processes = 0;
-#endif
defsubr (&Srecent_doskeys);
defsubr (&Smsdos_long_file_names);
diff --git a/src/msdos.h b/src/msdos.h
index bf44d3a9aa4..fe9964af25e 100644
--- a/src/msdos.h
+++ b/src/msdos.h
@@ -23,7 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <dpmi.h>
int dos_ttraw (struct tty_display_info *);
-int dos_ttcooked ();
+int dos_ttcooked (void);
int dos_get_saved_screen (char **, int *, int *);
int dos_set_keyboard (int, int);
void dos_set_window_size (int *, int *);
@@ -32,15 +32,13 @@ int getdefdir (int, char*);
void unixtodos_filename (char *);
void dostounix_filename (char *);
char *rootrelativepath (char *);
-void init_environment ();
-void internal_terminal_init ();
-void ctrl_break_func (_go32_dpmi_registers *);
-void install_ctrl_break_check ();
+void init_environment (int, char **, int);
+void internal_terminal_init (void);
extern int have_mouse;
-void mouse_init ();
-void mouse_on ();
-void mouse_off ();
+void mouse_init (void);
+void mouse_on (void);
+void mouse_off (void);
void mouse_moveto (int, int);
#ifndef HAVE_X_WINDOWS
@@ -70,13 +68,12 @@ struct window;
/* Defined in xfns.c; emulated on msdos.c */
-extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern int x_pixel_width P_ ((struct frame *));
-extern int x_pixel_height P_ ((struct frame *));
+extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
+extern int x_pixel_width (struct frame *);
+extern int x_pixel_height (struct frame *);
#define XFreeGC (void)
#define x_destroy_bitmap(p1,p2)
-#define load_pixmap(p1,p2,p3,p4) (0)
#define XGetGeometry(p1,p2,p3,p4,p5,p6,p7,p8,p9)
#define DisplayWidth(p1,p2) (SELECTED_FRAME()->text_cols)
#define DisplayHeight(p1,p2) (SELECTED_FRAME()->text_lines)
diff --git a/src/nsfns.m b/src/nsfns.m
index 53264a5f595..fd0ec1a965c 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -83,6 +83,10 @@ extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate, Qtitle;
extern Lisp_Object Qnone;
extern Lisp_Object Vframe_title_format;
+/* The below are defined in frame.c. */
+
+extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
+
Lisp_Object Qbuffered;
Lisp_Object Qfontsize;
@@ -224,7 +228,8 @@ ns_get_screen (Lisp_Object screen)
else
{
struct ns_display_info *dpyinfo = terminal->display_info.ns;
- f = (dpyinfo->x_focus_frame || dpyinfo->x_highlight_frame);
+ f = dpyinfo->x_focus_frame
+ ? dpyinfo->x_focus_frame : dpyinfo->x_highlight_frame;
}
return ((f && FRAME_NS_P (f)) ? [[FRAME_NS_VIEW (f) window] screen]
@@ -1058,8 +1063,7 @@ If the parameters specify that the frame should not have a minibuffer,
and do not specify a specific minibuffer window to use,
then `default-minibuffer-frame' must be a frame whose minibuffer can
be shared by the new frame. */)
- (parms)
- Lisp_Object parms;
+ (Lisp_Object parms)
{
static int desc_ctr = 1;
struct frame *f;
@@ -1154,7 +1158,7 @@ be shared by the new frame. */)
f->output_method = output_ns;
f->output_data.ns = (struct ns_output *)xmalloc (sizeof *(f->output_data.ns));
- bzero (f->output_data.ns, sizeof (*(f->output_data.ns)));
+ memset (f->output_data.ns, 0, sizeof (*(f->output_data.ns)));
FRAME_FONTSET (f) = -1;
@@ -1234,10 +1238,18 @@ be shared by the new frame. */)
init_frame_faces (f);
- x_default_parameter (f, parms, Qmenu_bar_lines, make_number (0), "menuBar",
- "menuBar", RES_TYPE_NUMBER);
- x_default_parameter (f, parms, Qtool_bar_lines, make_number (0), "toolBar",
- "toolBar", RES_TYPE_NUMBER);
+ /* The X resources controlling the menu-bar and tool-bar are
+ processed specially at startup, and reflected in the mode
+ variables; ignore them here. */
+ x_default_parameter (f, parms, Qmenu_bar_lines,
+ NILP (Vmenu_bar_mode)
+ ? make_number (0) : make_number (1),
+ NULL, NULL, RES_TYPE_NUMBER);
+ x_default_parameter (f, parms, Qtool_bar_lines,
+ NILP (Vtool_bar_mode)
+ ? make_number (0) : make_number (1),
+ NULL, NULL, RES_TYPE_NUMBER);
+
x_default_parameter (f, parms, Qbuffer_predicate, Qnil, "bufferPredicate",
"BufferPredicate", RES_TYPE_SYMBOL);
x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title",
@@ -1360,8 +1372,7 @@ be shared by the new frame. */)
DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
doc: /* Set the input focus to FRAME.
FRAME nil means use the selected frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct frame *f = check_ns_frame (frame);
struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f);
@@ -1382,8 +1393,7 @@ FRAME nil means use the selected frame. */)
DEFUN ("ns-popup-font-panel", Fns_popup_font_panel, Sns_popup_font_panel,
0, 1, "",
doc: /* Pop up the font panel. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
id fm;
struct frame *f;
@@ -1408,8 +1418,7 @@ DEFUN ("ns-popup-font-panel", Fns_popup_font_panel, Sns_popup_font_panel,
DEFUN ("ns-popup-color-panel", Fns_popup_color_panel, Sns_popup_color_panel,
0, 1, "",
doc: /* Pop up the color panel. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct frame *f;
@@ -1432,8 +1441,7 @@ DEFUN ("ns-read-file-name", Fns_read_file_name, Sns_read_file_name, 1, 4, 0,
Optional arg DIR, if non-nil, supplies a default directory.
Optional arg ISLOAD, if non-nil, means read a file name for saving.
Optional arg INIT, if non-nil, provides a default file name to use. */)
- (prompt, dir, isLoad, init)
- Lisp_Object prompt, dir, isLoad, init;
+ (Lisp_Object prompt, Lisp_Object dir, Lisp_Object isLoad, Lisp_Object init)
{
static id fileDelegate = nil;
int ret;
@@ -1497,8 +1505,7 @@ Optional arg INIT, if non-nil, provides a default file name to use. */)
DEFUN ("ns-get-resource", Fns_get_resource, Sns_get_resource, 2, 2, 0,
doc: /* Return the value of the property NAME of OWNER from the defaults database.
If OWNER is nil, Emacs is assumed. */)
- (owner, name)
- Lisp_Object owner, name;
+ (Lisp_Object owner, Lisp_Object name)
{
const char *value;
@@ -1522,8 +1529,7 @@ DEFUN ("ns-set-resource", Fns_set_resource, Sns_set_resource, 3, 3, 0,
doc: /* Set property NAME of OWNER to VALUE, from the defaults database.
If OWNER is nil, Emacs is assumed.
If VALUE is nil, the default is removed. */)
- (owner, name, value)
- Lisp_Object owner, name, value;
+ (Lisp_Object owner, Lisp_Object name, Lisp_Object value)
{
check_ns ();
if (NILP (owner))
@@ -1551,8 +1557,7 @@ DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
Sx_server_max_request_size,
0, 1, 0,
doc: /* This function is a no-op. It is only present for completeness. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
check_ns ();
/* This function has no real equivalent under NeXTstep. Return nil to
@@ -1565,8 +1570,7 @@ DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
doc: /* Return the vendor ID string of Nextstep display server DISPLAY.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, the selected frame's display is used. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
#ifdef NS_IMPL_GNUSTEP
return build_string ("GNU");
@@ -1585,8 +1589,7 @@ release number. See also the function `x-server-vendor'.
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
/*NOTE: it is unclear what would best correspond with "protocol";
we return 10.3, meaning Panther, since this is roughly the
@@ -1604,8 +1607,7 @@ DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
doc: /* Return the number of screens on Nextstep display server DISPLAY.
DISPLAY should be a frame, the display name as a string, or a terminal ID.
If omitted or nil, the selected frame's display is used. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
int num;
@@ -1621,8 +1623,7 @@ DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height,
doc: /* Return the height of Nextstep display server DISPLAY, in millimeters.
DISPLAY should be a frame, the display name as a string, or a terminal ID.
If omitted or nil, the selected frame's display is used. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
check_ns ();
return make_number ((int)
@@ -1635,8 +1636,7 @@ DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width,
doc: /* Return the width of Nextstep display server DISPLAY, in millimeters.
DISPLAY should be a frame, the display name as a string, or a terminal ID.
If omitted or nil, the selected frame's display is used. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
check_ns ();
return make_number ((int)
@@ -1650,8 +1650,7 @@ DEFUN ("x-display-backing-store", Fx_display_backing_store,
The value may be `buffered', `retained', or `non-retained'.
DISPLAY should be a frame, the display name as a string, or a terminal ID.
If omitted or nil, the selected frame's display is used. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
check_ns ();
switch ([ns_get_window (display) backingType])
@@ -1676,8 +1675,7 @@ The value is one of the symbols `static-gray', `gray-scale',
`static-color', `pseudo-color', `true-color', or `direct-color'.
DISPLAY should be a frame, the display name as a string, or a terminal ID.
If omitted or nil, the selected frame's display is used. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
NSWindowDepth depth;
check_ns ();
@@ -1705,8 +1703,7 @@ DEFUN ("x-display-save-under", Fx_display_save_under,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be a frame, the display name as a string, or a terminal ID.
If omitted or nil, the selected frame's display is used. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
check_ns ();
switch ([ns_get_window (display) backingType])
@@ -1730,8 +1727,7 @@ DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection,
doc: /* Open a connection to a Nextstep display server.
DISPLAY is the name of the display to connect to.
Optional arguments XRM-STRING and MUST-SUCCEED are currently ignored. */)
- (display, resource_string, must_succeed)
- Lisp_Object display, resource_string, must_succeed;
+ (Lisp_Object display, Lisp_Object resource_string, Lisp_Object must_succeed)
{
struct ns_display_info *dpyinfo;
@@ -1769,8 +1765,7 @@ DEFUN ("x-close-connection", Fx_close_connection, Sx_close_connection,
1, 1, 0,
doc: /* Close the connection to the current Nextstep display server.
The argument DISPLAY is currently ignored. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
check_ns ();
/*ns_delete_terminal (dpyinfo->terminal); */
@@ -1781,7 +1776,7 @@ The argument DISPLAY is currently ignored. */)
DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
doc: /* Return the list of display names that Emacs has connections to. */)
- ()
+ (void)
{
Lisp_Object tail, result;
@@ -1796,7 +1791,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
DEFUN ("ns-hide-others", Fns_hide_others, Sns_hide_others,
0, 0, 0,
doc: /* Hides all applications other than Emacs. */)
- ()
+ (void)
{
check_ns ();
[NSApp hideOtherApplications: NSApp];
@@ -1809,8 +1804,7 @@ DEFUN ("ns-hide-emacs", Fns_hide_emacs, Sns_hide_emacs,
Otherwise if Emacs is hidden, it is unhidden.
If ON is equal to `activate', Emacs is unhidden and becomes
the active application. */)
- (on)
- Lisp_Object on;
+ (Lisp_Object on)
{
check_ns ();
if (EQ (on, intern ("activate")))
@@ -1829,7 +1823,7 @@ the active application. */)
DEFUN ("ns-emacs-info-panel", Fns_emacs_info_panel, Sns_emacs_info_panel,
0, 0, 0,
doc: /* Shows the 'Info' or 'About' panel for Emacs. */)
- ()
+ (void)
{
check_ns ();
[NSApp orderFrontStandardAboutPanel: nil];
@@ -1842,8 +1836,7 @@ DEFUN ("ns-font-name", Fns_font_name, Sns_font_name, 1, 1, 0,
NAME should be a string containing either the font name or an XLFD
font descriptor. If string contains `fontset' and not
`fontset-startup', it is left alone. */)
- (name)
- Lisp_Object name;
+ (Lisp_Object name)
{
char *nm;
CHECK_STRING (name);
@@ -1861,8 +1854,7 @@ font descriptor. If string contains `fontset' and not
DEFUN ("ns-list-colors", Fns_list_colors, Sns_list_colors, 0, 1, 0,
doc: /* Return a list of all available colors.
The optional argument FRAME is currently ignored. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
Lisp_Object list = Qnil;
NSEnumerator *colorlists;
@@ -1901,7 +1893,7 @@ The optional argument FRAME is currently ignored. */)
DEFUN ("ns-list-services", Fns_list_services, Sns_list_services, 0, 0, 0,
doc: /* List available Nextstep services by querying NSApp. */)
- ()
+ (void)
{
Lisp_Object ret = Qnil;
NSMenu *svcs;
@@ -1955,8 +1947,7 @@ DEFUN ("ns-perform-service", Fns_perform_service, Sns_perform_service,
SEND should be either a string or nil.
The return value is the result of the service, as string, or nil if
there was no result. */)
- (service, send)
- Lisp_Object service, send;
+ (Lisp_Object service, Lisp_Object send)
{
id pb;
NSString *svcName;
@@ -1984,8 +1975,7 @@ there was no result. */)
DEFUN ("ns-convert-utf8-nfd-to-nfc", Fns_convert_utf8_nfd_to_nfc,
Sns_convert_utf8_nfd_to_nfc, 1, 1, 0,
doc: /* Return an NFC string that matches the UTF-8 NFD string STR. */)
- (str)
- Lisp_Object str;
+ (Lisp_Object str)
{
/* TODO: If GNUstep ever implements precomposedStringWithCanonicalMapping,
remove this. */
@@ -2072,8 +2062,7 @@ DEFUN ("ns-do-applescript", Fns_do_applescript, Sns_do_applescript, 1, 1, 0,
If compilation and execution are successful, the resulting script value
is returned as a string, a number or, in the case of other constructs, t.
In case the execution fails, an error is signaled. */)
- (script)
- Lisp_Object script;
+ (Lisp_Object script)
{
Lisp_Object result;
long status;
@@ -2218,8 +2207,7 @@ x_sync (Lisp_Object frame)
DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
doc: /* Return t if the current Nextstep display supports the color COLOR.
The optional argument FRAME is currently ignored. */)
- (color, frame)
- Lisp_Object color, frame;
+ (Lisp_Object color, Lisp_Object frame)
{
NSColor * col;
check_ns ();
@@ -2229,8 +2217,7 @@ The optional argument FRAME is currently ignored. */)
DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
doc: /* Internal function called by `color-values', which see. */)
- (color, frame)
- Lisp_Object color, frame;
+ (Lisp_Object color, Lisp_Object frame)
{
NSColor * col;
CGFloat red, green, blue, alpha;
@@ -2254,8 +2241,7 @@ DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame, a display name (a string), or terminal ID.
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
NSWindowDepth depth;
NSString *colorSpace;
@@ -2276,8 +2262,7 @@ Note that color displays do support shades of gray.
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame, a display name (a string), or terminal ID.
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
NSWindowDepth depth;
check_ns ();
@@ -2293,8 +2278,7 @@ DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame, a display name (a string), or terminal ID.
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
check_ns ();
return make_number ((int) [ns_get_screen (display) frame].size.width);
@@ -2307,8 +2291,7 @@ DEFUN ("x-display-pixel-height", Fx_display_pixel_height,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame, a display name (a string), or terminal ID.
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
check_ns ();
return make_number ((int) [ns_get_screen (display) frame].size.height);
@@ -2325,8 +2308,7 @@ reserved for the Mac menu, dock, and so forth.
The screen queried corresponds to DISPLAY, which should be either a
frame, a display name (a string), or terminal ID. If omitted or nil,
that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
int top;
NSScreen *screen;
@@ -2355,8 +2337,7 @@ DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame, a display name (a string), or terminal ID.
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
check_ns ();
return make_number
@@ -2370,12 +2351,12 @@ DEFUN ("x-display-color-cells", Fx_display_color_cells,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame, a display name (a string), or terminal ID.
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
+ struct ns_display_info *dpyinfo;
check_ns ();
- struct ns_display_info *dpyinfo = check_ns_display_info (display);
-
+
+ dpyinfo = check_ns_display_info (display);
/* We force 24+ bit depths to 24-bit to prevent an overflow. */
return make_number (1 << min (dpyinfo->n_planes, 24));
}
@@ -2398,22 +2379,27 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y)
/* Start with user-specified or mouse position. */
left = Fcdr (Fassq (Qleft, parms));
- if (INTEGERP (left))
- pt.x = XINT (left);
- else
- pt.x = last_mouse_motion_position.x;
top = Fcdr (Fassq (Qtop, parms));
- if (INTEGERP (top))
- pt.y = XINT (top);
- else
- pt.y = last_mouse_motion_position.y;
-
- /* Convert to screen coordinates */
- pt = [view convertPoint: pt toView: nil];
- pt = [[view window] convertBaseToScreen: pt];
+ if (!INTEGERP (left) || !INTEGERP (top))
+ {
+ pt = last_mouse_motion_position;
+ /* Convert to screen coordinates */
+ pt = [view convertPoint: pt toView: nil];
+ pt = [[view window] convertBaseToScreen: pt];
+ }
+ else
+ {
+ /* Absolute coordinates. */
+ pt.x = XINT (left);
+ pt.y = x_display_pixel_height (FRAME_NS_DISPLAY_INFO (f)) - XINT (top)
+ - height;
+ }
+
/* Ensure in bounds. (Note, screen origin = lower left.) */
- if (pt.x + XINT (dx) <= 0)
+ if (INTEGERP (left))
+ *root_x = pt.x;
+ else if (pt.x + XINT (dx) <= 0)
*root_x = 0; /* Can happen for negative dx */
else if (pt.x + XINT (dx) + width
<= x_display_pixel_width (FRAME_NS_DISPLAY_INFO (f)))
@@ -2426,7 +2412,9 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y)
/* Put it left justified on the screen -- it ought to fit that way. */
*root_x = 0;
- if (pt.y - XINT (dy) - height >= 0)
+ if (INTEGERP (top))
+ *root_y = pt.y;
+ else if (pt.y - XINT (dy) - height >= 0)
/* It fits below the pointer. */
*root_y = pt.y - height - XINT (dy);
else if (pt.y + XINT (dy) + height
@@ -2461,8 +2449,7 @@ DY added (default is -10).
A tooltip's maximum size is specified by `x-max-tooltip-size'.
Text larger than the specified size is clipped. */)
- (string, frame, parms, timeout, dx, dy)
- Lisp_Object string, frame, parms, timeout, dx, dy;
+ (Lisp_Object string, Lisp_Object frame, Lisp_Object parms, Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy)
{
int root_x, root_y;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
@@ -2518,7 +2505,7 @@ Text larger than the specified size is clipped. */)
DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0,
doc: /* Hide the current tooltip window, if there is any.
Value is t if tooltip was open, nil otherwise. */)
- ()
+ (void)
{
if (ns_tooltip == nil || ![ns_tooltip isActive])
return Qnil;
diff --git a/src/nsfont.m b/src/nsfont.m
index db2399a7fa0..3cc1f7fb076 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -776,8 +776,8 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
xmalloc (0x100 * sizeof (struct font_metrics *));
if (!font_info->glyphs || !font_info->metrics)
return Qnil;
- bzero (font_info->glyphs, 0x100 * sizeof (unsigned short *));
- bzero (font_info->metrics, 0x100 * sizeof (struct font_metrics *));
+ memset (font_info->glyphs, 0, 0x100 * sizeof (unsigned short *));
+ memset (font_info->metrics, 0, 0x100 * sizeof (struct font_metrics *));
BLOCK_INPUT;
@@ -816,8 +816,8 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
[font_info->nsfont retain];
/* set up ns_font (defined in nsgui.h) */
- font_info->name = (char *)xmalloc (strlen (fontName) + 1);
- bcopy (fontName, font_info->name, strlen (fontName) + 1);
+ font_info->name = (char *)xmalloc (strlen (fontName)+1);
+ strcpy (font_info->name, fontName);
font_info->bold = [fontMgr traitsOfFont: nsfont] & NSBoldFontMask;
font_info->ital =
synthItal || ([fontMgr traitsOfFont: nsfont] & NSItalicFontMask);
@@ -972,7 +972,7 @@ nsfont_text_extents (struct font *font, unsigned int *code, int nglyphs,
int totalWidth = 0;
int i;
- bzero (metrics, sizeof (struct font_metrics));
+ memset (metrics, 0, sizeof (struct font_metrics));
for (i =0; i<nglyphs; i++)
{
@@ -1395,7 +1395,7 @@ ns_glyph_metrics (struct nsfont_info *font_info, unsigned char block)
sfont = [font_info->nsfont screenFont];
font_info->metrics[block] = xmalloc (0x100 * sizeof (struct font_metrics));
- bzero (font_info->metrics[block], 0x100 * sizeof (struct font_metrics));
+ memset (font_info->metrics[block], 0, 0x100 * sizeof (struct font_metrics));
if (!(font_info->metrics[block]))
abort ();
diff --git a/src/nsimage.m b/src/nsimage.m
index 3e6a8c77ed7..6912156eb99 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -315,9 +315,9 @@ static EmacsImage *ImageList = nil;
[self addRepresentation: bmRep];
- bzero (planes[0], w*h);
- bzero (planes[1], w*h);
- bzero (planes[2], w*h);
+ memset (planes[0], 0, w*h);
+ memset (planes[1], 0, w*h);
+ memset (planes[2], 0, w*h);
[self setXBMColor: [NSColor blackColor]];
return self;
}
@@ -379,7 +379,7 @@ static EmacsImage *ImageList = nil;
[bmRep getBitmapDataPlanes: pixmapData];
for (i =0; i<4; i++)
- bzero (pixmapData[i], width*height);
+ memset (pixmapData[i], 0, width*height);
[self addRepresentation: bmRep];
return self;
}
diff --git a/src/nsmenu.m b/src/nsmenu.m
index f85ebc165af..e5b9379258f 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -219,8 +219,8 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu)
/* Save the frame's previous menu bar contents data */
if (previous_menu_items_used)
- bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items,
- previous_menu_items_used * sizeof (Lisp_Object));
+ memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents,
+ previous_menu_items_used * sizeof (Lisp_Object));
/* parse stage 1: extract from lisp */
save_menu_items ();
@@ -999,7 +999,10 @@ free_frame_tool_bar (FRAME_PTR f)
Under NS we just hide the toolbar until it might be needed again.
-------------------------------------------------------------------------- */
{
+ BLOCK_INPUT;
[[FRAME_NS_VIEW (f) toolbar] setVisible: NO];
+ FRAME_TOOLBAR_HEIGHT (f) = 0;
+ UNBLOCK_INPUT;
}
void
@@ -1009,8 +1012,11 @@ update_frame_tool_bar (FRAME_PTR f)
-------------------------------------------------------------------------- */
{
int i;
- EmacsToolbar *toolbar = [FRAME_NS_VIEW (f) toolbar];
+ EmacsView *view = FRAME_NS_VIEW (f);
+ NSWindow *window = [view window];
+ EmacsToolbar *toolbar = [view toolbar];
+ BLOCK_INPUT;
[toolbar clearActive];
/* update EmacsToolbar as in GtkUtils, build items list */
@@ -1094,6 +1100,10 @@ update_frame_tool_bar (FRAME_PTR f)
[newDict release];
}
+ FRAME_TOOLBAR_HEIGHT (f) =
+ NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)])
+ - FRAME_NS_TITLEBAR_HEIGHT (f);
+ UNBLOCK_INPUT;
}
@@ -1742,7 +1752,7 @@ void process_dialog (id window, Lisp_Object list)
DEFUN ("ns-reset-menu", Fns_reset_menu, Sns_reset_menu, 0, 0, 0,
doc: /* Cause the NS menu to be re-calculated. */)
- ()
+ (void)
{
set_frame_menubar (SELECTED_FRAME (), 1, 0);
return Qnil;
@@ -1772,15 +1782,14 @@ otherwise it is "Question".
If the user gets rid of the dialog box without making a valid choice,
for instance using the window manager, then this produces a quit and
`x-popup-dialog' does not return. */)
- (position, contents, header)
- Lisp_Object position, contents, header;
+ (Lisp_Object position, Lisp_Object contents, Lisp_Object header)
{
return ns_popup_dialog (position, contents, header);
}
DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
doc: /* Return t if a menu or popup dialog is active. */)
- ()
+ (void)
{
return popup_activated () ? Qt : Qnil;
}
diff --git a/src/nsselect.m b/src/nsselect.m
index b034eacf77c..23dede9c38e 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -378,8 +378,7 @@ DEFUN ("x-own-selection-internal", Fx_own_selection_internal,
SELECTION-NAME is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
VALUE is typically a string, or a cons of two markers, but may be
anything that the functions on `selection-converter-alist' know about. */)
- (selection_name, selection_value)
- Lisp_Object selection_name, selection_value;
+ (Lisp_Object selection_name, Lisp_Object selection_value)
{
id pb;
Lisp_Object old_value, new_value;
@@ -413,8 +412,7 @@ anything that the functions on `selection-converter-alist' know about. */)
DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,
Sx_disown_selection_internal, 1, 2, 0,
doc: /* If we own the selection SELECTION, disown it. */)
- (selection_name, time)
- Lisp_Object selection_name, time;
+ (Lisp_Object selection_name, Lisp_Object time)
{
id pb;
check_ns ();
@@ -434,8 +432,7 @@ the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
\(Those are literal upper-case symbol names.)
For convenience, the symbol nil is the same as `PRIMARY',
and t is the same as `SECONDARY'.) */)
- (selection)
- Lisp_Object selection;
+ (Lisp_Object selection)
{
id pb;
NSArray *types;
@@ -458,8 +455,7 @@ the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
\(Those are literal upper-case symbol names.)
For convenience, the symbol nil is the same as `PRIMARY',
and t is the same as `SECONDARY'.) */)
- (selection)
- Lisp_Object selection;
+ (Lisp_Object selection)
{
check_ns ();
CHECK_SYMBOL (selection);
@@ -475,8 +471,7 @@ DEFUN ("x-get-selection-internal", Fx_get_selection_internal,
SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
\(Those are literal upper-case symbol names.)
TYPE is the type of data desired, typically `STRING'. */)
- (selection_name, target_type)
- Lisp_Object selection_name, target_type;
+ (Lisp_Object selection_name, Lisp_Object target_type)
{
Lisp_Object val;
@@ -501,8 +496,7 @@ TYPE is the type of data desired, typically `STRING'. */)
DEFUN ("ns-get-cut-buffer-internal", Fns_get_cut_buffer_internal,
Sns_get_cut_buffer_internal, 1, 1, 0,
doc: /* Returns the value of the named cut buffer. */)
- (buffer)
- Lisp_Object buffer;
+ (Lisp_Object buffer)
{
id pb;
check_ns ();
@@ -516,8 +510,7 @@ DEFUN ("ns-rotate-cut-buffers-internal", Fns_rotate_cut_buffers_internal,
doc: /* Rotate the values of the cut buffers by N steps.
Positive N means move values forward, negative means
backward. CURRENTLY NOT IMPLEMENTED UNDER NEXTSTEP. */ )
- (n)
- Lisp_Object n;
+ (Lisp_Object n)
{
/* XXX This function is unimplemented under NeXTstep XXX */
Fsignal (Qquit, Fcons (build_string (
@@ -529,8 +522,7 @@ backward. CURRENTLY NOT IMPLEMENTED UNDER NEXTSTEP. */ )
DEFUN ("ns-store-cut-buffer-internal", Fns_store_cut_buffer_internal,
Sns_store_cut_buffer_internal, 2, 2, 0,
doc: /* Sets the value of the named cut buffer (typically CUT_BUFFER0). */)
- (buffer, string)
- Lisp_Object buffer, string;
+ (Lisp_Object buffer, Lisp_Object string)
{
id pb;
check_ns ();
diff --git a/src/nsterm.h b/src/nsterm.h
index 01086e63b69..bc0e6e286c2 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -606,7 +606,7 @@ struct x_output
#define NS_FACE_FOREGROUND(f) ((f)->foreground)
#define NS_FACE_BACKGROUND(f) ((f)->background)
#define FRAME_NS_TITLEBAR_HEIGHT(f) ((f)->output_data.ns->titlebar_height)
-#define FRAME_NS_TOOLBAR_HEIGHT(f) ((f)->output_data.ns->toolbar_height)
+#define FRAME_TOOLBAR_HEIGHT(f) ((f)->output_data.ns->toolbar_height)
#define FONT_WIDTH(f) ((f)->max_width)
#define FONT_HEIGHT(f) ((f)->height)
@@ -760,8 +760,8 @@ extern unsigned long ns_get_pixel (void *img, int x, int y);
extern void ns_put_pixel (void *img, int x, int y, unsigned long argb);
extern void ns_set_alpha (void *img, int x, int y, unsigned char a);
-extern int x_display_pixel_height P_ ((struct ns_display_info *));
-extern int x_display_pixel_width P_ ((struct ns_display_info *));
+extern int x_display_pixel_height (struct ns_display_info *);
+extern int x_display_pixel_width (struct ns_display_info *);
/* This in nsterm.m */
extern unsigned long ns_get_rgb_color (struct frame *f,
diff --git a/src/nsterm.m b/src/nsterm.m
index 14b824057da..58245f4aebf 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1138,15 +1138,15 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows)
/* NOTE: previously this would generate wrong result if toolbar not
yet displayed and fixing toolbar_height=32 helped, but
now (200903) seems no longer needed */
- FRAME_NS_TOOLBAR_HEIGHT (f) =
+ FRAME_TOOLBAR_HEIGHT (f) =
NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)])
- FRAME_NS_TITLEBAR_HEIGHT (f);
else
- FRAME_NS_TOOLBAR_HEIGHT (f) = 0;
+ FRAME_TOOLBAR_HEIGHT (f) = 0;
wr.size.width = pixelwidth + f->border_width;
wr.size.height = pixelheight + FRAME_NS_TITLEBAR_HEIGHT (f)
- + FRAME_NS_TOOLBAR_HEIGHT (f);
+ + FRAME_TOOLBAR_HEIGHT (f);
/* constrain to screen if we can */
if (screen)
@@ -2163,11 +2163,11 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
{
EmacsImage **newBimgs
= xmalloc (max_used_fringe_bitmap * sizeof (EmacsImage *));
- bzero (newBimgs, max_used_fringe_bitmap * sizeof (EmacsImage *));
+ memset (newBimgs, 0, max_used_fringe_bitmap * sizeof (EmacsImage *));
if (nBimgs)
{
- bcopy (bimgs, newBimgs, nBimgs * sizeof (EmacsImage *));
+ memcpy (newBimgs, bimgs, nBimgs * sizeof (EmacsImage *));
xfree (bimgs);
}
@@ -2177,20 +2177,7 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
/* Must clip because of partially visible lines. */
rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
- if (p->y < rowY)
- {
- /* Adjust position of "bottom aligned" bitmap on partially
- visible last row. */
- int oldY = row->y;
- int oldVH = row->visible_height;
- row->visible_height = p->h;
- row->y -= rowY - p->y;
- ns_clip_to_row (w, row, -1, NO);
- row->y = oldY;
- row->visible_height = oldVH;
- }
- else
- ns_clip_to_row (w, row, -1, YES);
+ ns_clip_to_row (w, row, -1, YES);
if (p->bx >= 0 && !p->overlay_p)
{
@@ -3707,7 +3694,7 @@ ns_term_init (Lisp_Object display_name)
name: nil object: nil]; */
dpyinfo = (struct ns_display_info *)xmalloc (sizeof (struct ns_display_info));
- bzero (dpyinfo, sizeof (struct ns_display_info));
+ memset (dpyinfo, 0, sizeof (struct ns_display_info));
ns_initialize_display_info (dpyinfo);
terminal = ns_create_terminal (dpyinfo);
@@ -4894,16 +4881,16 @@ ns_term_shutdown (int sig)
rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (emacsframe, frameSize.height
#ifdef NS_IMPL_GNUSTEP
- FRAME_NS_TITLEBAR_HEIGHT (emacsframe) + 3
- - FRAME_NS_TOOLBAR_HEIGHT (emacsframe));
+ - FRAME_TOOLBAR_HEIGHT (emacsframe));
#else
- FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
- - FRAME_NS_TOOLBAR_HEIGHT (emacsframe));
+ - FRAME_TOOLBAR_HEIGHT (emacsframe));
#endif
if (rows < MINHEIGHT)
rows = MINHEIGHT;
frameSize.height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (emacsframe, rows)
+ FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
- + FRAME_NS_TOOLBAR_HEIGHT (emacsframe);
+ + FRAME_TOOLBAR_HEIGHT (emacsframe);
#ifdef NS_IMPL_COCOA
{
/* this sets window title to have size in it; the wm does this under GS */
@@ -5114,7 +5101,7 @@ ns_term_shutdown (int sig)
[toggleButton setTarget: self];
[toggleButton setAction: @selector (toggleToolbar: )];
#endif
- FRAME_NS_TOOLBAR_HEIGHT (f) = 0;
+ FRAME_TOOLBAR_HEIGHT (f) = 0;
tem = f->icon_name;
if (!NILP (tem))
diff --git a/src/prefix-args.c b/src/prefix-args.c
deleted file mode 100644
index d29085a3dff..00000000000
--- a/src/prefix-args.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/* prefix-args.c - echo each argument, prefixed by a string.
- Copyright (C) 1992, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
-
-This file is part of GNU Emacs.
-
-GNU Emacs is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-
-/* Jim Blandy <jimb@occs.cs.oberlin.edu> - September 1992
-
- When using GCC 2 as the linker in the build process, options
- intended for the linker need to be prefixed with the "-Xlinker"
- option. If an option takes an argument, we need to use -Xlinker
- twice - once for the option and once for its argument. For
- example, to run the linker with the options "-Bstatic" "-e"
- "_start", you'd need to pass the following options to GCC:
-
- -Xlinker -Bstatic -Xlinker -e -Xlinker _start.
-
- The Emacs makefile used to use a Bourne Shell `for' loop to prefix
- each linker option with "-Xlinker", but 1) the for loop was hairier
- than one might hope because it had to work when there were no
- arguments to pass to the linker - the shell barfs on a loop like
- this:
-
- for arg in ; do echo -Xlinker "$arg"; done
-
- and 2) the whole compilation command containing this loop seems to
- exit with a non-zero status and halt the build under Ultrix.
-
- If I can't write a completely portable program to do this in C,
- I'm quitting and taking up gardening. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if STDC_HEADERS
-# include <stdlib.h> /* for proper declaration of `exit' */
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- char *progname;
- char *prefix;
-
- progname = argv[0];
- argc--, argv++;
-
- if (argc < 1)
- {
- fprintf (stderr, "Usage: %s PREFIX ARGS...\n\
-Echo each ARG preceded by PREFIX and a space.\n", progname);
- exit (2);
- }
-
- prefix = argv[0];
- argc--, argv++;
-
- for (; argc > 0; argc--, argv++)
- printf ("%s %s%c", prefix, argv[0], (argc > 1) ? ' ' : '\n');
-
- exit (0);
-}
-
-/* arch-tag: 08136d70-e5c0-49c7-bcd8-b4850233977a
- (do not change this comment) */
diff --git a/src/print.c b/src/print.c
index fb298233666..614ad6f2632 100644
--- a/src/print.c
+++ b/src/print.c
@@ -168,7 +168,7 @@ extern int noninteractive_need_newline;
extern int minibuffer_auto_raise;
-void print_interval ();
+void print_interval (INTERVAL interval, Lisp_Object printcharfun);
/* GDB resets this to zero on W32 to disable OutputDebugString calls. */
int print_output_debug_flag = 1;
@@ -287,10 +287,9 @@ int print_output_debug_flag = 1;
when there is a recursive call to print. */
static Lisp_Object
-print_unwind (saved_text)
- Lisp_Object saved_text;
+print_unwind (Lisp_Object saved_text)
{
- bcopy (SDATA (saved_text), print_buffer, SCHARS (saved_text));
+ memcpy (print_buffer, SDATA (saved_text), SCHARS (saved_text));
return Qnil;
}
@@ -301,9 +300,7 @@ print_unwind (saved_text)
argument. */
static void
-printchar (ch, fun)
- unsigned int ch;
- Lisp_Object fun;
+printchar (unsigned int ch, Lisp_Object fun)
{
if (!NILP (fun) && !EQ (fun, Qt))
call1 (fun, make_number (ch));
@@ -319,7 +316,7 @@ printchar (ch, fun)
if (print_buffer_pos_byte + len >= print_buffer_size)
print_buffer = (char *) xrealloc (print_buffer,
print_buffer_size *= 2);
- bcopy (str, print_buffer + print_buffer_pos_byte, len);
+ memcpy (print_buffer + print_buffer_pos_byte, str, len);
print_buffer_pos += 1;
print_buffer_pos_byte += len;
}
@@ -353,11 +350,8 @@ printchar (ch, fun)
to data in a Lisp string. Otherwise that is not safe. */
static void
-strout (ptr, size, size_byte, printcharfun, multibyte)
- char *ptr;
- int size, size_byte;
- Lisp_Object printcharfun;
- int multibyte;
+strout (const char *ptr, int size, int size_byte, Lisp_Object printcharfun,
+ int multibyte)
{
if (size < 0)
size_byte = size = strlen (ptr);
@@ -370,7 +364,7 @@ strout (ptr, size, size_byte, printcharfun, multibyte)
print_buffer = (char *) xrealloc (print_buffer,
print_buffer_size);
}
- bcopy (ptr, print_buffer + print_buffer_pos_byte, size_byte);
+ memcpy (print_buffer + print_buffer_pos_byte, ptr, size_byte);
print_buffer_pos += size;
print_buffer_pos_byte += size_byte;
}
@@ -440,9 +434,7 @@ strout (ptr, size, size_byte, printcharfun, multibyte)
because printing one char can relocate. */
static void
-print_string (string, printcharfun)
- Lisp_Object string;
- Lisp_Object printcharfun;
+print_string (Lisp_Object string, Lisp_Object printcharfun)
{
if (EQ (printcharfun, Qt) || NILP (printcharfun))
{
@@ -469,7 +461,7 @@ print_string (string, printcharfun)
if (chars < bytes)
{
newstr = make_uninit_multibyte_string (chars, bytes);
- bcopy (SDATA (string), SDATA (newstr), chars);
+ memcpy (SDATA (newstr), SDATA (string), chars);
str_to_multibyte (SDATA (newstr), bytes, chars);
string = newstr;
}
@@ -488,7 +480,7 @@ print_string (string, printcharfun)
USE_SAFE_ALLOCA;
SAFE_ALLOCA (buffer, char *, nbytes);
- bcopy (SDATA (string), buffer, nbytes);
+ memcpy (buffer, SDATA (string), nbytes);
strout (buffer, chars, SBYTES (string),
printcharfun, STRING_MULTIBYTE (string));
@@ -530,8 +522,7 @@ print_string (string, printcharfun)
DEFUN ("write-char", Fwrite_char, Swrite_char, 1, 2, 0,
doc: /* Output character CHARACTER to stream PRINTCHARFUN.
PRINTCHARFUN defaults to the value of `standard-output' (which see). */)
- (character, printcharfun)
- Lisp_Object character, printcharfun;
+ (Lisp_Object character, Lisp_Object printcharfun)
{
PRINTDECLARE;
@@ -549,9 +540,7 @@ PRINTCHARFUN defaults to the value of `standard-output' (which see). */)
Do not use this on the contents of a Lisp string. */
void
-write_string (data, size)
- char *data;
- int size;
+write_string (const char *data, int size)
{
PRINTDECLARE;
Lisp_Object printcharfun;
@@ -568,10 +557,7 @@ write_string (data, size)
Do not use this on the contents of a Lisp string. */
void
-write_string_1 (data, size, printcharfun)
- char *data;
- int size;
- Lisp_Object printcharfun;
+write_string_1 (const char *data, int size, Lisp_Object printcharfun)
{
PRINTDECLARE;
@@ -582,8 +568,7 @@ write_string_1 (data, size, printcharfun)
void
-temp_output_buffer_setup (bufname)
- const char *bufname;
+temp_output_buffer_setup (const char *bufname)
{
int count = SPECPDL_INDEX ();
register struct buffer *old = current_buffer;
@@ -616,10 +601,7 @@ temp_output_buffer_setup (bufname)
}
Lisp_Object
-internal_with_output_to_temp_buffer (bufname, function, args)
- const char *bufname;
- Lisp_Object (*function) P_ ((Lisp_Object));
- Lisp_Object args;
+internal_with_output_to_temp_buffer (const char *bufname, Lisp_Object (*function) (Lisp_Object), Lisp_Object args)
{
int count = SPECPDL_INDEX ();
Lisp_Object buf, val;
@@ -670,8 +652,7 @@ temporarily selected. But it doesn't run `temp-buffer-show-hook'
if it uses `temp-buffer-show-function'.
usage: (with-output-to-temp-buffer BUFNAME BODY...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
struct gcpro gcpro1;
Lisp_Object name;
@@ -695,16 +676,15 @@ usage: (with-output-to-temp-buffer BUFNAME BODY...) */)
}
-static void print ();
-static void print_preprocess ();
-static void print_preprocess_string ();
-static void print_object ();
+static void print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag);
+static void print_preprocess (Lisp_Object obj);
+static void print_preprocess_string (INTERVAL interval, Lisp_Object arg);
+static void print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag);
DEFUN ("terpri", Fterpri, Sterpri, 0, 1, 0,
doc: /* Output a newline to stream PRINTCHARFUN.
If PRINTCHARFUN is omitted or nil, the value of `standard-output' is used. */)
- (printcharfun)
- Lisp_Object printcharfun;
+ (Lisp_Object printcharfun)
{
PRINTDECLARE;
@@ -739,8 +719,7 @@ of these:
If PRINTCHARFUN is omitted, the value of `standard-output' (which see)
is used instead. */)
- (object, printcharfun)
- Lisp_Object object, printcharfun;
+ (Lisp_Object object, Lisp_Object printcharfun)
{
PRINTDECLARE;
@@ -766,8 +745,7 @@ OBJECT is any of the Lisp data types: a number, a string, a symbol,
a list, a buffer, a window, a frame, etc.
A printed representation of an object is text which describes that object. */)
- (object, noescape)
- Lisp_Object object, noescape;
+ (Lisp_Object object, Lisp_Object noescape)
{
Lisp_Object printcharfun;
/* struct gcpro gcpro1, gcpro2; */
@@ -835,8 +813,7 @@ of these:
If PRINTCHARFUN is omitted, the value of `standard-output' (which see)
is used instead. */)
- (object, printcharfun)
- Lisp_Object object, printcharfun;
+ (Lisp_Object object, Lisp_Object printcharfun)
{
PRINTDECLARE;
@@ -871,8 +848,7 @@ of these:
If PRINTCHARFUN is omitted, the value of `standard-output' (which see)
is used instead. */)
- (object, printcharfun)
- Lisp_Object object, printcharfun;
+ (Lisp_Object object, Lisp_Object printcharfun)
{
PRINTDECLARE;
struct gcpro gcpro1;
@@ -897,8 +873,7 @@ DEFUN ("external-debugging-output", Fexternal_debugging_output, Sexternal_debugg
doc: /* Write CHARACTER to stderr.
You can call print while debugging emacs, and pass it this function
to make it write to the debugging output. */)
- (character)
- Lisp_Object character;
+ (Lisp_Object character)
{
CHECK_NUMBER (character);
putc (XINT (character), stderr);
@@ -919,8 +894,7 @@ to make it write to the debugging output. */)
print_output_debug_flag from being optimized away. */
void
-debug_output_compilation_hack (x)
- int x;
+debug_output_compilation_hack (int x)
{
print_output_debug_flag = x;
}
@@ -941,8 +915,7 @@ DEFUN ("redirect-debugging-output", Fredirect_debugging_output, Sredirect_debugg
If FILE is nil, reset target to the initial stderr stream.
Optional arg APPEND non-nil (interactively, with prefix arg) means
append to existing target file. */)
- (file, append)
- Lisp_Object file, append;
+ (Lisp_Object file, Lisp_Object append)
{
if (initial_stderr_stream != NULL)
{
@@ -974,16 +947,14 @@ append to existing target file. */)
/* This is the interface for debugging printing. */
void
-debug_print (arg)
- Lisp_Object arg;
+debug_print (Lisp_Object arg)
{
Fprin1 (arg, Qexternal_debugging_output);
fprintf (stderr, "\r\n");
}
void
-safe_debug_print (arg)
- Lisp_Object arg;
+safe_debug_print (Lisp_Object arg)
{
int valid = valid_lisp_object_p (arg);
@@ -1002,8 +973,7 @@ DEFUN ("error-message-string", Ferror_message_string, Serror_message_string,
doc: /* Convert an error value (ERROR-SYMBOL . DATA) to an error message.
See Info anchor `(elisp)Definition of signal' for some details on how this
error message is constructed. */)
- (obj)
- Lisp_Object obj;
+ (Lisp_Object obj)
{
struct buffer *old = current_buffer;
Lisp_Object value;
@@ -1037,10 +1007,8 @@ error message is constructed. */)
CALLER is the Lisp function inside which the error was signaled. */
void
-print_error_message (data, stream, context, caller)
- Lisp_Object data, stream;
- char *context;
- Lisp_Object caller;
+print_error_message (Lisp_Object data, Lisp_Object stream, const char *context,
+ Lisp_Object caller)
{
Lisp_Object errname, errmsg, file_error, tail;
struct gcpro gcpro1;
@@ -1055,7 +1023,7 @@ print_error_message (data, stream, context, caller)
{
Lisp_Object cname = SYMBOL_NAME (caller);
char *name = alloca (SBYTES (cname));
- bcopy (SDATA (cname), name, SBYTES (cname));
+ memcpy (name, SDATA (cname), SBYTES (cname));
message_dolog (name, SBYTES (cname), 0, 0);
message_dolog (": ", 2, 0, 0);
}
@@ -1125,9 +1093,7 @@ print_error_message (data, stream, context, caller)
*/
void
-float_to_string (buf, data)
- unsigned char *buf;
- double data;
+float_to_string (unsigned char *buf, double data)
{
unsigned char *cp;
int width;
@@ -1250,10 +1216,7 @@ float_to_string (buf, data)
static void
-print (obj, printcharfun, escapeflag)
- Lisp_Object obj;
- register Lisp_Object printcharfun;
- int escapeflag;
+print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag)
{
new_backquote_output = 0;
@@ -1312,8 +1275,7 @@ print (obj, printcharfun, escapeflag)
The status fields of Vprint_number_table mean whether each object appears
more than once in OBJ: Qnil at the first time, and Qt after that . */
static void
-print_preprocess (obj)
- Lisp_Object obj;
+print_preprocess (Lisp_Object obj)
{
int i;
EMACS_INT size;
@@ -1433,9 +1395,7 @@ print_preprocess (obj)
}
static void
-print_preprocess_string (interval, arg)
- INTERVAL interval;
- Lisp_Object arg;
+print_preprocess_string (INTERVAL interval, Lisp_Object arg)
{
print_preprocess (interval->plist);
}
@@ -1445,7 +1405,7 @@ print_preprocess_string (interval, arg)
Lisp_Object Vprint_charset_text_property;
extern Lisp_Object Qdefault;
-static void print_check_string_charset_prop ();
+static void print_check_string_charset_prop (INTERVAL interval, Lisp_Object string);
#define PRINT_STRING_NON_CHARSET_FOUND 1
#define PRINT_STRING_UNSAFE_CHARSET_FOUND 2
@@ -1454,9 +1414,7 @@ static void print_check_string_charset_prop ();
static int print_check_string_result;
static void
-print_check_string_charset_prop (interval, string)
- INTERVAL interval;
- Lisp_Object string;
+print_check_string_charset_prop (INTERVAL interval, Lisp_Object string)
{
Lisp_Object val;
@@ -1503,8 +1461,7 @@ print_check_string_charset_prop (interval, string)
static Lisp_Object print_prune_charset_plist;
static Lisp_Object
-print_prune_string_charset (string)
- Lisp_Object string;
+print_prune_string_charset (Lisp_Object string)
{
print_check_string_result = 0;
traverse_intervals (STRING_INTERVALS (string), 0,
@@ -1528,10 +1485,7 @@ print_prune_string_charset (string)
}
static void
-print_object (obj, printcharfun, escapeflag)
- Lisp_Object obj;
- register Lisp_Object printcharfun;
- int escapeflag;
+print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag)
{
char buf[40];
@@ -2307,9 +2261,7 @@ print_object (obj, printcharfun, escapeflag)
This is part of printing a string that has text properties. */
void
-print_interval (interval, printcharfun)
- INTERVAL interval;
- Lisp_Object printcharfun;
+print_interval (INTERVAL interval, Lisp_Object printcharfun)
{
if (NILP (interval->plist))
return;
@@ -2324,7 +2276,7 @@ print_interval (interval, printcharfun)
void
-syms_of_print ()
+syms_of_print (void)
{
Qtemp_buffer_setup_hook = intern_c_string ("temp-buffer-setup-hook");
staticpro (&Qtemp_buffer_setup_hook);
diff --git a/src/process.c b/src/process.c
index 22b85ff5910..219098905cf 100644
--- a/src/process.c
+++ b/src/process.c
@@ -21,17 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <signal.h>
-
-/* This file is split into two parts by the following preprocessor
- conditional. The 'then' clause contains all of the support for
- asynchronous subprocesses. The 'else' clause contains stub
- versions of some of the asynchronous subprocess routines that are
- often called elsewhere in Emacs, so we don't have to #ifdef the
- sections that call them. */
-
-
-#ifdef subprocesses
-
#include <stdio.h>
#include <errno.h>
#include <setjmp.h>
@@ -51,6 +40,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#include <fcntl.h>
+/* Only MS-DOS does not define `subprocesses'. */
+#ifdef subprocesses
+
#ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */
#include <sys/socket.h>
#include <netdb.h>
@@ -101,6 +93,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <resolv.h>
#endif
+#endif /* subprocesses */
+
#include "lisp.h"
#include "systime.h"
#include "systty.h"
@@ -119,11 +113,16 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "dispextern.h"
#include "composite.h"
#include "atimer.h"
+#include "sysselect.h"
+#include "syssignal.h"
+#include "syswait.h"
#if defined (USE_GTK) || defined (HAVE_GCONF)
#include "xgselect.h"
#endif /* defined (USE_GTK) || defined (HAVE_GCONF) */
+#ifdef subprocesses
+
Lisp_Object Qprocessp;
Lisp_Object Qrun, Qstop, Qsignal;
Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten;
@@ -135,7 +134,7 @@ Lisp_Object Qipv6;
Lisp_Object QCport, QCspeed, QCprocess;
Lisp_Object QCbytesize, QCstopbits, QCparity, Qodd, Qeven;
Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary;
-Lisp_Object QCname, QCbuffer, QChost, QCservice, QCtype;
+Lisp_Object QCbuffer, QChost, QCservice;
Lisp_Object QClocal, QCremote, QCcoding;
Lisp_Object QCserver, QCnowait, QCnoquery, QCstop;
Lisp_Object QCsentinel, QClog, QCoptions, QCplist;
@@ -151,11 +150,6 @@ extern Lisp_Object QCfamily;
/* QCfilter is defined in keyboard.c. */
extern Lisp_Object QCfilter;
-Lisp_Object Qeuid, Qegid, Qcomm, Qstate, Qppid, Qpgrp, Qsess, Qttname, Qtpgid;
-Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime, Qcstime;
-Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs;
-Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtime, Qctime;
-
#ifdef HAVE_SOCKETS
#define NETCONN_P(p) (EQ (XPROCESS (p)->type, Qnetwork))
#define NETCONN1_P(p) (EQ ((p)->type, Qnetwork))
@@ -178,11 +172,7 @@ Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtime, Qctime;
#define SIGCHLD SIGCLD
#endif /* SIGCLD */
-#include "syssignal.h"
-
-#include "syswait.h"
-
-extern char *get_operating_system_release ();
+extern char *get_operating_system_release (void);
/* Serial processes require termios or Windows. */
#if defined (HAVE_TERMIOS) || defined (WINDOWSNT)
@@ -282,14 +272,11 @@ static Lisp_Object Vprocess_adaptive_read_buffering;
#define process_output_delay_count 0
#endif
-
-#include "sysselect.h"
-
-static int keyboard_bit_set P_ ((SELECT_TYPE *));
-static void deactivate_process P_ ((Lisp_Object));
-static void status_notify P_ ((struct Lisp_Process *));
-static int read_process_output P_ ((Lisp_Object, int));
-static void create_pty P_ ((Lisp_Object));
+static int keyboard_bit_set (SELECT_TYPE *);
+static void deactivate_process (Lisp_Object);
+static void status_notify (struct Lisp_Process *);
+static int read_process_output (Lisp_Object, int);
+static void create_pty (Lisp_Object);
/* If we support a window system, turn on the code to poll periodically
to detect C-g. It isn't actually used when doing interrupt input. */
@@ -297,11 +284,32 @@ static void create_pty P_ ((Lisp_Object));
#define POLL_FOR_INPUT
#endif
-static Lisp_Object get_process ();
-static void exec_sentinel ();
+static Lisp_Object get_process (register Lisp_Object name);
+static void exec_sentinel (Lisp_Object proc, Lisp_Object reason);
+
+#endif /* subprocesses */
extern int timers_run;
+
+Lisp_Object Qeuid, Qegid, Qcomm, Qstate, Qppid, Qpgrp, Qsess, Qttname, Qtpgid;
+Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime, Qcstime;
+Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs;
+Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtime, Qctime;
+Lisp_Object QCname, QCtype;
+/* Non-zero if keyboard input is on hold, zero otherwise. */
+
+static int kbd_is_on_hold;
+
+/* Nonzero means delete a process right away if it exits. */
+static int delete_exited_processes;
+
+/* Nonzero means don't run process sentinels. This is used
+ when exiting. */
+int inhibit_sentinels;
+
+#ifdef subprocesses
+
/* Mask of bits indicating the descriptors that we wait for input on. */
static SELECT_TYPE input_wait_mask;
@@ -329,9 +337,9 @@ static SELECT_TYPE connect_wait_mask;
static int num_pending_connects;
#define IF_NON_BLOCKING_CONNECT(s) s
-#else
+#else /* NON_BLOCKING_CONNECT */
#define IF_NON_BLOCKING_CONNECT(s)
-#endif
+#endif /* NON_BLOCKING_CONNECT */
/* The largest descriptor currently in use for a process object. */
static int max_process_desc;
@@ -342,9 +350,6 @@ static int max_keyboard_desc;
/* The largest descriptor currently in use for gpm mouse input. */
static int max_gpm_desc;
-/* Nonzero means delete a process right away if it exits. */
-static int delete_exited_processes;
-
/* Indexed by descriptor, gives the process (if any) for that descriptor */
Lisp_Object chan_process[MAXDESC];
@@ -380,10 +385,6 @@ struct sockaddr_and_len {
/* Maximum number of bytes to send to a pty without an eof. */
static int pty_max_bytes;
-/* Nonzero means don't run process sentinels. This is used
- when exiting. */
-int inhibit_sentinels;
-
#ifdef HAVE_PTYS
#ifdef HAVE_PTY_H
#include <pty.h>
@@ -399,8 +400,7 @@ static char pty_name[24];
static Lisp_Object status_convert (int);
static void
-update_status (p)
- struct Lisp_Process *p;
+update_status (struct Lisp_Process *p)
{
eassert (p->raw_status_new);
p->status = status_convert (p->raw_status);
@@ -429,11 +429,7 @@ status_convert (int w)
and store them individually through the three pointers. */
static void
-decode_status (l, symbol, code, coredump)
- Lisp_Object l;
- Lisp_Object *symbol;
- int *code;
- int *coredump;
+decode_status (Lisp_Object l, Lisp_Object *symbol, int *code, int *coredump)
{
Lisp_Object tem;
@@ -456,8 +452,7 @@ decode_status (l, symbol, code, coredump)
/* Return a string describing a process status list. */
static Lisp_Object
-status_message (p)
- struct Lisp_Process *p;
+status_message (struct Lisp_Process *p)
{
Lisp_Object status = p->status;
Lisp_Object symbol;
@@ -519,7 +514,7 @@ status_message (p)
is left in the variable pty_name. */
static int
-allocate_pty ()
+allocate_pty (void)
{
register int c, i;
int fd;
@@ -593,8 +588,7 @@ allocate_pty ()
#endif /* HAVE_PTYS */
static Lisp_Object
-make_process (name)
- Lisp_Object name;
+make_process (Lisp_Object name)
{
register Lisp_Object val, tem, name1;
register struct Lisp_Process *p;
@@ -638,8 +632,7 @@ make_process (name)
}
static void
-remove_process (proc)
- register Lisp_Object proc;
+remove_process (register Lisp_Object proc)
{
register Lisp_Object pair;
@@ -649,52 +642,17 @@ remove_process (proc)
deactivate_process (proc);
}
-/* Setup coding systems of PROCESS. */
-
-void
-setup_process_coding_systems (process)
- Lisp_Object process;
-{
- struct Lisp_Process *p = XPROCESS (process);
- int inch = p->infd;
- int outch = p->outfd;
- Lisp_Object coding_system;
-
- if (inch < 0 || outch < 0)
- return;
-
- if (!proc_decode_coding_system[inch])
- proc_decode_coding_system[inch]
- = (struct coding_system *) xmalloc (sizeof (struct coding_system));
- coding_system = p->decode_coding_system;
- if (! NILP (p->filter))
- ;
- else if (BUFFERP (p->buffer))
- {
- if (NILP (XBUFFER (p->buffer)->enable_multibyte_characters))
- coding_system = raw_text_coding_system (coding_system);
- }
- setup_coding_system (coding_system, proc_decode_coding_system[inch]);
-
- if (!proc_encode_coding_system[outch])
- proc_encode_coding_system[outch]
- = (struct coding_system *) xmalloc (sizeof (struct coding_system));
- setup_coding_system (p->encode_coding_system,
- proc_encode_coding_system[outch]);
-}
DEFUN ("processp", Fprocessp, Sprocessp, 1, 1, 0,
doc: /* Return t if OBJECT is a process. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
return PROCESSP (object) ? Qt : Qnil;
}
DEFUN ("get-process", Fget_process, Sget_process, 1, 1, 0,
doc: /* Return the process named NAME, or nil if there is none. */)
- (name)
- register Lisp_Object name;
+ (register Lisp_Object name)
{
if (PROCESSP (name))
return name;
@@ -702,35 +660,13 @@ DEFUN ("get-process", Fget_process, Sget_process, 1, 1, 0,
return Fcdr (Fassoc (name, Vprocess_alist));
}
-DEFUN ("get-buffer-process", Fget_buffer_process, Sget_buffer_process, 1, 1, 0,
- doc: /* Return the (or a) process associated with BUFFER.
-BUFFER may be a buffer or the name of one. */)
- (buffer)
- register Lisp_Object buffer;
-{
- register Lisp_Object buf, tail, proc;
-
- if (NILP (buffer)) return Qnil;
- buf = Fget_buffer (buffer);
- if (NILP (buf)) return Qnil;
-
- for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
- {
- proc = Fcdr (XCAR (tail));
- if (PROCESSP (proc) && EQ (XPROCESS (proc)->buffer, buf))
- return proc;
- }
- return Qnil;
-}
-
/* This is how commands for the user decode process arguments. It
accepts a process, a process name, a buffer, a buffer name, or nil.
Buffers denote the first process in the buffer, and nil denotes the
current buffer. */
static Lisp_Object
-get_process (name)
- register Lisp_Object name;
+get_process (register Lisp_Object name)
{
register Lisp_Object proc, obj;
if (STRINGP (name))
@@ -776,8 +712,7 @@ DEFUN ("delete-process", Fdelete_process, Sdelete_process, 1, 1, 0,
doc: /* Delete PROCESS: kill it and forget about it immediately.
PROCESS may be a process, a buffer, the name of a process or buffer, or
nil, indicating the current buffer's process. */)
- (process)
- register Lisp_Object process;
+ (register Lisp_Object process)
{
register struct Lisp_Process *p;
@@ -844,8 +779,7 @@ failed -- when a non-blocking connection has failed.
nil -- if arg is a process name and no such process exists.
PROCESS may be a process, a buffer, the name of a process, or
nil, indicating the current buffer's process. */)
- (process)
- register Lisp_Object process;
+ (register Lisp_Object process)
{
register struct Lisp_Process *p;
register Lisp_Object status;
@@ -880,8 +814,7 @@ DEFUN ("process-exit-status", Fprocess_exit_status, Sprocess_exit_status,
1, 1, 0,
doc: /* Return the exit status of PROCESS or the signal number that killed it.
If PROCESS has not yet exited or died, return 0. */)
- (process)
- register Lisp_Object process;
+ (register Lisp_Object process)
{
CHECK_PROCESS (process);
if (XPROCESS (process)->raw_status_new)
@@ -895,8 +828,7 @@ DEFUN ("process-id", Fprocess_id, Sprocess_id, 1, 1, 0,
doc: /* Return the process id of PROCESS.
This is the pid of the external process which PROCESS uses or talks to.
For a network connection, this value is nil. */)
- (process)
- register Lisp_Object process;
+ (register Lisp_Object process)
{
/* Assignment to EMACS_INT stops GCC whining about limited range of
data type. */
@@ -911,8 +843,7 @@ DEFUN ("process-name", Fprocess_name, Sprocess_name, 1, 1, 0,
doc: /* Return the name of PROCESS, as a string.
This is the name of the program invoked in PROCESS,
possibly modified to make it unique among process names. */)
- (process)
- register Lisp_Object process;
+ (register Lisp_Object process)
{
CHECK_PROCESS (process);
return XPROCESS (process)->name;
@@ -924,8 +855,7 @@ This is a list of strings, the first string being the program executed
and the rest of the strings being the arguments given to it.
For a network or serial process, this is nil (process is running) or t
\(process is stopped). */)
- (process)
- register Lisp_Object process;
+ (register Lisp_Object process)
{
CHECK_PROCESS (process);
return XPROCESS (process)->command;
@@ -935,8 +865,7 @@ DEFUN ("process-tty-name", Fprocess_tty_name, Sprocess_tty_name, 1, 1, 0,
doc: /* Return the name of the terminal PROCESS uses, or nil if none.
This is the terminal that the process itself reads and writes on,
not the name of the pty that Emacs uses to talk with that terminal. */)
- (process)
- register Lisp_Object process;
+ (register Lisp_Object process)
{
CHECK_PROCESS (process);
return XPROCESS (process)->tty_name;
@@ -945,8 +874,7 @@ not the name of the pty that Emacs uses to talk with that terminal. */)
DEFUN ("set-process-buffer", Fset_process_buffer, Sset_process_buffer,
2, 2, 0,
doc: /* Set buffer associated with PROCESS to BUFFER (a buffer, or nil). */)
- (process, buffer)
- register Lisp_Object process, buffer;
+ (register Lisp_Object process, Lisp_Object buffer)
{
struct Lisp_Process *p;
@@ -965,8 +893,7 @@ DEFUN ("process-buffer", Fprocess_buffer, Sprocess_buffer,
1, 1, 0,
doc: /* Return the buffer PROCESS is associated with.
Output from PROCESS is inserted in this buffer unless PROCESS has a filter. */)
- (process)
- register Lisp_Object process;
+ (register Lisp_Object process)
{
CHECK_PROCESS (process);
return XPROCESS (process)->buffer;
@@ -975,8 +902,7 @@ Output from PROCESS is inserted in this buffer unless PROCESS has a filter. */)
DEFUN ("process-mark", Fprocess_mark, Sprocess_mark,
1, 1, 0,
doc: /* Return the marker for the end of the last output from PROCESS. */)
- (process)
- register Lisp_Object process;
+ (register Lisp_Object process)
{
CHECK_PROCESS (process);
return XPROCESS (process)->mark;
@@ -998,8 +924,7 @@ The string argument is normally a multibyte string, except:
- if `default-enable-multibyte-characters' is nil, it is a unibyte
string (the result of converting the decoded input multibyte
string to unibyte with `string-make-unibyte'). */)
- (process, filter)
- register Lisp_Object process, filter;
+ (register Lisp_Object process, Lisp_Object filter)
{
struct Lisp_Process *p;
@@ -1041,8 +966,7 @@ DEFUN ("process-filter", Fprocess_filter, Sprocess_filter,
1, 1, 0,
doc: /* Returns the filter function of PROCESS; nil if none.
See `set-process-filter' for more info on filter functions. */)
- (process)
- register Lisp_Object process;
+ (register Lisp_Object process)
{
CHECK_PROCESS (process);
return XPROCESS (process)->filter;
@@ -1053,8 +977,7 @@ DEFUN ("set-process-sentinel", Fset_process_sentinel, Sset_process_sentinel,
doc: /* Give PROCESS the sentinel SENTINEL; nil for none.
The sentinel is called as a function when the process changes state.
It gets two arguments: the process, and a string describing the change. */)
- (process, sentinel)
- register Lisp_Object process, sentinel;
+ (register Lisp_Object process, Lisp_Object sentinel)
{
struct Lisp_Process *p;
@@ -1071,8 +994,7 @@ DEFUN ("process-sentinel", Fprocess_sentinel, Sprocess_sentinel,
1, 1, 0,
doc: /* Return the sentinel of PROCESS; nil if none.
See `set-process-sentinel' for more info on sentinels. */)
- (process)
- register Lisp_Object process;
+ (register Lisp_Object process)
{
CHECK_PROCESS (process);
return XPROCESS (process)->sentinel;
@@ -1081,8 +1003,7 @@ See `set-process-sentinel' for more info on sentinels. */)
DEFUN ("set-process-window-size", Fset_process_window_size,
Sset_process_window_size, 3, 3, 0,
doc: /* Tell PROCESS that it has logical window size HEIGHT and WIDTH. */)
- (process, height, width)
- register Lisp_Object process, height, width;
+ (register Lisp_Object process, Lisp_Object height, Lisp_Object width)
{
CHECK_PROCESS (process);
CHECK_NATNUM (height);
@@ -1113,36 +1034,20 @@ is more appropriate for saving the process buffer.
Binding the variable `inherit-process-coding-system' to non-nil before
starting the process is an alternative way of setting the inherit flag
for the process which will run. */)
- (process, flag)
- register Lisp_Object process, flag;
+ (register Lisp_Object process, Lisp_Object flag)
{
CHECK_PROCESS (process);
XPROCESS (process)->inherit_coding_system_flag = !NILP (flag);
return flag;
}
-DEFUN ("process-inherit-coding-system-flag",
- Fprocess_inherit_coding_system_flag, Sprocess_inherit_coding_system_flag,
- 1, 1, 0,
- doc: /* Return the value of inherit-coding-system flag for PROCESS.
-If this flag is t, `buffer-file-coding-system' of the buffer
-associated with PROCESS will inherit the coding system used to decode
-the process output. */)
- (process)
- register Lisp_Object process;
-{
- CHECK_PROCESS (process);
- return XPROCESS (process)->inherit_coding_system_flag ? Qt : Qnil;
-}
-
DEFUN ("set-process-query-on-exit-flag",
Fset_process_query_on_exit_flag, Sset_process_query_on_exit_flag,
2, 2, 0,
doc: /* Specify if query is needed for PROCESS when Emacs is exited.
If the second argument FLAG is non-nil, Emacs will query the user before
exiting or killing a buffer if PROCESS is running. */)
- (process, flag)
- register Lisp_Object process, flag;
+ (register Lisp_Object process, Lisp_Object flag)
{
CHECK_PROCESS (process);
XPROCESS (process)->kill_without_query = NILP (flag);
@@ -1153,15 +1058,14 @@ DEFUN ("process-query-on-exit-flag",
Fprocess_query_on_exit_flag, Sprocess_query_on_exit_flag,
1, 1, 0,
doc: /* Return the current value of query-on-exit flag for PROCESS. */)
- (process)
- register Lisp_Object process;
+ (register Lisp_Object process)
{
CHECK_PROCESS (process);
return (XPROCESS (process)->kill_without_query ? Qnil : Qt);
}
#ifdef DATAGRAM_SOCKETS
-Lisp_Object Fprocess_datagram_address ();
+Lisp_Object Fprocess_datagram_address (Lisp_Object process);
#endif
DEFUN ("process-contact", Fprocess_contact, Sprocess_contact,
@@ -1174,8 +1078,7 @@ connection. If KEY is t, the complete contact information for the
connection is returned, else the specific value for the keyword KEY is
returned. See `make-network-process' or `make-serial-process' for a
list of keywords. */)
- (process, key)
- register Lisp_Object process, key;
+ (register Lisp_Object process, Lisp_Object key)
{
Lisp_Object contact;
@@ -1203,8 +1106,7 @@ list of keywords. */)
DEFUN ("process-plist", Fprocess_plist, Sprocess_plist,
1, 1, 0,
doc: /* Return the plist of PROCESS. */)
- (process)
- register Lisp_Object process;
+ (register Lisp_Object process)
{
CHECK_PROCESS (process);
return XPROCESS (process)->plist;
@@ -1213,8 +1115,7 @@ DEFUN ("process-plist", Fprocess_plist, Sprocess_plist,
DEFUN ("set-process-plist", Fset_process_plist, Sset_process_plist,
2, 2, 0,
doc: /* Replace the plist of PROCESS with PLIST. Returns PLIST. */)
- (process, plist)
- register Lisp_Object process, plist;
+ (register Lisp_Object process, Lisp_Object plist)
{
CHECK_PROCESS (process);
CHECK_LIST (plist);
@@ -1229,8 +1130,7 @@ DEFUN ("process-connection", Fprocess_connection, Sprocess_connection, 1, 1, 0,
doc: /* Return the connection type of PROCESS.
The value is nil for a pipe, t or `pty' for a pty, or `stream' for
a socket connection. */)
- (process)
- Lisp_Object process;
+ (Lisp_Object process)
{
return XPROCESS (process)->type;
}
@@ -1241,8 +1141,7 @@ DEFUN ("process-type", Fprocess_type, Sprocess_type, 1, 1, 0,
The value is either the symbol `real', `network', or `serial'.
PROCESS may be a process, a buffer, the name of a process or buffer, or
nil, indicating the current buffer's process. */)
- (process)
- Lisp_Object process;
+ (Lisp_Object process)
{
Lisp_Object proc;
proc = get_process (process);
@@ -1258,8 +1157,7 @@ An 8 or 9 element vector represents an IPv6 address (with port number).
If optional second argument OMIT-PORT is non-nil, don't include a port
number in the string, even when present in ADDRESS.
Returns nil if format of ADDRESS is invalid. */)
- (address, omit_port)
- Lisp_Object address, omit_port;
+ (Lisp_Object address, Lisp_Object omit_port)
{
if (NILP (address))
return Qnil;
@@ -1327,8 +1225,7 @@ Returns nil if format of ADDRESS is invalid. */)
#endif
static Lisp_Object
-list_processes_1 (query_only)
- Lisp_Object query_only;
+list_processes_1 (Lisp_Object query_only)
{
register Lisp_Object tail, tem;
Lisp_Object proc, minspace, tem1;
@@ -1562,8 +1459,7 @@ If optional argument QUERY-ONLY is non-nil, only processes with
the query-on-exit flag set will be listed.
Any process listed as exited or signaled is actually eliminated
after the listing is made. */)
- (query_only)
- Lisp_Object query_only;
+ (Lisp_Object query_only)
{
internal_with_output_to_temp_buffer ("*Process List*",
list_processes_1, query_only);
@@ -1572,14 +1468,14 @@ after the listing is made. */)
DEFUN ("process-list", Fprocess_list, Sprocess_list, 0, 0, 0,
doc: /* Return a list of all processes. */)
- ()
+ (void)
{
return Fmapcar (Qcdr, Vprocess_alist);
}
/* Starting asynchronous inferior processes. */
-static Lisp_Object start_process_unwind ();
+static Lisp_Object start_process_unwind (Lisp_Object proc);
DEFUN ("start-process", Fstart_process, Sstart_process, 3, MANY, 0,
doc: /* Start a program in a subprocess. Return the process object for it.
@@ -1600,9 +1496,7 @@ the command through a shell and redirect one of them using the shell
syntax.
usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
Lisp_Object buffer, name, program, proc, current_dir, tem;
register unsigned char **new_argv;
@@ -1814,8 +1708,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
an error and the process wasn't started successfully, so we should
remove it from the process list. */
static Lisp_Object
-start_process_unwind (proc)
- Lisp_Object proc;
+start_process_unwind (Lisp_Object proc)
{
if (!PROCESSP (proc))
abort ();
@@ -1828,8 +1721,7 @@ start_process_unwind (proc)
}
static void
-create_process_1 (timer)
- struct atimer *timer;
+create_process_1 (struct atimer *timer)
{
/* Nothing to do. */
}
@@ -1855,10 +1747,7 @@ create_process_sigchld ()
#endif
void
-create_process (process, new_argv, current_dir)
- Lisp_Object process;
- char **new_argv;
- Lisp_Object current_dir;
+create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
{
int inchannel, outchannel;
pid_t pid;
@@ -2038,7 +1927,7 @@ create_process (process, new_argv, current_dir)
process_set_signal to fail on SGI when using a pipe. */
setsid ();
/* Make the pty's terminal the controlling terminal. */
- if (pty_flag)
+ if (pty_flag && xforkin >= 0)
{
#ifdef TIOCSCTTY
/* We ignore the return value
@@ -2081,8 +1970,11 @@ create_process (process, new_argv, current_dir)
/* I wonder: would just ioctl (0, TIOCNOTTY, 0) work here?
I can't test it since I don't have 4.3. */
int j = emacs_open ("/dev/tty", O_RDWR, 0);
- ioctl (j, TIOCNOTTY, 0);
- emacs_close (j);
+ if (j >= 0)
+ {
+ ioctl (j, TIOCNOTTY, 0);
+ emacs_close (j);
+ }
#ifndef USG
/* In order to get a controlling terminal on some versions
of BSD, it is necessary to put the process in pgrp 0
@@ -2242,8 +2134,7 @@ create_process (process, new_argv, current_dir)
}
void
-create_pty (process)
- Lisp_Object process;
+create_pty (Lisp_Object process)
{
int inchannel, outchannel;
@@ -2330,9 +2221,7 @@ create_pty (process)
The address family of sa is not included in the result. */
static Lisp_Object
-conv_sockaddr_to_lisp (sa, len)
- struct sockaddr *sa;
- int len;
+conv_sockaddr_to_lisp (struct sockaddr *sa, int len)
{
Lisp_Object address;
int i;
@@ -2342,7 +2231,7 @@ conv_sockaddr_to_lisp (sa, len)
/* Workaround for a bug in getsockname on BSD: Names bound to
sockets in the UNIX domain are inaccessible; getsockname returns
a zero length name. */
- if (len < OFFSETOF (struct sockaddr, sa_family) + sizeof (sa->sa_family))
+ if (len < offsetof (struct sockaddr, sa_family) + sizeof (sa->sa_family))
return empty_unibyte_string;
switch (sa->sa_family)
@@ -2382,7 +2271,7 @@ conv_sockaddr_to_lisp (sa, len)
}
#endif
default:
- len -= OFFSETOF (struct sockaddr, sa_family) + sizeof (sa->sa_family);
+ len -= offsetof (struct sockaddr, sa_family) + sizeof (sa->sa_family);
address = Fcons (make_number (sa->sa_family),
Fmake_vector (make_number (len), Qnil));
p = XVECTOR (XCDR (address));
@@ -2401,9 +2290,7 @@ conv_sockaddr_to_lisp (sa, len)
/* Get family and required size for sockaddr structure to hold ADDRESS. */
static int
-get_lisp_to_sockaddr_size (address, familyp)
- Lisp_Object address;
- int *familyp;
+get_lisp_to_sockaddr_size (Lisp_Object address, int *familyp)
{
register struct Lisp_Vector *p;
@@ -2448,17 +2335,13 @@ get_lisp_to_sockaddr_size (address, familyp)
we return after zeroing *SA. */
static void
-conv_lisp_to_sockaddr (family, address, sa, len)
- int family;
- Lisp_Object address;
- struct sockaddr *sa;
- int len;
+conv_lisp_to_sockaddr (int family, Lisp_Object address, struct sockaddr *sa, int len)
{
register struct Lisp_Vector *p;
register unsigned char *cp = NULL;
register int i;
- bzero (sa, len);
+ memset (sa, 0, len);
if (VECTORP (address))
{
@@ -2522,8 +2405,7 @@ conv_lisp_to_sockaddr (family, address, sa, len)
DEFUN ("process-datagram-address", Fprocess_datagram_address, Sprocess_datagram_address,
1, 1, 0,
doc: /* Get the current datagram address associated with PROCESS. */)
- (process)
- Lisp_Object process;
+ (Lisp_Object process)
{
int channel;
@@ -2541,8 +2423,7 @@ DEFUN ("set-process-datagram-address", Fset_process_datagram_address, Sset_proce
2, 2, 0,
doc: /* Set the datagram address for PROCESS to ADDRESS.
Returns nil upon error setting address, ADDRESS otherwise. */)
- (process, address)
- Lisp_Object process, address;
+ (Lisp_Object process, Lisp_Object address)
{
int channel;
int family, len;
@@ -2609,9 +2490,7 @@ static const struct socket_options {
*/
static int
-set_socket_option (s, opt, val)
- int s;
- Lisp_Object opt, val;
+set_socket_option (int s, Lisp_Object opt, Lisp_Object val)
{
char *name;
const struct socket_options *sopt;
@@ -2655,12 +2534,12 @@ set_socket_option (s, opt, val)
/* This is broken, at least in the Linux 2.4 kernel.
To unbind, the arg must be a zero integer, not the empty string.
This should work on all systems. KFS. 2003-09-23. */
- bzero (devname, sizeof devname);
+ memset (devname, 0, sizeof devname);
if (STRINGP (val))
{
char *arg = (char *) SDATA (val);
int len = min (strlen (arg), IFNAMSIZ);
- bcopy (arg, devname, len);
+ memcpy (devname, arg, len);
}
else if (!NILP (val))
error ("Bad option value for %s", name);
@@ -2705,9 +2584,7 @@ DEFUN ("set-network-process-option",
See `make-network-process' for a list of options and values.
If optional fourth arg NO-ERROR is non-nil, don't signal an error if
OPTION is not a supported option, return nil instead; otherwise return t. */)
- (process, option, value, no_error)
- Lisp_Object process, option, value;
- Lisp_Object no_error;
+ (Lisp_Object process, Lisp_Object option, Lisp_Object value, Lisp_Object no_error)
{
int s;
struct Lisp_Process *p;
@@ -2794,9 +2671,7 @@ Examples:
\(serial-process-configure :port "\\\\.\\COM13" :bytesize 7)
usage: (serial-process-configure &rest ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
struct Lisp_Process *p;
Lisp_Object contact = Qnil;
@@ -2913,9 +2788,7 @@ Examples:
\(make-serial-process :port "/dev/tty.BlueConsole-SPP-1" :speed nil)
usage: (make-serial-process &rest ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
int fd = -1;
Lisp_Object proc, contact, port;
@@ -3027,7 +2900,7 @@ usage: (make-serial-process &rest ARGS) */)
p->inherit_coding_system_flag
= !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system);
- Fserial_process_configure(nargs, args);
+ Fserial_process_configure (nargs, args);
specpdl_ptr = specpdl + specpdl_count;
@@ -3194,9 +3067,7 @@ The original argument list, modified with the actual connection
information, is available via the `process-contact' function.
usage: (make-network-process &rest ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
Lisp_Object proc;
Lisp_Object contact;
@@ -3369,7 +3240,7 @@ usage: (make-network-process &rest ARGS) */)
host = Qnil;
}
CHECK_STRING (service);
- bzero (&address_un, sizeof address_un);
+ memset (&address_un, 0, sizeof address_un);
address_un.sun_family = AF_LOCAL;
strncpy (address_un.sun_path, SDATA (service), sizeof address_un.sun_path);
ai.ai_addr = (struct sockaddr *) &address_un;
@@ -3425,7 +3296,7 @@ usage: (make-network-process &rest ARGS) */)
ret = getaddrinfo (SDATA (host), portstring, &hints, &res);
if (ret)
#ifdef HAVE_GAI_STRERROR
- error ("%s/%s %s", SDATA (host), portstring, gai_strerror(ret));
+ error ("%s/%s %s", SDATA (host), portstring, gai_strerror (ret));
#else
error ("%s/%s getaddrinfo error %d", SDATA (host), portstring, ret);
#endif
@@ -3453,7 +3324,7 @@ usage: (make-network-process &rest ARGS) */)
port = svc_info->s_port;
}
- bzero (&address_in, sizeof address_in);
+ memset (&address_in, 0, sizeof address_in);
address_in.sin_family = family;
address_in.sin_addr.s_addr = INADDR_ANY;
address_in.sin_port = port;
@@ -3477,8 +3348,8 @@ usage: (make-network-process &rest ARGS) */)
if (host_info_ptr)
{
- bcopy (host_info_ptr->h_addr, (char *) &address_in.sin_addr,
- host_info_ptr->h_length);
+ memcpy (&address_in.sin_addr, host_info_ptr->h_addr,
+ host_info_ptr->h_length);
family = host_info_ptr->h_addrtype;
address_in.sin_family = family;
}
@@ -3490,8 +3361,8 @@ usage: (make-network-process &rest ARGS) */)
if (numeric_addr == -1)
error ("Unknown host \"%s\"", SDATA (host));
- bcopy ((char *)&numeric_addr, (char *) &address_in.sin_addr,
- sizeof (address_in.sin_addr));
+ memcpy (&address_in.sin_addr, &numeric_addr,
+ sizeof (address_in.sin_addr));
}
}
@@ -3675,7 +3546,7 @@ usage: (make-network-process &rest ARGS) */)
if (is_server)
{
Lisp_Object remote;
- bzero (datagram_address[s].sa, lres->ai_addrlen);
+ memset (datagram_address[s].sa, 0, lres->ai_addrlen);
if (remote = Fplist_get (contact, QCremote), !NILP (remote))
{
int rfamily, rlen;
@@ -3686,7 +3557,7 @@ usage: (make-network-process &rest ARGS) */)
}
}
else
- bcopy (lres->ai_addr, datagram_address[s].sa, lres->ai_addrlen);
+ memcpy (datagram_address[s].sa, lres->ai_addr, lres->ai_addrlen);
}
#endif
contact = Fplist_put (contact, QCaddress,
@@ -3698,7 +3569,7 @@ usage: (make-network-process &rest ARGS) */)
int len1 = sizeof (sa1);
if (getsockname (s, (struct sockaddr *)&sa1, &len1) == 0)
contact = Fplist_put (contact, QClocal,
- conv_sockaddr_to_lisp (&sa1, len1));
+ conv_sockaddr_to_lisp ((struct sockaddr *)&sa1, len1));
}
#endif
}
@@ -3910,7 +3781,7 @@ DEFUN ("network-interface-list", Fnetwork_interface_list, Snetwork_interface_lis
Each element is a cons, the car of which is a string containing the
interface name, and the cdr is the network address in internal
format; see the description of ADDRESS in `make-network-process'. */)
- ()
+ (void)
{
struct ifconf ifconf;
struct ifreq *ifreqs = NULL;
@@ -3924,7 +3795,7 @@ format; see the description of ADDRESS in `make-network-process'. */)
again:
ifaces += 25;
- buf_size = ifaces * sizeof(ifreqs[0]);
+ buf_size = ifaces * sizeof (ifreqs[0]);
ifreqs = (struct ifreq *)xrealloc(ifreqs, buf_size);
if (!ifreqs)
{
@@ -3953,7 +3824,7 @@ format; see the description of ADDRESS in `make-network-process'. */)
char namebuf[sizeof (ifq->ifr_name) + 1];
if (ifq->ifr_addr.sa_family != AF_INET)
continue;
- bcopy (ifq->ifr_name, namebuf, sizeof (ifq->ifr_name));
+ memcpy (namebuf, ifq->ifr_name, sizeof (ifq->ifr_name));
namebuf[sizeof (ifq->ifr_name)] = 0;
res = Fcons (Fcons (build_string (namebuf),
conv_sockaddr_to_lisp (&ifq->ifr_addr,
@@ -4045,8 +3916,7 @@ The return value is a list (ADDR BCAST NETMASK HWADDR FLAGS),
where ADDR is the layer 3 address, BCAST is the layer 3 broadcast address,
NETMASK is the layer 3 network mask, HWADDR is the layer 2 addres, and
FLAGS is the current flags of the interface. */)
- (ifname)
- Lisp_Object ifname;
+ (Lisp_Object ifname)
{
struct ifreq rq;
Lisp_Object res = Qnil;
@@ -4056,7 +3926,7 @@ FLAGS is the current flags of the interface. */)
CHECK_STRING (ifname);
- bzero (rq.ifr_name, sizeof rq.ifr_name);
+ memset (rq.ifr_name, 0, sizeof rq.ifr_name);
strncpy (rq.ifr_name, SDATA (ifname), sizeof (rq.ifr_name));
s = socket (AF_INET, SOCK_STREAM, 0);
@@ -4151,8 +4021,7 @@ FLAGS is the current flags of the interface. */)
/* Turn off input and output for process PROC. */
void
-deactivate_process (proc)
- Lisp_Object proc;
+deactivate_process (Lisp_Object proc)
{
register int inchannel, outchannel;
register struct Lisp_Process *p = XPROCESS (proc);
@@ -4212,31 +4081,6 @@ deactivate_process (proc)
}
}
-/* Close all descriptors currently in use for communication
- with subprocess. This is used in a newly-forked subprocess
- to get rid of irrelevant descriptors. */
-
-void
-close_process_descs ()
-{
-#ifndef WINDOWSNT
- int i;
- for (i = 0; i < MAXDESC; i++)
- {
- Lisp_Object process;
- process = chan_process[i];
- if (!NILP (process))
- {
- int in = XPROCESS (process)->infd;
- int out = XPROCESS (process)->outfd;
- if (in >= 0)
- emacs_close (in);
- if (out >= 0 && in != out)
- emacs_close (out);
- }
- }
-#endif
-}
DEFUN ("accept-process-output", Faccept_process_output, Saccept_process_output,
0, 4, 0,
@@ -4255,8 +4099,7 @@ If optional fourth arg JUST-THIS-ONE is non-nil, only accept output
from PROCESS, suspending reading output from other processes.
If JUST-THIS-ONE is an integer, don't run any timers either.
Return non-nil if we received any output before the timeout expired. */)
- (process, seconds, millisec, just_this_one)
- register Lisp_Object process, seconds, millisec, just_this_one;
+ (register Lisp_Object process, Lisp_Object seconds, Lisp_Object millisec, Lisp_Object just_this_one)
{
int secs, usecs = 0;
@@ -4310,9 +4153,7 @@ Return non-nil if we received any output before the timeout expired. */)
static int connect_counter = 0;
static void
-server_accept_connection (server, channel)
- Lisp_Object server;
- int channel;
+server_accept_connection (Lisp_Object server, int channel)
{
Lisp_Object proc, caller, name, buffer;
Lisp_Object contact, host, service;
@@ -4389,7 +4230,7 @@ server_accept_connection (server, channel)
int i;
args[0] = build_string ("%x:%x:%x:%x:%x:%x:%x:%x");
for (i = 0; i < 8; i++)
- args[i+1] = make_number (ntohs(ip6[i]));
+ args[i+1] = make_number (ntohs (ip6[i]));
host = Fformat (9, args);
service = make_number (ntohs (saddr.in.sin_port));
@@ -4528,8 +4369,7 @@ server_accept_connection (server, channel)
static int waiting_for_user_input_p;
static Lisp_Object
-wait_reading_process_output_unwind (data)
- Lisp_Object data;
+wait_reading_process_output_unwind (Lisp_Object data)
{
waiting_for_user_input_p = XINT (data);
return Qnil;
@@ -4537,7 +4377,7 @@ wait_reading_process_output_unwind (data)
/* This is here so breakpoints can be put on it. */
static void
-wait_reading_process_output_1 ()
+wait_reading_process_output_1 (void)
{
}
@@ -4550,10 +4390,7 @@ wait_reading_process_output_1 ()
#ifndef select
static INLINE int
-select_wrapper (n, rfd, wfd, xfd, tmo)
- int n;
- SELECT_TYPE *rfd, *wfd, *xfd;
- EMACS_TIME *tmo;
+select_wrapper (int n, fd_set *rfd, fd_set *wfd, fd_set *xfd, struct timeval *tmo)
{
return select (n, rfd, wfd, xfd, tmo);
}
@@ -4598,12 +4435,10 @@ select_wrapper (n, rfd, wfd, xfd, tmo)
Otherwise, return true if we received input from any process. */
int
-wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
- wait_for_cell, wait_proc, just_wait_proc)
- int time_limit, microsecs, read_kbd, do_display;
- Lisp_Object wait_for_cell;
- struct Lisp_Process *wait_proc;
- int just_wait_proc;
+wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
+ int do_display,
+ Lisp_Object wait_for_cell,
+ struct Lisp_Process *wait_proc, int just_wait_proc)
{
register int channel, nfds;
SELECT_TYPE Available;
@@ -4762,7 +4597,10 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
SELECT_TYPE Ctemp;
#endif
- Atemp = input_wait_mask;
+ if (kbd_on_hold_p ())
+ FD_ZERO (&Atemp);
+ else
+ Atemp = input_wait_mask;
IF_NON_BLOCKING_CONNECT (Ctemp = connect_wait_mask);
EMACS_SET_SECS_USECS (timeout, 0, 0);
@@ -5195,23 +5033,23 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
/* getsockopt(,,SO_ERROR,,) is said to hang on some systems.
So only use it on systems where it is known to work. */
{
- int xlen = sizeof(xerrno);
- if (getsockopt(channel, SOL_SOCKET, SO_ERROR, &xerrno, &xlen))
+ int xlen = sizeof (xerrno);
+ if (getsockopt (channel, SOL_SOCKET, SO_ERROR, &xerrno, &xlen))
xerrno = errno;
}
#else
{
struct sockaddr pname;
- int pnamelen = sizeof(pname);
+ int pnamelen = sizeof (pname);
/* If connection failed, getpeername will fail. */
xerrno = 0;
- if (getpeername(channel, &pname, &pnamelen) < 0)
+ if (getpeername (channel, &pname, &pnamelen) < 0)
{
/* Obtain connect failure code through error slippage. */
char dummy;
xerrno = errno;
- if (errno == ENOTCONN && read(channel, &dummy, 1) < 0)
+ if (errno == ENOTCONN && read (channel, &dummy, 1) < 0)
xerrno = errno;
}
}
@@ -5258,15 +5096,13 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
/* Given a list (FUNCTION ARGS...), apply FUNCTION to the ARGS. */
static Lisp_Object
-read_process_output_call (fun_and_args)
- Lisp_Object fun_and_args;
+read_process_output_call (Lisp_Object fun_and_args)
{
return apply1 (XCAR (fun_and_args), XCDR (fun_and_args));
}
static Lisp_Object
-read_process_output_error_handler (error)
- Lisp_Object error;
+read_process_output_error_handler (Lisp_Object error)
{
cmd_error_internal (error, "error in process filter: ");
Vinhibit_quit = Qt;
@@ -5287,9 +5123,7 @@ read_process_output_error_handler (error)
for decoding. */
static int
-read_process_output (proc, channel)
- Lisp_Object proc;
- register int channel;
+read_process_output (Lisp_Object proc, register int channel)
{
register int nbytes;
char *chars;
@@ -5305,7 +5139,7 @@ read_process_output (proc, channel)
chars = (char *) alloca (carryover + readmax);
if (carryover)
/* See the comment above. */
- bcopy (SDATA (p->decoding_buf), chars, carryover);
+ memcpy (chars, SDATA (p->decoding_buf), carryover);
#ifdef DATAGRAM_SOCKETS
/* We have a working select, so proc_buffered_char is always -1. */
@@ -5449,8 +5283,8 @@ read_process_output (proc, channel)
{
if (SCHARS (p->decoding_buf) < coding->carryover_bytes)
p->decoding_buf = make_uninit_string (coding->carryover_bytes);
- bcopy (coding->carryover, SDATA (p->decoding_buf),
- coding->carryover_bytes);
+ memcpy (SDATA (p->decoding_buf), coding->carryover,
+ coding->carryover_bytes);
p->decoding_carryover = coding->carryover_bytes;
}
if (SBYTES (text) > 0)
@@ -5541,8 +5375,8 @@ read_process_output (proc, channel)
{
if (SCHARS (p->decoding_buf) < coding->carryover_bytes)
p->decoding_buf = make_uninit_string (coding->carryover_bytes);
- bcopy (coding->carryover, SDATA (p->decoding_buf),
- coding->carryover_bytes);
+ memcpy (SDATA (p->decoding_buf), coding->carryover,
+ coding->carryover_bytes);
p->decoding_carryover = coding->carryover_bytes;
}
/* Adjust the multibyteness of TEXT to that of the buffer. */
@@ -5599,15 +5433,6 @@ read_process_output (proc, channel)
unbind_to (count, Qnil);
return nbytes;
}
-
-DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, Swaiting_for_user_input_p,
- 0, 0, 0,
- doc: /* Returns non-nil if Emacs is waiting for input from the user.
-This is intended for use by asynchronous process output filters and sentinels. */)
- ()
-{
- return (waiting_for_user_input_p ? Qt : Qnil);
-}
/* Sending data to subprocess */
@@ -5615,7 +5440,7 @@ jmp_buf send_process_frame;
Lisp_Object process_sent_to;
SIGTYPE
-send_process_trap ()
+send_process_trap (int ignore)
{
SIGNAL_THREAD_CHECK (SIGPIPE);
sigunblock (sigmask (SIGPIPE));
@@ -5633,18 +5458,15 @@ send_process_trap ()
This function can evaluate Lisp code and can garbage collect. */
static void
-send_process (proc, buf, len, object)
- volatile Lisp_Object proc;
- unsigned char *volatile buf;
- volatile int len;
- volatile Lisp_Object object;
+send_process (volatile Lisp_Object proc, unsigned char *volatile buf,
+ volatile int len, volatile Lisp_Object object)
{
/* Use volatile to protect variables from being clobbered by longjmp. */
struct Lisp_Process *p = XPROCESS (proc);
int rv;
struct coding_system *coding;
struct gcpro gcpro1;
- SIGTYPE (*volatile old_sigpipe) ();
+ SIGTYPE (*volatile old_sigpipe) (int);
GCPRO1 (object);
@@ -5757,7 +5579,7 @@ send_process (proc, buf, len, object)
while (this > 0)
{
int outfd = p->outfd;
- old_sigpipe = (SIGTYPE (*) ()) signal (SIGPIPE, send_process_trap);
+ old_sigpipe = (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap);
#ifdef DATAGRAM_SOCKETS
if (DATAGRAM_CHAN_P (outfd))
{
@@ -5882,8 +5704,7 @@ Called from program, takes three arguments, PROCESS, START and END.
If the region is more than 500 characters long,
it is sent in several bunches. This may happen even for shorter regions.
Output from processes can arrive in between bunches. */)
- (process, start, end)
- Lisp_Object process, start, end;
+ (Lisp_Object process, Lisp_Object start, Lisp_Object end)
{
Lisp_Object proc;
int start1, end1;
@@ -5910,8 +5731,7 @@ nil, indicating the current buffer's process.
If STRING is more than 500 characters long,
it is sent in several bunches. This may happen even for shorter strings.
Output from processes can arrive in between bunches. */)
- (process, string)
- Lisp_Object process, string;
+ (Lisp_Object process, Lisp_Object string)
{
Lisp_Object proc;
CHECK_STRING (string);
@@ -5924,8 +5744,7 @@ Output from processes can arrive in between bunches. */)
/* Return the foreground process group for the tty/pty that
the process P uses. */
static int
-emacs_get_tty_pgrp (p)
- struct Lisp_Process *p;
+emacs_get_tty_pgrp (struct Lisp_Process *p)
{
int gid = -1;
@@ -5953,8 +5772,7 @@ DEFUN ("process-running-child-p", Fprocess_running_child_p,
doc: /* Return t if PROCESS has given the terminal to a child.
If the operating system does not make it possible to find out,
return t unconditionally. */)
- (process)
- Lisp_Object process;
+ (Lisp_Object process)
{
/* Initialize in case ioctl doesn't exist or gives an error,
in a way that will cause returning t. */
@@ -5994,11 +5812,8 @@ return t unconditionally. */)
their uid, for which killpg would return an EPERM error. */
static void
-process_send_signal (process, signo, current_group, nomsg)
- Lisp_Object process;
- int signo;
- Lisp_Object current_group;
- int nomsg;
+process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group,
+ int nomsg)
{
Lisp_Object proc;
register struct Lisp_Process *p;
@@ -6218,8 +6033,7 @@ rather than the shell.
If CURRENT-GROUP is `lambda', and if the shell owns the terminal,
don't send the signal. */)
- (process, current_group)
- Lisp_Object process, current_group;
+ (Lisp_Object process, Lisp_Object current_group)
{
process_send_signal (process, SIGINT, current_group, 0);
return process;
@@ -6228,8 +6042,7 @@ don't send the signal. */)
DEFUN ("kill-process", Fkill_process, Skill_process, 0, 2, 0,
doc: /* Kill process PROCESS. May be process or name of one.
See function `interrupt-process' for more details on usage. */)
- (process, current_group)
- Lisp_Object process, current_group;
+ (Lisp_Object process, Lisp_Object current_group)
{
process_send_signal (process, SIGKILL, current_group, 0);
return process;
@@ -6238,8 +6051,7 @@ See function `interrupt-process' for more details on usage. */)
DEFUN ("quit-process", Fquit_process, Squit_process, 0, 2, 0,
doc: /* Send QUIT signal to process PROCESS. May be process or name of one.
See function `interrupt-process' for more details on usage. */)
- (process, current_group)
- Lisp_Object process, current_group;
+ (Lisp_Object process, Lisp_Object current_group)
{
process_send_signal (process, SIGQUIT, current_group, 0);
return process;
@@ -6250,8 +6062,7 @@ DEFUN ("stop-process", Fstop_process, Sstop_process, 0, 2, 0,
See function `interrupt-process' for more details on usage.
If PROCESS is a network or serial process, inhibit handling of incoming
traffic. */)
- (process, current_group)
- Lisp_Object process, current_group;
+ (Lisp_Object process, Lisp_Object current_group)
{
#ifdef HAVE_SOCKETS
if (PROCESSP (process) && (NETCONN_P (process) || SERIALCONN_P (process)))
@@ -6282,8 +6093,7 @@ DEFUN ("continue-process", Fcontinue_process, Scontinue_process, 0, 2, 0,
See function `interrupt-process' for more details on usage.
If PROCESS is a network or serial process, resume handling of incoming
traffic. */)
- (process, current_group)
- Lisp_Object process, current_group;
+ (Lisp_Object process, Lisp_Object current_group)
{
#ifdef HAVE_SOCKETS
if (PROCESSP (process) && (NETCONN_P (process) || SERIALCONN_P (process)))
@@ -6324,8 +6134,7 @@ PROCESS may also be a number specifying the process id of the
process to signal; in this case, the process need not be a child of
this Emacs.
SIGCODE may be an integer, or a symbol whose name is a signal name. */)
- (process, sigcode)
- Lisp_Object process, sigcode;
+ (Lisp_Object process, Lisp_Object sigcode)
{
pid_t pid;
@@ -6378,7 +6187,7 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
CHECK_SYMBOL (sigcode);
name = SDATA (SYMBOL_NAME (sigcode));
- if (!strncmp(name, "SIG", 3) || !strncmp(name, "sig", 3))
+ if (!strncmp (name, "SIG", 3) || !strncmp (name, "sig", 3))
name += 3;
if (0)
@@ -6492,8 +6301,7 @@ through a pipe (as opposed to a pty), then you cannot send any more
text to PROCESS after you call this function.
If PROCESS is a serial process, wait until all output written to the
process has been transmitted to the serial port. */)
- (process)
- Lisp_Object process;
+ (Lisp_Object process)
{
Lisp_Object proc;
struct coding_system *coding;
@@ -6552,39 +6360,16 @@ process has been transmitted to the serial port. */)
if (!proc_encode_coding_system[new_outfd])
proc_encode_coding_system[new_outfd]
= (struct coding_system *) xmalloc (sizeof (struct coding_system));
- bcopy (proc_encode_coding_system[old_outfd],
- proc_encode_coding_system[new_outfd],
- sizeof (struct coding_system));
- bzero (proc_encode_coding_system[old_outfd],
- sizeof (struct coding_system));
+ memcpy (proc_encode_coding_system[new_outfd],
+ proc_encode_coding_system[old_outfd],
+ sizeof (struct coding_system));
+ memset (proc_encode_coding_system[old_outfd], 0,
+ sizeof (struct coding_system));
XPROCESS (proc)->outfd = new_outfd;
}
return process;
}
-
-/* Kill all processes associated with `buffer'.
- If `buffer' is nil, kill all processes */
-
-void
-kill_buffer_processes (buffer)
- Lisp_Object buffer;
-{
- Lisp_Object tail, proc;
-
- for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
- {
- proc = XCDR (XCAR (tail));
- if (PROCESSP (proc)
- && (NILP (buffer) || EQ (XPROCESS (proc)->buffer, buffer)))
- {
- if (NETCONN_P (proc) || SERIALCONN_P (proc))
- Fdelete_process (proc);
- else if (XPROCESS (proc)->infd >= 0)
- process_send_signal (proc, SIGHUP, Qnil, 1);
- }
- }
-}
/* On receipt of a signal that a child status has changed, loop asking
about children with changed statuses until the system says there
@@ -6613,8 +6398,7 @@ kill_buffer_processes (buffer)
#ifdef SIGCHLD
SIGTYPE
-sigchld_handler (signo)
- int signo;
+sigchld_handler (int signo)
{
int old_errno = errno;
Lisp_Object proc;
@@ -6755,16 +6539,14 @@ sigchld_handler (signo)
static Lisp_Object
-exec_sentinel_unwind (data)
- Lisp_Object data;
+exec_sentinel_unwind (Lisp_Object data)
{
XPROCESS (XCAR (data))->sentinel = XCDR (data);
return Qnil;
}
static Lisp_Object
-exec_sentinel_error_handler (error)
- Lisp_Object error;
+exec_sentinel_error_handler (Lisp_Object error)
{
cmd_error_internal (error, "error in process sentinel: ");
Vinhibit_quit = Qt;
@@ -6774,8 +6556,7 @@ exec_sentinel_error_handler (error)
}
static void
-exec_sentinel (proc, reason)
- Lisp_Object proc, reason;
+exec_sentinel (Lisp_Object proc, Lisp_Object reason)
{
Lisp_Object sentinel, obuffer, odeactivate, okeymap;
register struct Lisp_Process *p = XPROCESS (proc);
@@ -6860,8 +6641,7 @@ exec_sentinel (proc, reason)
but can be done at other times. */
static void
-status_notify (deleting_process)
- struct Lisp_Process *deleting_process;
+status_notify (struct Lisp_Process *deleting_process)
{
register Lisp_Object proc, buffer;
Lisp_Object tail, msg;
@@ -6988,8 +6768,7 @@ DEFUN ("set-process-coding-system", Fset_process_coding_system,
doc: /* Set coding systems of PROCESS to DECODING and ENCODING.
DECODING will be used to decode subprocess output and ENCODING to
encode subprocess input. */)
- (process, decoding, encoding)
- register Lisp_Object process, decoding, encoding;
+ (register Lisp_Object process, Lisp_Object decoding, Lisp_Object encoding)
{
register struct Lisp_Process *p;
@@ -7012,8 +6791,7 @@ encode subprocess input. */)
DEFUN ("process-coding-system",
Fprocess_coding_system, Sprocess_coding_system, 1, 1, 0,
doc: /* Return a cons of coding systems for decoding and encoding of PROCESS. */)
- (process)
- register Lisp_Object process;
+ (register Lisp_Object process)
{
CHECK_PROCESS (process);
return Fcons (XPROCESS (process)->decode_coding_system,
@@ -7027,8 +6805,7 @@ If FLAG is non-nil, the filter is given multibyte strings.
If FLAG is nil, the filter is given unibyte strings. In this case,
all character code conversion except for end-of-line conversion is
suppressed. */)
- (process, flag)
- Lisp_Object process, flag;
+ (Lisp_Object process, Lisp_Object flag)
{
register struct Lisp_Process *p;
@@ -7044,8 +6821,7 @@ suppressed. */)
DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p,
Sprocess_filter_multibyte_p, 1, 1, 0,
doc: /* Return t if a multibyte string is given to PROCESS's filter.*/)
- (process)
- Lisp_Object process;
+ (Lisp_Object process)
{
register struct Lisp_Process *p;
struct coding_system *coding;
@@ -7058,23 +6834,11 @@ DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p,
-/* Add DESC to the set of keyboard input descriptors. */
-
-void
-add_keyboard_wait_descriptor (desc)
- int desc;
-{
- FD_SET (desc, &input_wait_mask);
- FD_SET (desc, &non_process_wait_mask);
- if (desc > max_keyboard_desc)
- max_keyboard_desc = desc;
-}
static int add_gpm_wait_descriptor_called_flag;
void
-add_gpm_wait_descriptor (desc)
- int desc;
+add_gpm_wait_descriptor (int desc)
{
if (! add_gpm_wait_descriptor_called_flag)
FD_CLR (0, &input_wait_mask);
@@ -7085,29 +6849,8 @@ add_gpm_wait_descriptor (desc)
max_gpm_desc = desc;
}
-/* From now on, do not expect DESC to give keyboard input. */
-
void
-delete_keyboard_wait_descriptor (desc)
- int desc;
-{
- int fd;
- int lim = max_keyboard_desc;
-
- FD_CLR (desc, &input_wait_mask);
- FD_CLR (desc, &non_process_wait_mask);
-
- if (desc == max_keyboard_desc)
- for (fd = 0; fd < lim; fd++)
- if (FD_ISSET (fd, &input_wait_mask)
- && !FD_ISSET (fd, &non_keyboard_wait_mask)
- && !FD_ISSET (fd, &gpm_wait_mask))
- max_keyboard_desc = fd;
-}
-
-void
-delete_gpm_wait_descriptor (desc)
- int desc;
+delete_gpm_wait_descriptor (int desc)
{
int fd;
int lim = max_gpm_desc;
@@ -7127,8 +6870,7 @@ delete_gpm_wait_descriptor (desc)
that corresponds to one of the keyboard input descriptors. */
static int
-keyboard_bit_set (mask)
- SELECT_TYPE *mask;
+keyboard_bit_set (fd_set *mask)
{
int fd;
@@ -7139,6 +6881,432 @@ keyboard_bit_set (mask)
return 0;
}
+
+#else /* not subprocesses */
+
+/* Defined on msdos.c. */
+extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *,
+ EMACS_TIME *);
+
+/* Implementation of wait_reading_process_output, assuming that there
+ are no subprocesses. Used only by the MS-DOS build.
+
+ Wait for timeout to elapse and/or keyboard input to be available.
+
+ time_limit is:
+ timeout in seconds, or
+ zero for no limit, or
+ -1 means gobble data immediately available but don't wait for any.
+
+ read_kbd is a Lisp_Object:
+ 0 to ignore keyboard input, or
+ 1 to return when input is available, or
+ -1 means caller will actually read the input, so don't throw to
+ the quit handler.
+
+ see full version for other parameters. We know that wait_proc will
+ always be NULL, since `subprocesses' isn't defined.
+
+ do_display != 0 means redisplay should be done to show subprocess
+ output that arrives.
+
+ Return true if we received input from any process. */
+
+int
+wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
+ int do_display,
+ Lisp_Object wait_for_cell,
+ struct Lisp_Process *wait_proc, int just_wait_proc)
+{
+ register int nfds;
+ EMACS_TIME end_time, timeout;
+ SELECT_TYPE waitchannels;
+ int xerrno;
+
+ /* What does time_limit really mean? */
+ if (time_limit || microsecs)
+ {
+ EMACS_GET_TIME (end_time);
+ EMACS_SET_SECS_USECS (timeout, time_limit, microsecs);
+ EMACS_ADD_TIME (end_time, end_time, timeout);
+ }
+
+ /* Turn off periodic alarms (in case they are in use)
+ and then turn off any other atimers,
+ because the select emulator uses alarms. */
+ stop_polling ();
+ turn_on_atimers (0);
+
+ while (1)
+ {
+ int timeout_reduced_for_timers = 0;
+
+ /* If calling from keyboard input, do not quit
+ since we want to return C-g as an input character.
+ Otherwise, do pending quit if requested. */
+ if (read_kbd >= 0)
+ QUIT;
+
+ /* Exit now if the cell we're waiting for became non-nil. */
+ if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
+ break;
+
+ /* Compute time from now till when time limit is up */
+ /* Exit if already run out */
+ if (time_limit == -1)
+ {
+ /* -1 specified for timeout means
+ gobble output available now
+ but don't wait at all. */
+
+ EMACS_SET_SECS_USECS (timeout, 0, 0);
+ }
+ else if (time_limit || microsecs)
+ {
+ EMACS_GET_TIME (timeout);
+ EMACS_SUB_TIME (timeout, end_time, timeout);
+ if (EMACS_TIME_NEG_P (timeout))
+ break;
+ }
+ else
+ {
+ EMACS_SET_SECS_USECS (timeout, 100000, 0);
+ }
+
+ /* If our caller will not immediately handle keyboard events,
+ run timer events directly.
+ (Callers that will immediately read keyboard events
+ call timer_delay on their own.) */
+ if (NILP (wait_for_cell))
+ {
+ EMACS_TIME timer_delay;
+
+ do
+ {
+ int old_timers_run = timers_run;
+ timer_delay = timer_check (1);
+ if (timers_run != old_timers_run && do_display)
+ /* We must retry, since a timer may have requeued itself
+ and that could alter the time delay. */
+ redisplay_preserve_echo_area (14);
+ else
+ break;
+ }
+ while (!detect_input_pending ());
+
+ /* If there is unread keyboard input, also return. */
+ if (read_kbd != 0
+ && requeued_events_pending_p ())
+ break;
+
+ if (! EMACS_TIME_NEG_P (timer_delay) && time_limit != -1)
+ {
+ EMACS_TIME difference;
+ EMACS_SUB_TIME (difference, timer_delay, timeout);
+ if (EMACS_TIME_NEG_P (difference))
+ {
+ timeout = timer_delay;
+ timeout_reduced_for_timers = 1;
+ }
+ }
+ }
+
+ /* Cause C-g and alarm signals to take immediate action,
+ and cause input available signals to zero out timeout. */
+ if (read_kbd < 0)
+ set_waiting_for_input (&timeout);
+
+ /* Wait till there is something to do. */
+
+ if (! read_kbd && NILP (wait_for_cell))
+ FD_ZERO (&waitchannels);
+ else
+ FD_SET (0, &waitchannels);
+
+ /* If a frame has been newly mapped and needs updating,
+ reprocess its display stuff. */
+ if (frame_garbaged && do_display)
+ {
+ clear_waiting_for_input ();
+ redisplay_preserve_echo_area (15);
+ if (read_kbd < 0)
+ set_waiting_for_input (&timeout);
+ }
+
+ if (read_kbd && detect_input_pending ())
+ {
+ nfds = 0;
+ FD_ZERO (&waitchannels);
+ }
+ else
+ nfds = select (1, &waitchannels, (SELECT_TYPE *)0, (SELECT_TYPE *)0,
+ &timeout);
+
+ xerrno = errno;
+
+ /* Make C-g and alarm signals set flags again */
+ clear_waiting_for_input ();
+
+ /* If we woke up due to SIGWINCH, actually change size now. */
+ do_pending_window_change (0);
+
+ if (time_limit && nfds == 0 && ! timeout_reduced_for_timers)
+ /* We waited the full specified time, so return now. */
+ break;
+
+ if (nfds == -1)
+ {
+ /* If the system call was interrupted, then go around the
+ loop again. */
+ if (xerrno == EINTR)
+ FD_ZERO (&waitchannels);
+ else
+ error ("select error: %s", emacs_strerror (xerrno));
+ }
+
+ /* Check for keyboard input */
+
+ if (read_kbd
+ && detect_input_pending_run_timers (do_display))
+ {
+ swallow_events (do_display);
+ if (detect_input_pending_run_timers (do_display))
+ break;
+ }
+
+ /* If there is unread keyboard input, also return. */
+ if (read_kbd
+ && requeued_events_pending_p ())
+ break;
+
+ /* If wait_for_cell. check for keyboard input
+ but don't run any timers.
+ ??? (It seems wrong to me to check for keyboard
+ input at all when wait_for_cell, but the code
+ has been this way since July 1994.
+ Try changing this after version 19.31.) */
+ if (! NILP (wait_for_cell)
+ && detect_input_pending ())
+ {
+ swallow_events (do_display);
+ if (detect_input_pending ())
+ break;
+ }
+
+ /* Exit now if the cell we're waiting for became non-nil. */
+ if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
+ break;
+ }
+
+ start_polling ();
+
+ return 0;
+}
+
+#endif /* not subprocesses */
+
+/* The following functions are needed even if async subprocesses are
+ not supported. Some of them are no-op stubs in that case. */
+
+/* Add DESC to the set of keyboard input descriptors. */
+
+void
+add_keyboard_wait_descriptor (int desc)
+{
+#ifdef subprocesses
+ FD_SET (desc, &input_wait_mask);
+ FD_SET (desc, &non_process_wait_mask);
+ if (desc > max_keyboard_desc)
+ max_keyboard_desc = desc;
+#endif
+}
+
+/* From now on, do not expect DESC to give keyboard input. */
+
+void
+delete_keyboard_wait_descriptor (int desc)
+{
+#ifdef subprocesses
+ int fd;
+ int lim = max_keyboard_desc;
+
+ FD_CLR (desc, &input_wait_mask);
+ FD_CLR (desc, &non_process_wait_mask);
+
+ if (desc == max_keyboard_desc)
+ for (fd = 0; fd < lim; fd++)
+ if (FD_ISSET (fd, &input_wait_mask)
+ && !FD_ISSET (fd, &non_keyboard_wait_mask)
+ && !FD_ISSET (fd, &gpm_wait_mask))
+ max_keyboard_desc = fd;
+#endif /* subprocesses */
+}
+
+/* Setup coding systems of PROCESS. */
+
+void
+setup_process_coding_systems (Lisp_Object process)
+{
+#ifdef subprocesses
+ struct Lisp_Process *p = XPROCESS (process);
+ int inch = p->infd;
+ int outch = p->outfd;
+ Lisp_Object coding_system;
+
+ if (inch < 0 || outch < 0)
+ return;
+
+ if (!proc_decode_coding_system[inch])
+ proc_decode_coding_system[inch]
+ = (struct coding_system *) xmalloc (sizeof (struct coding_system));
+ coding_system = p->decode_coding_system;
+ if (! NILP (p->filter))
+ ;
+ else if (BUFFERP (p->buffer))
+ {
+ if (NILP (XBUFFER (p->buffer)->enable_multibyte_characters))
+ coding_system = raw_text_coding_system (coding_system);
+ }
+ setup_coding_system (coding_system, proc_decode_coding_system[inch]);
+
+ if (!proc_encode_coding_system[outch])
+ proc_encode_coding_system[outch]
+ = (struct coding_system *) xmalloc (sizeof (struct coding_system));
+ setup_coding_system (p->encode_coding_system,
+ proc_encode_coding_system[outch]);
+#endif
+}
+
+/* Close all descriptors currently in use for communication
+ with subprocess. This is used in a newly-forked subprocess
+ to get rid of irrelevant descriptors. */
+
+void
+close_process_descs (void)
+{
+#ifndef DOS_NT
+ int i;
+ for (i = 0; i < MAXDESC; i++)
+ {
+ Lisp_Object process;
+ process = chan_process[i];
+ if (!NILP (process))
+ {
+ int in = XPROCESS (process)->infd;
+ int out = XPROCESS (process)->outfd;
+ if (in >= 0)
+ emacs_close (in);
+ if (out >= 0 && in != out)
+ emacs_close (out);
+ }
+ }
+#endif
+}
+
+DEFUN ("get-buffer-process", Fget_buffer_process, Sget_buffer_process, 1, 1, 0,
+ doc: /* Return the (or a) process associated with BUFFER.
+BUFFER may be a buffer or the name of one. */)
+ (register Lisp_Object buffer)
+{
+#ifdef subprocesses
+ register Lisp_Object buf, tail, proc;
+
+ if (NILP (buffer)) return Qnil;
+ buf = Fget_buffer (buffer);
+ if (NILP (buf)) return Qnil;
+
+ for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
+ {
+ proc = Fcdr (XCAR (tail));
+ if (PROCESSP (proc) && EQ (XPROCESS (proc)->buffer, buf))
+ return proc;
+ }
+#endif /* subprocesses */
+ return Qnil;
+}
+
+DEFUN ("process-inherit-coding-system-flag",
+ Fprocess_inherit_coding_system_flag, Sprocess_inherit_coding_system_flag,
+ 1, 1, 0,
+ doc: /* Return the value of inherit-coding-system flag for PROCESS.
+If this flag is t, `buffer-file-coding-system' of the buffer
+associated with PROCESS will inherit the coding system used to decode
+the process output. */)
+ (register Lisp_Object process)
+{
+#ifdef subprocesses
+ CHECK_PROCESS (process);
+ return XPROCESS (process)->inherit_coding_system_flag ? Qt : Qnil;
+#else
+ /* Ignore the argument and return the value of
+ inherit-process-coding-system. */
+ return inherit_process_coding_system ? Qt : Qnil;
+#endif
+}
+
+/* Kill all processes associated with `buffer'.
+ If `buffer' is nil, kill all processes */
+
+void
+kill_buffer_processes (Lisp_Object buffer)
+{
+#ifdef subprocesses
+ Lisp_Object tail, proc;
+
+ for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
+ {
+ proc = XCDR (XCAR (tail));
+ if (PROCESSP (proc)
+ && (NILP (buffer) || EQ (XPROCESS (proc)->buffer, buffer)))
+ {
+ if (NETCONN_P (proc) || SERIALCONN_P (proc))
+ Fdelete_process (proc);
+ else if (XPROCESS (proc)->infd >= 0)
+ process_send_signal (proc, SIGHUP, Qnil, 1);
+ }
+ }
+#else /* subprocesses */
+ /* Since we have no subprocesses, this does nothing. */
+#endif /* subprocesses */
+}
+
+DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, Swaiting_for_user_input_p,
+ 0, 0, 0,
+ doc: /* Returns non-nil if Emacs is waiting for input from the user.
+This is intended for use by asynchronous process output filters and sentinels. */)
+ (void)
+{
+#ifdef subprocesses
+ return (waiting_for_user_input_p ? Qt : Qnil);
+#else
+ return Qnil;
+#endif
+}
+
+/* Stop reading input from keyboard sources. */
+
+void
+hold_keyboard_input (void)
+{
+ kbd_is_on_hold = 1;
+}
+
+/* Resume reading input from keyboard sources. */
+
+void
+unhold_keyboard_input (void)
+{
+ kbd_is_on_hold = 0;
+}
+
+/* Return non-zero if keyboard input is on hold, zero otherwise. */
+
+int
+kbd_on_hold_p (void)
+{
+ return kbd_is_on_hold;
+}
+
/* Enumeration of and access to system processes a-la ps(1). */
@@ -7148,7 +7316,7 @@ DEFUN ("list-system-processes", Flist_system_processes, Slist_system_processes,
If this functionality is unsupported, return nil.
See `process-attributes' for getting attributes of a process given its ID. */)
- ()
+ (void)
{
return list_system_processes ();
}
@@ -7204,16 +7372,16 @@ integer or floating point values.
pmem -- percents of total physical memory used by process's resident set
(floating-point number)
args -- command line which invoked the process (string). */)
- (pid)
-
- Lisp_Object pid;
+ ( Lisp_Object pid)
{
return system_process_attributes (pid);
}
+
void
-init_process ()
+init_process (void)
{
+#ifdef subprocesses
register int i;
inhibit_sentinels = 0;
@@ -7256,10 +7424,10 @@ init_process ()
chan_process[i] = Qnil;
proc_buffered_char[i] = -1;
}
- bzero (proc_decode_coding_system, sizeof proc_decode_coding_system);
- bzero (proc_encode_coding_system, sizeof proc_encode_coding_system);
+ memset (proc_decode_coding_system, 0, sizeof proc_decode_coding_system);
+ memset (proc_encode_coding_system, 0, sizeof proc_encode_coding_system);
#ifdef DATAGRAM_SOCKETS
- bzero (datagram_address, sizeof datagram_address);
+ memset (datagram_address, 0, sizeof datagram_address);
#endif
#ifdef HAVE_SOCKETS
@@ -7305,18 +7473,22 @@ init_process ()
processes. As such, we only change the default value. */
if (initialized)
{
- char *release = get_operating_system_release();
+ char *release = get_operating_system_release ();
if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION
&& release[1] == '.')) {
Vprocess_connection_type = Qnil;
}
}
#endif
+#endif /* subprocesses */
+ kbd_is_on_hold = 0;
}
void
-syms_of_process ()
+syms_of_process (void)
{
+#ifdef subprocesses
+
Qprocessp = intern_c_string ("processp");
staticpro (&Qprocessp);
Qrun = intern_c_string ("run");
@@ -7387,17 +7559,12 @@ syms_of_process ()
staticpro (&Qnetwork);
Qserial = intern_c_string ("serial");
staticpro (&Qserial);
-
- QCname = intern_c_string (":name");
- staticpro (&QCname);
QCbuffer = intern_c_string (":buffer");
staticpro (&QCbuffer);
QChost = intern_c_string (":host");
staticpro (&QChost);
QCservice = intern_c_string (":service");
staticpro (&QCservice);
- QCtype = intern_c_string (":type");
- staticpro (&QCtype);
QClocal = intern_c_string (":local");
staticpro (&QClocal);
QCremote = intern_c_string (":remote");
@@ -7429,6 +7596,13 @@ syms_of_process ()
staticpro (&deleted_pid_list);
#endif
+#endif /* subprocesses */
+
+ QCname = intern_c_string (":name");
+ staticpro (&QCname);
+ QCtype = intern_c_string (":type");
+ staticpro (&QCtype);
+
Qeuid = intern_c_string ("euid");
staticpro (&Qeuid);
Qegid = intern_c_string ("egid");
@@ -7498,6 +7672,7 @@ A value of nil means don't delete them until `list-processes' is run. */);
delete_exited_processes = 1;
+#ifdef subprocesses
DEFVAR_LISP ("process-connection-type", &Vprocess_connection_type,
doc: /* Control type of device used to communicate with subprocesses.
Values are nil to use a pipe, or t or `pty' to use a pty.
@@ -7522,7 +7697,6 @@ The variable takes effect when `start-process' is called. */);
defsubr (&Sprocessp);
defsubr (&Sget_process);
- defsubr (&Sget_buffer_process);
defsubr (&Sdelete_process);
defsubr (&Sprocess_status);
defsubr (&Sprocess_exit_status);
@@ -7539,7 +7713,6 @@ The variable takes effect when `start-process' is called. */);
defsubr (&Sprocess_sentinel);
defsubr (&Sset_process_window_size);
defsubr (&Sset_process_inherit_coding_system_flag);
- defsubr (&Sprocess_inherit_coding_system_flag);
defsubr (&Sset_process_query_on_exit_flag);
defsubr (&Sprocess_query_on_exit_flag);
defsubr (&Sprocess_contact);
@@ -7586,449 +7759,8 @@ The variable takes effect when `start-process' is called. */);
defsubr (&Sprocess_coding_system);
defsubr (&Sset_process_filter_multibyte);
defsubr (&Sprocess_filter_multibyte_p);
- defsubr (&Slist_system_processes);
- defsubr (&Sprocess_attributes);
-}
-
-
-#else /* not subprocesses */
-
-#include <sys/types.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <setjmp.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include "lisp.h"
-#include "systime.h"
-#include "character.h"
-#include "coding.h"
-#include "termopts.h"
-#include "sysselect.h"
-
-extern int frame_garbaged;
-
-extern EMACS_TIME timer_check ();
-extern int timers_run;
-
-Lisp_Object QCtype, QCname;
-
-Lisp_Object Qeuid, Qegid, Qcomm, Qstate, Qppid, Qpgrp, Qsess, Qttname, Qtpgid;
-Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime, Qcstime;
-Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs;
-Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtime, Qctime;
-
-/* As described above, except assuming that there are no subprocesses:
-
- Wait for timeout to elapse and/or keyboard input to be available.
-
- time_limit is:
- timeout in seconds, or
- zero for no limit, or
- -1 means gobble data immediately available but don't wait for any.
-
- read_kbd is a Lisp_Object:
- 0 to ignore keyboard input, or
- 1 to return when input is available, or
- -1 means caller will actually read the input, so don't throw to
- the quit handler.
-
- see full version for other parameters. We know that wait_proc will
- always be NULL, since `subprocesses' isn't defined.
-
- do_display != 0 means redisplay should be done to show subprocess
- output that arrives.
-
- Return true if we received input from any process. */
-
-int
-wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
- wait_for_cell, wait_proc, just_wait_proc)
- int time_limit, microsecs, read_kbd, do_display;
- Lisp_Object wait_for_cell;
- struct Lisp_Process *wait_proc;
- int just_wait_proc;
-{
- register int nfds;
- EMACS_TIME end_time, timeout;
- SELECT_TYPE waitchannels;
- int xerrno;
-
- /* What does time_limit really mean? */
- if (time_limit || microsecs)
- {
- EMACS_GET_TIME (end_time);
- EMACS_SET_SECS_USECS (timeout, time_limit, microsecs);
- EMACS_ADD_TIME (end_time, end_time, timeout);
- }
-
- /* Turn off periodic alarms (in case they are in use)
- and then turn off any other atimers,
- because the select emulator uses alarms. */
- stop_polling ();
- turn_on_atimers (0);
-
- while (1)
- {
- int timeout_reduced_for_timers = 0;
-
- /* If calling from keyboard input, do not quit
- since we want to return C-g as an input character.
- Otherwise, do pending quit if requested. */
- if (read_kbd >= 0)
- QUIT;
- /* Exit now if the cell we're waiting for became non-nil. */
- if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
- break;
-
- /* Compute time from now till when time limit is up */
- /* Exit if already run out */
- if (time_limit == -1)
- {
- /* -1 specified for timeout means
- gobble output available now
- but don't wait at all. */
-
- EMACS_SET_SECS_USECS (timeout, 0, 0);
- }
- else if (time_limit || microsecs)
- {
- EMACS_GET_TIME (timeout);
- EMACS_SUB_TIME (timeout, end_time, timeout);
- if (EMACS_TIME_NEG_P (timeout))
- break;
- }
- else
- {
- EMACS_SET_SECS_USECS (timeout, 100000, 0);
- }
-
- /* If our caller will not immediately handle keyboard events,
- run timer events directly.
- (Callers that will immediately read keyboard events
- call timer_delay on their own.) */
- if (NILP (wait_for_cell))
- {
- EMACS_TIME timer_delay;
-
- do
- {
- int old_timers_run = timers_run;
- timer_delay = timer_check (1);
- if (timers_run != old_timers_run && do_display)
- /* We must retry, since a timer may have requeued itself
- and that could alter the time delay. */
- redisplay_preserve_echo_area (14);
- else
- break;
- }
- while (!detect_input_pending ());
-
- /* If there is unread keyboard input, also return. */
- if (read_kbd != 0
- && requeued_events_pending_p ())
- break;
-
- if (! EMACS_TIME_NEG_P (timer_delay) && time_limit != -1)
- {
- EMACS_TIME difference;
- EMACS_SUB_TIME (difference, timer_delay, timeout);
- if (EMACS_TIME_NEG_P (difference))
- {
- timeout = timer_delay;
- timeout_reduced_for_timers = 1;
- }
- }
- }
-
- /* Cause C-g and alarm signals to take immediate action,
- and cause input available signals to zero out timeout. */
- if (read_kbd < 0)
- set_waiting_for_input (&timeout);
-
- /* Wait till there is something to do. */
-
- if (! read_kbd && NILP (wait_for_cell))
- FD_ZERO (&waitchannels);
- else
- FD_SET (0, &waitchannels);
-
- /* If a frame has been newly mapped and needs updating,
- reprocess its display stuff. */
- if (frame_garbaged && do_display)
- {
- clear_waiting_for_input ();
- redisplay_preserve_echo_area (15);
- if (read_kbd < 0)
- set_waiting_for_input (&timeout);
- }
-
- if (read_kbd && detect_input_pending ())
- {
- nfds = 0;
- FD_ZERO (&waitchannels);
- }
- else
- nfds = select (1, &waitchannels, (SELECT_TYPE *)0, (SELECT_TYPE *)0,
- &timeout);
-
- xerrno = errno;
-
- /* Make C-g and alarm signals set flags again */
- clear_waiting_for_input ();
-
- /* If we woke up due to SIGWINCH, actually change size now. */
- do_pending_window_change (0);
-
- if (time_limit && nfds == 0 && ! timeout_reduced_for_timers)
- /* We waited the full specified time, so return now. */
- break;
-
- if (nfds == -1)
- {
- /* If the system call was interrupted, then go around the
- loop again. */
- if (xerrno == EINTR)
- FD_ZERO (&waitchannels);
- else
- error ("select error: %s", emacs_strerror (xerrno));
- }
-#ifdef SOLARIS2
- else if (nfds > 0 && (waitchannels & 1) && interrupt_input)
- /* System sometimes fails to deliver SIGIO. */
- kill (getpid (), SIGIO);
-#endif
-#ifdef SIGIO
- if (read_kbd && interrupt_input && (waitchannels & 1))
- kill (getpid (), SIGIO);
-#endif
-
- /* Check for keyboard input */
-
- if (read_kbd
- && detect_input_pending_run_timers (do_display))
- {
- swallow_events (do_display);
- if (detect_input_pending_run_timers (do_display))
- break;
- }
-
- /* If there is unread keyboard input, also return. */
- if (read_kbd
- && requeued_events_pending_p ())
- break;
-
- /* If wait_for_cell. check for keyboard input
- but don't run any timers.
- ??? (It seems wrong to me to check for keyboard
- input at all when wait_for_cell, but the code
- has been this way since July 1994.
- Try changing this after version 19.31.) */
- if (! NILP (wait_for_cell)
- && detect_input_pending ())
- {
- swallow_events (do_display);
- if (detect_input_pending ())
- break;
- }
-
- /* Exit now if the cell we're waiting for became non-nil. */
- if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
- break;
- }
-
- start_polling ();
-
- return 0;
-}
-
-
-/* Don't confuse make-docfile by having two doc strings for this function.
- make-docfile does not pay attention to #if, for good reason! */
-DEFUN ("get-buffer-process", Fget_buffer_process, Sget_buffer_process, 1, 1, 0,
- 0)
- (name)
- register Lisp_Object name;
-{
- return Qnil;
-}
-
- /* Don't confuse make-docfile by having two doc strings for this function.
- make-docfile does not pay attention to #if, for good reason! */
-DEFUN ("process-inherit-coding-system-flag",
- Fprocess_inherit_coding_system_flag, Sprocess_inherit_coding_system_flag,
- 1, 1, 0,
- 0)
- (process)
- register Lisp_Object process;
-{
- /* Ignore the argument and return the value of
- inherit-process-coding-system. */
- return inherit_process_coding_system ? Qt : Qnil;
-}
-
-/* Kill all processes associated with `buffer'.
- If `buffer' is nil, kill all processes.
- Since we have no subprocesses, this does nothing. */
-
-void
-kill_buffer_processes (buffer)
- Lisp_Object buffer;
-{
-}
-
-DEFUN ("list-system-processes", Flist_system_processes, Slist_system_processes,
- 0, 0, 0,
- doc: /* Return a list of numerical process IDs of all running processes.
-If this functionality is unsupported, return nil.
-
-See `process-attributes' for getting attributes of a process given its ID. */)
- ()
-{
- return list_system_processes ();
-}
-
-DEFUN ("process-attributes", Fprocess_attributes,
- Sprocess_attributes, 1, 1, 0,
- doc: /* Return attributes of the process given by its PID, a number.
-
-Value is an alist where each element is a cons cell of the form
-
- \(KEY . VALUE)
-
-If this functionality is unsupported, the value is nil.
-
-See `list-system-processes' for getting a list of all process IDs.
-
-The KEYs of the attributes that this function may return are listed
-below, together with the type of the associated VALUE (in parentheses).
-Not all platforms support all of these attributes; unsupported
-attributes will not appear in the returned alist.
-Unless explicitly indicated otherwise, numbers can have either
-integer or floating point values.
-
- euid -- Effective user User ID of the process (number)
- user -- User name corresponding to euid (string)
- egid -- Effective user Group ID of the process (number)
- group -- Group name corresponding to egid (string)
- comm -- Command name (executable name only) (string)
- state -- Process state code, such as "S", "R", or "T" (string)
- ppid -- Parent process ID (number)
- pgrp -- Process group ID (number)
- sess -- Session ID, i.e. process ID of session leader (number)
- ttname -- Controlling tty name (string)
- tpgid -- ID of foreground process group on the process's tty (number)
- minflt -- number of minor page faults (number)
- majflt -- number of major page faults (number)
- cminflt -- cumulative number of minor page faults (number)
- cmajflt -- cumulative number of major page faults (number)
- utime -- user time used by the process, in the (HIGH LOW USEC) format
- stime -- system time used by the process, in the (HIGH LOW USEC) format
- time -- sum of utime and stime, in the (HIGH LOW USEC) format
- cutime -- user time used by the process and its children, (HIGH LOW USEC)
- cstime -- system time used by the process and its children, (HIGH LOW USEC)
- ctime -- sum of cutime and cstime, in the (HIGH LOW USEC) format
- pri -- priority of the process (number)
- nice -- nice value of the process (number)
- thcount -- process thread count (number)
- start -- time the process started, in the (HIGH LOW USEC) format
- vsize -- virtual memory size of the process in KB's (number)
- rss -- resident set size of the process in KB's (number)
- etime -- elapsed time the process is running, in (HIGH LOW USEC) format
- pcpu -- percents of CPU time used by the process (floating-point number)
- pmem -- percents of total physical memory used by process's resident set
- (floating-point number)
- args -- command line which invoked the process (string). */)
- (pid)
-
- Lisp_Object pid;
-{
- return system_process_attributes (pid);
-}
-
-void
-init_process ()
-{
-}
-
-void
-syms_of_process ()
-{
- QCtype = intern_c_string (":type");
- staticpro (&QCtype);
- QCname = intern_c_string (":name");
- staticpro (&QCname);
- QCtype = intern_c_string (":type");
- staticpro (&QCtype);
- QCname = intern_c_string (":name");
- staticpro (&QCname);
- Qeuid = intern_c_string ("euid");
- staticpro (&Qeuid);
- Qegid = intern_c_string ("egid");
- staticpro (&Qegid);
- Quser = intern_c_string ("user");
- staticpro (&Quser);
- Qgroup = intern_c_string ("group");
- staticpro (&Qgroup);
- Qcomm = intern_c_string ("comm");
- staticpro (&Qcomm);
- Qstate = intern_c_string ("state");
- staticpro (&Qstate);
- Qppid = intern_c_string ("ppid");
- staticpro (&Qppid);
- Qpgrp = intern_c_string ("pgrp");
- staticpro (&Qpgrp);
- Qsess = intern_c_string ("sess");
- staticpro (&Qsess);
- Qttname = intern_c_string ("ttname");
- staticpro (&Qttname);
- Qtpgid = intern_c_string ("tpgid");
- staticpro (&Qtpgid);
- Qminflt = intern_c_string ("minflt");
- staticpro (&Qminflt);
- Qmajflt = intern_c_string ("majflt");
- staticpro (&Qmajflt);
- Qcminflt = intern_c_string ("cminflt");
- staticpro (&Qcminflt);
- Qcmajflt = intern_c_string ("cmajflt");
- staticpro (&Qcmajflt);
- Qutime = intern_c_string ("utime");
- staticpro (&Qutime);
- Qstime = intern_c_string ("stime");
- staticpro (&Qstime);
- Qtime = intern_c_string ("time");
- staticpro (&Qtime);
- Qcutime = intern_c_string ("cutime");
- staticpro (&Qcutime);
- Qcstime = intern_c_string ("cstime");
- staticpro (&Qcstime);
- Qctime = intern_c_string ("ctime");
- staticpro (&Qctime);
- Qpri = intern_c_string ("pri");
- staticpro (&Qpri);
- Qnice = intern_c_string ("nice");
- staticpro (&Qnice);
- Qthcount = intern_c_string ("thcount");
- staticpro (&Qthcount);
- Qstart = intern_c_string ("start");
- staticpro (&Qstart);
- Qvsize = intern_c_string ("vsize");
- staticpro (&Qvsize);
- Qrss = intern_c_string ("rss");
- staticpro (&Qrss);
- Qetime = intern_c_string ("etime");
- staticpro (&Qetime);
- Qpcpu = intern_c_string ("pcpu");
- staticpro (&Qpcpu);
- Qpmem = intern_c_string ("pmem");
- staticpro (&Qpmem);
- Qargs = intern_c_string ("args");
- staticpro (&Qargs);
+#endif /* subprocesses */
defsubr (&Sget_buffer_process);
defsubr (&Sprocess_inherit_coding_system_flag);
@@ -8036,8 +7768,5 @@ syms_of_process ()
defsubr (&Sprocess_attributes);
}
-
-#endif /* not subprocesses */
-
/* arch-tag: 3706c011-7b9a-4117-bd4f-59e7f701a4c4
(do not change this comment) */
diff --git a/src/process.h b/src/process.h
index a8cd0a02da6..12b91d697b9 100644
--- a/src/process.h
+++ b/src/process.h
@@ -170,5 +170,9 @@ extern Lisp_Object Qtime, Qctime;
extern Lisp_Object list_system_processes (void);
extern Lisp_Object system_process_attributes (Lisp_Object);
+extern void hold_keyboard_input (void);
+extern void unhold_keyboard_input (void);
+extern int kbd_on_hold_p (void);
+
/* arch-tag: dffedfc4-d7bc-4b58-a26f-c16155449c72
(do not change this comment) */
diff --git a/src/puresize.h b/src/puresize.h
index 4e97e3731b7..682e8926135 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -72,7 +72,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
{ if (PURE_P (obj)) \
pure_write_error (); }
-extern void pure_write_error P_ ((void)) NO_RETURN;
+extern void pure_write_error (void) NO_RETURN;
/* Define PURE_P. */
diff --git a/src/ralloc.c b/src/ralloc.c
index 7ccbdc7daf7..0a2b156e393 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -37,14 +37,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
typedef POINTER_TYPE *POINTER;
typedef size_t SIZE;
-/* Declared in dispnew.c, this version doesn't screw up if regions
- overlap. */
-
-extern void safe_bcopy ();
-
#ifdef DOUG_LEA_MALLOC
#define M_TOP_PAD -2
-extern int mallopt ();
+extern int mallopt (int, int);
#else /* not DOUG_LEA_MALLOC */
#ifndef SYSTEM_MALLOC
extern size_t __malloc_extra_blocks;
@@ -61,9 +56,6 @@ typedef void *POINTER;
#include <unistd.h>
#include <malloc.h>
-#define safe_bcopy(x, y, z) memmove (y, x, z)
-#define bzero(x, len) memset (x, 0, len)
-
#endif /* not emacs */
@@ -81,7 +73,7 @@ typedef void *POINTER;
static int r_alloc_initialized = 0;
-static void r_alloc_init ();
+static void r_alloc_init (void);
/* Declarations for working with the malloc, ralloc, and system breaks. */
@@ -210,8 +202,7 @@ static int r_alloc_freeze_level;
/* Find the heap that ADDRESS falls within. */
static heap_ptr
-find_heap (address)
- POINTER address;
+find_heap (POINTER address)
{
heap_ptr heap;
@@ -243,9 +234,7 @@ find_heap (address)
allocate the memory. */
static POINTER
-obtain (address, size)
- POINTER address;
- SIZE size;
+obtain (POINTER address, SIZE size)
{
heap_ptr heap;
SIZE already_available;
@@ -326,7 +315,7 @@ obtain (address, size)
it can also eliminate the last heap entirely. */
static void
-relinquish ()
+relinquish (void)
{
register heap_ptr h;
long excess = 0;
@@ -385,7 +374,7 @@ relinquish ()
above where malloc gets space. */
long
-r_alloc_size_in_use ()
+r_alloc_size_in_use (void)
{
return (char *) break_value - (char *) virtual_break_value;
}
@@ -396,8 +385,7 @@ r_alloc_size_in_use ()
to that block. */
static bloc_ptr
-find_bloc (ptr)
- POINTER *ptr;
+find_bloc (POINTER *ptr)
{
register bloc_ptr p = first_bloc;
@@ -422,8 +410,7 @@ find_bloc (ptr)
memory for the new block. */
static bloc_ptr
-get_bloc (size)
- SIZE size;
+get_bloc (SIZE size)
{
register bloc_ptr new_bloc;
register heap_ptr heap;
@@ -478,10 +465,7 @@ get_bloc (size)
Do not touch the contents of blocs or break_value. */
static int
-relocate_blocs (bloc, heap, address)
- bloc_ptr bloc;
- heap_ptr heap;
- POINTER address;
+relocate_blocs (bloc_ptr bloc, heap_ptr heap, POINTER address)
{
register bloc_ptr b = bloc;
@@ -541,8 +525,7 @@ relocate_blocs (bloc, heap, address)
before that of BEFORE. */
static void
-reorder_bloc (bloc, before)
- bloc_ptr bloc, before;
+reorder_bloc (bloc_ptr bloc, bloc_ptr before)
{
bloc_ptr prev, next;
@@ -570,9 +553,7 @@ reorder_bloc (bloc, before)
with heap HEAP and bloc BLOC. */
static void
-update_heap_bloc_correspondence (bloc, heap)
- bloc_ptr bloc;
- heap_ptr heap;
+update_heap_bloc_correspondence (bloc_ptr bloc, heap_ptr heap)
{
register bloc_ptr b;
@@ -634,9 +615,7 @@ update_heap_bloc_correspondence (bloc, heap)
that come after BLOC in memory. */
static int
-resize_bloc (bloc, size)
- bloc_ptr bloc;
- SIZE size;
+resize_bloc (bloc_ptr bloc, SIZE size)
{
register bloc_ptr b;
heap_ptr heap;
@@ -689,7 +668,7 @@ resize_bloc (bloc, size)
}
else
{
- safe_bcopy (b->data, b->new_data, b->size);
+ memmove (b->new_data, b->data, b->size);
*b->variable = b->data = b->new_data;
}
}
@@ -700,8 +679,8 @@ resize_bloc (bloc, size)
}
else
{
- safe_bcopy (bloc->data, bloc->new_data, old_size);
- bzero ((char *) bloc->new_data + old_size, size - old_size);
+ memmove (bloc->new_data, bloc->data, old_size);
+ memset (bloc->new_data + old_size, 0, size - old_size);
*bloc->variable = bloc->data = bloc->new_data;
}
}
@@ -716,7 +695,7 @@ resize_bloc (bloc, size)
}
else
{
- safe_bcopy (b->data, b->new_data, b->size);
+ memmove (b->new_data, b->data, b->size);
*b->variable = b->data = b->new_data;
}
}
@@ -733,8 +712,7 @@ resize_bloc (bloc, size)
This may return space to the system. */
static void
-free_bloc (bloc)
- bloc_ptr bloc;
+free_bloc (bloc_ptr bloc)
{
heap_ptr heap = bloc->heap;
@@ -800,8 +778,7 @@ free_bloc (bloc)
GNU malloc package. */
POINTER
-r_alloc_sbrk (size)
- long size;
+r_alloc_sbrk (long int size)
{
register bloc_ptr b;
POINTER address;
@@ -871,7 +848,7 @@ r_alloc_sbrk (size)
header. */
for (b = last_bloc; b != NIL_BLOC; b = b->prev)
{
- safe_bcopy (b->data, b->new_data, b->size);
+ memmove (b->new_data, b->data, b->size);
*b->variable = b->data = b->new_data;
}
@@ -898,7 +875,7 @@ r_alloc_sbrk (size)
last_heap = first_heap;
}
- bzero (address, size);
+ memset (address, 0, size);
}
else /* size < 0 */
{
@@ -917,7 +894,7 @@ r_alloc_sbrk (size)
for (b = first_bloc; b != NIL_BLOC; b = b->next)
{
- safe_bcopy (b->data, b->new_data, b->size);
+ memmove (b->new_data, b->data, b->size);
*b->variable = b->data = b->new_data;
}
}
@@ -952,9 +929,7 @@ r_alloc_sbrk (size)
return zero. */
POINTER
-r_alloc (ptr, size)
- POINTER *ptr;
- SIZE size;
+r_alloc (POINTER *ptr, SIZE size)
{
register bloc_ptr new_bloc;
@@ -977,8 +952,7 @@ r_alloc (ptr, size)
Store 0 in *PTR to show there's no block allocated. */
void
-r_alloc_free (ptr)
- register POINTER *ptr;
+r_alloc_free (register POINTER *ptr)
{
register bloc_ptr dead_bloc;
@@ -1012,9 +986,7 @@ r_alloc_free (ptr)
return zero. */
POINTER
-r_re_alloc (ptr, size)
- POINTER *ptr;
- SIZE size;
+r_re_alloc (POINTER *ptr, SIZE size)
{
register bloc_ptr bloc;
@@ -1075,8 +1047,7 @@ r_re_alloc (ptr, size)
malloc must return a null pointer. */
void
-r_alloc_freeze (size)
- long size;
+r_alloc_freeze (long int size)
{
if (! r_alloc_initialized)
r_alloc_init ();
@@ -1093,7 +1064,7 @@ r_alloc_freeze (size)
}
void
-r_alloc_thaw ()
+r_alloc_thaw (void)
{
if (! r_alloc_initialized)
@@ -1103,7 +1074,7 @@ r_alloc_thaw ()
abort ();
/* This frees all unused blocs. It is not too inefficient, as the resize
- and bcopy is done only once. Afterwards, all unreferenced blocs are
+ and memcpy is done only once. Afterwards, all unreferenced blocs are
already shrunk to zero size. */
if (!r_alloc_freeze_level)
{
@@ -1122,7 +1093,7 @@ r_alloc_thaw ()
/* Reinitialize the morecore hook variables after restarting a dumped
Emacs. This is needed when using Doug Lea's malloc from GNU libc. */
void
-r_alloc_reinit ()
+r_alloc_reinit (void)
{
/* Only do this if the hook has been reset, so that we don't get an
infinite loop, in case Emacs was linked statically. */
@@ -1235,8 +1206,7 @@ r_alloc_check ()
is checked to ensure that memory corruption does not occur due to
misuse. */
void
-r_alloc_reset_variable (old, new)
- POINTER *old, *new;
+r_alloc_reset_variable (POINTER *old, POINTER *new)
{
bloc_ptr bloc = first_bloc;
@@ -1266,7 +1236,7 @@ r_alloc_reset_variable (old, new)
/* Initialize various things for memory allocation. */
static void
-r_alloc_init ()
+r_alloc_init (void)
{
if (r_alloc_initialized)
return;
@@ -1314,8 +1284,8 @@ r_alloc_init ()
even though it is after the sbrk value. */
/* Doubly true, with the additional call that explicitly adds the
rest of that page to the address space. */
- bzero (first_heap->start,
- (char *) first_heap->end - (char *) first_heap->start);
+ memset (first_heap->start, 0,
+ (char *) first_heap->end - (char *) first_heap->start);
virtual_break_value = break_value = first_heap->bloc_start = first_heap->end;
#endif
diff --git a/src/regex.c b/src/regex.c
index 46065dda9e6..b563d93fe29 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -248,37 +248,16 @@ xrealloc (block, size)
# endif
# define realloc xrealloc
-/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow.
- If nothing else has been done, use the method below. */
-# ifdef INHIBIT_STRING_HEADER
-# if !(defined HAVE_BZERO && defined HAVE_BCOPY)
-# if !defined bzero && !defined bcopy
-# undef INHIBIT_STRING_HEADER
-# endif
+/* This is the normal way of making sure we have memcpy, memcmp and memset. */
+# if defined HAVE_STRING_H || defined STDC_HEADERS || defined _LIBC
+# include <string.h>
+# else
+# include <strings.h>
+# ifndef memcmp
+# define memcmp(s1, s2, n) bcmp (s1, s2, n)
# endif
-# endif
-
-/* This is the normal way of making sure we have memcpy, memcmp and bzero.
- This is used in most programs--a few other programs avoid this
- by defining INHIBIT_STRING_HEADER. */
-# ifndef INHIBIT_STRING_HEADER
-# if defined HAVE_STRING_H || defined STDC_HEADERS || defined _LIBC
-# include <string.h>
-# ifndef bzero
-# ifndef _LIBC
-# define bzero(s, n) (memset (s, '\0', n), (s))
-# else
-# define bzero(s, n) __bzero (s, n)
-# endif
-# endif
-# else
-# include <strings.h>
-# ifndef memcmp
-# define memcmp(s1, s2, n) bcmp (s1, s2, n)
-# endif
-# ifndef memcpy
-# define memcpy(d, s, n) (bcopy (s, d, n), (d))
-# endif
+# ifndef memcpy
+# define memcpy(d, s, n) (bcopy (s, d, n), (d))
# endif
# endif
@@ -464,7 +443,7 @@ init_syntax_once ()
if (done)
return;
- bzero (re_syntax_table, sizeof re_syntax_table);
+ memset (re_syntax_table, 0, sizeof re_syntax_table);
for (c = 0; c < CHAR_SET_SIZE; ++c)
if (ISALNUM (c))
@@ -1321,8 +1300,7 @@ reg_syntax_t re_syntax_options;
defined in regex.h. We return the old syntax. */
reg_syntax_t
-re_set_syntax (syntax)
- reg_syntax_t syntax;
+re_set_syntax (reg_syntax_t syntax)
{
reg_syntax_t ret = re_syntax_options;
@@ -1335,8 +1313,7 @@ WEAK_ALIAS (__re_set_syntax, re_set_syntax)
static re_char *whitespace_regexp;
void
-re_set_whitespace_regexp (regexp)
- const char *regexp;
+re_set_whitespace_regexp (const char *regexp)
{
whitespace_regexp = (re_char *) regexp;
}
@@ -2149,8 +2126,7 @@ struct range_table_work_area
/* Map a string to the char class it names (if any). */
re_wctype_t
-re_wctype (str)
- re_char *str;
+re_wctype (const re_char *str)
{
const char *string = str;
if (STREQ (string, "alnum")) return RECC_ALNUM;
@@ -2175,9 +2151,7 @@ re_wctype (str)
/* True if CH is in the char class CC. */
boolean
-re_iswctype (ch, cc)
- int ch;
- re_wctype_t cc;
+re_iswctype (int ch, re_wctype_t cc)
{
switch (cc)
{
@@ -2207,8 +2181,7 @@ re_iswctype (ch, cc)
/* Return a bit-pattern to use in the range-table bits to match multibyte
chars of class CC. */
static int
-re_wctype_to_bit (cc)
- re_wctype_t cc;
+re_wctype_to_bit (re_wctype_t cc)
{
switch (cc)
{
@@ -2232,8 +2205,7 @@ re_wctype_to_bit (cc)
/* Actually extend the space in WORK_AREA. */
static void
-extend_range_table_work_area (work_area)
- struct range_table_work_area *work_area;
+extend_range_table_work_area (struct range_table_work_area *work_area)
{
work_area->allocated += 16 * sizeof (int);
if (work_area->table)
@@ -2557,11 +2529,7 @@ do { \
} while (0)
static reg_errcode_t
-regex_compile (pattern, size, syntax, bufp)
- re_char *pattern;
- size_t size;
- reg_syntax_t syntax;
- struct re_pattern_buffer *bufp;
+regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct re_pattern_buffer *bufp)
{
/* We fetch characters from PATTERN here. */
register re_wchar_t c, c1;
@@ -2959,7 +2927,7 @@ regex_compile (pattern, size, syntax, bufp)
BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
/* Clear the whole map. */
- bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
+ memset (b, 0, (1 << BYTEWIDTH) / BYTEWIDTH);
/* charset_not matches newline according to a syntax bit. */
if ((re_opcode_t) b[-2] == charset_not
@@ -3875,10 +3843,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Store OP at LOC followed by two-byte integer parameter ARG. */
static void
-store_op1 (op, loc, arg)
- re_opcode_t op;
- unsigned char *loc;
- int arg;
+store_op1 (re_opcode_t op, unsigned char *loc, int arg)
{
*loc = (unsigned char) op;
STORE_NUMBER (loc + 1, arg);
@@ -3888,10 +3853,7 @@ store_op1 (op, loc, arg)
/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */
static void
-store_op2 (op, loc, arg1, arg2)
- re_opcode_t op;
- unsigned char *loc;
- int arg1, arg2;
+store_op2 (re_opcode_t op, unsigned char *loc, int arg1, int arg2)
{
*loc = (unsigned char) op;
STORE_NUMBER (loc + 1, arg1);
@@ -3903,11 +3865,7 @@ store_op2 (op, loc, arg1, arg2)
for OP followed by two-byte integer parameter ARG. */
static void
-insert_op1 (op, loc, arg, end)
- re_opcode_t op;
- unsigned char *loc;
- int arg;
- unsigned char *end;
+insert_op1 (re_opcode_t op, unsigned char *loc, int arg, unsigned char *end)
{
register unsigned char *pfrom = end;
register unsigned char *pto = end + 3;
@@ -3922,11 +3880,7 @@ insert_op1 (op, loc, arg, end)
/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */
static void
-insert_op2 (op, loc, arg1, arg2, end)
- re_opcode_t op;
- unsigned char *loc;
- int arg1, arg2;
- unsigned char *end;
+insert_op2 (re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end)
{
register unsigned char *pfrom = end;
register unsigned char *pto = end + 5;
@@ -3943,9 +3897,7 @@ insert_op2 (op, loc, arg1, arg2, end)
least one character before the ^. */
static boolean
-at_begline_loc_p (pattern, p, syntax)
- re_char *pattern, *p;
- reg_syntax_t syntax;
+at_begline_loc_p (const re_char *pattern, const re_char *p, reg_syntax_t syntax)
{
re_char *prev = p - 2;
boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
@@ -3967,9 +3919,7 @@ at_begline_loc_p (pattern, p, syntax)
at least one character after the $, i.e., `P < PEND'. */
static boolean
-at_endline_loc_p (p, pend, syntax)
- re_char *p, *pend;
- reg_syntax_t syntax;
+at_endline_loc_p (const re_char *p, const re_char *pend, reg_syntax_t syntax)
{
re_char *next = p;
boolean next_backslash = *next == '\\';
@@ -3989,9 +3939,7 @@ at_endline_loc_p (p, pend, syntax)
false if it's not. */
static boolean
-group_in_compile_stack (compile_stack, regnum)
- compile_stack_type compile_stack;
- regnum_t regnum;
+group_in_compile_stack (compile_stack_type compile_stack, regnum_t regnum)
{
int this_element;
@@ -4015,10 +3963,7 @@ group_in_compile_stack (compile_stack, regnum)
Return -1 if fastmap was not updated accurately. */
static int
-analyse_first (p, pend, fastmap, multibyte)
- re_char *p, *pend;
- char *fastmap;
- const int multibyte;
+analyse_first (const re_char *p, const re_char *pend, char *fastmap, const int multibyte)
{
int j, k;
boolean not;
@@ -4330,15 +4275,14 @@ analyse_first (p, pend, fastmap, multibyte)
Returns 0 if we succeed, -2 if an internal error. */
int
-re_compile_fastmap (bufp)
- struct re_pattern_buffer *bufp;
+re_compile_fastmap (struct re_pattern_buffer *bufp)
{
char *fastmap = bufp->fastmap;
int analysis;
assert (fastmap && bufp->buffer);
- bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */
+ memset (fastmap, 0, 1 << BYTEWIDTH); /* Assume nothing's valid. */
bufp->fastmap_accurate = 1; /* It will be when we're done. */
analysis = analyse_first (bufp->buffer, bufp->buffer + bufp->used,
@@ -4361,11 +4305,7 @@ re_compile_fastmap (bufp)
freeing the old data. */
void
-re_set_registers (bufp, regs, num_regs, starts, ends)
- struct re_pattern_buffer *bufp;
- struct re_registers *regs;
- unsigned num_regs;
- regoff_t *starts, *ends;
+re_set_registers (struct re_pattern_buffer *bufp, struct re_registers *regs, unsigned int num_regs, regoff_t *starts, regoff_t *ends)
{
if (num_regs)
{
@@ -4389,11 +4329,7 @@ WEAK_ALIAS (__re_set_registers, re_set_registers)
doesn't let you say where to stop matching. */
int
-re_search (bufp, string, size, startpos, range, regs)
- struct re_pattern_buffer *bufp;
- const char *string;
- int size, startpos, range;
- struct re_registers *regs;
+re_search (struct re_pattern_buffer *bufp, const char *string, int size, int startpos, int range, struct re_registers *regs)
{
return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
regs, size);
@@ -4434,14 +4370,7 @@ WEAK_ALIAS (__re_search, re_search)
stack overflow). */
int
-re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
- struct re_pattern_buffer *bufp;
- const char *str1, *str2;
- int size1, size2;
- int startpos;
- int range;
- struct re_registers *regs;
- int stop;
+re_search_2 (struct re_pattern_buffer *bufp, const char *str1, int size1, const char *str2, int size2, int startpos, int range, struct re_registers *regs, int stop)
{
int val;
re_char *string1 = (re_char*) str1;
@@ -4775,8 +4704,7 @@ static int bcmp_translate _RE_ARGS((re_char *s1, re_char *s2,
/* If the operation is a match against one or more chars,
return a pointer to the next operation, else return NULL. */
static re_char *
-skip_one_char (p)
- re_char *p;
+skip_one_char (const re_char *p)
{
switch (SWITCH_ENUM_CAST (*p++))
{
@@ -4818,8 +4746,7 @@ skip_one_char (p)
/* Jump over non-matching operations. */
static re_char *
-skip_noops (p, pend)
- re_char *p, *pend;
+skip_noops (const re_char *p, const re_char *pend)
{
int mcnt;
while (p < pend)
@@ -4846,9 +4773,7 @@ skip_noops (p, pend)
/* Non-zero if "p1 matches something" implies "p2 fails". */
static int
-mutually_exclusive_p (bufp, p1, p2)
- struct re_pattern_buffer *bufp;
- re_char *p1, *p2;
+mutually_exclusive_p (struct re_pattern_buffer *bufp, const re_char *p1, const re_char *p2)
{
re_opcode_t op2;
const boolean multibyte = RE_MULTIBYTE_P (bufp);
@@ -5086,13 +5011,7 @@ Lisp_Object re_match_object;
matched substring. */
int
-re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
- struct re_pattern_buffer *bufp;
- const char *string1, *string2;
- int size1, size2;
- int pos;
- struct re_registers *regs;
- int stop;
+re_match_2 (struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int pos, struct re_registers *regs, int stop)
{
int result;
@@ -5114,13 +5033,7 @@ WEAK_ALIAS (__re_match_2, re_match_2)
/* This is a separate function so that we can force an alloca cleanup
afterwards. */
static int
-re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
- struct re_pattern_buffer *bufp;
- re_char *string1, *string2;
- int size1, size2;
- int pos;
- struct re_registers *regs;
- int stop;
+re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1, int size1, const re_char *string2, int size2, int pos, struct re_registers *regs, int stop)
{
/* General temporaries. */
int mcnt;
@@ -6451,11 +6364,8 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
bytes; nonzero otherwise. */
static int
-bcmp_translate (s1, s2, len, translate, target_multibyte)
- re_char *s1, *s2;
- register int len;
- RE_TRANSLATE_TYPE translate;
- const int target_multibyte;
+bcmp_translate (const re_char *s1, const re_char *s2, register int len,
+ RE_TRANSLATE_TYPE translate, const int target_multibyte)
{
register re_char *p1 = s1, *p2 = s2;
re_char *p1_end = s1 + len;
@@ -6496,10 +6406,7 @@ bcmp_translate (s1, s2, len, translate, target_multibyte)
We call regex_compile to do the actual compilation. */
const char *
-re_compile_pattern (pattern, length, bufp)
- const char *pattern;
- size_t length;
- struct re_pattern_buffer *bufp;
+re_compile_pattern (const char *pattern, size_t length, struct re_pattern_buffer *bufp)
{
reg_errcode_t ret;
diff --git a/src/region-cache.c b/src/region-cache.c
index d03d7df0bda..45eb723c885 100644
--- a/src/region-cache.c
+++ b/src/region-cache.c
@@ -122,13 +122,13 @@ struct region_cache {
preserve that information, instead of throwing it away. */
#define PRESERVE_THRESHOLD (500)
-static void revalidate_region_cache ();
+static void revalidate_region_cache (struct buffer *buf, struct region_cache *c);
/* Interface: Allocating, initializing, and disposing of region caches. */
struct region_cache *
-new_region_cache ()
+new_region_cache (void)
{
struct region_cache *c
= (struct region_cache *) xmalloc (sizeof (struct region_cache));
@@ -156,8 +156,7 @@ new_region_cache ()
}
void
-free_region_cache (c)
- struct region_cache *c;
+free_region_cache (struct region_cache *c)
{
xfree (c->boundaries);
xfree (c);
@@ -174,9 +173,7 @@ free_region_cache (c)
entries. It would be nice if it took advantage of locality of
reference, too, by searching entries near the last entry found. */
static int
-find_cache_boundary (c, pos)
- struct region_cache *c;
- int pos;
+find_cache_boundary (struct region_cache *c, int pos)
{
int low = 0, high = c->cache_len;
@@ -210,10 +207,7 @@ find_cache_boundary (c, pos)
/* Move the gap of cache C to index POS, and make sure it has space
for at least MIN_SIZE boundaries. */
static void
-move_cache_gap (c, pos, min_size)
- struct region_cache *c;
- int pos;
- int min_size;
+move_cache_gap (struct region_cache *c, int pos, int min_size)
{
/* Copy these out of the cache and into registers. */
int gap_start = c->gap_start;
@@ -298,10 +292,7 @@ move_cache_gap (c, pos, min_size)
/* Insert a new boundary in cache C; it will have cache index INDEX,
and have the specified POS and VALUE. */
static void
-insert_cache_boundary (c, index, pos, value)
- struct region_cache *c;
- int index;
- int pos, value;
+insert_cache_boundary (struct region_cache *c, int index, int pos, int value)
{
/* index must be a valid cache index. */
if (index < 0 || index > c->cache_len)
@@ -337,9 +328,7 @@ insert_cache_boundary (c, index, pos, value)
/* Delete the i'th entry from cache C if START <= i < END. */
static void
-delete_cache_boundaries (c, start, end)
- struct region_cache *c;
- int start, end;
+delete_cache_boundaries (struct region_cache *c, int start, int end)
{
int len = end - start;
@@ -391,10 +380,7 @@ delete_cache_boundaries (c, start, end)
/* Set the value in cache C for the region START..END to VALUE. */
static void
-set_cache_region (c, start, end, value)
- struct region_cache *c;
- int start, end;
- int value;
+set_cache_region (struct region_cache *c, int start, int end, int value)
{
if (start > end)
abort ();
@@ -495,10 +481,7 @@ set_cache_region (c, start, end, value)
buffer positions in the presence of insertions and deletions; the
args to pass are the same before and after such an operation.) */
void
-invalidate_region_cache (buf, c, head, tail)
- struct buffer *buf;
- struct region_cache *c;
- int head, tail;
+invalidate_region_cache (struct buffer *buf, struct region_cache *c, int head, int tail)
{
/* Let chead = c->beg_unchanged, and
ctail = c->end_unchanged.
@@ -576,9 +559,7 @@ invalidate_region_cache (buf, c, head, tail)
the cache, and causes cache gap motion. */
static void
-revalidate_region_cache (buf, c)
- struct buffer *buf;
- struct region_cache *c;
+revalidate_region_cache (struct buffer *buf, struct region_cache *c)
{
/* The boundaries now in the cache are expressed relative to the
buffer_beg and buffer_end values stored in the cache. Now,
@@ -706,10 +687,7 @@ revalidate_region_cache (buf, c)
buffer positions) is "known," for the purposes of CACHE (e.g. "has
no newlines", in the case of the line cache). */
void
-know_region_cache (buf, c, start, end)
- struct buffer *buf;
- struct region_cache *c;
- int start, end;
+know_region_cache (struct buffer *buf, struct region_cache *c, int start, int end)
{
revalidate_region_cache (buf, c);
@@ -723,11 +701,7 @@ know_region_cache (buf, c, start, end)
the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest
position after POS where the knownness changes. */
int
-region_cache_forward (buf, c, pos, next)
- struct buffer *buf;
- struct region_cache *c;
- int pos;
- int *next;
+region_cache_forward (struct buffer *buf, struct region_cache *c, int pos, int *next)
{
revalidate_region_cache (buf, c);
@@ -762,11 +736,7 @@ region_cache_forward (buf, c, pos, next)
/* Return true if the text immediately before POS in BUF is known, for
the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest
position before POS where the knownness changes. */
-int region_cache_backward (buf, c, pos, next)
- struct buffer *buf;
- struct region_cache *c;
- int pos;
- int *next;
+int region_cache_backward (struct buffer *buf, struct region_cache *c, int pos, int *next)
{
revalidate_region_cache (buf, c);
@@ -804,8 +774,7 @@ int region_cache_backward (buf, c, pos, next)
/* Debugging: pretty-print a cache to the standard error output. */
void
-pp_cache (c)
- struct region_cache *c;
+pp_cache (struct region_cache *c)
{
int i;
int beg_u = c->buffer_beg + c->beg_unchanged;
diff --git a/src/region-cache.h b/src/region-cache.h
index 4a717d66081..e2972f2ea0a 100644
--- a/src/region-cache.h
+++ b/src/region-cache.h
@@ -61,17 +61,17 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Allocate, initialize and return a new, empty region cache. */
-struct region_cache *new_region_cache P_ ((void));
+struct region_cache *new_region_cache (void);
/* Free a region cache. */
-void free_region_cache P_ ((struct region_cache *));
+void free_region_cache (struct region_cache *);
/* Assert that the region of BUF between START and END (absolute
buffer positions) is "known," for the purposes of CACHE (e.g. "has
no newlines", in the case of the line cache). */
-extern void know_region_cache P_ ((struct buffer *BUF,
- struct region_cache *CACHE,
- int START, int END));
+extern void know_region_cache (struct buffer *BUF,
+ struct region_cache *CACHE,
+ int START, int END);
/* Indicate that a section of BUF has changed, to invalidate CACHE.
HEAD is the number of chars unchanged at the beginning of the buffer.
@@ -81,9 +81,9 @@ extern void know_region_cache P_ ((struct buffer *BUF,
(This way of specifying regions makes more sense than absolute
buffer positions in the presence of insertions and deletions; the
args to pass are the same before and after such an operation.) */
-extern void invalidate_region_cache P_ ((struct buffer *BUF,
- struct region_cache *CACHE,
- int HEAD, int TAIL));
+extern void invalidate_region_cache (struct buffer *BUF,
+ struct region_cache *CACHE,
+ int HEAD, int TAIL);
/* The scanning functions.
@@ -97,18 +97,18 @@ extern void invalidate_region_cache P_ ((struct buffer *BUF,
/* Return true if the text immediately after POS in BUF is known, for
the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest
position after POS where the knownness changes. */
-extern int region_cache_forward P_ ((struct buffer *BUF,
- struct region_cache *CACHE,
- int POS,
- int *NEXT));
+extern int region_cache_forward (struct buffer *BUF,
+ struct region_cache *CACHE,
+ int POS,
+ int *NEXT);
/* Return true if the text immediately before POS in BUF is known, for
the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest
position before POS where the knownness changes. */
-extern int region_cache_backward P_ ((struct buffer *BUF,
- struct region_cache *CACHE,
- int POS,
- int *NEXT));
+extern int region_cache_backward (struct buffer *BUF,
+ struct region_cache *CACHE,
+ int POS,
+ int *NEXT);
/* arch-tag: 70f79125-ef22-4f58-9aec-a48ca2791435
(do not change this comment) */
diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h
index 48f43126fd9..cf06f9befe0 100644
--- a/src/s/aix4-2.h
+++ b/src/s/aix4-2.h
@@ -89,8 +89,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
memory use the libc malloc implementation. Calling xfree or
xrealloc on the results of such functions results in a crash.
- One solution for this could be to define SYSTEM_MALLOC here, but
- that does not currently work on this system.
+ One solution for this could be to define SYSTEM_MALLOC in configure,
+ but that does not currently work on this system.
It is possible to completely override the malloc implementation on
AIX, but that involves putting the malloc functions in a shared
diff --git a/src/s/darwin.h b/src/s/darwin.h
index 5c8db1242e1..146bfd693a2 100644
--- a/src/s/darwin.h
+++ b/src/s/darwin.h
@@ -114,15 +114,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* System uses OXTABS instead of the expected TAB3. (Copied from bsd386.h.) */
#define TAB3 OXTABS
-/* Darwin ld insists on the use of malloc routines in the System framework. */
-#define SYSTEM_MALLOC
-
/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */
#define HAVE_SOCKETS
-/* start_of_text isn't actually used, so make it compile without error. */
-#define TEXT_START (0)
-
/* Definitions for how to compile & link. */
#ifdef HAVE_NS
#define SYSTEM_PURESIZE_EXTRA 200000
diff --git a/src/s/freebsd.h b/src/s/freebsd.h
index 2b53ec0413f..9082935db07 100644
--- a/src/s/freebsd.h
+++ b/src/s/freebsd.h
@@ -25,9 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Get most of the stuff from bsd-common */
#include "bsd-common.h"
-/* For mem-limits.h. */
-#define BSD4_2
-
#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
#define HAVE_GETLOADAVG 1
@@ -70,9 +67,5 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack. */
#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
-/* Define USE_MMAP_FOR_BUFFERS to let Emacs use mmap(2) to allocate
- buffer text. This overrides REL_ALLOC. */
-#define USE_MMAP_FOR_BUFFERS 1
-
/* arch-tag: 426529ca-b7c4-448f-b10a-d4dcdc9c78eb
(do not change this comment) */
diff --git a/src/s/hpux10-20.h b/src/s/hpux10-20.h
index 8d9c73e2368..ee841041edb 100644
--- a/src/s/hpux10-20.h
+++ b/src/s/hpux10-20.h
@@ -131,7 +131,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define DATA_SEG_BITS 0x40000000
#define DATA_START 0x40000000
-#define TEXT_START 0x00000000
/* Data type of load average, as read out of kmem. */
#define LOAD_AVE_TYPE double
@@ -147,9 +146,5 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* No underscore please. */
#define LDAV_SYMBOL "avenrun"
-/* On USG systems these have different names. */
-#define index strchr
-#define rindex strrchr
-
/* arch-tag: 8d8dcbf1-ca9b-48a1-94be-b750de18a5c6
(do not change this comment) */
diff --git a/src/s/irix6-5.h b/src/s/irix6-5.h
index 1691daa6615..e2b18b2ec2b 100644
--- a/src/s/irix6-5.h
+++ b/src/s/irix6-5.h
@@ -85,8 +85,6 @@ char *_getpty();
#define NARROWPROTO 1
-#define USE_MMAP_FOR_BUFFERS 1
-
#if _MIPS_SZLONG == 64 /* -mabi=64 (gcc) or -64 (MIPSpro) */
#define _LP64 /* lisp.h takes care of the rest */
#endif /* _MIPS_SZLONG */
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index ea32373e02b..b3e9db8be8a 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -40,7 +40,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* SYSTEM_TYPE should indicate the kind of system you are using.
It sets the Lisp variable system-type. */
#define SYSTEM_TYPE "windows-nt"
-#define SYMS_SYSTEM syms_of_ntterm ()
#define NO_MATHERR 1
@@ -63,15 +62,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
for received packets, so datagrams are broken too. */
#define BROKEN_DATAGRAM_SOCKETS 1
-#define bzero(b, l) memset(b, 0, l)
-#define bcopy(s, d, l) memmove(d, s, l)
-#define bcmp(a, b, l) memcmp(a, b, l)
-
-/* bcopy (aka memmove aka memcpy at least on x86) under MSVC is quite safe. */
-#define GAP_USE_BCOPY 1
-#define BCOPY_UPWARD_SAFE 1
-#define BCOPY_DOWNWARD_SAFE 1
-
/* If your system uses COFF (Common Object File Format) then define the
preprocessor symbol "COFF". */
#define COFF 1
@@ -153,8 +143,10 @@ struct sigaction {
#define HAVE_RANDOM 1
#undef HAVE_SYSINFO
#undef HAVE_LRAND48
-#define HAVE_BCOPY 1
-#define HAVE_BCMP 1
+#define HAVE_MEMCMP 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMSET 1
#define HAVE_LOGB 1
#define HAVE_FREXP 1
#define HAVE_FMOD 1
@@ -281,8 +273,6 @@ typedef int pid_t;
#define pclose _pclose
#define umask _umask
#define utimbuf _utimbuf
-#define index strchr
-#define rindex strrchr
#define strdup _strdup
#define strupr _strupr
#define strnicmp _strnicmp
diff --git a/src/s/msdos.h b/src/s/msdos.h
index af272635968..b76b583250c 100644
--- a/src/s/msdos.h
+++ b/src/s/msdos.h
@@ -38,14 +38,8 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
It sets the Lisp variable system-type. */
#define SYSTEM_TYPE "ms-dos"
-#define SYMS_SYSTEM syms_of_dosfns();syms_of_msdos();syms_of_win16select()
-
#define SYSV_SYSTEM_DIR
-/* Define this is the compiler understands `volatile'. */
-#define HAVE_VOLATILE
-
-
/* subprocesses should be defined if you want to have code for
asynchronous subprocesses (as used in M-x compile and M-x shell).
This is the only system that needs this. */
@@ -75,7 +69,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
#define _longjmp longjmp
#define DATA_START (&etext + 1)
-#define TEXT_START &start
#define _NAIVE_DOS_REGS
@@ -104,10 +97,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
#define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
-/* bcopy under djgpp is quite safe. */
-#define GAP_USE_BCOPY
-#define BCOPY_UPWARD_SAFE 1
-#define BCOPY_DOWNWARD_SAFE 1
/* Mode line description of a buffer's type. */
#define MODE_LINE_BINARY_TEXT(buf) (NILP(buf->buffer_file_type) ? "T" : "B")
diff --git a/src/s/sol2-10.h b/src/s/sol2-10.h
index 7441eaa0210..fd7f30021ea 100644
--- a/src/s/sol2-10.h
+++ b/src/s/sol2-10.h
@@ -2,8 +2,6 @@
#include "sol2-6.h"
-#define SYSTEM_MALLOC
-
/* This is used in list_system_processes. */
#define HAVE_PROCFS 1
diff --git a/src/s/sol2-6.h b/src/s/sol2-6.h
index 0c30b3d81f0..f4719093d4a 100644
--- a/src/s/sol2-6.h
+++ b/src/s/sol2-6.h
@@ -34,10 +34,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define HAVE_LIBKSTAT
#endif
-/* inoue@ainet.or.jp says Solaris has a bug related to X11R6-style
- XIM support. */
-#define INHIBIT_X11R6_XIM
-
/* This is the same definition as in usg5-4.h, but with sigblock/sigunblock
rather than sighold/sigrelse, which appear to be BSD4.1 specific.
It may also be appropriate for SVR4.x
diff --git a/src/s/template.h b/src/s/template.h
index 694a1046566..67ed13e6180 100644
--- a/src/s/template.h
+++ b/src/s/template.h
@@ -108,9 +108,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
is not ':', #define this to be the appropriate character constant. */
/* #define SEPCHAR ':' */
-/* Define this if the system can use mmap for buffer text allocation. */
-/* #define USE_MMAP_FOR_BUFFERS 1 */
-
/* ============================================================ */
/* Here, add any special hacks needed to make Emacs work on this
diff --git a/src/s/usg5-4.h b/src/s/usg5-4.h
index e667ffdc106..b92a5bbb450 100644
--- a/src/s/usg5-4.h
+++ b/src/s/usg5-4.h
@@ -50,14 +50,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define _setjmp setjmp
#define _longjmp longjmp
-/* On USG systems these have different names. */
-#ifndef HAVE_INDEX
-#define index strchr
-#endif /* ! defined (HAVE_INDEX) */
-#ifndef HAVE_RINDEX
-#define rindex strrchr
-#endif /* ! defined (HAVE_RINDEX) */
-
/* The docs for system V/386 suggest v.3 has sigpause, so let's try it. */
#define HAVE_SYSV_SIGPAUSE
diff --git a/src/scroll.c b/src/scroll.c
index e2d3656dc43..bdb7f691ee7 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -58,14 +58,14 @@ struct matrix_elt
unsigned char writecount;
};
-static void do_direct_scrolling P_ ((struct frame *,
- struct glyph_matrix *,
- struct matrix_elt *,
- int, int));
-static void do_scrolling P_ ((struct frame *,
- struct glyph_matrix *,
- struct matrix_elt *,
- int, int));
+static void do_direct_scrolling (struct frame *,
+ struct glyph_matrix *,
+ struct matrix_elt *,
+ int, int);
+static void do_scrolling (struct frame *,
+ struct glyph_matrix *,
+ struct matrix_elt *,
+ int, int);
/* Determine, in matrix[i,j], the cost of updating the first j old
@@ -86,17 +86,12 @@ static void do_scrolling P_ ((struct frame *,
new contents appears. */
static void
-calculate_scrolling (frame, matrix, window_size, lines_below,
- draw_cost, old_hash, new_hash,
- free_at_end)
- FRAME_PTR frame;
- /* matrix is of size window_size + 1 on each side. */
- struct matrix_elt *matrix;
- int window_size, lines_below;
- int *draw_cost;
- int *old_hash;
- int *new_hash;
- int free_at_end;
+calculate_scrolling (FRAME_PTR frame,
+ /* matrix is of size window_size + 1 on each side. */
+ struct matrix_elt *matrix,
+ int window_size, int lines_below,
+ int *draw_cost, int *old_hash, int *new_hash,
+ int free_at_end)
{
register int i, j;
int frame_lines = FRAME_LINES (frame);
@@ -244,12 +239,7 @@ calculate_scrolling (frame, matrix, window_size, lines_below,
of lines. */
static void
-do_scrolling (frame, current_matrix, matrix, window_size, unchanged_at_top)
- struct frame *frame;
- struct glyph_matrix *current_matrix;
- struct matrix_elt *matrix;
- int window_size;
- int unchanged_at_top;
+do_scrolling (struct frame *frame, struct glyph_matrix *current_matrix, struct matrix_elt *matrix, int window_size, int unchanged_at_top)
{
struct matrix_elt *p;
int i, j, k;
@@ -268,7 +258,7 @@ do_scrolling (frame, current_matrix, matrix, window_size, unchanged_at_top)
int *copy_from = (int *) alloca (window_size * sizeof (int));
/* Zero means line is empty. */
- bzero (retained_p, window_size * sizeof (char));
+ memset (retained_p, 0, window_size * sizeof (char));
for (k = 0; k < window_size; ++k)
copy_from[k] = -1;
@@ -429,18 +419,13 @@ do_scrolling (frame, current_matrix, matrix, window_size, unchanged_at_top)
is the equivalent of draw_cost for the old line contents */
static void
-calculate_direct_scrolling (frame, matrix, window_size, lines_below,
- draw_cost, old_draw_cost, old_hash, new_hash,
- free_at_end)
- FRAME_PTR frame;
- /* matrix is of size window_size + 1 on each side. */
- struct matrix_elt *matrix;
- int window_size, lines_below;
- int *draw_cost;
- int *old_draw_cost;
- int *old_hash;
- int *new_hash;
- int free_at_end;
+calculate_direct_scrolling (FRAME_PTR frame,
+ /* matrix is of size window_size + 1 on each side. */
+ struct matrix_elt *matrix,
+ int window_size, int lines_below,
+ int *draw_cost, int *old_draw_cost,
+ int *old_hash, int *new_hash,
+ int free_at_end)
{
register int i, j;
int frame_lines = FRAME_LINES (frame);
@@ -655,13 +640,9 @@ calculate_direct_scrolling (frame, matrix, window_size, lines_below,
the cost matrix for this approach is constructed. */
static void
-do_direct_scrolling (frame, current_matrix, cost_matrix,
- window_size, unchanged_at_top)
- struct frame *frame;
- struct glyph_matrix *current_matrix;
- struct matrix_elt *cost_matrix;
- int window_size;
- int unchanged_at_top;
+do_direct_scrolling (struct frame *frame, struct glyph_matrix *current_matrix,
+ struct matrix_elt *cost_matrix, int window_size,
+ int unchanged_at_top)
{
struct matrix_elt *p;
int i, j;
@@ -692,7 +673,7 @@ do_direct_scrolling (frame, current_matrix, cost_matrix,
old matrix. Lines not retained are empty. */
char *retained_p = (char *) alloca (window_size * sizeof (char));
- bzero (retained_p, window_size * sizeof (char));
+ memset (retained_p, 0, window_size * sizeof (char));
/* Perform some sanity checks when GLYPH_DEBUG is on. */
CHECK_MATRIX (current_matrix);
@@ -811,15 +792,9 @@ do_direct_scrolling (frame, current_matrix, cost_matrix,
void
-scrolling_1 (frame, window_size, unchanged_at_top, unchanged_at_bottom,
- draw_cost, old_draw_cost, old_hash, new_hash, free_at_end)
- FRAME_PTR frame;
- int window_size, unchanged_at_top, unchanged_at_bottom;
- int *draw_cost;
- int *old_draw_cost;
- int *old_hash;
- int *new_hash;
- int free_at_end;
+scrolling_1 (FRAME_PTR frame, int window_size, int unchanged_at_top,
+ int unchanged_at_bottom, int *draw_cost, int *old_draw_cost,
+ int *old_hash, int *new_hash, int free_at_end)
{
struct matrix_elt *matrix;
matrix = ((struct matrix_elt *)
@@ -854,9 +829,7 @@ scrolling_1 (frame, window_size, unchanged_at_top, unchanged_at_bottom,
such a line will have little weight. */
int
-scrolling_max_lines_saved (start, end, oldhash, newhash, cost)
- int start, end;
- int *oldhash, *newhash, *cost;
+scrolling_max_lines_saved (int start, int end, int *oldhash, int *newhash, int *cost)
{
struct { int hash; int count; } lines[01000];
register int i, h;
@@ -872,7 +845,7 @@ scrolling_max_lines_saved (start, end, oldhash, newhash, cost)
avg_length /= end - start;
threshold = avg_length / 4;
- bzero (lines, sizeof lines);
+ memset (lines, 0, sizeof lines);
/* Put new lines' hash codes in hash table. Ignore lines shorter
than the threshold. Thus, if the lines that are in common are
@@ -909,9 +882,7 @@ scrolling_max_lines_saved (start, end, oldhash, newhash, cost)
to scroll_frame_lines to perform this scrolling. */
int
-scroll_cost (frame, from, to, amount)
- FRAME_PTR frame;
- int from, to, amount;
+scroll_cost (FRAME_PTR frame, int from, int to, int amount)
{
/* Compute how many lines, at bottom of frame,
will not be involved in actual motion. */
@@ -948,11 +919,7 @@ scroll_cost (frame, from, to, amount)
overhead and multiply factor values */
static void
-line_ins_del (frame, ov1, pf1, ovn, pfn, ov, mf)
- FRAME_PTR frame;
- int ov1, ovn;
- int pf1, pfn;
- register int *ov, *mf;
+line_ins_del (FRAME_PTR frame, int ov1, int pf1, int ovn, int pfn, register int *ov, register int *mf)
{
register int i;
register int frame_lines = FRAME_LINES (frame);
@@ -969,15 +936,11 @@ line_ins_del (frame, ov1, pf1, ovn, pfn, ov, mf)
}
static void
-ins_del_costs (frame,
- one_line_string, multi_string,
- setup_string, cleanup_string,
- costvec, ncostvec, coefficient)
- FRAME_PTR frame;
- char *one_line_string, *multi_string;
- char *setup_string, *cleanup_string;
- int *costvec, *ncostvec;
- int coefficient;
+ins_del_costs (FRAME_PTR frame,
+ char *one_line_string, char *multi_string,
+ char *setup_string, char *cleanup_string,
+ int *costvec, int *ncostvec,
+ int coefficient)
{
if (multi_string)
line_ins_del (frame,
@@ -1029,15 +992,11 @@ ins_del_costs (frame,
*/
void
-do_line_insertion_deletion_costs (frame,
- ins_line_string, multi_ins_string,
- del_line_string, multi_del_string,
- setup_string, cleanup_string, coefficient)
- FRAME_PTR frame;
- char *ins_line_string, *multi_ins_string;
- char *del_line_string, *multi_del_string;
- char *setup_string, *cleanup_string;
- int coefficient;
+do_line_insertion_deletion_costs (FRAME_PTR frame,
+ char *ins_line_string, char *multi_ins_string,
+ char *del_line_string, char *multi_del_string,
+ char *setup_string, char *cleanup_string,
+ int coefficient)
{
if (FRAME_INSERT_COST (frame) != 0)
{
diff --git a/src/search.c b/src/search.c
index 736a89258f5..602a50c0abe 100644
--- a/src/search.c
+++ b/src/search.c
@@ -98,22 +98,22 @@ Lisp_Object Vsearch_spaces_regexp;
only. */
Lisp_Object Vinhibit_changing_match_data;
-static void set_search_regs P_ ((EMACS_INT, EMACS_INT));
-static void save_search_regs P_ ((void));
-static EMACS_INT simple_search P_ ((int, unsigned char *, int, int,
- Lisp_Object, EMACS_INT, EMACS_INT,
- EMACS_INT, EMACS_INT));
-static EMACS_INT boyer_moore P_ ((int, unsigned char *, int, int,
- Lisp_Object, Lisp_Object,
- EMACS_INT, EMACS_INT,
- EMACS_INT, EMACS_INT, int));
-static EMACS_INT search_buffer P_ ((Lisp_Object, EMACS_INT, EMACS_INT,
- EMACS_INT, EMACS_INT, int, int,
- Lisp_Object, Lisp_Object, int));
-static void matcher_overflow () NO_RETURN;
+static void set_search_regs (EMACS_INT, EMACS_INT);
+static void save_search_regs (void);
+static EMACS_INT simple_search (int, unsigned char *, int, int,
+ Lisp_Object, EMACS_INT, EMACS_INT,
+ EMACS_INT, EMACS_INT);
+static EMACS_INT boyer_moore (int, unsigned char *, int, int,
+ Lisp_Object, Lisp_Object,
+ EMACS_INT, EMACS_INT,
+ EMACS_INT, EMACS_INT, int);
+static EMACS_INT search_buffer (Lisp_Object, EMACS_INT, EMACS_INT,
+ EMACS_INT, EMACS_INT, int, int,
+ Lisp_Object, Lisp_Object, int);
+static void matcher_overflow (void) NO_RETURN;
static void
-matcher_overflow ()
+matcher_overflow (void)
{
error ("Stack overflow in regexp matcher");
}
@@ -132,12 +132,7 @@ matcher_overflow ()
The behavior also depends on Vsearch_spaces_regexp. */
static void
-compile_pattern_1 (cp, pattern, translate, regp, posix)
- struct regexp_cache *cp;
- Lisp_Object pattern;
- Lisp_Object translate;
- struct re_registers *regp;
- int posix;
+compile_pattern_1 (struct regexp_cache *cp, Lisp_Object pattern, Lisp_Object translate, struct re_registers *regp, int posix)
{
char *val;
reg_syntax_t old;
@@ -187,7 +182,7 @@ compile_pattern_1 (cp, pattern, translate, regp, posix)
This is called from garbage collection. */
void
-shrink_regexp_cache ()
+shrink_regexp_cache (void)
{
struct regexp_cache *cp;
@@ -205,7 +200,7 @@ shrink_regexp_cache ()
automagically manages the memory in each re_pattern_buffer struct,
based on its `allocated' and `buffer' values. */
void
-clear_regexp_cache ()
+clear_regexp_cache (void)
{
int i;
@@ -229,11 +224,7 @@ clear_regexp_cache ()
for this pattern. 0 means backtrack only enough to get a valid match. */
struct re_pattern_buffer *
-compile_pattern (pattern, regp, translate, posix, multibyte)
- Lisp_Object pattern;
- struct re_registers *regp;
- Lisp_Object translate;
- int posix, multibyte;
+compile_pattern (Lisp_Object pattern, struct re_registers *regp, Lisp_Object translate, int posix, int multibyte)
{
struct regexp_cache *cp, **cpp;
@@ -290,9 +281,7 @@ compile_pattern (pattern, regp, translate, posix, multibyte)
static Lisp_Object
-looking_at_1 (string, posix)
- Lisp_Object string;
- int posix;
+looking_at_1 (Lisp_Object string, int posix)
{
Lisp_Object val;
unsigned char *p1, *p2;
@@ -373,8 +362,7 @@ DEFUN ("looking-at", Flooking_at, Slooking_at, 1, 1, 0,
This function modifies the match data that `match-beginning',
`match-end' and `match-data' access; save and restore the match
data if you want to preserve them. */)
- (regexp)
- Lisp_Object regexp;
+ (Lisp_Object regexp)
{
return looking_at_1 (regexp, 0);
}
@@ -385,16 +373,13 @@ Find the longest match, in accord with Posix regular expression rules.
This function modifies the match data that `match-beginning',
`match-end' and `match-data' access; save and restore the match
data if you want to preserve them. */)
- (regexp)
- Lisp_Object regexp;
+ (Lisp_Object regexp)
{
return looking_at_1 (regexp, 1);
}
static Lisp_Object
-string_match_1 (regexp, string, start, posix)
- Lisp_Object regexp, string, start;
- int posix;
+string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, int posix)
{
int val;
struct re_pattern_buffer *bufp;
@@ -474,8 +459,7 @@ matched by parenthesis constructs in the pattern.
You can use the function `match-string' to extract the substrings
matched by the parenthesis constructions in REGEXP. */)
- (regexp, string, start)
- Lisp_Object regexp, string, start;
+ (Lisp_Object regexp, Lisp_Object string, Lisp_Object start)
{
return string_match_1 (regexp, string, start, 0);
}
@@ -488,8 +472,7 @@ If third arg START is non-nil, start search at that index in STRING.
For index of first char beyond the match, do (match-end 0).
`match-end' and `match-beginning' also give indices of substrings
matched by parenthesis constructs in the pattern. */)
- (regexp, string, start)
- Lisp_Object regexp, string, start;
+ (Lisp_Object regexp, Lisp_Object string, Lisp_Object start)
{
return string_match_1 (regexp, string, start, 1);
}
@@ -499,8 +482,7 @@ matched by parenthesis constructs in the pattern. */)
This does not clobber the match data. */
int
-fast_string_match (regexp, string)
- Lisp_Object regexp, string;
+fast_string_match (Lisp_Object regexp, Lisp_Object string)
{
int val;
struct re_pattern_buffer *bufp;
@@ -525,9 +507,7 @@ fast_string_match (regexp, string)
extern Lisp_Object Vascii_downcase_table;
int
-fast_c_string_match_ignore_case (regexp, string)
- Lisp_Object regexp;
- const char *string;
+fast_c_string_match_ignore_case (Lisp_Object regexp, const char *string)
{
int val;
struct re_pattern_buffer *bufp;
@@ -547,8 +527,7 @@ fast_c_string_match_ignore_case (regexp, string)
/* Like fast_string_match but ignore case. */
int
-fast_string_match_ignore_case (regexp, string)
- Lisp_Object regexp, string;
+fast_string_match_ignore_case (Lisp_Object regexp, Lisp_Object string)
{
int val;
struct re_pattern_buffer *bufp;
@@ -572,10 +551,7 @@ fast_string_match_ignore_case (regexp, string)
data. */
EMACS_INT
-fast_looking_at (regexp, pos, pos_byte, limit, limit_byte, string)
- Lisp_Object regexp;
- EMACS_INT pos, pos_byte, limit, limit_byte;
- Lisp_Object string;
+fast_looking_at (Lisp_Object regexp, EMACS_INT pos, EMACS_INT pos_byte, EMACS_INT limit, EMACS_INT limit_byte, Lisp_Object string)
{
int multibyte;
struct re_pattern_buffer *buf;
@@ -640,8 +616,7 @@ fast_looking_at (regexp, pos, pos_byte, limit, limit_byte, string)
This is our cheezy way of associating an action with the change of
state of a buffer-local variable. */
static void
-newline_cache_on_off (buf)
- struct buffer *buf;
+newline_cache_on_off (struct buffer *buf)
{
if (NILP (buf->cache_long_line_scans))
{
@@ -682,12 +657,7 @@ newline_cache_on_off (buf)
except when inside redisplay. */
int
-scan_buffer (target, start, end, count, shortage, allow_quit)
- register int target;
- EMACS_INT start, end;
- int count;
- int *shortage;
- int allow_quit;
+scan_buffer (register int target, EMACS_INT start, EMACS_INT end, int count, int *shortage, int allow_quit)
{
struct region_cache *newline_cache;
int direction;
@@ -879,11 +849,7 @@ scan_buffer (target, start, end, count, shortage, allow_quit)
except in special cases. */
int
-scan_newline (start, start_byte, limit, limit_byte, count, allow_quit)
- EMACS_INT start, start_byte;
- EMACS_INT limit, limit_byte;
- register int count;
- int allow_quit;
+scan_newline (EMACS_INT start, EMACS_INT start_byte, EMACS_INT limit, EMACS_INT limit_byte, register int count, int allow_quit)
{
int direction = ((count > 0) ? 1 : -1);
@@ -977,9 +943,7 @@ scan_newline (start, start_byte, limit, limit_byte, count, allow_quit)
}
int
-find_next_newline_no_quit (from, cnt)
- EMACS_INT from;
- int cnt;
+find_next_newline_no_quit (EMACS_INT from, int cnt)
{
return scan_buffer ('\n', from, 0, cnt, (int *) 0, 0);
}
@@ -989,9 +953,7 @@ find_next_newline_no_quit (from, cnt)
find_next_newline (...)-1, because you might hit TO. */
int
-find_before_next_newline (from, to, cnt)
- EMACS_INT from, to;
- int cnt;
+find_before_next_newline (EMACS_INT from, EMACS_INT to, int cnt)
{
int shortage;
int pos = scan_buffer ('\n', from, to, cnt, &shortage, 1);
@@ -1005,11 +967,7 @@ find_before_next_newline (from, to, cnt)
/* Subroutines of Lisp buffer search functions. */
static Lisp_Object
-search_command (string, bound, noerror, count, direction, RE, posix)
- Lisp_Object string, bound, noerror, count;
- int direction;
- int RE;
- int posix;
+search_command (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count, int direction, int RE, int posix)
{
register int np;
int lim, lim_byte;
@@ -1086,8 +1044,7 @@ search_command (string, bound, noerror, count, direction, RE, posix)
/* Return 1 if REGEXP it matches just one constant string. */
static int
-trivial_regexp_p (regexp)
- Lisp_Object regexp;
+trivial_regexp_p (Lisp_Object regexp)
{
int len = SBYTES (regexp);
unsigned char *s = SDATA (regexp);
@@ -1153,18 +1110,9 @@ while (0)
static struct re_registers search_regs_1;
static EMACS_INT
-search_buffer (string, pos, pos_byte, lim, lim_byte, n,
- RE, trt, inverse_trt, posix)
- Lisp_Object string;
- EMACS_INT pos;
- EMACS_INT pos_byte;
- EMACS_INT lim;
- EMACS_INT lim_byte;
- int n;
- int RE;
- Lisp_Object trt;
- Lisp_Object inverse_trt;
- int posix;
+search_buffer (Lisp_Object string, EMACS_INT pos, EMACS_INT pos_byte,
+ EMACS_INT lim, EMACS_INT lim_byte, int n,
+ int RE, Lisp_Object trt, Lisp_Object inverse_trt, int posix)
{
int len = SCHARS (string);
int len_byte = SBYTES (string);
@@ -1443,7 +1391,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
}
/* Store this character into the translated pattern. */
- bcopy (str, pat, charlen);
+ memcpy (pat, str, charlen);
pat += charlen;
base_pat += in_charlen;
len_byte -= in_charlen;
@@ -1504,13 +1452,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
boyer_moore cannot work. */
static EMACS_INT
-simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
- int n;
- unsigned char *pat;
- int len, len_byte;
- Lisp_Object trt;
- EMACS_INT pos, pos_byte;
- EMACS_INT lim, lim_byte;
+simple_search (int n, unsigned char *pat, int len, int len_byte, Lisp_Object trt, EMACS_INT pos, EMACS_INT pos_byte, EMACS_INT lim, EMACS_INT lim_byte)
{
int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
int forward = n > 0;
@@ -1717,16 +1659,10 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
If that criterion is not satisfied, do not call this function. */
static EMACS_INT
-boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
- pos, pos_byte, lim, lim_byte, char_base)
- int n;
- unsigned char *base_pat;
- int len, len_byte;
- Lisp_Object trt;
- Lisp_Object inverse_trt;
- EMACS_INT pos, pos_byte;
- EMACS_INT lim, lim_byte;
- int char_base;
+boyer_moore (int n, unsigned char *base_pat, int len, int len_byte,
+ Lisp_Object trt, Lisp_Object inverse_trt,
+ EMACS_INT pos, EMACS_INT pos_byte,
+ EMACS_INT lim, EMACS_INT lim_byte, int char_base)
{
int direction = ((n > 0) ? 1 : -1);
register int dirlen;
@@ -2127,8 +2063,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
Also clear out the match data for registers 1 and up. */
static void
-set_search_regs (beg_byte, nbytes)
- EMACS_INT beg_byte, nbytes;
+set_search_regs (EMACS_INT beg_byte, EMACS_INT nbytes)
{
int i;
@@ -2162,9 +2097,7 @@ set_search_regs (beg_byte, nbytes)
need not match a word boundary unless it ends in whitespace. */
static Lisp_Object
-wordify (string, lax)
- Lisp_Object string;
- int lax;
+wordify (Lisp_Object string, int lax)
{
register unsigned char *p, *o;
register int i, i_byte, len, punct_count = 0, word_count = 0;
@@ -2226,8 +2159,7 @@ wordify (string, lax)
if (SYNTAX (c) == Sword)
{
- bcopy (SDATA (string) + i_byte_orig, o,
- i_byte - i_byte_orig);
+ memcpy (o, SDATA (string) + i_byte_orig, i_byte - i_byte_orig);
o += i_byte - i_byte_orig;
}
else if (i > 0 && SYNTAX (prev_c) == Sword && --word_count)
@@ -2265,8 +2197,7 @@ Search case-sensitivity is determined by the value of the variable
`case-fold-search', which see.
See also the functions `match-beginning', `match-end' and `replace-match'. */)
- (string, bound, noerror, count)
- Lisp_Object string, bound, noerror, count;
+ (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
{
return search_command (string, bound, noerror, count, -1, 0, 0);
}
@@ -2285,8 +2216,7 @@ Search case-sensitivity is determined by the value of the variable
`case-fold-search', which see.
See also the functions `match-beginning', `match-end' and `replace-match'. */)
- (string, bound, noerror, count)
- Lisp_Object string, bound, noerror, count;
+ (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
{
return search_command (string, bound, noerror, count, 1, 0, 0);
}
@@ -2300,8 +2230,7 @@ The match found must not extend before that position.
Optional third argument, if t, means if fail just return nil (no error).
If not nil and not t, move to limit of search and return nil.
Optional fourth argument is repeat count--search for successive occurrences. */)
- (string, bound, noerror, count)
- Lisp_Object string, bound, noerror, count;
+ (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
{
return search_command (wordify (string, 0), bound, noerror, count, -1, 1, 0);
}
@@ -2315,8 +2244,7 @@ The match found must not extend after that position.
Optional third argument, if t, means if fail just return nil (no error).
If not nil and not t, move to limit of search and return nil.
Optional fourth argument is repeat count--search for successive occurrences. */)
- (string, bound, noerror, count)
- Lisp_Object string, bound, noerror, count;
+ (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
{
return search_command (wordify (string, 0), bound, noerror, count, 1, 1, 0);
}
@@ -2334,8 +2262,7 @@ The match found must not extend before that position.
Optional third argument, if t, means if fail just return nil (no error).
If not nil and not t, move to limit of search and return nil.
Optional fourth argument is repeat count--search for successive occurrences. */)
- (string, bound, noerror, count)
- Lisp_Object string, bound, noerror, count;
+ (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
{
return search_command (wordify (string, 1), bound, noerror, count, -1, 1, 0);
}
@@ -2353,8 +2280,7 @@ The match found must not extend after that position.
Optional third argument, if t, means if fail just return nil (no error).
If not nil and not t, move to limit of search and return nil.
Optional fourth argument is repeat count--search for successive occurrences. */)
- (string, bound, noerror, count)
- Lisp_Object string, bound, noerror, count;
+ (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
{
return search_command (wordify (string, 1), bound, noerror, count, 1, 1, 0);
}
@@ -2372,8 +2298,7 @@ Optional third argument, if t, means if fail just return nil (no error).
Optional fourth argument is repeat count--search for successive occurrences.
See also the functions `match-beginning', `match-end', `match-string',
and `replace-match'. */)
- (regexp, bound, noerror, count)
- Lisp_Object regexp, bound, noerror, count;
+ (Lisp_Object regexp, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
{
return search_command (regexp, bound, noerror, count, -1, 1, 0);
}
@@ -2389,8 +2314,7 @@ Optional third argument, if t, means if fail just return nil (no error).
Optional fourth argument is repeat count--search for successive occurrences.
See also the functions `match-beginning', `match-end', `match-string',
and `replace-match'. */)
- (regexp, bound, noerror, count)
- Lisp_Object regexp, bound, noerror, count;
+ (Lisp_Object regexp, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
{
return search_command (regexp, bound, noerror, count, 1, 1, 0);
}
@@ -2409,8 +2333,7 @@ Optional third argument, if t, means if fail just return nil (no error).
Optional fourth argument is repeat count--search for successive occurrences.
See also the functions `match-beginning', `match-end', `match-string',
and `replace-match'. */)
- (regexp, bound, noerror, count)
- Lisp_Object regexp, bound, noerror, count;
+ (Lisp_Object regexp, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
{
return search_command (regexp, bound, noerror, count, -1, 1, 1);
}
@@ -2427,8 +2350,7 @@ Optional third argument, if t, means if fail just return nil (no error).
Optional fourth argument is repeat count--search for successive occurrences.
See also the functions `match-beginning', `match-end', `match-string',
and `replace-match'. */)
- (regexp, bound, noerror, count)
- Lisp_Object regexp, bound, noerror, count;
+ (Lisp_Object regexp, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
{
return search_command (regexp, bound, noerror, count, 1, 1, 1);
}
@@ -2469,8 +2391,7 @@ This is, in a vague sense, the inverse of using `\\N' in NEWTEXT;
NEWTEXT in place of subexp N.
This is useful only after a regular expression search or match,
since only regular expressions have distinguished subexpressions. */)
- (newtext, fixedcase, literal, string, subexp)
- Lisp_Object newtext, fixedcase, literal, string, subexp;
+ (Lisp_Object newtext, Lisp_Object fixedcase, Lisp_Object literal, Lisp_Object string, Lisp_Object subexp)
{
enum { nochange, all_caps, cap_initial } case_action;
register int pos, pos_byte;
@@ -2822,7 +2743,7 @@ since only regular expressions have distinguished subexpressions. */)
/* Now add to the end of SUBSTED. */
if (add_stuff)
{
- bcopy (add_stuff, substed + substed_len, add_len);
+ memcpy (substed + substed_len, add_stuff, add_len);
substed_len += add_len;
}
}
@@ -2886,9 +2807,7 @@ since only regular expressions have distinguished subexpressions. */)
}
static Lisp_Object
-match_limit (num, beginningp)
- Lisp_Object num;
- int beginningp;
+match_limit (Lisp_Object num, int beginningp)
{
register int n;
@@ -2912,8 +2831,7 @@ SUBEXP, a number, specifies which parenthesized expression in the last
Value is nil if SUBEXPth pair didn't match, or there were less than
SUBEXP pairs.
Zero means the entire text matched by the whole regexp or whole string. */)
- (subexp)
- Lisp_Object subexp;
+ (Lisp_Object subexp)
{
return match_limit (subexp, 1);
}
@@ -2925,8 +2843,7 @@ SUBEXP, a number, specifies which parenthesized expression in the last
Value is nil if SUBEXPth pair didn't match, or there were less than
SUBEXP pairs.
Zero means the entire text matched by the whole regexp or whole string. */)
- (subexp)
- Lisp_Object subexp;
+ (Lisp_Object subexp)
{
return match_limit (subexp, 0);
}
@@ -2951,8 +2868,7 @@ If optional third arg RESEAT is non-nil, any previous markers on the
REUSE list will be modified to point to nowhere.
Return value is undefined if the last search failed. */)
- (integers, reuse, reseat)
- Lisp_Object integers, reuse, reseat;
+ (Lisp_Object integers, Lisp_Object reuse, Lisp_Object reseat)
{
Lisp_Object tail, prev;
Lisp_Object *data;
@@ -3052,8 +2968,7 @@ DEFUN ("set-match-data", Fset_match_data, Sset_match_data, 1, 2, 0,
LIST should have been created by calling `match-data' previously.
If optional arg RESEAT is non-nil, make markers on LIST point nowhere. */)
- (list, reseat)
- register Lisp_Object list, reseat;
+ (register Lisp_Object list, Lisp_Object reseat)
{
register int i;
register Lisp_Object marker;
@@ -3171,7 +3086,7 @@ static Lisp_Object saved_last_thing_searched;
/* Called from Flooking_at, Fstring_match, search_buffer, Fstore_match_data
if asynchronous code (filter or sentinel) is running. */
static void
-save_search_regs ()
+save_search_regs (void)
{
if (!search_regs_saved)
{
@@ -3190,7 +3105,7 @@ save_search_regs ()
/* Called upon exit from filters and sentinels. */
void
-restore_search_regs ()
+restore_search_regs (void)
{
if (search_regs_saved)
{
@@ -3209,8 +3124,7 @@ restore_search_regs ()
}
static Lisp_Object
-unwind_set_match_data (list)
- Lisp_Object list;
+unwind_set_match_data (Lisp_Object list)
{
/* It is NOT ALWAYS safe to free (evaporate) the markers immediately. */
return Fset_match_data (list, Qt);
@@ -3218,7 +3132,7 @@ unwind_set_match_data (list)
/* Called to unwind protect the match data. */
void
-record_unwind_save_match_data ()
+record_unwind_save_match_data (void)
{
record_unwind_protect (unwind_set_match_data,
Fmatch_data (Qnil, Qnil, Qnil));
@@ -3228,8 +3142,7 @@ record_unwind_save_match_data ()
DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0,
doc: /* Return a regexp string which matches exactly STRING and nothing else. */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
register unsigned char *in, *out, *end;
register unsigned char *temp;
@@ -3262,7 +3175,7 @@ DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0,
}
void
-syms_of_search ()
+syms_of_search (void)
{
register int i;
diff --git a/src/sound.c b/src/sound.c
index af6daf2e268..e0ebd565151 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -115,10 +115,10 @@ enum sound_attr
SOUND_ATTR_SENTINEL
};
-static void alsa_sound_perror P_ ((char *, int)) NO_RETURN;
-static void sound_perror P_ ((char *)) NO_RETURN;
-static void sound_warning P_ ((char *));
-static int parse_sound P_ ((Lisp_Object, Lisp_Object *));
+static void alsa_sound_perror (char *, int) NO_RETURN;
+static void sound_perror (char *) NO_RETURN;
+static void sound_warning (char *);
+static int parse_sound (Lisp_Object, Lisp_Object *);
/* END: Common Definitions */
@@ -225,25 +225,25 @@ struct sound_device
int channels;
/* Open device SD. */
- void (* open) P_ ((struct sound_device *sd));
+ void (* open) (struct sound_device *sd);
/* Close device SD. */
- void (* close) P_ ((struct sound_device *sd));
+ void (* close) (struct sound_device *sd);
/* Configure SD accoring to device-dependent parameters. */
- void (* configure) P_ ((struct sound_device *device));
+ void (* configure) (struct sound_device *device);
/* Choose a device-dependent format for outputting sound S. */
- void (* choose_format) P_ ((struct sound_device *sd,
- struct sound *s));
+ void (* choose_format) (struct sound_device *sd,
+ struct sound *s);
/* Return a preferred data size in bytes to be sent to write (below)
each time. 2048 is used if this is NULL. */
- int (* period_size) P_ ((struct sound_device *sd));
+ int (* period_size) (struct sound_device *sd);
/* Write NYBTES bytes from BUFFER to device SD. */
- void (* write) P_ ((struct sound_device *sd, const char *buffer,
- int nbytes));
+ void (* write) (struct sound_device *sd, const char *buffer,
+ int nbytes);
/* A place for devices to store additional data. */
void *data;
@@ -279,7 +279,7 @@ struct sound
Lisp_Object data;
/* Play sound file S on device SD. */
- void (* play) P_ ((struct sound *s, struct sound_device *sd));
+ void (* play) (struct sound *s, struct sound_device *sd);
};
/* These are set during `play-sound-internal' so that sound_cleanup has
@@ -290,30 +290,30 @@ struct sound *current_sound;
/* Function prototypes. */
-static void vox_open P_ ((struct sound_device *));
-static void vox_configure P_ ((struct sound_device *));
-static void vox_close P_ ((struct sound_device *sd));
-static void vox_choose_format P_ ((struct sound_device *, struct sound *));
-static int vox_init P_ ((struct sound_device *));
-static void vox_write P_ ((struct sound_device *, const char *, int));
-static void find_sound_type P_ ((struct sound *));
-static u_int32_t le2hl P_ ((u_int32_t));
-static u_int16_t le2hs P_ ((u_int16_t));
-static u_int32_t be2hl P_ ((u_int32_t));
-static int wav_init P_ ((struct sound *));
-static void wav_play P_ ((struct sound *, struct sound_device *));
-static int au_init P_ ((struct sound *));
-static void au_play P_ ((struct sound *, struct sound_device *));
+static void vox_open (struct sound_device *);
+static void vox_configure (struct sound_device *);
+static void vox_close (struct sound_device *sd);
+static void vox_choose_format (struct sound_device *, struct sound *);
+static int vox_init (struct sound_device *);
+static void vox_write (struct sound_device *, const char *, int);
+static void find_sound_type (struct sound *);
+static u_int32_t le2hl (u_int32_t);
+static u_int16_t le2hs (u_int16_t);
+static u_int32_t be2hl (u_int32_t);
+static int wav_init (struct sound *);
+static void wav_play (struct sound *, struct sound_device *);
+static int au_init (struct sound *);
+static void au_play (struct sound *, struct sound_device *);
#if 0 /* Currently not used. */
-static u_int16_t be2hs P_ ((u_int16_t));
+static u_int16_t be2hs (u_int16_t);
#endif
/* END: Non Windows Definitions */
#else /* WINDOWSNT */
/* BEGIN: Windows Specific Definitions */
-static int do_play_sound P_ ((const char *, unsigned long));
+static int do_play_sound (const char *, unsigned long);
/*
END: Windows Specific Definitions */
#endif /* WINDOWSNT */
@@ -328,8 +328,7 @@ static int do_play_sound P_ ((const char *, unsigned long));
/* Like perror, but signals an error. */
static void
-sound_perror (msg)
- char *msg;
+sound_perror (char *msg)
{
int saved_errno = errno;
@@ -347,8 +346,7 @@ sound_perror (msg)
/* Display a warning message. */
static void
-sound_warning (msg)
- char *msg;
+sound_warning (char *msg)
{
message (msg);
}
@@ -381,9 +379,7 @@ sound_warning (msg)
range [0, 1]. */
static int
-parse_sound (sound, attrs)
- Lisp_Object sound;
- Lisp_Object *attrs;
+parse_sound (Lisp_Object sound, Lisp_Object *attrs)
{
/* SOUND must be a list starting with the symbol `sound'. */
if (!CONSP (sound) || !EQ (XCAR (sound), Qsound))
@@ -452,8 +448,7 @@ parse_sound (sound, attrs)
S is the sound file structure to fill in. */
static void
-find_sound_type (s)
- struct sound *s;
+find_sound_type (struct sound *s)
{
if (!wav_init (s) && !au_init (s))
error ("Unknown sound format");
@@ -463,8 +458,7 @@ find_sound_type (s)
/* Function installed by play-sound-internal with record_unwind_protect. */
static Lisp_Object
-sound_cleanup (arg)
- Lisp_Object arg;
+sound_cleanup (Lisp_Object arg)
{
if (current_sound_device->close)
current_sound_device->close (current_sound_device);
@@ -484,8 +478,7 @@ sound_cleanup (arg)
to host byte-order. */
static u_int32_t
-le2hl (value)
- u_int32_t value;
+le2hl (u_int32_t value)
{
#ifdef WORDS_BIG_ENDIAN
unsigned char *p = (unsigned char *) &value;
@@ -499,8 +492,7 @@ le2hl (value)
to host byte-order. */
static u_int16_t
-le2hs (value)
- u_int16_t value;
+le2hs (u_int16_t value)
{
#ifdef WORDS_BIG_ENDIAN
unsigned char *p = (unsigned char *) &value;
@@ -514,8 +506,7 @@ le2hs (value)
to host byte-order. */
static u_int32_t
-be2hl (value)
- u_int32_t value;
+be2hl (u_int32_t value)
{
#ifndef WORDS_BIG_ENDIAN
unsigned char *p = (unsigned char *) &value;
@@ -531,8 +522,7 @@ be2hl (value)
to host byte-order. */
static u_int16_t
-be2hs (value)
- u_int16_t value;
+be2hs (u_int16_t value)
{
#ifndef WORDS_BIG_ENDIAN
unsigned char *p = (unsigned char *) &value;
@@ -554,13 +544,12 @@ be2hs (value)
Value is non-zero if the file is a WAV file. */
static int
-wav_init (s)
- struct sound *s;
+wav_init (struct sound *s)
{
struct wav_header *header = (struct wav_header *) s->header;
if (s->header_size < sizeof *header
- || bcmp (s->header, "RIFF", 4) != 0)
+ || memcmp (s->header, "RIFF", 4) != 0)
return 0;
/* WAV files are in little-endian order. Convert the header
@@ -590,9 +579,7 @@ wav_init (s)
/* Play RIFF-WAVE audio file S on sound device SD. */
static void
-wav_play (s, sd)
- struct sound *s;
- struct sound_device *sd;
+wav_play (struct sound *s, struct sound_device *sd)
{
struct wav_header *header = (struct wav_header *) s->header;
@@ -665,13 +652,12 @@ enum au_encoding
Value is non-zero if the file is an AU file. */
static int
-au_init (s)
- struct sound *s;
+au_init (struct sound *s)
{
struct au_header *header = (struct au_header *) s->header;
if (s->header_size < sizeof *header
- || bcmp (s->header, ".snd", 4) != 0)
+ || memcmp (s->header, ".snd", 4) != 0)
return 0;
header->magic_number = be2hl (header->magic_number);
@@ -692,9 +678,7 @@ au_init (s)
/* Play Sun audio file S on sound device SD. */
static void
-au_play (s, sd)
- struct sound *s;
- struct sound_device *sd;
+au_play (struct sound *s, struct sound_device *sd)
{
struct au_header *header = (struct au_header *) s->header;
@@ -740,8 +724,7 @@ au_play (s, sd)
otherwise use a default device name. */
static void
-vox_open (sd)
- struct sound_device *sd;
+vox_open (struct sound_device *sd)
{
char *file;
@@ -760,8 +743,7 @@ vox_open (sd)
/* Configure device SD from parameters in it. */
static void
-vox_configure (sd)
- struct sound_device *sd;
+vox_configure (struct sound_device *sd)
{
int val;
@@ -814,8 +796,7 @@ vox_configure (sd)
/* Close device SD if it is open. */
static void
-vox_close (sd)
- struct sound_device *sd;
+vox_close (struct sound_device *sd)
{
if (sd->fd >= 0)
{
@@ -845,9 +826,7 @@ vox_close (sd)
/* Choose device-dependent format for device SD from sound file S. */
static void
-vox_choose_format (sd, s)
- struct sound_device *sd;
- struct sound *s;
+vox_choose_format (struct sound_device *sd, struct sound *s)
{
if (s->type == RIFF)
{
@@ -890,8 +869,7 @@ vox_choose_format (sd, s)
structure. */
static int
-vox_init (sd)
- struct sound_device *sd;
+vox_init (struct sound_device *sd)
{
char *file;
int fd;
@@ -921,10 +899,7 @@ vox_init (sd)
/* Write NBYTES bytes from BUFFER to device SD. */
static void
-vox_write (sd, buffer, nbytes)
- struct sound_device *sd;
- const char *buffer;
- int nbytes;
+vox_write (struct sound_device *sd, const char *buffer, int nbytes)
{
int nwritten = emacs_write (sd->fd, buffer, nbytes);
if (nwritten < 0)
@@ -939,9 +914,7 @@ vox_write (sd, buffer, nbytes)
/* This driver is available on GNU/Linux. */
static void
-alsa_sound_perror (msg, err)
- char *msg;
- int err;
+alsa_sound_perror (char *msg, int err)
{
error ("%s: %s", msg, snd_strerror (err));
}
@@ -958,8 +931,7 @@ struct alsa_params
otherwise use a default device name. */
static void
-alsa_open (sd)
- struct sound_device *sd;
+alsa_open (struct sound_device *sd)
{
char *file;
struct alsa_params *p;
@@ -986,8 +958,7 @@ alsa_open (sd)
}
static int
-alsa_period_size (sd)
- struct sound_device *sd;
+alsa_period_size (struct sound_device *sd)
{
struct alsa_params *p = (struct alsa_params *) sd->data;
int fact = snd_pcm_format_size (sd->format, 1) * sd->channels;
@@ -995,8 +966,7 @@ alsa_period_size (sd)
}
static void
-alsa_configure (sd)
- struct sound_device *sd;
+alsa_configure (struct sound_device *sd)
{
int val, err, dir;
unsigned uval;
@@ -1115,8 +1085,7 @@ alsa_configure (sd)
/* Close device SD if it is open. */
static void
-alsa_close (sd)
- struct sound_device *sd;
+alsa_close (struct sound_device *sd)
{
struct alsa_params *p = (struct alsa_params *) sd->data;
if (p)
@@ -1137,9 +1106,7 @@ alsa_close (sd)
/* Choose device-dependent format for device SD from sound file S. */
static void
-alsa_choose_format (sd, s)
- struct sound_device *sd;
- struct sound *s;
+alsa_choose_format (struct sound_device *sd, struct sound *s)
{
struct alsa_params *p = (struct alsa_params *) sd->data;
if (s->type == RIFF)
@@ -1194,10 +1161,7 @@ alsa_choose_format (sd, s)
/* Write NBYTES bytes from BUFFER to device SD. */
static void
-alsa_write (sd, buffer, nbytes)
- struct sound_device *sd;
- const char *buffer;
- int nbytes;
+alsa_write (struct sound_device *sd, const char *buffer, int nbytes)
{
struct alsa_params *p = (struct alsa_params *) sd->data;
@@ -1244,12 +1208,8 @@ alsa_write (sd, buffer, nbytes)
}
static void
-snd_error_quiet (file, line, function, err, fmt)
- const char *file;
- int line;
- const char *function;
- int err;
- const char *fmt;
+snd_error_quiet (const char *file, int line, const char *function, int err,
+ const char *fmt)
{
}
@@ -1257,8 +1217,7 @@ snd_error_quiet (file, line, function, err, fmt)
structure. */
static int
-alsa_init (sd)
- struct sound_device *sd;
+alsa_init (struct sound_device *sd)
{
char *file;
snd_pcm_t *handle;
@@ -1307,9 +1266,7 @@ alsa_init (sd)
}
static int
-do_play_sound (psz_file, ui_volume)
- const char *psz_file;
- unsigned long ui_volume;
+do_play_sound (const char *psz_file, unsigned long ui_volume)
{
int i_result = 0;
MCIERROR mci_error = 0;
@@ -1394,8 +1351,7 @@ DEFUN ("play-sound-internal", Fplay_sound_internal, Splay_sound_internal, 1, 1,
doc: /* Play sound SOUND.
Internal use only, use `play-sound' instead. */)
- (sound)
- Lisp_Object sound;
+ (Lisp_Object sound)
{
Lisp_Object attrs[SOUND_ATTR_SENTINEL];
int count = SPECPDL_INDEX ();
@@ -1421,9 +1377,9 @@ Internal use only, use `play-sound' instead. */)
file = Qnil;
GCPRO2 (sound, file);
current_sound_device = (struct sound_device *) xmalloc (sizeof (struct sound_device));
- bzero (current_sound_device, sizeof (struct sound_device));
+ memset (current_sound_device, 0, sizeof (struct sound_device));
current_sound = (struct sound *) xmalloc (sizeof (struct sound));
- bzero (current_sound, sizeof (struct sound));
+ memset (current_sound, 0, sizeof (struct sound));
record_unwind_protect (sound_cleanup, Qnil);
current_sound->header = (char *) alloca (MAX_SOUND_HEADER_BYTES);
@@ -1446,7 +1402,8 @@ Internal use only, use `play-sound' instead. */)
{
current_sound->data = attrs[SOUND_DATA];
current_sound->header_size = min (MAX_SOUND_HEADER_BYTES, SBYTES (current_sound->data));
- bcopy (SDATA (current_sound->data), current_sound->header, current_sound->header_size);
+ memcpy (current_sound->header, SDATA (current_sound->data),
+ current_sound->header_size);
}
/* Find out the type of sound. Give up if we can't tell. */
@@ -1524,7 +1481,7 @@ Internal use only, use `play-sound' instead. */)
***********************************************************************/
void
-syms_of_sound ()
+syms_of_sound (void)
{
QCdevice = intern_c_string(":device");
staticpro (&QCdevice);
@@ -1540,7 +1497,7 @@ syms_of_sound ()
void
-init_sound ()
+init_sound (void)
{
}
diff --git a/src/strftime.c b/src/strftime.c
index 7a9506e55d3..a7617427793 100644
--- a/src/strftime.c
+++ b/src/strftime.c
@@ -131,14 +131,6 @@ extern char *tzname[];
# endif
#endif
-#ifndef __P
-# if defined __GNUC__ || (defined __STDC__ && __STDC__) || defined (PROTOTYPES)
-# define __P(args) args
-# else
-# define __P(args) ()
-# endif /* GCC. */
-#endif /* Not __P. */
-
#ifndef PTR
# ifdef __STDC__
# define PTR void *
@@ -187,7 +179,7 @@ extern char *tzname[];
Similarly for localtime_r. */
# if ! HAVE_TM_GMTOFF
-static struct tm *my_strftime_gmtime_r __P ((const time_t *, struct tm *));
+static struct tm *my_strftime_gmtime_r (const time_t *, struct tm *);
static struct tm *
my_strftime_gmtime_r (t, tp)
const time_t *t;
@@ -200,7 +192,7 @@ my_strftime_gmtime_r (t, tp)
return tp;
}
-static struct tm *my_strftime_localtime_r __P ((const time_t *, struct tm *));
+static struct tm *my_strftime_localtime_r (const time_t *, struct tm *);
static struct tm *
my_strftime_localtime_r (t, tp)
const time_t *t;
@@ -371,8 +363,8 @@ static const CHAR_T zeroes[16] = /* "0000000000000000" */
more reliable way to accept other sets of digits. */
#define ISDIGIT(Ch) ((unsigned int) (Ch) - L_('0') <= 9)
-static CHAR_T *memcpy_lowcase __P ((CHAR_T *dest, const CHAR_T *src,
- size_t len LOCALE_PARAM_PROTO));
+static CHAR_T *memcpy_lowcase (CHAR_T *dest, const CHAR_T *src,
+ size_t len LOCALE_PARAM_PROTO);
static CHAR_T *
memcpy_lowcase (dest, src, len LOCALE_PARAM)
@@ -386,8 +378,8 @@ memcpy_lowcase (dest, src, len LOCALE_PARAM)
return dest;
}
-static CHAR_T *memcpy_uppcase __P ((CHAR_T *dest, const CHAR_T *src,
- size_t len LOCALE_PARAM_PROTO));
+static CHAR_T *memcpy_uppcase (CHAR_T *dest, const CHAR_T *src,
+ size_t len LOCALE_PARAM_PROTO);
static CHAR_T *
memcpy_uppcase (dest, src, len LOCALE_PARAM)
@@ -406,7 +398,7 @@ memcpy_uppcase (dest, src, len LOCALE_PARAM)
/* Yield the difference between *A and *B,
measured in seconds, ignoring leap seconds. */
# define tm_diff ftime_tm_diff
-static int tm_diff __P ((const struct tm *, const struct tm *));
+static int tm_diff (const struct tm *, const struct tm *);
static int
tm_diff (a, b)
const struct tm *a;
@@ -440,7 +432,7 @@ tm_diff (a, b)
#define ISO_WEEK_START_WDAY 1 /* Monday */
#define ISO_WEEK1_WDAY 4 /* Thursday */
#define YDAY_MINIMUM (-366)
-static int iso_week_days __P ((int, int));
+static int iso_week_days (int, int);
#ifdef __GNUC__
__inline__
#endif
@@ -499,8 +491,8 @@ static CHAR_T const month_name[][10] =
#if !defined _LIBC && !defined(WINDOWSNT) && HAVE_TZNAME && HAVE_TZSET
/* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
Work around this bug by copying *tp before it might be munged. */
- size_t _strftime_copytm __P ((char *, size_t, const char *,
- const struct tm * extra_args_spec_iso));
+ size_t _strftime_copytm (char *, size_t, const char *,
+ const struct tm * extra_args_spec_iso);
size_t
my_strftime (s, maxsize, format, tp extra_args)
CHAR_T *s;
diff --git a/src/syntax.c b/src/syntax.c
index 4741fa260d2..9b707c6c3b7 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -98,18 +98,18 @@ static EMACS_INT find_start_begv;
static int find_start_modiff;
-static Lisp_Object skip_chars P_ ((int, Lisp_Object, Lisp_Object, int));
-static Lisp_Object skip_syntaxes P_ ((int, Lisp_Object, Lisp_Object));
-static Lisp_Object scan_lists P_ ((EMACS_INT, EMACS_INT, EMACS_INT, int));
-static void scan_sexps_forward P_ ((struct lisp_parse_state *,
- EMACS_INT, EMACS_INT, EMACS_INT, int,
- int, Lisp_Object, int));
-static int in_classes P_ ((int, Lisp_Object));
+static Lisp_Object skip_chars (int, Lisp_Object, Lisp_Object, int);
+static Lisp_Object skip_syntaxes (int, Lisp_Object, Lisp_Object);
+static Lisp_Object scan_lists (EMACS_INT, EMACS_INT, EMACS_INT, int);
+static void scan_sexps_forward (struct lisp_parse_state *,
+ EMACS_INT, EMACS_INT, EMACS_INT, int,
+ int, Lisp_Object, int);
+static int in_classes (int, Lisp_Object);
struct gl_state_s gl_state; /* Global state of syntax parser. */
-INTERVAL interval_of ();
+INTERVAL interval_of (int, Lisp_Object);
#define INTERVALS_AT_ONCE 10 /* 1 + max-number of intervals
to scan to property-change. */
@@ -127,9 +127,7 @@ INTERVAL interval_of ();
start/end of OBJECT. */
void
-update_syntax_table (charpos, count, init, object)
- int charpos, count, init;
- Lisp_Object object;
+update_syntax_table (int charpos, int count, int init, Lisp_Object object)
{
Lisp_Object tmp_table;
int cnt = 0, invalidate = 1;
@@ -318,8 +316,7 @@ char_quoted (EMACS_INT charpos, EMACS_INT bytepos)
We assume that BYTEPOS is not at the end of the buffer. */
INLINE EMACS_INT
-inc_bytepos (bytepos)
- EMACS_INT bytepos;
+inc_bytepos (EMACS_INT bytepos)
{
if (NILP (current_buffer->enable_multibyte_characters))
return bytepos + 1;
@@ -332,8 +329,7 @@ inc_bytepos (bytepos)
We assume that BYTEPOS is not at the start of the buffer. */
INLINE EMACS_INT
-dec_bytepos (bytepos)
- EMACS_INT bytepos;
+dec_bytepos (EMACS_INT bytepos)
{
if (NILP (current_buffer->enable_multibyte_characters))
return bytepos - 1;
@@ -357,8 +353,7 @@ dec_bytepos (bytepos)
update the global data. */
static EMACS_INT
-find_defun_start (pos, pos_byte)
- EMACS_INT pos, pos_byte;
+find_defun_start (EMACS_INT pos, EMACS_INT pos_byte)
{
EMACS_INT opoint = PT, opoint_byte = PT_BYTE;
@@ -422,8 +417,7 @@ find_defun_start (pos, pos_byte)
/* Return the SYNTAX_COMEND_FIRST of the character before POS, POS_BYTE. */
static int
-prev_char_comend_first (pos, pos_byte)
- int pos, pos_byte;
+prev_char_comend_first (int pos, int pos_byte)
{
int c, val;
@@ -465,10 +459,7 @@ prev_char_comend_first (pos, pos_byte)
the returned value (or at FROM, if the search was not successful). */
static int
-back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_ptr)
- EMACS_INT from, from_byte, stop;
- int comnested, comstyle;
- EMACS_INT *charpos_ptr, *bytepos_ptr;
+back_comment (EMACS_INT from, EMACS_INT from_byte, EMACS_INT stop, int comnested, int comstyle, EMACS_INT *charpos_ptr, EMACS_INT *bytepos_ptr)
{
/* Look back, counting the parity of string-quotes,
and recording the comment-starters seen.
@@ -730,8 +721,7 @@ back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_p
DEFUN ("syntax-table-p", Fsyntax_table_p, Ssyntax_table_p, 1, 1, 0,
doc: /* Return t if OBJECT is a syntax table.
Currently, any char-table counts as a syntax table. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (CHAR_TABLE_P (object)
&& EQ (XCHAR_TABLE (object)->purpose, Qsyntax_table))
@@ -740,8 +730,7 @@ Currently, any char-table counts as a syntax table. */)
}
static void
-check_syntax_table (obj)
- Lisp_Object obj;
+check_syntax_table (Lisp_Object obj)
{
CHECK_TYPE (CHAR_TABLE_P (obj) && EQ (XCHAR_TABLE (obj)->purpose, Qsyntax_table),
Qsyntax_table_p, obj);
@@ -750,7 +739,7 @@ check_syntax_table (obj)
DEFUN ("syntax-table", Fsyntax_table, Ssyntax_table, 0, 0, 0,
doc: /* Return the current syntax table.
This is the one specified by the current buffer. */)
- ()
+ (void)
{
return current_buffer->syntax_table;
}
@@ -759,7 +748,7 @@ DEFUN ("standard-syntax-table", Fstandard_syntax_table,
Sstandard_syntax_table, 0, 0, 0,
doc: /* Return the standard syntax table.
This is the one used for new buffers. */)
- ()
+ (void)
{
return Vstandard_syntax_table;
}
@@ -767,8 +756,7 @@ This is the one used for new buffers. */)
DEFUN ("copy-syntax-table", Fcopy_syntax_table, Scopy_syntax_table, 0, 1, 0,
doc: /* Construct a new syntax table and return it.
It is a copy of the TABLE, which defaults to the standard syntax table. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
Lisp_Object copy;
@@ -794,8 +782,7 @@ It is a copy of the TABLE, which defaults to the standard syntax table. */)
DEFUN ("set-syntax-table", Fset_syntax_table, Sset_syntax_table, 1, 1, 0,
doc: /* Select a new syntax table for the current buffer.
One argument, a syntax table. */)
- (table)
- Lisp_Object table;
+ (Lisp_Object table)
{
int idx;
check_syntax_table (table);
@@ -854,8 +841,7 @@ For example, if CHARACTER is a word constituent, the
character `w' (119) is returned.
The characters that correspond to various syntax codes
are listed in the documentation of `modify-syntax-entry'. */)
- (character)
- Lisp_Object character;
+ (Lisp_Object character)
{
int char_int;
CHECK_CHARACTER (character);
@@ -866,8 +852,7 @@ are listed in the documentation of `modify-syntax-entry'. */)
DEFUN ("matching-paren", Fmatching_paren, Smatching_paren, 1, 1, 0,
doc: /* Return the matching parenthesis of CHARACTER, or nil if none. */)
- (character)
- Lisp_Object character;
+ (Lisp_Object character)
{
int char_int, code;
CHECK_NUMBER (character);
@@ -885,8 +870,7 @@ STRING should be a string as it is allowed as argument of
`modify-syntax-entry'. Value is the equivalent cons cell
\(CODE . MATCHING-CHAR) that can be used as value of a `syntax-table'
text property. */)
- (string)
- Lisp_Object string;
+ (Lisp_Object string)
{
register const unsigned char *p;
register enum syntaxcode code;
@@ -997,8 +981,7 @@ this flag:
such characters are treated as whitespace when they occur
between expressions.
usage: (modify-syntax-entry CHAR NEWENTRY &optional SYNTAX-TABLE) */)
- (c, newentry, syntax_table)
- Lisp_Object c, newentry, syntax_table;
+ (Lisp_Object c, Lisp_Object newentry, Lisp_Object syntax_table)
{
if (CONSP (c))
{
@@ -1031,8 +1014,7 @@ usage: (modify-syntax-entry CHAR NEWENTRY &optional SYNTAX-TABLE) */)
DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value,
Sinternal_describe_syntax_value, 1, 1, 0,
doc: /* Insert a description of the internal syntax description SYNTAX at point. */)
- (syntax)
- Lisp_Object syntax;
+ (Lisp_Object syntax)
{
register enum syntaxcode code;
char desc, start1, start2, end1, end2, prefix, comstyle, comnested;
@@ -1185,8 +1167,7 @@ Lisp_Object Vfind_word_boundary_function_table;
COUNT negative means scan backward and stop at word beginning. */
int
-scan_words (from, count)
- register int from, count;
+scan_words (register int from, register int count)
{
register int beg = BEGV;
register int end = ZV;
@@ -1318,8 +1299,7 @@ Normally returns t.
If an edge of the buffer or a field boundary is reached, point is left there
and the function returns nil. Field boundaries are not noticed if
`inhibit-field-text-motion' is non-nil. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
Lisp_Object tmp;
int orig_val, val;
@@ -1342,7 +1322,7 @@ and the function returns nil. Field boundaries are not noticed if
return val == orig_val ? Qt : Qnil;
}
-Lisp_Object skip_chars ();
+Lisp_Object skip_chars (int, Lisp_Object, Lisp_Object, int);
DEFUN ("skip-chars-forward", Fskip_chars_forward, Sskip_chars_forward, 1, 2, 0,
doc: /* Move point forward, stopping before a char not in STRING, or at pos LIM.
@@ -1354,8 +1334,7 @@ With arg "^a-zA-Z", skips nonletters stopping before first letter.
Char classes, e.g. `[:alpha:]', are supported.
Returns the distance traveled, either zero or positive. */)
- (string, lim)
- Lisp_Object string, lim;
+ (Lisp_Object string, Lisp_Object lim)
{
return skip_chars (1, string, lim, 1);
}
@@ -1364,8 +1343,7 @@ DEFUN ("skip-chars-backward", Fskip_chars_backward, Sskip_chars_backward, 1, 2,
doc: /* Move point backward, stopping after a char not in STRING, or at pos LIM.
See `skip-chars-forward' for details.
Returns the distance traveled, either zero or negative. */)
- (string, lim)
- Lisp_Object string, lim;
+ (Lisp_Object string, Lisp_Object lim)
{
return skip_chars (0, string, lim, 1);
}
@@ -1376,8 +1354,7 @@ SYNTAX is a string of syntax code characters.
Stop before a char whose syntax is not in SYNTAX, or at position LIM.
If SYNTAX starts with ^, skip characters whose syntax is NOT in SYNTAX.
This function returns the distance traveled, either zero or positive. */)
- (syntax, lim)
- Lisp_Object syntax, lim;
+ (Lisp_Object syntax, Lisp_Object lim)
{
return skip_syntaxes (1, syntax, lim);
}
@@ -1388,17 +1365,13 @@ SYNTAX is a string of syntax code characters.
Stop on reaching a char whose syntax is not in SYNTAX, or at position LIM.
If SYNTAX starts with ^, skip characters whose syntax is NOT in SYNTAX.
This function returns the distance traveled, either zero or negative. */)
- (syntax, lim)
- Lisp_Object syntax, lim;
+ (Lisp_Object syntax, Lisp_Object lim)
{
return skip_syntaxes (0, syntax, lim);
}
static Lisp_Object
-skip_chars (forwardp, string, lim, handle_iso_classes)
- int forwardp;
- Lisp_Object string, lim;
- int handle_iso_classes;
+skip_chars (int forwardp, Lisp_Object string, Lisp_Object lim, int handle_iso_classes)
{
register unsigned int c;
unsigned char fastmap[0400];
@@ -1436,7 +1409,7 @@ skip_chars (forwardp, string, lim, handle_iso_classes)
&& (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE));
string_multibyte = SBYTES (string) > SCHARS (string);
- bzero (fastmap, sizeof fastmap);
+ memset (fastmap, 0, sizeof fastmap);
str = SDATA (string);
size_byte = SBYTES (string);
@@ -1485,7 +1458,7 @@ skip_chars (forwardp, string, lim, handle_iso_classes)
|| *class_end != ':' || class_end[1] != ']')
goto not_a_class_name;
- bcopy (class_beg, class_name, class_end - class_beg);
+ memcpy (class_name, class_beg, class_end - class_beg);
class_name[class_end - class_beg] = 0;
cc = re_wctype (class_name);
@@ -1546,8 +1519,8 @@ skip_chars (forwardp, string, lim, handle_iso_classes)
unsigned char fastmap2[0400];
int range_start_byte, range_start_char;
- bcopy (fastmap2 + 0200, fastmap + 0200, 0200);
- bzero (fastmap + 0200, 0200);
+ memcpy (fastmap + 0200, fastmap2 + 0200, 0200);
+ memset (fastmap + 0200, 0, 0200);
/* We are sure that this loop stops. */
for (i = 0200; ! fastmap2[i]; i++);
c = BYTE8_TO_CHAR (i);
@@ -1607,7 +1580,7 @@ skip_chars (forwardp, string, lim, handle_iso_classes)
|| *class_end != ':' || class_end[1] != ']')
goto not_a_class_name_multibyte;
- bcopy (class_beg, class_name, class_end - class_beg);
+ memcpy (class_name, class_beg, class_end - class_beg);
class_name[class_end - class_beg] = 0;
cc = re_wctype (class_name);
@@ -1692,7 +1665,7 @@ skip_chars (forwardp, string, lim, handle_iso_classes)
if (! multibyte && n_char_ranges > 0)
{
- bzero (fastmap + 0200, 0200);
+ memset (fastmap + 0200, 0, 0200);
for (i = 0; i < n_char_ranges; i += 2)
{
int c1 = char_ranges[i];
@@ -1892,9 +1865,7 @@ skip_chars (forwardp, string, lim, handle_iso_classes)
static Lisp_Object
-skip_syntaxes (forwardp, string, lim)
- int forwardp;
- Lisp_Object string, lim;
+skip_syntaxes (int forwardp, Lisp_Object string, Lisp_Object lim)
{
register unsigned int c;
unsigned char fastmap[0400];
@@ -1923,7 +1894,7 @@ skip_syntaxes (forwardp, string, lim)
multibyte = (!NILP (current_buffer->enable_multibyte_characters)
&& (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE));
- bzero (fastmap, sizeof fastmap);
+ memset (fastmap, 0, sizeof fastmap);
if (SBYTES (string) > SCHARS (string))
/* As this is very rare case (syntax spec is ASCII only), don't
@@ -2067,9 +2038,7 @@ skip_syntaxes (forwardp, string, lim)
integer which is its type according to re_wctype. */
static int
-in_classes (c, iso_classes)
- int c;
- Lisp_Object iso_classes;
+in_classes (int c, Lisp_Object iso_classes)
{
int fits_class = 0;
@@ -2111,12 +2080,10 @@ in_classes (c, iso_classes)
remains valid for forward search starting at the returned position. */
static int
-forw_comment (from, from_byte, stop, nesting, style, prev_syntax,
- charpos_ptr, bytepos_ptr, incomment_ptr)
- EMACS_INT from, from_byte, stop;
- int nesting, style, prev_syntax;
- EMACS_INT *charpos_ptr, *bytepos_ptr;
- int *incomment_ptr;
+forw_comment (EMACS_INT from, EMACS_INT from_byte, EMACS_INT stop,
+ int nesting, int style, int prev_syntax,
+ EMACS_INT *charpos_ptr, EMACS_INT *bytepos_ptr,
+ int *incomment_ptr)
{
register int c, c1;
register enum syntaxcode code;
@@ -2213,8 +2180,7 @@ Stop scanning if we find something other than a comment or whitespace.
Set point to where scanning stops.
If COUNT comments are found as expected, with nothing except whitespace
between them, return t; otherwise return nil. */)
- (count)
- Lisp_Object count;
+ (Lisp_Object count)
{
register EMACS_INT from;
EMACS_INT from_byte;
@@ -2422,10 +2388,7 @@ between them, return t; otherwise return nil. */)
? SYNTAX (c) : Ssymbol)
static Lisp_Object
-scan_lists (from, count, depth, sexpflag)
- register EMACS_INT from;
- EMACS_INT count, depth;
- int sexpflag;
+scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpflag)
{
Lisp_Object val;
register EMACS_INT stop = count > 0 ? ZV : BEGV;
@@ -2820,8 +2783,7 @@ Comments are ignored if `parse-sexp-ignore-comments' is non-nil.
If the beginning or end of (the accessible part of) the buffer is reached
and the depth is wrong, an error is signaled.
If the depth is right but the count is not used up, nil is returned. */)
- (from, count, depth)
- Lisp_Object from, count, depth;
+ (Lisp_Object from, Lisp_Object count, Lisp_Object depth)
{
CHECK_NUMBER (from);
CHECK_NUMBER (count);
@@ -2841,8 +2803,7 @@ If the beginning or end of (the accessible part of) the buffer is reached
in the middle of a parenthetical grouping, an error is signaled.
If the beginning or end is reached between groupings
but before count is used up, nil is returned. */)
- (from, count)
- Lisp_Object from, count;
+ (Lisp_Object from, Lisp_Object count)
{
CHECK_NUMBER (from);
CHECK_NUMBER (count);
@@ -2854,7 +2815,7 @@ DEFUN ("backward-prefix-chars", Fbackward_prefix_chars, Sbackward_prefix_chars,
0, 0, 0,
doc: /* Move point backward over any number of chars with prefix syntax.
This includes chars with "quote" or "prefix" syntax (' or p). */)
- ()
+ (void)
{
int beg = BEGV;
int opoint = PT;
@@ -2900,14 +2861,10 @@ This includes chars with "quote" or "prefix" syntax (' or p). */)
after the beginning of a string, or after the end of a string. */
static void
-scan_sexps_forward (stateptr, from, from_byte, end, targetdepth,
- stopbefore, oldstate, commentstop)
- struct lisp_parse_state *stateptr;
- register EMACS_INT from;
- EMACS_INT from_byte, end;
- int targetdepth, stopbefore;
- Lisp_Object oldstate;
- int commentstop;
+scan_sexps_forward (struct lisp_parse_state *stateptr,
+ EMACS_INT from, EMACS_INT from_byte, EMACS_INT end,
+ int targetdepth, int stopbefore,
+ Lisp_Object oldstate, int commentstop)
{
struct lisp_parse_state state;
@@ -3278,8 +3235,7 @@ Fifth arg OLDSTATE is a list like what this function returns.
Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.
If it is symbol `syntax-table', stop after the start of a comment or a
string, or after end of a comment or a string. */)
- (from, to, targetdepth, stopbefore, oldstate, commentstop)
- Lisp_Object from, to, targetdepth, stopbefore, oldstate, commentstop;
+ (Lisp_Object from, Lisp_Object to, Lisp_Object targetdepth, Lisp_Object stopbefore, Lisp_Object oldstate, Lisp_Object commentstop)
{
struct lisp_parse_state state;
int target;
@@ -3324,7 +3280,7 @@ Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.
}
void
-init_syntax_once ()
+init_syntax_once (void)
{
register int i, c;
Lisp_Object temp;
@@ -3414,7 +3370,7 @@ init_syntax_once ()
}
void
-syms_of_syntax ()
+syms_of_syntax (void)
{
Qsyntax_table_p = intern_c_string ("syntax-table-p");
staticpro (&Qsyntax_table_p);
diff --git a/src/syntax.h b/src/syntax.h
index ec8fab0166c..9eaf553f2e5 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -19,7 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
extern Lisp_Object Qsyntax_table_p;
-extern void update_syntax_table P_ ((int, int, int, Lisp_Object));
+extern void update_syntax_table (int, int, int, Lisp_Object);
/* The standard syntax table is stored where it will automatically
be used in all new buffers. */
@@ -346,9 +346,9 @@ struct gl_state_s
extern struct gl_state_s gl_state;
extern int parse_sexp_lookup_properties;
-extern INTERVAL interval_of P_ ((int, Lisp_Object));
+extern INTERVAL interval_of (int, Lisp_Object);
-extern int scan_words P_ ((int, int));
+extern int scan_words (int, int);
/* arch-tag: 28833cca-cd73-4741-8c85-a3111166a0e0
(do not change this comment) */
diff --git a/src/sysdep.c b/src/sysdep.c
index e311d181c9c..d720c7c5811 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -18,10 +18,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <ctype.h>
#include <signal.h>
#include <stdio.h>
@@ -79,9 +76,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "dosfns.h"
#include "msdos.h"
#include <sys/param.h>
-
-extern int etext;
-extern unsigned start __asm__ ("start");
#endif
#include <sys/file.h>
@@ -169,7 +163,7 @@ static const int baud_convert[] =
int emacs_ospeed;
-void croak P_ ((char *)) NO_RETURN;
+void croak (char *) NO_RETURN;
/* Temporary used by `sigblock' when defined in terms of signprocmask. */
@@ -182,7 +176,7 @@ SIGMASKTYPE sigprocmask_set;
Any other returned value must be freed with free. This is used
only when get_current_dir_name is not defined on the system. */
char*
-get_current_dir_name ()
+get_current_dir_name (void)
{
char *buf;
char *pwd;
@@ -254,7 +248,7 @@ get_current_dir_name ()
/* Discard pending input on all input descriptors. */
void
-discard_tty_input ()
+discard_tty_input (void)
{
#ifndef WINDOWSNT
struct emacs_tty buf;
@@ -353,8 +347,7 @@ init_baud_rate (int fd)
/*ARGSUSED*/
void
-set_exclusive_use (fd)
- int fd;
+set_exclusive_use (int fd)
{
#ifdef FIOCLEX
ioctl (fd, FIOCLEX, 0);
@@ -362,33 +355,23 @@ set_exclusive_use (fd)
/* Ok to do nothing if this feature does not exist */
}
-#ifndef subprocesses
-
-wait_without_blocking ()
-{
- croak ("wait_without_blocking");
- synch_process_alive = 0;
-}
-
-#endif /* not subprocesses */
int wait_debugging; /* Set nonzero to make following function work under dbx
(at least for bsd). */
SIGTYPE
-wait_for_termination_signal ()
+wait_for_termination_signal (void)
{}
+#ifndef MSDOS
/* Wait for subprocess with process id `pid' to terminate and
make sure it will get eliminated (not remain forever as a zombie) */
void
-wait_for_termination (pid)
- int pid;
+wait_for_termination (int pid)
{
while (1)
{
-#ifdef subprocesses
#if defined (BSD_SYSTEM) || defined (HPUX)
/* Note that kill returns -1 even if the process is just a zombie now.
But inevitably a SIGCHLD interrupt should be generated
@@ -424,22 +407,16 @@ wait_for_termination (pid)
sigsuspend (&empty_mask);
#endif /* not WINDOWSNT */
#endif /* not BSD_SYSTEM, and not HPUX version >= 6 */
-#else /* not subprocesses */
- break;
-#endif /* not subprocesses */
}
}
-#ifdef subprocesses
-
/*
* flush any pending output
* (may flush input as well; it does not matter the way we use it)
*/
void
-flush_pending_output (channel)
- int channel;
+flush_pending_output (int channel)
{
#ifdef HAVE_TERMIOS
/* If we try this, we get hit with SIGTTIN, because
@@ -465,10 +442,9 @@ flush_pending_output (channel)
in Emacs. No padding needed for insertion into an Emacs buffer. */
void
-child_setup_tty (out)
- int out;
+child_setup_tty (int out)
{
-#ifndef DOS_NT
+#ifndef WINDOWSNT
struct emacs_tty s;
EMACS_GET_TTY (out, &s);
@@ -552,25 +528,25 @@ child_setup_tty (out)
EMACS_SET_TTY (out, &s, 0);
-#endif /* not DOS_NT */
+#endif /* not WINDOWSNT */
}
+#endif /* MSDOS */
-#endif /* subprocesses */
/* Record a signal code and the handler for it. */
struct save_signal
{
int code;
- SIGTYPE (*handler) P_ ((int));
+ SIGTYPE (*handler) (int);
};
-static void save_signal_handlers P_ ((struct save_signal *));
-static void restore_signal_handlers P_ ((struct save_signal *));
+static void save_signal_handlers (struct save_signal *);
+static void restore_signal_handlers (struct save_signal *);
/* Suspend the Emacs process; give terminal to its superior. */
void
-sys_suspend ()
+sys_suspend (void)
{
#if defined (SIGTSTP) && !defined (MSDOS)
@@ -591,7 +567,7 @@ sys_suspend ()
/* Fork a subshell. */
void
-sys_subshell ()
+sys_subshell (void)
{
#ifdef DOS_NT /* Demacs 1.1.2 91/10/20 Manabu Higashida */
int st;
@@ -626,7 +602,7 @@ sys_subshell ()
dir = expand_and_dir_to_file (Funhandled_file_name_directory (dir), Qnil);
str = (unsigned char *) alloca (SCHARS (dir) + 2);
len = SCHARS (dir);
- bcopy (SDATA (dir), str, len);
+ memcpy (str, SDATA (dir), len);
if (str[len - 1] != '/') str[len++] = '/';
str[len] = 0;
xyzzy:
@@ -659,9 +635,7 @@ sys_subshell ()
if (str)
chdir ((char *) str);
-#ifdef subprocesses
close_process_descs (); /* Close Emacs's pipes/ptys */
-#endif
#ifdef SET_EMACS_PRIORITY
{
@@ -719,20 +693,18 @@ sys_subshell ()
}
static void
-save_signal_handlers (saved_handlers)
- struct save_signal *saved_handlers;
+save_signal_handlers (struct save_signal *saved_handlers)
{
while (saved_handlers->code)
{
saved_handlers->handler
- = (SIGTYPE (*) P_ ((int))) signal (saved_handlers->code, SIG_IGN);
+ = (SIGTYPE (*) (int)) signal (saved_handlers->code, SIG_IGN);
saved_handlers++;
}
}
static void
-restore_signal_handlers (saved_handlers)
- struct save_signal *saved_handlers;
+restore_signal_handlers (struct save_signal *saved_handlers)
{
while (saved_handlers->code)
{
@@ -769,8 +741,7 @@ unrequest_sigio (void)
int old_fcntl_flags[MAXDESC];
void
-init_sigio (fd)
- int fd;
+init_sigio (int fd)
{
#ifdef FASYNC
old_fcntl_flags[fd] = fcntl (fd, F_GETFL, 0) & ~FASYNC;
@@ -780,8 +751,7 @@ init_sigio (fd)
}
void
-reset_sigio (fd)
- int fd;
+reset_sigio (int fd)
{
#ifdef FASYNC
fcntl (fd, F_SETFL, old_fcntl_flags[fd]);
@@ -793,7 +763,7 @@ reset_sigio (fd)
/* XXX Yeah, but you need it for SIGIO, don't you? */
void
-request_sigio ()
+request_sigio (void)
{
if (noninteractive)
return;
@@ -808,7 +778,7 @@ request_sigio ()
void
unrequest_sigio (void)
-{
+{
if (noninteractive)
return;
@@ -828,7 +798,7 @@ unrequest_sigio (void)
#ifndef MSDOS
void
-request_sigio ()
+request_sigio (void)
{
if (noninteractive || read_socket_hook)
return;
@@ -837,7 +807,7 @@ request_sigio ()
}
void
-unrequest_sigio ()
+unrequest_sigio (void)
{
if (noninteractive || read_socket_hook)
return;
@@ -857,14 +827,12 @@ unrequest_sigio ()
Return zero if all's well, or -1 if we ran into an error we
couldn't deal with. */
int
-emacs_get_tty (fd, settings)
- int fd;
- struct emacs_tty *settings;
+emacs_get_tty (int fd, struct emacs_tty *settings)
{
/* Retrieve the primary parameters - baud rate, character size, etcetera. */
#ifdef HAVE_TCATTR
/* We have those nifty POSIX tcmumbleattr functions. */
- bzero (&settings->main, sizeof (settings->main));
+ memset (&settings->main, 0, sizeof (settings->main));
if (tcgetattr (fd, &settings->main) < 0)
return -1;
@@ -906,10 +874,7 @@ emacs_get_tty (fd, settings)
Return 0 if all went well, and -1 if anything failed. */
int
-emacs_set_tty (fd, settings, flushp)
- int fd;
- struct emacs_tty *settings;
- int flushp;
+emacs_set_tty (int fd, struct emacs_tty *settings, int flushp)
{
/* Set the primary parameters - baud rate, character size, etcetera. */
#ifdef HAVE_TCATTR
@@ -934,7 +899,7 @@ emacs_set_tty (fd, settings, flushp)
{
struct termios new;
- bzero (&new, sizeof (new));
+ memset (&new, 0, sizeof (new));
/* Get the current settings, and see if they're what we asked for. */
tcgetattr (fd, &new);
/* We cannot use memcmp on the whole structure here because under
@@ -1021,8 +986,7 @@ init_all_sys_modes (void)
/* Initialize the terminal mode on the given tty device. */
void
-init_sys_modes (tty_out)
- struct tty_display_info *tty_out;
+init_sys_modes (struct tty_display_info *tty_out)
{
struct emacs_tty tty;
@@ -1033,10 +997,10 @@ init_sys_modes (tty_out)
if (!tty_out->output)
return; /* The tty is suspended. */
-
+
if (! tty_out->old_tty)
tty_out->old_tty = (struct emacs_tty *) xmalloc (sizeof (struct emacs_tty));
-
+
EMACS_GET_TTY (fileno (tty_out->input), tty_out->old_tty);
tty = *tty_out->old_tty;
@@ -1094,7 +1058,7 @@ init_sys_modes (tty_out)
means that the interrupt and quit feature must be
disabled on secondary ttys, or we would not even see the
keypress.
-
+
Note that even though emacsclient could have special code
to pass SIGINT to Emacs, we should _not_ enable
interrupt/quit keys for emacsclient frames. This means
@@ -1112,7 +1076,7 @@ init_sys_modes (tty_out)
tty.main.c_cc[VSWTCH] = CDISABLE; /* Turn off shell layering use
of C-z */
#endif /* VSWTCH */
-
+
#if defined (__mips__) || defined (HAVE_TCATTR)
#ifdef VSUSP
tty.main.c_cc[VSUSP] = CDISABLE; /* Turn off mips handling of C-z. */
@@ -1203,9 +1167,9 @@ init_sys_modes (tty_out)
tty.tchars.t_startc = '\021';
tty.tchars.t_stopc = '\023';
}
-
+
tty.lmode = LDECCTQ | LLITOUT | LPASS8 | LNOFLSH | tty_out->old_tty.lmode;
-
+
#endif /* HAVE_TCHARS */
#endif /* not HAVE_TERMIO */
@@ -1365,8 +1329,7 @@ get_tty_size (int fd, int *widthp, int *heightp)
to HEIGHT and WIDTH. This is used mainly with ptys. */
int
-set_window_size (fd, height, width)
- int fd, height, width;
+set_window_size (int fd, int height, int width)
{
#ifdef TIOCSWINSZ
@@ -1414,8 +1377,7 @@ reset_all_sys_modes (void)
bottom of the frame, turn off interrupt-driven I/O, etc. */
void
-reset_sys_modes (tty_out)
- struct tty_display_info *tty_out;
+reset_sys_modes (struct tty_display_info *tty_out)
{
if (noninteractive)
{
@@ -1427,11 +1389,11 @@ reset_sys_modes (tty_out)
if (!tty_out->output)
return; /* The tty is suspended. */
-
+
/* Go to and clear the last line of the terminal. */
cmgoto (tty_out, FrameRows (tty_out) - 1, 0);
-
+
/* Code adapted from tty_clear_end_of_line. */
if (tty_out->TS_clr_line)
{
@@ -1441,16 +1403,16 @@ reset_sys_modes (tty_out)
{ /* have to do it the hard way */
int i;
tty_turn_off_insert (tty_out);
-
+
for (i = curX (tty_out); i < FrameCols (tty_out) - 1; i++)
{
fputc (' ', tty_out->output);
}
}
-
+
cmgoto (tty_out, FrameRows (tty_out) - 1, 0);
fflush (tty_out->output);
-
+
if (tty_out->terminal->reset_terminal_modes_hook)
tty_out->terminal->reset_terminal_modes_hook (tty_out->terminal);
@@ -1490,8 +1452,7 @@ reset_sys_modes (tty_out)
/* Set up the proper status flags for use of a pty. */
void
-setup_pty (fd)
- int fd;
+setup_pty (int fd)
{
/* I'm told that TOICREMOTE does not mean control chars
"can't be sent" but rather that they don't have
@@ -1527,83 +1488,6 @@ setup_pty (fd)
}
#endif /* HAVE_PTYS */
-#if !defined(CANNOT_DUMP) || !defined(SYSTEM_MALLOC)
-/* Some systems that cannot dump also cannot implement these. */
-
-/*
- * Return the address of the start of the text segment prior to
- * doing an unexec. After unexec the return value is undefined.
- * See crt0.c for further explanation and _start.
- *
- */
-
-#if !(defined (__NetBSD__) && defined (__ELF__))
-#ifndef HAVE_TEXT_START
-char *
-start_of_text ()
-{
-#ifdef TEXT_START
- return ((char *) TEXT_START);
-#else
- extern int _start ();
- return ((char *) _start);
-#endif /* TEXT_START */
-}
-#endif /* not HAVE_TEXT_START */
-#endif
-
-/*
- * Return the address of the start of the data segment prior to
- * doing an unexec. After unexec the return value is undefined.
- * See crt0.c for further information and definition of data_start.
- *
- * Apparently, on BSD systems this is etext at startup. On
- * USG systems (swapping) this is highly mmu dependent and
- * is also dependent on whether or not the program is running
- * with shared text. Generally there is a (possibly large)
- * gap between end of text and start of data with shared text.
- *
- * On Uniplus+ systems with shared text, data starts at a
- * fixed address. Each port (from a given oem) is generally
- * different, and the specific value of the start of data can
- * be obtained via the UniPlus+ specific "uvar" system call,
- * however the method outlined in crt0.c seems to be more portable.
- *
- * Probably what will have to happen when a USG unexec is available,
- * at least on UniPlus, is temacs will have to be made unshared so
- * that text and data are contiguous. Then once loadup is complete,
- * unexec will produce a shared executable where the data can be
- * at the normal shared text boundary and the startofdata variable
- * will be patched by unexec to the correct value.
- *
- */
-
-#ifndef start_of_data
-char *
-start_of_data ()
-{
-#ifdef DATA_START
- return ((char *) DATA_START);
-#else
-#ifdef ORDINARY_LINK
- /*
- * This is a hack. Since we're not linking crt0.c or pre_crt0.c,
- * data_start isn't defined. We take the address of environ, which
- * is known to live at or near the start of the system crt0.c, and
- * we don't sweat the handful of bytes that might lose.
- */
- extern char **environ;
-
- return ((char *) &environ);
-#else
- extern int data_start;
- return ((char *) &data_start);
-#endif /* ORDINARY_LINK */
-#endif /* DATA_START */
-}
-#endif /* start_of_data */
-#endif /* NEED_STARTS (not CANNOT_DUMP or not SYSTEM_MALLOC) */
-
/* init_system_name sets up the string for the Lisp function
system-name to return. */
@@ -1621,7 +1505,7 @@ extern int h_errno;
#endif /* TRY_AGAIN */
void
-init_system_name ()
+init_system_name (void)
{
#ifndef HAVE_GETHOSTNAME
struct utsname uts;
@@ -1654,7 +1538,7 @@ init_system_name ()
#ifndef CANNOT_DUMP
if (initialized)
#endif /* not CANNOT_DUMP */
- if (! index (hostname, '.'))
+ if (! strchr (hostname, '.'))
{
int count;
#ifdef HAVE_GETADDRINFO
@@ -1662,7 +1546,7 @@ init_system_name ()
struct addrinfo hints;
int ret;
- memset (&hints, 0, sizeof(hints));
+ memset (&hints, 0, sizeof (hints));
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_CANONNAME;
@@ -1683,7 +1567,7 @@ init_system_name ()
while (it)
{
char *fqdn = it->ai_canonname;
- if (fqdn && index (fqdn, '.')
+ if (fqdn && strchr (fqdn, '.')
&& strcmp (fqdn, "localhost.localdomain") != 0)
break;
it = it->ai_next;
@@ -1719,13 +1603,13 @@ init_system_name ()
{
char *fqdn = (char *) hp->h_name;
- if (!index (fqdn, '.'))
+ if (!strchr (fqdn, '.'))
{
/* We still don't have a fully qualified domain name.
Try to find one in the list of alternate names */
char **alias = hp->h_aliases;
while (*alias
- && (!index (*alias, '.')
+ && (!strchr (*alias, '.')
|| !strcmp (*alias, "localhost.localdomain")))
alias++;
if (*alias)
@@ -1774,8 +1658,8 @@ jmp_buf read_alarm_throw;
int read_alarm_should_throw;
-SIGTYPE
-select_alarm ()
+void
+select_alarm (int ignore)
{
select_alarmed = 1;
signal (SIGALRM, SIG_IGN);
@@ -1787,23 +1671,18 @@ select_alarm ()
#ifndef WINDOWSNT
/* Only rfds are checked. */
int
-sys_select (nfds, rfds, wfds, efds, timeout)
- int nfds;
- SELECT_TYPE *rfds, *wfds, *efds;
- EMACS_TIME *timeout;
+sys_select (int nfds,
+ SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
+ EMACS_TIME *timeout)
{
/* XXX This needs to be updated for multi-tty support. Is there
- anybody who needs to emulate select these days? */
+ anybody who needs to emulate select these days? */
int ravail = 0;
SELECT_TYPE orfds;
int timeoutval;
int *local_timeout;
extern int proc_buffered_char[];
-#ifndef subprocesses
- int process_tick = 0, update_tick = 0;
-#else
extern int process_tick, update_tick;
-#endif
unsigned char buf;
#if defined (HAVE_SELECT) && defined (HAVE_X_WINDOWS)
@@ -1924,12 +1803,11 @@ sys_select (nfds, rfds, wfds, efds, timeout)
waiting for at least one character. */
void
-read_input_waiting ()
+read_input_waiting (void)
{
/* XXX This needs to be updated for multi-tty support. Is there
anybody who needs to emulate select these days? */
int nread, i;
- extern int quit_char;
if (read_socket_hook)
{
@@ -2077,7 +1955,7 @@ static char *my_sys_siglist[NSIG];
#endif
void
-init_signals ()
+init_signals (void)
{
sigemptyset (&empty_mask);
sigfillset (&full_mask);
@@ -2283,8 +2161,7 @@ init_signals ()
#endif /* !RAND_BITS */
void
-seed_random (arg)
- long arg;
+seed_random (long int arg)
{
#ifdef HAVE_RANDOM
srandom ((unsigned int)arg);
@@ -2302,7 +2179,7 @@ seed_random (arg)
* This suffices even for a 64-bit architecture with a 15-bit rand.
*/
long
-get_random ()
+get_random (void)
{
long val = random ();
#if VALBITS > RAND_BITS
@@ -2337,9 +2214,7 @@ strerror (errnum)
#endif /* ! HAVE_STRERROR */
int
-emacs_open (path, oflag, mode)
- const char *path;
- int oflag, mode;
+emacs_open (const char *path, int oflag, int mode)
{
register int rtnval;
@@ -2350,8 +2225,7 @@ emacs_open (path, oflag, mode)
}
int
-emacs_close (fd)
- int fd;
+emacs_close (int fd)
{
int did_retry = 0;
register int rtnval;
@@ -2370,10 +2244,7 @@ emacs_close (fd)
}
int
-emacs_read (fildes, buf, nbyte)
- int fildes;
- char *buf;
- unsigned int nbyte;
+emacs_read (int fildes, char *buf, unsigned int nbyte)
{
register int rtnval;
@@ -2384,10 +2255,7 @@ emacs_read (fildes, buf, nbyte)
}
int
-emacs_write (fildes, buf, nbyte)
- int fildes;
- const char *buf;
- unsigned int nbyte;
+emacs_write (int fildes, const char *buf, unsigned int nbyte)
{
register int rtnval, bytes_written;
@@ -2448,11 +2316,10 @@ emacs_write (fildes, buf, nbyte)
#ifndef HAVE_GETWD
char *
-getwd (pathname)
- char *pathname;
+getwd (char *pathname)
{
char *npath, *spath;
- extern char *getcwd ();
+ extern char *getcwd (char *, size_t);
BLOCK_INPUT; /* getcwd uses malloc */
spath = npath = getcwd ((char *) 0, MAXPATHLEN);
@@ -2481,9 +2348,8 @@ getwd (pathname)
#ifndef HAVE_RENAME
-rename (from, to)
- const char *from;
- const char *to;
+int
+rename (const char *from, const char *to)
{
if (access (from, 0) == 0)
{
@@ -2503,7 +2369,8 @@ rename (from, to)
/* HPUX curses library references perror, but as far as we know
it won't be called. Anyway this definition will do for now. */
-perror ()
+void
+perror (void)
{
}
#endif /* HPUX and not HAVE_PERROR */
@@ -2516,9 +2383,8 @@ perror ()
* until we are, then close the unsuccessful ones.
*/
-dup2 (oldd, newd)
- int oldd;
- int newd;
+int
+dup2 (int oldd, int newd)
{
register int fd, ret;
@@ -2546,17 +2412,14 @@ dup2 (oldd, newd)
* Only needed when subprocesses are defined.
*/
-#ifdef subprocesses
#ifndef HAVE_GETTIMEOFDAY
#ifdef HAVE_TIMEVAL
/* ARGSUSED */
int
-gettimeofday (tp, tzp)
- struct timeval *tp;
- struct timezone *tzp;
+gettimeofday (struct timeval *tp, struct timezone *tzp)
{
- extern long time ();
+ extern long time (long);
tp->tv_sec = time ((long *)0);
tp->tv_usec = 0;
@@ -2566,16 +2429,14 @@ gettimeofday (tp, tzp)
}
#endif
-#endif
-#endif /* subprocess && !HAVE_GETTIMEOFDAY && HAVE_TIMEVAL */
+#endif /* !HAVE_GETTIMEOFDAY && HAVE_TIMEVAL */
/*
* This function will go away as soon as all the stubs fixed. (fnf)
*/
void
-croak (badfunc)
- char *badfunc;
+croak (char *badfunc)
{
printf ("%s not yet implemented\r\n", badfunc);
reset_all_sys_modes ();
@@ -2607,9 +2468,7 @@ closedir (DIR *dirp /* stream from opendir */)
int
-set_file_times (filename, atime, mtime)
- const char *filename;
- EMACS_TIME atime, mtime;
+set_file_times (const char *filename, EMACS_TIME atime, EMACS_TIME mtime)
{
#ifdef HAVE_UTIMES
struct timeval tv[2];
@@ -2646,9 +2505,7 @@ set_file_times (filename, atime, mtime)
* Make a directory.
*/
int
-mkdir (dpath, dmode)
- char *dpath;
- int dmode;
+mkdir (char *dpath, int dmode)
{
int cpid, status, fd;
struct stat statbuf;
@@ -2706,8 +2563,7 @@ mkdir (dpath, dmode)
#ifndef HAVE_RMDIR
int
-rmdir (dpath)
- char *dpath;
+rmdir (char *dpath)
{
int cpid, status, fd;
struct stat statbuf;
@@ -2752,10 +2608,62 @@ rmdir (dpath)
#endif /* !HAVE_RMDIR */
+#ifndef HAVE_MEMSET
+void *
+memset (void *b, int n, size_t length)
+{
+ unsigned char *p = b;
+ while (length-- > 0)
+ *p++ = n;
+ return b;
+}
+#endif /* !HAVE_MEMSET */
+
+#ifndef HAVE_MEMCPY
+void *
+memcpy (void *b1, void *b2, size_t length)
+{
+ unsigned char *p1 = b1, *p2 = b2;
+ while (length-- > 0)
+ *p1++ = *p2++;
+ return b1;
+}
+#endif /* !HAVE_MEMCPY */
+
+#ifndef HAVE_MEMMOVE
+void *
+memmove (void *b1, void *b2, size_t length)
+{
+ unsigned char *p1 = b1, *p2 = b2;
+ if (p1 < p2 || p1 >= p2 + length)
+ while (length-- > 0)
+ *p1++ = *p2++;
+ else
+ {
+ p1 += length;
+ p2 += length;
+ while (length-- > 0)
+ *--p1 = *--p2;
+ }
+ return b1;
+}
+#endif /* !HAVE_MEMCPY */
+
+#ifndef HAVE_MEMCMP
+int
+memcmp (void *b1, void *b2, size_t length)
+{
+ unsigned char *p1 = b1, *p2 = b2;
+ while (length-- > 0)
+ if (*p1++ != *p2++)
+ return p1[-1] < p2[-1] ? -1 : 1;
+ return 0;
+}
+#endif /* !HAVE_MEMCMP */
+
#ifndef HAVE_STRSIGNAL
char *
-strsignal (code)
- int code;
+strsignal (int code)
{
char *signame = 0;
@@ -2771,7 +2679,8 @@ strsignal (code)
#ifdef HAVE_TERMIOS
/* For make-serial-process */
-int serial_open (char *port)
+int
+serial_open (char *port)
{
int fd = -1;
@@ -2804,7 +2713,8 @@ int serial_open (char *port)
#if !defined (HAVE_CFMAKERAW)
/* Workaround for targets which are missing cfmakeraw. */
/* Pasted from man page. */
-static void cfmakeraw (struct termios *termios_p)
+static void
+cfmakeraw (struct termios *termios_p)
{
termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
termios_p->c_oflag &= ~OPOST;
@@ -2816,7 +2726,8 @@ static void cfmakeraw (struct termios *termios_p)
#if !defined (HAVE_CFSETSPEED)
/* Workaround for targets which are missing cfsetspeed. */
-static int cfsetspeed (struct termios *termios_p, speed_t vitesse)
+static int
+cfsetspeed (struct termios *termios_p, speed_t vitesse)
{
return (cfsetispeed (termios_p, vitesse)
+ cfsetospeed (termios_p, vitesse));
@@ -2826,7 +2737,7 @@ static int cfsetspeed (struct termios *termios_p, speed_t vitesse)
/* For serial-process-configure */
void
serial_configure (struct Lisp_Process *p,
- Lisp_Object contact)
+ Lisp_Object contact)
{
Lisp_Object childp2 = Qnil;
Lisp_Object tem = Qnil;
@@ -2869,7 +2780,7 @@ serial_configure (struct Lisp_Process *p,
CHECK_NUMBER (tem);
if (XINT (tem) != 7 && XINT (tem) != 8)
error (":bytesize must be nil (8), 7, or 8");
- summary[0] = XINT(tem) + '0';
+ summary[0] = XINT (tem) + '0';
#if defined (CSIZE) && defined (CS7) && defined (CS8)
attr.c_cflag &= ~CSIZE;
attr.c_cflag |= ((XINT (tem) == 7) ? CS7 : CS8);
@@ -2993,7 +2904,7 @@ serial_configure (struct Lisp_Process *p,
/* Process enumeration and access via /proc. */
Lisp_Object
-list_system_processes ()
+list_system_processes (void)
{
Lisp_Object procdir, match, proclist, next;
struct gcpro gcpro1, gcpro2;
@@ -3027,7 +2938,7 @@ list_system_processes ()
#elif !defined (WINDOWSNT) && !defined (MSDOS)
Lisp_Object
-list_system_processes ()
+list_system_processes (void)
{
return Qnil;
}
@@ -3226,7 +3137,7 @@ system_process_attributes (Lisp_Object pid)
procfn_end = fn + strlen (fn);
strcpy (procfn_end, "/stat");
fd = emacs_open (fn, O_RDONLY, 0);
- if (fd >= 0 && (nread = emacs_read (fd, procbuf, sizeof(procbuf) - 1)) > 0)
+ if (fd >= 0 && (nread = emacs_read (fd, procbuf, sizeof (procbuf) - 1)) > 0)
{
procbuf[nread] = '\0';
p = procbuf;
@@ -3487,7 +3398,7 @@ system_process_attributes (Lisp_Object pid)
strcpy (procfn_end, "/psinfo");
fd = emacs_open (fn, O_RDONLY, 0);
if (fd >= 0
- && (nread = read (fd, (char*)&pinfo, sizeof(struct psinfo)) > 0))
+ && (nread = read (fd, (char*)&pinfo, sizeof (struct psinfo)) > 0))
{
attrs = Fcons (Fcons (Qppid, make_fixnum_or_float (pinfo.pr_ppid)), attrs);
attrs = Fcons (Fcons (Qpgrp, make_fixnum_or_float (pinfo.pr_pgid)), attrs);
diff --git a/src/syssignal.h b/src/syssignal.h
index 9a145b78cb1..e3765add425 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-extern void init_signals P_ ((void));
+extern void init_signals (void);
#if defined (HAVE_GTK_AND_PTHREAD) || defined (HAVE_NS)
#include <pthread.h>
@@ -76,12 +76,12 @@ extern sigset_t sys_sigmask ();
/* Whether this is what all systems want or not, this is what
appears to be assumed in the source, for example data.c:arith_error. */
-typedef RETSIGTYPE (*signal_handler_t) (/*int*/);
+typedef RETSIGTYPE (*signal_handler_t) (int);
-signal_handler_t sys_signal P_ ((int signal_number, signal_handler_t action));
-sigset_t sys_sigblock P_ ((sigset_t new_mask));
-sigset_t sys_sigunblock P_ ((sigset_t new_mask));
-sigset_t sys_sigsetmask P_ ((sigset_t new_mask));
+signal_handler_t sys_signal (int signal_number, signal_handler_t action);
+sigset_t sys_sigblock (sigset_t new_mask);
+sigset_t sys_sigunblock (sigset_t new_mask);
+sigset_t sys_sigsetmask (sigset_t new_mask);
#define sys_sigdel(MASK,SIG) sigdelset (&MASK,SIG)
@@ -113,9 +113,6 @@ sigset_t sys_sigsetmask P_ ((sigset_t new_mask));
#endif
#if defined (SIGIO) && defined (BROKEN_SIGIO)
# undef SIGIO
-# if defined (__Lynx__)
-# undef SIGPOLL /* Defined as SIGIO on LynxOS */
-# endif
#endif
#if defined (SIGPOLL) && defined (BROKEN_SIGPOLL)
#undef SIGPOLL
diff --git a/src/systime.h b/src/systime.h
index 2f8d35805a4..bd789e9bd32 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -136,17 +136,17 @@ extern time_t timezone;
#define EMACS_SET_SECS_USECS(time, secs, usecs) \
(EMACS_SET_SECS (time, secs), EMACS_SET_USECS (time, usecs))
-extern int set_file_times __P ((const char *, EMACS_TIME, EMACS_TIME));
+extern int set_file_times (const char *, EMACS_TIME, EMACS_TIME);
/* defined in keyboard.c */
-extern void set_waiting_for_input __P ((EMACS_TIME *));
+extern void set_waiting_for_input (EMACS_TIME *);
/* When lisp.h is not included Lisp_Object is not defined (this can
happen when this files is used outside the src directory).
Use GCPRO1 to determine if lisp.h was included. */
#ifdef GCPRO1
/* defined in dired.c */
-extern Lisp_Object make_time __P ((time_t));
+extern Lisp_Object make_time (time_t);
#endif
/* Compare times T1 and T2. Value is 0 if T1 and T2 are the same.
diff --git a/src/term.c b/src/term.c
index fad6e3c80d7..3233db84cf7 100644
--- a/src/term.c
+++ b/src/term.c
@@ -66,10 +66,10 @@ static int been_here = -1;
/* For now, don't try to include termcap.h. On some systems,
configure finds a non-standard termcap.h that the main build
won't find. */
-extern void tputs P_ ((const char *, int, int (*)(int)));
-extern int tgetent P_ ((char *, const char *));
-extern int tgetflag P_ ((char *id));
-extern int tgetnum P_ ((char *id));
+extern void tputs (const char *, int, int (*)(int));
+extern int tgetent (char *, const char *);
+extern int tgetflag (char *id);
+extern int tgetnum (char *id);
#include "cm.h"
#ifdef HAVE_X_WINDOWS
@@ -91,16 +91,20 @@ extern int tgetnum P_ ((char *id));
#define DEV_TTY "/dev/tty"
#endif
-static void tty_set_scroll_region P_ ((struct frame *f, int start, int stop));
-static void turn_on_face P_ ((struct frame *, int face_id));
-static void turn_off_face P_ ((struct frame *, int face_id));
-static void tty_show_cursor P_ ((struct tty_display_info *));
-static void tty_hide_cursor P_ ((struct tty_display_info *));
-static void tty_background_highlight P_ ((struct tty_display_info *tty));
-static void clear_tty_hooks P_ ((struct terminal *terminal));
-static void set_tty_hooks P_ ((struct terminal *terminal));
-static void dissociate_if_controlling_tty P_ ((int fd));
-static void delete_tty P_ ((struct terminal *));
+static void tty_set_scroll_region (struct frame *f, int start, int stop);
+static void turn_on_face (struct frame *, int face_id);
+static void turn_off_face (struct frame *, int face_id);
+static void tty_show_cursor (struct tty_display_info *);
+static void tty_hide_cursor (struct tty_display_info *);
+static void tty_background_highlight (struct tty_display_info *tty);
+static void clear_tty_hooks (struct terminal *terminal);
+static void set_tty_hooks (struct terminal *terminal);
+static void dissociate_if_controlling_tty (int fd);
+static void delete_tty (struct terminal *);
+static void maybe_fatal (int must_succeed, struct terminal *terminal,
+ const char *str1, const char *str2, ...) NO_RETURN;
+static void vfatal (const char *str, va_list ap) NO_RETURN;
+
#define OUTPUT(tty, a) \
emacs_tputs ((tty), a, \
@@ -181,13 +185,13 @@ static int system_uses_terminfo;
char *tparam ();
-extern char *tgetstr ();
+extern char *tgetstr (char *, char **);
#ifdef HAVE_GPM
#include <sys/fcntl.h>
-static void term_clear_mouse_face ();
+static void term_clear_mouse_face (void);
static void term_mouse_highlight (struct frame *f, int x, int y);
/* The device for which we have enabled gpm support (or NULL). */
@@ -558,10 +562,7 @@ static int encode_terminal_dst_size;
sequence, and return a pointer to that byte sequence. */
unsigned char *
-encode_terminal_code (src, src_len, coding)
- struct glyph *src;
- int src_len;
- struct coding_system *coding;
+encode_terminal_code (struct glyph *src, int src_len, struct coding_system *coding)
{
struct glyph *src_end = src + src_len;
unsigned char *buf;
@@ -723,7 +724,7 @@ encode_terminal_code (src, src_len, coding)
encode_terminal_src_size);
buf = encode_terminal_src + nbytes;
}
- bcopy (SDATA (string), buf, SBYTES (string));
+ memcpy (buf, SDATA (string), SBYTES (string));
buf += SBYTES (string);
nchars += SCHARS (string);
}
@@ -836,10 +837,8 @@ tty_write_glyphs (struct frame *f, struct glyph *string, int len)
#ifdef HAVE_GPM /* Only used by GPM code. */
static void
-tty_write_glyphs_with_face (f, string, len, face_id)
- register struct frame *f;
- register struct glyph *string;
- register int len, face_id;
+tty_write_glyphs_with_face (register struct frame *f, register struct glyph *string,
+ register int len, register int face_id)
{
unsigned char *conversion_buffer;
struct coding_system *coding;
@@ -1230,8 +1229,8 @@ calculate_costs (struct frame *frame)
= (int *) xmalloc (sizeof (int)
+ 2 * max_frame_cols * sizeof (int));
- bzero (char_ins_del_vector, (sizeof (int)
- + 2 * max_frame_cols * sizeof (int)));
+ memset (char_ins_del_vector, 0,
+ (sizeof (int) + 2 * max_frame_cols * sizeof (int)));
if (f && (!tty->TS_ins_line && !tty->TS_del_line))
@@ -1366,16 +1365,14 @@ static struct fkey_table keys[] =
static char **term_get_fkeys_address;
static KBOARD *term_get_fkeys_kboard;
-static Lisp_Object term_get_fkeys_1 ();
+static Lisp_Object term_get_fkeys_1 (void);
/* Find the escape codes sent by the function keys for Vinput_decode_map.
This function scans the termcap function key sequence entries, and
adds entries to Vinput_decode_map for each function key it finds. */
static void
-term_get_fkeys (address, kboard)
- char **address;
- KBOARD *kboard;
+term_get_fkeys (char **address, KBOARD *kboard)
{
/* We run the body of the function (term_get_fkeys_1) and ignore all Lisp
errors during the call. The only errors should be from Fdefine_key
@@ -1385,14 +1382,14 @@ term_get_fkeys (address, kboard)
function key specification, rather than giving the user an error and
refusing to run at all on such a terminal. */
- extern Lisp_Object Fidentity ();
+ extern Lisp_Object Fidentity (Lisp_Object);
term_get_fkeys_address = address;
term_get_fkeys_kboard = kboard;
internal_condition_case (term_get_fkeys_1, Qerror, Fidentity);
}
static Lisp_Object
-term_get_fkeys_1 ()
+term_get_fkeys_1 (void)
{
int i;
@@ -1517,10 +1514,10 @@ term_get_fkeys_1 ()
#define produce_composite_glyph produce_composite_glyph_term
#endif
-static void append_glyph P_ ((struct it *));
-static void produce_stretch_glyph P_ ((struct it *));
-static void append_composite_glyph P_ ((struct it *));
-static void produce_composite_glyph P_ ((struct it *));
+static void append_glyph (struct it *);
+static void produce_stretch_glyph (struct it *);
+static void append_composite_glyph (struct it *);
+static void produce_composite_glyph (struct it *);
/* Append glyphs to IT's glyph_row. Called from produce_glyphs for
terminal frames if IT->glyph_row != NULL. IT->char_to_display is
@@ -1529,8 +1526,7 @@ static void produce_composite_glyph P_ ((struct it *));
IT->pixel_width > 1. */
static void
-append_glyph (it)
- struct it *it;
+append_glyph (struct it *it)
{
struct glyph *glyph, *end;
int i;
@@ -1609,8 +1605,7 @@ append_glyph (it)
instead they use the macro PRODUCE_GLYPHS. */
void
-produce_glyphs (it)
- struct it *it;
+produce_glyphs (struct it *it)
{
/* If a hook is installed, let it do the work. */
@@ -1728,8 +1723,7 @@ produce_glyphs (it)
to reach HPOS, a value in canonical character units. */
static void
-produce_stretch_glyph (it)
- struct it *it;
+produce_stretch_glyph (struct it *it)
{
/* (space :width WIDTH ...) */
Lisp_Object prop, plist;
@@ -1798,8 +1792,7 @@ produce_stretch_glyph (it)
face. */
static void
-append_composite_glyph (it)
- struct it *it;
+append_composite_glyph (struct it *it)
{
struct glyph *glyph;
@@ -1863,8 +1856,7 @@ append_composite_glyph (it)
correctly. */
static void
-produce_composite_glyph (it)
- struct it *it;
+produce_composite_glyph (struct it *it)
{
int c;
@@ -1894,9 +1886,7 @@ produce_composite_glyph (it)
face_id, c, len of IT are left untouched. */
void
-produce_special_glyphs (it, what)
- struct it *it;
- enum display_element_type what;
+produce_special_glyphs (struct it *it, enum display_element_type what)
{
struct it temp_it;
Lisp_Object gc;
@@ -1907,7 +1897,7 @@ produce_special_glyphs (it, what)
temp_it.what = IT_CHARACTER;
temp_it.len = 1;
temp_it.object = make_number (0);
- bzero (&temp_it.current, sizeof temp_it.current);
+ memset (&temp_it.current, 0, sizeof temp_it.current);
if (what == IT_CONTINUATION)
{
@@ -1970,9 +1960,7 @@ produce_special_glyphs (it, what)
FACE_ID is a realized face ID number, in the face cache. */
static void
-turn_on_face (f, face_id)
- struct frame *f;
- int face_id;
+turn_on_face (struct frame *f, int face_id)
{
struct face *face = FACE_FROM_ID (f, face_id);
long fg = face->foreground;
@@ -2069,9 +2057,7 @@ turn_on_face (f, face_id)
/* Turn off appearances of face FACE_ID on tty frame F. */
static void
-turn_off_face (f, face_id)
- struct frame *f;
- int face_id;
+turn_off_face (struct frame *f, int face_id)
{
struct face *face = FACE_FROM_ID (f, face_id);
struct tty_display_info *tty = FRAME_TTY (f);
@@ -2124,10 +2110,8 @@ turn_off_face (f, face_id)
colors FG and BG. */
int
-tty_capable_p (tty, caps, fg, bg)
- struct tty_display_info *tty;
- unsigned caps;
- unsigned long fg, bg;
+tty_capable_p (struct tty_display_info *tty, unsigned int caps,
+ unsigned long fg, unsigned long bg)
{
#define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit) \
if ((caps & (cap)) && (!(TS) || !MAY_USE_WITH_COLORS_P(tty, NC_bit))) \
@@ -2153,8 +2137,7 @@ DEFUN ("tty-display-color-p", Ftty_display_color_p, Stty_display_color_p,
TERMINAL can be a terminal object, a frame, or nil (meaning the
selected frame's terminal). This function always returns nil if
TERMINAL does not refer to a text-only terminal. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct terminal *t = get_tty_terminal (terminal, 0);
if (!t)
@@ -2171,8 +2154,7 @@ DEFUN ("tty-display-color-cells", Ftty_display_color_cells,
TERMINAL can be a terminal object, a frame, or nil (meaning the
selected frame's terminal). This function always returns 0 if
TERMINAL does not refer to a text-only terminal. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct terminal *t = get_tty_terminal (terminal, 0);
if (!t)
@@ -2267,9 +2249,7 @@ tty_setup_colors (struct tty_display_info *tty, int mode)
}
void
-set_tty_color_mode (tty, f)
- struct tty_display_info *tty;
- struct frame *f;
+set_tty_color_mode (struct tty_display_info *tty, struct frame *f)
{
Lisp_Object tem, val;
Lisp_Object color_mode;
@@ -2333,8 +2313,7 @@ get_tty_terminal (Lisp_Object terminal, int throw)
Returns NULL if the named terminal device is not opened. */
struct terminal *
-get_named_tty (name)
- char *name;
+get_named_tty (char *name)
{
struct terminal *t;
@@ -2359,8 +2338,7 @@ Returns nil if TERMINAL is not on a tty device.
TERMINAL can be a terminal object, a frame, or nil (meaning the
selected frame's terminal). */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct terminal *t = get_terminal (terminal, 1);
@@ -2379,8 +2357,7 @@ DEFUN ("controlling-tty-p", Fcontrolling_tty_p, Scontrolling_tty_p, 0, 1, 0,
TERMINAL can be a terminal object, a frame, or nil (meaning the
selected frame's terminal). This function always returns nil if
TERMINAL is not on a tty device. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct terminal *t = get_terminal (terminal, 1);
@@ -2400,8 +2377,7 @@ no effect if used on a non-tty terminal.
TERMINAL can be a terminal object, a frame or nil (meaning the
selected frame's terminal). This function always returns nil if
TERMINAL does not refer to a text-only terminal. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct terminal *t = get_terminal (terminal, 1);
@@ -2431,8 +2407,7 @@ terminal device.
suspended.
A suspended tty may be resumed by calling `resume-tty' on it. */)
- (tty)
- Lisp_Object tty;
+ (Lisp_Object tty)
{
struct terminal *t = get_tty_terminal (tty, 1);
FILE *f;
@@ -2456,10 +2431,7 @@ A suspended tty may be resumed by calling `resume-tty' on it. */)
}
reset_sys_modes (t->display_info.tty);
-
-#ifdef subprocesses
delete_keyboard_wait_descriptor (fileno (f));
-#endif
#ifndef MSDOS
fclose (f);
@@ -2498,8 +2470,7 @@ suspended.
TTY may be a terminal object, a frame, or nil (meaning the selected
frame's terminal). */)
- (tty)
- Lisp_Object tty;
+ (Lisp_Object tty)
{
struct terminal *t = get_tty_terminal (tty, 1);
int fd;
@@ -2528,9 +2499,7 @@ frame's terminal). */)
t->display_info.tty->input = t->display_info.tty->output;
#endif
-#ifdef subprocesses
add_keyboard_wait_descriptor (fd);
-#endif
if (FRAMEP (t->display_info.tty->top_frame))
{
@@ -2664,7 +2633,7 @@ term_show_mouse_face (enum draw_glyphs_face draw)
}
static void
-term_clear_mouse_face ()
+term_clear_mouse_face (void)
{
if (!NILP (mouse_face_window))
term_show_mouse_face (DRAW_NORMAL_TEXT);
@@ -3171,7 +3140,7 @@ DEFUN ("gpm-mouse-start", Fgpm_mouse_start, Sgpm_mouse_start,
0, 0, 0,
doc: /* Open a connection to Gpm.
Gpm-mouse can only be activated for one tty at a time. */)
- ()
+ (void)
{
struct frame *f = SELECTED_FRAME ();
struct tty_display_info *tty
@@ -3219,7 +3188,7 @@ close_gpm (int fd)
DEFUN ("gpm-mouse-stop", Fgpm_mouse_stop, Sgpm_mouse_stop,
0, 0, 0,
doc: /* Close a connection to Gpm. */)
- ()
+ (void)
{
struct frame *f = SELECTED_FRAME ();
struct tty_display_info *tty
@@ -3252,7 +3221,7 @@ create_tty_output (struct frame *f)
abort ();
t = xmalloc (sizeof (struct tty_output));
- bzero (t, sizeof (struct tty_output));
+ memset (t, 0, sizeof (struct tty_output));
t->display_info = FRAME_TERMINAL (f)->display_info.tty;
@@ -3405,8 +3374,6 @@ dissociate_if_controlling_tty (int fd)
#endif /* !DOS_NT */
}
-static void maybe_fatal();
-
/* Create a termcap display on the tty device with the given name and
type.
@@ -3459,7 +3426,7 @@ init_tty (char *name, char *terminal_type, int must_succeed)
#else
tty = (struct tty_display_info *) xmalloc (sizeof (struct tty_display_info));
#endif
- bzero (tty, sizeof (struct tty_display_info));
+ memset (tty, 0, sizeof (struct tty_display_info));
tty->next = tty_list;
tty_list = tty;
@@ -3551,9 +3518,7 @@ init_tty (char *name, char *terminal_type, int must_succeed)
terminal->name = xstrdup (name);
tty->type = xstrdup (terminal_type);
-#ifdef subprocesses
add_keyboard_wait_descriptor (0);
-#endif
Wcm_clear (tty);
@@ -3778,7 +3743,7 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
if (FrameRows (tty) < 3 || FrameCols (tty) < 3)
maybe_fatal (must_succeed, terminal,
- "Screen size %dx%d is too small"
+ "Screen size %dx%d is too small",
"Screen size %dx%d is too small",
FrameCols (tty), FrameRows (tty));
@@ -3954,24 +3919,39 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
return terminal;
}
+
+static void
+vfatal (const char *str, va_list ap)
+{
+ fprintf (stderr, "emacs: ");
+ vfprintf (stderr, str, ap);
+ if (!(strlen (str) > 0 && str[strlen (str) - 1] == '\n'))
+ fprintf (stderr, "\n");
+ va_end (ap);
+ fflush (stderr);
+ exit (1);
+}
+
+
/* Auxiliary error-handling function for init_tty.
Delete TERMINAL, then call error or fatal with str1 or str2,
respectively, according to MUST_SUCCEED. */
static void
-maybe_fatal (must_succeed, terminal, str1, str2, arg1, arg2)
- int must_succeed;
- struct terminal *terminal;
- char *str1, *str2, *arg1, *arg2;
+maybe_fatal (int must_succeed, struct terminal *terminal,
+ const char *str1, const char *str2, ...)
{
+ va_list ap;
+ va_start (ap, str2);
if (terminal)
delete_tty (terminal);
if (must_succeed)
- fatal (str2, arg1, arg2);
+ vfatal (str2, ap);
else
- error (str1, arg1, arg2);
+ verror (str1, ap);
+ va_end (ap);
abort ();
}
@@ -3980,13 +3960,8 @@ fatal (const char *str, ...)
{
va_list ap;
va_start (ap, str);
- fprintf (stderr, "emacs: ");
- vfprintf (stderr, str, ap);
- if (!(strlen (str) > 0 && str[strlen (str) - 1] == '\n'))
- fprintf (stderr, "\n");
+ vfatal (str, ap);
va_end (ap);
- fflush (stderr);
- exit (1);
}
@@ -4035,9 +4010,7 @@ delete_tty (struct terminal *terminal)
if (tty->input)
{
-#ifdef subprocesses
delete_keyboard_wait_descriptor (fileno (tty->input));
-#endif
if (tty->input != stdin)
fclose (tty->input);
}
@@ -4051,7 +4024,7 @@ delete_tty (struct terminal *terminal)
xfree (tty->termcap_strings_buffer);
xfree (tty->termcap_term_buffer);
- bzero (tty, sizeof (struct tty_display_info));
+ memset (tty, 0, sizeof (struct tty_display_info));
xfree (tty);
}
@@ -4072,7 +4045,7 @@ mark_ttys (void)
void
-syms_of_term ()
+syms_of_term (void)
{
DEFVAR_BOOL ("system-uses-terminfo", &system_uses_terminfo,
doc: /* Non-nil means the system uses terminfo rather than termcap.
diff --git a/src/termcap.c b/src/termcap.c
index 9b4a7f657f6..ea4ef244f64 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -18,12 +18,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* Emacs config.h may rename various library functions such as malloc. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
-#ifdef emacs
-
#include <setjmp.h>
#include <lisp.h> /* xmalloc is here */
/* Get the O_* definitions for open et al. */
@@ -35,31 +30,6 @@ Boston, MA 02110-1301, USA. */
#include <unistd.h>
#endif
-#else /* not emacs */
-
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <string.h>
-#else
-char *getenv ();
-char *malloc ();
-char *realloc ();
-#endif
-
-/* Do this after the include, in case string.h prototypes bcopy. */
-#if (defined(HAVE_STRING_H) || defined(STDC_HEADERS)) && !defined(bcopy)
-#define bcopy(s, d, n) memcpy ((d), (s), (n))
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#endif /* not emacs */
-
#ifndef NULL
#define NULL (char *) 0
#endif
@@ -89,37 +59,6 @@ int bufsize = 128;
#define TERMCAP_FILE "/etc/termcap"
#endif
-#ifndef emacs
-static void
-memory_out ()
-{
- write (2, "virtual memory exhausted\n", 25);
- exit (1);
-}
-
-static char *
-xmalloc (size)
- unsigned size;
-{
- register char *tem = malloc (size);
-
- if (!tem)
- memory_out ();
- return tem;
-}
-
-static char *
-xrealloc (ptr, size)
- char *ptr;
- unsigned size;
-{
- register char *tem = realloc (ptr, size);
-
- if (!tem)
- memory_out ();
- return tem;
-}
-#endif /* not emacs */
/* Looking up capabilities in the entry already found. */
@@ -127,15 +66,14 @@ xrealloc (ptr, size)
for tgetnum, tgetflag and tgetstr to find. */
static char *term_entry;
-static char *tgetst1 ();
+static char *tgetst1 (char *ptr, char **area);
/* Search entry BP for capability CAP.
Return a pointer to the capability (in BP) if found,
0 if not found. */
static char *
-find_capability (bp, cap)
- register char *bp, *cap;
+find_capability (register char *bp, register char *cap)
{
for (; *bp; bp++)
if (bp[0] == ':'
@@ -146,8 +84,7 @@ find_capability (bp, cap)
}
int
-tgetnum (cap)
- char *cap;
+tgetnum (char *cap)
{
register char *ptr = find_capability (term_entry, cap);
if (!ptr || ptr[-1] != '#')
@@ -156,8 +93,7 @@ tgetnum (cap)
}
int
-tgetflag (cap)
- char *cap;
+tgetflag (char *cap)
{
register char *ptr = find_capability (term_entry, cap);
return ptr && ptr[-1] == ':';
@@ -169,9 +105,7 @@ tgetflag (cap)
If AREA is null, space is allocated with `malloc'. */
char *
-tgetstr (cap, area)
- char *cap;
- char **area;
+tgetstr (char *cap, char **area)
{
register char *ptr = find_capability (term_entry, cap);
if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~'))
@@ -209,9 +143,7 @@ static const char esctab[]
or NULL if PTR is NULL. */
static char *
-tgetst1 (ptr, area)
- char *ptr;
- char **area;
+tgetst1 (char *ptr, char **area)
{
register char *p, *r;
register int c;
@@ -322,7 +254,7 @@ tgetst1 (ptr, area)
cut[last_p_param].len = r - cut[last_p_param].beg;
for (i = 0, wp = ret; i <= last_p_param; wp += cut[i++].len)
- bcopy (cut[i].beg, wp, cut[i].len);
+ memcpy (wp, cut[i].beg, cut[i].len);
r = wp;
}
}
@@ -357,10 +289,7 @@ static const int speeds[] =
#endif /* not emacs */
void
-tputs (str, nlines, outfun)
- register char *str;
- int nlines;
- register int (*outfun) ();
+tputs (register char *str, int nlines, register int (*outfun) (/* ??? */))
{
register int padcount = 0;
register int speed;
@@ -432,10 +361,10 @@ struct termcap_buffer
/* Forward declarations of static functions. */
-static int scan_file ();
-static char *gobble_line ();
-static int compare_contin ();
-static int name_match ();
+static int scan_file (char *str, int fd, register struct termcap_buffer *bufp);
+static char *gobble_line (int fd, register struct termcap_buffer *bufp, char *append_end);
+static int compare_contin (register char *str1, register char *str2);
+static int name_match (char *line, char *name);
#ifdef MSDOS /* MW, May 1993 */
static int
@@ -460,8 +389,7 @@ valid_filename_p (fn)
in it, and some other value otherwise. */
int
-tgetent (bp, name)
- char *bp, *name;
+tgetent (char *bp, char *name)
{
register char *termcap_name;
register int fd;
@@ -625,10 +553,7 @@ tgetent (bp, name)
or 0 if no entry is found in the file. */
static int
-scan_file (str, fd, bufp)
- char *str;
- int fd;
- register struct termcap_buffer *bufp;
+scan_file (char *str, int fd, register struct termcap_buffer *bufp)
{
register char *end;
@@ -665,8 +590,7 @@ scan_file (str, fd, bufp)
by termcap entry LINE. */
static int
-name_match (line, name)
- char *line, *name;
+name_match (char *line, char *name)
{
register char *tem;
@@ -681,8 +605,7 @@ name_match (line, name)
}
static int
-compare_contin (str1, str2)
- register char *str1, *str2;
+compare_contin (register char *str1, register char *str2)
{
register int c1, c2;
while (1)
@@ -722,10 +645,7 @@ compare_contin (str1, str2)
thing as one line. The caller decides when a line is continued. */
static char *
-gobble_line (fd, bufp, append_end)
- int fd;
- register struct termcap_buffer *bufp;
- char *append_end;
+gobble_line (int fd, register struct termcap_buffer *bufp, char *append_end)
{
register char *end;
register int nread;
@@ -758,7 +678,7 @@ gobble_line (fd, bufp, append_end)
else
{
append_end -= bufp->ptr - buf;
- bcopy (bufp->ptr, buf, bufp->full -= bufp->ptr - buf);
+ memcpy (buf, bufp->ptr, bufp->full -= bufp->ptr - buf);
bufp->ptr = buf;
}
if (!(nread = read (fd, buf + bufp->full, bufp->size - bufp->full)))
diff --git a/src/termhooks.h b/src/termhooks.h
index 2b4011627c8..7762dd15efe 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -39,7 +39,7 @@ enum scroll_bar_part {
/* If the value of the frame parameter changed, whis hook is called.
For example, if going from fullscreen to not fullscreen this hook
may do something OS dependent, like extended window manager hints on X11. */
-extern void (*fullscreen_hook) P_ ((struct frame *f));
+extern void (*fullscreen_hook) (struct frame *f);
/* Input queue declarations and hooks. */
@@ -255,7 +255,7 @@ struct input_event
Lisp_Object arg;
};
-#define EVENT_INIT(event) bzero (&(event), sizeof (struct input_event))
+#define EVENT_INIT(event) memset (&(event), 0, sizeof (struct input_event))
/* Bits in the modifiers member of the input_event structure.
Note that reorder_modifiers assumes that the bits are in canonical
@@ -415,28 +415,28 @@ struct terminal
/* Text display hooks. */
- void (*cursor_to_hook) P_ ((struct frame *f, int vpos, int hpos));
- void (*raw_cursor_to_hook) P_ ((struct frame *, int, int));
+ void (*cursor_to_hook) (struct frame *f, int vpos, int hpos);
+ void (*raw_cursor_to_hook) (struct frame *, int, int);
- void (*clear_to_end_hook) P_ ((struct frame *));
- void (*clear_frame_hook) P_ ((struct frame *));
- void (*clear_end_of_line_hook) P_ ((struct frame *, int));
+ void (*clear_to_end_hook) (struct frame *);
+ void (*clear_frame_hook) (struct frame *);
+ void (*clear_end_of_line_hook) (struct frame *, int);
- void (*ins_del_lines_hook) P_ ((struct frame *f, int, int));
+ void (*ins_del_lines_hook) (struct frame *f, int, int);
- void (*insert_glyphs_hook) P_ ((struct frame *f, struct glyph *s, int n));
- void (*write_glyphs_hook) P_ ((struct frame *f, struct glyph *s, int n));
- void (*delete_glyphs_hook) P_ ((struct frame *, int));
+ void (*insert_glyphs_hook) (struct frame *f, struct glyph *s, int n);
+ void (*write_glyphs_hook) (struct frame *f, struct glyph *s, int n);
+ void (*delete_glyphs_hook) (struct frame *, int);
- void (*ring_bell_hook) P_ ((struct frame *f));
- void (*toggle_invisible_pointer_hook) P_ ((struct frame *f, int invisible));
+ void (*ring_bell_hook) (struct frame *f);
+ void (*toggle_invisible_pointer_hook) (struct frame *f, int invisible);
- void (*reset_terminal_modes_hook) P_ ((struct terminal *));
- void (*set_terminal_modes_hook) P_ ((struct terminal *));
+ void (*reset_terminal_modes_hook) (struct terminal *);
+ void (*set_terminal_modes_hook) (struct terminal *);
- void (*update_begin_hook) P_ ((struct frame *));
- void (*update_end_hook) P_ ((struct frame *));
- void (*set_terminal_window_hook) P_ ((struct frame *, int));
+ void (*update_begin_hook) (struct frame *);
+ void (*update_end_hook) (struct frame *);
+ void (*set_terminal_window_hook) (struct frame *, int);
/* Multi-frame and mouse support hooks. */
@@ -458,12 +458,12 @@ struct terminal
This should clear mouse_moved until the next motion
event arrives. */
- void (*mouse_position_hook) P_ ((struct frame **f, int,
- Lisp_Object *bar_window,
- enum scroll_bar_part *part,
- Lisp_Object *x,
- Lisp_Object *y,
- unsigned long *time));
+ void (*mouse_position_hook) (struct frame **f, int,
+ Lisp_Object *bar_window,
+ enum scroll_bar_part *part,
+ Lisp_Object *x,
+ Lisp_Object *y,
+ unsigned long *time);
/* The window system handling code should set this if the mouse has
moved since the last call to the mouse_position_hook. Calling that
@@ -473,7 +473,7 @@ struct terminal
/* When a frame's focus redirection is changed, this hook tells the
window system code to re-decide where to put the highlight. Under
X, this means that Emacs lies about where the focus is. */
- void (*frame_rehighlight_hook) P_ ((struct frame *));
+ void (*frame_rehighlight_hook) (struct frame *);
/* If we're displaying frames using a window system that can stack
frames on top of each other, this hook allows you to bring a frame
@@ -485,12 +485,12 @@ struct terminal
If RAISE is non-zero, F is brought to the front, before all other
windows. If RAISE is zero, F is sent to the back, behind all other
windows. */
- void (*frame_raise_lower_hook) P_ ((struct frame *f, int raise));
+ void (*frame_raise_lower_hook) (struct frame *f, int raise);
/* If the value of the frame parameter changed, whis hook is called.
For example, if going from fullscreen to not fullscreen this hook
may do something OS dependent, like extended window manager hints on X11. */
- void (*fullscreen_hook) P_ ((struct frame *f));
+ void (*fullscreen_hook) (struct frame *f);
/* Scroll bar hooks. */
@@ -520,9 +520,9 @@ struct terminal
indicate that we are displaying PORTION characters out of a total
of WHOLE characters, starting at POSITION. If WINDOW doesn't yet
have a scroll bar, create one for it. */
- void (*set_vertical_scroll_bar_hook) P_ ((struct window *window,
- int portion, int whole,
- int position));
+ void (*set_vertical_scroll_bar_hook) (struct window *window,
+ int portion, int whole,
+ int position);
/* The following three hooks are used when we're doing a thorough
@@ -545,11 +545,11 @@ struct terminal
If non-zero, this hook should be safe to apply to any frame,
whether or not it can support scroll bars, and whether or not it is
currently displaying them. */
- void (*condemn_scroll_bars_hook) P_ ((struct frame *frame));
+ void (*condemn_scroll_bars_hook) (struct frame *frame);
/* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
Note that it's okay to redeem a scroll bar that is not condemned. */
- void (*redeem_scroll_bar_hook) P_ ((struct window *window));
+ void (*redeem_scroll_bar_hook) (struct window *window);
/* Remove all scroll bars on FRAME that haven't been saved since the
last call to `*condemn_scroll_bars_hook'.
@@ -562,7 +562,7 @@ struct terminal
If non-zero, this hook should be safe to apply to any frame,
whether or not it can support scroll bars, and whether or not it is
currently displaying them. */
- void (*judge_scroll_bars_hook) P_ ((struct frame *FRAME));
+ void (*judge_scroll_bars_hook) (struct frame *FRAME);
/* Called to read input events.
@@ -584,17 +584,17 @@ struct terminal
Therefore, in most cases EXPECTED should be simply ignored.
XXX This documentation needs to be updated. */
- int (*read_socket_hook) P_ ((struct terminal *terminal,
- int expected,
- struct input_event *hold_quit));
+ int (*read_socket_hook) (struct terminal *terminal,
+ int expected,
+ struct input_event *hold_quit);
/* Called when a frame's display becomes entirely up to date. */
- void (*frame_up_to_date_hook) P_ ((struct frame *));
+ void (*frame_up_to_date_hook) (struct frame *);
/* Called to delete the device-specific portions of a frame that is
on this terminal device. */
- void (*delete_frame_hook) P_ ((struct frame *));
+ void (*delete_frame_hook) (struct frame *);
/* Called after the last frame on this terminal is deleted, or when
the display device was closed (hangup).
@@ -606,7 +606,7 @@ struct terminal
on the terminal. delete_frame ensures that there are no live
frames on the terminal when it calls this hook, so infinite
recursion is prevented. */
- void (*delete_terminal_hook) P_ ((struct terminal *));
+ void (*delete_terminal_hook) (struct terminal *);
};
@@ -647,10 +647,10 @@ extern struct terminal *terminal_list;
/* Return true if the terminal device is not suspended. */
#define TERMINAL_ACTIVE_P(d) (((d)->type != output_termcap && (d)->type !=output_msdos_raw) || (d)->display_info.tty->input)
-extern Lisp_Object get_terminal_param P_ ((struct terminal *, Lisp_Object));
-extern struct terminal *get_terminal P_ ((Lisp_Object terminal, int));
-extern struct terminal *create_terminal P_ ((void));
-extern void delete_terminal P_ ((struct terminal *));
+extern Lisp_Object get_terminal_param (struct terminal *, Lisp_Object);
+extern struct terminal *get_terminal (Lisp_Object terminal, int);
+extern struct terminal *create_terminal (void);
+extern void delete_terminal (struct terminal *);
/* The initial terminal device, created by initial_term_init. */
extern struct terminal *initial_terminal;
diff --git a/src/terminal.c b/src/terminal.c
index 45d918a2bd4..bda6c307a10 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -40,7 +40,7 @@ struct terminal *initial_terminal;
/* Function to use to ring the bell. */
Lisp_Object Vring_bell_function;
-static void delete_initial_terminal P_ ((struct terminal *));
+static void delete_initial_terminal (struct terminal *);
@@ -300,8 +300,7 @@ selected frame's terminal).
Normally, you may not delete a display if all other displays are suspended,
but if the second argument FORCE is non-nil, you may do so. */)
- (terminal, force)
- Lisp_Object terminal, force;
+ (Lisp_Object terminal, Lisp_Object force)
{
struct terminal *t = get_terminal (terminal, 0);
@@ -342,8 +341,7 @@ DEFUN ("frame-terminal", Fframe_terminal, Sframe_terminal, 0, 1, 0,
If FRAME is nil, the selected frame is used.
The terminal device is represented by its integer identifier. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct terminal *t;
@@ -370,8 +368,7 @@ Value is nil if OBJECT is not a live display terminal.
If object is a live display terminal, the return value indicates what
sort of output terminal it uses. See the documentation of `framep' for
possible return values. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
struct terminal *t;
@@ -402,7 +399,7 @@ possible return values. */)
DEFUN ("terminal-list", Fterminal_list, Sterminal_list, 0, 0, 0,
doc: /* Return a list of all terminal devices. */)
- ()
+ (void)
{
Lisp_Object terminal, terminals = Qnil;
struct terminal *t;
@@ -422,8 +419,7 @@ It is not guaranteed that the returned value is unique among opened devices.
TERMINAL may be a terminal object, a frame, or nil (meaning the
selected frame's terminal). */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct terminal *t
= TERMINALP (terminal) ? XTERMINAL (terminal) : get_terminal (terminal, 1);
@@ -435,9 +431,7 @@ selected frame's terminal). */)
/* Return the value of terminal parameter PARAM in terminal T. */
Lisp_Object
-get_terminal_param (t, param)
- struct terminal *t;
- Lisp_Object param;
+get_terminal_param (struct terminal *t, Lisp_Object param)
{
Lisp_Object tem = Fassq (param, t->param_alist);
if (EQ (tem, Qnil))
@@ -449,10 +443,7 @@ get_terminal_param (t, param)
Return the previous value. */
Lisp_Object
-store_terminal_param (t, parameter, value)
- struct terminal *t;
- Lisp_Object parameter;
- Lisp_Object value;
+store_terminal_param (struct terminal *t, Lisp_Object parameter, Lisp_Object value)
{
Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist);
if (EQ (old_alist_elt, Qnil))
@@ -476,8 +467,7 @@ is a symbol.
TERMINAL can be a terminal object, a frame, or nil (meaning the
selected frame's terminal). */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct terminal *t
= TERMINALP (terminal) ? XTERMINAL (terminal) : get_terminal (terminal, 1);
@@ -488,9 +478,7 @@ DEFUN ("terminal-parameter", Fterminal_parameter, Sterminal_parameter, 2, 2, 0,
doc: /* Return TERMINAL's value for parameter PARAMETER.
TERMINAL can be a terminal object, a frame, or nil (meaning the
selected frame's terminal). */)
- (terminal, parameter)
- Lisp_Object terminal;
- Lisp_Object parameter;
+ (Lisp_Object terminal, Lisp_Object parameter)
{
Lisp_Object value;
struct terminal *t
@@ -507,10 +495,7 @@ Return the previous value of PARAMETER.
TERMINAL can be a terminal object, a frame or nil (meaning the
selected frame's terminal). */)
- (terminal, parameter, value)
- Lisp_Object terminal;
- Lisp_Object parameter;
- Lisp_Object value;
+ (Lisp_Object terminal, Lisp_Object parameter, Lisp_Object value)
{
struct terminal *t
= TERMINALP (terminal) ? XTERMINAL (terminal) : get_terminal (terminal, 1);
@@ -552,7 +537,7 @@ delete_initial_terminal (struct terminal *terminal)
}
void
-syms_of_terminal ()
+syms_of_terminal (void)
{
DEFVAR_LISP ("ring-bell-function", &Vring_bell_function,
diff --git a/src/terminfo.c b/src/terminfo.c
index 55508196fae..89d7426e8f4 100644
--- a/src/terminfo.c
+++ b/src/terminfo.c
@@ -35,13 +35,10 @@ char *UP, *BC, PC;
*/
char *
-tparam (string, outstring, len, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
- char *string;
- char *outstring;
- int len, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9;
+tparam (char *string, char *outstring, int len, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9)
{
char *temp;
- extern char *tparm();
+ extern char *tparm(/* ??? */);
temp = tparm (string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
if (outstring == 0)
diff --git a/src/textprop.c b/src/textprop.c
index 83d09cce558..0e398e41e4a 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -78,15 +78,14 @@ Lisp_Object Vtext_property_default_nonsticky;
Lisp_Object interval_insert_behind_hooks;
Lisp_Object interval_insert_in_front_hooks;
-static void text_read_only P_ ((Lisp_Object)) NO_RETURN;
+static void text_read_only (Lisp_Object) NO_RETURN;
/* Signal a `text-read-only' error. This function makes it easier
to capture that error in GDB by putting a breakpoint on it. */
static void
-text_read_only (propval)
- Lisp_Object propval;
+text_read_only (Lisp_Object propval)
{
if (STRINGP (propval))
xsignal1 (Qtext_read_only, propval);
@@ -123,9 +122,7 @@ text_read_only (propval)
#define hard 1
INTERVAL
-validate_interval_range (object, begin, end, force)
- Lisp_Object object, *begin, *end;
- int force;
+validate_interval_range (Lisp_Object object, Lisp_Object *begin, Lisp_Object *end, int force)
{
register INTERVAL i;
int searchpos;
@@ -191,8 +188,7 @@ validate_interval_range (object, begin, end, force)
is even numbered and thus suitable as a plist. */
static Lisp_Object
-validate_plist (list)
- Lisp_Object list;
+validate_plist (Lisp_Object list)
{
if (NILP (list))
return Qnil;
@@ -218,9 +214,7 @@ validate_plist (list)
with the same values, of list PLIST. */
static int
-interval_has_all_properties (plist, i)
- Lisp_Object plist;
- INTERVAL i;
+interval_has_all_properties (Lisp_Object plist, INTERVAL i)
{
register Lisp_Object tail1, tail2, sym1;
register int found;
@@ -256,9 +250,7 @@ interval_has_all_properties (plist, i)
properties of PLIST, regardless of their values. */
static INLINE int
-interval_has_some_properties (plist, i)
- Lisp_Object plist;
- INTERVAL i;
+interval_has_some_properties (Lisp_Object plist, INTERVAL i)
{
register Lisp_Object tail1, tail2, sym;
@@ -280,9 +272,7 @@ interval_has_some_properties (plist, i)
property names in LIST, regardless of their values. */
static INLINE int
-interval_has_some_properties_list (list, i)
- Lisp_Object list;
- INTERVAL i;
+interval_has_some_properties_list (Lisp_Object list, INTERVAL i)
{
register Lisp_Object tail1, tail2, sym;
@@ -305,8 +295,7 @@ interval_has_some_properties_list (list, i)
/* Return the value of PROP in property-list PLIST, or Qunbound if it
has none. */
static Lisp_Object
-property_value (plist, prop)
- Lisp_Object plist, prop;
+property_value (Lisp_Object plist, Lisp_Object prop)
{
Lisp_Object value;
@@ -324,9 +313,7 @@ property_value (plist, prop)
OBJECT is the string or buffer that INTERVAL belongs to. */
static void
-set_properties (properties, interval, object)
- Lisp_Object properties, object;
- INTERVAL interval;
+set_properties (Lisp_Object properties, INTERVAL interval, Lisp_Object object)
{
Lisp_Object sym, value;
@@ -372,10 +359,7 @@ set_properties (properties, interval, object)
are actually added to I's plist) */
static int
-add_properties (plist, i, object)
- Lisp_Object plist;
- INTERVAL i;
- Lisp_Object object;
+add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
{
Lisp_Object tail1, tail2, sym1, val1;
register int changed = 0;
@@ -451,10 +435,7 @@ add_properties (plist, i, object)
OBJECT is the string or buffer containing I. */
static int
-remove_properties (plist, list, i, object)
- Lisp_Object plist, list;
- INTERVAL i;
- Lisp_Object object;
+remove_properties (Lisp_Object plist, Lisp_Object list, INTERVAL i, Lisp_Object object)
{
register Lisp_Object tail1, tail2, sym, current_plist;
register int changed = 0;
@@ -535,9 +516,7 @@ erase_properties (i)
POSITION is BEG-based. */
INTERVAL
-interval_of (position, object)
- int position;
- Lisp_Object object;
+interval_of (int position, Lisp_Object object)
{
register INTERVAL i;
int beg, end;
@@ -579,8 +558,7 @@ If the optional second argument OBJECT is a buffer (or nil, which means
the current buffer), POSITION is a buffer position (integer or marker).
If OBJECT is a string, POSITION is a 0-based index into it.
If POSITION is at the end of OBJECT, the value is nil. */)
- (position, object)
- Lisp_Object position, object;
+ (Lisp_Object position, Lisp_Object object)
{
register INTERVAL i;
@@ -604,9 +582,7 @@ DEFUN ("get-text-property", Fget_text_property, Sget_text_property, 2, 3, 0,
doc: /* Return the value of POSITION's property PROP, in OBJECT.
OBJECT is optional and defaults to the current buffer.
If POSITION is at the end of OBJECT, the value is nil. */)
- (position, prop, object)
- Lisp_Object position, object;
- Lisp_Object prop;
+ (Lisp_Object position, Lisp_Object prop, Lisp_Object object)
{
return textget (Ftext_properties_at (position, object), prop);
}
@@ -623,10 +599,7 @@ If POSITION is at the end of OBJECT, the value is nil. */)
window-specific overlays are considered only if they are associated
with OBJECT. */
Lisp_Object
-get_char_property_and_overlay (position, prop, object, overlay)
- Lisp_Object position, object;
- register Lisp_Object prop;
- Lisp_Object *overlay;
+get_char_property_and_overlay (Lisp_Object position, register Lisp_Object prop, Lisp_Object object, Lisp_Object *overlay)
{
struct window *w = 0;
@@ -689,9 +662,7 @@ If OBJECT is a buffer, then overlay properties are considered as well as
text properties.
If OBJECT is a window, then that window's buffer is used, but window-specific
overlays are considered only if they are associated with OBJECT. */)
- (position, prop, object)
- Lisp_Object position, object;
- register Lisp_Object prop;
+ (Lisp_Object position, Lisp_Object prop, Lisp_Object object)
{
return get_char_property_and_overlay (position, prop, object, 0);
}
@@ -710,9 +681,7 @@ value is always nil, since strings do not have overlays. If OBJECT is
a window, then that window's buffer is used, but window-specific
overlays are considered only if they are associated with OBJECT. If
POSITION is at the end of OBJECT, both car and cdr are nil. */)
- (position, prop, object)
- Lisp_Object position, object;
- register Lisp_Object prop;
+ (Lisp_Object position, Lisp_Object prop, Lisp_Object object)
{
Lisp_Object overlay;
Lisp_Object val
@@ -732,8 +701,7 @@ If none is found up to (point-max), the function returns (point-max).
If the optional second argument LIMIT is non-nil, don't search
past position LIMIT; return LIMIT if nothing is found before LIMIT.
LIMIT is a no-op if it is greater than (point-max). */)
- (position, limit)
- Lisp_Object position, limit;
+ (Lisp_Object position, Lisp_Object limit)
{
Lisp_Object temp;
@@ -758,8 +726,7 @@ If none is found since (point-min), the function returns (point-min).
If the optional second argument LIMIT is non-nil, don't search
past position LIMIT; return LIMIT if nothing is found before LIMIT.
LIMIT is a no-op if it is less than (point-min). */)
- (position, limit)
- Lisp_Object position, limit;
+ (Lisp_Object position, Lisp_Object limit)
{
Lisp_Object temp;
@@ -791,8 +758,7 @@ If the property is constant all the way to the end of OBJECT, return the
last valid position in OBJECT.
If the optional fourth argument LIMIT is non-nil, don't search
past position LIMIT; return LIMIT if nothing is found before LIMIT. */)
- (position, prop, object, limit)
- Lisp_Object prop, position, object, limit;
+ (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit)
{
if (STRINGP (object))
{
@@ -876,8 +842,7 @@ If the property is constant all the way to the start of OBJECT, return the
first valid position in OBJECT.
If the optional fourth argument LIMIT is non-nil, don't search
back past position LIMIT; return LIMIT if nothing is found before LIMIT. */)
- (position, prop, object, limit)
- Lisp_Object prop, position, object, limit;
+ (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit)
{
if (STRINGP (object))
{
@@ -965,8 +930,7 @@ If the value is non-nil, it is a position greater than POSITION, never equal.
If the optional third argument LIMIT is non-nil, don't search
past position LIMIT; return LIMIT if nothing is found before LIMIT. */)
- (position, object, limit)
- Lisp_Object position, object, limit;
+ (Lisp_Object position, Lisp_Object object, Lisp_Object limit)
{
register INTERVAL i, next;
@@ -1020,8 +984,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */)
/* Return 1 if there's a change in some property between BEG and END. */
int
-property_change_between_p (beg, end)
- int beg, end;
+property_change_between_p (int beg, int end)
{
register INTERVAL i, next;
Lisp_Object object, pos;
@@ -1063,8 +1026,7 @@ If the value is non-nil, it is a position greater than POSITION, never equal.
If the optional fourth argument LIMIT is non-nil, don't search
past position LIMIT; return LIMIT if nothing is found before LIMIT. */)
- (position, prop, object, limit)
- Lisp_Object position, prop, object, limit;
+ (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit)
{
register INTERVAL i, next;
register Lisp_Object here_val;
@@ -1111,8 +1073,7 @@ If the value is non-nil, it is a position less than POSITION, never equal.
If the optional third argument LIMIT is non-nil, don't search
back past position LIMIT; return LIMIT if nothing is found until LIMIT. */)
- (position, object, limit)
- Lisp_Object position, object, limit;
+ (Lisp_Object position, Lisp_Object object, Lisp_Object limit)
{
register INTERVAL i, previous;
@@ -1160,8 +1121,7 @@ If the value is non-nil, it is a position less than POSITION, never equal.
If the optional fourth argument LIMIT is non-nil, don't search
back past position LIMIT; return LIMIT if nothing is found until LIMIT. */)
- (position, prop, object, limit)
- Lisp_Object position, prop, object, limit;
+ (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit)
{
register INTERVAL i, previous;
register Lisp_Object here_val;
@@ -1210,8 +1170,7 @@ OBJECT is a buffer (or nil, which means the current buffer),
START and END are buffer positions (integers or markers).
If OBJECT is a string, START and END are 0-based indices into it.
Return t if any property value actually changed, nil otherwise. */)
- (start, end, properties, object)
- Lisp_Object start, end, properties, object;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object)
{
register INTERVAL i, unchanged;
register int s, len, modified = 0;
@@ -1318,8 +1277,7 @@ specify the property to add.
If the optional fifth argument OBJECT is a buffer (or nil, which means
the current buffer), START and END are buffer positions (integers or
markers). If OBJECT is a string, START and END are 0-based indices into it. */)
- (start, end, property, value, object)
- Lisp_Object start, end, property, value, object;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object)
{
Fadd_text_properties (start, end,
Fcons (property, Fcons (value, Qnil)),
@@ -1336,8 +1294,7 @@ the current buffer), START and END are buffer positions (integers or
markers). If OBJECT is a string, START and END are 0-based indices into it.
If PROPERTIES is nil, the effect is to remove all properties from
the designated part of OBJECT. */)
- (start, end, properties, object)
- Lisp_Object start, end, properties, object;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object)
{
return set_text_properties (start, end, properties, object, Qt);
}
@@ -1353,8 +1310,7 @@ the designated part of OBJECT. */)
otherwise. */
Lisp_Object
-set_text_properties (start, end, properties, object, coherent_change_p)
- Lisp_Object start, end, properties, object, coherent_change_p;
+set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object, Lisp_Object coherent_change_p)
{
register INTERVAL i;
Lisp_Object ostart, oend;
@@ -1418,9 +1374,7 @@ set_text_properties (start, end, properties, object, coherent_change_p)
START and END can be in any order. */
void
-set_text_properties_1 (start, end, properties, buffer, i)
- Lisp_Object start, end, properties, buffer;
- INTERVAL i;
+set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object buffer, INTERVAL i)
{
register INTERVAL prev_changed = NULL_INTERVAL;
register int s, len;
@@ -1509,8 +1463,7 @@ markers). If OBJECT is a string, START and END are 0-based indices into it.
Return t if any property was actually removed, nil otherwise.
Use `set-text-properties' if you want to remove all text properties. */)
- (start, end, properties, object)
- Lisp_Object start, end, properties, object;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object)
{
register INTERVAL i, unchanged;
register int s, len, modified = 0;
@@ -1595,8 +1548,7 @@ If the optional fourth argument OBJECT is a buffer (or nil, which means
the current buffer), START and END are buffer positions (integers or
markers). If OBJECT is a string, START and END are 0-based indices into it.
Return t if any property was actually removed, nil otherwise. */)
- (start, end, list_of_properties, object)
- Lisp_Object start, end, list_of_properties, object;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object list_of_properties, Lisp_Object object)
{
register INTERVAL i, unchanged;
register int s, len, modified = 0;
@@ -1703,8 +1655,7 @@ is `eq' to VALUE. Otherwise return nil.
If the optional fifth argument OBJECT is a buffer (or nil, which means
the current buffer), START and END are buffer positions (integers or
markers). If OBJECT is a string, START and END are 0-based indices into it. */)
- (start, end, property, value, object)
- Lisp_Object start, end, property, value, object;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object)
{
register INTERVAL i;
register int e, pos;
@@ -1740,8 +1691,7 @@ is not `eq' to VALUE. Otherwise, return nil.
If the optional fifth argument OBJECT is a buffer (or nil, which means
the current buffer), START and END are buffer positions (integers or
markers). If OBJECT is a string, START and END are 0-based indices into it. */)
- (start, end, property, value, object)
- Lisp_Object start, end, property, value, object;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object)
{
register INTERVAL i;
register int s, e;
@@ -1777,8 +1727,7 @@ markers). If OBJECT is a string, START and END are 0-based indices into it. */
BUFFER can be either a buffer or nil (meaning current buffer). */
int
-text_property_stickiness (prop, pos, buffer)
- Lisp_Object prop, pos, buffer;
+text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer)
{
Lisp_Object prev_pos, front_sticky;
int is_rear_sticky = 1, is_front_sticky = 0; /* defaults */
@@ -1851,8 +1800,7 @@ text_property_stickiness (prop, pos, buffer)
/* Note this can GC when DEST is a buffer. */
Lisp_Object
-copy_text_properties (start, end, src, pos, dest, prop)
- Lisp_Object start, end, src, pos, dest, prop;
+copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_Object pos, Lisp_Object dest, Lisp_Object prop)
{
INTERVAL i;
Lisp_Object res;
@@ -1944,8 +1892,7 @@ copy_text_properties (start, end, src, pos, dest, prop)
doesn't contain text properties between START and END. */
Lisp_Object
-text_property_list (object, start, end, prop)
- Lisp_Object object, start, end, prop;
+text_property_list (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object prop)
{
struct interval *i;
Lisp_Object result;
@@ -2002,8 +1949,7 @@ text_property_list (object, start, end, prop)
non-zero if OBJECT was modified. */
int
-add_text_properties_from_list (object, list, delta)
- Lisp_Object object, list, delta;
+add_text_properties_from_list (Lisp_Object object, Lisp_Object list, Lisp_Object delta)
{
struct gcpro gcpro1, gcpro2;
int modified_p = 0;
@@ -2036,8 +1982,7 @@ add_text_properties_from_list (object, list, delta)
end-points to NEW_END. */
Lisp_Object
-extend_property_ranges (list, new_end)
- Lisp_Object list, new_end;
+extend_property_ranges (Lisp_Object list, Lisp_Object new_end)
{
Lisp_Object prev = Qnil, head = list;
int max = XINT (new_end);
@@ -2072,8 +2017,7 @@ extend_property_ranges (list, new_end)
/* Call the modification hook functions in LIST, each with START and END. */
static void
-call_mod_hooks (list, start, end)
- Lisp_Object list, start, end;
+call_mod_hooks (Lisp_Object list, Lisp_Object start, Lisp_Object end)
{
struct gcpro gcpro1;
GCPRO1 (list);
@@ -2094,9 +2038,7 @@ call_mod_hooks (list, start, end)
those hooks in order, with START and END - 1 as arguments. */
void
-verify_interval_modification (buf, start, end)
- struct buffer *buf;
- int start, end;
+verify_interval_modification (struct buffer *buf, int start, int end)
{
register INTERVAL intervals = BUF_INTERVALS (buf);
register INTERVAL i;
@@ -2274,8 +2216,7 @@ verify_interval_modification (buf, start, end)
so it can indicate the range of inserted text. */
void
-report_interval_modification (start, end)
- Lisp_Object start, end;
+report_interval_modification (Lisp_Object start, Lisp_Object end)
{
if (! NILP (interval_insert_behind_hooks))
call_mod_hooks (interval_insert_behind_hooks, start, end);
@@ -2286,7 +2227,7 @@ report_interval_modification (start, end)
}
void
-syms_of_textprop ()
+syms_of_textprop (void)
{
DEFVAR_LISP ("default-text-properties", &Vdefault_text_properties,
doc: /* Property-list used as default values.
diff --git a/src/tparam.c b/src/tparam.c
index dcf79a3b617..d8a8f0260f0 100644
--- a/src/tparam.c
+++ b/src/tparam.c
@@ -18,66 +18,14 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* Emacs config.h may rename various library functions such as malloc. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
-#ifdef emacs
#include <setjmp.h>
#include "lisp.h" /* for xmalloc */
-#else
-
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <string.h>
-#else
-char *malloc ();
-char *realloc ();
-#endif
-
-/* Do this after the include, in case string.h prototypes bcopy. */
-#if (defined(HAVE_STRING_H) || defined(STDC_HEADERS)) && !defined(bcopy)
-#define bcopy(s, d, n) memcpy ((d), (s), (n))
-#endif
-
-#endif /* not emacs */
#ifndef NULL
#define NULL (char *) 0
#endif
-#ifndef emacs
-static void
-memory_out ()
-{
- write (2, "virtual memory exhausted\n", 25);
- exit (1);
-}
-
-static char *
-xmalloc (size)
- unsigned size;
-{
- register char *tem = malloc (size);
-
- if (!tem)
- memory_out ();
- return tem;
-}
-
-static char *
-xrealloc (ptr, size)
- char *ptr;
- unsigned size;
-{
- register char *tem = realloc (ptr, size);
-
- if (!tem)
- memory_out ();
- return tem;
-}
-#endif /* not emacs */
-
/* Assuming STRING is the value of a termcap string entry
containing `%' constructs to expand parameters,
merge in parameter values and store result in block OUTSTRING points to.
@@ -90,15 +38,11 @@ xrealloc (ptr, size)
The fourth and following args to tparam serve as the parameter values. */
-static char *tparam1 ();
+static char *tparam1 (char *string, char *outstring, int len, char *up, char *left, register int *argp);
/* VARARGS 2 */
char *
-tparam (string, outstring, len, arg0, arg1, arg2, arg3)
- char *string;
- char *outstring;
- int len;
- int arg0, arg1, arg2, arg3;
+tparam (char *string, char *outstring, int len, int arg0, int arg1, int arg2, int arg3)
{
int arg[4];
@@ -115,9 +59,7 @@ char *UP;
static char tgoto_buf[50];
char *
-tgoto (cm, hpos, vpos)
- char *cm;
- int hpos, vpos;
+tgoto (char *cm, int hpos, int vpos)
{
int args[2];
if (!cm)
@@ -128,12 +70,7 @@ tgoto (cm, hpos, vpos)
}
static char *
-tparam1 (string, outstring, len, up, left, argp)
- char *string;
- char *outstring;
- int len;
- char *up, *left;
- register int *argp;
+tparam1 (char *string, char *outstring, int len, char *up, char *left, register int *argp)
{
register int c;
register char *p = string;
@@ -162,7 +99,7 @@ tparam1 (string, outstring, len, up, left, argp)
{
outlen = len + 40;
new = (char *) xmalloc (outlen);
- bcopy (outstring, new, offset);
+ memcpy (new, outstring, offset);
}
else
{
diff --git a/src/undo.c b/src/undo.c
index b678c5c58ba..14a8268394a 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -67,8 +67,7 @@ int undo_inhibit_record_point;
undo record that will be added just after this command terminates. */
static void
-record_point (pt)
- int pt;
+record_point (int pt)
{
int at_boundary;
@@ -130,8 +129,7 @@ record_point (pt)
because we don't need to record the contents.) */
void
-record_insert (beg, length)
- int beg, length;
+record_insert (int beg, int length)
{
Lisp_Object lbeg, lend;
@@ -166,9 +164,7 @@ record_insert (beg, length)
of the characters in STRING, at location BEG. */
void
-record_delete (beg, string)
- int beg;
- Lisp_Object string;
+record_delete (int beg, Lisp_Object string)
{
Lisp_Object sbeg;
@@ -196,9 +192,7 @@ record_delete (beg, string)
won't be inverted automatically by undoing the buffer modification. */
void
-record_marker_adjustment (marker, adjustment)
- Lisp_Object marker;
- int adjustment;
+record_marker_adjustment (Lisp_Object marker, int adjustment)
{
if (EQ (current_buffer->undo_list, Qt))
return;
@@ -221,8 +215,7 @@ record_marker_adjustment (marker, adjustment)
The replacement must not change the number of characters. */
void
-record_change (beg, length)
- int beg, length;
+record_change (int beg, int length)
{
record_delete (beg, make_buffer_string (beg, beg + length, 1));
record_insert (beg, length);
@@ -233,7 +226,7 @@ record_change (beg, length)
we can tell whether it is obsolete because the file was saved again. */
void
-record_first_change ()
+record_first_change (void)
{
Lisp_Object high, low;
struct buffer *base_buffer = current_buffer;
@@ -257,9 +250,7 @@ record_first_change ()
for LENGTH characters starting at position BEG in BUFFER. */
void
-record_property_change (beg, length, prop, value, buffer)
- int beg, length;
- Lisp_Object prop, value, buffer;
+record_property_change (int beg, int length, Lisp_Object prop, Lisp_Object value, Lisp_Object buffer)
{
Lisp_Object lbeg, lend, entry;
struct buffer *obuf = current_buffer, *buf = XBUFFER (buffer);
@@ -297,7 +288,7 @@ DEFUN ("undo-boundary", Fundo_boundary, Sundo_boundary, 0, 0, 0,
doc: /* Mark a boundary between units of undo.
An undo command will stop at this point,
but another undo command will undo to the previous boundary. */)
- ()
+ (void)
{
Lisp_Object tem;
if (EQ (current_buffer->undo_list, Qt))
@@ -328,8 +319,7 @@ but another undo command will undo to the previous boundary. */)
In some cases this works by calling undo-outer-limit-function. */
void
-truncate_undo_list (b)
- struct buffer *b;
+truncate_undo_list (struct buffer *b)
{
Lisp_Object list;
Lisp_Object prev, next, last_boundary;
@@ -465,8 +455,7 @@ truncate_undo_list (b)
DEFUN ("primitive-undo", Fprimitive_undo, Sprimitive_undo, 2, 2, 0,
doc: /* Undo N records from the front of the list LIST.
Return what remains of the list. */)
- (n, list)
- Lisp_Object n, list;
+ (Lisp_Object n, Lisp_Object list)
{
struct gcpro gcpro1, gcpro2;
Lisp_Object next;
@@ -665,7 +654,7 @@ Return what remains of the list. */)
}
void
-syms_of_undo ()
+syms_of_undo (void)
{
Qinhibit_read_only = intern_c_string ("inhibit-read-only");
staticpro (&Qinhibit_read_only);
diff --git a/src/unexaix.c b/src/unexaix.c
index 2657d144296..949616d5e31 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -71,7 +71,7 @@ what you give them. Help stamp out software-hoarding! */
#include <unistd.h>
#include <fcntl.h>
-extern char *start_of_text (void); /* Start of text */
+char *start_of_text (void); /* Start of text */
extern char *start_of_data (void); /* Start of initialized data */
extern int _data;
@@ -669,5 +669,18 @@ unrelocate_symbols (int new, int a_out, char *a_name, char *new_name)
return 0;
}
+/*
+ * Return the address of the start of the text segment prior to
+ * doing an unexec. After unexec the return value is undefined.
+ * See crt0.c for further explanation and _start.
+ *
+ */
+
+char *
+start_of_text (void)
+{
+ return ((char *) 0x10000000);
+}
+
/* arch-tag: 0783857a-7c2d-456f-a426-58b722d69fd0
(do not change this comment) */
diff --git a/src/unexalpha.c b/src/unexalpha.c
index 13c1def5714..d0faa179931 100644
--- a/src/unexalpha.c
+++ b/src/unexalpha.c
@@ -28,9 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/mman.h>
#include <stdio.h>
#include <errno.h>
-#ifdef HAVE_STRING_H
#include <string.h>
-#endif
#if !defined (__NetBSD__) && !defined (__OpenBSD__)
#include <filehdr.h>
#include <aouthdr.h>
@@ -79,12 +77,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define _RDATA ".rdata"
#define _SDATA ".sdata"
#define _SBSS ".sbss"
+#define TEXT_START 0x120000000
#endif /* __NetBSD__ || __OpenBSD__ */
-static void fatal_unexec __P ((char *, char *));
-static void mark_x __P ((char *));
-static void update_dynamic_symbols __P ((char *, char *, int, struct aouthdr));
+static void fatal_unexec (char *, char *);
+static void mark_x (char *);
+
+static void update_dynamic_symbols (char *, char *, int, struct aouthdr);
#define READ(_fd, _buffer, _size, _error_message, _error_arg) \
errno = EEOF; \
@@ -260,7 +260,7 @@ unexec (new_name, a_name, data_start, bss_start, entry_address)
Brk = brk;
- bcopy (data_section, &old_data_scnhdr, sizeof (old_data_scnhdr));
+ memcpy (&old_data_scnhdr, data_section, sizeof (old_data_scnhdr));
nhdr.aout.dsize = brk - DATA_START;
nhdr.aout.bsize = 0;
@@ -328,7 +328,7 @@ unexec (new_name, a_name, data_start, bss_start, entry_address)
#ifdef _GOT
if (got_section != NULL)
{
- bcopy (got_section, buffer, sizeof (struct scnhdr));
+ memcpy (buffer, got_section, sizeof (struct scnhdr));
got_section->s_vaddr = vaddr;
got_section->s_paddr = vaddr;
@@ -376,7 +376,7 @@ unexec (new_name, a_name, data_start, bss_start, entry_address)
* Construct new symbol table header
*/
- bcopy (oldptr + nhdr.fhdr.f_symptr, buffer, cbHDRR);
+ memcpy (buffer, oldptr + nhdr.fhdr.f_symptr, cbHDRR);
#define symhdr ((pHDRR)buffer)
newsyms = nhdr.aout.tsize + nhdr.aout.dsize;
diff --git a/src/unexec.c b/src/unexec.c
index 1a27db1232d..8edd9e22b96 100644
--- a/src/unexec.c
+++ b/src/unexec.c
@@ -472,7 +472,7 @@ write_segment (new, ptr, end)
int pagesize = getpagesize ();
char zeros[1 << 13];
- bzero (zeros, sizeof (zeros));
+ memset (zeros, 0, sizeof (zeros));
for (i = 0; ptr < end;)
{
@@ -687,6 +687,21 @@ adjust_lnnoptrs (writedesc, readdesc, new_name)
return 0;
}
+extern unsigned start __asm__ ("start");
+
+/*
+ * Return the address of the start of the text segment prior to
+ * doing an unexec. After unexec the return value is undefined.
+ * See crt0.c for further explanation and _start.
+ *
+ */
+
+char *
+start_of_text (void)
+{
+ return ((char *) &start);
+}
+
/* ****************************************************************
* unexec
*
diff --git a/src/unexelf.c b/src/unexelf.c
index a91af9458eb..2ac6bbdc06e 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -594,8 +594,7 @@ typedef unsigned char byte;
/* Round X up to a multiple of Y. */
static ElfW(Addr)
-round_up (x, y)
- ElfW(Addr) x, y;
+round_up (ElfW(Addr) x, ElfW(Addr) y)
{
int rem = x % y;
if (rem == 0)
@@ -611,13 +610,8 @@ round_up (x, y)
if NOERROR is 0; we return -1 if NOERROR is nonzero. */
static int
-find_section (name, section_names, file_name, old_file_h, old_section_h, noerror)
- char *name;
- char *section_names;
- char *file_name;
- ElfW(Ehdr) *old_file_h;
- ElfW(Shdr) *old_section_h;
- int noerror;
+find_section (char *name, char *section_names, char *file_name,
+ ElfW(Ehdr) *old_file_h, ElfW(Shdr) *old_section_h, int noerror)
{
int idx;
@@ -652,9 +646,8 @@ find_section (name, section_names, file_name, old_file_h, old_section_h, noerror
*
*/
void
-unexec (new_name, old_name, data_start, bss_start, entry_address)
- char *new_name, *old_name;
- unsigned data_start, bss_start, entry_address;
+unexec (char *new_name, char *old_name, unsigned int data_start,
+ unsigned int bss_start, unsigned int entry_address)
{
int new_file, old_file, new_file_size;
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 3949e5f6e00..1acc009ba90 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -218,7 +218,7 @@ unexec_write_zero (off_t dest, size_t count)
char buf[UNEXEC_COPY_BUFSZ];
ssize_t bytes;
- bzero (buf, UNEXEC_COPY_BUFSZ);
+ memset (buf, 0, UNEXEC_COPY_BUFSZ);
if (lseek (outfd, dest, SEEK_SET) != dest)
return 0;
diff --git a/src/vm-limit.c b/src/vm-limit.c
index a5b07eb50da..b288276f394 100644
--- a/src/vm-limit.c
+++ b/src/vm-limit.c
@@ -23,13 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "lisp.h"
#endif
-#ifndef emacs
-#include <stddef.h>
-typedef size_t SIZE;
-typedef void *POINTER;
-#define EXCEEDS_LISP_PTR(x) 0
-#endif
-
#include "mem-limits.h"
#ifdef HAVE_GETRLIMIT
@@ -49,7 +42,7 @@ static enum warnlevel warnlevel;
/* Function to call to issue a warning;
0 means don't issue them. */
-static void (*warn_function) ();
+static void (*warn_function) (const char *);
/* Start of data space; can be changed by calling malloc_init. */
static POINTER data_space_start;
@@ -58,17 +51,9 @@ static POINTER data_space_start;
static unsigned long lim_data;
-#ifdef NO_LIM_DATA
-static void
-get_lim_data ()
-{
- lim_data = -1;
-}
-#else /* not NO_LIM_DATA */
-
#if defined (HAVE_GETRLIMIT) && defined (RLIMIT_AS)
static void
-get_lim_data ()
+get_lim_data (void)
{
struct rlimit rlimit;
@@ -84,7 +69,7 @@ get_lim_data ()
#ifdef USG
static void
-get_lim_data ()
+get_lim_data (void)
{
extern long ulimit ();
@@ -108,7 +93,7 @@ get_lim_data ()
#ifdef WINDOWSNT
static void
-get_lim_data ()
+get_lim_data (void)
{
extern unsigned long reserved_heap_size;
lim_data = reserved_heap_size;
@@ -119,7 +104,7 @@ get_lim_data ()
#ifdef MSDOS
void
-get_lim_data ()
+get_lim_data (void)
{
_go32_dpmi_meminfo info;
unsigned long lim1, lim2;
@@ -150,14 +135,14 @@ get_lim_data ()
}
unsigned long
-ret_lim_data ()
+ret_lim_data (void)
{
get_lim_data ();
return lim_data;
}
#else /* not MSDOS */
static void
-get_lim_data ()
+get_lim_data (void)
{
lim_data = vlimit (LIM_DATA, -1);
}
@@ -166,7 +151,7 @@ get_lim_data ()
#else /* BSD4_2 */
static void
-get_lim_data ()
+get_lim_data (void)
{
struct rlimit XXrlimit;
@@ -181,12 +166,11 @@ get_lim_data ()
#endif /* not WINDOWSNT */
#endif /* not USG */
#endif /* not HAVE_GETRLIMIT */
-#endif /* not NO_LIM_DATA */
/* Verify amount of memory available, complaining if we're near the end. */
static void
-check_memory_limits ()
+check_memory_limits (void)
{
#ifdef REL_ALLOC
extern POINTER (*real_morecore) ();
@@ -260,16 +244,54 @@ check_memory_limits ()
(*warn_function) ("Warning: memory in use exceeds lisp pointer size");
}
+#if !defined(CANNOT_DUMP) || !defined(SYSTEM_MALLOC)
+/* Some systems that cannot dump also cannot implement these. */
+
+/*
+ * Return the address of the start of the data segment prior to
+ * doing an unexec. After unexec the return value is undefined.
+ * See crt0.c for further information and definition of data_start.
+ *
+ * Apparently, on BSD systems this is etext at startup. On
+ * USG systems (swapping) this is highly mmu dependent and
+ * is also dependent on whether or not the program is running
+ * with shared text. Generally there is a (possibly large)
+ * gap between end of text and start of data with shared text.
+ *
+ */
+
+POINTER
+start_of_data (void)
+{
+#ifdef BSD_SYSTEM
+ extern char etext;
+ return (POINTER)(&etext);
+#elif defined DATA_START
+ return ((POINTER) DATA_START);
+#elif defined ORDINARY_LINK
+ /*
+ * This is a hack. Since we're not linking crt0.c or pre_crt0.c,
+ * data_start isn't defined. We take the address of environ, which
+ * is known to live at or near the start of the system crt0.c, and
+ * we don't sweat the handful of bytes that might lose.
+ */
+ extern char **environ;
+ return ((POINTER) &environ);
+#else
+ extern int data_start;
+ return ((POINTER) &data_start);
+#endif
+}
+#endif /* (not CANNOT_DUMP or not SYSTEM_MALLOC) */
+
/* Enable memory usage warnings.
START says where the end of pure storage is.
WARNFUN specifies the function to call to issue a warning. */
void
-memory_warnings (start, warnfun)
- POINTER start;
- void (*warnfun) ();
+memory_warnings (POINTER start, void (*warnfun) (const char *))
{
- extern void (* __after_morecore_hook) (); /* From gmalloc.c */
+ extern void (* __after_morecore_hook) (void); /* From gmalloc.c */
if (start)
data_space_start = start;
diff --git a/src/w16select.c b/src/w16select.c
index 9ebf6de6250..384b82ceff1 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -109,7 +109,7 @@ static size_t clipboard_storage_size;
/* Return the WinOldAp support version, or 0x1700 if not supported. */
unsigned
-identify_winoldap_version ()
+identify_winoldap_version (void)
{
__dpmi_regs regs;
@@ -124,7 +124,7 @@ identify_winoldap_version ()
/* Open the clipboard, return non-zero if successfull. */
unsigned
-open_clipboard ()
+open_clipboard (void)
{
__dpmi_regs regs;
@@ -147,7 +147,7 @@ open_clipboard ()
/* Empty clipboard, return non-zero if successfull. */
unsigned
-empty_clipboard ()
+empty_clipboard (void)
{
__dpmi_regs regs;
@@ -162,8 +162,7 @@ empty_clipboard ()
/* Ensure we have a buffer in low memory with enough memory for data
of size WANT_SIZE. Return the linear address of the buffer. */
static unsigned long
-alloc_xfer_buf (want_size)
- unsigned want_size;
+alloc_xfer_buf (unsigned want_size)
{
__dpmi_regs regs;
@@ -200,7 +199,7 @@ alloc_xfer_buf (want_size)
The clipboard buffer tends to be large in size, because for small
clipboard data sizes we use the DJGPP transfer buffer. */
static void
-free_xfer_buf ()
+free_xfer_buf (void)
{
/* If the size is 0, we used DJGPP transfer buffer, so don't free. */
if (clipboard_xfer_buf_info.size)
@@ -218,11 +217,7 @@ free_xfer_buf ()
/* Copy data into the clipboard, return zero if successfull. */
unsigned
-set_clipboard_data (Format, Data, Size, Raw)
- unsigned Format;
- void *Data;
- unsigned Size;
- int Raw;
+set_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
{
__dpmi_regs regs;
unsigned truelen;
@@ -321,8 +316,7 @@ set_clipboard_data (Format, Data, Size, Raw)
/* Return the size of the clipboard data of format FORMAT. */
unsigned
-get_clipboard_data_size (Format)
- unsigned Format;
+get_clipboard_data_size (unsigned Format)
{
__dpmi_regs regs;
@@ -342,11 +336,7 @@ get_clipboard_data_size (Format)
Warning: this doesn't check whether DATA has enough space to hold
SIZE bytes. */
unsigned
-get_clipboard_data (Format, Data, Size, Raw)
- unsigned Format;
- void *Data;
- unsigned Size;
- int Raw;
+get_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
{
__dpmi_regs regs;
unsigned long xbuf_addr;
@@ -425,7 +415,7 @@ get_clipboard_data (Format, Data, Size, Raw)
/* Close clipboard, return non-zero if successfull. */
unsigned
-close_clipboard ()
+close_clipboard (void)
{
__dpmi_regs regs;
@@ -439,8 +429,7 @@ close_clipboard ()
/* Compact clipboard data so that at least SIZE bytes is available. */
unsigned
-clipboard_compact (Size)
- unsigned Size;
+clipboard_compact (unsigned Size)
{
__dpmi_regs regs;
@@ -464,8 +453,7 @@ static char system_error_msg[] =
DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_data, 1, 2, 0,
doc: /* This sets the clipboard data to the given text. */)
- (string, frame)
- Lisp_Object string, frame;
+ (Lisp_Object string, Lisp_Object frame)
{
unsigned ok = 1, put_status = 0;
int nbytes, charset_info, no_crlf_conversion;
@@ -574,8 +562,7 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat
DEFUN ("w16-get-clipboard-data", Fw16_get_clipboard_data, Sw16_get_clipboard_data, 0, 1, 0,
doc: /* This gets the clipboard data in text format. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
unsigned data_size, truelen;
unsigned char *htext = NULL;
@@ -669,8 +656,7 @@ the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
\(Those are literal upper-case symbol names, since that's what X expects.)
For convenience, the symbol nil is the same as `PRIMARY',
and t is the same as `SECONDARY'. */)
- (selection)
- Lisp_Object selection;
+ (Lisp_Object selection)
{
CHECK_SYMBOL (selection);
@@ -705,7 +691,7 @@ and t is the same as `SECONDARY'. */)
}
void
-syms_of_win16select ()
+syms_of_win16select (void)
{
defsubr (&Sw16_set_clipboard_data);
defsubr (&Sw16_get_clipboard_data);
diff --git a/src/w32.c b/src/w32.c
index 0560ce4a6b8..19335742347 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -148,7 +148,7 @@ extern Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary;
typedef HRESULT (WINAPI * ShGetFolderPath_fn)
(IN HWND, IN int, IN HANDLE, IN DWORD, OUT char *);
-void globals_of_w32 ();
+void globals_of_w32 (void);
static DWORD get_rid (PSID);
extern Lisp_Object Vw32_downcase_file_names;
@@ -308,15 +308,15 @@ typedef BOOL (WINAPI * GetSystemTimes_Proc) (
/* ** A utility function ** */
static BOOL
-is_windows_9x ()
+is_windows_9x (void)
{
static BOOL s_b_ret=0;
OSVERSIONINFO os_ver;
if (g_b_init_is_windows_9x == 0)
{
g_b_init_is_windows_9x = 1;
- ZeroMemory(&os_ver, sizeof(OSVERSIONINFO));
- os_ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ ZeroMemory (&os_ver, sizeof (OSVERSIONINFO));
+ os_ver.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
if (GetVersionEx (&os_ver))
{
s_b_ret = (os_ver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS);
@@ -329,12 +329,12 @@ is_windows_9x ()
Returns a list of three integers if the times are provided by the OS
(NT derivatives), otherwise it returns the result of current-time. */
Lisp_Object
-w32_get_internal_run_time ()
+w32_get_internal_run_time (void)
{
if (get_process_times_fn)
{
FILETIME create, exit, kernel, user;
- HANDLE proc = GetCurrentProcess();
+ HANDLE proc = GetCurrentProcess ();
if ((*get_process_times_fn) (proc, &create, &exit, &kernel, &user))
{
LARGE_INTEGER user_int, kernel_int, total;
@@ -753,7 +753,7 @@ void WINAPI get_native_system_info (
lpSystemInfo->dwNumberOfProcessors = -1;
}
-BOOL WINAPI get_system_times(
+BOOL WINAPI get_system_times (
LPFILETIME lpIdleTime,
LPFILETIME lpKernelTime,
LPFILETIME lpUserTime)
@@ -1035,13 +1035,13 @@ static struct group dflt_group =
};
unsigned
-getuid ()
+getuid (void)
{
return dflt_passwd.pw_uid;
}
unsigned
-geteuid ()
+geteuid (void)
{
/* I could imagine arguing for checking to see whether the user is
in the Administrators group and returning a UID of 0 for that
@@ -1050,13 +1050,13 @@ geteuid ()
}
unsigned
-getgid ()
+getgid (void)
{
return dflt_passwd.pw_gid;
}
unsigned
-getegid ()
+getegid (void)
{
return getgid ();
}
@@ -1091,7 +1091,7 @@ getpwnam (char *name)
}
void
-init_user_info ()
+init_user_info (void)
{
/* Find the user's real name by opening the process token and
looking up the name associated with the user-sid in that token.
@@ -1207,7 +1207,7 @@ init_user_info ()
}
int
-random ()
+random (void)
{
/* rand () on NT gives us 15 random bits...hack together 30 bits. */
return ((rand () << 15) | rand ());
@@ -1225,9 +1225,7 @@ srandom (int seed)
case path name components to lower case. */
static void
-normalize_filename (fp, path_sep)
- register char *fp;
- char path_sep;
+normalize_filename (register char *fp, char path_sep)
{
char sep;
char *elem;
@@ -1283,16 +1281,14 @@ normalize_filename (fp, path_sep)
/* Destructively turn backslashes into slashes. */
void
-dostounix_filename (p)
- register char *p;
+dostounix_filename (register char *p)
{
normalize_filename (p, '/');
}
/* Destructively turn slashes into backslashes. */
void
-unixtodos_filename (p)
- register char *p;
+unixtodos_filename (register char *p)
{
normalize_filename (p, '\\');
}
@@ -1301,9 +1297,7 @@ unixtodos_filename (p)
(From msdos.c...probably should figure out a way to share it,
although this code isn't going to ever change.) */
int
-crlf_to_lf (n, buf)
- register int n;
- register unsigned char *buf;
+crlf_to_lf (register int n, register unsigned char *buf)
{
unsigned char *np = buf;
unsigned char *startp = buf;
@@ -1520,9 +1514,7 @@ alarm (int seconds)
#define REG_ROOT "SOFTWARE\\GNU\\Emacs"
LPBYTE
-w32_get_resource (key, lpdwtype)
- char *key;
- LPDWORD lpdwtype;
+w32_get_resource (char *key, LPDWORD lpdwtype)
{
LPBYTE lpvalue;
HKEY hrootkey = NULL;
@@ -1642,7 +1634,7 @@ init_environment (char ** argv)
{"LANG", NULL},
};
-#define N_ENV_VARS sizeof(dflt_envvars)/sizeof(dflt_envvars[0])
+#define N_ENV_VARS sizeof (dflt_envvars)/sizeof (dflt_envvars[0])
/* We need to copy dflt_envvars[] and work on the copy because we
don't want the dumped Emacs to inherit the values of
@@ -1715,7 +1707,7 @@ init_environment (char ** argv)
for (p = modname; *p; p++)
if (*p == '\\') *p = '/';
- _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname);
+ _snprintf (buf, sizeof (buf)-1, "emacs_dir=%s", modname);
_putenv (strdup (buf));
}
/* Handle running emacs from the build directory: src/oo-spd/i386/ */
@@ -1739,7 +1731,7 @@ init_environment (char ** argv)
for (p = modname; *p; p++)
if (*p == '\\') *p = '/';
- _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname);
+ _snprintf (buf, sizeof (buf)-1, "emacs_dir=%s", modname);
_putenv (strdup (buf));
}
}
@@ -1767,12 +1759,12 @@ init_environment (char ** argv)
char buf1[SET_ENV_BUF_SIZE], buf2[SET_ENV_BUF_SIZE];
if (dwType == REG_EXPAND_SZ)
- ExpandEnvironmentStrings ((LPSTR) lpval, buf1, sizeof(buf1));
+ ExpandEnvironmentStrings ((LPSTR) lpval, buf1, sizeof (buf1));
else if (dwType == REG_SZ)
strcpy (buf1, lpval);
if (dwType == REG_EXPAND_SZ || dwType == REG_SZ)
{
- _snprintf (buf2, sizeof(buf2)-1, "%s=%s", env_vars[i].name,
+ _snprintf (buf2, sizeof (buf2)-1, "%s=%s", env_vars[i].name,
buf1);
_putenv (strdup (buf2));
}
@@ -2115,7 +2107,7 @@ GetCachedVolumeInformation (char * root_dir)
involve network access, and so is extremely quick). */
/* Map drive letter to UNC if remote. */
- if ( isalpha( root_dir[0] ) && !fixed[ DRIVE_INDEX( root_dir[0] ) ] )
+ if (isalpha (root_dir[0]) && !fixed[DRIVE_INDEX (root_dir[0])])
{
char remote_name[ 256 ];
char drive[3] = { root_dir[0], ':' };
@@ -2514,8 +2506,8 @@ open_unc_volume (const char *path)
nr.lpComment = NULL;
nr.lpProvider = NULL;
- result = WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_DISK,
- RESOURCEUSAGE_CONNECTABLE, &nr, &henum);
+ result = WNetOpenEnum (RESOURCE_GLOBALNET, RESOURCETYPE_DISK,
+ RESOURCEUSAGE_CONNECTABLE, &nr, &henum);
if (result == NO_ERROR)
return henum;
@@ -2691,7 +2683,7 @@ sys_creat (const char * path, int mode)
}
FILE *
-sys_fopen(const char * path, const char * mode)
+sys_fopen (const char * path, const char * mode)
{
int fd;
int oflag;
@@ -2778,7 +2770,7 @@ sys_link (const char * old, const char * new)
data.wid.dwStreamId = BACKUP_LINK;
data.wid.dwStreamAttributes = 0;
- data.wid.Size.LowPart = wlen * sizeof(WCHAR);
+ data.wid.Size.LowPart = wlen * sizeof (WCHAR);
data.wid.Size.HighPart = 0;
data.wid.dwStreamNameSize = 0;
@@ -2980,7 +2972,7 @@ static int init = 0;
} while (0)
static void
-initialize_utc_base ()
+initialize_utc_base (void)
{
/* Determine the delta between 1-Jan-1601 and 1-Jan-1970. */
SYSTEMTIME st;
@@ -3191,7 +3183,7 @@ get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname,
char name[UNLEN+1];
DWORD name_len = sizeof (name);
char domain[1024];
- DWORD domain_len = sizeof(domain);
+ DWORD domain_len = sizeof (domain);
char *mp = NULL;
int use_dflt = 0;
int result;
@@ -3666,7 +3658,7 @@ utime (const char *name, struct utimbuf *times)
/* Helper wrapper functions. */
-HANDLE WINAPI create_toolhelp32_snapshot(
+HANDLE WINAPI create_toolhelp32_snapshot (
DWORD Flags,
DWORD Ignored)
{
@@ -3686,7 +3678,7 @@ HANDLE WINAPI create_toolhelp32_snapshot(
return (s_pfn_Create_Toolhelp32_Snapshot (Flags, Ignored));
}
-BOOL WINAPI process32_first(
+BOOL WINAPI process32_first (
HANDLE hSnapshot,
LPPROCESSENTRY32 lppe)
{
@@ -3706,7 +3698,7 @@ BOOL WINAPI process32_first(
return (s_pfn_Process32_First (hSnapshot, lppe));
}
-BOOL WINAPI process32_next(
+BOOL WINAPI process32_next (
HANDLE hSnapshot,
LPPROCESSENTRY32 lppe)
{
@@ -3904,7 +3896,7 @@ BOOL WINAPI global_memory_status_ex (
}
Lisp_Object
-list_system_processes ()
+list_system_processes (void)
{
struct gcpro gcpro1;
Lisp_Object proclist = Qnil;
@@ -3995,8 +3987,7 @@ restore_privilege (TOKEN_PRIVILEGES *priv)
}
static Lisp_Object
-ltime (time_sec, time_usec)
- long time_sec, time_usec;
+ltime (long time_sec, long time_usec)
{
return list3 (make_number ((time_sec >> 16) & 0xffff),
make_number (time_sec & 0xffff),
@@ -4006,18 +3997,17 @@ ltime (time_sec, time_usec)
#define U64_TO_LISP_TIME(time) ltime ((time) / 1000000L, (time) % 1000000L)
static int
-process_times (h_proc, ctime, etime, stime, utime, ttime, pcpu)
- HANDLE h_proc;
- Lisp_Object *ctime, *etime, *stime, *utime, *ttime;
- double *pcpu;
+process_times (HANDLE h_proc, Lisp_Object *ctime, Lisp_Object *etime,
+ Lisp_Object *stime, Lisp_Object *utime, Lisp_Object *ttime,
+ double *pcpu)
{
FILETIME ft_creation, ft_exit, ft_kernel, ft_user, ft_current;
ULONGLONG tem1, tem2, tem3, tem;
if (!h_proc
|| !get_process_times_fn
- || !(*get_process_times_fn)(h_proc, &ft_creation, &ft_exit,
- &ft_kernel, &ft_user))
+ || !(*get_process_times_fn) (h_proc, &ft_creation, &ft_exit,
+ &ft_kernel, &ft_user))
return 0;
GetSystemTimeAsFileTime (&ft_current);
@@ -4059,8 +4049,7 @@ process_times (h_proc, ctime, etime, stime, utime, ttime, pcpu)
}
Lisp_Object
-system_process_attributes (pid)
- Lisp_Object pid;
+system_process_attributes (Lisp_Object pid)
{
struct gcpro gcpro1, gcpro2, gcpro3;
Lisp_Object attrs = Qnil;
@@ -4459,34 +4448,34 @@ init_winsock (int load_now)
if ((pfn_##fn = (void *) GetProcAddress (winsock_lib, #fn)) == NULL) \
goto fail;
- LOAD_PROC( WSAStartup );
- LOAD_PROC( WSASetLastError );
- LOAD_PROC( WSAGetLastError );
- LOAD_PROC( WSAEventSelect );
- LOAD_PROC( WSACreateEvent );
- LOAD_PROC( WSACloseEvent );
- LOAD_PROC( socket );
- LOAD_PROC( bind );
- LOAD_PROC( connect );
- LOAD_PROC( ioctlsocket );
- LOAD_PROC( recv );
- LOAD_PROC( send );
- LOAD_PROC( closesocket );
- LOAD_PROC( shutdown );
- LOAD_PROC( htons );
- LOAD_PROC( ntohs );
- LOAD_PROC( inet_addr );
- LOAD_PROC( gethostname );
- LOAD_PROC( gethostbyname );
- LOAD_PROC( getservbyname );
- LOAD_PROC( getpeername );
- LOAD_PROC( WSACleanup );
- LOAD_PROC( setsockopt );
- LOAD_PROC( listen );
- LOAD_PROC( getsockname );
- LOAD_PROC( accept );
- LOAD_PROC( recvfrom );
- LOAD_PROC( sendto );
+ LOAD_PROC (WSAStartup);
+ LOAD_PROC (WSASetLastError);
+ LOAD_PROC (WSAGetLastError);
+ LOAD_PROC (WSAEventSelect);
+ LOAD_PROC (WSACreateEvent);
+ LOAD_PROC (WSACloseEvent);
+ LOAD_PROC (socket);
+ LOAD_PROC (bind);
+ LOAD_PROC (connect);
+ LOAD_PROC (ioctlsocket);
+ LOAD_PROC (recv);
+ LOAD_PROC (send);
+ LOAD_PROC (closesocket);
+ LOAD_PROC (shutdown);
+ LOAD_PROC (htons);
+ LOAD_PROC (ntohs);
+ LOAD_PROC (inet_addr);
+ LOAD_PROC (gethostname);
+ LOAD_PROC (gethostbyname);
+ LOAD_PROC (getservbyname);
+ LOAD_PROC (getpeername);
+ LOAD_PROC (WSACleanup);
+ LOAD_PROC (setsockopt);
+ LOAD_PROC (listen);
+ LOAD_PROC (getsockname);
+ LOAD_PROC (accept);
+ LOAD_PROC (recvfrom);
+ LOAD_PROC (sendto);
#undef LOAD_PROC
/* specify version 1.1 of winsock */
@@ -4526,7 +4515,7 @@ int h_errno = 0;
normal system codes where they overlap (non-overlapping definitions
are already in <sys/socket.h> */
static void
-set_errno ()
+set_errno (void)
{
if (winsock_lib == NULL)
h_errno = EINVAL;
@@ -4548,7 +4537,7 @@ set_errno ()
}
static void
-check_errno ()
+check_errno (void)
{
if (h_errno == 0 && winsock_lib != NULL)
pfn_WSASetLastError (0);
@@ -4631,7 +4620,7 @@ struct {
};
char *
-sys_strerror(int error_no)
+sys_strerror (int error_no)
{
int i;
static char unknown_msg[40];
@@ -4643,7 +4632,7 @@ sys_strerror(int error_no)
if (_wsa_errlist[i].errnum == error_no)
return _wsa_errlist[i].msg;
- sprintf(unknown_msg, "Unidentified error: %d", error_no);
+ sprintf (unknown_msg, "Unidentified error: %d", error_no);
return unknown_msg;
}
@@ -4662,7 +4651,7 @@ sys_strerror(int error_no)
int socket_to_fd (SOCKET s);
int
-sys_socket(int af, int type, int protocol)
+sys_socket (int af, int type, int protocol)
{
SOCKET s;
@@ -4865,7 +4854,7 @@ sys_gethostname (char * name, int namelen)
}
struct hostent *
-sys_gethostbyname(const char * name)
+sys_gethostbyname (const char * name)
{
struct hostent * host;
@@ -4883,7 +4872,7 @@ sys_gethostbyname(const char * name)
}
struct servent *
-sys_getservbyname(const char * name, const char * proto)
+sys_getservbyname (const char * name, const char * proto)
{
struct servent * serv;
@@ -5038,7 +5027,7 @@ sys_accept (int s, struct sockaddr * addr, int * addrlen)
int
sys_recvfrom (int s, char * buf, int len, int flags,
- struct sockaddr * from, int * fromlen)
+ struct sockaddr * from, int * fromlen)
{
if (winsock_lib == NULL)
{
@@ -5536,8 +5525,8 @@ sys_read (int fd, char * buffer, unsigned int count)
int res = pfn_recv (SOCK_HANDLE (fd), buffer, count, 0);
if (res == SOCKET_ERROR)
{
- DebPrint(("sys_read.recv failed with error %d on socket %ld\n",
- pfn_WSAGetLastError (), SOCK_HANDLE (fd)));
+ DebPrint (("sys_read.recv failed with error %d on socket %ld\n",
+ pfn_WSAGetLastError (), SOCK_HANDLE (fd)));
set_errno ();
return -1;
}
@@ -5693,8 +5682,8 @@ sys_write (int fd, const void * buffer, unsigned int count)
if (nchars == SOCKET_ERROR)
{
- DebPrint(("sys_write.send failed with error %d on socket %ld\n",
- pfn_WSAGetLastError (), SOCK_HANDLE (fd)));
+ DebPrint (("sys_write.send failed with error %d on socket %ld\n",
+ pfn_WSAGetLastError (), SOCK_HANDLE (fd)));
set_errno ();
}
}
@@ -5733,7 +5722,7 @@ sys_write (int fd, const void * buffer, unsigned int count)
}
static void
-check_windows_init_file ()
+check_windows_init_file (void)
{
extern int noninteractive, inhibit_window_system;
@@ -5789,7 +5778,7 @@ check_windows_init_file ()
}
void
-term_ntproc ()
+term_ntproc (void)
{
#ifdef HAVE_SOCKETS
/* shutdown the socket interface if necessary */
@@ -5800,7 +5789,7 @@ term_ntproc ()
}
void
-init_ntproc ()
+init_ntproc (void)
{
#ifdef HAVE_SOCKETS
/* Initialise the socket interface now if available and requested by
@@ -5908,7 +5897,8 @@ init_ntproc ()
shutdown_handler ensures that buffers' autosave files are
up to date when the user logs off, or the system shuts down.
*/
-BOOL WINAPI shutdown_handler(DWORD type)
+BOOL WINAPI
+shutdown_handler (DWORD type)
{
/* Ctrl-C and Ctrl-Break are already suppressed, so don't handle them. */
if (type == CTRL_CLOSE_EVENT /* User closes console window. */
@@ -5929,7 +5919,7 @@ BOOL WINAPI shutdown_handler(DWORD type)
initialized is non zero (see the function main in emacs.c).
*/
void
-globals_of_w32 ()
+globals_of_w32 (void)
{
HMODULE kernel32 = GetModuleHandle ("kernel32.dll");
@@ -5967,14 +5957,15 @@ globals_of_w32 ()
console apps. This actually applies to Emacs in both console and
GUI modes, since we had to fool windows into thinking emacs is a
console application to get console mode to work. */
- SetConsoleCtrlHandler(shutdown_handler, TRUE);
+ SetConsoleCtrlHandler (shutdown_handler, TRUE);
/* "None" is the default group name on standalone workstations. */
strcpy (dflt_group_name, "None");
}
/* For make-serial-process */
-int serial_open (char *port)
+int
+serial_open (char *port)
{
HANDLE hnd;
child_process *cp;
@@ -6014,7 +6005,7 @@ int serial_open (char *port)
/* For serial-process-configure */
void
serial_configure (struct Lisp_Process *p,
- Lisp_Object contact)
+ Lisp_Object contact)
{
Lisp_Object childp2 = Qnil;
Lisp_Object tem = Qnil;
diff --git a/src/w32console.c b/src/w32console.c
index dcebe466e32..26fa544d670 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -42,13 +42,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "w32inevt.h"
/* from window.c */
-extern Lisp_Object Frecenter ();
+extern Lisp_Object Frecenter (Lisp_Object);
/* from keyboard.c */
-extern int detect_input_pending ();
+extern int detect_input_pending (void);
/* from sysdep.c */
-extern int read_input_pending ();
+extern int read_input_pending (void);
static void w32con_move_cursor (struct frame *f, int row, int col);
static void w32con_clear_to_end (struct frame *f);
@@ -68,7 +68,7 @@ static WORD w32_face_attributes (struct frame *f, int face_id);
static COORD cursor_coords;
static HANDLE prev_screen, cur_screen;
static WORD char_attr_normal;
-static DWORD prev_console_mode;
+static DWORD prev_console_mode;
#ifndef USE_SEPARATE_SCREEN
static CONSOLE_CURSOR_INFO prev_console_cursor;
@@ -268,7 +268,8 @@ scroll_line (struct frame *f, int dist, int direction)
/* If start is zero insert blanks instead of a string at start ?. */
static void
-w32con_insert_glyphs (struct frame *f, register struct glyph *start, register int len)
+w32con_insert_glyphs (struct frame *f, register struct glyph *start,
+ register int len)
{
scroll_line (f, len, RIGHT);
@@ -286,8 +287,8 @@ w32con_insert_glyphs (struct frame *f, register struct glyph *start, register in
}
}
-extern unsigned char *encode_terminal_code P_ ((struct glyph *, int,
- struct coding_system *));
+extern unsigned char *encode_terminal_code (struct glyph *, int,
+ struct coding_system *);
static void
w32con_write_glyphs (struct frame *f, register struct glyph *string,
@@ -392,8 +393,7 @@ SOUND is 'asterisk, 'exclamation, 'hand, 'question, 'ok, or 'silent
to use the corresponding system sound for the bell. The 'silent sound
prevents Emacs from making any sound at all.
SOUND is nil to use the normal beep. */)
- (sound)
- Lisp_Object sound;
+ (Lisp_Object sound)
{
CHECK_SYMBOL (sound);
@@ -438,7 +438,7 @@ w32con_reset_terminal_modes (struct terminal *t)
FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r);
/* Now that the screen is clear, put the cursor at the top. */
SetConsoleCursorPosition (cur_screen, dest);
-
+
#ifdef USE_SEPARATE_SCREEN
SetConsoleActiveScreenBuffer (prev_screen);
#else
@@ -492,7 +492,7 @@ w32con_set_terminal_window (struct frame *f, int size)
***********************************************************************/
void
-sys_tputs (char *str, int nlines, int (*outfun)())
+sys_tputs (char *str, int nlines, int (*outfun) (int))
{
}
@@ -511,13 +511,13 @@ struct tty_display_info *current_tty = NULL;
int cost = 0;
int
-evalcost (char c)
+evalcost (int c)
{
return c;
}
int
-cmputc (char c)
+cmputc (int c)
{
return c;
}
@@ -551,9 +551,7 @@ Wcm_clear (struct tty_display_info *tty)
/* Turn appearances of face FACE_ID on tty frame F on. */
static WORD
-w32_face_attributes (f, face_id)
- struct frame *f;
- int face_id;
+w32_face_attributes (struct frame *f, int face_id)
{
WORD char_attr;
struct face *face = FACE_FROM_ID (f, face_id);
@@ -609,8 +607,6 @@ vga_stdcolor_name (int idx)
return Qunspecified; /* meaning the default */
}
-typedef int (*term_hook) ();
-
void
initialize_w32_display (struct terminal *term)
{
@@ -618,19 +614,19 @@ initialize_w32_display (struct terminal *term)
term->rif = 0; /* No window based redisplay on the console. */
term->cursor_to_hook = w32con_move_cursor;
- term->raw_cursor_to_hook = w32con_move_cursor;
- term->clear_to_end_hook = w32con_clear_to_end;
- term->clear_frame_hook = w32con_clear_frame;
+ term->raw_cursor_to_hook = w32con_move_cursor;
+ term->clear_to_end_hook = w32con_clear_to_end;
+ term->clear_frame_hook = w32con_clear_frame;
term->clear_end_of_line_hook = w32con_clear_end_of_line;
- term->ins_del_lines_hook = w32con_ins_del_lines;
- term->insert_glyphs_hook = w32con_insert_glyphs;
- term->write_glyphs_hook = w32con_write_glyphs;
- term->delete_glyphs_hook = w32con_delete_glyphs;
+ term->ins_del_lines_hook = w32con_ins_del_lines;
+ term->insert_glyphs_hook = w32con_insert_glyphs;
+ term->write_glyphs_hook = w32con_write_glyphs;
+ term->delete_glyphs_hook = w32con_delete_glyphs;
term->ring_bell_hook = w32_sys_ring_bell;
- term->reset_terminal_modes_hook = w32con_reset_terminal_modes;
+ term->reset_terminal_modes_hook = w32con_reset_terminal_modes;
term->set_terminal_modes_hook = w32con_set_terminal_modes;
- term->set_terminal_window_hook = w32con_set_terminal_window;
- term->update_begin_hook = w32con_update_begin;
+ term->set_terminal_window_hook = w32con_set_terminal_window;
+ term->update_begin_hook = w32con_update_begin;
term->update_end_hook = w32con_update_end;
term->read_socket_hook = w32_console_read_socket;
@@ -674,8 +670,8 @@ initialize_w32_display (struct terminal *term)
/* Respect setting of LINES and COLUMNS environment variables. */
{
- char * lines = getenv("LINES");
- char * columns = getenv("COLUMNS");
+ char * lines = getenv ("LINES");
+ char * columns = getenv ("COLUMNS");
if (lines != NULL && columns != NULL)
{
@@ -751,9 +747,7 @@ initialize_w32_display (struct terminal *term)
DEFUN ("set-screen-color", Fset_screen_color, Sset_screen_color, 2, 2, 0,
doc: /* Set screen colors. */)
- (foreground, background)
- Lisp_Object foreground;
- Lisp_Object background;
+ (Lisp_Object foreground, Lisp_Object background)
{
char_attr_normal = XFASTINT (foreground) + (XFASTINT (background) << 4);
@@ -763,8 +757,7 @@ DEFUN ("set-screen-color", Fset_screen_color, Sset_screen_color, 2, 2, 0,
DEFUN ("set-cursor-size", Fset_cursor_size, Sset_cursor_size, 1, 1, 0,
doc: /* Set cursor size. */)
- (size)
- Lisp_Object size;
+ (Lisp_Object size)
{
CONSOLE_CURSOR_INFO cci;
cci.dwSize = XFASTINT (size);
@@ -775,7 +768,7 @@ DEFUN ("set-cursor-size", Fset_cursor_size, Sset_cursor_size, 1, 1, 0,
}
void
-syms_of_ntterm ()
+syms_of_ntterm (void)
{
DEFVAR_BOOL ("w32-use-full-screen-buffer",
&w32_use_full_screen_buffer,
diff --git a/src/w32fns.c b/src/w32fns.c
index bc310da0d2f..c5e555dc884 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -69,15 +69,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define FOF_NO_CONNECTED_ELEMENTS 0x2000
#endif
-void syms_of_w32fns ();
-void globals_of_w32fns ();
+void syms_of_w32fns (void);
+void globals_of_w32fns (void);
-extern void free_frame_menubar ();
-extern double atof ();
-extern int w32_console_toggle_lock_key P_ ((int, Lisp_Object));
-extern void w32_menu_display_help P_ ((HWND, HMENU, UINT, UINT));
-extern void w32_free_menu_strings P_ ((HWND));
-extern const char *map_w32_filename P_ ((const char *, const char **));
+extern void free_frame_menubar (struct frame *);
+extern double atof (const char *);
+extern int w32_console_toggle_lock_key (int, Lisp_Object);
+extern void w32_menu_display_help (HWND, HMENU, UINT, UINT);
+extern void w32_free_menu_strings (HWND);
+extern const char *map_w32_filename (const char *, const char **);
extern int quit_char;
@@ -288,9 +288,15 @@ unsigned int msh_mousewheel = 0;
#define MENU_FREE_DELAY 1000
static unsigned menu_free_timer = 0;
+/* In dispnew.c */
+
+extern Lisp_Object Vwindow_system_version;
+
/* The below are defined in frame.c. */
+extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
extern Lisp_Object Vwindow_system_version;
+extern Lisp_Object Qtooltip;
#ifdef GLYPH_DEBUG
int image_cache_refcount, dpyinfo_refcount;
@@ -315,18 +321,18 @@ extern HMENU current_popup_menu;
static int menubar_in_use = 0;
/* From w32uniscribe.c */
-extern void syms_of_w32uniscribe ();
+extern void syms_of_w32uniscribe (void);
extern int uniscribe_available;
/* Function prototypes for hourglass support. */
-static void w32_show_hourglass P_ ((struct frame *));
-static void w32_hide_hourglass P_ ((void));
+static void w32_show_hourglass (struct frame *);
+static void w32_hide_hourglass (void);
/* Error if we are not connected to MS-Windows. */
void
-check_w32 ()
+check_w32 (void)
{
if (! w32_in_use)
error ("MS-Windows not in use or not initialized");
@@ -336,7 +342,7 @@ check_w32 ()
You should not call this unless HAVE_MENUS is defined. */
int
-have_menus_p ()
+have_menus_p (void)
{
return w32_in_use;
}
@@ -345,8 +351,7 @@ have_menus_p ()
and checking validity for W32. */
FRAME_PTR
-check_x_frame (frame)
- Lisp_Object frame;
+check_x_frame (Lisp_Object frame)
{
FRAME_PTR f;
@@ -364,8 +369,7 @@ check_x_frame (frame)
the first display on the list. */
struct w32_display_info *
-check_x_display_info (frame)
- Lisp_Object frame;
+check_x_display_info (Lisp_Object frame)
{
if (NILP (frame))
{
@@ -396,9 +400,7 @@ check_x_display_info (frame)
/* This function can be called during GC, so use GC_xxx type test macros. */
struct frame *
-x_window_to_frame (dpyinfo, wdesc)
- struct w32_display_info *dpyinfo;
- HWND wdesc;
+x_window_to_frame (struct w32_display_info *dpyinfo, HWND wdesc)
{
Lisp_Object tail, frame;
struct frame *f;
@@ -419,26 +421,24 @@ x_window_to_frame (dpyinfo, wdesc)
}
-static Lisp_Object unwind_create_frame P_ ((Lisp_Object));
-static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object));
-static void my_create_window P_ ((struct frame *));
-static void my_create_tip_window P_ ((struct frame *));
+static Lisp_Object unwind_create_frame (Lisp_Object);
+static Lisp_Object unwind_create_tip_frame (Lisp_Object);
+static void my_create_window (struct frame *);
+static void my_create_tip_window (struct frame *);
/* TODO: Native Input Method support; see x_create_im. */
-void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_mouse_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_cursor_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_border_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_cursor_type P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_icon_type P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_icon_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_explicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_title P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
-static void x_edge_detection P_ ((struct frame *, struct image *, Lisp_Object,
- Lisp_Object));
+void x_set_foreground_color (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_background_color (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_mouse_color (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_cursor_color (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_border_color (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_cursor_type (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_icon_type (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_icon_name (struct frame *, Lisp_Object, Lisp_Object);
+void x_explicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_title (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
@@ -448,9 +448,7 @@ static void x_edge_detection P_ ((struct frame *, struct image *, Lisp_Object,
not Emacs's own window. */
void
-x_real_positions (f, xptr, yptr)
- FRAME_PTR f;
- int *xptr, *yptr;
+x_real_positions (FRAME_PTR f, int *xptr, int *yptr)
{
POINT pt;
RECT rect;
@@ -480,8 +478,7 @@ DEFUN ("w32-define-rgb-color", Fw32_define_rgb_color,
This adds or updates a named color to `w32-color-map', making it
available for use. The original entry's RGB ref is returned, or nil
if the entry is new. */)
- (red, green, blue, name)
- Lisp_Object red, green, blue, name;
+ (Lisp_Object red, Lisp_Object green, Lisp_Object blue, Lisp_Object name)
{
Lisp_Object rgb;
Lisp_Object oldrgb = Qnil;
@@ -767,7 +764,7 @@ colormap_t w32_color_map[] =
DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map,
0, 0, 0, doc: /* Return the default color map. */)
- ()
+ (void)
{
int i;
colormap_t *pc = w32_color_map;
@@ -789,8 +786,7 @@ DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map,
}
static Lisp_Object
-w32_to_x_color (rgb)
- Lisp_Object rgb;
+w32_to_x_color (Lisp_Object rgb)
{
Lisp_Object color;
@@ -809,8 +805,7 @@ w32_to_x_color (rgb)
}
static Lisp_Object
-w32_color_map_lookup (colorname)
- char *colorname;
+w32_color_map_lookup (char *colorname)
{
Lisp_Object tail, ret = Qnil;
@@ -842,8 +837,7 @@ w32_color_map_lookup (colorname)
static void
-add_system_logical_colors_to_map (system_colors)
- Lisp_Object *system_colors;
+add_system_logical_colors_to_map (Lisp_Object *system_colors)
{
HKEY colors_key;
@@ -891,8 +885,7 @@ add_system_logical_colors_to_map (system_colors)
static Lisp_Object
-x_to_w32_color (colorname)
- char * colorname;
+x_to_w32_color (char * colorname)
{
register Lisp_Object ret = Qnil;
@@ -1203,9 +1196,7 @@ w32_unmap_color (FRAME_PTR f, COLORREF color)
/* Gamma-correct COLOR on frame F. */
void
-gamma_correct (f, color)
- struct frame *f;
- COLORREF *color;
+gamma_correct (struct frame *f, COLORREF *color)
{
if (f->gamma)
{
@@ -1222,11 +1213,7 @@ gamma_correct (f, color)
If ALLOC is nonzero, allocate a new colormap cell. */
int
-w32_defined_color (f, color, color_def, alloc)
- FRAME_PTR f;
- char *color;
- XColor *color_def;
- int alloc;
+w32_defined_color (FRAME_PTR f, char *color, XColor *color_def, int alloc)
{
register Lisp_Object tem;
COLORREF w32_color_ref;
@@ -1298,10 +1285,7 @@ w32_defined_color (f, color, color_def, alloc)
ARG says. */
int
-x_decode_color (f, arg, def)
- FRAME_PTR f;
- Lisp_Object arg;
- int def;
+x_decode_color (FRAME_PTR f, Lisp_Object arg, int def)
{
XColor cdef;
@@ -1335,9 +1319,7 @@ x_decode_color (f, arg, def)
in the standard place; do not attempt to change the window. */
void
-x_set_foreground_color (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
struct w32_output *x = f->output_data.w32;
PIX_TYPE fg, old_fg;
@@ -1349,7 +1331,10 @@ x_set_foreground_color (f, arg, oldval)
if (FRAME_W32_WINDOW (f) != 0)
{
if (x->cursor_pixel == old_fg)
- x->cursor_pixel = fg;
+ {
+ x->cursor_pixel = fg;
+ x->cursor_gc->background = fg;
+ }
update_face_from_frame_parameter (f, Qforeground_color, arg);
if (FRAME_VISIBLE_P (f))
@@ -1358,9 +1343,7 @@ x_set_foreground_color (f, arg, oldval)
}
void
-x_set_background_color (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
FRAME_BACKGROUND_PIXEL (f)
= x_decode_color (f, arg, WHITE_PIX_DEFAULT (f));
@@ -1378,9 +1361,7 @@ x_set_background_color (f, arg, oldval)
}
void
-x_set_mouse_color (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
int count;
@@ -1527,9 +1508,7 @@ x_set_mouse_color (f, arg, oldval)
}
void
-x_set_cursor_color (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
unsigned long fore_pixel, pixel;
@@ -1576,9 +1555,7 @@ x_set_cursor_color (f, arg, oldval)
F has a window. */
void
-x_set_border_pixel (f, pix)
- struct frame *f;
- int pix;
+x_set_border_pixel (struct frame *f, int pix)
{
f->output_data.w32->border_pixel = pix;
@@ -1597,9 +1574,7 @@ x_set_border_pixel (f, pix)
F has a window; it must be redone when the window is created. */
void
-x_set_border_color (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int pix;
@@ -1611,9 +1586,7 @@ x_set_border_color (f, arg, oldval)
void
-x_set_cursor_type (f, arg, oldval)
- FRAME_PTR f;
- Lisp_Object arg, oldval;
+x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
{
set_frame_cursor_types (f, arg);
@@ -1622,9 +1595,7 @@ x_set_cursor_type (f, arg, oldval)
}
void
-x_set_icon_type (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int result;
@@ -1651,9 +1622,7 @@ x_set_icon_type (f, arg, oldval)
}
void
-x_set_icon_name (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
if (STRINGP (arg))
{
@@ -1701,9 +1670,7 @@ x_set_icon_name (f, arg, oldval)
void
-x_set_menu_bar_lines (f, value, oldval)
- struct frame *f;
- Lisp_Object value, oldval;
+x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
int nlines;
int olines = FRAME_MENU_BAR_LINES (f);
@@ -1746,9 +1713,7 @@ x_set_menu_bar_lines (f, value, oldval)
The frame's height doesn't change. */
void
-x_set_tool_bar_lines (f, value, oldval)
- struct frame *f;
- Lisp_Object value, oldval;
+x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
int delta, nlines, root_height;
Lisp_Object root_window;
@@ -1828,10 +1793,7 @@ x_set_tool_bar_lines (f, value, oldval)
F->explicit_name is set, ignore the new name; otherwise, set it. */
void
-x_set_name (f, name, explicit)
- struct frame *f;
- Lisp_Object name;
- int explicit;
+x_set_name (struct frame *f, Lisp_Object name, int explicit)
{
/* Make sure that requests from lisp code override requests from
Emacs redisplay code. */
@@ -1886,9 +1848,7 @@ x_set_name (f, name, explicit)
specified a name for the frame; the name will override any set by the
redisplay code. */
void
-x_explicitly_set_name (f, arg, oldval)
- FRAME_PTR f;
- Lisp_Object arg, oldval;
+x_explicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
{
x_set_name (f, arg, 1);
}
@@ -1897,9 +1857,7 @@ x_explicitly_set_name (f, arg, oldval)
name; names set this way will never override names set by the user's
lisp code. */
void
-x_implicitly_set_name (f, arg, oldval)
- FRAME_PTR f;
- Lisp_Object arg, oldval;
+x_implicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
{
x_set_name (f, arg, 0);
}
@@ -1908,9 +1866,7 @@ x_implicitly_set_name (f, arg, oldval)
If NAME is nil, use the frame name as the title. */
void
-x_set_title (f, name, old_name)
- struct frame *f;
- Lisp_Object name, old_name;
+x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
{
/* Don't change the title if it's already NAME. */
if (EQ (name, f->title))
@@ -1935,8 +1891,8 @@ x_set_title (f, name, old_name)
}
-void x_set_scroll_bar_default_width (f)
- struct frame *f;
+void
+x_set_scroll_bar_default_width (struct frame *f)
{
int wid = FRAME_COLUMN_WIDTH (f);
@@ -1964,11 +1920,10 @@ w32_load_cursor (LPCTSTR name)
return cursor;
}
-extern LRESULT CALLBACK w32_wnd_proc ();
+extern LRESULT CALLBACK w32_wnd_proc (HWND, UINT, WPARAM, LPARAM);
static BOOL
-w32_init_class (hinst)
- HINSTANCE hinst;
+w32_init_class (HINSTANCE hinst)
{
WNDCLASS wc;
@@ -1987,9 +1942,7 @@ w32_init_class (hinst)
}
static HWND
-w32_createscrollbar (f, bar)
- struct frame *f;
- struct scroll_bar * bar;
+w32_createscrollbar (struct frame *f, struct scroll_bar * bar)
{
return (CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE,
/* Position and size of scroll bar. */
@@ -2004,8 +1957,7 @@ w32_createscrollbar (f, bar)
}
static void
-w32_createwindow (f)
- struct frame *f;
+w32_createwindow (struct frame *f)
{
HWND hwnd;
RECT rect;
@@ -2075,12 +2027,7 @@ w32_createwindow (f)
}
static void
-my_post_msg (wmsg, hwnd, msg, wParam, lParam)
- W32Msg * wmsg;
- HWND hwnd;
- UINT msg;
- WPARAM wParam;
- LPARAM lParam;
+my_post_msg (W32Msg * wmsg, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
wmsg->msg.hwnd = hwnd;
wmsg->msg.message = msg;
@@ -2174,7 +2121,7 @@ record_keyup (unsigned int wparam, unsigned int lparam)
it regains focus, be conservative and clear all modifiers since
we cannot reconstruct the left and right modifier state. */
static void
-reset_modifiers ()
+reset_modifiers (void)
{
SHORT ctrl, alt;
@@ -2221,7 +2168,7 @@ reset_modifiers ()
modifier keys, we know that, if no modifiers are set, then neither
the left or right modifier should be set. */
static void
-sync_modifiers ()
+sync_modifiers (void)
{
if (!modifiers_recorded)
return;
@@ -2307,7 +2254,7 @@ w32_key_to_modifier (int key)
}
static unsigned int
-w32_get_modifiers ()
+w32_get_modifiers (void)
{
return ((modifier_set (VK_SHIFT) ? shift_modifier : 0) |
(modifier_set (VK_CONTROL) ? ctrl_modifier : 0) |
@@ -2324,7 +2271,7 @@ w32_get_modifiers ()
and window input. */
static int
-construct_console_modifiers ()
+construct_console_modifiers (void)
{
int mods;
@@ -2396,8 +2343,7 @@ static Lisp_Object w32_grabbed_keys;
combinations like Alt-Tab which are used by the system. */
static void
-register_hot_keys (hwnd)
- HWND hwnd;
+register_hot_keys (HWND hwnd)
{
Lisp_Object keylist;
@@ -2416,8 +2362,7 @@ register_hot_keys (hwnd)
}
static void
-unregister_hot_keys (hwnd)
- HWND hwnd;
+unregister_hot_keys (HWND hwnd)
{
Lisp_Object keylist;
@@ -2623,7 +2568,7 @@ complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result)
}
static void
-cancel_all_deferred_msgs ()
+cancel_all_deferred_msgs (void)
{
deferred_msg * item;
@@ -2668,7 +2613,7 @@ w32_msg_worker (void *arg)
}
static void
-signal_user_input ()
+signal_user_input (void)
{
/* Interrupt any lisp that wants to be interrupted by input. */
if (!NILP (Vthrow_on_input))
@@ -2686,13 +2631,9 @@ signal_user_input ()
static void
-post_character_message (hwnd, msg, wParam, lParam, modifiers)
- HWND hwnd;
- UINT msg;
- WPARAM wParam;
- LPARAM lParam;
- DWORD modifiers;
-
+post_character_message (HWND hwnd, UINT msg,
+ WPARAM wParam, LPARAM lParam,
+ DWORD modifiers)
{
W32Msg wmsg;
@@ -2752,11 +2693,7 @@ post_character_message (hwnd, msg, wParam, lParam, modifiers)
/* Main window procedure */
LRESULT CALLBACK
-w32_wnd_proc (hwnd, msg, wParam, lParam)
- HWND hwnd;
- UINT msg;
- WPARAM wParam;
- LPARAM lParam;
+w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
struct frame *f;
struct w32_display_info *dpyinfo = &one_w32_display_info;
@@ -2814,7 +2751,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
{
PAINTSTRUCT paintStruct;
RECT update_rect;
- bzero (&update_rect, sizeof (update_rect));
+ memset (&update_rect, 0, sizeof (update_rect));
f = x_window_to_frame (dpyinfo, hwnd);
if (f == 0)
@@ -3162,7 +3099,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
wmsg.dwModifiers = w32_get_key_modifiers (wParam, lParam);
/* Get buffer size. */
size = get_composition_string_fn (context, GCS_RESULTSTR, buffer, 0);
- buffer = alloca(size);
+ buffer = alloca (size);
size = get_composition_string_fn (context, GCS_RESULTSTR,
buffer, size);
release_ime_context_fn (hwnd, context);
@@ -4006,8 +3943,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
}
static void
-my_create_window (f)
- struct frame * f;
+my_create_window (struct frame * f)
{
MSG msg;
@@ -4022,8 +3958,7 @@ my_create_window (f)
messages for the tooltip. Creating tooltips indirectly also creates
deadlocks when tooltips are created for menu items. */
static void
-my_create_tip_window (f)
- struct frame *f;
+my_create_tip_window (struct frame *f)
{
RECT rect;
@@ -4066,10 +4001,7 @@ my_create_tip_window (f)
/* Create and set up the w32 window for frame F. */
static void
-w32_window (f, window_prompting, minibuffer_only)
- struct frame *f;
- long window_prompting;
- int minibuffer_only;
+w32_window (struct frame *f, long window_prompting, int minibuffer_only)
{
BLOCK_INPUT;
@@ -4117,9 +4049,7 @@ w32_window (f, window_prompting, minibuffer_only)
well. */
static void
-x_icon (f, parms)
- struct frame *f;
- Lisp_Object parms;
+x_icon (struct frame *f, Lisp_Object parms)
{
Lisp_Object icon_x, icon_y;
struct w32_display_info *dpyinfo = &one_w32_display_info;
@@ -4158,8 +4088,7 @@ x_icon (f, parms)
static void
-x_make_gc (f)
- struct frame *f;
+x_make_gc (struct frame *f)
{
XGCValues gc_values;
@@ -4192,8 +4121,7 @@ x_make_gc (f)
constructed. */
static Lisp_Object
-unwind_create_frame (frame)
- Lisp_Object frame;
+unwind_create_frame (Lisp_Object frame)
{
struct frame *f = XFRAME (frame);
@@ -4218,9 +4146,7 @@ unwind_create_frame (frame)
}
static void
-x_default_font_parameter (f, parms)
- struct frame *f;
- Lisp_Object parms;
+x_default_font_parameter (struct frame *f, Lisp_Object parms)
{
struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL,
@@ -4270,8 +4196,7 @@ then `default-minibuffer-frame' must be a frame whose minibuffer can
be shared by the new frame.
This function is an internal primitive--use `make-frame' instead. */)
- (parameters)
- Lisp_Object parameters;
+ (Lisp_Object parameters)
{
struct frame *f;
Lisp_Object frame, tem;
@@ -4354,7 +4279,7 @@ This function is an internal primitive--use `make-frame' instead. */)
f->output_method = output_w32;
f->output_data.w32 =
(struct w32_output *) xmalloc (sizeof (struct w32_output));
- bzero (f->output_data.w32, sizeof (struct w32_output));
+ memset (f->output_data.w32, 0, sizeof (struct w32_output));
FRAME_FONTSET (f) = -1;
f->icon_name
@@ -4462,10 +4387,17 @@ This function is an internal primitive--use `make-frame' instead. */)
happen. */
init_frame_faces (f);
- x_default_parameter (f, parameters, Qmenu_bar_lines, make_number (1),
- "menuBar", "MenuBar", RES_TYPE_NUMBER);
- x_default_parameter (f, parameters, Qtool_bar_lines, make_number (1),
- "toolBar", "ToolBar", RES_TYPE_NUMBER);
+ /* The X resources controlling the menu-bar and tool-bar are
+ processed specially at startup, and reflected in the mode
+ variables; ignore them here. */
+ x_default_parameter (f, parameters, Qmenu_bar_lines,
+ NILP (Vmenu_bar_mode)
+ ? make_number (0) : make_number (1),
+ NULL, NULL, RES_TYPE_NUMBER);
+ x_default_parameter (f, parameters, Qtool_bar_lines,
+ NILP (Vtool_bar_mode)
+ ? make_number (0) : make_number (1),
+ NULL, NULL, RES_TYPE_NUMBER);
x_default_parameter (f, parameters, Qbuffer_predicate, Qnil,
"bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL);
@@ -4579,8 +4511,7 @@ This function is an internal primitive--use `make-frame' instead. */)
display info directly because we're called from frame.c, which doesn't
know about that structure. */
Lisp_Object
-x_get_focus_frame (frame)
- struct frame *frame;
+x_get_focus_frame (struct frame *frame)
{
struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (frame);
Lisp_Object xfocus;
@@ -4593,8 +4524,7 @@ x_get_focus_frame (frame)
DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
doc: /* Give FRAME input focus, raising to foreground if necessary. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
x_focus_on_frame (check_x_frame (frame));
return Qnil;
@@ -4603,8 +4533,7 @@ DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
doc: /* Internal function called by `color-defined-p', which see. */)
- (color, frame)
- Lisp_Object color, frame;
+ (Lisp_Object color, Lisp_Object frame)
{
XColor foo;
FRAME_PTR f = check_x_frame (frame);
@@ -4619,8 +4548,7 @@ DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
doc: /* Internal function called by `color-values', which see. */)
- (color, frame)
- Lisp_Object color, frame;
+ (Lisp_Object color, Lisp_Object frame)
{
XColor foo;
FRAME_PTR f = check_x_frame (frame);
@@ -4640,8 +4568,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0,
doc: /* Internal function called by `display-color-p', which see. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
struct w32_display_info *dpyinfo = check_x_display_info (display);
@@ -4658,8 +4585,7 @@ Note that color displays do support shades of gray.
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
struct w32_display_info *dpyinfo = check_x_display_info (display);
@@ -4675,8 +4601,7 @@ DEFUN ("x-display-pixel-width", Fx_display_pixel_width,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
struct w32_display_info *dpyinfo = check_x_display_info (display);
@@ -4689,8 +4614,7 @@ DEFUN ("x-display-pixel-height", Fx_display_pixel_height,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
struct w32_display_info *dpyinfo = check_x_display_info (display);
@@ -4703,8 +4627,7 @@ DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
struct w32_display_info *dpyinfo = check_x_display_info (display);
@@ -4717,8 +4640,7 @@ DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
struct w32_display_info *dpyinfo = check_x_display_info (display);
HDC hdc;
@@ -4747,8 +4669,7 @@ DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
struct w32_display_info *dpyinfo = check_x_display_info (display);
@@ -4760,8 +4681,7 @@ DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
return build_string ("Microsoft Corp.");
}
@@ -4775,8 +4695,7 @@ release number. See also the function `x-server-vendor'.
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
return Fcons (make_number (w32_major_version),
Fcons (make_number (w32_minor_version),
@@ -4788,8 +4707,7 @@ DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
return make_number (1);
}
@@ -4800,8 +4718,7 @@ DEFUN ("x-display-mm-height", Fx_display_mm_height,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
struct w32_display_info *dpyinfo = check_x_display_info (display);
HDC hdc;
@@ -4821,8 +4738,7 @@ DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
struct w32_display_info *dpyinfo = check_x_display_info (display);
@@ -4845,8 +4761,7 @@ The value may be `always', `when-mapped', or `not-useful'.
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
return intern ("not-useful");
}
@@ -4860,8 +4775,7 @@ The value is one of the symbols `static-gray', `gray-scale',
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
struct w32_display_info *dpyinfo = check_x_display_info (display);
Lisp_Object result = Qnil;
@@ -4884,43 +4798,37 @@ DEFUN ("x-display-save-under", Fx_display_save_under,
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
return Qnil;
}
int
-x_pixel_width (f)
- register struct frame *f;
+x_pixel_width (register struct frame *f)
{
return FRAME_PIXEL_WIDTH (f);
}
int
-x_pixel_height (f)
- register struct frame *f;
+x_pixel_height (register struct frame *f)
{
return FRAME_PIXEL_HEIGHT (f);
}
int
-x_char_width (f)
- register struct frame *f;
+x_char_width (register struct frame *f)
{
return FRAME_COLUMN_WIDTH (f);
}
int
-x_char_height (f)
- register struct frame *f;
+x_char_height (register struct frame *f)
{
return FRAME_LINE_HEIGHT (f);
}
int
-x_screen_planes (f)
- register struct frame *f;
+x_screen_planes (register struct frame *f)
{
return FRAME_W32_DISPLAY_INFO (f)->n_planes;
}
@@ -4929,8 +4837,7 @@ x_screen_planes (f)
Open a new connection if necessary. */
struct w32_display_info *
-x_display_info_for_name (name)
- Lisp_Object name;
+x_display_info_for_name (Lisp_Object name)
{
Lisp_Object names;
struct w32_display_info *dpyinfo;
@@ -4970,8 +4877,7 @@ DISPLAY is the name of the display to connect to.
Optional second arg XRM-STRING is a string of resources in xrdb format.
If the optional third arg MUST-SUCCEED is non-nil,
terminate Emacs if we can't open the connection. */)
- (display, xrm_string, must_succeed)
- Lisp_Object display, xrm_string, must_succeed;
+ (Lisp_Object display, Lisp_Object xrm_string, Lisp_Object must_succeed)
{
unsigned char *xrm_option;
struct w32_display_info *dpyinfo;
@@ -5059,8 +4965,7 @@ DEFUN ("x-close-connection", Fx_close_connection,
doc: /* Close the connection to DISPLAY's server.
For DISPLAY, specify either a frame or a display name (a string).
If DISPLAY is nil, that stands for the selected frame's display. */)
- (display)
- Lisp_Object display;
+ (Lisp_Object display)
{
struct w32_display_info *dpyinfo = check_x_display_info (display);
int i;
@@ -5079,7 +4984,7 @@ If DISPLAY is nil, that stands for the selected frame's display. */)
DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
doc: /* Return the list of display names that Emacs has connections to. */)
- ()
+ (void)
{
Lisp_Object tail, result;
@@ -5092,8 +4997,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0,
doc: /* This is a noop on W32 systems. */)
- (on, display)
- Lisp_Object display, on;
+ (Lisp_Object on, Lisp_Object display)
{
return Qnil;
}
@@ -5122,8 +5026,7 @@ If OUTER_P is non-nil, the property is changed for the outer X window of
FRAME. Default is to change on the edit X window.
Value is VALUE. */)
- (prop, value, frame, type, format, outer_p)
- Lisp_Object prop, value, frame, type, format, outer_p;
+ (Lisp_Object prop, Lisp_Object value, Lisp_Object frame, Lisp_Object type, Lisp_Object format, Lisp_Object outer_p)
{
#if 0 /* TODO : port window properties to W32 */
struct frame *f = check_x_frame (frame);
@@ -5152,8 +5055,7 @@ DEFUN ("x-delete-window-property", Fx_delete_window_property,
Sx_delete_window_property, 1, 2, 0,
doc: /* Remove window property PROP from X window of FRAME.
FRAME nil or omitted means use the selected frame. Value is PROP. */)
- (prop, frame)
- Lisp_Object prop, frame;
+ (Lisp_Object prop, Lisp_Object frame)
{
#if 0 /* TODO : port window properties to W32 */
@@ -5180,8 +5082,7 @@ DEFUN ("x-window-property", Fx_window_property, Sx_window_property,
If FRAME is nil or omitted, use the selected frame. Value is nil
if FRAME hasn't a property with name PROP or if PROP has no string
value. */)
- (prop, frame)
- Lisp_Object prop, frame;
+ (Lisp_Object prop, Lisp_Object frame)
{
#if 0 /* TODO : port window properties to W32 */
@@ -5245,7 +5146,7 @@ extern Lisp_Object Vhourglass_delay;
xdisp.c could be used. */
int
-hourglass_started ()
+hourglass_started (void)
{
return hourglass_shown_p || hourglass_timer;
}
@@ -5253,7 +5154,7 @@ hourglass_started ()
/* Cancel a currently active hourglass timer, and start a new one. */
void
-start_hourglass ()
+start_hourglass (void)
{
DWORD delay;
int secs, msecs = 0;
@@ -5289,7 +5190,7 @@ start_hourglass ()
cursor if shown. */
void
-cancel_hourglass ()
+cancel_hourglass (void)
{
if (hourglass_timer)
{
@@ -5308,8 +5209,7 @@ cancel_hourglass ()
to indicate that an hourglass cursor is shown. */
static void
-w32_show_hourglass (f)
- struct frame *f;
+w32_show_hourglass (struct frame *f)
{
if (!hourglass_shown_p)
{
@@ -5324,7 +5224,7 @@ w32_show_hourglass (f)
/* Hide the hourglass cursor on all frames, if it is currently shown. */
static void
-w32_hide_hourglass ()
+w32_hide_hourglass (void)
{
if (hourglass_shown_p)
{
@@ -5352,10 +5252,10 @@ w32_hide_hourglass ()
Tool tips
***********************************************************************/
-static Lisp_Object x_create_tip_frame P_ ((struct w32_display_info *,
- Lisp_Object, Lisp_Object));
-static void compute_tip_xy P_ ((struct frame *, Lisp_Object, Lisp_Object,
- Lisp_Object, int, int, int *, int *));
+static Lisp_Object x_create_tip_frame (struct w32_display_info *,
+ Lisp_Object, Lisp_Object);
+static void compute_tip_xy (struct frame *, Lisp_Object, Lisp_Object,
+ Lisp_Object, int, int, int *, int *);
/* The frame of a currently visible tooltip. */
@@ -5378,8 +5278,7 @@ Lisp_Object Vx_max_tooltip_size;
static Lisp_Object
-unwind_create_tip_frame (frame)
- Lisp_Object frame;
+unwind_create_tip_frame (Lisp_Object frame)
{
Lisp_Object deleted;
@@ -5404,9 +5303,8 @@ unwind_create_tip_frame (frame)
when this happens. */
static Lisp_Object
-x_create_tip_frame (dpyinfo, parms, text)
- struct w32_display_info *dpyinfo;
- Lisp_Object parms, text;
+x_create_tip_frame (struct w32_display_info *dpyinfo,
+ Lisp_Object parms, Lisp_Object text)
{
struct frame *f;
Lisp_Object frame, tem;
@@ -5470,7 +5368,7 @@ x_create_tip_frame (dpyinfo, parms, text)
f->output_method = output_w32;
f->output_data.w32 =
(struct w32_output *) xmalloc (sizeof (struct w32_output));
- bzero (f->output_data.w32, sizeof (struct w32_output));
+ memset (f->output_data.w32, 0, sizeof (struct w32_output));
FRAME_FONTSET (f) = -1;
f->icon_name = Qnil;
@@ -5584,9 +5482,8 @@ x_create_tip_frame (dpyinfo, parms, text)
change_frame_size (f, height, width, 1, 0, 0);
/* Add `tooltip' frame parameter's default value. */
- if (NILP (Fframe_parameter (frame, intern ("tooltip"))))
- Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt),
- Qnil));
+ if (NILP (Fframe_parameter (frame, Qtooltip)))
+ Fmodify_frame_parameters (frame, Fcons (Fcons (Qtooltip, Qt), Qnil));
/* Set up faces after all frame parameters are known. This call
also merges in face attributes specified for new frames.
@@ -5646,11 +5543,9 @@ x_create_tip_frame (dpyinfo, parms, text)
the display in *ROOT_X, and *ROOT_Y. */
static void
-compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y)
- struct frame *f;
- Lisp_Object parms, dx, dy;
- int width, height;
- int *root_x, *root_y;
+compute_tip_xy (struct frame *f,
+ Lisp_Object parms, Lisp_Object dx, Lisp_Object dy,
+ int width, int height, int *root_x, int *root_y)
{
Lisp_Object left, top;
int min_x, min_y, max_x, max_y;
@@ -5754,8 +5649,7 @@ DY added (default is -10).
A tooltip's maximum size is specified by `x-max-tooltip-size'.
Text larger than the specified size is clipped. */)
- (string, frame, parms, timeout, dx, dy)
- Lisp_Object string, frame, parms, timeout, dx, dy;
+ (Lisp_Object string, Lisp_Object frame, Lisp_Object parms, Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy)
{
struct frame *f;
struct window *w;
@@ -5984,7 +5878,7 @@ Text larger than the specified size is clipped. */)
DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0,
doc: /* Hide the current tooltip window, if there is any.
Value is t if tooltip was open, nil otherwise. */)
- ()
+ (void)
{
int count;
Lisp_Object deleted, frame, timer;
@@ -6029,11 +5923,7 @@ extern Lisp_Object Qfile_name_history;
allows us to work around the fact that the standard Open File
dialog does not support directories. */
UINT CALLBACK
-file_dialog_callback (hwnd, msg, wParam, lParam)
- HWND hwnd;
- UINT msg;
- WPARAM wParam;
- LPARAM lParam;
+file_dialog_callback (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == WM_NOTIFY)
{
@@ -6084,8 +5974,7 @@ Use a file selection dialog.
Select DEFAULT-FILENAME in the dialog's file selection box, if
specified. Ensure that file exists if MUSTMATCH is non-nil.
If ONLY-DIR-P is non-nil, the user can only select directories. */)
- (prompt, dir, default_filename, mustmatch, only_dir_p)
- Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p;
+ (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p)
{
struct frame *f = SELECTED_FRAME ();
Lisp_Object file = Qnil;
@@ -6134,7 +6023,7 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
specbind (Qinhibit_redisplay, Qt);
BLOCK_INPUT;
- bzero (&new_file_details, sizeof (new_file_details));
+ memset (&new_file_details, 0, sizeof (new_file_details));
/* Apparently NT4 crashes if you give it an unexpected size.
I'm not sure about Windows 9x, so play it safe. */
if (w32_major_version > 4 && w32_major_version < 95)
@@ -6213,8 +6102,7 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
DEFUN ("system-move-file-to-trash", Fsystem_move_file_to_trash,
Ssystem_move_file_to_trash, 1, 1, 0,
doc: /* Move file or directory named FILENAME to the recycle bin. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
Lisp_Object handler;
Lisp_Object encoded_file;
@@ -6245,10 +6133,10 @@ DEFUN ("system-move-file-to-trash", Fsystem_move_file_to_trash,
/* On Windows, write permission is required to delete/move files. */
_chmod (path, 0666);
- bzero (tmp_path, sizeof (tmp_path));
+ memset (tmp_path, 0, sizeof (tmp_path));
strcpy (tmp_path, path);
- bzero (&file_op, sizeof (file_op));
+ memset (&file_op, 0, sizeof (file_op));
file_op.hwnd = HWND_DESKTOP;
file_op.wFunc = FO_DELETE;
file_op.pFrom = tmp_path;
@@ -6276,8 +6164,7 @@ to activate the menubar for keyboard access. #xf140 activates the
screen saver if defined.
If optional parameter FRAME is not specified, use selected frame. */)
- (command, frame)
- Lisp_Object command, frame;
+ (Lisp_Object command, Lisp_Object frame)
{
FRAME_PTR f = check_x_frame (frame);
@@ -6330,8 +6217,7 @@ an integer representing a ShowWindow flag:
1 - start normally
3 - start maximized
6 - start minimized */)
- (operation, document, parameters, show_flag)
- Lisp_Object operation, document, parameters, show_flag;
+ (Lisp_Object operation, Lisp_Object document, Lisp_Object parameters, Lisp_Object show_flag)
{
Lisp_Object current_dir;
char *errstr;
@@ -6387,8 +6273,7 @@ lookup_vk_code (char *key)
/* Convert a one-element vector style key sequence to a hot key
definition. */
static Lisp_Object
-w32_parse_hot_key (key)
- Lisp_Object key;
+w32_parse_hot_key (Lisp_Object key)
{
/* Copied from Fdefine_key and store_in_keymap. */
register Lisp_Object c;
@@ -6469,8 +6354,7 @@ modifier is interpreted as Alt if `w32-alt-is-meta' is t, and hyper
is always interpreted as the Windows modifier keys.
The return value is the hotkey-id if registered, otherwise nil. */)
- (key)
- Lisp_Object key;
+ (Lisp_Object key)
{
key = w32_parse_hot_key (key);
@@ -6502,8 +6386,7 @@ The return value is the hotkey-id if registered, otherwise nil. */)
DEFUN ("w32-unregister-hot-key", Fw32_unregister_hot_key,
Sw32_unregister_hot_key, 1, 1, 0,
doc: /* Unregister KEY as a hot-key combination. */)
- (key)
- Lisp_Object key;
+ (Lisp_Object key)
{
Lisp_Object item;
@@ -6535,7 +6418,7 @@ DEFUN ("w32-unregister-hot-key", Fw32_unregister_hot_key,
DEFUN ("w32-registered-hot-keys", Fw32_registered_hot_keys,
Sw32_registered_hot_keys, 0, 0, 0,
doc: /* Return list of registered hot-key IDs. */)
- ()
+ (void)
{
return Fdelq (Qnil, Fcopy_sequence (w32_grabbed_keys));
}
@@ -6544,8 +6427,7 @@ DEFUN ("w32-reconstruct-hot-key", Fw32_reconstruct_hot_key,
Sw32_reconstruct_hot_key, 1, 1, 0,
doc: /* Convert hot-key ID to a lisp key combination.
usage: (w32-reconstruct-hot-key ID) */)
- (hotkeyid)
- Lisp_Object hotkeyid;
+ (Lisp_Object hotkeyid)
{
int vk_code, w32_modifiers;
Lisp_Object key;
@@ -6579,8 +6461,7 @@ DEFUN ("w32-toggle-lock-key", Fw32_toggle_lock_key,
KEY can be `capslock', `kp-numlock', or `scroll'.
If the optional parameter NEW-STATE is a number, then the state of KEY
is set to off if the low bit of NEW-STATE is zero, otherwise on. */)
- (key, new_state)
- Lisp_Object key, new_state;
+ (Lisp_Object key, Lisp_Object new_state)
{
int vk_code;
@@ -6616,8 +6497,7 @@ DEFUN ("w32-window-exists-p", Fw32_window_exists_p, Sw32_window_exists_p,
doc: /* Return non-nil if a window exists with the specified CLASS and NAME.
This is a direct interface to the Windows API FindWindow function. */)
- (class, name)
-Lisp_Object class, name;
+ (Lisp_Object class, Lisp_Object name)
{
HWND hnd;
@@ -6646,7 +6526,7 @@ The following %-sequences are provided:
%m Remaining time (to charge or discharge) in minutes
%h Remaining time (to charge or discharge) in hours
%t Remaining time (to charge or discharge) in the form `h:min' */)
- ()
+ (void)
{
Lisp_Object status = Qnil;
@@ -6750,8 +6630,7 @@ Value is a list of floats (TOTAL FREE AVAIL), where TOTAL is the total
storage of the file system, FREE is the free storage, and AVAIL is the
storage available to a non-superuser. All 3 numbers are in bytes.
If the underlying system call fails, value is nil. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
Lisp_Object encoded, value;
@@ -6843,7 +6722,7 @@ If the underlying system call fails, value is nil. */)
DEFUN ("default-printer-name", Fdefault_printer_name, Sdefault_printer_name,
0, 0, 0, doc: /* Return the name of Windows default printer device. */)
- ()
+ (void)
{
static char pname_buf[256];
int err;
@@ -6955,7 +6834,7 @@ frame_parm_handler w32_frame_parm_handlers[] =
};
void
-syms_of_w32fns ()
+syms_of_w32fns (void)
{
globals_of_w32fns ();
/* This is zero if not using MS-Windows. */
@@ -7312,7 +7191,7 @@ only be necessary if the default setting causes problems. */);
is non zero.
*/
void
-globals_of_w32fns ()
+globals_of_w32fns (void)
{
HMODULE user32_lib = GetModuleHandle ("user32.dll");
/*
@@ -7355,7 +7234,7 @@ globals_of_w32fns ()
#undef abort
void
-w32_abort ()
+w32_abort (void)
{
int button;
button = MessageBox (NULL,
@@ -7383,7 +7262,7 @@ w32_abort ()
/* For convenience when debugging. */
int
-w32_last_error ()
+w32_last_error (void)
{
return GetLastError ();
}
diff --git a/src/w32font.c b/src/w32font.c
index e93dbca2ddb..d1375d58507 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -106,28 +106,28 @@ static Lisp_Object Vw32_charset_info_alist;
/* Font spacing symbols - defined in font.c. */
extern Lisp_Object Qc, Qp, Qm;
-static void fill_in_logfont P_ ((FRAME_PTR, LOGFONT *, Lisp_Object));
+static void fill_in_logfont (FRAME_PTR, LOGFONT *, Lisp_Object);
-static BYTE w32_antialias_type P_ ((Lisp_Object));
-static Lisp_Object lispy_antialias_type P_ ((BYTE));
+static BYTE w32_antialias_type (Lisp_Object);
+static Lisp_Object lispy_antialias_type (BYTE);
-static Lisp_Object font_supported_scripts P_ ((FONTSIGNATURE *));
-static int w32font_full_name P_ ((LOGFONT *, Lisp_Object, int, char *, int));
-static void compute_metrics P_ ((HDC, struct w32font_info *, unsigned int,
- struct w32_metric_cache *));
+static Lisp_Object font_supported_scripts (FONTSIGNATURE *);
+static int w32font_full_name (LOGFONT *, Lisp_Object, int, char *, int);
+static void compute_metrics (HDC, struct w32font_info *, unsigned int,
+ struct w32_metric_cache *);
-static Lisp_Object w32_registry P_ ((LONG, DWORD));
+static Lisp_Object w32_registry (LONG, DWORD);
/* EnumFontFamiliesEx callbacks. */
-static int CALLBACK add_font_entity_to_list P_ ((ENUMLOGFONTEX *,
+static int CALLBACK add_font_entity_to_list (ENUMLOGFONTEX *,
+ NEWTEXTMETRICEX *,
+ DWORD, LPARAM);
+static int CALLBACK add_one_font_entity_to_list (ENUMLOGFONTEX *,
NEWTEXTMETRICEX *,
- DWORD, LPARAM));
-static int CALLBACK add_one_font_entity_to_list P_ ((ENUMLOGFONTEX *,
- NEWTEXTMETRICEX *,
- DWORD, LPARAM));
-static int CALLBACK add_font_name_to_list P_ ((ENUMLOGFONTEX *,
- NEWTEXTMETRICEX *,
- DWORD, LPARAM));
+ DWORD, LPARAM);
+static int CALLBACK add_font_name_to_list (ENUMLOGFONTEX *,
+ NEWTEXTMETRICEX *,
+ DWORD, LPARAM);
/* struct passed in as LPARAM arg to EnumFontFamiliesEx, for keeping track
of what we really want. */
@@ -149,12 +149,11 @@ struct font_callback_data
/* Handles the problem that EnumFontFamiliesEx will not return all
style variations if the font name is not specified. */
-static void list_all_matching_fonts P_ ((struct font_callback_data *));
+static void list_all_matching_fonts (struct font_callback_data *);
static int
-memq_no_quit (elt, list)
- Lisp_Object elt, list;
+memq_no_quit (Lisp_Object elt, Lisp_Object list)
{
while (CONSP (list) && ! EQ (XCAR (list), elt))
list = XCDR (list);
@@ -162,8 +161,7 @@ memq_no_quit (elt, list)
}
Lisp_Object
-intern_font_name (string)
- char * string;
+intern_font_name (char * string)
{
Lisp_Object obarray, tem, str;
int len;
@@ -185,8 +183,7 @@ intern_font_name (string)
Return a cache of font-entities on FRAME. The cache must be a
cons whose cdr part is the actual cache area. */
Lisp_Object
-w32font_get_cache (f)
- FRAME_PTR f;
+w32font_get_cache (FRAME_PTR f)
{
struct w32_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -198,8 +195,7 @@ w32font_get_cache (f)
is a vector of font-entities. This is the sole API that
allocates font-entities. */
static Lisp_Object
-w32font_list (frame, font_spec)
- Lisp_Object frame, font_spec;
+w32font_list (Lisp_Object frame, Lisp_Object font_spec)
{
Lisp_Object fonts = w32font_list_internal (frame, font_spec, 0);
FONT_ADD_LOG ("w32font-list", font_spec, fonts);
@@ -211,8 +207,7 @@ w32font_list (frame, font_spec)
FRAME. The closeness is detemined by the font backend, thus
`face-font-selection-order' is ignored here. */
static Lisp_Object
-w32font_match (frame, font_spec)
- Lisp_Object frame, font_spec;
+w32font_match (Lisp_Object frame, Lisp_Object font_spec)
{
Lisp_Object entity = w32font_match_internal (frame, font_spec, 0);
FONT_ADD_LOG ("w32font-match", font_spec, entity);
@@ -223,15 +218,14 @@ w32font_match (frame, font_spec)
List available families. The value is a list of family names
(symbols). */
static Lisp_Object
-w32font_list_family (frame)
- Lisp_Object frame;
+w32font_list_family (Lisp_Object frame)
{
Lisp_Object list = Qnil;
LOGFONT font_match_pattern;
HDC dc;
FRAME_PTR f = XFRAME (frame);
- bzero (&font_match_pattern, sizeof (font_match_pattern));
+ memset (&font_match_pattern, 0, sizeof (font_match_pattern));
font_match_pattern.lfCharSet = DEFAULT_CHARSET;
dc = get_frame_dc (f);
@@ -248,10 +242,7 @@ w32font_list_family (frame)
Open a font specified by FONT_ENTITY on frame F.
If the font is scalable, open it with PIXEL_SIZE. */
static Lisp_Object
-w32font_open (f, font_entity, pixel_size)
- FRAME_PTR f;
- Lisp_Object font_entity;
- int pixel_size;
+w32font_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
{
Lisp_Object font_object
= font_make_object (VECSIZE (struct w32font_info),
@@ -275,9 +266,7 @@ w32font_open (f, font_entity, pixel_size)
/* w32 implementation of close for font_backend.
Close FONT on frame F. */
void
-w32font_close (f, font)
- FRAME_PTR f;
- struct font *font;
+w32font_close (FRAME_PTR f, struct font *font)
{
int i;
struct w32font_info *w32_font = (struct w32font_info *) font;
@@ -303,9 +292,7 @@ w32font_close (f, font)
return 1. If not, return 0. If a font must be opened to check
it, return -1. */
int
-w32font_has_char (entity, c)
- Lisp_Object entity;
- int c;
+w32font_has_char (Lisp_Object entity, int c)
{
/* We can't be certain about which characters a font will support until
we open it. Checking the scripts that the font supports turns out
@@ -354,9 +341,7 @@ w32font_has_char (entity, c)
which characters are not supported by the font.
*/
static unsigned
-w32font_encode_char (font, c)
- struct font *font;
- int c;
+w32font_encode_char (struct font *font, int c)
{
struct w32font_info * w32_font = (struct w32font_info *)font;
@@ -373,11 +358,8 @@ w32font_encode_char (font, c)
CODE (length NGLYPHS). Apparently metrics can be NULL, in this
case just return the overall width. */
int
-w32font_text_extents (font, code, nglyphs, metrics)
- struct font *font;
- unsigned *code;
- int nglyphs;
- struct font_metrics *metrics;
+w32font_text_extents (struct font *font, unsigned *code,
+ int nglyphs, struct font_metrics *metrics)
{
int i;
HFONT old_font = NULL;
@@ -391,7 +373,7 @@ w32font_text_extents (font, code, nglyphs, metrics)
if (metrics)
{
- bzero (metrics, sizeof (struct font_metrics));
+ memset (metrics, 0, sizeof (struct font_metrics));
metrics->ascent = font->ascent;
metrics->descent = font->descent;
@@ -412,9 +394,9 @@ w32font_text_extents (font, code, nglyphs, metrics)
= xrealloc (w32_font->cached_metrics,
(block + 1)
* sizeof (struct w32_metric_cache *));
- bzero (w32_font->cached_metrics + w32_font->n_cache_blocks,
- ((block + 1 - w32_font->n_cache_blocks)
- * sizeof (struct w32_metric_cache *)));
+ memset (w32_font->cached_metrics + w32_font->n_cache_blocks, 0,
+ ((block + 1 - w32_font->n_cache_blocks)
+ * sizeof (struct w32_metric_cache *)));
w32_font->n_cache_blocks = block + 1;
}
@@ -422,8 +404,8 @@ w32font_text_extents (font, code, nglyphs, metrics)
{
w32_font->cached_metrics[block]
= xmalloc (CACHE_BLOCKSIZE * sizeof (struct w32_metric_cache));
- bzero (w32_font->cached_metrics[block],
- CACHE_BLOCKSIZE * sizeof (struct w32_metric_cache));
+ memset (w32_font->cached_metrics[block], 0,
+ CACHE_BLOCKSIZE * sizeof (struct w32_metric_cache));
}
char_metric = w32_font->cached_metrics[block] + pos_in_block;
@@ -552,9 +534,8 @@ w32font_text_extents (font, code, nglyphs, metrics)
*/
int
-w32font_draw (s, from, to, x, y, with_background)
- struct glyph_string *s;
- int from, to, x, y, with_background;
+w32font_draw (struct glyph_string *s, int from, int to,
+ int x, int y, int with_background)
{
UINT options;
HRGN orig_clip = NULL;
@@ -568,7 +549,7 @@ w32font_draw (s, from, to, x, y, with_background)
/* Save clip region for later restoration. */
orig_clip = CreateRectRgn (0, 0, 0, 0);
- if (!GetClipRgn(s->hdc, orig_clip))
+ if (!GetClipRgn (s->hdc, orig_clip))
{
DeleteObject (orig_clip);
orig_clip = NULL;
@@ -715,9 +696,7 @@ w32font_otf_drive (struct font *font, Lisp_Object features,
Additional parameter opentype_only restricts the returned fonts to
opentype fonts, which can be used with the Uniscribe backend. */
Lisp_Object
-w32font_list_internal (frame, font_spec, opentype_only)
- Lisp_Object frame, font_spec;
- int opentype_only;
+w32font_list_internal (Lisp_Object frame, Lisp_Object font_spec, int opentype_only)
{
struct font_callback_data match_data;
HDC dc;
@@ -727,7 +706,7 @@ w32font_list_internal (frame, font_spec, opentype_only)
match_data.list = Qnil;
match_data.frame = frame;
- bzero (&match_data.pattern, sizeof (LOGFONT));
+ memset (&match_data.pattern, 0, sizeof (LOGFONT));
fill_in_logfont (f, &match_data.pattern, font_spec);
/* If the charset is unrecognized, then we won't find a font, so don't
@@ -770,9 +749,7 @@ w32font_list_internal (frame, font_spec, opentype_only)
Additional parameter opentype_only restricts the returned fonts to
opentype fonts, which can be used with the Uniscribe backend. */
Lisp_Object
-w32font_match_internal (frame, font_spec, opentype_only)
- Lisp_Object frame, font_spec;
- int opentype_only;
+w32font_match_internal (Lisp_Object frame, Lisp_Object font_spec, int opentype_only)
{
struct font_callback_data match_data;
HDC dc;
@@ -782,7 +759,7 @@ w32font_match_internal (frame, font_spec, opentype_only)
match_data.frame = frame;
match_data.list = Qnil;
- bzero (&match_data.pattern, sizeof (LOGFONT));
+ memset (&match_data.pattern, 0, sizeof (LOGFONT));
fill_in_logfont (f, &match_data.pattern, font_spec);
match_data.opentype_only = opentype_only;
@@ -800,11 +777,8 @@ w32font_match_internal (frame, font_spec, opentype_only)
}
int
-w32font_open_internal (f, font_entity, pixel_size, font_object)
- FRAME_PTR f;
- Lisp_Object font_entity;
- int pixel_size;
- Lisp_Object font_object;
+w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity,
+ int pixel_size, Lisp_Object font_object)
{
int len, size, i;
LOGFONT logfont;
@@ -821,7 +795,7 @@ w32font_open_internal (f, font_entity, pixel_size, font_object)
if (!font)
return 0;
- bzero (&logfont, sizeof (logfont));
+ memset (&logfont, 0, sizeof (logfont));
fill_in_logfont (f, &logfont, font_entity);
/* Prefer truetype fonts, to avoid known problems with type1 fonts, and
@@ -850,8 +824,8 @@ w32font_open_internal (f, font_entity, pixel_size, font_object)
{
metrics = (OUTLINETEXTMETRICW *) alloca (len);
if (GetOutlineTextMetricsW (dc, len, metrics))
- bcopy (&metrics->otmTextMetrics, &w32_font->metrics,
- sizeof (TEXTMETRICW));
+ memcpy (&w32_font->metrics, &metrics->otmTextMetrics,
+ sizeof (TEXTMETRICW));
else
metrics = NULL;
}
@@ -951,11 +925,9 @@ w32font_open_internal (f, font_entity, pixel_size, font_object)
/* Callback function for EnumFontFamiliesEx.
* Adds the name of a font to a Lisp list (passed in as the lParam arg). */
static int CALLBACK
-add_font_name_to_list (logical_font, physical_font, font_type, list_object)
- ENUMLOGFONTEX *logical_font;
- NEWTEXTMETRICEX *physical_font;
- DWORD font_type;
- LPARAM list_object;
+add_font_name_to_list (ENUMLOGFONTEX *logical_font,
+ NEWTEXTMETRICEX *physical_font,
+ DWORD font_type, LPARAM list_object)
{
Lisp_Object* list = (Lisp_Object *) list_object;
Lisp_Object family;
@@ -971,19 +943,17 @@ add_font_name_to_list (logical_font, physical_font, font_type, list_object)
return 1;
}
-static int w32_decode_weight P_ ((int));
-static int w32_encode_weight P_ ((int));
+static int w32_decode_weight (int);
+static int w32_encode_weight (int);
/* Convert an enumerated Windows font to an Emacs font entity. */
static Lisp_Object
-w32_enumfont_pattern_entity (frame, logical_font, physical_font,
- font_type, requested_font, backend)
- Lisp_Object frame;
- ENUMLOGFONTEX *logical_font;
- NEWTEXTMETRICEX *physical_font;
- DWORD font_type;
- LOGFONT *requested_font;
- Lisp_Object backend;
+w32_enumfont_pattern_entity (Lisp_Object frame,
+ ENUMLOGFONTEX *logical_font,
+ NEWTEXTMETRICEX *physical_font,
+ DWORD font_type,
+ LOGFONT *requested_font,
+ Lisp_Object backend)
{
Lisp_Object entity, tem;
LOGFONT *lf = (LOGFONT*) logical_font;
@@ -1107,8 +1077,7 @@ w32_generic_family (Lisp_Object name)
}
static int
-logfonts_match (font, pattern)
- LOGFONT *font, *pattern;
+logfonts_match (LOGFONT *font, LOGFONT *pattern)
{
/* Only check height for raster fonts. */
if (pattern->lfHeight && font->lfOutPrecision == OUT_STRING_PRECIS
@@ -1132,12 +1101,9 @@ logfonts_match (font, pattern)
#define CSB_CHINESE ((1 << 18) | (1 << 20))
static int
-font_matches_spec (type, font, spec, backend, logfont)
- DWORD type;
- NEWTEXTMETRICEX *font;
- Lisp_Object spec;
- Lisp_Object backend;
- LOGFONT *logfont;
+font_matches_spec (DWORD type, NEWTEXTMETRICEX *font,
+ Lisp_Object spec, Lisp_Object backend,
+ LOGFONT *logfont)
{
Lisp_Object extra, val;
@@ -1322,9 +1288,7 @@ font_matches_spec (type, font, spec, backend, logfont)
}
static int
-w32font_coverage_ok (coverage, charset)
- FONTSIGNATURE * coverage;
- BYTE charset;
+w32font_coverage_ok (FONTSIGNATURE * coverage, BYTE charset)
{
DWORD subrange1 = coverage->fsUsb[1];
@@ -1350,9 +1314,7 @@ w32font_coverage_ok (coverage, charset)
static int
-check_face_name (font, full_name)
- LOGFONT *font;
- char *full_name;
+check_face_name (LOGFONT *font, char *full_name)
{
char full_iname[LF_FULLFACESIZE+1];
@@ -1397,11 +1359,9 @@ check_face_name (font, full_name)
* and the list to which the fonts are added are passed in via the
* lparam argument, in the form of a font_callback_data struct. */
static int CALLBACK
-add_font_entity_to_list (logical_font, physical_font, font_type, lParam)
- ENUMLOGFONTEX *logical_font;
- NEWTEXTMETRICEX *physical_font;
- DWORD font_type;
- LPARAM lParam;
+add_font_entity_to_list (ENUMLOGFONTEX *logical_font,
+ NEWTEXTMETRICEX *physical_font,
+ DWORD font_type, LPARAM lParam)
{
struct font_callback_data *match_data
= (struct font_callback_data *) lParam;
@@ -1510,11 +1470,9 @@ add_font_entity_to_list (logical_font, physical_font, font_type, lParam)
/* Callback function for EnumFontFamiliesEx.
* Terminates the search once we have a match. */
static int CALLBACK
-add_one_font_entity_to_list (logical_font, physical_font, font_type, lParam)
- ENUMLOGFONTEX *logical_font;
- NEWTEXTMETRICEX *physical_font;
- DWORD font_type;
- LPARAM lParam;
+add_one_font_entity_to_list (ENUMLOGFONTEX *logical_font,
+ NEWTEXTMETRICEX *physical_font,
+ DWORD font_type, LPARAM lParam)
{
struct font_callback_data *match_data
= (struct font_callback_data *) lParam;
@@ -1526,8 +1484,7 @@ add_one_font_entity_to_list (logical_font, physical_font, font_type, lParam)
/* Old function to convert from x to w32 charset, from w32fns.c. */
static LONG
-x_to_w32_charset (lpcs)
- char * lpcs;
+x_to_w32_charset (char * lpcs)
{
Lisp_Object this_entry, w32_charset;
char *charset;
@@ -1609,8 +1566,7 @@ x_to_w32_charset (lpcs)
/* Convert a Lisp font registry (symbol) to a windows charset. */
static LONG
-registry_to_w32_charset (charset)
- Lisp_Object charset;
+registry_to_w32_charset (Lisp_Object charset)
{
if (EQ (charset, Qiso10646_1) || EQ (charset, Qunicode_bmp)
|| EQ (charset, Qunicode_sip))
@@ -1625,9 +1581,7 @@ registry_to_w32_charset (charset)
/* Old function to convert from w32 to x charset, from w32fns.c. */
static char *
-w32_to_x_charset (fncharset, matching)
- int fncharset;
- char *matching;
+w32_to_x_charset (int fncharset, char *matching)
{
static char buf[32];
Lisp_Object charset_type;
@@ -1821,9 +1775,7 @@ w32_to_x_charset (fncharset, matching)
}
static Lisp_Object
-w32_registry (w32_charset, font_type)
- LONG w32_charset;
- DWORD font_type;
+w32_registry (LONG w32_charset, DWORD font_type)
{
char *charset;
@@ -1833,12 +1785,11 @@ w32_registry (w32_charset, font_type)
return font_type == TRUETYPE_FONTTYPE ? Qiso10646_1 : Qunknown;
charset = w32_to_x_charset (w32_charset, NULL);
- return font_intern_prop (charset, strlen(charset), 1);
+ return font_intern_prop (charset, strlen (charset), 1);
}
static int
-w32_decode_weight (fnweight)
- int fnweight;
+w32_decode_weight (int fnweight)
{
if (fnweight >= FW_HEAVY) return 210;
if (fnweight >= FW_EXTRABOLD) return 205;
@@ -1852,8 +1803,7 @@ w32_decode_weight (fnweight)
}
static int
-w32_encode_weight (n)
- int n;
+w32_encode_weight (int n)
{
if (n >= 210) return FW_HEAVY;
if (n >= 205) return FW_EXTRABOLD;
@@ -1869,8 +1819,7 @@ w32_encode_weight (n)
/* Convert a Windows font weight into one of the weights supported
by fontconfig (see font.c:font_parse_fcname). */
static Lisp_Object
-w32_to_fc_weight (n)
- int n;
+w32_to_fc_weight (int n)
{
if (n >= FW_EXTRABOLD) return intern ("black");
if (n >= FW_BOLD) return intern ("bold");
@@ -1881,10 +1830,7 @@ w32_to_fc_weight (n)
/* Fill in all the available details of LOGFONT from FONT_SPEC. */
static void
-fill_in_logfont (f, logfont, font_spec)
- FRAME_PTR f;
- LOGFONT *logfont;
- Lisp_Object font_spec;
+fill_in_logfont (FRAME_PTR f, LOGFONT *logfont, Lisp_Object font_spec)
{
Lisp_Object tmp, extra;
int dpi = FRAME_W32_DISPLAY_INFO (f)->resy;
@@ -2029,8 +1975,7 @@ fill_in_logfont (f, logfont, font_spec)
}
static void
-list_all_matching_fonts (match_data)
- struct font_callback_data *match_data;
+list_all_matching_fonts (struct font_callback_data *match_data)
{
HDC dc;
Lisp_Object families = w32font_list_family (match_data->frame);
@@ -2066,8 +2011,7 @@ list_all_matching_fonts (match_data)
}
static Lisp_Object
-lispy_antialias_type (type)
- BYTE type;
+lispy_antialias_type (BYTE type)
{
Lisp_Object lispy;
@@ -2094,8 +2038,7 @@ lispy_antialias_type (type)
/* Convert antialiasing symbols to lfQuality */
static BYTE
-w32_antialias_type (type)
- Lisp_Object type;
+w32_antialias_type (Lisp_Object type)
{
if (EQ (type, Qnone))
return NONANTIALIASED_QUALITY;
@@ -2241,12 +2184,8 @@ font_supported_scripts (FONTSIGNATURE * sig)
The full name is in fcname format, with weight, slant and antialiasing
specified if they are not "normal". */
static int
-w32font_full_name (font, font_obj, pixel_size, name, nbytes)
- LOGFONT * font;
- Lisp_Object font_obj;
- int pixel_size;
- char *name;
- int nbytes;
+w32font_full_name (LOGFONT * font, Lisp_Object font_obj,
+ int pixel_size, char *name, int nbytes)
{
int len, height, outline;
char *p;
@@ -2317,11 +2256,8 @@ w32font_full_name (font, font_obj, pixel_size, name, nbytes)
is written. If the buffer is not large enough to contain the name,
the function returns -1, otherwise it returns the number of bytes
written to FCNAME. */
-static int logfont_to_fcname(font, pointsize, fcname, size)
- LOGFONT* font;
- int pointsize;
- char *fcname;
- int size;
+static int
+logfont_to_fcname (LOGFONT* font, int pointsize, char *fcname, int size)
{
int len, height;
char *p = fcname;
@@ -2360,11 +2296,8 @@ static int logfont_to_fcname(font, pointsize, fcname, size)
}
static void
-compute_metrics (dc, w32_font, code, metrics)
- HDC dc;
- struct w32font_info *w32_font;
- unsigned int code;
- struct w32_metric_cache *metrics;
+compute_metrics (HDC dc, struct w32font_info *w32_font, unsigned int code,
+ struct w32_metric_cache *metrics)
{
GLYPHMETRICS gm;
MAT2 transform;
@@ -2373,7 +2306,7 @@ compute_metrics (dc, w32_font, code, metrics)
if (w32_font->glyph_idx)
options |= GGO_GLYPH_INDEX;
- bzero (&transform, sizeof (transform));
+ memset (&transform, 0, sizeof (transform));
transform.eM11.value = 1;
transform.eM22.value = 1;
@@ -2396,8 +2329,7 @@ Return fontconfig style font string corresponding to the selection.
If FRAME is omitted or nil, it defaults to the selected frame.
If EXCLUDE-PROPORTIONAL is non-nil, exclude proportional fonts
in the font selection dialog. */)
- (frame, exclude_proportional)
- Lisp_Object frame, exclude_proportional;
+ (Lisp_Object frame, Lisp_Object exclude_proportional)
{
FRAME_PTR f = check_x_frame (frame);
CHOOSEFONT cf;
@@ -2407,8 +2339,8 @@ in the font selection dialog. */)
HANDLE oldobj;
char buf[100];
- bzero (&cf, sizeof (cf));
- bzero (&lf, sizeof (lf));
+ memset (&cf, 0, sizeof (cf));
+ memset (&lf, 0, sizeof (lf));
cf.lStructSize = sizeof (cf);
cf.hwndOwner = FRAME_W32_WINDOW (f);
@@ -2482,7 +2414,7 @@ struct font_driver w32font_driver =
/* Initialize state that does not change between invocations. This is only
called when Emacs is dumped. */
void
-syms_of_w32font ()
+syms_of_w32font (void)
{
DEFSYM (Qgdi, "gdi");
DEFSYM (Quniscribe, "uniscribe");
diff --git a/src/w32font.h b/src/w32font.h
index 3e2345589b5..6479f95faf5 100644
--- a/src/w32font.h
+++ b/src/w32font.h
@@ -62,26 +62,26 @@ struct w32font_info
#define CACHE_BLOCKSIZE 128
-Lisp_Object w32font_get_cache P_ ((FRAME_PTR fe));
-Lisp_Object w32font_list_internal P_ ((Lisp_Object frame,
- Lisp_Object font_spec,
- int opentype_only));
-Lisp_Object w32font_match_internal P_ ((Lisp_Object frame,
- Lisp_Object font_spec,
- int opentype_only));
-int w32font_open_internal P_ ((FRAME_PTR f, Lisp_Object font_entity,
- int pixel_size, Lisp_Object font_object));
-void w32font_close P_ ((FRAME_PTR f, struct font *font));
-int w32font_has_char P_ ((Lisp_Object entity, int c));
-int w32font_text_extents P_ ((struct font *font, unsigned *code, int nglyphs,
- struct font_metrics *metrics));
-int w32font_draw P_ ((struct glyph_string *s, int from, int to,
- int x, int y, int with_background));
-
-
-int uniscribe_check_otf P_ ((LOGFONT *font, Lisp_Object otf_spec));
-
-Lisp_Object intern_font_name P_ ((char *));
+Lisp_Object w32font_get_cache (FRAME_PTR fe);
+Lisp_Object w32font_list_internal (Lisp_Object frame,
+ Lisp_Object font_spec,
+ int opentype_only);
+Lisp_Object w32font_match_internal (Lisp_Object frame,
+ Lisp_Object font_spec,
+ int opentype_only);
+int w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity,
+ int pixel_size, Lisp_Object font_object);
+void w32font_close (FRAME_PTR f, struct font *font);
+int w32font_has_char (Lisp_Object entity, int c);
+int w32font_text_extents (struct font *font, unsigned *code, int nglyphs,
+ struct font_metrics *metrics);
+int w32font_draw (struct glyph_string *s, int from, int to,
+ int x, int y, int with_background);
+
+
+int uniscribe_check_otf (LOGFONT *font, Lisp_Object otf_spec);
+
+Lisp_Object intern_font_name (char *);
#endif
diff --git a/src/w32heap.c b/src/w32heap.c
index 440388c6eab..e307694a563 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -222,7 +222,7 @@ sbrk (unsigned long increment)
was allocated by something else; GNU malloc detects when there is a
jump in the sbrk values, and starts a new heap block. */
void
-init_heap ()
+init_heap (void)
{
PIMAGE_DOS_HEADER dos_header;
PIMAGE_NT_HEADERS nt_header;
diff --git a/src/w32inevt.c b/src/w32inevt.c
index 864b3b3f0bb..1ab0546d44f 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -582,8 +582,8 @@ w32_console_mouse_position (FRAME_PTR *f,
*part = 0;
SELECTED_FRAME ()->mouse_moved = 0;
- XSETINT(*x, movement_pos.X);
- XSETINT(*y, movement_pos.Y);
+ XSETINT (*x, movement_pos.X);
+ XSETINT (*y, movement_pos.Y);
*time = movement_time;
UNBLOCK_INPUT;
@@ -684,7 +684,7 @@ resize_event (WINDOW_BUFFER_SIZE_RECORD *event)
}
static void
-maybe_generate_resize_event ()
+maybe_generate_resize_event (void)
{
CONSOLE_SCREEN_BUFFER_INFO info;
FRAME_PTR f = get_frame ();
diff --git a/src/w32menu.c b/src/w32menu.c
index 73fba8108c6..e96b70b59dc 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -59,8 +59,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
HMENU current_popup_menu;
-void syms_of_w32menu ();
-void globals_of_w32menu ();
+void syms_of_w32menu (void);
+void globals_of_w32menu (void);
typedef BOOL (WINAPI * GetMenuItemInfoA_Proc) (
IN HMENU,
@@ -90,16 +90,16 @@ extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
extern Lisp_Object Qmenu_bar_update_hook;
-void set_frame_menubar P_ ((FRAME_PTR, int, int));
+void set_frame_menubar (FRAME_PTR, int, int);
#ifdef HAVE_DIALOGS
-static Lisp_Object w32_dialog_show P_ ((FRAME_PTR, int, Lisp_Object, char**));
+static Lisp_Object w32_dialog_show (FRAME_PTR, int, Lisp_Object, char**);
#else
-static int is_simple_dialog P_ ((Lisp_Object));
-static Lisp_Object simple_dialog_show P_ ((FRAME_PTR, Lisp_Object, Lisp_Object));
+static int is_simple_dialog (Lisp_Object);
+static Lisp_Object simple_dialog_show (FRAME_PTR, Lisp_Object, Lisp_Object);
#endif
-void w32_free_menu_strings P_((HWND));
+void w32_free_menu_strings (HWND);
/* This is set nonzero after the user activates the menu bar, and set
@@ -116,8 +116,7 @@ int pending_menu_activation;
ID, or 0 if none. */
static struct frame *
-menubar_id_to_frame (id)
- HMENU id;
+menubar_id_to_frame (HMENU id)
{
Lisp_Object tail, frame;
FRAME_PTR f;
@@ -157,8 +156,7 @@ on the left of the dialog box and all following items on the right.
If HEADER is non-nil, the frame title for the box is "Information",
otherwise it is "Question". */)
- (position, contents, header)
- Lisp_Object position, contents, header;
+ (Lisp_Object position, Lisp_Object contents, Lisp_Object header)
{
FRAME_PTR f = NULL;
Lisp_Object window;
@@ -276,8 +274,7 @@ otherwise it is "Question". */)
This way we can safely execute Lisp code. */
void
-x_activate_menubar (f)
- FRAME_PTR f;
+x_activate_menubar (FRAME_PTR f)
{
set_frame_menubar (f, 0, 1);
@@ -386,10 +383,7 @@ menubar_selection_callback (FRAME_PTR f, void * client_data)
it is set the first time this is called, from initialize_frame_menubar. */
void
-set_frame_menubar (f, first_time, deep_p)
- FRAME_PTR f;
- int first_time;
- int deep_p;
+set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
{
HMENU menubar_widget = f->output_data.w32->menubar_widget;
Lisp_Object items;
@@ -455,8 +449,8 @@ set_frame_menubar (f, first_time, deep_p)
/* Save the frame's previous menu bar contents data. */
if (previous_menu_items_used)
- bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items,
- previous_menu_items_used * sizeof (Lisp_Object));
+ memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents,
+ previous_menu_items_used * sizeof (Lisp_Object));
/* Fill in menu_items with the current menu bar contents.
This can evaluate Lisp code. */
@@ -648,8 +642,7 @@ set_frame_menubar (f, first_time, deep_p)
is visible. */
void
-initialize_frame_menubar (f)
- FRAME_PTR f;
+initialize_frame_menubar (FRAME_PTR f)
{
/* This function is called before the first chance to redisplay
the frame. It has to be, so the frame will have the right size. */
@@ -661,8 +654,7 @@ initialize_frame_menubar (f)
This is used when deleting a frame, and when turning off the menu bar. */
void
-free_frame_menubar (f)
- FRAME_PTR f;
+free_frame_menubar (FRAME_PTR f)
{
BLOCK_INPUT;
@@ -1020,11 +1012,9 @@ static char * button_names [] = {
"button6", "button7", "button8", "button9", "button10" };
static Lisp_Object
-w32_dialog_show (f, keymaps, title, header, error)
- FRAME_PTR f;
- int keymaps;
- Lisp_Object title, header;
- char **error;
+w32_dialog_show (FRAME_PTR f, int keymaps,
+ Lisp_Object title, Lisp_Object header,
+ char **error)
{
int i, nb_buttons=0;
char dialog_name[6];
@@ -1127,7 +1117,7 @@ w32_dialog_show (f, keymaps, title, header, error)
/* Frame title: 'Q' = Question, 'I' = Information.
Can also have 'E' = Error if, one day, we want
a popup for errors. */
- if (NILP(header))
+ if (NILP (header))
dialog_name[0] = 'Q';
else
dialog_name[0] = 'I';
@@ -1213,8 +1203,8 @@ w32_dialog_show (f, keymaps, title, header, error)
anywhere in Emacs that uses the other specific dialog choices that
MessageBox provides. */
-static int is_simple_dialog (contents)
- Lisp_Object contents;
+static int
+is_simple_dialog (Lisp_Object contents)
{
Lisp_Object options = XCDR (contents);
Lisp_Object name, yes, no, other;
@@ -1249,9 +1239,8 @@ static int is_simple_dialog (contents)
return !(CONSP (options));
}
-static Lisp_Object simple_dialog_show (f, contents, header)
- FRAME_PTR f;
- Lisp_Object contents, header;
+static Lisp_Object
+simple_dialog_show (FRAME_PTR f, Lisp_Object contents, Lisp_Object header)
{
int answer;
UINT type;
@@ -1315,8 +1304,7 @@ static Lisp_Object simple_dialog_show (f, contents, header)
/* Is this item a separator? */
static int
-name_is_separator (name)
- char *name;
+name_is_separator (char *name)
{
char *start = name;
@@ -1533,7 +1521,7 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
if (set_menu_item_info)
{
MENUITEMINFO info;
- bzero (&info, sizeof (info));
+ memset (&info, 0, sizeof (info));
info.cbSize = sizeof (info);
info.fMask = MIIM_DATA;
@@ -1616,7 +1604,7 @@ w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags)
{
MENUITEMINFO info;
- bzero (&info, sizeof (info));
+ memset (&info, 0, sizeof (info));
info.cbSize = sizeof (info);
info.fMask = MIIM_DATA;
get_menu_item_info (menu, item, FALSE, &info);
@@ -1647,14 +1635,13 @@ w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags)
/* Free memory used by owner-drawn strings. */
static void
-w32_free_submenu_strings (menu)
- HMENU menu;
+w32_free_submenu_strings (HMENU menu)
{
int i, num = GetMenuItemCount (menu);
for (i = 0; i < num; i++)
{
MENUITEMINFO info;
- bzero (&info, sizeof (info));
+ memset (&info, 0, sizeof (info));
info.cbSize = sizeof (info);
info.fMask = MIIM_DATA | MIIM_TYPE | MIIM_SUBMENU;
@@ -1676,8 +1663,7 @@ w32_free_submenu_strings (menu)
}
void
-w32_free_menu_strings (hwnd)
- HWND hwnd;
+w32_free_menu_strings (HWND hwnd)
{
HMENU menu = current_popup_menu;
@@ -1701,7 +1687,7 @@ w32_free_menu_strings (hwnd)
DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
doc: /* Return t if a menu or popup dialog is active on selected frame. */)
- ()
+ (void)
{
#ifdef HAVE_MENUS
FRAME_PTR f;
@@ -1712,7 +1698,8 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_
#endif /* HAVE_MENUS */
}
-void syms_of_w32menu ()
+void
+syms_of_w32menu (void)
{
globals_of_w32menu ();
@@ -1734,7 +1721,8 @@ void syms_of_w32menu ()
variable initialized is 0 and directly from main when initialized
is non zero.
*/
-void globals_of_w32menu ()
+void
+globals_of_w32menu (void)
{
/* See if Get/SetMenuItemInfo functions are available. */
HMODULE user32 = GetModuleHandle ("user32.dll");
diff --git a/src/w32proc.c b/src/w32proc.c
index b8443e5a75b..af923723709 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -46,7 +46,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <windows.h>
#ifdef __GNUC__
/* This definition is missing from mingw32 headers. */
-extern BOOL WINAPI IsValidLocale(LCID, DWORD);
+extern BOOL WINAPI IsValidLocale (LCID, DWORD);
#endif
#ifdef HAVE_LANGINFO_CODESET
@@ -117,7 +117,8 @@ extern Lisp_Object Qlocal;
Lisp_Object Qhigh, Qlow;
#ifdef EMACSDEBUG
-void _DebPrint (const char *fmt, ...)
+void
+_DebPrint (const char *fmt, ...)
{
char buf[1024];
va_list args;
@@ -129,7 +130,7 @@ void _DebPrint (const char *fmt, ...)
}
#endif
-typedef void (_CALLBACK_ *signal_handler)(int);
+typedef void (_CALLBACK_ *signal_handler) (int);
/* Signal handlers...SIG_DFL == 0 so this is initialized correctly. */
static signal_handler sig_handlers[NSIG];
@@ -175,7 +176,7 @@ new_child (void)
cp = &child_procs[child_proc_count++];
Initialise:
- memset (cp, 0, sizeof(*cp));
+ memset (cp, 0, sizeof (*cp));
cp->fd = -1;
cp->pid = -1;
cp->procinfo.hProcess = NULL;
@@ -398,7 +399,7 @@ create_child (char *exe, char *cmdline, char *env, int is_gui_app,
return TRUE;
EH_Fail:
- DebPrint (("create_child.CreateProcess failed: %ld\n", GetLastError()););
+ DebPrint (("create_child.CreateProcess failed: %ld\n", GetLastError ()););
return FALSE;
}
@@ -608,7 +609,10 @@ get_result:
#endif
void
-w32_executable_type (char * filename, int * is_dos_app, int * is_cygnus_app, int * is_gui_app)
+w32_executable_type (char * filename,
+ int * is_dos_app,
+ int * is_cygnus_app,
+ int * is_gui_app)
{
file_data executable;
char * p;
@@ -1719,8 +1723,7 @@ also loaded immediately if not already loaded. If winsock is loaded,
the winsock local hostname is returned (since this may be different from
the value of `system-name' and should supplant it), otherwise t is
returned to indicate winsock support is present. */)
- (load_now)
- Lisp_Object load_now;
+ (Lisp_Object load_now)
{
int have_winsock;
@@ -1751,7 +1754,7 @@ DEFUN ("w32-unload-winsock", Fw32_unload_winsock, Sw32_unload_winsock,
This is provided to allow dial-up socket connections to be disconnected
when no longer needed. Returns nil without unloading winsock if any
socket connections still exist. */)
- ()
+ (void)
{
return term_winsock () ? Qt : Qnil;
}
@@ -1766,8 +1769,7 @@ DEFUN ("w32-short-file-name", Fw32_short_file_name, Sw32_short_file_name, 1, 1,
doc: /* Return the short file name version (8.3) of the full path of FILENAME.
If FILENAME does not exist, return nil.
All path elements in FILENAME are converted to their short names. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
char shortname[MAX_PATH];
@@ -1791,8 +1793,7 @@ DEFUN ("w32-long-file-name", Fw32_long_file_name, Sw32_long_file_name,
doc: /* Return the long file name version of the full path of FILENAME.
If FILENAME does not exist, return nil.
All path elements in FILENAME are converted to their long names. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
char longname[ MAX_PATH ];
int drive_only = 0;
@@ -1829,8 +1830,7 @@ PRIORITY should be one of the symbols high, normal, or low;
any other symbol will be interpreted as normal.
If successful, the return value is t, otherwise nil. */)
- (process, priority)
- Lisp_Object process, priority;
+ (Lisp_Object process, Lisp_Object priority)
{
HANDLE proc_handle = GetCurrentProcess ();
DWORD priority_class = NORMAL_PRIORITY_CLASS;
@@ -1875,7 +1875,8 @@ If successful, the return value is t, otherwise nil. */)
#ifdef HAVE_LANGINFO_CODESET
/* Emulation of nl_langinfo. Used in fns.c:Flocale_info. */
-char *nl_langinfo (nl_item item)
+char *
+nl_langinfo (nl_item item)
{
/* Conversion of Posix item numbers to their Windows equivalents. */
static const LCTYPE w32item[] = {
@@ -1951,8 +1952,7 @@ is a number, it is interpreted as an LCTYPE constant and the corresponding
locale information is returned.
If LCID (a 16-bit number) is not a valid locale, the result is nil. */)
- (lcid, longform)
- Lisp_Object lcid, longform;
+ (Lisp_Object lcid, Lisp_Object longform)
{
int got_abbrev;
int got_full;
@@ -1998,18 +1998,19 @@ DEFUN ("w32-get-current-locale-id", Fw32_get_current_locale_id,
doc: /* Return Windows locale id for current locale setting.
This is a numerical value; use `w32-get-locale-info' to convert to a
human-readable form. */)
- ()
+ (void)
{
return make_number (GetThreadLocale ());
}
-DWORD int_from_hex (char * s)
+DWORD
+int_from_hex (char * s)
{
DWORD val = 0;
static char hex[] = "0123456789abcdefABCDEF";
char * p;
- while (*s && (p = strchr(hex, *s)) != NULL)
+ while (*s && (p = strchr (hex, *s)) != NULL)
{
unsigned digit = p - hex;
if (digit > 15)
@@ -2024,7 +2025,8 @@ DWORD int_from_hex (char * s)
function isn't given a context pointer. */
Lisp_Object Vw32_valid_locale_ids;
-BOOL CALLBACK enum_locale_fn (LPTSTR localeNum)
+BOOL CALLBACK
+enum_locale_fn (LPTSTR localeNum)
{
DWORD id = int_from_hex (localeNum);
Vw32_valid_locale_ids = Fcons (make_number (id), Vw32_valid_locale_ids);
@@ -2036,7 +2038,7 @@ DEFUN ("w32-get-valid-locale-ids", Fw32_get_valid_locale_ids,
doc: /* Return list of all valid Windows locale ids.
Each id is a numerical value; use `w32-get-locale-info' to convert to a
human-readable form. */)
- ()
+ (void)
{
Vw32_valid_locale_ids = Qnil;
@@ -2053,8 +2055,7 @@ By default, the system default locale setting is returned; if the optional
parameter USERP is non-nil, the user default locale setting is returned.
This is a numerical value; use `w32-get-locale-info' to convert to a
human-readable form. */)
- (userp)
- Lisp_Object userp;
+ (Lisp_Object userp)
{
if (NILP (userp))
return make_number (GetSystemDefaultLCID ());
@@ -2065,8 +2066,7 @@ human-readable form. */)
DEFUN ("w32-set-current-locale", Fw32_set_current_locale, Sw32_set_current_locale, 1, 1, 0,
doc: /* Make Windows locale LCID be the current locale setting for Emacs.
If successful, the new locale id is returned, otherwise nil. */)
- (lcid)
- Lisp_Object lcid;
+ (Lisp_Object lcid)
{
CHECK_NUMBER (lcid);
@@ -2089,7 +2089,8 @@ If successful, the new locale id is returned, otherwise nil. */)
function isn't given a context pointer. */
Lisp_Object Vw32_valid_codepages;
-BOOL CALLBACK enum_codepage_fn (LPTSTR codepageNum)
+BOOL CALLBACK
+enum_codepage_fn (LPTSTR codepageNum)
{
DWORD id = atoi (codepageNum);
Vw32_valid_codepages = Fcons (make_number (id), Vw32_valid_codepages);
@@ -2099,7 +2100,7 @@ BOOL CALLBACK enum_codepage_fn (LPTSTR codepageNum)
DEFUN ("w32-get-valid-codepages", Fw32_get_valid_codepages,
Sw32_get_valid_codepages, 0, 0, 0,
doc: /* Return list of all valid Windows codepages. */)
- ()
+ (void)
{
Vw32_valid_codepages = Qnil;
@@ -2113,7 +2114,7 @@ DEFUN ("w32-get-valid-codepages", Fw32_get_valid_codepages,
DEFUN ("w32-get-console-codepage", Fw32_get_console_codepage,
Sw32_get_console_codepage, 0, 0, 0,
doc: /* Return current Windows codepage for console input. */)
- ()
+ (void)
{
return make_number (GetConsoleCP ());
}
@@ -2124,8 +2125,7 @@ DEFUN ("w32-set-console-codepage", Fw32_set_console_codepage,
doc: /* Make Windows codepage CP be the current codepage setting for Emacs.
The codepage setting affects keyboard input and display in tty mode.
If successful, the new CP is returned, otherwise nil. */)
- (cp)
- Lisp_Object cp;
+ (Lisp_Object cp)
{
CHECK_NUMBER (cp);
@@ -2142,7 +2142,7 @@ If successful, the new CP is returned, otherwise nil. */)
DEFUN ("w32-get-console-output-codepage", Fw32_get_console_output_codepage,
Sw32_get_console_output_codepage, 0, 0, 0,
doc: /* Return current Windows codepage for console output. */)
- ()
+ (void)
{
return make_number (GetConsoleOutputCP ());
}
@@ -2153,8 +2153,7 @@ DEFUN ("w32-set-console-output-codepage", Fw32_set_console_output_codepage,
doc: /* Make Windows codepage CP be the current codepage setting for Emacs.
The codepage setting affects keyboard input and display in tty mode.
If successful, the new CP is returned, otherwise nil. */)
- (cp)
- Lisp_Object cp;
+ (Lisp_Object cp)
{
CHECK_NUMBER (cp);
@@ -2172,8 +2171,7 @@ DEFUN ("w32-get-codepage-charset", Fw32_get_codepage_charset,
Sw32_get_codepage_charset, 1, 1, 0,
doc: /* Return charset of codepage CP.
Returns nil if the codepage is not valid. */)
- (cp)
- Lisp_Object cp;
+ (Lisp_Object cp)
{
CHARSETINFO info;
@@ -2193,7 +2191,7 @@ DEFUN ("w32-get-valid-keyboard-layouts", Fw32_get_valid_keyboard_layouts,
Sw32_get_valid_keyboard_layouts, 0, 0, 0,
doc: /* Return list of Windows keyboard languages and layouts.
The return value is a list of pairs of language id and layout id. */)
- ()
+ (void)
{
int num_layouts = GetKeyboardLayoutList (0, NULL);
HKL * layouts = (HKL *) alloca (num_layouts * sizeof (HKL));
@@ -2219,7 +2217,7 @@ DEFUN ("w32-get-keyboard-layout", Fw32_get_keyboard_layout,
Sw32_get_keyboard_layout, 0, 0, 0,
doc: /* Return current Windows keyboard language and layout.
The return value is the cons of the language id and the layout id. */)
- ()
+ (void)
{
DWORD kl = (DWORD) GetKeyboardLayout (dwWindowsThreadId);
@@ -2233,8 +2231,7 @@ DEFUN ("w32-set-keyboard-layout", Fw32_set_keyboard_layout,
doc: /* Make LAYOUT be the current keyboard layout for Emacs.
The keyboard layout setting affects interpretation of keyboard input.
If successful, the new layout id is returned, otherwise nil. */)
- (layout)
- Lisp_Object layout;
+ (Lisp_Object layout)
{
DWORD kl;
@@ -2265,7 +2262,8 @@ If successful, the new layout id is returned, otherwise nil. */)
}
-syms_of_ntproc ()
+void
+syms_of_ntproc (void)
{
DEFSYM (Qhigh, "high");
DEFSYM (Qlow, "low");
diff --git a/src/w32reg.c b/src/w32reg.c
index f9687d1effe..77667eb7dc9 100644
--- a/src/w32reg.c
+++ b/src/w32reg.c
@@ -58,9 +58,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
*/
static char *
-w32_get_rdb_resource (rdb, resource)
- char *rdb;
- char *resource;
+w32_get_rdb_resource (char *rdb, char *resource)
{
char *value = rdb;
int len = strlen (resource);
@@ -78,9 +76,7 @@ w32_get_rdb_resource (rdb, resource)
}
static LPBYTE
-w32_get_string_resource (name, class, dwexptype)
- char *name, *class;
- DWORD dwexptype;
+w32_get_string_resource (char *name, char *class, DWORD dwexptype)
{
LPBYTE lpvalue = NULL;
HKEY hrootkey = NULL;
@@ -147,9 +143,7 @@ w32_get_string_resource (name, class, dwexptype)
database RDB. */
char *
-x_get_string_resource (rdb, name, class)
- XrmDatabase rdb;
- char *name, *class;
+x_get_string_resource (XrmDatabase rdb, char *name, char *class)
{
if (rdb)
{
diff --git a/src/w32select.c b/src/w32select.c
index 2da4b333c2a..8482d3331ff 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -30,7 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
* (CF_UNICODETEXT), when a well-known console codepage is given, they
* apply to the console version of the clipboard data (CF_OEMTEXT),
* else they apply to the normal 8-bit text clipboard (CF_TEXT).
- *
+ *
* When pasting (getting data from the OS), the clipboard format that
* matches the {next-}selection-coding-system is retrieved. If
* Unicode is requested, but not available, 8-bit text (CF_TEXT) is
@@ -45,13 +45,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
*
* Scenarios to use the facilities for customizing the selection
* coding system are:
- *
+ *
* ;; Generally use KOI8-R instead of the russian MS codepage for
* ;; the 8-bit clipboard.
* (set-selection-coding-system 'koi8-r-dos)
- *
+ *
* Or
- *
+ *
* ;; Create a special clipboard copy function that uses codepage
* ;; 1253 (Greek) to copy Greek text to a specific non-Unicode
* ;; application.
@@ -71,7 +71,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
* types should be supported is also moved to Lisp, functionality
* could be expanded to CF_HTML, CF_RTF and maybe other types.
*/
-
+
#include <config.h>
#include <setjmp.h>
#include "lisp.h"
@@ -89,8 +89,8 @@ static HGLOBAL convert_to_handle_as_ascii (void);
static HGLOBAL convert_to_handle_as_coded (Lisp_Object coding_system);
static Lisp_Object render (Lisp_Object oformat);
static Lisp_Object render_locale (void);
-static Lisp_Object render_all (void);
-static void run_protected (Lisp_Object (*code) (), Lisp_Object arg);
+static Lisp_Object render_all (Lisp_Object ignore);
+static void run_protected (Lisp_Object (*code) (Lisp_Object), Lisp_Object arg);
static Lisp_Object lisp_error_handler (Lisp_Object error);
static LRESULT CALLBACK owner_callback (HWND win, UINT msg,
WPARAM wp, LPARAM lp);
@@ -220,11 +220,11 @@ convert_to_handle_as_coded (Lisp_Object coding_system)
unsigned char *dst = NULL;
struct coding_system coding;
- ONTRACE (fprintf (stderr, "convert_to_handle_as_coded: %s\n",
+ ONTRACE (fprintf (stderr, "convert_to_handle_as_coded: %s\n",
SDATA (SYMBOL_NAME (coding_system))));
setup_windows_coding_system (coding_system, &coding);
- coding.dst_bytes = SBYTES(current_text) * 2;
+ coding.dst_bytes = SBYTES (current_text) * 2;
coding.destination = (unsigned char *) xmalloc (coding.dst_bytes);
encode_coding_object (&coding, current_text, 0, 0,
SCHARS (current_text), SBYTES (current_text), Qnil);
@@ -290,7 +290,7 @@ render (Lisp_Object oformat)
if (SetClipboardData (format, htext) == NULL)
{
- GlobalFree(htext);
+ GlobalFree (htext);
return Qnil;
}
@@ -314,7 +314,7 @@ render_locale (void)
if ((lcid_ptr = (LCID *) GlobalLock (hlocale)) == NULL)
{
- GlobalFree(hlocale);
+ GlobalFree (hlocale);
return Qnil;
}
@@ -323,7 +323,7 @@ render_locale (void)
if (SetClipboardData (CF_LOCALE, hlocale) == NULL)
{
- GlobalFree(hlocale);
+ GlobalFree (hlocale);
return Qnil;
}
@@ -334,7 +334,7 @@ render_locale (void)
data survives us. This code will do that. */
static Lisp_Object
-render_all (void)
+render_all (Lisp_Object ignore)
{
ONTRACE (fprintf (stderr, "render_all\n"));
@@ -380,7 +380,7 @@ render_all (void)
automatic conversions anywhere else, so to get consistent
results, we probably don't want to rely on it here either. */
- render_locale();
+ render_locale ();
if (current_clipboard_type == CF_UNICODETEXT)
render (make_number (CF_TEXT));
@@ -392,7 +392,7 @@ render_all (void)
}
static void
-run_protected (Lisp_Object (*code) (), Lisp_Object arg)
+run_protected (Lisp_Object (*code) (Lisp_Object), Lisp_Object arg)
{
/* FIXME: This works but it doesn't feel right. Too much fiddling
with global variables and calling strange looking functions. Is
@@ -514,7 +514,7 @@ setup_config (void)
&& EQ (cfg_coding_system, dos_coding_system))
return;
cfg_coding_system = dos_coding_system;
-
+
/* Set some sensible fallbacks */
cfg_codepage = ANSICP;
cfg_lcid = LOCALE_NEUTRAL;
@@ -583,7 +583,7 @@ enum_locale_callback (/*const*/ char* loc_string)
cfg_clipboard_type = CF_TEXT;
return FALSE; /* Stop enumeration */
}
-
+
/* Is the wanted codepage the OEM codepage for this locale? */
codepage = cp_from_locale (lcid, CF_OEMTEXT);
if (codepage == cfg_codepage)
@@ -681,8 +681,7 @@ setup_windows_coding_system (Lisp_Object coding_system,
DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
Sw32_set_clipboard_data, 1, 2, 0,
doc: /* This sets the clipboard data to the given text. */)
- (string, ignored)
- Lisp_Object string, ignored;
+ (Lisp_Object string, Lisp_Object ignored)
{
BOOL ok = TRUE;
int nbytes;
@@ -704,7 +703,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
current_lcid = cfg_lcid;
current_num_nls = 0;
current_requires_encoding = 0;
-
+
BLOCK_INPUT;
/* Check for non-ASCII characters. While we are at it, count the
@@ -744,7 +743,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
/* If we have something non-ASCII we may want to set a locale. We
do that directly (non-delayed), as it's just a small bit. */
if (ok)
- ok = !NILP(render_locale());
+ ok = !NILP (render_locale ());
if (ok)
{
@@ -753,7 +752,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
/* If for some reason we don't have a clipboard_owner, we
just set the text format as chosen by the configuration
and than forget about the whole thing. */
- ok = !NILP(render (make_number (current_clipboard_type)));
+ ok = !NILP (render (make_number (current_clipboard_type)));
current_text = Qnil;
current_coding_system = Qnil;
}
@@ -802,8 +801,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
Sw32_get_clipboard_data, 0, 1, 0,
doc: /* This gets the clipboard data in text format. */)
- (ignored)
- Lisp_Object ignored;
+ (Lisp_Object ignored)
{
HGLOBAL htext;
Lisp_Object ret = Qnil;
@@ -884,7 +882,7 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
struct coding_system coding;
Lisp_Object coding_system = Qnil;
Lisp_Object dos_coding_system;
-
+
/* `next-selection-coding-system' should override everything,
even when the locale passed by the system disagrees. The
only exception is when `next-selection-coding-system'
@@ -1027,8 +1025,7 @@ the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
\(Those are literal upper-case symbol names, since that's what X expects.)
For convenience, the symbol nil is the same as `PRIMARY',
and t is the same as `SECONDARY'. */)
- (selection)
- Lisp_Object selection;
+ (Lisp_Object selection)
{
CHECK_SYMBOL (selection);
@@ -1065,7 +1062,7 @@ and t is the same as `SECONDARY'. */)
dumped version. */
void
-syms_of_w32select ()
+syms_of_w32select (void)
{
defsubr (&Sw32_set_clipboard_data);
defsubr (&Sw32_get_clipboard_data);
@@ -1076,7 +1073,7 @@ syms_of_w32select ()
When sending or receiving text via cut_buffer, selection, and
clipboard, the text is encoded or decoded by this coding system.
The default value is the current system default encoding on 9x/Me and
-`utf-16le-dos' (Unicode) on NT/W2K/XP. */);
+`utf-16le-dos' (Unicode) on NT/W2K/XP. */);
/* The actual value is set dynamically in the dumped Emacs, see
below. */
Vselection_coding_system = Qnil;
@@ -1104,7 +1101,7 @@ set to nil. */);
un-dumped version. */
void
-globals_of_w32select ()
+globals_of_w32select (void)
{
DEFAULT_LCID = GetUserDefaultLCID ();
/* Drop the sort order from the LCID, so we can compare this with
diff --git a/src/w32term.c b/src/w32term.c
index 0b71b7e02b7..abd7843c2ef 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -96,7 +96,7 @@ int x_underline_at_descent_line;
extern unsigned int msh_mousewheel;
-extern void free_frame_menubar ();
+extern void free_frame_menubar (struct frame *);
extern int w32_codepage_for_font (char *fontname);
extern Cursor w32_load_cursor (LPCTSTR name);
@@ -234,43 +234,43 @@ extern EMACS_INT extra_keyboard_modifiers;
/* Keyboard code page - may be changed by language-change events. */
static int keyboard_codepage;
-static void x_update_window_end P_ ((struct window *, int, int));
-static void w32_handle_tool_bar_click P_ ((struct frame *,
- struct input_event *));
-static void w32_define_cursor P_ ((Window, Cursor));
-
-void x_lower_frame P_ ((struct frame *));
-void x_scroll_bar_clear P_ ((struct frame *));
-void x_wm_set_size_hint P_ ((struct frame *, long, int));
-void x_raise_frame P_ ((struct frame *));
-void x_set_window_size P_ ((struct frame *, int, int, int));
-void x_wm_set_window_state P_ ((struct frame *, int));
-void x_wm_set_icon_pixmap P_ ((struct frame *, int));
-static void w32_initialize P_ ((void));
-static void x_update_end P_ ((struct frame *));
-static void w32_frame_up_to_date P_ ((struct frame *));
-static void w32_set_terminal_modes P_ ((struct terminal *));
-static void w32_reset_terminal_modes P_ ((struct terminal *));
-static void x_clear_frame P_ ((struct frame *));
-static void frame_highlight P_ ((struct frame *));
-static void frame_unhighlight P_ ((struct frame *));
-static void x_new_focus_frame P_ ((struct w32_display_info *,
- struct frame *));
-static void x_focus_changed P_ ((int, int, struct w32_display_info *,
- struct frame *, struct input_event *));
-static void w32_detect_focus_change P_ ((struct w32_display_info *,
- W32Msg *, struct input_event *));
-static void w32_frame_rehighlight P_ ((struct frame *));
-static void x_frame_rehighlight P_ ((struct w32_display_info *));
-static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
-static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int,
- enum text_cursor_kinds));
-static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, int, HDC));
-static BOOL my_show_window P_ ((struct frame *, HWND, int));
-static void my_set_window_pos P_ ((HWND, HWND, int, int, int, int, UINT));
-static void my_set_focus P_ ((struct frame *, HWND));
-static void my_set_foreground_window P_ ((HWND));
-static void my_destroy_window P_ ((struct frame *, HWND));
+static void x_update_window_end (struct window *, int, int);
+static void w32_handle_tool_bar_click (struct frame *,
+ struct input_event *);
+static void w32_define_cursor (Window, Cursor);
+
+void x_lower_frame (struct frame *);
+void x_scroll_bar_clear (struct frame *);
+void x_wm_set_size_hint (struct frame *, long, int);
+void x_raise_frame (struct frame *);
+void x_set_window_size (struct frame *, int, int, int);
+void x_wm_set_window_state (struct frame *, int);
+void x_wm_set_icon_pixmap (struct frame *, int);
+static void w32_initialize (void);
+static void x_update_end (struct frame *);
+static void w32_frame_up_to_date (struct frame *);
+static void w32_set_terminal_modes (struct terminal *);
+static void w32_reset_terminal_modes (struct terminal *);
+static void x_clear_frame (struct frame *);
+static void frame_highlight (struct frame *);
+static void frame_unhighlight (struct frame *);
+static void x_new_focus_frame (struct w32_display_info *,
+ struct frame *);
+static void x_focus_changed (int, int, struct w32_display_info *,
+ struct frame *, struct input_event *);
+static void w32_detect_focus_change (struct w32_display_info *,
+ W32Msg *, struct input_event *);
+static void w32_frame_rehighlight (struct frame *);
+static void x_frame_rehighlight (struct w32_display_info *);
+static void x_draw_hollow_cursor (struct window *, struct glyph_row *);
+static void x_draw_bar_cursor (struct window *, struct glyph_row *, int,
+ enum text_cursor_kinds);
+static void w32_clip_to_row (struct window *, struct glyph_row *, int, HDC);
+static BOOL my_show_window (struct frame *, HWND, int);
+static void my_set_window_pos (HWND, HWND, int, int, int, int, UINT);
+static void my_set_focus (struct frame *, HWND);
+static void my_set_foreground_window (HWND);
+static void my_destroy_window (struct frame *, HWND);
static Lisp_Object Qvendor_specific_keysyms;
@@ -294,9 +294,7 @@ struct record event_record[100];
int event_record_index;
-record_event (locus, type)
- char *locus;
- int type;
+record_event (char *locus, int type)
{
if (event_record_index == sizeof (event_record) / sizeof (struct record))
event_record_index = 0;
@@ -310,7 +308,7 @@ record_event (locus, type)
void
-XChangeGC (void * ignore, XGCValues* gc, unsigned long mask,
+XChangeGC (void *ignore, XGCValues *gc, unsigned long mask,
XGCValues *xgcv)
{
if (mask & GCForeground)
@@ -321,11 +319,11 @@ XChangeGC (void * ignore, XGCValues* gc, unsigned long mask,
gc->font = xgcv->font;
}
-XGCValues *XCreateGC (void * ignore, Window window, unsigned long mask,
- XGCValues *xgcv)
+XGCValues *
+XCreateGC (void *ignore, Window window, unsigned long mask, XGCValues *xgcv)
{
XGCValues *gc = (XGCValues *) xmalloc (sizeof (XGCValues));
- bzero (gc, sizeof (XGCValues));
+ memset (gc, 0, sizeof (XGCValues));
XChangeGC (ignore, gc, mask, xgcv);
@@ -333,8 +331,8 @@ XGCValues *XCreateGC (void * ignore, Window window, unsigned long mask,
}
void
-XGetGCValues (void* ignore, XGCValues *gc,
- unsigned long mask, XGCValues *xgcv)
+XGetGCValues (void *ignore, XGCValues *gc,
+ unsigned long mask, XGCValues *xgcv)
{
XChangeGC (ignore, xgcv, mask, gc);
}
@@ -376,11 +374,7 @@ w32_draw_rectangle (HDC hdc, XGCValues *gc, int x, int y,
/* Draw a filled rectangle at the specified position. */
void
-w32_fill_rect (f, hdc, pix, lprect)
- FRAME_PTR f;
- HDC hdc;
- COLORREF pix;
- RECT * lprect;
+w32_fill_rect (FRAME_PTR f, HDC hdc, COLORREF pix, RECT *lprect)
{
HBRUSH hb;
@@ -390,8 +384,7 @@ w32_fill_rect (f, hdc, pix, lprect)
}
void
-w32_clear_window (f)
- FRAME_PTR f;
+w32_clear_window (FRAME_PTR f)
{
RECT rect;
HDC hdc = get_frame_dc (f);
@@ -411,8 +404,7 @@ w32_clear_window (f)
#define OPAQUE_FRAME 255
void
-x_set_frame_alpha (f)
- struct frame *f;
+x_set_frame_alpha (struct frame *f)
{
struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
double alpha = 1.0;
@@ -458,8 +450,7 @@ x_set_frame_alpha (f)
}
int
-x_display_pixel_height (dpyinfo)
- struct w32_display_info *dpyinfo;
+x_display_pixel_height (struct w32_display_info *dpyinfo)
{
HDC dc = GetDC (NULL);
int pixels = GetDeviceCaps (dc, VERTRES);
@@ -468,8 +459,7 @@ x_display_pixel_height (dpyinfo)
}
int
-x_display_pixel_width (dpyinfo)
- struct w32_display_info *dpyinfo;
+x_display_pixel_width (struct w32_display_info *dpyinfo)
{
HDC dc = GetDC (NULL);
int pixels = GetDeviceCaps (dc, HORZRES);
@@ -488,8 +478,7 @@ x_display_pixel_width (dpyinfo)
each window being updated. */
static void
-x_update_begin (f)
- struct frame *f;
+x_update_begin (struct frame *f)
{
struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f);
@@ -511,8 +500,7 @@ x_update_begin (f)
position of W. */
static void
-x_update_window_begin (w)
- struct window *w;
+x_update_window_begin (struct window *w)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f);
@@ -571,9 +559,7 @@ x_update_window_begin (w)
/* Draw a vertical window border from (x,y0) to (x,y1) */
static void
-w32_draw_vertical_window_border (w, x, y0, y1)
- struct window *w;
- int x, y0, y1;
+w32_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
RECT r;
@@ -610,9 +596,8 @@ w32_draw_vertical_window_border (w, x, y0, y1)
here. */
static void
-x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
- struct window *w;
- int cursor_on_p, mouse_face_overwritten_p;
+x_update_window_end (struct window *w, int cursor_on_p,
+ int mouse_face_overwritten_p)
{
struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (XFRAME (w->frame));
@@ -656,8 +641,7 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
update_end. */
static void
-x_update_end (f)
- struct frame *f;
+x_update_end (struct frame *f)
{
if (! FRAME_W32_P (f))
return;
@@ -672,8 +656,7 @@ x_update_end (f)
updated_window is not available here. */
static void
-w32_frame_up_to_date (f)
- struct frame *f;
+w32_frame_up_to_date (struct frame *f)
{
if (FRAME_W32_P (f))
{
@@ -702,8 +685,7 @@ w32_frame_up_to_date (f)
between bitmaps to be drawn between current row and DESIRED_ROW. */
static void
-x_after_update_window_line (desired_row)
- struct glyph_row *desired_row;
+x_after_update_window_line (struct glyph_row *desired_row)
{
struct window *w = updated_window;
struct frame *f;
@@ -749,15 +731,12 @@ x_after_update_window_line (desired_row)
drawn. */
static void
-w32_draw_fringe_bitmap (w, row, p)
- struct window *w;
- struct glyph_row *row;
- struct draw_fringe_bitmap_params *p;
+w32_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
+ struct draw_fringe_bitmap_params *p)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
HDC hdc;
struct face *face = p->face;
- int rowY;
hdc = get_frame_dc (f);
@@ -816,21 +795,7 @@ w32_draw_fringe_bitmap (w, row, p)
}
/* Must clip because of partially visible lines. */
- rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
- if (p->y < rowY)
- {
- /* Adjust position of "bottom aligned" bitmap on partially
- visible last row. */
- int oldY = row->y;
- int oldVH = row->visible_height;
- row->visible_height = p->h;
- row->y -= rowY - p->y;
- w32_clip_to_row (w, row, -1, hdc);
- row->y = oldY;
- row->visible_height = oldVH;
- }
- else
- w32_clip_to_row (w, row, -1, hdc);
+ w32_clip_to_row (w, row, -1, hdc);
if (p->which && p->which < max_fringe_bmp)
{
@@ -890,10 +855,7 @@ w32_draw_fringe_bitmap (w, row, p)
}
static void
-w32_define_fringe_bitmap (which, bits, h, wd)
- int which;
- unsigned short *bits;
- int h, wd;
+w32_define_fringe_bitmap (int which, unsigned short *bits, int h, int wd)
{
if (which >= max_fringe_bmp)
{
@@ -908,8 +870,7 @@ w32_define_fringe_bitmap (which, bits, h, wd)
}
static void
-w32_destroy_fringe_bitmap (which)
- int which;
+w32_destroy_fringe_bitmap (int which)
{
if (which >= max_fringe_bmp)
return;
@@ -947,40 +908,39 @@ w32_reset_terminal_modes (struct terminal *term)
/* Function prototypes of this page. */
-static void x_set_glyph_string_clipping P_ ((struct glyph_string *));
-static void x_set_glyph_string_gc P_ ((struct glyph_string *));
-static void x_draw_glyph_string_background P_ ((struct glyph_string *,
- int));
-static void x_draw_glyph_string_foreground P_ ((struct glyph_string *));
-static void x_draw_composite_glyph_string_foreground P_ ((struct glyph_string *));
-static void x_draw_glyph_string_box P_ ((struct glyph_string *));
-static void x_draw_glyph_string P_ ((struct glyph_string *));
-static void x_set_cursor_gc P_ ((struct glyph_string *));
-static void x_set_mode_line_face_gc P_ ((struct glyph_string *));
-static void x_set_mouse_face_gc P_ ((struct glyph_string *));
+static void x_set_glyph_string_clipping (struct glyph_string *);
+static void x_set_glyph_string_gc (struct glyph_string *);
+static void x_draw_glyph_string_background (struct glyph_string *,
+ int);
+static void x_draw_glyph_string_foreground (struct glyph_string *);
+static void x_draw_composite_glyph_string_foreground (struct glyph_string *);
+static void x_draw_glyph_string_box (struct glyph_string *);
+static void x_draw_glyph_string (struct glyph_string *);
+static void x_set_cursor_gc (struct glyph_string *);
+static void x_set_mode_line_face_gc (struct glyph_string *);
+static void x_set_mouse_face_gc (struct glyph_string *);
static int w32_alloc_lighter_color (struct frame *, COLORREF *, double, int);
-static void w32_setup_relief_color P_ ((struct frame *, struct relief *,
- double, int, COLORREF));
-static void x_setup_relief_colors P_ ((struct glyph_string *));
-static void x_draw_image_glyph_string P_ ((struct glyph_string *));
-static void x_draw_image_relief P_ ((struct glyph_string *));
-static void x_draw_image_foreground P_ ((struct glyph_string *));
-static void w32_draw_image_foreground_1 P_ ((struct glyph_string *, HBITMAP));
-static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int,
- int, int, int));
-static void w32_draw_relief_rect P_ ((struct frame *, int, int, int, int,
- int, int, int, int, int, int,
- RECT *));
-static void w32_draw_box_rect P_ ((struct glyph_string *, int, int, int, int,
- int, int, int, RECT *));
+static void w32_setup_relief_color (struct frame *, struct relief *,
+ double, int, COLORREF);
+static void x_setup_relief_colors (struct glyph_string *);
+static void x_draw_image_glyph_string (struct glyph_string *);
+static void x_draw_image_relief (struct glyph_string *);
+static void x_draw_image_foreground (struct glyph_string *);
+static void w32_draw_image_foreground_1 (struct glyph_string *, HBITMAP);
+static void x_clear_glyph_string_rect (struct glyph_string *, int,
+ int, int, int);
+static void w32_draw_relief_rect (struct frame *, int, int, int, int,
+ int, int, int, int, int, int,
+ RECT *);
+static void w32_draw_box_rect (struct glyph_string *, int, int, int, int,
+ int, int, int, RECT *);
/* Set S->gc to a suitable GC for drawing glyph string S in cursor
face. */
static void
-x_set_cursor_gc (s)
- struct glyph_string *s;
+x_set_cursor_gc (struct glyph_string *s)
{
if (s->font == FRAME_FONT (s->f)
&& s->face->background == FRAME_BACKGROUND_PIXEL (s->f)
@@ -1031,8 +991,7 @@ x_set_cursor_gc (s)
/* Set up S->gc of glyph string S for drawing text in mouse face. */
static void
-x_set_mouse_face_gc (s)
- struct glyph_string *s;
+x_set_mouse_face_gc (struct glyph_string *s)
{
int face_id;
struct face *face;
@@ -1085,8 +1044,7 @@ x_set_mouse_face_gc (s)
matrix was built, so there isn't much to do, here. */
static INLINE void
-x_set_mode_line_face_gc (s)
- struct glyph_string *s;
+x_set_mode_line_face_gc (struct glyph_string *s)
{
s->gc = s->face->gc;
}
@@ -1097,8 +1055,7 @@ x_set_mode_line_face_gc (s)
pattern. */
static INLINE void
-x_set_glyph_string_gc (s)
- struct glyph_string *s;
+x_set_glyph_string_gc (struct glyph_string *s)
{
PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
@@ -1143,8 +1100,7 @@ x_set_glyph_string_gc (s)
line or menu if we don't have X toolkit support. */
static INLINE void
-x_set_glyph_string_clipping (s)
- struct glyph_string *s;
+x_set_glyph_string_clipping (struct glyph_string *s)
{
RECT *r = s->clip;
int n = get_glyph_string_clip_rects (s, r, 2);
@@ -1172,8 +1128,8 @@ x_set_glyph_string_clipping (s)
the area of SRC. */
static void
-x_set_glyph_string_clipping_exactly (src, dst)
- struct glyph_string *src, *dst;
+x_set_glyph_string_clipping_exactly (struct glyph_string *src,
+ struct glyph_string *dst)
{
RECT r;
@@ -1190,8 +1146,7 @@ x_set_glyph_string_clipping_exactly (src, dst)
Compute left and right overhang of glyph string S. */
static void
-w32_compute_glyph_string_overhangs (s)
- struct glyph_string *s;
+w32_compute_glyph_string_overhangs (struct glyph_string *s)
{
if (s->cmp == NULL
&& s->first_glyph->type == CHAR_GLYPH
@@ -1219,9 +1174,8 @@ w32_compute_glyph_string_overhangs (s)
/* Fill rectangle X, Y, W, H with background color of glyph string S. */
static INLINE void
-x_clear_glyph_string_rect (s, x, y, w, h)
- struct glyph_string *s;
- int x, y, w, h;
+x_clear_glyph_string_rect (struct glyph_string *s,
+ int x, int y, int w, int h)
{
int real_x = x;
int real_y = y;
@@ -1251,9 +1205,7 @@ x_clear_glyph_string_rect (s, x, y, w, h)
contains the first component of a composition. */
static void
-x_draw_glyph_string_background (s, force_p)
- struct glyph_string *s;
- int force_p;
+x_draw_glyph_string_background (struct glyph_string *s, int force_p)
{
/* Nothing to do if background has already been drawn or if it
shouldn't be drawn in the first place. */
@@ -1292,8 +1244,7 @@ x_draw_glyph_string_background (s, force_p)
/* Draw the foreground of glyph string S. */
static void
-x_draw_glyph_string_foreground (s)
- struct glyph_string *s;
+x_draw_glyph_string_foreground (struct glyph_string *s)
{
int i, x;
@@ -1350,8 +1301,7 @@ x_draw_glyph_string_foreground (s)
/* Draw the foreground of composite glyph string S. */
static void
-x_draw_composite_glyph_string_foreground (s)
- struct glyph_string *s;
+x_draw_composite_glyph_string_foreground (struct glyph_string *s)
{
int i, j, x;
struct font *font = s->font;
@@ -1464,11 +1414,8 @@ x_draw_composite_glyph_string_foreground (s)
Value is non-zero if successful. */
static int
-w32_alloc_lighter_color (f, color, factor, delta)
- struct frame *f;
- COLORREF *color;
- double factor;
- int delta;
+w32_alloc_lighter_color (struct frame *f, COLORREF *color,
+ double factor, int delta)
{
COLORREF new;
long bright;
@@ -1527,10 +1474,7 @@ w32_alloc_lighter_color (f, color, factor, delta)
colors in COLORS. On W32, we no longer try to map colors to
a palette. */
void
-x_query_colors (f, colors, ncolors)
- struct frame *f;
- XColor *colors;
- int ncolors;
+x_query_colors (struct frame *f, XColor *colors, int ncolors)
{
int i;
@@ -1545,9 +1489,7 @@ x_query_colors (f, colors, ncolors)
}
void
-x_query_color (f, color)
- struct frame *f;
- XColor *color;
+x_query_color (struct frame *f, XColor *color)
{
x_query_colors (f, color, 1);
}
@@ -1561,12 +1503,8 @@ x_query_color (f, color)
be allocated, use DEFAULT_PIXEL, instead. */
static void
-w32_setup_relief_color (f, relief, factor, delta, default_pixel)
- struct frame *f;
- struct relief *relief;
- double factor;
- int delta;
- COLORREF default_pixel;
+w32_setup_relief_color (struct frame *f, struct relief *relief, double factor,
+ int delta, COLORREF default_pixel)
{
XGCValues xgcv;
struct w32_output *di = f->output_data.w32;
@@ -1602,8 +1540,7 @@ w32_setup_relief_color (f, relief, factor, delta, default_pixel)
/* Set up colors for the relief lines around glyph string S. */
static void
-x_setup_relief_colors (s)
- struct glyph_string *s;
+x_setup_relief_colors (struct glyph_string *s)
{
struct w32_output *di = s->f->output_data.w32;
COLORREF color;
@@ -1638,12 +1575,10 @@ x_setup_relief_colors (s)
when drawing. */
static void
-w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
- raised_p, top_p, bot_p, left_p, right_p, clip_rect)
- struct frame *f;
- int left_x, top_y, right_x, bottom_y, width;
- int top_p, bot_p, left_p, right_p, raised_p;
- RECT *clip_rect;
+w32_draw_relief_rect (struct frame *f,
+ int left_x, int top_y, int right_x, int bottom_y, int width,
+ int raised_p, int top_p, int bot_p, int left_p, int right_p,
+ RECT *clip_rect)
{
int i;
XGCValues gc;
@@ -1703,11 +1638,9 @@ w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
rectangle to use when drawing. */
static void
-w32_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
- left_p, right_p, clip_rect)
- struct glyph_string *s;
- int left_x, top_y, right_x, bottom_y, width, left_p, right_p;
- RECT *clip_rect;
+w32_draw_box_rect (struct glyph_string *s,
+ int left_x, int top_y, int right_x, int bottom_y, int width,
+ int left_p, int right_p, RECT *clip_rect)
{
w32_set_clip_rectangle (s->hdc, clip_rect);
@@ -1740,8 +1673,7 @@ w32_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
/* Draw a box around glyph string S. */
static void
-x_draw_glyph_string_box (s)
- struct glyph_string *s;
+x_draw_glyph_string_box (struct glyph_string *s)
{
int width, left_x, right_x, top_y, bottom_y, last_x, raised_p;
int left_p, right_p;
@@ -1792,8 +1724,7 @@ x_draw_glyph_string_box (s)
/* Draw foreground of image glyph string S. */
static void
-x_draw_image_foreground (s)
- struct glyph_string *s;
+x_draw_image_foreground (struct glyph_string *s)
{
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
@@ -1883,8 +1814,7 @@ x_draw_image_foreground (s)
/* Draw a relief around the image glyph string S. */
static void
-x_draw_image_relief (s)
- struct glyph_string *s;
+x_draw_image_relief (struct glyph_string *s)
{
int x0, y0, x1, y1, thick, raised_p;
RECT r;
@@ -1936,9 +1866,7 @@ x_draw_image_relief (s)
/* Draw the foreground of image glyph string S to PIXMAP. */
static void
-w32_draw_image_foreground_1 (s, pixmap)
- struct glyph_string *s;
- HBITMAP pixmap;
+w32_draw_image_foreground_1 (struct glyph_string *s, HBITMAP pixmap)
{
HDC hdc = CreateCompatibleDC (s->hdc);
HGDIOBJ orig_hdc_obj = SelectObject (hdc, pixmap);
@@ -2025,9 +1953,7 @@ w32_draw_image_foreground_1 (s, pixmap)
give the rectangle to draw. */
static void
-x_draw_glyph_string_bg_rect (s, x, y, w, h)
- struct glyph_string *s;
- int x, y, w, h;
+x_draw_glyph_string_bg_rect (struct glyph_string *s, int x, int y, int w, int h)
{
#if 0 /* TODO: stipple */
if (s->stippled_p)
@@ -2058,8 +1984,7 @@ x_draw_glyph_string_bg_rect (s, x, y, w, h)
*/
static void
-x_draw_image_glyph_string (s)
- struct glyph_string *s;
+x_draw_image_glyph_string (struct glyph_string *s)
{
int x, y;
int box_line_hwidth = eabs (s->face->box_line_width);
@@ -2172,8 +2097,7 @@ x_draw_image_glyph_string (s)
/* Draw stretch glyph string S. */
static void
-x_draw_stretch_glyph_string (s)
- struct glyph_string *s;
+x_draw_stretch_glyph_string (struct glyph_string *s)
{
xassert (s->first_glyph->type == STRETCH_GLYPH);
@@ -2255,8 +2179,7 @@ x_draw_stretch_glyph_string (s)
/* Draw glyph string S. */
static void
-x_draw_glyph_string (s)
- struct glyph_string *s;
+x_draw_glyph_string (struct glyph_string *s)
{
int relief_drawn_p = 0;
@@ -2421,7 +2344,7 @@ x_draw_glyph_string (s)
/* Draw strike-through. */
if (s->face->strike_through_p
- && !FONT_TEXTMETRIC(s->font).tmStruckOut)
+ && !FONT_TEXTMETRIC (s->font).tmStruckOut)
{
unsigned long h = 1;
unsigned long dy = (s->height - h) / 2;
@@ -2502,9 +2425,8 @@ x_draw_glyph_string (s)
/* Shift display to make room for inserted glyphs. */
void
-w32_shift_glyphs_for_insert (f, x, y, width, height, shift_by)
- struct frame *f;
- int x, y, width, height, shift_by;
+w32_shift_glyphs_for_insert (struct frame *f, int x, int y,
+ int width, int height, int shift_by)
{
HDC hdc;
@@ -2520,9 +2442,7 @@ w32_shift_glyphs_for_insert (f, x, y, width, height, shift_by)
for X frames. */
static void
-x_delete_glyphs (f, n)
- struct frame *f;
- register int n;
+x_delete_glyphs (struct frame *f, register int n)
{
if (! FRAME_W32_P (f))
return;
@@ -2592,8 +2512,7 @@ w32_ring_bell (struct frame *f)
that is bounded by calls to x_update_begin and x_update_end. */
static void
-w32_set_terminal_window (n)
- register int n;
+w32_set_terminal_window (struct frame *f, int n)
{
/* This function intentionally left blank. */
}
@@ -2607,9 +2526,7 @@ w32_set_terminal_window (n)
lines or deleting -N lines at vertical position VPOS. */
static void
-x_ins_del_lines (f, vpos, n)
- struct frame *f;
- int vpos, n;
+x_ins_del_lines (struct frame *f, int vpos, int n)
{
if (! FRAME_W32_P (f))
return;
@@ -2621,9 +2538,7 @@ x_ins_del_lines (f, vpos, n)
/* Scroll part of the display as described by RUN. */
static void
-x_scroll_run (w, run)
- struct window *w;
- struct run *run;
+x_scroll_run (struct window *w, struct run *run)
{
struct frame *f = XFRAME (w->frame);
int x, y, width, height, from_y, to_y, bottom_y;
@@ -2705,16 +2620,14 @@ x_scroll_run (w, run)
***********************************************************************/
static void
-frame_highlight (f)
- struct frame *f;
+frame_highlight (struct frame *f)
{
x_update_cursor (f, 1);
x_set_frame_alpha (f);
}
static void
-frame_unhighlight (f)
- struct frame *f;
+frame_unhighlight (struct frame *f)
{
x_update_cursor (f, 1);
x_set_frame_alpha (f);
@@ -2727,9 +2640,7 @@ frame_unhighlight (f)
Lisp code can tell when the switch took place by examining the events. */
static void
-x_new_focus_frame (dpyinfo, frame)
- struct w32_display_info *dpyinfo;
- struct frame *frame;
+x_new_focus_frame (struct w32_display_info *dpyinfo, struct frame *frame)
{
struct frame *old_focus = dpyinfo->w32_focus_frame;
@@ -2757,12 +2668,8 @@ x_new_focus_frame (dpyinfo, frame)
a FOCUS_IN_EVENT into *BUFP. */
static void
-x_focus_changed (type, state, dpyinfo, frame, bufp)
- int type;
- int state;
- struct w32_display_info *dpyinfo;
- struct frame *frame;
- struct input_event *bufp;
+x_focus_changed (int type, int state, struct w32_display_info *dpyinfo,
+ struct frame *frame, struct input_event *bufp)
{
if (type == WM_SETFOCUS)
{
@@ -2807,10 +2714,8 @@ x_focus_changed (type, state, dpyinfo, frame, bufp)
Returns FOCUS_IN_EVENT event in *BUFP. */
static void
-w32_detect_focus_change (dpyinfo, event, bufp)
- struct w32_display_info *dpyinfo;
- W32Msg *event;
- struct input_event *bufp;
+w32_detect_focus_change (struct w32_display_info *dpyinfo, W32Msg *event,
+ struct input_event *bufp)
{
struct frame *frame;
@@ -2829,8 +2734,7 @@ w32_detect_focus_change (dpyinfo, event, bufp)
/* Handle an event saying the mouse has moved out of an Emacs frame. */
void
-x_mouse_leave (dpyinfo)
- struct w32_display_info *dpyinfo;
+x_mouse_leave (struct w32_display_info *dpyinfo)
{
x_new_focus_frame (dpyinfo, dpyinfo->w32_focus_event_frame);
}
@@ -2844,8 +2748,7 @@ x_mouse_leave (dpyinfo)
the appropriate X display info. */
static void
-w32_frame_rehighlight (frame)
- struct frame *frame;
+w32_frame_rehighlight (struct frame *frame)
{
if (! FRAME_W32_P (frame))
return;
@@ -2853,8 +2756,7 @@ w32_frame_rehighlight (frame)
}
static void
-x_frame_rehighlight (dpyinfo)
- struct w32_display_info *dpyinfo;
+x_frame_rehighlight (struct w32_display_info *dpyinfo)
{
struct frame *old_highlight = dpyinfo->x_highlight_frame;
@@ -2887,8 +2789,7 @@ x_frame_rehighlight (dpyinfo)
/* Convert a keysym to its name. */
char *
-x_get_keysym_name (keysym)
- int keysym;
+x_get_keysym_name (int keysym)
{
/* Make static so we can always return it */
static char value[100];
@@ -2900,7 +2801,8 @@ x_get_keysym_name (keysym)
return value;
}
-static int codepage_for_locale(LCID locale)
+static int
+codepage_for_locale (LCID locale)
{
char cp[20];
@@ -2917,11 +2819,7 @@ static int codepage_for_locale(LCID locale)
the state in PUP. XBUTTON provides extra information for extended mouse
button messages. Returns FALSE if unable to parse the message. */
BOOL
-parse_button (message, xbutton, pbutton, pup)
- int message;
- int xbutton;
- int * pbutton;
- int * pup;
+parse_button (int message, int xbutton, int * pbutton, int * pup)
{
int button = 0;
int up = 0;
@@ -2989,10 +2887,7 @@ parse_button (message, xbutton, pbutton, pup)
the mouse. */
static Lisp_Object
-construct_mouse_click (result, msg, f)
- struct input_event *result;
- W32Msg *msg;
- struct frame *f;
+construct_mouse_click (struct input_event *result, W32Msg *msg, struct frame *f)
{
int button;
int up;
@@ -3018,10 +2913,7 @@ construct_mouse_click (result, msg, f)
}
static Lisp_Object
-construct_mouse_wheel (result, msg, f)
- struct input_event *result;
- W32Msg *msg;
- struct frame *f;
+construct_mouse_wheel (struct input_event *result, W32Msg *msg, struct frame *f)
{
POINT p;
int delta;
@@ -3054,10 +2946,7 @@ construct_mouse_wheel (result, msg, f)
}
static Lisp_Object
-construct_drag_n_drop (result, msg, f)
- struct input_event *result;
- W32Msg *msg;
- struct frame *f;
+construct_drag_n_drop (struct input_event *result, W32Msg *msg, struct frame *f)
{
Lisp_Object files;
Lisp_Object frame;
@@ -3118,9 +3007,7 @@ static MSG last_mouse_motion_event;
static Lisp_Object last_mouse_motion_frame;
static int
-note_mouse_movement (frame, msg)
- FRAME_PTR frame;
- MSG *msg;
+note_mouse_movement (FRAME_PTR frame, MSG *msg)
{
int mouse_x = LOWORD (msg->lParam);
int mouse_y = HIWORD (msg->lParam);
@@ -3168,12 +3055,15 @@ note_mouse_movement (frame, msg)
Mouse Face
************************************************************************/
-static struct scroll_bar *x_window_to_scroll_bar ();
-static void x_scroll_bar_report_motion ();
-static void x_check_fullscreen P_ ((struct frame *));
+static struct scroll_bar *x_window_to_scroll_bar (Window);
+static void x_scroll_bar_report_motion (FRAME_PTR *, Lisp_Object *,
+ enum scroll_bar_part *,
+ Lisp_Object *, Lisp_Object *,
+ unsigned long *);
+static void x_check_fullscreen (struct frame *);
static void
-redo_mouse_highlight ()
+redo_mouse_highlight (void)
{
if (!NILP (last_mouse_motion_frame)
&& FRAME_LIVE_P (XFRAME (last_mouse_motion_frame)))
@@ -3183,9 +3073,7 @@ redo_mouse_highlight ()
}
static void
-w32_define_cursor (window, cursor)
- Window window;
- Cursor cursor;
+w32_define_cursor (Window window, Cursor cursor)
{
PostMessage (window, WM_EMACS_SETCURSOR, (WPARAM) cursor, 0);
}
@@ -3210,13 +3098,9 @@ w32_define_cursor (window, cursor)
movement. */
static void
-w32_mouse_position (fp, insist, bar_window, part, x, y, time)
- FRAME_PTR *fp;
- int insist;
- Lisp_Object *bar_window;
- enum scroll_bar_part *part;
- Lisp_Object *x, *y;
- unsigned long *time;
+w32_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
+ enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y,
+ unsigned long *time)
{
FRAME_PTR f1;
@@ -3307,9 +3191,7 @@ w32_mouse_position (fp, insist, bar_window, part, x, y, time)
or ButtonRelase. */
static void
-w32_handle_tool_bar_click (f, button_event)
- struct frame *f;
- struct input_event *button_event;
+w32_handle_tool_bar_click (struct frame *f, struct input_event *button_event)
{
int x = XFASTINT (button_event->x);
int y = XFASTINT (button_event->y);
@@ -3334,8 +3216,7 @@ w32_handle_tool_bar_click (f, button_event)
bits. */
static struct scroll_bar *
-x_window_to_scroll_bar (window_id)
- Window window_id;
+x_window_to_scroll_bar (Window window_id)
{
Lisp_Object tail;
@@ -3371,9 +3252,8 @@ x_window_to_scroll_bar (window_id)
displaying PORTION out of a whole WHOLE, and our position POSITION. */
static void
-w32_set_scroll_bar_thumb (bar, portion, position, whole)
- struct scroll_bar *bar;
- int portion, position, whole;
+w32_set_scroll_bar_thumb (struct scroll_bar *bar,
+ int portion, int position, int whole)
{
Window w = SCROLL_BAR_W32_WINDOW (bar);
/* We use the whole scroll-bar height in the calculations below, to
@@ -3399,7 +3279,7 @@ w32_set_scroll_bar_thumb (bar, portion, position, whole)
BLOCK_INPUT;
si.cbSize = sizeof (si);
si.fMask = SIF_POS | SIF_PAGE;
- GetScrollInfo(w, SB_CTL, &si);
+ GetScrollInfo (w, SB_CTL, &si);
near_bottom_p = si.nPos + si.nPage >= range;
UNBLOCK_INPUT;
if (!near_bottom_p)
@@ -3448,9 +3328,7 @@ w32_set_scroll_bar_thumb (bar, portion, position, whole)
************************************************************************/
static HWND
-my_create_scrollbar (f, bar)
- struct frame * f;
- struct scroll_bar * bar;
+my_create_scrollbar (struct frame * f, struct scroll_bar * bar)
{
return (HWND) SendMessage (FRAME_W32_WINDOW (f),
WM_EMACS_CREATESCROLLBAR, (WPARAM) f,
@@ -3488,27 +3366,24 @@ my_set_window_pos (HWND hwnd, HWND hwndAfter,
#endif
}
+#if 0
static void
-my_set_focus (f, hwnd)
- struct frame * f;
- HWND hwnd;
+my_set_focus (struct frame * f, HWND hwnd)
{
SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_SETFOCUS,
(WPARAM) hwnd, 0);
}
+#endif
static void
-my_set_foreground_window (hwnd)
- HWND hwnd;
+my_set_foreground_window (HWND hwnd)
{
SendMessage (hwnd, WM_EMACS_SETFOREGROUND, (WPARAM) hwnd, 0);
}
static void
-my_destroy_window (f, hwnd)
- struct frame * f;
- HWND hwnd;
+my_destroy_window (struct frame * f, HWND hwnd)
{
SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_DESTROYWINDOW,
(WPARAM) hwnd, 0);
@@ -3520,9 +3395,7 @@ my_destroy_window (f, hwnd)
scroll bar. */
static struct scroll_bar *
-x_scroll_bar_create (w, top, left, width, height)
- struct window *w;
- int top, left, width, height;
+x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
HWND hwnd;
@@ -3575,8 +3448,7 @@ x_scroll_bar_create (w, top, left, width, height)
nil. */
static void
-x_scroll_bar_remove (bar)
- struct scroll_bar *bar;
+x_scroll_bar_remove (struct scroll_bar *bar)
{
FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
@@ -3596,9 +3468,8 @@ x_scroll_bar_remove (bar)
characters, starting at POSITION. If WINDOW has no scroll bar,
create one. */
static void
-w32_set_vertical_scroll_bar (w, portion, whole, position)
- struct window *w;
- int portion, whole, position;
+w32_set_vertical_scroll_bar (struct window *w,
+ int portion, int whole, int position)
{
struct frame *f = XFRAME (w->frame);
struct scroll_bar *bar;
@@ -3741,8 +3612,7 @@ w32_set_vertical_scroll_bar (w, portion, whole, position)
`*redeem_scroll_bar_hook' is applied to its window before the judgment. */
static void
-w32_condemn_scroll_bars (frame)
- FRAME_PTR frame;
+w32_condemn_scroll_bars (FRAME_PTR frame)
{
/* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */
while (! NILP (FRAME_SCROLL_BARS (frame)))
@@ -3763,8 +3633,7 @@ w32_condemn_scroll_bars (frame)
Note that WINDOW isn't necessarily condemned at all. */
static void
-w32_redeem_scroll_bar (window)
- struct window *window;
+w32_redeem_scroll_bar (struct window *window)
{
struct scroll_bar *bar;
struct frame *f;
@@ -3809,8 +3678,7 @@ w32_redeem_scroll_bar (window)
last call to `*condemn_scroll_bars_hook'. */
static void
-w32_judge_scroll_bars (f)
- FRAME_PTR f;
+w32_judge_scroll_bars (FRAME_PTR f)
{
Lisp_Object bar, next;
@@ -3841,10 +3709,8 @@ w32_judge_scroll_bars (f)
mark bits. */
static int
-w32_scroll_bar_handle_click (bar, msg, emacs_event)
- struct scroll_bar *bar;
- W32Msg *msg;
- struct input_event *emacs_event;
+w32_scroll_bar_handle_click (struct scroll_bar *bar, W32Msg *msg,
+ struct input_event *emacs_event)
{
if (! WINDOWP (bar->window))
abort ();
@@ -3950,12 +3816,10 @@ w32_scroll_bar_handle_click (bar, msg, emacs_event)
on the scroll bar. */
static void
-x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
- FRAME_PTR *fp;
- Lisp_Object *bar_window;
- enum scroll_bar_part *part;
- Lisp_Object *x, *y;
- unsigned long *time;
+x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window,
+ enum scroll_bar_part *part,
+ Lisp_Object *x, Lisp_Object *y,
+ unsigned long *time)
{
struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar);
Window w = SCROLL_BAR_W32_WINDOW (bar);
@@ -4011,8 +3875,7 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
redraw them. */
void
-x_scroll_bar_clear (f)
- FRAME_PTR f;
+x_scroll_bar_clear (FRAME_PTR f)
{
Lisp_Object bar;
@@ -4071,10 +3934,8 @@ static char dbcs_lead = 0;
*/
int
-w32_read_socket (sd, expected, hold_quit)
- register int sd;
- int expected;
- struct input_event *hold_quit;
+w32_read_socket (struct terminal *terminal, int expected,
+ struct input_event *hold_quit)
{
int count = 0;
int check_visibility = 0;
@@ -4295,7 +4156,7 @@ w32_read_socket (sd, expected, hold_quit)
temp_index = 0;
temp_buffer[temp_index++] = msg.msg.wParam;
inev.kind = MULTIMEDIA_KEY_EVENT;
- inev.code = GET_APPCOMMAND_LPARAM(msg.msg.lParam);
+ inev.code = GET_APPCOMMAND_LPARAM (msg.msg.lParam);
inev.modifiers = msg.dwModifiers;
XSETFRAME (inev.frame_or_window, f);
inev.timestamp = msg.msg.time;
@@ -4343,7 +4204,7 @@ w32_read_socket (sd, expected, hold_quit)
selected now and last mouse movement event was
not in it. Minibuffer window will be selected
only when it is active. */
- if (WINDOWP(window)
+ if (WINDOWP (window)
&& !EQ (window, last_window)
&& !EQ (window, selected_window)
/* For click-to-focus window managers
@@ -4903,11 +4764,7 @@ w32_read_socket (sd, expected, hold_quit)
mode lines must be clipped to the whole window. */
static void
-w32_clip_to_row (w, row, area, hdc)
- struct window *w;
- struct glyph_row *row;
- int area;
- HDC hdc;
+w32_clip_to_row (struct window *w, struct glyph_row *row, int area, HDC hdc)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
RECT clip_rect;
@@ -4928,9 +4785,7 @@ w32_clip_to_row (w, row, area, hdc)
/* Draw a hollow box cursor on window W in glyph row ROW. */
static void
-x_draw_hollow_cursor (w, row)
- struct window *w;
- struct glyph_row *row;
+x_draw_hollow_cursor (struct window *w, struct glyph_row *row)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
HDC hdc;
@@ -4970,11 +4825,8 @@ x_draw_hollow_cursor (w, row)
--gerd. */
static void
-x_draw_bar_cursor (w, row, width, kind)
- struct window *w;
- struct glyph_row *row;
- int width;
- enum text_cursor_kinds kind;
+x_draw_bar_cursor (struct window *w, struct glyph_row *row,
+ int width, enum text_cursor_kinds kind)
{
struct frame *f = XFRAME (w->frame);
struct glyph *cursor_glyph;
@@ -5053,9 +4905,7 @@ x_draw_bar_cursor (w, row, width, kind)
/* RIF: Define cursor CURSOR on frame F. */
static void
-w32_define_frame_cursor (f, cursor)
- struct frame *f;
- Cursor cursor;
+w32_define_frame_cursor (struct frame *f, Cursor cursor)
{
w32_define_cursor (FRAME_W32_WINDOW (f), cursor);
}
@@ -5064,9 +4914,7 @@ w32_define_frame_cursor (f, cursor)
/* RIF: Clear area on frame F. */
static void
-w32_clear_frame_area (f, x, y, width, height)
- struct frame *f;
- int x, y, width, height;
+w32_clear_frame_area (struct frame *f, int x, int y, int width, int height)
{
HDC hdc;
@@ -5078,12 +4926,9 @@ w32_clear_frame_area (f, x, y, width, height)
/* RIF: Draw or clear cursor on window W. */
static void
-w32_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, active_p)
- struct window *w;
- struct glyph_row *glyph_row;
- int x, y;
- int cursor_type, cursor_width;
- int on_p, active_p;
+w32_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
+ int x, int y, int cursor_type, int cursor_width,
+ int on_p, int active_p)
{
if (on_p)
{
@@ -5178,9 +5023,7 @@ w32_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, act
/* Icons. */
int
-x_bitmap_icon (f, icon)
- struct frame *f;
- Lisp_Object icon;
+x_bitmap_icon (struct frame *f, Lisp_Object icon)
{
HANDLE main_icon;
HANDLE small_icon = NULL;
@@ -5269,10 +5112,7 @@ x_io_error_quitter (display)
/* Changing the font of the frame. */
Lisp_Object
-x_new_font (f, font_object, fontset)
- struct frame *f;
- Lisp_Object font_object;
- int fontset;
+x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
{
struct font *font = XFONT_OBJECT (font_object);
@@ -5340,8 +5180,7 @@ xim_close_dpy (dpyinfo)
from its current recorded position values and gravity. */
void
-x_calc_absolute_position (f)
- struct frame *f;
+x_calc_absolute_position (struct frame *f)
{
int flags = f->size_hint_flags;
@@ -5401,10 +5240,8 @@ x_calc_absolute_position (f)
which means, do adjust for borders but don't change the gravity. */
void
-x_set_offset (f, xoff, yoff, change_gravity)
- struct frame *f;
- register int xoff, yoff;
- int change_gravity;
+x_set_offset (struct frame *f, register int xoff, register int yoff,
+ int change_gravity)
{
int modified_top, modified_left;
@@ -5439,8 +5276,7 @@ x_set_offset (f, xoff, yoff, change_gravity)
/* Check if we need to resize the frame due to a fullscreen request.
If so needed, resize the frame. */
static void
-x_check_fullscreen (f)
- struct frame *f;
+x_check_fullscreen (struct frame *f)
{
if (f->want_fullscreen & FULLSCREEN_BOTH)
{
@@ -5470,10 +5306,7 @@ x_check_fullscreen (f)
Otherwise we leave the window gravity unchanged. */
void
-x_set_window_size (f, change_gravity, cols, rows)
- struct frame *f;
- int change_gravity;
- int cols, rows;
+x_set_window_size (struct frame *f, int change_gravity, int cols, int rows)
{
int pixelwidth, pixelheight;
@@ -5498,8 +5331,8 @@ x_set_window_size (f, change_gravity, cols, rows)
rect.right = pixelwidth;
rect.bottom = pixelheight;
- AdjustWindowRect(&rect, f->output_data.w32->dwStyle,
- FRAME_EXTERNAL_MENU_BAR (f));
+ AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
+ FRAME_EXTERNAL_MENU_BAR (f));
my_set_window_pos (FRAME_W32_WINDOW (f),
NULL,
@@ -5565,9 +5398,7 @@ x_set_window_size (f, change_gravity, cols, rows)
void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
void
-x_set_mouse_position (f, x, y)
- struct frame *f;
- int x, y;
+x_set_mouse_position (struct frame *f, int x, int y)
{
int pix_x, pix_y;
@@ -5584,9 +5415,7 @@ x_set_mouse_position (f, x, y)
}
void
-x_set_mouse_pixel_position (f, pix_x, pix_y)
- struct frame *f;
- int pix_x, pix_y;
+x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
{
RECT rect;
POINT pt;
@@ -5607,8 +5436,7 @@ x_set_mouse_pixel_position (f, pix_x, pix_y)
/* focus shifting, raising and lowering. */
void
-x_focus_on_frame (f)
- struct frame *f;
+x_focus_on_frame (struct frame *f)
{
struct w32_display_info *dpyinfo = &one_w32_display_info;
@@ -5625,15 +5453,13 @@ x_focus_on_frame (f)
}
void
-x_unfocus_frame (f)
- struct frame *f;
+x_unfocus_frame (struct frame *f)
{
}
/* Raise frame F. */
void
-x_raise_frame (f)
- struct frame *f;
+x_raise_frame (struct frame *f)
{
BLOCK_INPUT;
@@ -5692,8 +5518,7 @@ x_raise_frame (f)
/* Lower frame F. */
void
-x_lower_frame (f)
- struct frame *f;
+x_lower_frame (struct frame *f)
{
BLOCK_INPUT;
my_set_window_pos (FRAME_W32_WINDOW (f),
@@ -5704,9 +5529,7 @@ x_lower_frame (f)
}
static void
-w32_frame_raise_lower (f, raise_flag)
- FRAME_PTR f;
- int raise_flag;
+w32_frame_raise_lower (FRAME_PTR f, int raise_flag)
{
if (! FRAME_W32_P (f))
return;
@@ -5727,8 +5550,7 @@ w32_frame_raise_lower (f, raise_flag)
finishes with it. */
void
-x_make_frame_visible (f)
- struct frame *f;
+x_make_frame_visible (struct frame *f)
{
Lisp_Object type;
@@ -5752,8 +5574,8 @@ x_make_frame_visible (f)
/* Adjust vertical window position in order to avoid being
covered by a task bar placed at the bottom of the desktop. */
- SystemParametersInfo(SPI_GETWORKAREA, 0, &workarea_rect, 0);
- GetWindowRect(FRAME_W32_WINDOW(f), &window_rect);
+ SystemParametersInfo (SPI_GETWORKAREA, 0, &workarea_rect, 0);
+ GetWindowRect (FRAME_W32_WINDOW(f), &window_rect);
if (window_rect.bottom > workarea_rect.bottom
&& window_rect.top > workarea_rect.top)
f->top_pos = max (window_rect.top
@@ -5820,8 +5642,8 @@ x_make_frame_visible (f)
/* Make the frame visible (mapped and not iconified). */
-x_make_frame_invisible (f)
- struct frame *f;
+void
+x_make_frame_invisible (struct frame *f)
{
/* Don't keep the highlight on an invisible frame. */
if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f)
@@ -5847,8 +5669,7 @@ x_make_frame_invisible (f)
/* Change window state from mapped to iconified. */
void
-x_iconify_frame (f)
- struct frame *f;
+x_iconify_frame (struct frame *f)
{
Lisp_Object type;
@@ -5875,8 +5696,7 @@ x_iconify_frame (f)
/* Free X resources of frame F. */
void
-x_free_frame_resources (f)
- struct frame *f;
+x_free_frame_resources (struct frame *f)
{
struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
@@ -5934,8 +5754,7 @@ x_free_frame_resources (f)
/* Destroy the window of frame F. */
void
-x_destroy_window (f)
- struct frame *f;
+x_destroy_window (struct frame *f)
{
struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
@@ -5952,10 +5771,7 @@ x_destroy_window (f)
If USER_POSITION is nonzero, we set the USPosition
flag (this is useful when FLAGS is 0). */
void
-x_wm_set_size_hint (f, flags, user_position)
- struct frame *f;
- long flags;
- int user_position;
+x_wm_set_size_hint (struct frame *f, long flags, int user_position)
{
Window window = FRAME_W32_WINDOW (f);
@@ -5971,9 +5787,7 @@ x_wm_set_size_hint (f, flags, user_position)
/* Window manager things */
void
-x_wm_set_icon_position (f, icon_x, icon_y)
- struct frame *f;
- int icon_x, icon_y;
+x_wm_set_icon_position (struct frame *f, int icon_x, int icon_y)
{
#if 0
Window window = FRAME_W32_WINDOW (f);
@@ -5994,12 +5808,11 @@ x_wm_set_icon_position (f, icon_x, icon_y)
static int w32_initialized = 0;
void
-w32_initialize_display_info (display_name)
- Lisp_Object display_name;
+w32_initialize_display_info (Lisp_Object display_name)
{
struct w32_display_info *dpyinfo = &one_w32_display_info;
- bzero (dpyinfo, sizeof (*dpyinfo));
+ memset (dpyinfo, 0, sizeof (*dpyinfo));
/* Put it on w32_display_name_list. */
w32_display_name_list = Fcons (Fcons (display_name, Qnil),
@@ -6048,8 +5861,7 @@ w32_initialize_display_info (display_name)
but any whitespace following value is not removed. */
static char *
-w32_make_rdb (xrm_option)
- char *xrm_option;
+w32_make_rdb (char *xrm_option)
{
char *buffer = xmalloc (strlen (xrm_option) + 2);
char *current = buffer;
@@ -6208,10 +6020,7 @@ x_delete_terminal (struct terminal *terminal)
}
struct w32_display_info *
-w32_term_init (display_name, xrm_option, resource_name)
- Lisp_Object display_name;
- char *xrm_option;
- char *resource_name;
+w32_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
{
struct w32_display_info *dpyinfo;
struct terminal *terminal;
@@ -6286,8 +6095,7 @@ w32_term_init (display_name, xrm_option, resource_name)
/* Get rid of display DPYINFO, assuming all frames are already gone. */
void
-x_delete_display (dpyinfo)
- struct w32_display_info *dpyinfo;
+x_delete_display (struct w32_display_info *dpyinfo)
{
/* Discard this display from w32_display_name_list and w32_display_list.
We can't use Fdelq because that can quit. */
@@ -6323,7 +6131,7 @@ x_delete_display (dpyinfo)
}
dpyinfo->color_list = NULL;
if (dpyinfo->palette)
- DeleteObject(dpyinfo->palette);
+ DeleteObject (dpyinfo->palette);
}
xfree (dpyinfo->w32_id_name);
@@ -6335,7 +6143,7 @@ x_delete_display (dpyinfo)
DWORD WINAPI w32_msg_worker (void * arg);
static void
-w32_initialize ()
+w32_initialize (void)
{
HANDLE shell;
HRESULT (WINAPI * set_user_model) (wchar_t * id);
@@ -6438,7 +6246,7 @@ w32_initialize ()
}
void
-syms_of_w32term ()
+syms_of_w32term (void)
{
staticpro (&w32_display_name_list);
w32_display_name_list = Qnil;
diff --git a/src/w32term.h b/src/w32term.h
index ea5f420a7dc..b5b3d4451f2 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -228,14 +228,14 @@ extern Lisp_Object Vx_pixel_size_width_font_regexp;
struct w32_display_info *x_display_info_for_name ();
-Lisp_Object display_x_get_resource P_ ((struct w32_display_info *,
- Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object));
+Lisp_Object display_x_get_resource (struct w32_display_info *,
+ Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object);
extern struct w32_display_info *w32_term_init ();
-extern int x_display_pixel_height P_ ((struct w32_display_info *));
-extern int x_display_pixel_width P_ ((struct w32_display_info *));
+extern int x_display_pixel_height (struct w32_display_info *);
+extern int x_display_pixel_width (struct w32_display_info *);
#define PIX_TYPE COLORREF
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index cfdf629ceee..9edd6353ba3 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -57,15 +57,14 @@ extern int initialized;
extern struct font_driver uniscribe_font_driver;
/* EnumFontFamiliesEx callback. */
-static int CALLBACK add_opentype_font_name_to_list P_ ((ENUMLOGFONTEX *,
- NEWTEXTMETRICEX *,
- DWORD, LPARAM));
+static int CALLBACK add_opentype_font_name_to_list (ENUMLOGFONTEX *,
+ NEWTEXTMETRICEX *,
+ DWORD, LPARAM);
/* Used by uniscribe_otf_capability. */
static Lisp_Object otf_features (HDC context, char *table);
static int
-memq_no_quit (elt, list)
- Lisp_Object elt, list;
+memq_no_quit (Lisp_Object elt, Lisp_Object list)
{
while (CONSP (list) && ! EQ (XCAR (list), elt))
list = XCDR (list);
@@ -75,8 +74,7 @@ memq_no_quit (elt, list)
/* Font backend interface implementation. */
static Lisp_Object
-uniscribe_list (frame, font_spec)
- Lisp_Object frame, font_spec;
+uniscribe_list (Lisp_Object frame, Lisp_Object font_spec)
{
Lisp_Object fonts = w32font_list_internal (frame, font_spec, 1);
FONT_ADD_LOG ("uniscribe-list", font_spec, fonts);
@@ -84,8 +82,7 @@ uniscribe_list (frame, font_spec)
}
static Lisp_Object
-uniscribe_match (frame, font_spec)
- Lisp_Object frame, font_spec;
+uniscribe_match (Lisp_Object frame, Lisp_Object font_spec)
{
Lisp_Object entity = w32font_match_internal (frame, font_spec, 1);
FONT_ADD_LOG ("uniscribe-match", font_spec, entity);
@@ -93,15 +90,14 @@ uniscribe_match (frame, font_spec)
}
static Lisp_Object
-uniscribe_list_family (frame)
- Lisp_Object frame;
+uniscribe_list_family (Lisp_Object frame)
{
Lisp_Object list = Qnil;
LOGFONT font_match_pattern;
HDC dc;
FRAME_PTR f = XFRAME (frame);
- bzero (&font_match_pattern, sizeof (font_match_pattern));
+ memset (&font_match_pattern, 0, sizeof (font_match_pattern));
/* Limit enumerated fonts to outline fonts to save time. */
font_match_pattern.lfOutPrecision = OUT_OUTLINE_PRECIS;
@@ -116,10 +112,7 @@ uniscribe_list_family (frame)
}
static Lisp_Object
-uniscribe_open (f, font_entity, pixel_size)
- FRAME_PTR f;
- Lisp_Object font_entity;
- int pixel_size;
+uniscribe_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
{
Lisp_Object font_object
= font_make_object (VECSIZE (struct uniscribe_font_info),
@@ -148,9 +141,7 @@ uniscribe_open (f, font_entity, pixel_size)
}
static void
-uniscribe_close (f, font)
- FRAME_PTR f;
- struct font *font;
+uniscribe_close (FRAME_PTR f, struct font *font)
{
struct uniscribe_font_info *uniscribe_font
= (struct uniscribe_font_info *) font;
@@ -164,8 +155,7 @@ uniscribe_close (f, font)
/* Return a list describing which scripts/languages FONT supports by
which GSUB/GPOS features of OpenType tables. */
static Lisp_Object
-uniscribe_otf_capability (font)
- struct font *font;
+uniscribe_otf_capability (struct font *font)
{
HDC context;
HFONT old_font;
@@ -175,7 +165,7 @@ uniscribe_otf_capability (font)
f = XFRAME (selected_frame);
context = get_frame_dc (f);
- old_font = SelectObject (context, FONT_HANDLE(font));
+ old_font = SelectObject (context, FONT_HANDLE (font));
features = otf_features (context, "GSUB");
XSETCAR (capability, features);
@@ -202,8 +192,7 @@ uniscribe_otf_capability (font)
than the length of LGSTRING, nil should be return. In that case,
this function is called again with the larger LGSTRING. */
static Lisp_Object
-uniscribe_shape (lgstring)
- Lisp_Object lgstring;
+uniscribe_shape (Lisp_Object lgstring)
{
struct font * font;
struct uniscribe_font_info * uniscribe_font;
@@ -287,7 +276,7 @@ uniscribe_shape (lgstring)
passed in. */
f = XFRAME (selected_frame);
context = get_frame_dc (f);
- old_font = SelectObject (context, FONT_HANDLE(font));
+ old_font = SelectObject (context, FONT_HANDLE (font));
result = ScriptShape (context, &(uniscribe_font->cache),
chars + items[i].iCharPos, nchars_in_run,
@@ -322,7 +311,7 @@ uniscribe_shape (lgstring)
/* Cache not complete... */
f = XFRAME (selected_frame);
context = get_frame_dc (f);
- old_font = SelectObject (context, FONT_HANDLE(font));
+ old_font = SelectObject (context, FONT_HANDLE (font));
result = ScriptPlace (context, &(uniscribe_font->cache),
glyphs, nglyphs, attributes, &(items[i].a),
@@ -397,7 +386,7 @@ uniscribe_shape (lgstring)
/* Cache incomplete... */
f = XFRAME (selected_frame);
context = get_frame_dc (f);
- old_font = SelectObject (context, FONT_HANDLE(font));
+ old_font = SelectObject (context, FONT_HANDLE (font));
result = ScriptGetGlyphABCWidth (context,
&(uniscribe_font->cache),
glyphs[j], &char_metric);
@@ -451,9 +440,7 @@ uniscribe_shape (lgstring)
Return a glyph code of FONT for characer C (Unicode code point).
If FONT doesn't have such a glyph, return FONT_INVALID_CODE. */
static unsigned
-uniscribe_encode_char (font, c)
- struct font *font;
- int c;
+uniscribe_encode_char (struct font *font, int c)
{
HDC context = NULL;
struct frame *f = NULL;
@@ -509,7 +496,7 @@ uniscribe_encode_char (font, c)
the frame. */
f = XFRAME (selected_frame);
context = get_frame_dc (f);
- old_font = SelectObject (context, FONT_HANDLE(font));
+ old_font = SelectObject (context, FONT_HANDLE (font));
result = ScriptShape (context, &(uniscribe_font->cache),
ch, len, 2, &(items[0].a),
glyphs, clusters, attrs, &nglyphs);
@@ -574,12 +561,9 @@ uniscribe_encode_char (font, c)
Adds the name of opentype fonts to a Lisp list (passed in as the
lParam arg). */
static int CALLBACK
-add_opentype_font_name_to_list (logical_font, physical_font, font_type,
- list_object)
- ENUMLOGFONTEX *logical_font;
- NEWTEXTMETRICEX *physical_font;
- DWORD font_type;
- LPARAM list_object;
+add_opentype_font_name_to_list (ENUMLOGFONTEX *logical_font,
+ NEWTEXTMETRICEX *physical_font,
+ DWORD font_type, LPARAM list_object)
{
Lisp_Object* list = (Lisp_Object *) list_object;
Lisp_Object family;
@@ -650,9 +634,8 @@ static char* NOTHING = " ";
/* Check if font supports the otf script/language/features specified.
OTF_SPEC is in the format
(script lang [(gsub_feature ...)|nil] [(gpos_feature ...)]?) */
-int uniscribe_check_otf (font, otf_spec)
- LOGFONT *font;
- Lisp_Object otf_spec;
+int
+uniscribe_check_otf (LOGFONT *font, Lisp_Object otf_spec)
{
Lisp_Object script, lang, rest;
Lisp_Object features[2];
@@ -947,7 +930,7 @@ struct font_driver uniscribe_font_driver =
NULL, /* get_outline */
NULL, /* free_outline */
NULL, /* anchor_point */
- uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works. */
+ uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works. */
NULL, /* otf_drive - use shape instead. */
NULL, /* start_for_frame */
NULL, /* end_for_frame */
@@ -957,7 +940,7 @@ struct font_driver uniscribe_font_driver =
/* Note that this should be called at every startup, not just when dumping,
as it needs to test for the existence of the Uniscribe library. */
void
-syms_of_w32uniscribe ()
+syms_of_w32uniscribe (void)
{
HMODULE uniscribe;
diff --git a/src/w32xfns.c b/src/w32xfns.c
index d77eb6b68ea..8fee42dae48 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -39,7 +39,7 @@ HANDLE input_available = NULL;
HANDLE interrupt_handle = NULL;
void
-init_crit ()
+init_crit (void)
{
InitializeCriticalSection (&critsect);
@@ -57,7 +57,7 @@ init_crit ()
}
void
-delete_crit ()
+delete_crit (void)
{
DeleteCriticalSection (&critsect);
@@ -74,7 +74,7 @@ delete_crit ()
}
void
-signal_quit ()
+signal_quit (void)
{
/* Make sure this event never remains signaled; if the main thread
isn't in a blocking call, then this should do nothing. */
@@ -161,9 +161,7 @@ int_msg *lpTail = NULL;
int nQueue = 0;
BOOL
-get_next_msg (lpmsg, bWait)
- W32Msg * lpmsg;
- BOOL bWait;
+get_next_msg (W32Msg * lpmsg, BOOL bWait)
{
BOOL bRet = FALSE;
@@ -180,7 +178,7 @@ get_next_msg (lpmsg, bWait)
if (nQueue)
{
- bcopy (&(lpHead->w32msg), lpmsg, sizeof (W32Msg));
+ memcpy (lpmsg, &lpHead->w32msg, sizeof (W32Msg));
{
int_msg * lpCur = lpHead;
@@ -216,7 +214,7 @@ get_next_msg (lpmsg, bWait)
if (!UnionRect (&(lpmsg->rect), &(lpmsg->rect),
&(lpCur->w32msg.rect)))
{
- SetRectEmpty(&(lpmsg->rect));
+ SetRectEmpty (&(lpmsg->rect));
}
myfree (lpCur);
@@ -245,15 +243,14 @@ get_next_msg (lpmsg, bWait)
}
BOOL
-post_msg (lpmsg)
- W32Msg * lpmsg;
+post_msg (W32Msg * lpmsg)
{
int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg));
if (!lpNew)
return (FALSE);
- bcopy (lpmsg, &(lpNew->w32msg), sizeof (W32Msg));
+ memcpy (&lpNew->w32msg, lpmsg, sizeof (W32Msg));
lpNew->lpNext = NULL;
enter_crit ();
@@ -283,7 +280,7 @@ prepend_msg (W32Msg *lpmsg)
if (!lpNew)
return (FALSE);
- bcopy (lpmsg, &(lpNew->w32msg), sizeof (W32Msg));
+ memcpy (&lpNew->w32msg, lpmsg, sizeof (W32Msg));
enter_crit ();
@@ -298,7 +295,7 @@ prepend_msg (W32Msg *lpmsg)
/* Process all messages in the current thread's queue. */
void
-drain_message_queue ()
+drain_message_queue (void)
{
MSG msg;
while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
@@ -322,9 +319,7 @@ drain_message_queue ()
*/
static int
-read_integer (string, NextString)
- register char *string;
- char **NextString;
+read_integer (register char *string, char **NextString)
{
register int Result = 0;
int Sign = 1;
@@ -348,10 +343,9 @@ read_integer (string, NextString)
}
int
-XParseGeometry (string, x, y, width, height)
- char *string;
- int *x, *y;
- unsigned int *width, *height; /* RETURN */
+XParseGeometry (char *string,
+ int *x, int *y,
+ unsigned int *width, unsigned int *height)
{
int mask = NoValue;
register char *strind;
@@ -446,8 +440,7 @@ XParseGeometry (string, x, y, width, height)
/* x_sync is a no-op on W32. */
void
-x_sync (f)
- void *f;
+x_sync (void *f)
{
}
diff --git a/src/widget.c b/src/widget.c
index 0c3aa64a74e..2301f76c7c9 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -76,14 +76,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define DEFAULT_FACE_FONT "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*"
-static void EmacsFrameInitialize (/*Widget, Widget, ArgList, Cardinal * */);
-static void EmacsFrameDestroy (/* Widget */);
-static void EmacsFrameRealize (/* Widget, XtValueMask*, XSetWindowAttributes* */);
-void EmacsFrameResize (/* Widget widget */);
-static Boolean EmacsFrameSetValues (/* Widget, Widget, Widget,
- ArgList, Cardinal * */);
-static XtGeometryResult EmacsFrameQueryGeometry (/* Widget, XtWidgetGeometry*,
- XtWidgetGeometry* */);
+static void EmacsFrameInitialize (Widget request, Widget new, ArgList dum1, Cardinal *dum2);
+static void EmacsFrameDestroy (Widget widget);
+static void EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs);
+void EmacsFrameResize (Widget widget);
+static Boolean EmacsFrameSetValues (Widget cur_widget, Widget req_widget, Widget new_widget, ArgList dum1, Cardinal *dum2);
+static XtGeometryResult EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *result);
#undef XtOffset
@@ -180,10 +178,7 @@ EmacsFrameClassRec emacsFrameClassRec = {
WidgetClass emacsFrameClass = (WidgetClass) &emacsFrameClassRec;
static void
-get_default_char_pixel_size (ew, pixel_width, pixel_height)
- EmacsFrame ew;
- int* pixel_width;
- int* pixel_height;
+get_default_char_pixel_size (EmacsFrame ew, int *pixel_width, int *pixel_height)
{
struct frame* f = ew->emacs_frame.frame;
*pixel_width = FRAME_COLUMN_WIDTH (f);
@@ -191,12 +186,7 @@ get_default_char_pixel_size (ew, pixel_width, pixel_height)
}
static void
-pixel_to_char_size (ew, pixel_width, pixel_height, char_width, char_height)
- EmacsFrame ew;
- Dimension pixel_width;
- Dimension pixel_height;
- int* char_width;
- int* char_height;
+pixel_to_char_size (EmacsFrame ew, Dimension pixel_width, Dimension pixel_height, int *char_width, int *char_height)
{
struct frame* f = ew->emacs_frame.frame;
*char_width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, (int) pixel_width);
@@ -204,12 +194,7 @@ pixel_to_char_size (ew, pixel_width, pixel_height, char_width, char_height)
}
static void
-char_to_pixel_size (ew, char_width, char_height, pixel_width, pixel_height)
- EmacsFrame ew;
- int char_width;
- int char_height;
- Dimension* pixel_width;
- Dimension* pixel_height;
+char_to_pixel_size (EmacsFrame ew, int char_width, int char_height, Dimension *pixel_width, Dimension *pixel_height)
{
struct frame* f = ew->emacs_frame.frame;
*pixel_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, char_width);
@@ -217,12 +202,7 @@ char_to_pixel_size (ew, char_width, char_height, pixel_width, pixel_height)
}
static void
-round_size_to_char (ew, in_width, in_height, out_width, out_height)
- EmacsFrame ew;
- Dimension in_width;
- Dimension in_height;
- Dimension* out_width;
- Dimension* out_height;
+round_size_to_char (EmacsFrame ew, Dimension in_width, Dimension in_height, Dimension *out_width, Dimension *out_height)
{
int char_width;
int char_height;
@@ -231,8 +211,7 @@ round_size_to_char (ew, in_width, in_height, out_width, out_height)
}
static Widget
-get_wm_shell (w)
- Widget w;
+get_wm_shell (Widget w)
{
Widget wmshell;
@@ -269,8 +248,7 @@ static Boolean first_frame_p = True;
#endif
static void
-set_frame_size (ew)
- EmacsFrame ew;
+set_frame_size (EmacsFrame ew)
{
/* The widget hierarchy is
@@ -491,8 +469,7 @@ set_frame_size (ew)
int update_hints_inhibit;
static void
-update_wm_hints (ew)
- EmacsFrame ew;
+update_wm_hints (EmacsFrame ew)
{
Widget wmshell = get_wm_shell ((Widget)ew);
int cw;
@@ -570,8 +547,7 @@ static char setup_frame_cursor_bits[] =
};
static void
-setup_frame_gcs (ew)
- EmacsFrame ew;
+setup_frame_gcs (EmacsFrame ew)
{
XGCValues gc_values;
struct frame* s = ew->emacs_frame.frame;
@@ -649,8 +625,7 @@ setup_frame_gcs (ew)
}
static void
-update_various_frame_slots (ew)
- EmacsFrame ew;
+update_various_frame_slots (EmacsFrame ew)
{
struct frame *f = ew->emacs_frame.frame;
struct x_output *x = f->output_data.x;
@@ -661,8 +636,7 @@ update_various_frame_slots (ew)
}
static void
-update_from_various_frame_slots (ew)
- EmacsFrame ew;
+update_from_various_frame_slots (EmacsFrame ew)
{
struct frame *f = ew->emacs_frame.frame;
struct x_output *x = f->output_data.x;
@@ -677,11 +651,7 @@ update_from_various_frame_slots (ew)
}
static void
-EmacsFrameInitialize (request, new, dum1, dum2)
- Widget request;
- Widget new;
- ArgList dum1;
- Cardinal *dum2;
+EmacsFrameInitialize (Widget request, Widget new, ArgList dum1, Cardinal *dum2)
{
EmacsFrame ew = (EmacsFrame)new;
@@ -698,10 +668,7 @@ EmacsFrameInitialize (request, new, dum1, dum2)
static void
-EmacsFrameRealize (widget, mask, attrs)
- Widget widget;
- XtValueMask *mask;
- XSetWindowAttributes *attrs;
+EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs)
{
EmacsFrame ew = (EmacsFrame)widget;
@@ -717,11 +684,10 @@ EmacsFrameRealize (widget, mask, attrs)
update_wm_hints (ew);
}
-extern void free_frame_faces (/* struct frame * */);
+extern void free_frame_faces (struct frame *);
static void
-EmacsFrameDestroy (widget)
- Widget widget;
+EmacsFrameDestroy (Widget widget)
{
EmacsFrame ew = (EmacsFrame) widget;
struct frame* s = ew->emacs_frame.frame;
@@ -739,8 +705,7 @@ EmacsFrameDestroy (widget)
}
void
-EmacsFrameResize (widget)
- Widget widget;
+EmacsFrameResize (Widget widget)
{
EmacsFrame ew = (EmacsFrame)widget;
struct frame *f = ew->emacs_frame.frame;
@@ -756,12 +721,7 @@ EmacsFrameResize (widget)
}
static Boolean
-EmacsFrameSetValues (cur_widget, req_widget, new_widget, dum1, dum2)
- Widget cur_widget;
- Widget req_widget;
- Widget new_widget;
- ArgList dum1;
- Cardinal *dum2;
+EmacsFrameSetValues (Widget cur_widget, Widget req_widget, Widget new_widget, ArgList dum1, Cardinal *dum2)
{
EmacsFrame cur = (EmacsFrame)cur_widget;
EmacsFrame new = (EmacsFrame)new_widget;
@@ -834,10 +794,7 @@ EmacsFrameSetValues (cur_widget, req_widget, new_widget, dum1, dum2)
}
static XtGeometryResult
-EmacsFrameQueryGeometry (widget, request, result)
- Widget widget;
- XtWidgetGeometry* request;
- XtWidgetGeometry* result;
+EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *result)
{
EmacsFrame ew = (EmacsFrame)widget;
@@ -867,10 +824,7 @@ EmacsFrameQueryGeometry (widget, request, result)
/* Special entrypoints */
void
-EmacsFrameSetCharSize (widget, columns, rows)
- Widget widget;
- int columns;
- int rows;
+EmacsFrameSetCharSize (Widget widget, int columns, int rows)
{
EmacsFrame ew = (EmacsFrame) widget;
struct frame *f = ew->emacs_frame.frame;
@@ -880,8 +834,7 @@ EmacsFrameSetCharSize (widget, columns, rows)
void
-widget_store_internal_border (widget)
- Widget widget;
+widget_store_internal_border (Widget widget)
{
EmacsFrame ew = (EmacsFrame) widget;
FRAME_PTR f = ew->emacs_frame.frame;
diff --git a/src/widget.h b/src/widget.h
index 00c08914059..a1ddeb2e94f 100644
--- a/src/widget.h
+++ b/src/widget.h
@@ -94,8 +94,8 @@ extern WidgetClass emacsFrameClass;
extern struct _DisplayContext* display_context;
/* Special entrypoints */
-void EmacsFrameSetCharSize P_ ((Widget, int, int));
-void widget_store_internal_border P_ ((Widget widget));
+void EmacsFrameSetCharSize (Widget, int, int);
+void widget_store_internal_border (Widget widget);
#endif /* _EmacsFrame_h */
diff --git a/src/window.c b/src/window.c
index c105e37c462..89563112628 100644
--- a/src/window.c
+++ b/src/window.c
@@ -59,32 +59,32 @@ Lisp_Object Qwindow_size_fixed;
extern Lisp_Object Qleft_margin, Qright_margin;
-static int displayed_window_lines P_ ((struct window *));
-static struct window *decode_window P_ ((Lisp_Object));
-static int count_windows P_ ((struct window *));
-static int get_leaf_windows P_ ((struct window *, struct window **, int));
-static void window_scroll P_ ((Lisp_Object, int, int, int));
-static void window_scroll_pixel_based P_ ((Lisp_Object, int, int, int));
-static void window_scroll_line_based P_ ((Lisp_Object, int, int, int));
-static int window_min_size_1 P_ ((struct window *, int, int));
-static int window_min_size_2 P_ ((struct window *, int, int));
-static int window_min_size P_ ((struct window *, int, int, int, int *));
-static void size_window P_ ((Lisp_Object, int, int, int, int, int));
-static int freeze_window_start P_ ((struct window *, void *));
-static int window_fixed_size_p P_ ((struct window *, int, int));
-static void enlarge_window P_ ((Lisp_Object, int, int));
-static Lisp_Object window_list P_ ((void));
-static int add_window_to_list P_ ((struct window *, void *));
-static int candidate_window_p P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
- Lisp_Object));
-static Lisp_Object next_window P_ ((Lisp_Object, Lisp_Object,
- Lisp_Object, int));
-static void decode_next_window_args P_ ((Lisp_Object *, Lisp_Object *,
- Lisp_Object *));
-static int foreach_window_1 P_ ((struct window *,
- int (* fn) (struct window *, void *),
- void *));
-static Lisp_Object window_list_1 P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
+static int displayed_window_lines (struct window *);
+static struct window *decode_window (Lisp_Object);
+static int count_windows (struct window *);
+static int get_leaf_windows (struct window *, struct window **, int);
+static void window_scroll (Lisp_Object, int, int, int);
+static void window_scroll_pixel_based (Lisp_Object, int, int, int);
+static void window_scroll_line_based (Lisp_Object, int, int, int);
+static int window_min_size_1 (struct window *, int, int);
+static int window_min_size_2 (struct window *, int, int);
+static int window_min_size (struct window *, int, int, int, int *);
+static void size_window (Lisp_Object, int, int, int, int, int);
+static int freeze_window_start (struct window *, void *);
+static int window_fixed_size_p (struct window *, int, int);
+static void enlarge_window (Lisp_Object, int, int);
+static Lisp_Object window_list (void);
+static int add_window_to_list (struct window *, void *);
+static int candidate_window_p (Lisp_Object, Lisp_Object, Lisp_Object,
+ Lisp_Object);
+static Lisp_Object next_window (Lisp_Object, Lisp_Object,
+ Lisp_Object, int);
+static void decode_next_window_args (Lisp_Object *, Lisp_Object *,
+ Lisp_Object *);
+static int foreach_window_1 (struct window *,
+ int (* fn) (struct window *, void *),
+ void *);
+static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object);
/* This is the window in which the terminal's cursor should
be left when nothing is being done with it. This must
@@ -205,22 +205,20 @@ extern Lisp_Object Qtty;
DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0,
doc: /* Return t if OBJECT is a window. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
return WINDOWP (object) ? Qt : Qnil;
}
DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0,
doc: /* Return t if OBJECT is a window which is currently visible. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
return WINDOW_LIVE_P (object) ? Qt : Qnil;
}
Lisp_Object
-make_window ()
+make_window (void)
{
Lisp_Object val;
register struct window *p;
@@ -243,9 +241,9 @@ make_window ()
p->dedicated = Qnil;
p->window_parameters = Qnil;
p->pseudo_window_p = 0;
- bzero (&p->cursor, sizeof (p->cursor));
- bzero (&p->last_cursor, sizeof (p->last_cursor));
- bzero (&p->phys_cursor, sizeof (p->phys_cursor));
+ memset (&p->cursor, 0, sizeof (p->cursor));
+ memset (&p->last_cursor, 0, sizeof (p->last_cursor));
+ memset (&p->phys_cursor, 0, sizeof (p->phys_cursor));
p->desired_matrix = p->current_matrix = 0;
p->nrows_scale_factor = p->ncols_scale_factor = 1;
p->phys_cursor_type = -1;
@@ -274,7 +272,7 @@ make_window ()
DEFUN ("selected-window", Fselected_window, Sselected_window, 0, 0, 0,
doc: /* Return the window that the cursor now appears in and commands apply to. */)
- ()
+ (void)
{
return selected_window;
}
@@ -283,8 +281,7 @@ DEFUN ("minibuffer-window", Fminibuffer_window, Sminibuffer_window, 0, 1, 0,
doc: /* Return the window used now for minibuffers.
If the optional argument FRAME is specified, return the minibuffer window
used by that frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
if (NILP (frame))
frame = selected_frame;
@@ -295,8 +292,7 @@ used by that frame. */)
DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, Swindow_minibuffer_p, 0, 1, 0,
doc: /* Return non-nil if WINDOW is a minibuffer window.
WINDOW defaults to the selected window. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
struct window *w = decode_window (window);
return MINI_WINDOW_P (w) ? Qt : Qnil;
@@ -320,8 +316,7 @@ of the window. The remaining elements are omitted if the character after
POS is fully visible; otherwise, RTOP and RBOT are the number of pixels
off-window at the top and bottom of the row, ROWH is the height of the
display row, and VPOS is the row number (0-based) containing POS. */)
- (pos, window, partially)
- Lisp_Object pos, window, partially;
+ (Lisp_Object pos, Lisp_Object window, Lisp_Object partially)
{
register struct window *w;
register int posint;
@@ -389,8 +384,7 @@ of the (first) text line, YPOS is negative.
Return nil if window display is not up-to-date. In that case, use
`pos-visible-in-window-p' to obtain the information. */)
- (line, window)
- Lisp_Object line, window;
+ (Lisp_Object line, Lisp_Object window)
{
register struct window *w;
register struct buffer *b;
@@ -483,8 +477,7 @@ Return nil if window display is not up-to-date. In that case, use
static struct window *
-decode_window (window)
- register Lisp_Object window;
+decode_window (register Lisp_Object window)
{
if (NILP (window))
return XWINDOW (selected_window);
@@ -494,8 +487,7 @@ decode_window (window)
}
static struct window *
-decode_any_window (window)
- register Lisp_Object window;
+decode_any_window (register Lisp_Object window)
{
if (NILP (window))
return XWINDOW (selected_window);
@@ -507,8 +499,7 @@ decode_any_window (window)
DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
doc: /* Return the buffer that WINDOW is displaying.
WINDOW defaults to the selected window. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
return decode_window (window)->buffer;
}
@@ -518,8 +509,7 @@ DEFUN ("window-height", Fwindow_height, Swindow_height, 0, 1, 0,
WINDOW defaults to the selected window.
The return value includes WINDOW's mode line and header line, if any. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
return decode_any_window (window)->total_lines;
}
@@ -531,8 +521,7 @@ WINDOW defaults to the selected window.
Note: The return value is the number of columns available for text in
WINDOW. If you want to find out how many columns WINDOW takes up, use
(let ((edges (window-edges))) (- (nth 2 edges) (nth 0 edges))). */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
return make_number (window_box_text_cols (decode_any_window (window)));
}
@@ -540,8 +529,7 @@ WINDOW. If you want to find out how many columns WINDOW takes up, use
DEFUN ("window-full-width-p", Fwindow_full_width_p, Swindow_full_width_p, 0, 1, 0,
doc: /* Return t if WINDOW is as wide as its frame.
WINDOW defaults to the selected window. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
return WINDOW_FULL_WIDTH_P (decode_any_window (window)) ? Qt : Qnil;
}
@@ -549,8 +537,7 @@ WINDOW defaults to the selected window. */)
DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0,
doc: /* Return the number of columns by which WINDOW is scrolled from left margin.
WINDOW defaults to the selected window. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
return decode_window (window)->hscroll;
}
@@ -561,8 +548,7 @@ Return NCOL. NCOL should be zero or positive.
Note that if `automatic-hscrolling' is non-nil, you cannot scroll the
window so that the location of point moves off-window. */)
- (window, ncol)
- Lisp_Object window, ncol;
+ (Lisp_Object window, Lisp_Object ncol)
{
struct window *w = decode_window (window);
int hscroll;
@@ -583,8 +569,7 @@ DEFUN ("window-redisplay-end-trigger", Fwindow_redisplay_end_trigger,
doc: /* Return WINDOW's redisplay end trigger value.
WINDOW defaults to the selected window.
See `set-window-redisplay-end-trigger' for more information. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
return decode_window (window)->redisplay_end_trigger;
}
@@ -597,8 +582,7 @@ If it is a buffer position, then if redisplay in WINDOW reaches a position
beyond VALUE, the functions in `redisplay-end-trigger-functions' are called
with two arguments: WINDOW, and the end trigger value.
Afterwards the end-trigger value is reset to nil. */)
- (window, value)
- register Lisp_Object window, value;
+ (register Lisp_Object window, Lisp_Object value)
{
register struct window *w;
@@ -618,8 +602,7 @@ BOTTOM is one more than the bottommost row occupied by WINDOW.
The edges include the space used by WINDOW's scroll bar, display
margins, fringes, header line, and/or mode line. For the edges of
just the text area, use `window-inside-edges'. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
register struct window *w = decode_any_window (window);
@@ -640,8 +623,7 @@ BOTTOM is one more than the bottommost y position occupied by WINDOW.
The pixel edges include the space used by WINDOW's scroll bar, display
margins, fringes, header line, and/or mode line. For the pixel edges
of just the text area, use `window-inside-pixel-edges'. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
register struct window *w = decode_any_window (window);
@@ -652,6 +634,47 @@ of just the text area, use `window-inside-pixel-edges'. */)
Qnil))));
}
+static void
+calc_absolute_offset(struct window *w, int *add_x, int *add_y)
+{
+ struct frame *f = XFRAME (w->frame);
+ *add_y = f->top_pos;
+#ifdef FRAME_MENUBAR_HEIGHT
+ *add_y += FRAME_MENUBAR_HEIGHT (f);
+#endif
+#ifdef FRAME_TOOLBAR_HEIGHT
+ *add_y += FRAME_TOOLBAR_HEIGHT (f);
+#endif
+#ifdef FRAME_NS_TITLEBAR_HEIGHT
+ *add_y += FRAME_NS_TITLEBAR_HEIGHT (f);
+#endif
+ *add_x = f->left_pos;
+}
+
+DEFUN ("window-absolute-pixel-edges", Fwindow_absolute_pixel_edges,
+ Swindow_absolute_pixel_edges, 0, 1, 0,
+ doc: /* Return a list of the edge pixel coordinates of WINDOW.
+The list has the form (LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at
+the top left corner of the display.
+
+RIGHT is one more than the rightmost x position occupied by WINDOW.
+BOTTOM is one more than the bottommost y position occupied by WINDOW.
+The pixel edges include the space used by WINDOW's scroll bar, display
+margins, fringes, header line, and/or mode line. For the pixel edges
+of just the text area, use `window-inside-absolute-pixel-edges'. */)
+ (Lisp_Object window)
+{
+ register struct window *w = decode_any_window (window);
+ int add_x, add_y;
+ calc_absolute_offset (w, &add_x, &add_y);
+
+ return Fcons (make_number (WINDOW_LEFT_EDGE_X (w) + add_x),
+ Fcons (make_number (WINDOW_TOP_EDGE_Y (w) + add_y),
+ Fcons (make_number (WINDOW_RIGHT_EDGE_X (w) + add_x),
+ Fcons (make_number (WINDOW_BOTTOM_EDGE_Y (w) + add_y),
+ Qnil))));
+}
+
DEFUN ("window-inside-edges", Fwindow_inside_edges, Swindow_inside_edges, 0, 1, 0,
doc: /* Return a list of the edge coordinates of WINDOW.
The list has the form (LEFT TOP RIGHT BOTTOM).
@@ -662,8 +685,7 @@ RIGHT is one more than the rightmost column of WINDOW's text area.
BOTTOM is one more than the bottommost row of WINDOW's text area.
The inside edges do not include the space used by the WINDOW's scroll
bar, display margins, fringes, header line, and/or mode line. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
register struct window *w = decode_any_window (window);
@@ -688,8 +710,7 @@ RIGHT is one more than the rightmost x position of WINDOW's text area.
BOTTOM is one more than the bottommost y position of WINDOW's text area.
The inside edges do not include the space used by WINDOW's scroll bar,
display margins, fringes, header line, and/or mode line. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
register struct window *w = decode_any_window (window);
@@ -705,6 +726,35 @@ display margins, fringes, header line, and/or mode line. */)
- WINDOW_MODE_LINE_HEIGHT (w)));
}
+DEFUN ("window-inside-absolute-pixel-edges",
+ Fwindow_inside_absolute_pixel_edges,
+ Swindow_inside_absolute_pixel_edges, 0, 1, 0,
+ doc: /* Return a list of the edge pixel coordinates of WINDOW.
+The list has the form (LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at
+the top left corner of the display.
+
+RIGHT is one more than the rightmost x position of WINDOW's text area.
+BOTTOM is one more than the bottommost y position of WINDOW's text area.
+The inside edges do not include the space used by WINDOW's scroll bar,
+display margins, fringes, header line, and/or mode line. */)
+ (Lisp_Object window)
+{
+ register struct window *w = decode_any_window (window);
+ int add_x, add_y;
+ calc_absolute_offset (w, &add_x, &add_y);
+
+ return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w)
+ + WINDOW_LEFT_MARGIN_WIDTH (w)
+ + WINDOW_LEFT_FRINGE_WIDTH (w) + add_x),
+ make_number (WINDOW_TOP_EDGE_Y (w)
+ + WINDOW_HEADER_LINE_HEIGHT (w) + add_y),
+ make_number (WINDOW_BOX_RIGHT_EDGE_X (w)
+ - WINDOW_RIGHT_MARGIN_WIDTH (w)
+ - WINDOW_RIGHT_FRINGE_WIDTH (w) + add_x),
+ make_number (WINDOW_BOTTOM_EDGE_Y (w)
+ - WINDOW_MODE_LINE_HEIGHT (w) + add_y));
+}
+
/* Test if the character at column *X, row *Y is within window W.
If it is not, return ON_NOTHING;
if it is in the window's text area,
@@ -727,9 +777,7 @@ display margins, fringes, header line, and/or mode line. */)
X and Y are frame relative pixel coordinates. */
static enum window_part
-coordinates_in_window (w, x, y)
- register struct window *w;
- register int *x, *y;
+coordinates_in_window (register struct window *w, register int *x, register int *y)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
int left_x, right_x, top_y, bottom_y;
@@ -934,8 +982,7 @@ If they are on the border between WINDOW and its right sibling,
`vertical-line' is returned.
If they are in the windows's left or right marginal areas, `left-margin'\n\
or `right-margin' is returned. */)
- (coordinates, window)
- register Lisp_Object coordinates, window;
+ (register Lisp_Object coordinates, Lisp_Object window)
{
struct window *w;
struct frame *f;
@@ -1012,9 +1059,7 @@ struct check_window_data
};
static int
-check_window_containing (w, user_data)
- struct window *w;
- void *user_data;
+check_window_containing (struct window *w, void *user_data)
{
struct check_window_data *cw = (struct check_window_data *) user_data;
enum window_part found;
@@ -1052,12 +1097,7 @@ check_window_containing (w, user_data)
case. */
Lisp_Object
-window_from_coordinates (f, x, y, part, wx, wy, tool_bar_p)
- struct frame *f;
- int x, y;
- enum window_part *part;
- int *wx, *wy;
- int tool_bar_p;
+window_from_coordinates (struct frame *f, int x, int y, enum window_part *part, int *wx, int *wy, int tool_bar_p)
{
Lisp_Object window;
struct check_window_data cw;
@@ -1094,8 +1134,7 @@ DEFUN ("window-at", Fwindow_at, Swindow_at, 2, 3, 0,
If omitted, FRAME defaults to the currently selected frame.
The top left corner of the frame is considered to be row 0,
column 0. */)
- (x, y, frame)
- Lisp_Object x, y, frame;
+ (Lisp_Object x, Lisp_Object y, Lisp_Object frame)
{
struct frame *f;
@@ -1128,8 +1167,7 @@ is also currently selected, the value returned is the same as (point).
It would be more strictly correct to return the `top-level' value
of point, outside of any save-excursion forms.
But that is hard to define. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
register struct window *w = decode_window (window);
@@ -1143,8 +1181,7 @@ DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0,
doc: /* Return position at which display currently starts in WINDOW.
WINDOW defaults to the selected window.
This is updated by redisplay or by calling `set-window-start'. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
return Fmarker_position (decode_window (window)->start);
}
@@ -1170,8 +1207,7 @@ Return nil if there is no recorded value. \(This can happen if the
last redisplay of WINDOW was preempted, and did not finish.)
If UPDATE is non-nil, compute the up-to-date position
if it isn't already recorded. */)
- (window, update)
- Lisp_Object window, update;
+ (Lisp_Object window, Lisp_Object update)
{
Lisp_Object value;
struct window *w = decode_window (window);
@@ -1239,8 +1275,7 @@ if it isn't already recorded. */)
DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0,
doc: /* Make point value in WINDOW be at position POS in WINDOW's buffer.
Return POS. */)
- (window, pos)
- Lisp_Object window, pos;
+ (Lisp_Object window, Lisp_Object pos)
{
register struct window *w = decode_window (window);
@@ -1264,8 +1299,7 @@ DEFUN ("set-window-start", Fset_window_start, Sset_window_start, 2, 3, 0,
WINDOW defaults to the selected window. Return POS.
Optional third arg NOFORCE non-nil inhibits next redisplay from
overriding motion of point in order to display at this exact start. */)
- (window, pos, noforce)
- Lisp_Object window, pos, noforce;
+ (Lisp_Object window, Lisp_Object pos, Lisp_Object noforce)
{
register struct window *w = decode_window (window);
@@ -1303,8 +1337,7 @@ from displaying another buffer in it. `get-lru-window' and
Functions like `set-window-buffer' may change the buffer displayed by a
window, unless that window is "strongly" dedicated to its buffer, that
is the value returned by `window-dedicated-p' is t. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
return decode_window (window)->dedicated;
}
@@ -1328,8 +1361,7 @@ its buffer. Functions like `set-window-buffer' may change the buffer
displayed by a window, unless that window is strongly dedicated to its
buffer. If and when `set-window-buffer' displays another buffer in a
window, it also makes sure that the window is not marked as dedicated. */)
- (window, flag)
- Lisp_Object window, flag;
+ (Lisp_Object window, Lisp_Object flag)
{
register struct window *w = decode_window (window);
@@ -1343,8 +1375,7 @@ DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters,
doc: /* Return the parameters of WINDOW and their values.
WINDOW defaults to the selected window. The return value is a list of
elements of the form (PARAMETER . VALUE). */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
return Fcopy_alist (decode_window (window)->window_parameters);
}
@@ -1353,8 +1384,7 @@ DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter,
2, 2, 0,
doc: /* Return WINDOW's value for PARAMETER.
WINDOW defaults to the selected window. */)
- (window, parameter)
- Lisp_Object window, parameter;
+ (Lisp_Object window, Lisp_Object parameter)
{
Lisp_Object result;
@@ -1366,8 +1396,7 @@ DEFUN ("set-window-parameter", Fset_window_parameter,
Sset_window_parameter, 3, 3, 0,
doc: /* Set WINDOW's value of PARAMETER to VALUE.
WINDOW defaults to the selected window. Return VALUE. */)
- (window, parameter, value)
- Lisp_Object window, parameter, value;
+ (Lisp_Object window, Lisp_Object parameter, Lisp_Object value)
{
register struct window *w = decode_window (window);
Lisp_Object old_alist_elt;
@@ -1385,8 +1414,7 @@ DEFUN ("window-display-table", Fwindow_display_table, Swindow_display_table,
0, 1, 0,
doc: /* Return the display-table that WINDOW is using.
WINDOW defaults to the selected window. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
return decode_window (window)->display_table;
}
@@ -1397,8 +1425,7 @@ WINDOW defaults to the selected window. */)
return 0. */
struct Lisp_Char_Table *
-window_display_table (w)
- struct window *w;
+window_display_table (struct window *w)
{
struct Lisp_Char_Table *dp = NULL;
@@ -1419,8 +1446,7 @@ window_display_table (w)
DEFUN ("set-window-display-table", Fset_window_display_table, Sset_window_display_table, 2, 2, 0,
doc: /* Set WINDOW's display-table to TABLE. */)
- (window, table)
- register Lisp_Object window, table;
+ (register Lisp_Object window, Lisp_Object table)
{
register struct window *w;
@@ -1432,8 +1458,7 @@ DEFUN ("set-window-display-table", Fset_window_display_table, Sset_window_displa
/* Record info on buffer window w is displaying
when it is about to cease to display that buffer. */
static void
-unshow_buffer (w)
- register struct window *w;
+unshow_buffer (register struct window *w)
{
Lisp_Object buf;
struct buffer *b;
@@ -1481,8 +1506,7 @@ unshow_buffer (w)
/* Put replacement into the window structure in place of old. */
static void
-replace_window (old, replacement)
- Lisp_Object old, replacement;
+replace_window (Lisp_Object old, Lisp_Object replacement)
{
register Lisp_Object tem;
register struct window *o = XWINDOW (old), *p = XWINDOW (replacement);
@@ -1499,9 +1523,9 @@ replace_window (old, replacement)
p->total_lines = o->total_lines;
p->desired_matrix = p->current_matrix = 0;
p->vscroll = 0;
- bzero (&p->cursor, sizeof (p->cursor));
- bzero (&p->last_cursor, sizeof (p->last_cursor));
- bzero (&p->phys_cursor, sizeof (p->phys_cursor));
+ memset (&p->cursor, 0, sizeof (p->cursor));
+ memset (&p->last_cursor, 0, sizeof (p->last_cursor));
+ memset (&p->phys_cursor, 0, sizeof (p->phys_cursor));
p->phys_cursor_type = -1;
p->phys_cursor_width = -1;
p->must_be_updated_p = 0;
@@ -1538,8 +1562,7 @@ DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "",
doc: /* Remove WINDOW from its frame.
WINDOW defaults to the selected window. Return nil.
Signal an error when WINDOW is the only window on its frame. */)
- (window)
- register Lisp_Object window;
+ (register Lisp_Object window)
{
struct frame *f;
if (NILP (window))
@@ -1556,8 +1579,7 @@ Signal an error when WINDOW is the only window on its frame. */)
}
void
-delete_window (window)
- register Lisp_Object window;
+delete_window (register Lisp_Object window)
{
register Lisp_Object tem, parent, sib;
register struct window *p;
@@ -1771,9 +1793,7 @@ delete_window (window)
function window_list. */
static int
-add_window_to_list (w, user_data)
- struct window *w;
- void *user_data;
+add_window_to_list (struct window *w, void *user_data)
{
Lisp_Object *list = (Lisp_Object *) user_data;
Lisp_Object window;
@@ -1788,7 +1808,7 @@ add_window_to_list (w, user_data)
list, cache it in Vwindow_list, and return that. */
static Lisp_Object
-window_list ()
+window_list (void)
{
if (!CONSP (Vwindow_list))
{
@@ -1829,8 +1849,7 @@ window_list ()
a frame means consider windows on that frame, only. */
static int
-candidate_window_p (window, owindow, minibuf, all_frames)
- Lisp_Object window, owindow, minibuf, all_frames;
+candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf, Lisp_Object all_frames)
{
struct window *w = XWINDOW (window);
struct frame *f = XFRAME (w->frame);
@@ -1895,8 +1914,7 @@ candidate_window_p (window, owindow, minibuf, all_frames)
ALL_FRAMES. */
static void
-decode_next_window_args (window, minibuf, all_frames)
- Lisp_Object *window, *minibuf, *all_frames;
+decode_next_window_args (Lisp_Object *window, Lisp_Object *minibuf, Lisp_Object *all_frames)
{
if (NILP (*window))
*window = selected_window;
@@ -1942,9 +1960,7 @@ decode_next_window_args (window, minibuf, all_frames)
ALL_FRAMES. */
static Lisp_Object
-next_window (window, minibuf, all_frames, next_p)
- Lisp_Object window, minibuf, all_frames;
- int next_p;
+next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames, int next_p)
{
decode_next_window_args (&window, &minibuf, &all_frames);
@@ -2043,8 +2059,7 @@ If you use consistent values for MINIBUF and ALL-FRAMES, you can use
`next-window' to iterate through the entire cycle of acceptable
windows, eventually ending up back at the window you started with.
`previous-window' traverses the same cycle, in the reverse order. */)
- (window, minibuf, all_frames)
- Lisp_Object window, minibuf, all_frames;
+ (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
{
return next_window (window, minibuf, all_frames, 1);
}
@@ -2061,8 +2076,7 @@ use `previous-window' to iterate through the entire cycle of
acceptable windows, eventually ending up back at the window you
started with. `next-window' traverses the same cycle, in the
reverse order. */)
- (window, minibuf, all_frames)
- Lisp_Object window, minibuf, all_frames;
+ (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
{
return next_window (window, minibuf, all_frames, 0);
}
@@ -2081,8 +2095,7 @@ This function uses `next-window' for finding the window to select.
The argument ALL-FRAMES has the same meaning as in `next-window',
but the MINIBUF argument of `next-window' is always effectively
nil. */)
- (count, all_frames)
- Lisp_Object count, all_frames;
+ (Lisp_Object count, Lisp_Object all_frames)
{
Lisp_Object window;
int i;
@@ -2108,8 +2121,7 @@ MINIBUF t means include the minibuffer window, even if it isn't active.
MINIBUF nil or omitted means include the minibuffer window only
if it's active.
MINIBUF neither nil nor t means never include the minibuffer window. */)
- (frame, minibuf, window)
- Lisp_Object frame, minibuf, window;
+ (Lisp_Object frame, Lisp_Object minibuf, Lisp_Object window)
{
if (NILP (window))
window = FRAMEP (frame) ? XFRAME (frame)->selected_window : selected_window;
@@ -2128,8 +2140,7 @@ MINIBUF neither nil nor t means never include the minibuffer window. */)
for `next-window'. */
static Lisp_Object
-window_list_1 (window, minibuf, all_frames)
- Lisp_Object window, minibuf, all_frames;
+window_list_1 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
{
Lisp_Object tail, list, rest;
@@ -2177,10 +2188,7 @@ enum window_loop
};
static Lisp_Object
-window_loop (type, obj, mini, frames)
- enum window_loop type;
- Lisp_Object obj, frames;
- int mini;
+window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frames)
{
Lisp_Object window, windows, best_window, frame_arg;
struct frame *f;
@@ -2407,7 +2415,7 @@ window_loop (type, obj, mini, frames)
/* Used for debugging. Abort if any window has a dead buffer. */
void
-check_all_windows ()
+check_all_windows (void)
{
window_loop (CHECK_ALL_WINDOWS, Qnil, 1, Qt);
}
@@ -2425,8 +2433,7 @@ If FRAME is 0, search all visible and iconified frames.
If FRAME is t, search all frames.
If FRAME is nil, search only the selected frame.
If FRAME is a frame, search only that frame. */)
- (frame, dedicated)
- Lisp_Object frame, dedicated;
+ (Lisp_Object frame, Lisp_Object dedicated)
{
register Lisp_Object w;
/* First try for a window that is full-width */
@@ -2451,8 +2458,7 @@ If FRAME is 0, search all visible and iconified frames.
If FRAME is t, search all frames.
If FRAME is nil, search only the selected frame.
If FRAME is a frame, search only that frame. */)
- (frame, dedicated)
- Lisp_Object frame, dedicated;
+ (Lisp_Object frame, Lisp_Object dedicated)
{
return window_loop (GET_LARGEST_WINDOW, dedicated, 0,
frame);
@@ -2467,8 +2473,7 @@ If optional argument FRAME is 0, search all visible and iconified frames.
If FRAME is t, search all frames.
If FRAME is nil, search only the selected frame.
If FRAME is a frame, search only that frame. */)
- (buffer_or_name, frame)
- Lisp_Object buffer_or_name, frame;
+ (Lisp_Object buffer_or_name, Lisp_Object frame)
{
Lisp_Object buffer;
@@ -2492,8 +2497,7 @@ previously visible in WINDOW in the same place on the frame. Doing this
depends on the value of (window-start WINDOW), so if calling this
function in a program gives strange scrolling, make sure the
window-start value is reasonable when this function is called. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
struct window *w;
int startpos;
@@ -2560,8 +2564,7 @@ If FRAME is t, search only the selected frame.
If FRAME is a frame, search only that frame.
When a window showing BUFFER-OR-NAME is dedicated and the only window of
its frame, that frame is deleted when there are other frames left. */)
- (buffer_or_name, frame)
- Lisp_Object buffer_or_name, frame;
+ (Lisp_Object buffer_or_name, Lisp_Object frame)
{
Lisp_Object buffer;
@@ -2596,8 +2599,7 @@ When a window showing BUFFER-OR-NAME is dedicated that window is
deleted. If that window is the only window on its frame, that frame is
deleted too when there are other frames left. If there are no other
frames left, some other buffer is displayed in that window. */)
- (buffer_or_name)
- Lisp_Object buffer_or_name;
+ (Lisp_Object buffer_or_name)
{
Lisp_Object buffer;
@@ -2618,8 +2620,7 @@ frames left, some other buffer is displayed in that window. */)
of all frames, even those on other keyboards. */
void
-replace_buffer_in_all_windows (buffer)
- Lisp_Object buffer;
+replace_buffer_in_all_windows (Lisp_Object buffer)
{
Lisp_Object tail, frame;
@@ -2648,9 +2649,7 @@ replace_buffer_in_all_windows (buffer)
minimum allowable size. */
void
-check_frame_size (frame, rows, cols)
- FRAME_PTR frame;
- int *rows, *cols;
+check_frame_size (FRAME_PTR frame, int *rows, int *cols)
{
/* For height, we have to see:
how many windows the frame has at minimum (one or two),
@@ -2676,9 +2675,7 @@ check_frame_size (frame, rows, cols)
either. */
static int
-window_fixed_size_p (w, width_p, check_siblings_p)
- struct window *w;
- int width_p, check_siblings_p;
+window_fixed_size_p (struct window *w, int width_p, int check_siblings_p)
{
int fixed_p;
struct window *c;
@@ -2778,9 +2775,7 @@ window_fixed_size_p (w, width_p, check_siblings_p)
minibuffer window, always return 1. */
static int
-window_min_size_2 (w, width_p, safe_p)
- struct window *w;
- int width_p, safe_p;
+window_min_size_2 (struct window *w, int width_p, int safe_p)
{
/* We should consider buffer-local values of window_min_height and
window_min_width here. */
@@ -2814,9 +2809,7 @@ window_min_size_2 (w, width_p, safe_p)
sizes of W's children. */
static int
-window_min_size_1 (w, width_p, safe_p)
- struct window *w;
- int width_p, safe_p;
+window_min_size_1 (struct window *w, int width_p, int safe_p)
{
struct window *c;
int size;
@@ -2891,9 +2884,7 @@ window_min_size_1 (w, width_p, safe_p)
to 1 if W is fixed-size unless FIXED is null. */
static int
-window_min_size (w, width_p, safe_p, ignore_fixed_p, fixed)
- struct window *w;
- int width_p, safe_p, ignore_fixed_p, *fixed;
+window_min_size (struct window *w, int width_p, int safe_p, int ignore_fixed_p, int *fixed)
{
int size, fixed_p;
@@ -2919,8 +2910,7 @@ window_min_size (w, width_p, safe_p, ignore_fixed_p, fixed)
is still too narrow. */
static int
-adjust_window_margins (w)
- struct window *w;
+adjust_window_margins (struct window *w)
{
int box_cols = (WINDOW_TOTAL_COLS (w)
- WINDOW_FRINGE_COLS (w)
@@ -2974,11 +2964,8 @@ adjust_window_margins (w)
a specific window, it will attempt to strictly resize that window
proportionally, even at the expense of deleting smaller windows. */
static int *
-shrink_windows (total, size, nchildren, shrinkable, resize_fixed_p,
- forward, width_p, safe_p)
- int total, size, nchildren, shrinkable;
- int resize_fixed_p, width_p, safe_p;
- Lisp_Object forward;
+shrink_windows (int total, int size, int nchildren, int shrinkable,
+ int resize_fixed_p, Lisp_Object forward, int width_p, int safe_p)
{
int available_resize = 0;
int *new_sizes, *min_sizes;
@@ -3118,10 +3105,7 @@ shrink_windows (total, size, nchildren, shrinkable, resize_fixed_p,
This should give better behavior when resizing frames. */
static void
-size_window (window, size, width_p, nodelete_p, first_only, last_only)
- Lisp_Object window;
- int size, width_p, nodelete_p;
- int first_only, last_only;
+size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int first_only, int last_only)
{
struct window *w = XWINDOW (window);
struct window *c;
@@ -3312,10 +3296,7 @@ size_window (window, size, width_p, nodelete_p, first_only, last_only)
displayed correctly. */
void
-set_window_height (window, height, nodelete)
- Lisp_Object window;
- int height;
- int nodelete;
+set_window_height (Lisp_Object window, int height, int nodelete)
{
size_window (window, height, 0, nodelete, 0, 0);
}
@@ -3329,10 +3310,7 @@ set_window_height (window, height, nodelete)
displayed correctly. */
void
-set_window_width (window, width, nodelete)
- Lisp_Object window;
- int width;
- int nodelete;
+set_window_width (Lisp_Object window, int width, int nodelete)
{
size_window (window, width, 1, nodelete, 0, 0);
}
@@ -3340,9 +3318,7 @@ set_window_width (window, width, nodelete)
/* Change window heights in windows rooted in WINDOW by N lines. */
void
-change_window_heights (window, n)
- Lisp_Object window;
- int n;
+change_window_heights (Lisp_Object window, int n)
{
struct window *w = XWINDOW (window);
@@ -3438,9 +3414,7 @@ run_window_configuration_change_hook (struct frame *f)
reset from the buffer's local settings. */
void
-set_window_buffer (window, buffer, run_hooks_p, keep_margins_p)
- Lisp_Object window, buffer;
- int run_hooks_p, keep_margins_p;
+set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int keep_margins_p)
{
struct window *w = XWINDOW (window);
struct buffer *b = XBUFFER (buffer);
@@ -3462,7 +3436,7 @@ set_window_buffer (window, buffer, run_hooks_p, keep_margins_p)
XSETFASTINT (w->window_end_pos, 0);
XSETFASTINT (w->window_end_vpos, 0);
- bzero (&w->last_cursor, sizeof w->last_cursor);
+ memset (&w->last_cursor, 0, sizeof w->last_cursor);
w->window_end_valid = Qnil;
if (!(keep_margins_p && samebuf))
{ /* If we're not actually changing the buffer, don't reset hscroll and
@@ -3551,8 +3525,7 @@ already display BUFFER-OR-NAME.
This function runs `window-scroll-functions' before running
`window-configuration-change-hook'. */)
- (window, buffer_or_name, keep_margins)
- register Lisp_Object window, buffer_or_name, keep_margins;
+ (register Lisp_Object window, Lisp_Object buffer_or_name, Lisp_Object keep_margins)
{
register Lisp_Object tem, buffer;
register struct window *w = decode_window (window);
@@ -3595,8 +3568,7 @@ make this window the most recently selected one.
Note that the main editor command loop selects the buffer of the
selected window before each command. */)
- (window, norecord)
- register Lisp_Object window, norecord;
+ (register Lisp_Object window, Lisp_Object norecord)
{
register struct window *w;
register struct window *ow;
@@ -3671,24 +3643,21 @@ selected window before each command. */)
}
static Lisp_Object
-select_window_norecord (window)
- Lisp_Object window;
+select_window_norecord (Lisp_Object window)
{
return WINDOW_LIVE_P (window)
? Fselect_window (window, Qt) : selected_window;
}
static Lisp_Object
-select_frame_norecord (frame)
- Lisp_Object frame;
+select_frame_norecord (Lisp_Object frame)
{
return FRAME_LIVE_P (XFRAME (frame))
? Fselect_frame (frame, Qt) : selected_frame;
}
Lisp_Object
-display_buffer (buffer, not_this_window_p, override_frame)
- Lisp_Object buffer, not_this_window_p, override_frame;
+display_buffer (Lisp_Object buffer, Lisp_Object not_this_window_p, Lisp_Object override_frame)
{
return call3 (Qdisplay_buffer, buffer, not_this_window_p, override_frame);
}
@@ -3699,8 +3668,7 @@ DEFUN ("force-window-update", Fforce_window_update, Sforce_window_update,
If optional arg OBJECT is a window, force redisplay of that window only.
If OBJECT is a buffer or buffer name, force redisplay of all windows
displaying that buffer. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
if (NILP (object))
{
@@ -3739,8 +3707,7 @@ displaying that buffer. */)
void
-temp_output_buffer_show (buf)
- register Lisp_Object buf;
+temp_output_buffer_show (register Lisp_Object buf)
{
register struct buffer *old = current_buffer;
register Lisp_Object window;
@@ -3800,8 +3767,7 @@ temp_output_buffer_show (buf)
}
static void
-make_dummy_parent (window)
- Lisp_Object window;
+make_dummy_parent (Lisp_Object window)
{
Lisp_Object new;
register struct window *o, *p;
@@ -3843,8 +3809,7 @@ The upper or leftmost window is the original one, and remains selected
if it was selected before.
See Info node `(elisp)Splitting Windows' for more details and examples. */)
- (window, size, horizontal)
- Lisp_Object window, size, horizontal;
+ (Lisp_Object window, Lisp_Object size, Lisp_Object horizontal)
{
register Lisp_Object new;
register struct window *o, *p;
@@ -3934,7 +3899,7 @@ See Info node `(elisp)Splitting Windows' for more details and examples. */)
p->parent = o->parent;
p->buffer = Qt;
p->window_end_valid = Qnil;
- bzero (&p->last_cursor, sizeof p->last_cursor);
+ memset (&p->last_cursor, 0, sizeof p->last_cursor);
/* Duplicate special geometry settings. */
@@ -3983,8 +3948,7 @@ window wider by SIZE columns. If SIZE is negative, shrink the window by
This function can delete windows if they get too small. The size of
fixed size windows is not altered by this function. */)
- (size, horizontal)
- Lisp_Object size, horizontal;
+ (Lisp_Object size, Lisp_Object horizontal)
{
CHECK_NUMBER (size);
enlarge_window (selected_window, XINT (size), !NILP (horizontal));
@@ -4003,8 +3967,7 @@ window by -SIZE lines or columns. Return nil.
This function can delete windows if they get too small. The size of
fixed size windows is not altered by this function. */)
- (size, horizontal)
- Lisp_Object size, horizontal;
+ (Lisp_Object size, Lisp_Object horizontal)
{
CHECK_NUMBER (size);
enlarge_window (selected_window, -XINT (size), !NILP (horizontal));
@@ -4015,16 +3978,14 @@ fixed size windows is not altered by this function. */)
}
int
-window_height (window)
- Lisp_Object window;
+window_height (Lisp_Object window)
{
register struct window *p = XWINDOW (window);
return WINDOW_TOTAL_LINES (p);
}
int
-window_width (window)
- Lisp_Object window;
+window_width (Lisp_Object window)
{
register struct window *p = XWINDOW (window);
return WINDOW_TOTAL_COLS (p);
@@ -4046,17 +4007,15 @@ window_width (window)
deleted. */
static void
-enlarge_window (window, delta, horiz_flag)
- Lisp_Object window;
- int delta, horiz_flag;
+enlarge_window (Lisp_Object window, int delta, int horiz_flag)
{
Lisp_Object parent, next, prev;
struct window *p;
Lisp_Object *sizep;
int maximum;
- int (*sizefun) P_ ((Lisp_Object))
+ int (*sizefun) (Lisp_Object)
= horiz_flag ? window_width : window_height;
- void (*setsizefun) P_ ((Lisp_Object, int, int))
+ void (*setsizefun) (Lisp_Object, int, int)
= (horiz_flag ? set_window_width : set_window_height);
/* Give up if this window cannot be resized. */
@@ -4324,9 +4283,7 @@ enlarge_window (window, delta, horiz_flag)
are not deleted; instead, we signal an error. */
static void
-adjust_window_trailing_edge (window, delta, horiz_flag)
- Lisp_Object window;
- int delta, horiz_flag;
+adjust_window_trailing_edge (Lisp_Object window, int delta, int horiz_flag)
{
Lisp_Object parent, child;
struct window *p;
@@ -4462,8 +4419,7 @@ Otherwise, adjust the height, moving the bottom edge.
Following siblings of the selected window are resized to fulfill
the size request. If they become too small in the process, they
are not deleted; instead, we signal an error. */)
- (window, delta, horizontal)
- Lisp_Object window, delta, horizontal;
+ (Lisp_Object window, Lisp_Object delta, Lisp_Object horizontal)
{
CHECK_NUMBER (delta);
if (NILP (window))
@@ -4482,7 +4438,7 @@ are not deleted; instead, we signal an error. */)
Resizing Mini-Windows
***********************************************************************/
-static void shrink_window_lowest_first P_ ((struct window *, int));
+static void shrink_window_lowest_first (struct window *, int);
enum save_restore_action
{
@@ -4491,16 +4447,14 @@ enum save_restore_action
RESTORE_ORIG_SIZES
};
-static int save_restore_orig_size P_ ((struct window *,
- enum save_restore_action));
+static int save_restore_orig_size (struct window *,
+ enum save_restore_action);
/* Shrink windows rooted in window W to HEIGHT. Take the space needed
from lowest windows first. */
static void
-shrink_window_lowest_first (w, height)
- struct window *w;
- int height;
+shrink_window_lowest_first (struct window *w, int height)
{
struct window *c;
Lisp_Object child;
@@ -4582,9 +4536,7 @@ shrink_window_lowest_first (w, height)
stored in orig_top_line and orig_total_lines for all windows. */
static int
-save_restore_orig_size (w, action)
- struct window *w;
- enum save_restore_action action;
+save_restore_orig_size (struct window *w, enum save_restore_action action)
{
int success_p = 1;
@@ -4639,9 +4591,7 @@ save_restore_orig_size (w, action)
without deleting other windows. */
void
-grow_mini_window (w, delta)
- struct window *w;
- int delta;
+grow_mini_window (struct window *w, int delta)
{
struct frame *f = XFRAME (w->frame);
struct window *root;
@@ -4690,8 +4640,7 @@ grow_mini_window (w, delta)
line. */
void
-shrink_mini_window (w)
- struct window *w;
+shrink_mini_window (struct window *w)
{
struct frame *f = XFRAME (w->frame);
struct window *root = XWINDOW (FRAME_ROOT_WINDOW (f));
@@ -4721,8 +4670,7 @@ shrink_mini_window (w)
the frame are cleared. */
void
-mark_window_cursors_off (w)
- struct window *w;
+mark_window_cursors_off (struct window *w)
{
while (w)
{
@@ -4741,8 +4689,7 @@ mark_window_cursors_off (w)
/* Return number of lines of text (not counting mode lines) in W. */
int
-window_internal_height (w)
- struct window *w;
+window_internal_height (struct window *w)
{
int ht = XFASTINT (w->total_lines);
@@ -4769,8 +4716,7 @@ window_internal_height (w)
separating W from the sibling to its right. */
int
-window_box_text_cols (w)
- struct window *w;
+window_box_text_cols (struct window *w)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
int width = XINT (w->total_cols);
@@ -4807,11 +4753,7 @@ window_box_text_cols (w)
respectively. */
static void
-window_scroll (window, n, whole, noerror)
- Lisp_Object window;
- int n;
- int whole;
- int noerror;
+window_scroll (Lisp_Object window, int n, int whole, int noerror)
{
immediate_quit = 1;
@@ -4831,11 +4773,7 @@ window_scroll (window, n, whole, noerror)
descriptions. */
static void
-window_scroll_pixel_based (window, n, whole, noerror)
- Lisp_Object window;
- int n;
- int whole;
- int noerror;
+window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
{
struct it it;
struct window *w = XWINDOW (window);
@@ -5181,11 +5119,7 @@ window_scroll_pixel_based (window, n, whole, noerror)
See the comment of window_scroll for parameter descriptions. */
static void
-window_scroll_line_based (window, n, whole, noerror)
- Lisp_Object window;
- int n;
- int whole;
- int noerror;
+window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
{
register struct window *w = XWINDOW (window);
register int opoint = PT, opoint_byte = PT_BYTE;
@@ -5343,9 +5277,7 @@ window_scroll_line_based (window, n, whole, noerror)
up. This is the guts of Fscroll_up and Fscroll_down. */
static void
-scroll_command (n, direction)
- Lisp_Object n;
- int direction;
+scroll_command (Lisp_Object n, int direction)
{
int count = SPECPDL_INDEX ();
@@ -5382,8 +5314,7 @@ A near full screen is `next-screen-context-lines' less than a full screen.
Negative ARG means scroll downward.
If ARG is the atom `-', scroll downward by nearly full screen.
When calling from a program, supply as argument a number, nil, or `-'. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
scroll_command (arg, 1);
return Qnil;
@@ -5396,8 +5327,7 @@ A near full screen is `next-screen-context-lines' less than a full screen.
Negative ARG means scroll upward.
If ARG is the atom `-', scroll upward by nearly full screen.
When calling from a program, supply as argument a number, nil, or `-'. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
scroll_command (arg, -1);
return Qnil;
@@ -5410,7 +5340,7 @@ showing that buffer is used.
If in the minibuffer, `minibuffer-scroll-window' if non-nil
specifies the window. This takes precedence over
`other-window-scroll-buffer'. */)
- ()
+ (void)
{
Lisp_Object window;
@@ -5460,8 +5390,7 @@ showing that buffer, popping the buffer up if necessary.
If in the minibuffer, `minibuffer-scroll-window' if non-nil
specifies the window to scroll. This takes precedence over
`other-window-scroll-buffer'. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
Lisp_Object window;
struct window *w;
@@ -5504,8 +5433,7 @@ If SET-MINIMUM is non-nil, the new scroll amount becomes the
lower bound for automatic scrolling, i.e. automatic scrolling
will not scroll a window to a column less than the value returned
by this function. This happens in an interactive call. */)
- (arg, set_minimum)
- register Lisp_Object arg, set_minimum;
+ (register Lisp_Object arg, Lisp_Object set_minimum)
{
Lisp_Object result;
int hscroll;
@@ -5534,8 +5462,7 @@ If SET-MINIMUM is non-nil, the new scroll amount becomes the
lower bound for automatic scrolling, i.e. automatic scrolling
will not scroll a window to a column less than the value returned
by this function. This happens in an interactive call. */)
- (arg, set_minimum)
- register Lisp_Object arg, set_minimum;
+ (register Lisp_Object arg, Lisp_Object set_minimum)
{
Lisp_Object result;
int hscroll;
@@ -5558,7 +5485,7 @@ by this function. This happens in an interactive call. */)
DEFUN ("minibuffer-selected-window", Fminibuffer_selected_window, Sminibuffer_selected_window, 0, 0, 0,
doc: /* Return the window which was selected when entering the minibuffer.
Returns nil, if selected window is not a minibuffer window. */)
- ()
+ (void)
{
if (minibuf_level > 0
&& MINI_WINDOW_P (XWINDOW (selected_window))
@@ -5572,8 +5499,7 @@ Returns nil, if selected window is not a minibuffer window. */)
as opposed to its height. */
static int
-displayed_window_lines (w)
- struct window *w;
+displayed_window_lines (struct window *w)
{
struct it it;
struct text_pos start;
@@ -5641,8 +5567,7 @@ then only tty frame are redrawn.
Just C-u as prefix means put point in the center of the window
and redisplay normally--don't erase and redraw the frame. */)
- (arg)
- register Lisp_Object arg;
+ (register Lisp_Object arg)
{
struct window *w = XWINDOW (selected_window);
struct buffer *buf = XBUFFER (w->buffer);
@@ -5826,8 +5751,7 @@ WINDOW defaults to the selected window.
The return value does not include the mode line, any header line, nor
any partial-height lines in the text display area. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
struct window *w = decode_window (window);
int pixel_height = window_box_height (w);
@@ -5843,8 +5767,7 @@ DEFUN ("move-to-window-line", Fmove_to_window_line, Smove_to_window_line,
With no argument, position point at center of window.
An argument specifies vertical position within the window;
zero means top of window, negative means relative to bottom of window. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
struct window *w = XWINDOW (selected_window);
int lines, start;
@@ -5957,16 +5880,14 @@ struct saved_window
DEFUN ("window-configuration-p", Fwindow_configuration_p, Swindow_configuration_p, 1, 1, 0,
doc: /* Return t if OBJECT is a window-configuration object. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
return WINDOW_CONFIGURATIONP (object) ? Qt : Qnil;
}
DEFUN ("window-configuration-frame", Fwindow_configuration_frame, Swindow_configuration_frame, 1, 1, 0,
doc: /* Return the frame that CONFIG, a window-configuration object, is about. */)
- (config)
- Lisp_Object config;
+ (Lisp_Object config)
{
register struct save_window_data *data;
struct Lisp_Vector *saved_windows;
@@ -5986,8 +5907,7 @@ by `current-window-configuration' (which see).
If CONFIGURATION was made from a frame that is now deleted,
only frame-independent values can be restored. In this case,
the return value is nil. Otherwise the value is t. */)
- (configuration)
- Lisp_Object configuration;
+ (Lisp_Object configuration)
{
register struct save_window_data *data;
struct Lisp_Vector *saved_windows;
@@ -6318,8 +6238,7 @@ the return value is nil. Otherwise the value is t. */)
by setting their buffers to nil. */
void
-delete_all_subwindows (w)
- register struct window *w;
+delete_all_subwindows (register struct window *w)
{
if (!NILP (w->next))
delete_all_subwindows (XWINDOW (w->next));
@@ -6345,8 +6264,7 @@ delete_all_subwindows (w)
}
static int
-count_windows (window)
- register struct window *window;
+count_windows (register struct window *window)
{
register int count = 1;
if (!NILP (window->next))
@@ -6363,10 +6281,7 @@ count_windows (window)
Value is last index + 1. */
static int
-get_leaf_windows (w, flat, i)
- struct window *w;
- struct window **flat;
- int i;
+get_leaf_windows (struct window *w, struct window **flat, int i)
{
while (w)
{
@@ -6389,8 +6304,7 @@ get_leaf_windows (w, flat, i)
can be returned. */
struct glyph *
-get_phys_cursor_glyph (w)
- struct window *w;
+get_phys_cursor_glyph (struct window *w)
{
struct glyph_row *row;
struct glyph *glyph;
@@ -6409,10 +6323,7 @@ get_phys_cursor_glyph (w)
static int
-save_window_save (window, vector, i)
- Lisp_Object window;
- struct Lisp_Vector *vector;
- int i;
+save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
{
register struct saved_window *p;
register struct window *w;
@@ -6502,8 +6413,7 @@ point and mark. An exception is made for point in the current buffer:
its value is -not- saved.
This also records the currently selected frame, and FRAME's focus
redirection (see `redirect-frame-focus'). */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
register Lisp_Object tem;
register int n_windows;
@@ -6551,8 +6461,7 @@ Also restore the choice of selected window.
Also restore which buffer is current.
Does not restore the value of point in current buffer.
usage: (save-window-excursion BODY...) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object val;
register int count = SPECPDL_INDEX ();
@@ -6570,8 +6479,7 @@ usage: (save-window-excursion BODY...) */)
***********************************************************************/
static Lisp_Object
-window_tree (w)
- struct window *w;
+window_tree (struct window *w)
{
Lisp_Object tail = Qnil;
Lisp_Object result = Qnil;
@@ -6624,8 +6532,7 @@ EDGES is a list \(LEFT TOP RIGHT BOTTOM) as returned by `window-edges'.
If FRAME is nil or omitted, return information on the currently
selected frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
FRAME_PTR f;
@@ -6654,8 +6561,7 @@ Second arg LEFT-WIDTH specifies the number of character cells to
reserve for the left marginal area. Optional third arg RIGHT-WIDTH
does the same for the right marginal area. A nil width parameter
means no margin. */)
- (window, left_width, right_width)
- Lisp_Object window, left_width, right_width;
+ (Lisp_Object window, Lisp_Object left_width, Lisp_Object right_width)
{
struct window *w = decode_window (window);
@@ -6699,8 +6605,7 @@ If WINDOW is omitted or nil, use the currently selected window.
Value is a cons of the form (LEFT-WIDTH . RIGHT-WIDTH).
If a marginal area does not exist, its width will be returned
as nil. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
struct window *w = decode_window (window);
return Fcons (w->left_margin_cols, w->right_margin_cols);
@@ -6725,8 +6630,7 @@ the command `set-fringe-style'.
If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes
outside of the display margins. By default, fringes are drawn between
display marginal areas and the text area. */)
- (window, left_width, right_width, outside_margins)
- Lisp_Object window, left_width, right_width, outside_margins;
+ (Lisp_Object window, Lisp_Object left_width, Lisp_Object right_width, Lisp_Object outside_margins)
{
struct window *w = decode_window (window);
@@ -6763,8 +6667,7 @@ DEFUN ("window-fringes", Fwindow_fringes, Swindow_fringes,
doc: /* Get width of fringes of window WINDOW.
If WINDOW is omitted or nil, use the currently selected window.
Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
struct window *w = decode_window (window);
@@ -6791,8 +6694,7 @@ bar: left, right, or nil.
If WIDTH is nil, use the frame's scroll-bar width.
If VERTICAL-TYPE is t, use the frame's scroll-bar type.
Fourth parameter HORIZONTAL-TYPE is currently unused. */)
- (window, width, vertical_type, horizontal_type)
- Lisp_Object window, width, vertical_type, horizontal_type;
+ (Lisp_Object window, Lisp_Object width, Lisp_Object vertical_type, Lisp_Object horizontal_type)
{
struct window *w = decode_window (window);
@@ -6836,8 +6738,7 @@ If WINDOW is omitted or nil, use the currently selected window.
Value is a list of the form (WIDTH COLS VERTICAL-TYPE HORIZONTAL-TYPE).
If WIDTH is nil or TYPE is t, the window is using the frame's corresponding
value. */)
- (window)
- Lisp_Object window;
+ (Lisp_Object window)
{
struct window *w = decode_window (window);
return Fcons (make_number ((WINDOW_CONFIG_SCROLL_BAR_WIDTH (w)
@@ -6859,8 +6760,7 @@ DEFUN ("window-vscroll", Fwindow_vscroll, Swindow_vscroll, 0, 2, 0,
Use the selected window if WINDOW is nil or omitted.
Normally, value is a multiple of the canonical character height of WINDOW;
optional second arg PIXELS-P means value is measured in pixels. */)
- (window, pixels_p)
- Lisp_Object window, pixels_p;
+ (Lisp_Object window, Lisp_Object pixels_p)
{
Lisp_Object result;
struct frame *f;
@@ -6893,8 +6793,7 @@ If PIXELS-P is nil, VSCROLL may have to be rounded so that it
corresponds to an integral number of pixels. The return value is the
result of this rounding.
If PIXELS-P is non-nil, the return value is VSCROLL. */)
- (window, vscroll, pixels_p)
- Lisp_Object window, vscroll, pixels_p;
+ (Lisp_Object window, Lisp_Object vscroll, Lisp_Object pixels_p)
{
struct window *w;
struct frame *f;
@@ -6938,10 +6837,7 @@ If PIXELS-P is non-nil, the return value is VSCROLL. */)
additional argument USER_DATA. Stops when FN returns 0. */
void
-foreach_window (f, fn, user_data)
- struct frame *f;
- int (* fn) P_ ((struct window *, void *));
- void *user_data;
+foreach_window (struct frame *f, int (*fn) (struct window *, void *), void *user_data)
{
/* delete_frame may set FRAME_ROOT_WINDOW (f) to Qnil. */
if (WINDOWP (FRAME_ROOT_WINDOW (f)))
@@ -6955,10 +6851,7 @@ foreach_window (f, fn, user_data)
Stop when FN returns 0. Value is 0 if stopped by FN. */
static int
-foreach_window_1 (w, fn, user_data)
- struct window *w;
- int (* fn) P_ ((struct window *, void *));
- void *user_data;
+foreach_window_1 (struct window *w, int (*fn) (struct window *, void *), void *user_data)
{
int cont;
@@ -6983,9 +6876,7 @@ foreach_window_1 (w, fn, user_data)
the window start. */
static int
-freeze_window_start (w, freeze_p)
- struct window *w;
- void *freeze_p;
+freeze_window_start (struct window *w, void *freeze_p)
{
if (MINI_WINDOW_P (w)
|| (WINDOWP (selected_window) /* Can be nil in corner cases. */
@@ -7005,9 +6896,7 @@ freeze_window_start (w, freeze_p)
means freeze the window start. */
void
-freeze_window_starts (f, freeze_p)
- struct frame *f;
- int freeze_p;
+freeze_window_starts (struct frame *f, int freeze_p)
{
foreach_window (f, freeze_window_start, (void *) (freeze_p ? f : 0));
}
@@ -7021,9 +6910,7 @@ freeze_window_starts (f, freeze_p)
describe the same state of affairs. This is used by Fequal. */
int
-compare_window_configurations (c1, c2, ignore_positions)
- Lisp_Object c1, c2;
- int ignore_positions;
+compare_window_configurations (Lisp_Object c1, Lisp_Object c2, int ignore_positions)
{
register struct save_window_data *d1, *d2;
struct Lisp_Vector *sw1, *sw2;
@@ -7140,8 +7027,7 @@ DEFUN ("compare-window-configurations", Fcompare_window_configurations,
doc: /* Compare two window configurations as regards the structure of windows.
This function ignores details such as the values of point and mark
and scrolling positions. */)
- (x, y)
- Lisp_Object x, y;
+ (Lisp_Object x, Lisp_Object y)
{
if (compare_window_configurations (x, y, 1))
return Qt;
@@ -7149,7 +7035,7 @@ and scrolling positions. */)
}
void
-init_window_once ()
+init_window_once (void)
{
struct frame *f = make_initial_frame ();
XSETFRAME (selected_frame, f);
@@ -7162,13 +7048,13 @@ init_window_once ()
}
void
-init_window ()
+init_window (void)
{
Vwindow_list = Qnil;
}
void
-syms_of_window ()
+syms_of_window (void)
{
Qscroll_up = intern_c_string ("scroll-up");
staticpro (&Qscroll_up);
@@ -7312,8 +7198,10 @@ frame to be redrawn only if it is a tty frame. */);
defsubr (&Sset_window_redisplay_end_trigger);
defsubr (&Swindow_edges);
defsubr (&Swindow_pixel_edges);
+ defsubr (&Swindow_absolute_pixel_edges);
defsubr (&Swindow_inside_edges);
defsubr (&Swindow_inside_pixel_edges);
+ defsubr (&Swindow_inside_absolute_pixel_edges);
defsubr (&Scoordinates_in_window_p);
defsubr (&Swindow_at);
defsubr (&Swindow_point);
@@ -7375,7 +7263,7 @@ frame to be redrawn only if it is a tty frame. */);
}
void
-keys_of_window ()
+keys_of_window (void)
{
initial_define_key (control_x_map, '1', "delete-other-windows");
initial_define_key (control_x_map, '2', "split-window");
diff --git a/src/window.h b/src/window.h
index 17332f0af20..e9529487b14 100644
--- a/src/window.h
+++ b/src/window.h
@@ -785,25 +785,25 @@ EXFUN (Fwindow_vscroll, 2);
EXFUN (Fset_window_margins, 3);
EXFUN (Fwindow_live_p, 1);
EXFUN (Fset_window_point, 2);
-extern Lisp_Object make_window P_ ((void));
-extern void delete_window P_ ((Lisp_Object));
-extern Lisp_Object window_from_coordinates P_ ((struct frame *, int, int,
- enum window_part *,
- int *, int*, int));
+extern Lisp_Object make_window (void);
+extern void delete_window (Lisp_Object);
+extern Lisp_Object window_from_coordinates (struct frame *, int, int,
+ enum window_part *,
+ int *, int*, int);
EXFUN (Fwindow_dedicated_p, 1);
-extern int window_height P_ ((Lisp_Object));
-extern int window_width P_ ((Lisp_Object));
+extern int window_height (Lisp_Object);
+extern int window_width (Lisp_Object);
EXFUN (Fwindow_full_width_p, 1);
-extern void set_window_height P_ ((Lisp_Object, int, int));
-extern void set_window_width P_ ((Lisp_Object, int, int));
-extern void change_window_heights P_ ((Lisp_Object, int));
-extern void delete_all_subwindows P_ ((struct window *));
-extern void freeze_window_starts P_ ((struct frame *, int));
-extern void foreach_window P_ ((struct frame *,
- int (* fn) (struct window *, void *),
- void *));
-extern void grow_mini_window P_ ((struct window *, int));
-extern void shrink_mini_window P_ ((struct window *));
+extern void set_window_height (Lisp_Object, int, int);
+extern void set_window_width (Lisp_Object, int, int);
+extern void change_window_heights (Lisp_Object, int);
+extern void delete_all_subwindows (struct window *);
+extern void freeze_window_starts (struct frame *, int);
+extern void foreach_window (struct frame *,
+ int (* fn) (struct window *, void *),
+ void *);
+extern void grow_mini_window (struct window *, int);
+extern void shrink_mini_window (struct window *);
void run_window_configuration_change_hook (struct frame *f);
@@ -811,8 +811,8 @@ void run_window_configuration_change_hook (struct frame *f);
means it's allowed to run hooks. See make_frame for a case where
it's not allowed. */
-void set_window_buffer P_ ((Lisp_Object window, Lisp_Object buffer,
- int run_hooks_p, int keep_margins_p));
+void set_window_buffer (Lisp_Object window, Lisp_Object buffer,
+ int run_hooks_p, int keep_margins_p);
/* Prompt to display in front of the minibuffer contents. */
@@ -862,13 +862,13 @@ extern int buffer_shared;
/* If *ROWS or *COLS are too small a size for FRAME, set them to the
minimum allowable size. */
-extern void check_frame_size P_ ((struct frame *frame, int *rows, int *cols));
+extern void check_frame_size (struct frame *frame, int *rows, int *cols);
/* Return a pointer to the glyph W's physical cursor is on. Value is
null if W's current matrix is invalid, so that no meaningfull glyph
can be returned. */
-struct glyph *get_phys_cursor_glyph P_ ((struct window *w));
+struct glyph *get_phys_cursor_glyph (struct window *w);
/* Value is non-zero if WINDOW is a live window. */
@@ -891,24 +891,24 @@ EXFUN (Fsave_window_excursion, UNEVALLED);
EXFUN (Fsplit_window, 3);
EXFUN (Fset_window_configuration, 1);
EXFUN (Fcurrent_window_configuration, 1);
-extern int compare_window_configurations P_ ((Lisp_Object, Lisp_Object, int));
+extern int compare_window_configurations (Lisp_Object, Lisp_Object, int);
EXFUN (Fcoordinates_in_window_p, 2);
EXFUN (Fwindow_at, 3);
EXFUN (Fpos_visible_in_window_p, 3);
-extern void mark_window_cursors_off P_ ((struct window *));
-extern int window_internal_height P_ ((struct window *));
-extern int window_internal_width P_ ((struct window *));
+extern void mark_window_cursors_off (struct window *);
+extern int window_internal_height (struct window *);
+extern int window_internal_width (struct window *);
EXFUN (Frecenter, 1);
EXFUN (Fscroll_other_window, 1);
EXFUN (Fset_window_start, 3);
-extern void temp_output_buffer_show P_ ((Lisp_Object));
-extern void replace_buffer_in_all_windows P_ ((Lisp_Object));
-extern void init_window_once P_ ((void));
-extern void init_window P_ ((void));
-extern void syms_of_window P_ ((void));
-extern void keys_of_window P_ ((void));
-
-extern int window_box_text_cols P_ ((struct window *w));
+extern void temp_output_buffer_show (Lisp_Object);
+extern void replace_buffer_in_all_windows (Lisp_Object);
+extern void init_window_once (void);
+extern void init_window (void);
+extern void syms_of_window (void);
+extern void keys_of_window (void);
+
+extern int window_box_text_cols (struct window *w);
#endif /* not WINDOW_H_INCLUDED */
diff --git a/src/xdisp.c b/src/xdisp.c
index c8043308ec8..53fba8caa90 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -270,8 +270,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
|| defined(HAVE_NS) || defined (USE_GTK)
-extern void set_frame_menubar P_ ((struct frame *f, int, int));
-extern int pending_menu_activation;
+extern void set_frame_menubar (struct frame *f, int, int);
#endif
extern int interrupt_input;
@@ -831,15 +830,15 @@ struct props
/* A handler function called to set up iterator IT from the property
at IT's current position. Value is used to steer handle_stop. */
- enum prop_handled (*handler) P_ ((struct it *it));
+ enum prop_handled (*handler) (struct it *it);
};
-static enum prop_handled handle_face_prop P_ ((struct it *));
-static enum prop_handled handle_invisible_prop P_ ((struct it *));
-static enum prop_handled handle_display_prop P_ ((struct it *));
-static enum prop_handled handle_composition_prop P_ ((struct it *));
-static enum prop_handled handle_overlay_change P_ ((struct it *));
-static enum prop_handled handle_fontified_prop P_ ((struct it *));
+static enum prop_handled handle_face_prop (struct it *);
+static enum prop_handled handle_invisible_prop (struct it *);
+static enum prop_handled handle_display_prop (struct it *);
+static enum prop_handled handle_composition_prop (struct it *);
+static enum prop_handled handle_overlay_change (struct it *);
+static enum prop_handled handle_fontified_prop (struct it *);
/* Properties handled by iterators. */
@@ -949,149 +948,149 @@ Lisp_Object Vhourglass_delay;
/* Function prototypes. */
-static void setup_for_ellipsis P_ ((struct it *, int));
-static void mark_window_display_accurate_1 P_ ((struct window *, int));
-static int single_display_spec_string_p P_ ((Lisp_Object, Lisp_Object));
-static int display_prop_string_p P_ ((Lisp_Object, Lisp_Object));
-static int cursor_row_p P_ ((struct window *, struct glyph_row *));
-static int redisplay_mode_lines P_ ((Lisp_Object, int));
-static char *decode_mode_spec_coding P_ ((Lisp_Object, char *, int));
-
-static Lisp_Object get_it_property P_ ((struct it *it, Lisp_Object prop));
-
-static void handle_line_prefix P_ ((struct it *));
-
-static void pint2str P_ ((char *, int, int));
-static void pint2hrstr P_ ((char *, int, int));
-static struct text_pos run_window_scroll_functions P_ ((Lisp_Object,
- struct text_pos));
-static void reconsider_clip_changes P_ ((struct window *, struct buffer *));
-static int text_outside_line_unchanged_p P_ ((struct window *, int, int));
-static void store_mode_line_noprop_char P_ ((char));
-static int store_mode_line_noprop P_ ((const unsigned char *, int, int));
-static void x_consider_frame_title P_ ((Lisp_Object));
-static void handle_stop P_ ((struct it *));
-static void handle_stop_backwards P_ ((struct it *, EMACS_INT));
-static int tool_bar_lines_needed P_ ((struct frame *, int *));
-static int single_display_spec_intangible_p P_ ((Lisp_Object));
-static void ensure_echo_area_buffers P_ ((void));
-static Lisp_Object unwind_with_echo_area_buffer P_ ((Lisp_Object));
-static Lisp_Object with_echo_area_buffer_unwind_data P_ ((struct window *));
-static int with_echo_area_buffer P_ ((struct window *, int,
- int (*) (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT),
- EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
-static void clear_garbaged_frames P_ ((void));
-static int current_message_1 P_ ((EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
-static int truncate_message_1 P_ ((EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
-static int set_message_1 P_ ((EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
-static int display_echo_area P_ ((struct window *));
-static int display_echo_area_1 P_ ((EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
-static int resize_mini_window_1 P_ ((EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
-static Lisp_Object unwind_redisplay P_ ((Lisp_Object));
-static int string_char_and_length P_ ((const unsigned char *, int *));
-static struct text_pos display_prop_end P_ ((struct it *, Lisp_Object,
- struct text_pos));
-static int compute_window_start_on_continuation_line P_ ((struct window *));
-static Lisp_Object safe_eval_handler P_ ((Lisp_Object));
-static void insert_left_trunc_glyphs P_ ((struct it *));
-static struct glyph_row *get_overlay_arrow_glyph_row P_ ((struct window *,
- Lisp_Object));
-static void extend_face_to_end_of_line P_ ((struct it *));
-static int append_space_for_newline P_ ((struct it *, int));
-static int cursor_row_fully_visible_p P_ ((struct window *, int, int));
-static int try_scrolling P_ ((Lisp_Object, int, EMACS_INT, EMACS_INT, int, int));
-static int try_cursor_movement P_ ((Lisp_Object, struct text_pos, int *));
-static int trailing_whitespace_p P_ ((int));
-static int message_log_check_duplicate P_ ((int, int, int, int));
-static void push_it P_ ((struct it *));
-static void pop_it P_ ((struct it *));
-static void sync_frame_with_window_matrix_rows P_ ((struct window *));
-static void select_frame_for_redisplay P_ ((Lisp_Object));
-static void redisplay_internal P_ ((int));
-static int echo_area_display P_ ((int));
-static void redisplay_windows P_ ((Lisp_Object));
-static void redisplay_window P_ ((Lisp_Object, int));
-static Lisp_Object redisplay_window_error ();
-static Lisp_Object redisplay_window_0 P_ ((Lisp_Object));
-static Lisp_Object redisplay_window_1 P_ ((Lisp_Object));
-static int update_menu_bar P_ ((struct frame *, int, int));
-static int try_window_reusing_current_matrix P_ ((struct window *));
-static int try_window_id P_ ((struct window *));
-static int display_line P_ ((struct it *));
-static int display_mode_lines P_ ((struct window *));
-static int display_mode_line P_ ((struct window *, enum face_id, Lisp_Object));
-static int display_mode_element P_ ((struct it *, int, int, int, Lisp_Object, Lisp_Object, int));
-static int store_mode_line_string P_ ((char *, Lisp_Object, int, int, int, Lisp_Object));
-static char *decode_mode_spec P_ ((struct window *, int, int, int,
- Lisp_Object *));
-static void display_menu_bar P_ ((struct window *));
-static int display_count_lines P_ ((int, int, int, int, int *));
-static int display_string P_ ((unsigned char *, Lisp_Object, Lisp_Object,
- EMACS_INT, EMACS_INT, struct it *, int, int, int, int));
-static void compute_line_metrics P_ ((struct it *));
-static void run_redisplay_end_trigger_hook P_ ((struct it *));
-static int get_overlay_strings P_ ((struct it *, int));
-static int get_overlay_strings_1 P_ ((struct it *, int, int));
-static void next_overlay_string P_ ((struct it *));
-static void reseat P_ ((struct it *, struct text_pos, int));
-static void reseat_1 P_ ((struct it *, struct text_pos, int));
-static void back_to_previous_visible_line_start P_ ((struct it *));
-void reseat_at_previous_visible_line_start P_ ((struct it *));
-static void reseat_at_next_visible_line_start P_ ((struct it *, int));
-static int next_element_from_ellipsis P_ ((struct it *));
-static int next_element_from_display_vector P_ ((struct it *));
-static int next_element_from_string P_ ((struct it *));
-static int next_element_from_c_string P_ ((struct it *));
-static int next_element_from_buffer P_ ((struct it *));
-static int next_element_from_composition P_ ((struct it *));
-static int next_element_from_image P_ ((struct it *));
-static int next_element_from_stretch P_ ((struct it *));
-static void load_overlay_strings P_ ((struct it *, int));
-static int init_from_display_pos P_ ((struct it *, struct window *,
- struct display_pos *));
-static void reseat_to_string P_ ((struct it *, unsigned char *,
- Lisp_Object, int, int, int, int));
+static void setup_for_ellipsis (struct it *, int);
+static void mark_window_display_accurate_1 (struct window *, int);
+static int single_display_spec_string_p (Lisp_Object, Lisp_Object);
+static int display_prop_string_p (Lisp_Object, Lisp_Object);
+static int cursor_row_p (struct window *, struct glyph_row *);
+static int redisplay_mode_lines (Lisp_Object, int);
+static char *decode_mode_spec_coding (Lisp_Object, char *, int);
+
+static Lisp_Object get_it_property (struct it *it, Lisp_Object prop);
+
+static void handle_line_prefix (struct it *);
+
+static void pint2str (char *, int, int);
+static void pint2hrstr (char *, int, int);
+static struct text_pos run_window_scroll_functions (Lisp_Object,
+ struct text_pos);
+static void reconsider_clip_changes (struct window *, struct buffer *);
+static int text_outside_line_unchanged_p (struct window *, int, int);
+static void store_mode_line_noprop_char (char);
+static int store_mode_line_noprop (const unsigned char *, int, int);
+static void x_consider_frame_title (Lisp_Object);
+static void handle_stop (struct it *);
+static void handle_stop_backwards (struct it *, EMACS_INT);
+static int tool_bar_lines_needed (struct frame *, int *);
+static int single_display_spec_intangible_p (Lisp_Object);
+static void ensure_echo_area_buffers (void);
+static Lisp_Object unwind_with_echo_area_buffer (Lisp_Object);
+static Lisp_Object with_echo_area_buffer_unwind_data (struct window *);
+static int with_echo_area_buffer (struct window *, int,
+ int (*) (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT),
+ EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
+static void clear_garbaged_frames (void);
+static int current_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
+static int truncate_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
+static int set_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
+static int display_echo_area (struct window *);
+static int display_echo_area_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
+static int resize_mini_window_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
+static Lisp_Object unwind_redisplay (Lisp_Object);
+static int string_char_and_length (const unsigned char *, int *);
+static struct text_pos display_prop_end (struct it *, Lisp_Object,
+ struct text_pos);
+static int compute_window_start_on_continuation_line (struct window *);
+static Lisp_Object safe_eval_handler (Lisp_Object);
+static void insert_left_trunc_glyphs (struct it *);
+static struct glyph_row *get_overlay_arrow_glyph_row (struct window *,
+ Lisp_Object);
+static void extend_face_to_end_of_line (struct it *);
+static int append_space_for_newline (struct it *, int);
+static int cursor_row_fully_visible_p (struct window *, int, int);
+static int try_scrolling (Lisp_Object, int, EMACS_INT, EMACS_INT, int, int);
+static int try_cursor_movement (Lisp_Object, struct text_pos, int *);
+static int trailing_whitespace_p (int);
+static int message_log_check_duplicate (int, int, int, int);
+static void push_it (struct it *);
+static void pop_it (struct it *);
+static void sync_frame_with_window_matrix_rows (struct window *);
+static void select_frame_for_redisplay (Lisp_Object);
+static void redisplay_internal (int);
+static int echo_area_display (int);
+static void redisplay_windows (Lisp_Object);
+static void redisplay_window (Lisp_Object, int);
+static Lisp_Object redisplay_window_error (Lisp_Object);
+static Lisp_Object redisplay_window_0 (Lisp_Object);
+static Lisp_Object redisplay_window_1 (Lisp_Object);
+static int update_menu_bar (struct frame *, int, int);
+static int try_window_reusing_current_matrix (struct window *);
+static int try_window_id (struct window *);
+static int display_line (struct it *);
+static int display_mode_lines (struct window *);
+static int display_mode_line (struct window *, enum face_id, Lisp_Object);
+static int display_mode_element (struct it *, int, int, int, Lisp_Object, Lisp_Object, int);
+static int store_mode_line_string (char *, Lisp_Object, int, int, int, Lisp_Object);
+static char *decode_mode_spec (struct window *, int, int, int,
+ Lisp_Object *);
+static void display_menu_bar (struct window *);
+static int display_count_lines (int, int, int, int, int *);
+static int display_string (unsigned char *, Lisp_Object, Lisp_Object,
+ EMACS_INT, EMACS_INT, struct it *, int, int, int, int);
+static void compute_line_metrics (struct it *);
+static void run_redisplay_end_trigger_hook (struct it *);
+static int get_overlay_strings (struct it *, int);
+static int get_overlay_strings_1 (struct it *, int, int);
+static void next_overlay_string (struct it *);
+static void reseat (struct it *, struct text_pos, int);
+static void reseat_1 (struct it *, struct text_pos, int);
+static void back_to_previous_visible_line_start (struct it *);
+void reseat_at_previous_visible_line_start (struct it *);
+static void reseat_at_next_visible_line_start (struct it *, int);
+static int next_element_from_ellipsis (struct it *);
+static int next_element_from_display_vector (struct it *);
+static int next_element_from_string (struct it *);
+static int next_element_from_c_string (struct it *);
+static int next_element_from_buffer (struct it *);
+static int next_element_from_composition (struct it *);
+static int next_element_from_image (struct it *);
+static int next_element_from_stretch (struct it *);
+static void load_overlay_strings (struct it *, int);
+static int init_from_display_pos (struct it *, struct window *,
+ struct display_pos *);
+static void reseat_to_string (struct it *, unsigned char *,
+ Lisp_Object, int, int, int, int);
static enum move_it_result
move_it_in_display_line_to (struct it *, EMACS_INT, int,
enum move_operation_enum);
-void move_it_vertically_backward P_ ((struct it *, int));
-static void init_to_row_start P_ ((struct it *, struct window *,
- struct glyph_row *));
-static int init_to_row_end P_ ((struct it *, struct window *,
- struct glyph_row *));
-static void back_to_previous_line_start P_ ((struct it *));
-static int forward_to_next_line_start P_ ((struct it *, int *));
-static struct text_pos string_pos_nchars_ahead P_ ((struct text_pos,
- Lisp_Object, int));
-static struct text_pos string_pos P_ ((int, Lisp_Object));
-static struct text_pos c_string_pos P_ ((int, unsigned char *, int));
-static int number_of_chars P_ ((unsigned char *, int));
-static void compute_stop_pos P_ ((struct it *));
-static void compute_string_pos P_ ((struct text_pos *, struct text_pos,
- Lisp_Object));
-static int face_before_or_after_it_pos P_ ((struct it *, int));
-static EMACS_INT next_overlay_change P_ ((EMACS_INT));
-static int handle_single_display_spec P_ ((struct it *, Lisp_Object,
- Lisp_Object, Lisp_Object,
- struct text_pos *, int));
-static int underlying_face_id P_ ((struct it *));
-static int in_ellipses_for_invisible_text_p P_ ((struct display_pos *,
- struct window *));
+void move_it_vertically_backward (struct it *, int);
+static void init_to_row_start (struct it *, struct window *,
+ struct glyph_row *);
+static int init_to_row_end (struct it *, struct window *,
+ struct glyph_row *);
+static void back_to_previous_line_start (struct it *);
+static int forward_to_next_line_start (struct it *, int *);
+static struct text_pos string_pos_nchars_ahead (struct text_pos,
+ Lisp_Object, int);
+static struct text_pos string_pos (int, Lisp_Object);
+static struct text_pos c_string_pos (int, unsigned char *, int);
+static int number_of_chars (unsigned char *, int);
+static void compute_stop_pos (struct it *);
+static void compute_string_pos (struct text_pos *, struct text_pos,
+ Lisp_Object);
+static int face_before_or_after_it_pos (struct it *, int);
+static EMACS_INT next_overlay_change (EMACS_INT);
+static int handle_single_display_spec (struct it *, Lisp_Object,
+ Lisp_Object, Lisp_Object,
+ struct text_pos *, int);
+static int underlying_face_id (struct it *);
+static int in_ellipses_for_invisible_text_p (struct display_pos *,
+ struct window *);
#define face_before_it_pos(IT) face_before_or_after_it_pos ((IT), 1)
#define face_after_it_pos(IT) face_before_or_after_it_pos ((IT), 0)
#ifdef HAVE_WINDOW_SYSTEM
-static void update_tool_bar P_ ((struct frame *, int));
-static void build_desired_tool_bar_string P_ ((struct frame *f));
-static int redisplay_tool_bar P_ ((struct frame *));
-static void display_tool_bar_line P_ ((struct it *, int));
-static void notice_overwritten_cursor P_ ((struct window *,
- enum glyph_row_area,
- int, int, int, int));
-static void append_stretch_glyph P_ ((struct it *, Lisp_Object,
- int, int, int));
+static void update_tool_bar (struct frame *, int);
+static void build_desired_tool_bar_string (struct frame *f);
+static int redisplay_tool_bar (struct frame *);
+static void display_tool_bar_line (struct it *, int);
+static void notice_overwritten_cursor (struct window *,
+ enum glyph_row_area,
+ int, int, int, int);
+static void append_stretch_glyph (struct it *, Lisp_Object,
+ int, int, int);
@@ -1109,8 +1108,7 @@ static void append_stretch_glyph P_ ((struct it *, Lisp_Object,
This is the height of W minus the height of a mode line, if any. */
INLINE int
-window_text_bottom_y (w)
- struct window *w;
+window_text_bottom_y (struct window *w)
{
int height = WINDOW_TOTAL_HEIGHT (w);
@@ -1124,9 +1122,7 @@ window_text_bottom_y (w)
the left and right of the window. */
INLINE int
-window_box_width (w, area)
- struct window *w;
- int area;
+window_box_width (struct window *w, int area)
{
int cols = XFASTINT (w->total_cols);
int pixels = 0;
@@ -1165,8 +1161,7 @@ window_box_width (w, area)
including mode lines of W, if any. */
INLINE int
-window_box_height (w)
- struct window *w;
+window_box_height (struct window *w)
{
struct frame *f = XFRAME (w->frame);
int height = WINDOW_TOTAL_HEIGHT (w);
@@ -1213,9 +1208,7 @@ window_box_height (w)
whole window, to the right of the left fringe of W. */
INLINE int
-window_box_left_offset (w, area)
- struct window *w;
- int area;
+window_box_left_offset (struct window *w, int area)
{
int x;
@@ -1247,9 +1240,7 @@ window_box_left_offset (w, area)
whole window, to the left of the right fringe of W. */
INLINE int
-window_box_right_offset (w, area)
- struct window *w;
- int area;
+window_box_right_offset (struct window *w, int area)
{
return window_box_left_offset (w, area) + window_box_width (w, area);
}
@@ -1259,9 +1250,7 @@ window_box_right_offset (w, area)
whole window, to the right of the left fringe of W. */
INLINE int
-window_box_left (w, area)
- struct window *w;
- int area;
+window_box_left (struct window *w, int area)
{
struct frame *f = XFRAME (w->frame);
int x;
@@ -1281,9 +1270,7 @@ window_box_left (w, area)
whole window, to the left of the right fringe of W. */
INLINE int
-window_box_right (w, area)
- struct window *w;
- int area;
+window_box_right (struct window *w, int area)
{
return window_box_left (w, area) + window_box_width (w, area);
}
@@ -1296,10 +1283,8 @@ window_box_right (w, area)
*BOX_WIDTH, and *BOX_HEIGHT the pixel width and height of the box. */
INLINE void
-window_box (w, area, box_x, box_y, box_width, box_height)
- struct window *w;
- int area;
- int *box_x, *box_y, *box_width, *box_height;
+window_box (struct window *w, int area, int *box_x, int *box_y,
+ int *box_width, int *box_height)
{
if (box_width)
*box_width = window_box_width (w, area);
@@ -1325,11 +1310,8 @@ window_box (w, area, box_x, box_y, box_width, box_height)
box. */
INLINE void
-window_box_edges (w, area, top_left_x, top_left_y,
- bottom_right_x, bottom_right_y)
- struct window *w;
- int area;
- int *top_left_x, *top_left_y, *bottom_right_x, *bottom_right_y;
+window_box_edges (struct window *w, int area, int *top_left_x, int *top_left_y,
+ int *bottom_right_x, int *bottom_right_y)
{
window_box (w, area, top_left_x, top_left_y, bottom_right_x,
bottom_right_y);
@@ -1347,8 +1329,7 @@ window_box_edges (w, area, top_left_x, top_left_y,
This can modify IT's settings. */
int
-line_bottom_y (it)
- struct it *it;
+line_bottom_y (struct it *it)
{
int line_height = it->max_ascent + it->max_descent;
int line_top_y = it->current_y;
@@ -1390,9 +1371,8 @@ line_bottom_y (it)
Set *ROWH and *VPOS to row's visible height and VPOS (row number). */
int
-pos_visible_p (w, charpos, x, y, rtop, rbot, rowh, vpos)
- struct window *w;
- int charpos, *x, *y, *rtop, *rbot, *rowh, *vpos;
+pos_visible_p (struct window *w, int charpos, int *x, int *y,
+ int *rtop, int *rbot, int *rowh, int *vpos)
{
struct it it;
struct text_pos top;
@@ -1531,9 +1511,7 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, rowh, vpos)
character. */
static INLINE int
-string_char_and_length (str, len)
- const unsigned char *str;
- int *len;
+string_char_and_length (const unsigned char *str, int *len)
{
int c;
@@ -1553,10 +1531,7 @@ string_char_and_length (str, len)
in STRING, return the position NCHARS ahead (NCHARS >= 0). */
static struct text_pos
-string_pos_nchars_ahead (pos, string, nchars)
- struct text_pos pos;
- Lisp_Object string;
- int nchars;
+string_pos_nchars_ahead (struct text_pos pos, Lisp_Object string, int nchars)
{
xassert (STRINGP (string) && nchars >= 0);
@@ -1586,9 +1561,7 @@ string_pos_nchars_ahead (pos, string, nchars)
for character position CHARPOS in STRING. */
static INLINE struct text_pos
-string_pos (charpos, string)
- int charpos;
- Lisp_Object string;
+string_pos (int charpos, Lisp_Object string)
{
struct text_pos pos;
xassert (STRINGP (string));
@@ -1603,10 +1576,7 @@ string_pos (charpos, string)
means recognize multibyte characters. */
static struct text_pos
-c_string_pos (charpos, s, multibyte_p)
- int charpos;
- unsigned char *s;
- int multibyte_p;
+c_string_pos (int charpos, unsigned char *s, int multibyte_p)
{
struct text_pos pos;
@@ -1638,9 +1608,7 @@ c_string_pos (charpos, s, multibyte_p)
non-zero means recognize multibyte characters. */
static int
-number_of_chars (s, multibyte_p)
- unsigned char *s;
- int multibyte_p;
+number_of_chars (unsigned char *s, int multibyte_p)
{
int nchars;
@@ -1667,9 +1635,7 @@ number_of_chars (s, multibyte_p)
NEWPOS->charpos must be >= POS.charpos. */
static void
-compute_string_pos (newpos, pos, string)
- struct text_pos *newpos, pos;
- Lisp_Object string;
+compute_string_pos (struct text_pos *newpos, struct text_pos pos, Lisp_Object string)
{
xassert (STRINGP (string));
xassert (CHARPOS (*newpos) >= CHARPOS (pos));
@@ -1686,9 +1652,7 @@ compute_string_pos (newpos, pos, string)
frame F. FACE_ID specifies what line's height to estimate. */
int
-estimate_mode_line_height (f, face_id)
- struct frame *f;
- enum face_id face_id;
+estimate_mode_line_height (struct frame *f, enum face_id face_id)
{
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
@@ -1722,12 +1686,8 @@ estimate_mode_line_height (f, face_id)
not force the value into range. */
void
-pixel_to_glyph_coords (f, pix_x, pix_y, x, y, bounds, noclip)
- FRAME_PTR f;
- register int pix_x, pix_y;
- int *x, *y;
- NativeRectangle *bounds;
- int noclip;
+pixel_to_glyph_coords (FRAME_PTR f, register int pix_x, register int pix_y,
+ int *x, int *y, NativeRectangle *bounds, int noclip)
{
#ifdef HAVE_WINDOW_SYSTEM
@@ -1776,10 +1736,8 @@ pixel_to_glyph_coords (f, pix_x, pix_y, x, y, bounds, noclip)
return 0. */
int
-glyph_to_pixel_coords (w, hpos, vpos, frame_x, frame_y)
- struct window *w;
- int hpos, vpos;
- int *frame_x, *frame_y;
+glyph_to_pixel_coords (struct window *w, int hpos, int vpos,
+ int *frame_x, int *frame_y)
{
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w))))
@@ -1839,10 +1797,8 @@ glyph_to_pixel_coords (w, hpos, vpos, frame_x, frame_y)
static
struct glyph *
-x_y_to_hpos_vpos (w, x, y, hpos, vpos, dx, dy, area)
- struct window *w;
- int x, y;
- int *hpos, *vpos, *dx, *dy, *area;
+x_y_to_hpos_vpos (struct window *w, int x, int y, int *hpos, int *vpos,
+ int *dx, int *dy, int *area)
{
struct glyph *glyph, *end;
struct glyph_row *row = NULL;
@@ -1919,9 +1875,7 @@ x_y_to_hpos_vpos (w, x, y, hpos, vpos, dx, dy, area)
Takes pseudo-windows into account. */
void
-frame_to_window_pixel_xy (w, x, y)
- struct window *w;
- int *x, *y;
+frame_to_window_pixel_xy (struct window *w, int *x, int *y)
{
if (w->pseudo_window_p)
{
@@ -1943,10 +1897,7 @@ frame_to_window_pixel_xy (w, x, y)
Return the number of stored rectangles. */
int
-get_glyph_string_clip_rects (s, rects, n)
- struct glyph_string *s;
- NativeRectangle *rects;
- int n;
+get_glyph_string_clip_rects (struct glyph_string *s, NativeRectangle *rects, int n)
{
XRectangle r;
@@ -2140,9 +2091,7 @@ get_glyph_string_clip_rects (s, rects, n)
Return in *NR the clipping rectangle for glyph string S. */
void
-get_glyph_string_clip_rect (s, nr)
- struct glyph_string *s;
- NativeRectangle *nr;
+get_glyph_string_clip_rect (struct glyph_string *s, NativeRectangle *nr)
{
get_glyph_string_clip_rects (s, nr, 1);
}
@@ -2154,11 +2103,8 @@ get_glyph_string_clip_rect (s, nr)
*/
void
-get_phys_cursor_geometry (w, row, glyph, xp, yp, heightp)
- struct window *w;
- struct glyph_row *row;
- struct glyph *glyph;
- int *xp, *yp, *heightp;
+get_phys_cursor_geometry (struct window *w, struct glyph_row *row,
+ struct glyph *glyph, int *xp, int *yp, int *heightp)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
int x, y, wd, h, h0, y0;
@@ -2218,10 +2164,7 @@ get_phys_cursor_geometry (w, row, glyph, xp, yp, heightp)
*/
void
-remember_mouse_glyph (f, gx, gy, rect)
- struct frame *f;
- int gx, gy;
- NativeRectangle *rect;
+remember_mouse_glyph (struct frame *f, int gx, int gy, NativeRectangle *rect)
{
Lisp_Object window;
struct window *w;
@@ -2417,8 +2360,7 @@ remember_mouse_glyph (f, gx, gy, rect)
/* Error handler for safe_eval and safe_call. */
static Lisp_Object
-safe_eval_handler (arg)
- Lisp_Object arg;
+safe_eval_handler (Lisp_Object arg)
{
add_to_log ("Error during redisplay: %s", arg, Qnil);
return Qnil;
@@ -2433,9 +2375,7 @@ safe_eval_handler (arg)
redisplay during the evaluation. */
Lisp_Object
-safe_call (nargs, args)
- int nargs;
- Lisp_Object *args;
+safe_call (int nargs, Lisp_Object *args)
{
Lisp_Object val;
@@ -2465,8 +2405,7 @@ safe_call (nargs, args)
Return the result, or nil if something went wrong. */
Lisp_Object
-safe_call1 (fn, arg)
- Lisp_Object fn, arg;
+safe_call1 (Lisp_Object fn, Lisp_Object arg)
{
Lisp_Object args[2];
args[0] = fn;
@@ -2595,12 +2534,9 @@ check_window_end (w)
the desired matrix of W. */
void
-init_iterator (it, w, charpos, bytepos, row, base_face_id)
- struct it *it;
- struct window *w;
- EMACS_INT charpos, bytepos;
- struct glyph_row *row;
- enum face_id base_face_id;
+init_iterator (struct it *it, struct window *w,
+ EMACS_INT charpos, EMACS_INT bytepos,
+ struct glyph_row *row, enum face_id base_face_id)
{
int highlight_region_p;
enum face_id remapped_base_face_id = base_face_id;
@@ -2636,7 +2572,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id)
}
/* Clear IT. */
- bzero (it, sizeof *it);
+ memset (it, 0, sizeof *it);
it->current.overlay_string_index = -1;
it->current.dpvec_index = -1;
it->base_face_id = remapped_base_face_id;
@@ -2896,10 +2832,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id)
/* Initialize IT for the display of window W with window start POS. */
void
-start_display (it, w, pos)
- struct it *it;
- struct window *w;
- struct text_pos pos;
+start_display (struct it *it, struct window *w, struct text_pos pos)
{
struct glyph_row *row;
int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0;
@@ -2971,9 +2904,7 @@ start_display (it, w, pos)
text. W is the window we display, for text property lookup. */
static int
-in_ellipses_for_invisible_text_p (pos, w)
- struct display_pos *pos;
- struct window *w;
+in_ellipses_for_invisible_text_p (struct display_pos *pos, struct window *w)
{
Lisp_Object prop, window;
int ellipses_p = 0;
@@ -3007,10 +2938,7 @@ in_ellipses_for_invisible_text_p (pos, w)
is zero if there are overlay strings with newlines at POS. */
static int
-init_from_display_pos (it, w, pos)
- struct it *it;
- struct window *w;
- struct display_pos *pos;
+init_from_display_pos (struct it *it, struct window *w, struct display_pos *pos)
{
EMACS_INT charpos = CHARPOS (pos->pos), bytepos = BYTEPOS (pos->pos);
int i, overlay_strings_with_newlines = 0;
@@ -3118,10 +3046,7 @@ init_from_display_pos (it, w, pos)
starting at ROW->start. */
static void
-init_to_row_start (it, w, row)
- struct it *it;
- struct window *w;
- struct glyph_row *row;
+init_to_row_start (struct it *it, struct window *w, struct glyph_row *row)
{
init_from_display_pos (it, w, &row->start);
it->start = row->start;
@@ -3136,10 +3061,7 @@ init_to_row_start (it, w, row)
end position. */
static int
-init_to_row_end (it, w, row)
- struct it *it;
- struct window *w;
- struct glyph_row *row;
+init_to_row_end (struct it *it, struct window *w, struct glyph_row *row)
{
int success = 0;
@@ -3167,8 +3089,7 @@ init_to_row_end (it, w, row)
to stop. */
static void
-handle_stop (it)
- struct it *it;
+handle_stop (struct it *it)
{
enum prop_handled handled;
int handle_overlay_change_p;
@@ -3261,8 +3182,7 @@ handle_stop (it)
information for IT's current position. */
static void
-compute_stop_pos (it)
- struct it *it;
+compute_stop_pos (struct it *it)
{
register INTERVAL iv, next_iv;
Lisp_Object object, limit, position;
@@ -3371,8 +3291,7 @@ compute_stop_pos (it)
xmalloc. */
static EMACS_INT
-next_overlay_change (pos)
- EMACS_INT pos;
+next_overlay_change (EMACS_INT pos)
{
int noverlays;
EMACS_INT endpos;
@@ -3408,8 +3327,7 @@ next_overlay_change (pos)
regions of text. */
static enum prop_handled
-handle_fontified_prop (it)
- struct it *it;
+handle_fontified_prop (struct it *it)
{
Lisp_Object prop, pos;
enum prop_handled handled = HANDLED_NORMALLY;
@@ -3496,8 +3414,7 @@ handle_fontified_prop (it)
Called from handle_stop. */
static enum prop_handled
-handle_face_prop (it)
- struct it *it;
+handle_face_prop (struct it *it)
{
int new_face_id;
EMACS_INT next_stop;
@@ -3635,8 +3552,7 @@ handle_face_prop (it)
Otherwise, use the iterator's base_face_id. */
static int
-underlying_face_id (it)
- struct it *it;
+underlying_face_id (struct it *it)
{
int face_id = it->base_face_id, i;
@@ -3655,9 +3571,7 @@ underlying_face_id (it)
position. Value is the id of the face. */
static int
-face_before_or_after_it_pos (it, before_p)
- struct it *it;
- int before_p;
+face_before_or_after_it_pos (struct it *it, int before_p)
{
int face_id, limit;
EMACS_INT next_check_charpos;
@@ -3771,8 +3685,7 @@ face_before_or_after_it_pos (it, before_p)
position. Called from handle_stop. */
static enum prop_handled
-handle_invisible_prop (it)
- struct it *it;
+handle_invisible_prop (struct it *it)
{
enum prop_handled handled = HANDLED_NORMALLY;
@@ -3985,9 +3898,7 @@ handle_invisible_prop (it)
Replaces LEN characters from buffer. */
static void
-setup_for_ellipsis (it, len)
- struct it *it;
- int len;
+setup_for_ellipsis (struct it *it, int len)
{
/* Use the display table definition for `...'. Invalid glyphs
will be handled by the method returning elements from dpvec. */
@@ -4031,8 +3942,7 @@ setup_for_ellipsis (it, len)
Otherwise we return HANDLED_NORMALLY. */
static enum prop_handled
-handle_display_prop (it)
- struct it *it;
+handle_display_prop (struct it *it)
{
Lisp_Object prop, object, overlay;
struct text_pos *position;
@@ -4129,10 +4039,7 @@ handle_display_prop (it)
at START_POS in OBJECT. */
static struct text_pos
-display_prop_end (it, object, start_pos)
- struct it *it;
- Lisp_Object object;
- struct text_pos start_pos;
+display_prop_end (struct it *it, Lisp_Object object, struct text_pos start_pos)
{
Lisp_Object end;
struct text_pos end_pos;
@@ -4167,14 +4074,9 @@ display_prop_end (it, object, start_pos)
of buffer or string text. */
static int
-handle_single_display_spec (it, spec, object, overlay, position,
- display_replaced_before_p)
- struct it *it;
- Lisp_Object spec;
- Lisp_Object object;
- Lisp_Object overlay;
- struct text_pos *position;
- int display_replaced_before_p;
+handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
+ Lisp_Object overlay, struct text_pos *position,
+ int display_replaced_before_p)
{
Lisp_Object form;
Lisp_Object location, value;
@@ -4539,8 +4441,7 @@ handle_single_display_spec (it, spec, object, overlay, position,
treated as intangible. */
static int
-single_display_spec_intangible_p (prop)
- Lisp_Object prop;
+single_display_spec_intangible_p (Lisp_Object prop)
{
/* Skip over `when FORM'. */
if (CONSP (prop) && EQ (XCAR (prop), Qwhen))
@@ -4582,8 +4483,7 @@ single_display_spec_intangible_p (prop)
treated as intangible. */
int
-display_prop_intangible_p (prop)
- Lisp_Object prop;
+display_prop_intangible_p (Lisp_Object prop)
{
if (CONSP (prop)
&& CONSP (XCAR (prop))
@@ -4615,8 +4515,7 @@ display_prop_intangible_p (prop)
/* Return 1 if PROP is a display sub-property value containing STRING. */
static int
-single_display_spec_string_p (prop, string)
- Lisp_Object prop, string;
+single_display_spec_string_p (Lisp_Object prop, Lisp_Object string)
{
if (EQ (string, prop))
return 1;
@@ -4650,8 +4549,7 @@ single_display_spec_string_p (prop, string)
/* Return 1 if STRING appears in the `display' property PROP. */
static int
-display_prop_string_p (prop, string)
- Lisp_Object prop, string;
+display_prop_string_p (Lisp_Object prop, Lisp_Object string)
{
if (CONSP (prop)
&& CONSP (XCAR (prop))
@@ -4692,11 +4590,8 @@ display_prop_string_p (prop, string)
called asynchronously from note_mouse_highlight. */
static EMACS_INT
-string_buffer_position_lim (w, string, from, to, back_p)
- struct window *w;
- Lisp_Object string;
- EMACS_INT from, to;
- int back_p;
+string_buffer_position_lim (struct window *w, Lisp_Object string,
+ EMACS_INT from, EMACS_INT to, int back_p)
{
Lisp_Object limit, prop, pos;
int found = 0;
@@ -4745,10 +4640,7 @@ string_buffer_position_lim (w, string, from, to, back_p)
called asynchronously from note_mouse_highlight. */
EMACS_INT
-string_buffer_position (w, string, around_charpos)
- struct window *w;
- Lisp_Object string;
- EMACS_INT around_charpos;
+string_buffer_position (struct window *w, Lisp_Object string, EMACS_INT around_charpos)
{
Lisp_Object limit, prop, pos;
const int MAX_DISTANCE = 1000;
@@ -4772,8 +4664,7 @@ string_buffer_position (w, string, around_charpos)
position. Called from handle_stop. */
static enum prop_handled
-handle_composition_prop (it)
- struct it *it;
+handle_composition_prop (struct it *it)
{
Lisp_Object prop, string;
EMACS_INT pos, pos_byte, start, end;
@@ -4846,8 +4737,7 @@ struct overlay_entry
Called from handle_stop. */
static enum prop_handled
-handle_overlay_change (it)
- struct it *it;
+handle_overlay_change (struct it *it)
{
if (!STRINGP (it->string) && get_overlay_strings (it, 0))
return HANDLED_RECOMPUTE_PROPS;
@@ -4864,8 +4754,7 @@ handle_overlay_change (it)
Otherwise IT->string is set to nil. */
static void
-next_overlay_string (it)
- struct it *it;
+next_overlay_string (struct it *it)
{
++it->current.overlay_string_index;
if (it->current.overlay_string_index == it->n_overlay_strings)
@@ -4933,8 +4822,7 @@ next_overlay_string (it)
static int
-compare_overlay_entries (e1, e2)
- void *e1, *e2;
+compare_overlay_entries (const void *e1, const void *e2)
{
struct overlay_entry *entry1 = (struct overlay_entry *) e1;
struct overlay_entry *entry2 = (struct overlay_entry *) e2;
@@ -4985,9 +4873,7 @@ compare_overlay_entries (e1, e2)
compare_overlay_entries. */
static void
-load_overlay_strings (it, charpos)
- struct it *it;
- int charpos;
+load_overlay_strings (struct it *it, int charpos)
{
extern Lisp_Object Qwindow, Qpriority;
Lisp_Object overlay, window, str, invisible;
@@ -5017,7 +4903,7 @@ load_overlay_strings (it, charpos)
entries = \
(struct overlay_entry *) alloca (new_size \
* sizeof *entries); \
- bcopy (old, entries, size * sizeof *entries); \
+ memcpy (entries, old, size * sizeof *entries); \
size = new_size; \
} \
\
@@ -5138,10 +5024,7 @@ load_overlay_strings (it, charpos)
least one overlay string was found. */
static int
-get_overlay_strings_1 (it, charpos, compute_stop_p)
- struct it *it;
- int charpos;
- int compute_stop_p;
+get_overlay_strings_1 (struct it *it, int charpos, int compute_stop_p)
{
/* Get the first OVERLAY_STRING_CHUNK_SIZE overlay strings to
process. This fills IT->overlay_strings with strings, and sets
@@ -5192,9 +5075,7 @@ get_overlay_strings_1 (it, charpos, compute_stop_p)
}
static int
-get_overlay_strings (it, charpos)
- struct it *it;
- int charpos;
+get_overlay_strings (struct it *it, int charpos)
{
it->string = Qnil;
it->method = GET_FROM_BUFFER;
@@ -5219,8 +5100,7 @@ get_overlay_strings (it, charpos)
processed. */
static void
-push_it (it)
- struct it *it;
+push_it (struct it *it)
{
struct iterator_stack_entry *p;
@@ -5264,8 +5144,7 @@ push_it (it)
}
static void
-iterate_out_of_display_property (it)
- struct it *it;
+iterate_out_of_display_property (struct it *it)
{
/* Maybe initialize paragraph direction. If we are at the beginning
of a new paragraph, next_element_from_buffer may not have a
@@ -5298,8 +5177,7 @@ iterate_out_of_display_property (it)
elements from an overlay string, or from a buffer. */
static void
-pop_it (it)
- struct it *it;
+pop_it (struct it *it)
{
struct iterator_stack_entry *p;
@@ -5378,8 +5256,7 @@ pop_it (it)
/* Set IT's current position to the previous line start. */
static void
-back_to_previous_line_start (it)
- struct it *it;
+back_to_previous_line_start (struct it *it)
{
IT_CHARPOS (*it) = find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1);
IT_BYTEPOS (*it) = CHAR_TO_BYTE (IT_CHARPOS (*it));
@@ -5405,9 +5282,7 @@ back_to_previous_line_start (it)
leads to wrong cursor motion. */
static int
-forward_to_next_line_start (it, skipped_p)
- struct it *it;
- int *skipped_p;
+forward_to_next_line_start (struct it *it, int *skipped_p)
{
int old_selective, newline_found_p, n;
const int MAX_NEWLINE_DISTANCE = 500;
@@ -5488,8 +5363,7 @@ forward_to_next_line_start (it, skipped_p)
IT->hpos. */
static void
-back_to_previous_visible_line_start (it)
- struct it *it;
+back_to_previous_visible_line_start (struct it *it)
{
while (IT_CHARPOS (*it) > BEGV)
{
@@ -5569,8 +5443,7 @@ back_to_previous_visible_line_start (it)
face information etc. */
void
-reseat_at_previous_visible_line_start (it)
- struct it *it;
+reseat_at_previous_visible_line_start (struct it *it)
{
back_to_previous_visible_line_start (it);
reseat (it, it->current.pos, 1);
@@ -5586,9 +5459,7 @@ reseat_at_previous_visible_line_start (it)
is invisible because of text properties. */
static void
-reseat_at_next_visible_line_start (it, on_newline_p)
- struct it *it;
- int on_newline_p;
+reseat_at_next_visible_line_start (struct it *it, int on_newline_p)
{
int newline_found_p, skipped_p = 0;
@@ -5642,10 +5513,7 @@ reseat_at_next_visible_line_start (it, on_newline_p)
IT->check_charpos of a property. */
static void
-reseat (it, pos, force_p)
- struct it *it;
- struct text_pos pos;
- int force_p;
+reseat (struct it *it, struct text_pos pos, int force_p)
{
int original_pos = IT_CHARPOS (*it);
@@ -5689,10 +5557,7 @@ reseat (it, pos, force_p)
IT->stop_pos to POS, also. */
static void
-reseat_1 (it, pos, set_stop_p)
- struct it *it;
- struct text_pos pos;
- int set_stop_p;
+reseat_1 (struct it *it, struct text_pos pos, int set_stop_p)
{
/* Don't call this function when scanning a C string. */
xassert (it->s == NULL);
@@ -5746,12 +5611,8 @@ reseat_1 (it, pos, set_stop_p)
calling this function. */
static void
-reseat_to_string (it, s, string, charpos, precision, field_width, multibyte)
- struct it *it;
- unsigned char *s;
- Lisp_Object string;
- int charpos;
- int precision, field_width, multibyte;
+reseat_to_string (struct it *it, unsigned char *s, Lisp_Object string,
+ int charpos, int precision, int field_width, int multibyte)
{
/* No region in strings. */
it->region_beg_charpos = it->region_end_charpos = -1;
@@ -5760,7 +5621,7 @@ reseat_to_string (it, s, string, charpos, precision, field_width, multibyte)
it->stop_charpos = -1;
/* Set iterator position and end position. */
- bzero (&it->current, sizeof it->current);
+ memset (&it->current, 0, sizeof it->current);
it->current.overlay_string_index = -1;
it->current.dpvec_index = -1;
xassert (charpos >= 0);
@@ -5839,7 +5700,7 @@ reseat_to_string (it, s, string, charpos, precision, field_width, multibyte)
/* Map enum it_method value to corresponding next_element_from_* function. */
-static int (* get_next_element[NUM_IT_METHODS]) P_ ((struct it *it)) =
+static int (* get_next_element[NUM_IT_METHODS]) (struct it *it) =
{
next_element_from_buffer,
next_element_from_display_vector,
@@ -5873,8 +5734,7 @@ static unsigned last_escape_glyph_face_id = (1 << FACE_ID_BITS);
static int last_escape_glyph_merged_face_id = 0;
int
-get_next_display_element (it)
- struct it *it;
+get_next_display_element (struct it *it)
{
/* Non-zero means that we found a display element. Zero means that
we hit the end of what we iterate over. Performance note: the
@@ -6266,9 +6126,7 @@ get_next_display_element (it)
decrement position function which would not be easy to write. */
void
-set_iterator_to_next (it, reseat_p)
- struct it *it;
- int reseat_p;
+set_iterator_to_next (struct it *it, int reseat_p)
{
/* Reset flags indicating start and end of a sequence of characters
with box. Reset them at the start of this function because
@@ -6533,8 +6391,7 @@ set_iterator_to_next (it, reseat_p)
is restored into IT->face_id in set_iterator_to_next. */
static int
-next_element_from_display_vector (it)
- struct it *it;
+next_element_from_display_vector (struct it *it)
{
Lisp_Object gc;
@@ -6583,8 +6440,7 @@ next_element_from_display_vector (it)
overlay string. */
static int
-next_element_from_string (it)
- struct it *it;
+next_element_from_string (struct it *it)
{
struct text_pos position;
@@ -6685,8 +6541,7 @@ next_element_from_string (it)
reached, including padding spaces. */
static int
-next_element_from_c_string (it)
- struct it *it;
+next_element_from_c_string (struct it *it)
{
int success_p = 1;
@@ -6731,8 +6586,7 @@ next_element_from_c_string (it)
ellipsis if an ellipsis is to be displayed. */
static int
-next_element_from_ellipsis (it)
- struct it *it;
+next_element_from_ellipsis (struct it *it)
{
if (it->selective_display_ellipsis_p)
setup_for_ellipsis (it, it->len);
@@ -6759,10 +6613,10 @@ next_element_from_ellipsis (it)
static int
-next_element_from_image (it)
- struct it *it;
+next_element_from_image (struct it *it)
{
it->what = IT_IMAGE;
+ it->ignore_overlay_strings_at_pos_p = 0;
return 1;
}
@@ -6772,8 +6626,7 @@ next_element_from_image (it)
always 1. */
static int
-next_element_from_stretch (it)
- struct it *it;
+next_element_from_stretch (struct it *it)
{
it->what = IT_STRETCH;
return 1;
@@ -6788,9 +6641,7 @@ next_element_from_stretch (it)
position. */
static void
-handle_stop_backwards (it, charpos)
- struct it *it;
- EMACS_INT charpos;
+handle_stop_backwards (struct it *it, EMACS_INT charpos)
{
EMACS_INT where_we_are = IT_CHARPOS (*it);
struct display_pos save_current = it->current;
@@ -6828,8 +6679,7 @@ handle_stop_backwards (it, charpos)
end. */
static int
-next_element_from_buffer (it)
- struct it *it;
+next_element_from_buffer (struct it *it)
{
int success_p = 1;
@@ -7038,8 +6888,7 @@ next_element_from_buffer (it)
/* Run the redisplay end trigger hook for IT. */
static void
-run_redisplay_end_trigger_hook (it)
- struct it *it;
+run_redisplay_end_trigger_hook (struct it *it)
{
Lisp_Object args[3];
@@ -7069,8 +6918,7 @@ run_redisplay_end_trigger_hook (it)
next_element_from_string when necessary. */
static int
-next_element_from_composition (it)
- struct it *it;
+next_element_from_composition (struct it *it)
{
it->what = IT_COMPOSITION;
it->len = it->cmp_it.nbytes;
@@ -7593,10 +7441,7 @@ move_it_in_display_line (struct it *it,
TO_CHARPOS. */
void
-move_it_to (it, to_charpos, to_x, to_y, to_vpos, op)
- struct it *it;
- int to_charpos, to_x, to_y, to_vpos;
- int op;
+move_it_to (struct it *it, int to_charpos, int to_x, int to_y, int to_vpos, int op)
{
enum move_it_result skip, skip2 = MOVE_X_REACHED;
int line_height, line_start_x = 0, reached = 0;
@@ -7847,9 +7692,7 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op)
set to the top of the line moved to. */
void
-move_it_vertically_backward (it, dy)
- struct it *it;
- int dy;
+move_it_vertically_backward (struct it *it, int dy)
{
int nlines, h;
struct it it2, it3;
@@ -7968,9 +7811,7 @@ move_it_vertically_backward (it, dy)
end, IT will be on the start of a screen line. */
void
-move_it_vertically (it, dy)
- struct it *it;
- int dy;
+move_it_vertically (struct it *it, int dy)
{
if (dy <= 0)
move_it_vertically_backward (it, -dy);
@@ -7994,8 +7835,7 @@ move_it_vertically (it, dy)
/* Move iterator IT past the end of the text line it is in. */
void
-move_it_past_eol (it)
- struct it *it;
+move_it_past_eol (struct it *it)
{
enum move_it_result rc;
@@ -8015,9 +7855,7 @@ move_it_past_eol (it)
truncate-lines nil. */
void
-move_it_by_lines (it, dvpos, need_y_p)
- struct it *it;
- int dvpos, need_y_p;
+move_it_by_lines (struct it *it, int dvpos, int need_y_p)
{
struct position pos;
@@ -8111,8 +7949,7 @@ move_it_by_lines (it, dvpos, need_y_p)
/* Return 1 if IT points into the middle of a display vector. */
int
-in_display_vector_p (it)
- struct it *it;
+in_display_vector_p (struct it *it)
{
return (it->method == GET_FROM_DISPLAY_VECTOR
&& it->current.dpvec_index > 0
@@ -8129,9 +7966,7 @@ in_display_vector_p (it)
to *Messages*. */
void
-add_to_log (format, arg1, arg2)
- char *format;
- Lisp_Object arg1, arg2;
+add_to_log (char *format, Lisp_Object arg1, Lisp_Object arg2)
{
Lisp_Object args[3];
Lisp_Object msg, fmt;
@@ -8156,7 +7991,7 @@ add_to_log (format, arg1, arg2)
len = SBYTES (msg) + 1;
SAFE_ALLOCA (buffer, char *, len);
- bcopy (SDATA (msg), buffer, len);
+ memcpy (buffer, SDATA (msg), len);
message_dolog (buffer, len - 1, 1, 0);
SAFE_FREE ();
@@ -8168,7 +8003,7 @@ add_to_log (format, arg1, arg2)
/* Output a newline in the *Messages* buffer if "needs" one. */
void
-message_log_maybe_newline ()
+message_log_maybe_newline (void)
{
if (message_log_need_newline)
message_dolog ("", 0, 1, 0);
@@ -8185,9 +8020,7 @@ message_log_maybe_newline ()
so the buffer M must NOT point to a Lisp string. */
void
-message_dolog (m, nbytes, nlflag, multibyte)
- const char *m;
- int nbytes, nlflag, multibyte;
+message_dolog (const char *m, int nbytes, int nlflag, int multibyte)
{
if (!NILP (Vmemory_full))
return;
@@ -8357,9 +8190,8 @@ message_dolog (m, nbytes, nlflag, multibyte)
value N > 1 if we should also append " [N times]". */
static int
-message_log_check_duplicate (prev_bol, prev_bol_byte, this_bol, this_bol_byte)
- int prev_bol, this_bol;
- int prev_bol_byte, this_bol_byte;
+message_log_check_duplicate (int prev_bol, int prev_bol_byte,
+ int this_bol, int this_bol_byte)
{
int i;
int len = Z_BYTE - 1 - this_bol_byte;
@@ -8397,10 +8229,7 @@ message_log_check_duplicate (prev_bol, prev_bol_byte, this_bol, this_bol_byte)
This may GC, so the buffer M must NOT point to a Lisp string. */
void
-message2 (m, nbytes, multibyte)
- const char *m;
- int nbytes;
- int multibyte;
+message2 (const char *m, int nbytes, int multibyte)
{
/* First flush out any partial line written with print. */
message_log_maybe_newline ();
@@ -8413,9 +8242,7 @@ message2 (m, nbytes, multibyte)
/* The non-logging counterpart of message2. */
void
-message2_nolog (m, nbytes, multibyte)
- const char *m;
- int nbytes, multibyte;
+message2_nolog (const char *m, int nbytes, int multibyte)
{
struct frame *sf = SELECTED_FRAME ();
message_enable_multibyte = multibyte;
@@ -8477,10 +8304,7 @@ message2_nolog (m, nbytes, multibyte)
This function cancels echoing. */
void
-message3 (m, nbytes, multibyte)
- Lisp_Object m;
- int nbytes;
- int multibyte;
+message3 (Lisp_Object m, int nbytes, int multibyte)
{
struct gcpro gcpro1;
@@ -8496,7 +8320,7 @@ message3 (m, nbytes, multibyte)
USE_SAFE_ALLOCA;
SAFE_ALLOCA (buffer, char *, nbytes);
- bcopy (SDATA (m), buffer, nbytes);
+ memcpy (buffer, SDATA (m), nbytes);
message_dolog (buffer, nbytes, 1, multibyte);
SAFE_FREE ();
}
@@ -8512,9 +8336,7 @@ message3 (m, nbytes, multibyte)
and make this cancel echoing. */
void
-message3_nolog (m, nbytes, multibyte)
- Lisp_Object m;
- int nbytes, multibyte;
+message3_nolog (Lisp_Object m, int nbytes, int multibyte)
{
struct frame *sf = SELECTED_FRAME ();
message_enable_multibyte = multibyte;
@@ -8582,8 +8404,7 @@ message3_nolog (m, nbytes, multibyte)
that was alloca'd. */
void
-message1 (m)
- char *m;
+message1 (const char *m)
{
message2 (m, (m ? strlen (m) : 0), 0);
}
@@ -8592,8 +8413,7 @@ message1 (m)
/* The non-logging counterpart of message1. */
void
-message1_nolog (m)
- char *m;
+message1_nolog (const char *m)
{
message2_nolog (m, (m ? strlen (m) : 0), 0);
}
@@ -8602,10 +8422,7 @@ message1_nolog (m)
which gets replaced with STRING. */
void
-message_with_string (m, string, log)
- char *m;
- Lisp_Object string;
- int log;
+message_with_string (const char *m, Lisp_Object string, int log)
{
CHECK_STRING (string);
@@ -8668,11 +8485,8 @@ message_with_string (m, string, log)
/* Dump an informative message to the minibuf. If M is 0, clear out
any existing message, and let the mini-buffer text show through. */
-/* VARARGS 1 */
-void
-message (m, a1, a2, a3)
- char *m;
- EMACS_INT a1, a2, a3;
+static void
+vmessage (const char *m, va_list ap)
{
if (noninteractive)
{
@@ -8681,7 +8495,7 @@ message (m, a1, a2, a3)
if (noninteractive_need_newline)
putc ('\n', stderr);
noninteractive_need_newline = 0;
- fprintf (stderr, m, a1, a2, a3);
+ vfprintf (stderr, m, ap);
if (cursor_in_echo_area == 0)
fprintf (stderr, "\n");
fflush (stderr);
@@ -8709,13 +8523,9 @@ message (m, a1, a2, a3)
if (m)
{
int len;
- char *a[3];
- a[0] = (char *) a1;
- a[1] = (char *) a2;
- a[2] = (char *) a3;
len = doprnt (FRAME_MESSAGE_BUF (f),
- FRAME_MESSAGE_BUF_SIZE (f), m, (char *)0, 3, a);
+ FRAME_MESSAGE_BUF_SIZE (f), m, (char *)0, ap);
message2 (FRAME_MESSAGE_BUF (f), len, 0);
}
@@ -8729,19 +8539,29 @@ message (m, a1, a2, a3)
}
}
+void
+message (const char *m, ...)
+{
+ va_list ap;
+ va_start (ap, m);
+ vmessage (m, ap);
+ va_end (ap);
+}
+
/* The non-logging version of message. */
void
-message_nolog (m, a1, a2, a3)
- char *m;
- EMACS_INT a1, a2, a3;
+message_nolog (const char *m, ...)
{
Lisp_Object old_log_max;
+ va_list ap;
+ va_start (ap, m);
old_log_max = Vmessage_log_max;
Vmessage_log_max = Qnil;
- message (m, a1, a2, a3);
+ vmessage (m, ap);
Vmessage_log_max = old_log_max;
+ va_end (ap);
}
@@ -8750,7 +8570,7 @@ message_nolog (m, a1, a2, a3)
critical. */
void
-update_echo_area ()
+update_echo_area (void)
{
if (!NILP (echo_area_buffer[0]))
{
@@ -8766,7 +8586,7 @@ update_echo_area ()
If they aren't, make new ones. */
static void
-ensure_echo_area_buffers ()
+ensure_echo_area_buffers (void)
{
int i;
@@ -8810,13 +8630,9 @@ ensure_echo_area_buffers ()
Value is what FN returns. */
static int
-with_echo_area_buffer (w, which, fn, a1, a2, a3, a4)
- struct window *w;
- int which;
- int (*fn) P_ ((EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
- EMACS_INT a1;
- Lisp_Object a2;
- EMACS_INT a3, a4;
+with_echo_area_buffer (struct window *w, int which,
+ int (*fn) (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT),
+ EMACS_INT a1, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4)
{
Lisp_Object buffer;
int this_one, the_other, clear_buffer_p, rc;
@@ -8903,8 +8719,7 @@ with_echo_area_buffer (w, which, fn, a1, a2, a3, a4)
FN called in with_echo_area_buffer. */
static Lisp_Object
-with_echo_area_buffer_unwind_data (w)
- struct window *w;
+with_echo_area_buffer_unwind_data (struct window *w)
{
int i = 0;
Lisp_Object vector, tmp;
@@ -8944,8 +8759,7 @@ with_echo_area_buffer_unwind_data (w)
with_echo_area_buffer_unwind_data. */
static Lisp_Object
-unwind_with_echo_area_buffer (vector)
- Lisp_Object vector;
+unwind_with_echo_area_buffer (Lisp_Object vector)
{
set_buffer_internal_1 (XBUFFER (AREF (vector, 0)));
Vdeactivate_mark = AREF (vector, 1);
@@ -8975,8 +8789,7 @@ unwind_with_echo_area_buffer (vector)
non-zero means we will print multibyte. */
void
-setup_echo_area_for_printing (multibyte_p)
- int multibyte_p;
+setup_echo_area_for_printing (int multibyte_p)
{
/* If we can't find an echo area any more, exit. */
if (! FRAME_LIVE_P (XFRAME (selected_frame)))
@@ -9050,8 +8863,7 @@ setup_echo_area_for_printing (multibyte_p)
display the current message. */
static int
-display_echo_area (w)
- struct window *w;
+display_echo_area (struct window *w)
{
int i, no_message_p, window_height_changed_p, count;
@@ -9089,10 +8901,7 @@ display_echo_area (w)
Value is non-zero if height of W was changed. */
static int
-display_echo_area_1 (a1, a2, a3, a4)
- EMACS_INT a1;
- Lisp_Object a2;
- EMACS_INT a3, a4;
+display_echo_area_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4)
{
struct window *w = (struct window *) a1;
Lisp_Object window;
@@ -9121,7 +8930,7 @@ display_echo_area_1 (a1, a2, a3, a4)
is active, don't shrink it. */
void
-resize_echo_area_exactly ()
+resize_echo_area_exactly (void)
{
if (BUFFERP (echo_area_buffer[0])
&& WINDOWP (echo_area_window))
@@ -9154,10 +8963,7 @@ resize_echo_area_exactly ()
resize_mini_window returns. */
static int
-resize_mini_window_1 (a1, exactly, a3, a4)
- EMACS_INT a1;
- Lisp_Object exactly;
- EMACS_INT a3, a4;
+resize_mini_window_1 (EMACS_INT a1, Lisp_Object exactly, EMACS_INT a3, EMACS_INT a4)
{
return resize_mini_window ((struct window *) a1, !NILP (exactly));
}
@@ -9175,9 +8981,7 @@ resize_mini_window_1 (a1, exactly, a3, a4)
Value is non-zero if the window height has been changed. */
int
-resize_mini_window (w, exact_p)
- struct window *w;
- int exact_p;
+resize_mini_window (struct window *w, int exact_p)
{
struct frame *f = XFRAME (w->frame);
int window_height_changed_p = 0;
@@ -9318,7 +9122,7 @@ resize_mini_window (w, exact_p)
current message. */
Lisp_Object
-current_message ()
+current_message (void)
{
Lisp_Object msg;
@@ -9337,10 +9141,7 @@ current_message ()
static int
-current_message_1 (a1, a2, a3, a4)
- EMACS_INT a1;
- Lisp_Object a2;
- EMACS_INT a3, a4;
+current_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4)
{
Lisp_Object *msg = (Lisp_Object *) a1;
@@ -9358,7 +9159,7 @@ current_message_1 (a1, a2, a3, a4)
worth optimizing. */
int
-push_message ()
+push_message (void)
{
Lisp_Object msg;
msg = current_message ();
@@ -9370,7 +9171,7 @@ push_message ()
/* Restore message display from the top of Vmessage_stack. */
void
-restore_message ()
+restore_message (void)
{
Lisp_Object msg;
@@ -9386,8 +9187,7 @@ restore_message ()
/* Handler for record_unwind_protect calling pop_message. */
Lisp_Object
-pop_message_unwind (dummy)
- Lisp_Object dummy;
+pop_message_unwind (Lisp_Object dummy)
{
pop_message ();
return Qnil;
@@ -9396,7 +9196,7 @@ pop_message_unwind (dummy)
/* Pop the top-most entry off Vmessage_stack. */
void
-pop_message ()
+pop_message (void)
{
xassert (CONSP (Vmessage_stack));
Vmessage_stack = XCDR (Vmessage_stack);
@@ -9408,7 +9208,7 @@ pop_message ()
somewhere. */
void
-check_message_stack ()
+check_message_stack (void)
{
if (!NILP (Vmessage_stack))
abort ();
@@ -9419,8 +9219,7 @@ check_message_stack ()
time we display it---but don't redisplay it now. */
void
-truncate_echo_area (nchars)
- int nchars;
+truncate_echo_area (int nchars)
{
if (nchars == 0)
echo_area_buffer[0] = Qnil;
@@ -9442,10 +9241,7 @@ truncate_echo_area (nchars)
message to at most NCHARS characters. */
static int
-truncate_message_1 (nchars, a2, a3, a4)
- EMACS_INT nchars;
- Lisp_Object a2;
- EMACS_INT a3, a4;
+truncate_message_1 (EMACS_INT nchars, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4)
{
if (BEG + nchars < Z)
del_range (BEG + nchars, Z);
@@ -9470,10 +9266,7 @@ truncate_message_1 (nchars, a2, a3, a4)
*/
void
-set_message (s, string, nbytes, multibyte_p)
- const char *s;
- Lisp_Object string;
- int nbytes, multibyte_p;
+set_message (const char *s, Lisp_Object string, int nbytes, int multibyte_p)
{
message_enable_multibyte
= ((s && multibyte_p)
@@ -9492,10 +9285,7 @@ set_message (s, string, nbytes, multibyte_p)
current. */
static int
-set_message_1 (a1, a2, nbytes, multibyte_p)
- EMACS_INT a1;
- Lisp_Object a2;
- EMACS_INT nbytes, multibyte_p;
+set_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT nbytes, EMACS_INT multibyte_p)
{
const char *s = (const char *) a1;
Lisp_Object string = a2;
@@ -9574,8 +9364,7 @@ set_message_1 (a1, a2, nbytes, multibyte_p)
last displayed. */
void
-clear_message (current_p, last_displayed_p)
- int current_p, last_displayed_p;
+clear_message (int current_p, int last_displayed_p)
{
if (current_p)
{
@@ -9599,7 +9388,7 @@ clear_message (current_p, last_displayed_p)
and ensure a complete redisplay of all windows. */
static void
-clear_garbaged_frames ()
+clear_garbaged_frames (void)
{
if (frame_garbaged)
{
@@ -9636,8 +9425,7 @@ clear_garbaged_frames ()
mini-windows height has been changed. */
static int
-echo_area_display (update_frame_p)
- int update_frame_p;
+echo_area_display (int update_frame_p)
{
Lisp_Object mini_window;
struct window *w;
@@ -9812,8 +9600,7 @@ format_mode_line_unwind_data (struct buffer *obuf,
}
static Lisp_Object
-unwind_format_mode_line (vector)
- Lisp_Object vector;
+unwind_format_mode_line (Lisp_Object vector)
{
mode_line_target = XINT (AREF (vector, 0));
mode_line_noprop_ptr = mode_line_noprop_buf + XINT (AREF (vector, 1));
@@ -9842,12 +9629,7 @@ unwind_format_mode_line (vector)
Re-allocate mode_line_noprop_buf if necessary. */
static void
-#ifdef PROTOTYPES
store_mode_line_noprop_char (char c)
-#else
-store_mode_line_noprop_char (c)
- char c;
-#endif
{
/* If output position has reached the end of the allocated buffer,
double the buffer's size. */
@@ -9873,9 +9655,7 @@ store_mode_line_noprop_char (c)
frame title. */
static int
-store_mode_line_noprop (str, field_width, precision)
- const unsigned char *str;
- int field_width, precision;
+store_mode_line_noprop (const unsigned char *str, int field_width, int precision)
{
int n = 0;
int dummy, nbytes;
@@ -9908,8 +9688,7 @@ store_mode_line_noprop (str, field_width, precision)
frame_title_format. */
static void
-x_consider_frame_title (frame)
- Lisp_Object frame;
+x_consider_frame_title (Lisp_Object frame)
{
struct frame *f = XFRAME (frame);
@@ -9969,7 +9748,7 @@ x_consider_frame_title (frame)
higher level than this.) */
if (! STRINGP (f->name)
|| SBYTES (f->name) != len
- || bcmp (title, SDATA (f->name), len) != 0)
+ || memcmp (title, SDATA (f->name), len) != 0)
x_implicitly_set_name (f, make_string (title, len), Qnil);
}
}
@@ -9988,7 +9767,7 @@ x_consider_frame_title (frame)
appropriate. This can call eval. */
void
-prepare_menu_bars ()
+prepare_menu_bars (void)
{
int all_windows;
struct gcpro gcpro1, gcpro2;
@@ -10086,12 +9865,6 @@ prepare_menu_bars ()
update_tool_bar (sf, 1);
#endif
}
-
- /* Motif needs this. See comment in xmenu.c. Turn it off when
- pending_menu_activation is not defined. */
-#ifdef USE_X_TOOLKIT
- pending_menu_activation = 0;
-#endif
}
@@ -10107,10 +9880,7 @@ prepare_menu_bars ()
updated value of this flag, to pass to the next call. */
static int
-update_menu_bar (f, save_match_data, hooks_run)
- struct frame *f;
- int save_match_data;
- int hooks_run;
+update_menu_bar (struct frame *f, int save_match_data, int hooks_run)
{
Lisp_Object window;
register struct window *w;
@@ -10235,8 +10005,7 @@ struct cursor_pos output_cursor;
positions are relative to updated_window. */
void
-set_output_cursor (cursor)
- struct cursor_pos *cursor;
+set_output_cursor (struct cursor_pos *cursor)
{
output_cursor.hpos = cursor->hpos;
output_cursor.vpos = cursor->vpos;
@@ -10257,8 +10026,7 @@ set_output_cursor (cursor)
selected_window and display the cursor at the given position. */
void
-x_cursor_to (vpos, hpos, y, x)
- int vpos, hpos, y, x;
+x_cursor_to (int vpos, int hpos, int y, int x)
{
struct window *w;
@@ -10306,8 +10074,7 @@ int last_tool_bar_item;
static Lisp_Object
-update_tool_bar_unwind (frame)
- Lisp_Object frame;
+update_tool_bar_unwind (Lisp_Object frame)
{
selected_frame = frame;
return Qnil;
@@ -10319,9 +10086,7 @@ update_tool_bar_unwind (frame)
and restore it here. */
static void
-update_tool_bar (f, save_match_data)
- struct frame *f;
- int save_match_data;
+update_tool_bar (struct frame *f, int save_match_data)
{
#if defined (USE_GTK) || defined (HAVE_NS)
int do_update = FRAME_EXTERNAL_TOOL_BAR (f);
@@ -10419,8 +10184,7 @@ update_tool_bar (f, save_match_data)
been set up previously by calling prepare_menu_bars. */
static void
-build_desired_tool_bar_string (f)
- struct frame *f;
+build_desired_tool_bar_string (struct frame *f)
{
int i, size, size_needed;
struct gcpro gcpro1, gcpro2, gcpro3;
@@ -10591,9 +10355,7 @@ build_desired_tool_bar_string (f)
*/
static void
-display_tool_bar_line (it, height)
- struct it *it;
- int height;
+display_tool_bar_line (struct it *it, int height)
{
struct glyph_row *row = it->glyph_row;
int max_x = it->last_visible_x;
@@ -10720,9 +10482,7 @@ display_tool_bar_line (it, height)
returned in *N_ROWS if non-NULL. */
static int
-tool_bar_lines_needed (f, n_rows)
- struct frame *f;
- int *n_rows;
+tool_bar_lines_needed (struct frame *f, int *n_rows)
{
struct window *w = XWINDOW (f->tool_bar_window);
struct it it;
@@ -10757,8 +10517,7 @@ tool_bar_lines_needed (f, n_rows)
DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed,
0, 1, 0,
doc: /* Return the number of lines occupied by the tool bar of FRAME. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct frame *f;
struct window *w;
@@ -10790,8 +10549,7 @@ DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed,
height should be changed. */
static int
-redisplay_tool_bar (f)
- struct frame *f;
+redisplay_tool_bar (struct frame *f)
{
struct window *w;
struct it it;
@@ -10962,10 +10720,7 @@ redisplay_tool_bar (f)
GLYPH doesn't display a tool-bar item. */
static int
-tool_bar_item_info (f, glyph, prop_idx)
- struct frame *f;
- struct glyph *glyph;
- int *prop_idx;
+tool_bar_item_info (struct frame *f, struct glyph *glyph, int *prop_idx)
{
Lisp_Object prop;
int success_p;
@@ -11005,11 +10760,8 @@ tool_bar_item_info (f, glyph, prop_idx)
1 otherwise. */
static int
-get_tool_bar_item (f, x, y, glyph, hpos, vpos, prop_idx)
- struct frame *f;
- int x, y;
- struct glyph **glyph;
- int *hpos, *vpos, *prop_idx;
+get_tool_bar_item (struct frame *f, int x, int y, struct glyph **glyph,
+ int *hpos, int *vpos, int *prop_idx)
{
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
struct window *w = XWINDOW (f->tool_bar_window);
@@ -11047,10 +10799,8 @@ get_tool_bar_item (f, x, y, glyph, hpos, vpos, prop_idx)
release. */
void
-handle_tool_bar_click (f, x, y, down_p, modifiers)
- struct frame *f;
- int x, y, down_p;
- unsigned int modifiers;
+handle_tool_bar_click (struct frame *f, int x, int y, int down_p,
+ unsigned int modifiers)
{
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
struct window *w = XWINDOW (f->tool_bar_window);
@@ -11108,9 +10858,7 @@ handle_tool_bar_click (f, x, y, down_p, modifiers)
note_mouse_highlight. */
static void
-note_tool_bar_highlight (f, x, y)
- struct frame *f;
- int x, y;
+note_tool_bar_highlight (struct frame *f, int x, int y)
{
Lisp_Object window = f->tool_bar_window;
struct window *w = XWINDOW (window);
@@ -11204,8 +10952,8 @@ note_tool_bar_highlight (f, x, y)
Horizontal scrolling
************************************************************************/
-static int hscroll_window_tree P_ ((Lisp_Object));
-static int hscroll_windows P_ ((Lisp_Object));
+static int hscroll_window_tree (Lisp_Object);
+static int hscroll_windows (Lisp_Object);
/* For all leaf windows in the window tree rooted at WINDOW, set their
hscroll value so that PT is (i) visible in the window, and (ii) so
@@ -11214,8 +10962,7 @@ static int hscroll_windows P_ ((Lisp_Object));
changed. */
static int
-hscroll_window_tree (window)
- Lisp_Object window;
+hscroll_window_tree (Lisp_Object window)
{
int hscrolled_p = 0;
int hscroll_relative_p = FLOATP (Vhscroll_step);
@@ -11358,8 +11105,7 @@ hscroll_window_tree (window)
of WINDOW are cleared. */
static int
-hscroll_windows (window)
- Lisp_Object window;
+hscroll_windows (Lisp_Object window)
{
int hscrolled_p = hscroll_window_tree (window);
if (hscrolled_p)
@@ -11442,9 +11188,7 @@ debug_method_add (w, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9)
redisplay_internal for display optimization. */
static INLINE int
-text_outside_line_unchanged_p (w, start, end)
- struct window *w;
- int start, end;
+text_outside_line_unchanged_p (struct window *w, int start, int end)
{
int unchanged_p = 1;
@@ -11511,15 +11255,14 @@ text_outside_line_unchanged_p (w, start, end)
mini-buffer if that is in use. */
void
-redisplay ()
+redisplay (void)
{
redisplay_internal (0);
}
static Lisp_Object
-overlay_arrow_string_or_property (var)
- Lisp_Object var;
+overlay_arrow_string_or_property (Lisp_Object var)
{
Lisp_Object val;
@@ -11531,7 +11274,7 @@ overlay_arrow_string_or_property (var)
/* Return 1 if there are any overlay-arrows in current_buffer. */
static int
-overlay_arrow_in_current_buffer_p ()
+overlay_arrow_in_current_buffer_p (void)
{
Lisp_Object vlist;
@@ -11557,7 +11300,7 @@ overlay_arrow_in_current_buffer_p ()
has changed. */
static int
-overlay_arrows_changed_p ()
+overlay_arrows_changed_p (void)
{
Lisp_Object vlist;
@@ -11585,8 +11328,7 @@ overlay_arrows_changed_p ()
/* Mark overlay arrows to be updated on next redisplay. */
static void
-update_overlay_arrows (up_to_date)
- int up_to_date;
+update_overlay_arrows (int up_to_date)
{
Lisp_Object vlist;
@@ -11622,9 +11364,7 @@ update_overlay_arrows (up_to_date)
Return nil if no overlay arrow. */
static Lisp_Object
-overlay_arrow_at_row (it, row)
- struct it *it;
- struct glyph_row *row;
+overlay_arrow_at_row (struct it *it, struct glyph_row *row)
{
Lisp_Object vlist;
@@ -11669,9 +11409,8 @@ overlay_arrow_at_row (it, row)
position. BUF and PT are the current point buffer and position. */
int
-check_point_in_composition (prev_buf, prev_pt, buf, pt)
- struct buffer *prev_buf, *buf;
- int prev_pt, pt;
+check_point_in_composition (struct buffer *prev_buf, int prev_pt,
+ struct buffer *buf, int pt)
{
EMACS_INT start, end;
Lisp_Object prop;
@@ -11707,9 +11446,7 @@ check_point_in_composition (prev_buf, prev_pt, buf, pt)
in window W. */
static INLINE void
-reconsider_clip_changes (w, b)
- struct window *w;
- struct buffer *b;
+reconsider_clip_changes (struct window *w, struct buffer *b)
{
if (b->clip_changed
&& !NILP (w->window_end_valid)
@@ -11748,8 +11485,7 @@ reconsider_clip_changes (w, b)
directly. */
static void
-select_frame_for_redisplay (frame)
- Lisp_Object frame;
+select_frame_for_redisplay (Lisp_Object frame)
{
Lisp_Object tail, tem;
Lisp_Object old = selected_frame;
@@ -11790,8 +11526,7 @@ do { if (polling_stopped_here) start_polling (); \
causes some problems. */
static void
-redisplay_internal (preserve_echo_area)
- int preserve_echo_area;
+redisplay_internal (int preserve_echo_area)
{
struct window *w = XWINDOW (selected_window);
struct frame *f;
@@ -12524,8 +12259,7 @@ redisplay_internal (preserve_echo_area)
called. This is useful for debugging. */
void
-redisplay_preserve_echo_area (from_where)
- int from_where;
+redisplay_preserve_echo_area (int from_where)
{
TRACE ((stderr, "redisplay_preserve_echo_area (%d)\n", from_where));
@@ -12554,8 +12288,7 @@ redisplay_preserve_echo_area (from_where)
failure during redisplay, for example). */
static Lisp_Object
-unwind_redisplay (val)
- Lisp_Object val;
+unwind_redisplay (Lisp_Object val)
{
Lisp_Object old_redisplaying_p, old_frame;
@@ -12575,9 +12308,7 @@ unwind_redisplay (val)
redisplay_internal is called. */
static void
-mark_window_display_accurate_1 (w, accurate_p)
- struct window *w;
- int accurate_p;
+mark_window_display_accurate_1 (struct window *w, int accurate_p)
{
if (BUFFERP (w->buffer))
{
@@ -12628,9 +12359,7 @@ mark_window_display_accurate_1 (w, accurate_p)
be redisplayed the next time redisplay_internal is called. */
void
-mark_window_display_accurate (window, accurate_p)
- Lisp_Object window;
- int accurate_p;
+mark_window_display_accurate (Lisp_Object window, int accurate_p)
{
struct window *w;
@@ -12665,9 +12394,7 @@ mark_window_display_accurate (window, accurate_p)
macro DISP_CHAR_VECTOR. */
Lisp_Object
-disp_char_vector (dp, c)
- struct Lisp_Char_Table *dp;
- int c;
+disp_char_vector (struct Lisp_Char_Table *dp, int c)
{
Lisp_Object val;
@@ -12698,8 +12425,7 @@ disp_char_vector (dp, c)
/* Redisplay all leaf windows in the window tree rooted at WINDOW. */
static void
-redisplay_windows (window)
- Lisp_Object window;
+redisplay_windows (Lisp_Object window)
{
while (!NILP (window))
{
@@ -12724,15 +12450,14 @@ redisplay_windows (window)
}
static Lisp_Object
-redisplay_window_error ()
+redisplay_window_error (Lisp_Object ignore)
{
displayed_buffer->display_error_modiff = BUF_MODIFF (displayed_buffer);
return Qnil;
}
static Lisp_Object
-redisplay_window_0 (window)
- Lisp_Object window;
+redisplay_window_0 (Lisp_Object window)
{
if (displayed_buffer->display_error_modiff < BUF_MODIFF (displayed_buffer))
redisplay_window (window, 0);
@@ -12740,8 +12465,7 @@ redisplay_window_0 (window)
}
static Lisp_Object
-redisplay_window_1 (window)
- Lisp_Object window;
+redisplay_window_1 (Lisp_Object window)
{
if (displayed_buffer->display_error_modiff < BUF_MODIFF (displayed_buffer))
redisplay_window (window, 1);
@@ -12769,11 +12493,9 @@ redisplay_window_1 (window)
Return 0 if cursor is not on this row, 1 otherwise. */
int
-set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
- struct window *w;
- struct glyph_row *row;
- struct glyph_matrix *matrix;
- int delta, delta_bytes, dy, dvpos;
+set_cursor_from_row (struct window *w, struct glyph_row *row,
+ struct glyph_matrix *matrix, int delta, int delta_bytes,
+ int dy, int dvpos)
{
struct glyph *glyph = row->glyphs[TEXT_AREA];
struct glyph *end = glyph + row->used[TEXT_AREA];
@@ -13198,7 +12920,7 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
point. */
if (/* previous candidate is a glyph in TEXT_AREA of that row */
w->cursor.hpos >= 0
- && w->cursor.hpos < MATRIX_ROW_USED(matrix, w->cursor.vpos)
+ && w->cursor.hpos < MATRIX_ROW_USED (matrix, w->cursor.vpos)
&& BUFFERP (g1->object)
&& (g1->charpos == pt_old /* an exact match always wins */
|| (BUFFERP (glyph->object)
@@ -13259,9 +12981,7 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
We assume that the window's buffer is really current. */
static INLINE struct text_pos
-run_window_scroll_functions (window, startp)
- Lisp_Object window;
- struct text_pos startp;
+run_window_scroll_functions (Lisp_Object window, struct text_pos startp)
{
struct window *w = XWINDOW (window);
SET_MARKER_FROM_TEXT_POS (w->start, startp);
@@ -13295,10 +13015,7 @@ run_window_scroll_functions (window, startp)
as if point had gone off the screen. */
static int
-cursor_row_fully_visible_p (w, force_p, current_matrix_p)
- struct window *w;
- int force_p;
- int current_matrix_p;
+cursor_row_fully_visible_p (struct window *w, int force_p, int current_matrix_p)
{
struct glyph_matrix *matrix;
struct glyph_row *row;
@@ -13358,13 +13075,9 @@ enum
};
static int
-try_scrolling (window, just_this_one_p, scroll_conservatively,
- scroll_step, temp_scroll_step, last_line_misfit)
- Lisp_Object window;
- int just_this_one_p;
- EMACS_INT scroll_conservatively, scroll_step;
- int temp_scroll_step;
- int last_line_misfit;
+try_scrolling (Lisp_Object window, int just_this_one_p,
+ EMACS_INT scroll_conservatively, EMACS_INT scroll_step,
+ int temp_scroll_step, int last_line_misfit)
{
struct window *w = XWINDOW (window);
struct frame *f = XFRAME (w->frame);
@@ -13431,14 +13144,22 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
if (PT > CHARPOS (it.current.pos))
{
int y0 = line_bottom_y (&it);
-
- /* Compute the distance from the scroll margin to PT
- (including the height of the cursor line). Moving the
- iterator unconditionally to PT can be slow if PT is far
- away, so stop 10 lines past the window bottom (is there a
- way to do the right thing quickly?). */
- move_it_to (&it, PT, -1,
- it.last_visible_y + 10 * FRAME_LINE_HEIGHT (f),
+ /* Compute how many pixels below window bottom to stop searching
+ for PT. This avoids costly search for PT that is far away if
+ the user limited scrolling by a small number of lines, but
+ always finds PT if scroll_conservatively is set to a large
+ number, such as most-positive-fixnum. */
+ int slack = max (scroll_max, 10 * FRAME_LINE_HEIGHT (f));
+ int y_to_move =
+ slack >= INT_MAX - it.last_visible_y
+ ? INT_MAX
+ : it.last_visible_y + slack;
+
+ /* Compute the distance from the scroll margin to PT or to
+ the scroll limit, whichever comes first. This should
+ include the height of the cursor line, to make that line
+ fully visible. */
+ move_it_to (&it, PT, -1, y_to_move,
-1, MOVE_TO_POS | MOVE_TO_Y);
dy = line_bottom_y (&it) - y0;
@@ -13478,7 +13199,26 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
return SCROLLING_FAILED;
start_display (&it, w, startp);
- move_it_vertically (&it, amount_to_scroll);
+ if (scroll_max < INT_MAX)
+ move_it_vertically (&it, amount_to_scroll);
+ else
+ {
+ /* Extra precision for users who set scroll-conservatively
+ to most-positive-fixnum: make sure the amount we scroll
+ the window start is never less than amount_to_scroll,
+ which was computed as distance from window bottom to
+ point. This matters when lines at window top and lines
+ below window bottom have different height. */
+ struct it it1 = it;
+ /* We use a temporary it1 because line_bottom_y can modify
+ its argument, if it moves one line down; see there. */
+ int start_y = line_bottom_y (&it1);
+
+ do {
+ move_it_by_lines (&it, 1, 1);
+ it1 = it;
+ } while (line_bottom_y (&it1) - start_y < amount_to_scroll);
+ }
/* If STARTP is unchanged, move it down another screen line. */
if (CHARPOS (it.current.pos) == CHARPOS (startp))
@@ -13590,8 +13330,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
screen line with the minimum distance from the old start W->start. */
static int
-compute_window_start_on_continuation_line (w)
- struct window *w;
+compute_window_start_on_continuation_line (struct window *w)
{
struct text_pos pos, start_pos;
int window_start_changed_p = 0;
@@ -13677,10 +13416,7 @@ enum
};
static int
-try_cursor_movement (window, startp, scroll_step)
- Lisp_Object window;
- struct text_pos startp;
- int *scroll_step;
+try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_step)
{
struct window *w = XWINDOW (window);
struct frame *f = XFRAME (w->frame);
@@ -13984,8 +13720,7 @@ try_cursor_movement (window, startp, scroll_step)
}
void
-set_vertical_scroll_bar (w)
- struct window *w;
+set_vertical_scroll_bar (struct window *w)
{
int start, end, whole;
@@ -14030,9 +13765,7 @@ set_vertical_scroll_bar (w)
retry. */
static void
-redisplay_window (window, just_this_one_p)
- Lisp_Object window;
- int just_this_one_p;
+redisplay_window (Lisp_Object window, int just_this_one_p)
{
struct window *w = XWINDOW (window);
struct frame *f = XFRAME (w->frame);
@@ -14826,10 +14559,7 @@ redisplay_window (window, just_this_one_p)
set in FLAGS.) */
int
-try_window (window, pos, flags)
- Lisp_Object window;
- struct text_pos pos;
- int flags;
+try_window (Lisp_Object window, struct text_pos pos, int flags)
{
struct window *w = XWINDOW (window);
struct it it;
@@ -14929,8 +14659,7 @@ try_window (window, pos, flags)
W->start is the new window start. */
static int
-try_window_reusing_current_matrix (w)
- struct window *w;
+try_window_reusing_current_matrix (struct window *w)
{
struct frame *f = XFRAME (w->frame);
struct glyph_row *row, *bottom_row;
@@ -15357,12 +15086,12 @@ try_window_reusing_current_matrix (w)
Window redisplay reusing current matrix when buffer has changed
************************************************************************/
-static struct glyph_row *find_last_unchanged_at_beg_row P_ ((struct window *));
-static struct glyph_row *find_first_unchanged_at_end_row P_ ((struct window *,
- int *, int *));
+static struct glyph_row *find_last_unchanged_at_beg_row (struct window *);
+static struct glyph_row *find_first_unchanged_at_end_row (struct window *,
+ int *, int *);
static struct glyph_row *
-find_last_row_displaying_text P_ ((struct glyph_matrix *, struct it *,
- struct glyph_row *));
+find_last_row_displaying_text (struct glyph_matrix *, struct it *,
+ struct glyph_row *);
/* Return the last row in MATRIX displaying text. If row START is
@@ -15371,10 +15100,8 @@ find_last_row_displaying_text P_ ((struct glyph_matrix *, struct it *,
a pointer to the row found. */
static struct glyph_row *
-find_last_row_displaying_text (matrix, it, start)
- struct glyph_matrix *matrix;
- struct it *it;
- struct glyph_row *start;
+find_last_row_displaying_text (struct glyph_matrix *matrix, struct it *it,
+ struct glyph_row *start)
{
struct glyph_row *row, *row_found;
@@ -15407,8 +15134,7 @@ find_last_row_displaying_text (matrix, it, start)
when the current matrix was built. */
static struct glyph_row *
-find_last_unchanged_at_beg_row (w)
- struct window *w;
+find_last_unchanged_at_beg_row (struct window *w)
{
int first_changed_pos = BEG + BEG_UNCHANGED;
struct glyph_row *row;
@@ -15457,9 +15183,7 @@ find_last_unchanged_at_beg_row (w)
changes. */
static struct glyph_row *
-find_first_unchanged_at_end_row (w, delta, delta_bytes)
- struct window *w;
- int *delta, *delta_bytes;
+find_first_unchanged_at_end_row (struct window *w, int *delta, int *delta_bytes)
{
struct glyph_row *row;
struct glyph_row *row_found = NULL;
@@ -15532,8 +15256,7 @@ find_first_unchanged_at_end_row (w, delta, delta_bytes)
try_window_reusing_current_matrix. */
static void
-sync_frame_with_window_matrix_rows (w)
- struct window *w;
+sync_frame_with_window_matrix_rows (struct window *w)
{
struct frame *f = XFRAME (w->frame);
struct glyph_row *window_row, *window_row_end, *frame_row;
@@ -15577,11 +15300,8 @@ sync_frame_with_window_matrix_rows (w)
containing CHARPOS or null. */
struct glyph_row *
-row_containing_pos (w, charpos, start, end, dy)
- struct window *w;
- int charpos;
- struct glyph_row *start, *end;
- int dy;
+row_containing_pos (struct window *w, int charpos, struct glyph_row *start,
+ struct glyph_row *end, int dy)
{
struct glyph_row *row = start;
struct glyph_row *best_row = NULL;
@@ -15683,8 +15403,7 @@ row_containing_pos (w, charpos, start, end, dy)
7. Update W's window end information. */
static int
-try_window_id (w)
- struct window *w;
+try_window_id (struct window *w)
{
struct frame *f = XFRAME (w->frame);
struct glyph_matrix *current_matrix = w->current_matrix;
@@ -16420,9 +16139,9 @@ try_window_id (w)
#if GLYPH_DEBUG
-void dump_glyph_row P_ ((struct glyph_row *, int, int));
-void dump_glyph_matrix P_ ((struct glyph_matrix *, int));
-void dump_glyph P_ ((struct glyph_row *, struct glyph *, int));
+void dump_glyph_row (struct glyph_row *, int, int);
+void dump_glyph_matrix (struct glyph_matrix *, int);
+void dump_glyph (struct glyph_row *, struct glyph *, int);
/* Dump the contents of glyph matrix MATRIX on stderr.
@@ -16639,8 +16358,7 @@ DEFUN ("dump-glyph-matrix", Fdump_glyph_matrix,
Shows contents of glyph row structures. With non-nil
parameter GLYPHS, dump glyphs as well. If GLYPHS is 1 show
glyphs in short form, otherwise show glyphs in long form. */)
- (glyphs)
- Lisp_Object glyphs;
+ (Lisp_Object glyphs)
{
struct window *w = XWINDOW (selected_window);
struct buffer *buffer = XBUFFER (w->buffer);
@@ -16658,7 +16376,7 @@ glyphs in short form, otherwise show glyphs in long form. */)
DEFUN ("dump-frame-glyph-matrix", Fdump_frame_glyph_matrix,
Sdump_frame_glyph_matrix, 0, 0, "", doc: /* */)
- ()
+ (void)
{
struct frame *f = XFRAME (selected_frame);
dump_glyph_matrix (f->current_matrix, 1);
@@ -16671,8 +16389,7 @@ DEFUN ("dump-glyph-row", Fdump_glyph_row, Sdump_glyph_row, 1, 2, "",
GLYPH 0 means don't dump glyphs.
GLYPH 1 means dump glyphs in short form.
GLYPH > 1 or omitted means dump glyphs in long form. */)
- (row, glyphs)
- Lisp_Object row, glyphs;
+ (Lisp_Object row, Lisp_Object glyphs)
{
struct glyph_matrix *matrix;
int vpos;
@@ -16693,8 +16410,7 @@ DEFUN ("dump-tool-bar-row", Fdump_tool_bar_row, Sdump_tool_bar_row, 1, 2, "",
GLYPH 0 means don't dump glyphs.
GLYPH 1 means dump glyphs in short form.
GLYPH > 1 or omitted means dump glyphs in long form. */)
- (row, glyphs)
- Lisp_Object row, glyphs;
+ (Lisp_Object row, Lisp_Object glyphs)
{
struct frame *sf = SELECTED_FRAME ();
struct glyph_matrix *m = XWINDOW (sf->tool_bar_window)->current_matrix;
@@ -16712,8 +16428,7 @@ GLYPH > 1 or omitted means dump glyphs in long form. */)
DEFUN ("trace-redisplay", Ftrace_redisplay, Strace_redisplay, 0, 1, "P",
doc: /* Toggle tracing of redisplay.
With ARG, turn tracing on if and only if ARG is positive. */)
- (arg)
- Lisp_Object arg;
+ (Lisp_Object arg)
{
if (NILP (arg))
trace_redisplay_p = !trace_redisplay_p;
@@ -16730,9 +16445,7 @@ With ARG, turn tracing on if and only if ARG is positive. */)
DEFUN ("trace-to-stderr", Ftrace_to_stderr, Strace_to_stderr, 1, MANY, "",
doc: /* Like `format', but print result to stderr.
usage: (trace-to-stderr STRING &rest OBJECTS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
Lisp_Object s = Fformat (nargs, args);
fprintf (stderr, "%s", SDATA (s));
@@ -16751,9 +16464,7 @@ usage: (trace-to-stderr STRING &rest OBJECTS) */)
Used for non-window-redisplay windows, and for windows w/o left fringe. */
static struct glyph_row *
-get_overlay_arrow_glyph_row (w, overlay_arrow_string)
- struct window *w;
- Lisp_Object overlay_arrow_string;
+get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
struct buffer *buffer = XBUFFER (w->buffer);
@@ -16815,8 +16526,7 @@ get_overlay_arrow_glyph_row (w, overlay_arrow_string)
produce_special_glyphs. */
static void
-insert_left_trunc_glyphs (it)
- struct it *it;
+insert_left_trunc_glyphs (struct it *it)
{
struct it truncate_it;
struct glyph *from, *end, *to, *toend;
@@ -16910,8 +16620,7 @@ insert_left_trunc_glyphs (it)
must not be zero. */
static void
-compute_line_metrics (it)
- struct it *it;
+compute_line_metrics (struct it *it)
{
struct glyph_row *row = it->glyph_row;
int area, i;
@@ -17006,9 +16715,7 @@ compute_line_metrics (it)
end of the line if the row ends in italic text. */
static int
-append_space_for_newline (it, default_face_p)
- struct it *it;
- int default_face_p;
+append_space_for_newline (struct it *it, int default_face_p)
{
if (FRAME_WINDOW_P (it->f))
{
@@ -17033,7 +16740,7 @@ append_space_for_newline (it, default_face_p)
saved_pos = it->position;
it->what = IT_CHARACTER;
- bzero (&it->position, sizeof it->position);
+ memset (&it->position, 0, sizeof it->position);
it->object = make_number (0);
it->c = ' ';
it->len = 1;
@@ -17072,8 +16779,7 @@ append_space_for_newline (it, default_face_p)
left of the leftmost glyph. */
static void
-extend_face_to_end_of_line (it)
- struct it *it;
+extend_face_to_end_of_line (struct it *it)
{
struct face *face;
struct frame *f = it->f;
@@ -17154,7 +16860,7 @@ extend_face_to_end_of_line (it)
(((it->ascent + it->descent)
* FONT_BASE (font)) / FONT_HEIGHT (font));
saved_pos = it->position;
- bzero (&it->position, sizeof it->position);
+ memset (&it->position, 0, sizeof it->position);
saved_avoid_cursor = it->avoid_cursor_p;
it->avoid_cursor_p = 1;
saved_face_id = it->face_id;
@@ -17187,7 +16893,7 @@ extend_face_to_end_of_line (it)
saved_pos = it->position;
it->what = IT_CHARACTER;
- bzero (&it->position, sizeof it->position);
+ memset (&it->position, 0, sizeof it->position);
it->object = make_number (0);
it->c = ' ';
it->len = 1;
@@ -17219,8 +16925,7 @@ extend_face_to_end_of_line (it)
trailing whitespace. */
static int
-trailing_whitespace_p (charpos)
- int charpos;
+trailing_whitespace_p (int charpos)
{
int bytepos = CHAR_TO_BYTE (charpos);
int c = 0;
@@ -17242,9 +16947,7 @@ trailing_whitespace_p (charpos)
/* Highlight trailing whitespace, if any, in ROW. */
void
-highlight_trailing_whitespace (f, row)
- struct frame *f;
- struct glyph_row *row;
+highlight_trailing_whitespace (struct frame *f, struct glyph_row *row)
{
int used = row->used[TEXT_AREA];
@@ -17321,9 +17024,7 @@ highlight_trailing_whitespace (f, row)
used to hold the cursor. */
static int
-cursor_row_p (w, row)
- struct window *w;
- struct glyph_row *row;
+cursor_row_p (struct window *w, struct glyph_row *row)
{
int cursor_row_p = 1;
@@ -17438,9 +17139,7 @@ push_display_prop (struct it *it, Lisp_Object prop)
/* Return the character-property PROP at the current position in IT. */
static Lisp_Object
-get_it_property (it, prop)
- struct it *it;
- Lisp_Object prop;
+get_it_property (struct it *it, Lisp_Object prop)
{
Lisp_Object position;
@@ -17489,9 +17188,7 @@ handle_line_prefix (struct it *it)
glyphs were produced by PRODUCE_GLYPHS, and the line needs to be
continued. */
static void
-unproduce_glyphs (it, n)
- struct it *it;
- int n;
+unproduce_glyphs (struct it *it, int n)
{
struct glyph *glyph, *end;
@@ -17511,10 +17208,9 @@ unproduce_glyphs (it, n)
/* Find the positions in a bidi-reordered ROW to serve as ROW->minpos
and ROW->maxpos. */
static void
-find_row_edges (it, row, min_pos, min_bpos, max_pos, max_bpos)
- struct it *it;
- struct glyph_row *row;
- EMACS_INT min_pos, min_bpos, max_pos, max_bpos;
+find_row_edges (struct it *it, struct glyph_row *row,
+ EMACS_INT min_pos, EMACS_INT min_bpos,
+ EMACS_INT max_pos, EMACS_INT max_bpos)
{
/* FIXME: Revisit this when glyph ``spilling'' in continuation
lines' rows is implemented for bidi-reordered rows. */
@@ -17598,8 +17294,7 @@ find_row_edges (it, row, min_pos, min_bpos, max_pos, max_bpos)
only. */
static int
-display_line (it)
- struct it *it;
+display_line (struct it *it)
{
struct glyph_row *row = it->glyph_row;
Lisp_Object overlay_arrow_string;
@@ -18269,8 +17964,7 @@ and the reading direction is generally left to right. In right-to-left
paragraphs, text begins at the right margin and is read from right to left.
See also `bidi-paragraph-direction'. */)
- (buffer)
- Lisp_Object buffer;
+ (Lisp_Object buffer)
{
struct buffer *buf;
struct buffer *old;
@@ -18352,8 +18046,7 @@ See also `bidi-paragraph-direction'. */)
for the menu bar. */
static void
-display_menu_bar (w)
- struct window *w;
+display_menu_bar (struct window *w)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
struct it it;
@@ -18457,9 +18150,7 @@ display_menu_bar (w)
the number of windows whose mode lines were redisplayed. */
static int
-redisplay_mode_lines (window, force)
- Lisp_Object window;
- int force;
+redisplay_mode_lines (Lisp_Object window, int force)
{
int nwindows = 0;
@@ -18521,8 +18212,7 @@ redisplay_mode_lines (window, force)
sum number of mode lines and header lines displayed. */
static int
-display_mode_lines (w)
- struct window *w;
+display_mode_lines (struct window *w)
{
Lisp_Object old_selected_window, old_selected_frame;
int n = 0;
@@ -18566,10 +18256,7 @@ display_mode_lines (w)
displayed. */
static int
-display_mode_line (w, face_id, format)
- struct window *w;
- enum face_id face_id;
- Lisp_Object format;
+display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format)
{
struct it it;
struct face *face;
@@ -18628,8 +18315,7 @@ display_mode_line (w, face_id, format)
Return the updated list. */
static Lisp_Object
-move_elt_to_front (elt, list)
- Lisp_Object elt, list;
+move_elt_to_front (Lisp_Object elt, Lisp_Object list)
{
register Lisp_Object tail, prev;
register Lisp_Object tem;
@@ -18687,12 +18373,8 @@ move_elt_to_front (elt, list)
`store_mode_line_string', or `display_string'. */
static int
-display_mode_element (it, depth, field_width, precision, elt, props, risky)
- struct it *it;
- int depth;
- int field_width, precision;
- Lisp_Object elt, props;
- int risky;
+display_mode_element (struct it *it, int depth, int field_width, int precision,
+ Lisp_Object elt, Lisp_Object props, int risky)
{
int n = 0, field, prec;
int literal = 0;
@@ -19154,13 +18836,8 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky)
*/
static int
-store_mode_line_string (string, lisp_string, copy_string, field_width, precision, props)
- char *string;
- Lisp_Object lisp_string;
- int copy_string;
- int field_width;
- int precision;
- Lisp_Object props;
+store_mode_line_string (char *string, Lisp_Object lisp_string, int copy_string,
+ int field_width, int precision, Lisp_Object props)
{
int len;
int n = 0;
@@ -19251,8 +18928,7 @@ If FACE is an integer, the value string has no text properties.
Optional third and fourth args WINDOW and BUFFER specify the window
and buffer to use as the context for the formatting (defaults
are the selected window and the window's buffer). */)
- (format, face, window, buffer)
- Lisp_Object format, face, window, buffer;
+ (Lisp_Object format, Lisp_Object face, Lisp_Object window, Lisp_Object buffer)
{
struct it it;
int len;
@@ -19347,10 +19023,7 @@ are the selected window and the window's buffer). */)
the positive integer D to BUF using a minimal field width WIDTH. */
static void
-pint2str (buf, width, d)
- register char *buf;
- register int width;
- register int d;
+pint2str (register char *buf, register int width, register int d)
{
register char *p = buf;
@@ -19394,10 +19067,7 @@ static const char power_letter[] =
};
static void
-pint2hrstr (buf, width, d)
- char *buf;
- int width;
- int d;
+pint2hrstr (char *buf, int width, int d)
{
/* We aim to represent the nonnegative integer D as
QUOTIENT.TENTHS * 10 ^ (3 * EXPONENT). */
@@ -19498,10 +19168,7 @@ pint2hrstr (buf, width, d)
static unsigned char invalid_eol_type[] = "(*invalid*)";
static char *
-decode_mode_spec_coding (coding_system, buf, eol_flag)
- Lisp_Object coding_system;
- register char *buf;
- int eol_flag;
+decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_flag)
{
Lisp_Object val;
int multibyte = !NILP (current_buffer->enable_multibyte_characters);
@@ -19567,7 +19234,7 @@ decode_mode_spec_coding (coding_system, buf, eol_flag)
eol_str = invalid_eol_type;
eol_str_len = sizeof (invalid_eol_type) - 1;
}
- bcopy (eol_str, buf, eol_str_len);
+ memcpy (buf, eol_str, eol_str_len);
buf += eol_str_len;
}
@@ -19586,11 +19253,8 @@ decode_mode_spec_coding (coding_system, buf, eol_flag)
static char lots_of_dashes[] = "--------------------------------------------------------------------------------------------------------------------------------------------";
static char *
-decode_mode_spec (w, c, field_width, precision, string)
- struct window *w;
- register int c;
- int field_width, precision;
- Lisp_Object *string;
+decode_mode_spec (struct window *w, register int c, int field_width,
+ int precision, Lisp_Object *string)
{
Lisp_Object obj;
struct frame *f = XFRAME (WINDOW_FRAME (w));
@@ -19926,7 +19590,7 @@ decode_mode_spec (w, c, field_width, precision, string)
obj = Fget_buffer_process (Fcurrent_buffer ());
if (NILP (obj))
return "no process";
-#ifdef subprocesses
+#ifndef MSDOS
obj = Fsymbol_name (Fprocess_status (obj));
#endif
break;
@@ -20007,9 +19671,8 @@ decode_mode_spec (w, c, field_width, precision, string)
Set *BYTE_POS_PTR to 1 if we found COUNT lines, 0 if we hit LIMIT. */
static int
-display_count_lines (start, start_byte, limit_byte, count, byte_pos_ptr)
- int start, start_byte, limit_byte, count;
- int *byte_pos_ptr;
+display_count_lines (int start, int start_byte, int limit_byte, int count,
+ int *byte_pos_ptr)
{
register unsigned char *cursor;
unsigned char *base;
@@ -20149,16 +19812,9 @@ display_count_lines (start, start_byte, limit_byte, count, byte_pos_ptr)
Value is the number of columns displayed. */
static int
-display_string (string, lisp_string, face_string, face_string_pos,
- start, it, field_width, precision, max_x, multibyte)
- unsigned char *string;
- Lisp_Object lisp_string;
- Lisp_Object face_string;
- EMACS_INT face_string_pos;
- EMACS_INT start;
- struct it *it;
- int field_width, precision, max_x;
- int multibyte;
+display_string (unsigned char *string, Lisp_Object lisp_string, Lisp_Object face_string,
+ EMACS_INT face_string_pos, EMACS_INT start, struct it *it,
+ int field_width, int precision, int max_x, int multibyte)
{
int hpos_at_start = it->hpos;
int saved_face_id = it->face_id;
@@ -20168,7 +19824,7 @@ display_string (string, lisp_string, face_string, face_string_pos,
with index START. */
reseat_to_string (it, NILP (lisp_string) ? string : NULL, lisp_string, start,
precision, field_width, multibyte);
- if (string && STRINGP (lisp_string))
+ if (string && STRINGP (lisp_string))
/* LISP_STRING is the one returned by decode_mode_spec. We should
ignore its text properties. */
it->stop_charpos = -1;
@@ -20342,9 +19998,7 @@ display_string (string, lisp_string, face_string, face_string_pos,
and 1 if it's invisible and without an ellipsis. */
int
-invisible_p (propval, list)
- register Lisp_Object propval;
- Lisp_Object list;
+invisible_p (register Lisp_Object propval, Lisp_Object list)
{
register Lisp_Object tail, proptail;
@@ -20387,8 +20041,7 @@ is checked; or it can be some other value, which is then presumed to be the
value of the `invisible' property of the text of interest.
The non-nil value returned can be t for truly invisible text or something
else if the text is replaced by an ellipsis. */)
- (pos_or_prop)
- Lisp_Object pos_or_prop;
+ (Lisp_Object pos_or_prop)
{
Lisp_Object prop
= (NATNUMP (pos_or_prop) || MARKERP (pos_or_prop)
@@ -20473,12 +20126,8 @@ else if the text is replaced by an ellipsis. */)
: - 1)
int
-calc_pixel_width_or_height (res, it, prop, font, width_p, align_to)
- double *res;
- struct it *it;
- Lisp_Object prop;
- struct font *font;
- int width_p, *align_to;
+calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
+ struct font *font, int width_p, int *align_to)
{
double pixels;
@@ -20696,7 +20345,7 @@ dump_glyph_string (s)
face-override for drawing S. */
#ifdef HAVE_NTGUI
-#define OPTIONAL_HDC(hdc) hdc,
+#define OPTIONAL_HDC(hdc) HDC hdc,
#define DECLARE_HDC(hdc) HDC hdc;
#define ALLOCATE_HDC(hdc, f) hdc = get_frame_dc ((f))
#define RELEASE_HDC(hdc, f) release_frame_dc ((f), (hdc))
@@ -20710,17 +20359,12 @@ dump_glyph_string (s)
#endif
static void
-init_glyph_string (s, OPTIONAL_HDC (hdc) char2b, w, row, area, start, hl)
- struct glyph_string *s;
- DECLARE_HDC (hdc)
- XChar2b *char2b;
- struct window *w;
- struct glyph_row *row;
- enum glyph_row_area area;
- int start;
- enum draw_glyphs_face hl;
+init_glyph_string (struct glyph_string *s,
+ OPTIONAL_HDC (hdc)
+ XChar2b *char2b, struct window *w, struct glyph_row *row,
+ enum glyph_row_area area, int start, enum draw_glyphs_face hl)
{
- bzero (s, sizeof *s);
+ memset (s, 0, sizeof *s);
s->w = w;
s->f = XFRAME (w->frame);
#ifdef HAVE_NTGUI
@@ -20743,9 +20387,8 @@ init_glyph_string (s, OPTIONAL_HDC (hdc) char2b, w, row, area, start, hl)
with head *HEAD and tail *TAIL. Set *HEAD and *TAIL to the result. */
static INLINE void
-append_glyph_string_lists (head, tail, h, t)
- struct glyph_string **head, **tail;
- struct glyph_string *h, *t;
+append_glyph_string_lists (struct glyph_string **head, struct glyph_string **tail,
+ struct glyph_string *h, struct glyph_string *t)
{
if (h)
{
@@ -20764,9 +20407,8 @@ append_glyph_string_lists (head, tail, h, t)
result. */
static INLINE void
-prepend_glyph_string_lists (head, tail, h, t)
- struct glyph_string **head, **tail;
- struct glyph_string *h, *t;
+prepend_glyph_string_lists (struct glyph_string **head, struct glyph_string **tail,
+ struct glyph_string *h, struct glyph_string *t)
{
if (h)
{
@@ -20784,9 +20426,8 @@ prepend_glyph_string_lists (head, tail, h, t)
Set *HEAD and *TAIL to the resulting list. */
static INLINE void
-append_glyph_string (head, tail, s)
- struct glyph_string **head, **tail;
- struct glyph_string *s;
+append_glyph_string (struct glyph_string **head, struct glyph_string **tail,
+ struct glyph_string *s)
{
s->next = s->prev = NULL;
append_glyph_string_lists (head, tail, s, s);
@@ -20801,11 +20442,8 @@ append_glyph_string (head, tail, s)
DISPLAY_P is non-zero. */
static INLINE struct face *
-get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p)
- struct frame *f;
- int c, face_id;
- XChar2b *char2b;
- int multibyte_p, display_p;
+get_char_face_and_encoding (struct frame *f, int c, int face_id,
+ XChar2b *char2b, int multibyte_p, int display_p)
{
struct face *face = FACE_FROM_ID (f, face_id);
@@ -20837,11 +20475,8 @@ get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p)
a pointer to a realized face that is ready for display. */
static INLINE struct face *
-get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
- struct frame *f;
- struct glyph *glyph;
- XChar2b *char2b;
- int *two_byte_p;
+get_glyph_face_and_encoding (struct frame *f, struct glyph *glyph,
+ XChar2b *char2b, int *two_byte_p)
{
struct face *face;
@@ -20879,10 +20514,8 @@ get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
Value is the index of a component not in S. */
static int
-fill_composite_glyph_string (s, base_face, overlaps)
- struct glyph_string *s;
- struct face *base_face;
- int overlaps;
+fill_composite_glyph_string (struct glyph_string *s, struct face *base_face,
+ int overlaps)
{
int i;
/* For all glyphs of this composition, starting at the offset
@@ -20945,10 +20578,8 @@ fill_composite_glyph_string (s, base_face, overlaps)
}
static int
-fill_gstring_glyph_string (s, face_id, start, end, overlaps)
- struct glyph_string *s;
- int face_id;
- int start, end, overlaps;
+fill_gstring_glyph_string (struct glyph_string *s, int face_id,
+ int start, int end, int overlaps)
{
struct glyph *glyph, *last;
Lisp_Object lgstring;
@@ -20992,10 +20623,8 @@ fill_gstring_glyph_string (s, face_id, start, end, overlaps)
Value is the index of the first glyph not in S. */
static int
-fill_glyph_string (s, face_id, start, end, overlaps)
- struct glyph_string *s;
- int face_id;
- int start, end, overlaps;
+fill_glyph_string (struct glyph_string *s, int face_id,
+ int start, int end, int overlaps)
{
struct glyph *glyph, *last;
int voffset;
@@ -21055,8 +20684,7 @@ fill_glyph_string (s, face_id, start, end, overlaps)
/* Fill glyph string S from image glyph S->first_glyph. */
static void
-fill_image_glyph_string (s)
- struct glyph_string *s;
+fill_image_glyph_string (struct glyph_string *s)
{
xassert (s->first_glyph->type == IMAGE_GLYPH);
s->img = IMAGE_FROM_ID (s->f, s->first_glyph->u.img_id);
@@ -21080,11 +20708,8 @@ fill_image_glyph_string (s)
Value is the index of the first glyph not in S. */
static int
-fill_stretch_glyph_string (s, row, area, start, end)
- struct glyph_string *s;
- struct glyph_row *row;
- enum glyph_row_area area;
- int start, end;
+fill_stretch_glyph_string (struct glyph_string *s, struct glyph_row *row,
+ enum glyph_row_area area, int start, int end)
{
struct glyph *glyph, *last;
int voffset, face_id;
@@ -21118,10 +20743,7 @@ fill_stretch_glyph_string (s, row, area, start, end)
}
static struct font_metrics *
-get_per_char_metric (f, font, char2b)
- struct frame *f;
- struct font *font;
- XChar2b *char2b;
+get_per_char_metric (struct frame *f, struct font *font, XChar2b *char2b)
{
static struct font_metrics metrics;
unsigned code = (XCHAR2B_BYTE1 (char2b) << 8) | XCHAR2B_BYTE2 (char2b);
@@ -21138,10 +20760,7 @@ get_per_char_metric (f, font, char2b)
assumed to be zero. */
void
-x_get_glyph_overhangs (glyph, f, left, right)
- struct glyph *glyph;
- struct frame *f;
- int *left, *right;
+x_get_glyph_overhangs (struct glyph *glyph, struct frame *f, int *left, int *right)
{
*left = *right = 0;
@@ -21192,8 +20811,7 @@ x_get_glyph_overhangs (glyph, f, left, right)
if no glyphs are overwritten. */
static int
-left_overwritten (s)
- struct glyph_string *s;
+left_overwritten (struct glyph_string *s)
{
int k;
@@ -21220,8 +20838,7 @@ left_overwritten (s)
glyph in front of S overwrites S. */
static int
-left_overwriting (s)
- struct glyph_string *s;
+left_overwriting (struct glyph_string *s)
{
int i, k, x;
struct glyph *glyphs = s->row->glyphs[s->area];
@@ -21247,8 +20864,7 @@ left_overwriting (s)
no such glyph is found. */
static int
-right_overwritten (s)
- struct glyph_string *s;
+right_overwritten (struct glyph_string *s)
{
int k = -1;
@@ -21274,8 +20890,7 @@ right_overwritten (s)
if no such glyph is found. */
static int
-right_overwriting (s)
- struct glyph_string *s;
+right_overwriting (struct glyph_string *s)
{
int i, k, x;
int end = s->row->used[s->area];
@@ -21302,10 +20917,7 @@ right_overwriting (s)
in the drawing area. */
static INLINE void
-set_glyph_string_background_width (s, start, last_x)
- struct glyph_string *s;
- int start;
- int last_x;
+set_glyph_string_background_width (struct glyph_string *s, int start, int last_x)
{
/* If the face of this glyph string has to be drawn to the end of
the drawing area, set S->extends_to_end_of_line_p. */
@@ -21334,10 +20946,7 @@ set_glyph_string_background_width (s, start, last_x)
BACKWARD_P non-zero means process predecessors. */
static void
-compute_overhangs_and_x (s, x, backward_p)
- struct glyph_string *s;
- int x;
- int backward_p;
+compute_overhangs_and_x (struct glyph_string *s, int x, int backward_p)
{
if (backward_p)
{
@@ -21593,14 +21202,9 @@ compute_overhangs_and_x (s, x, backward_p)
Value is the x-position reached, relative to AREA of W. */
static int
-draw_glyphs (w, x, row, area, start, end, hl, overlaps)
- struct window *w;
- int x;
- struct glyph_row *row;
- enum glyph_row_area area;
- EMACS_INT start, end;
- enum draw_glyphs_face hl;
- int overlaps;
+draw_glyphs (struct window *w, int x, struct glyph_row *row,
+ enum glyph_row_area area, EMACS_INT start, EMACS_INT end,
+ enum draw_glyphs_face hl, int overlaps)
{
struct glyph_string *head, *tail;
struct glyph_string *s;
@@ -21848,8 +21452,7 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps)
Called from x_produce_glyphs when IT->glyph_row is non-null. */
static INLINE void
-append_glyph (it)
- struct it *it;
+append_glyph (struct it *it)
{
struct glyph *glyph;
enum glyph_row_area area = it->area;
@@ -21923,8 +21526,7 @@ append_glyph (it)
non-null. */
static INLINE void
-append_composite_glyph (it)
- struct it *it;
+append_composite_glyph (struct it *it)
{
struct glyph *glyph;
enum glyph_row_area area = it->area;
@@ -21993,8 +21595,7 @@ append_composite_glyph (it)
IT->voffset. */
static INLINE void
-take_vertical_position_into_account (it)
- struct it *it;
+take_vertical_position_into_account (struct it *it)
{
if (it->voffset)
{
@@ -22015,8 +21616,7 @@ take_vertical_position_into_account (it)
an overview of struct display_iterator. */
static void
-produce_image_glyph (it)
- struct it *it;
+produce_image_glyph (struct it *it)
{
struct image *img;
struct face *face;
@@ -22176,11 +21776,8 @@ produce_image_glyph (it)
stretch. ASCENT is the ascent of the glyph (0 <= ASCENT <= HEIGHT). */
static void
-append_stretch_glyph (it, object, width, height, ascent)
- struct it *it;
- Lisp_Object object;
- int width, height;
- int ascent;
+append_stretch_glyph (struct it *it, Lisp_Object object,
+ int width, int height, int ascent)
{
struct glyph *glyph;
enum glyph_row_area area = it->area;
@@ -22271,8 +21868,7 @@ append_stretch_glyph (it, object, width, height, ascent)
ASCENT must be in the range 0 <= ASCENT <= 100. */
static void
-produce_stretch_glyph (it)
- struct it *it;
+produce_stretch_glyph (struct it *it)
{
/* (space :width WIDTH :height HEIGHT ...) */
Lisp_Object prop, plist;
@@ -22398,11 +21994,8 @@ produce_stretch_glyph (it)
static Lisp_Object
-calc_line_height_property (it, val, font, boff, override)
- struct it *it;
- Lisp_Object val;
- struct font *font;
- int boff, override;
+calc_line_height_property (struct it *it, Lisp_Object val, struct font *font,
+ int boff, int override)
{
Lisp_Object face_name = Qnil;
int ascent, descent, height;
@@ -22478,8 +22071,7 @@ calc_line_height_property (it, val, font, boff, override)
for an overview of struct it. */
void
-x_produce_glyphs (it)
- struct it *it;
+x_produce_glyphs (struct it *it)
{
int extra_line_spacing = it->extra_line_spacing;
@@ -22684,7 +22276,7 @@ x_produce_glyphs (it)
it->pixel_width = 0;
it->nglyphs = 0;
- height = get_it_property(it, Qline_height);
+ height = get_it_property (it, Qline_height);
/* Split (line-height total-height) list */
if (CONSP (height)
&& CONSP (XCDR (height))
@@ -22693,7 +22285,7 @@ x_produce_glyphs (it)
total_height = XCAR (XCDR (height));
height = XCAR (height);
}
- height = calc_line_height_property(it, height, font, boff, 1);
+ height = calc_line_height_property (it, height, font, boff, 1);
if (it->override_ascent >= 0)
{
@@ -22743,11 +22335,11 @@ x_produce_glyphs (it)
it->ascent = XINT (height) - it->descent;
if (!NILP (total_height))
- spacing = calc_line_height_property(it, total_height, font, boff, 0);
+ spacing = calc_line_height_property (it, total_height, font, boff, 0);
else
{
- spacing = get_it_property(it, Qline_spacing);
- spacing = calc_line_height_property(it, spacing, font, boff, 0);
+ spacing = get_it_property (it, Qline_spacing);
+ spacing = calc_line_height_property (it, spacing, font, boff, 0);
}
if (INTEGERP (spacing))
{
@@ -23265,9 +22857,7 @@ x_produce_glyphs (it)
row being updated. */
void
-x_write_glyphs (start, len)
- struct glyph *start;
- int len;
+x_write_glyphs (struct glyph *start, int len)
{
int x, hpos;
@@ -23302,9 +22892,7 @@ x_write_glyphs (start, len)
Insert LEN glyphs from START at the nominal cursor position. */
void
-x_insert_glyphs (start, len)
- struct glyph *start;
- int len;
+x_insert_glyphs (struct glyph *start, int len)
{
struct frame *f;
struct window *w;
@@ -23362,8 +22950,7 @@ x_insert_glyphs (start, len)
updated_window. TO_X == -1 means clear to the end of this area. */
void
-x_clear_end_of_line (to_x)
- int to_x;
+x_clear_end_of_line (int to_x)
{
struct frame *f;
struct window *w = updated_window;
@@ -23439,9 +23026,7 @@ x_clear_end_of_line (to_x)
of the bar cursor. */
static enum text_cursor_kinds
-get_specified_cursor_type (arg, width)
- Lisp_Object arg;
- int *width;
+get_specified_cursor_type (Lisp_Object arg, int *width)
{
enum text_cursor_kinds type;
@@ -23494,9 +23079,7 @@ get_specified_cursor_type (arg, width)
/* Set the default cursor types for specified frame. */
void
-set_frame_cursor_types (f, arg)
- struct frame *f;
- Lisp_Object arg;
+set_frame_cursor_types (struct frame *f, Lisp_Object arg)
{
int width;
Lisp_Object tem;
@@ -23530,11 +23113,8 @@ set_frame_cursor_types (f, arg)
In all other cases, we want a hollow box cursor. */
static enum text_cursor_kinds
-get_window_cursor_type (w, glyph, width, active_cursor)
- struct window *w;
- struct glyph *glyph;
- int *width;
- int *active_cursor;
+get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
+ int *active_cursor)
{
struct frame *f = XFRAME (w->frame);
struct buffer *b = XBUFFER (w->buffer);
@@ -23690,10 +23270,8 @@ get_window_cursor_type (w, glyph, width, active_cursor)
are window-relative. */
static void
-notice_overwritten_cursor (w, area, x0, x1, y0, y1)
- struct window *w;
- enum glyph_row_area area;
- int x0, y0, x1, y1;
+notice_overwritten_cursor (struct window *w, enum glyph_row_area area,
+ int x0, int x1, int y0, int y1)
{
int cx0, cx1, cy0, cy1;
struct glyph_row *row;
@@ -23760,11 +23338,8 @@ notice_overwritten_cursor (w, area, x0, x1, y0, y1)
with respect to the overlapping part OVERLAPS. */
void
-x_fix_overlapping_area (w, row, area, overlaps)
- struct window *w;
- struct glyph_row *row;
- enum glyph_row_area area;
- int overlaps;
+x_fix_overlapping_area (struct window *w, struct glyph_row *row,
+ enum glyph_row_area area, int overlaps)
{
int i, x;
@@ -23805,10 +23380,8 @@ x_fix_overlapping_area (w, row, area, overlaps)
comment of draw_glyphs for the meaning of HL. */
void
-draw_phys_cursor_glyph (w, row, hl)
- struct window *w;
- struct glyph_row *row;
- enum draw_glyphs_face hl;
+draw_phys_cursor_glyph (struct window *w, struct glyph_row *row,
+ enum draw_glyphs_face hl)
{
/* If cursor hpos is out of bounds, don't draw garbage. This can
happen in mini-buffer windows when switching between echo area
@@ -23851,8 +23424,7 @@ draw_phys_cursor_glyph (w, row, hl)
Erase the image of a cursor of window W from the screen. */
void
-erase_phys_cursor (w)
- struct window *w;
+erase_phys_cursor (struct window *w)
{
struct frame *f = XFRAME (w->frame);
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -23968,9 +23540,8 @@ erase_phys_cursor (w)
where to put the cursor is specified by HPOS, VPOS, X and Y. */
void
-display_and_set_cursor (w, on, hpos, vpos, x, y)
- struct window *w;
- int on, hpos, vpos, x, y;
+display_and_set_cursor (struct window *w, int on,
+ int hpos, int vpos, int x, int y)
{
struct frame *f = XFRAME (w->frame);
int new_cursor_type;
@@ -24053,9 +23624,7 @@ display_and_set_cursor (w, on, hpos, vpos, x, y)
of ON. */
void
-update_window_cursor (w, on)
- struct window *w;
- int on;
+update_window_cursor (struct window *w, int on)
{
/* Don't update cursor in windows whose frame is in the process
of being deleted. */
@@ -24073,9 +23642,7 @@ update_window_cursor (w, on)
in the window tree rooted at W. */
static void
-update_cursor_in_window_tree (w, on_p)
- struct window *w;
- int on_p;
+update_cursor_in_window_tree (struct window *w, int on_p)
{
while (w)
{
@@ -24096,9 +23663,7 @@ update_cursor_in_window_tree (w, on_p)
Don't change the cursor's position. */
void
-x_update_cursor (f, on_p)
- struct frame *f;
- int on_p;
+x_update_cursor (struct frame *f, int on_p)
{
update_cursor_in_window_tree (XWINDOW (f->root_window), on_p);
}
@@ -24110,8 +23675,7 @@ x_update_cursor (f, on_p)
is about to be rewritten. */
void
-x_clear_cursor (w)
- struct window *w;
+x_clear_cursor (struct window *w)
{
if (FRAME_VISIBLE_P (XFRAME (w->frame)) && w->phys_cursor_on_p)
update_window_cursor (w, 0);
@@ -24122,9 +23686,7 @@ x_clear_cursor (w)
Display the active region described by mouse_face_* according to DRAW. */
void
-show_mouse_face (dpyinfo, draw)
- Display_Info *dpyinfo;
- enum draw_glyphs_face draw;
+show_mouse_face (Display_Info *dpyinfo, enum draw_glyphs_face draw)
{
struct window *w = XWINDOW (dpyinfo->mouse_face_window);
struct frame *f = XFRAME (WINDOW_FRAME (w));
@@ -24207,8 +23769,7 @@ show_mouse_face (dpyinfo, draw)
face was actually drawn unhighlighted. */
int
-clear_mouse_face (dpyinfo)
- Display_Info *dpyinfo;
+clear_mouse_face (Display_Info *dpyinfo)
{
int cleared = 0;
@@ -24230,8 +23791,7 @@ clear_mouse_face (dpyinfo)
Non-zero if physical cursor of window W is within mouse face. */
int
-cursor_in_mouse_face_p (w)
- struct window *w;
+cursor_in_mouse_face_p (struct window *w)
{
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame));
int in_mouse_face = 0;
@@ -24456,12 +24016,8 @@ mouse_face_from_buffer_pos (Lisp_Object window,
Value is non-zero if a glyph was found. */
static int
-fast_find_string_pos (w, pos, object, hpos, vpos, x, y, right_p)
- struct window *w;
- EMACS_INT pos;
- Lisp_Object object;
- int *hpos, *vpos, *x, *y;
- int right_p;
+fast_find_string_pos (struct window *w, EMACS_INT pos, Lisp_Object object,
+ int *hpos, int *vpos, int *x, int *y, int right_p)
{
int yb = window_text_bottom_y (w);
struct glyph_row *r;
@@ -24525,9 +24081,7 @@ fast_find_string_pos (w, pos, object, hpos, vpos, x, y, right_p)
/* See if position X, Y is within a hot-spot of an image. */
static int
-on_hot_spot_p (hot_spot, x, y)
- Lisp_Object hot_spot;
- int x, y;
+on_hot_spot_p (Lisp_Object hot_spot, int x, int y)
{
if (!CONSP (hot_spot))
return 0;
@@ -24623,9 +24177,7 @@ on_hot_spot_p (hot_spot, x, y)
}
Lisp_Object
-find_hot_spot (map, x, y)
- Lisp_Object map;
- int x, y;
+find_hot_spot (Lisp_Object map, int x, int y)
{
while (CONSP (map))
{
@@ -24650,9 +24202,7 @@ and the radius of the circle; r may be a float or integer.
A polygon is a cons (poly . [x0 y0 x1 y1 ...]) where each pair in the
vector describes one corner in the polygon.
Returns the alist element for the first matching AREA in MAP. */)
- (map, x, y)
- Lisp_Object map;
- Lisp_Object x, y;
+ (Lisp_Object map, Lisp_Object x, Lisp_Object y)
{
if (NILP (map))
return Qnil;
@@ -24666,10 +24216,7 @@ Returns the alist element for the first matching AREA in MAP. */)
/* Display frame CURSOR, optionally using shape defined by POINTER. */
static void
-define_frame_cursor1 (f, cursor, pointer)
- struct frame *f;
- Cursor cursor;
- Lisp_Object pointer;
+define_frame_cursor1 (struct frame *f, Cursor cursor, Lisp_Object pointer)
{
/* Do not change cursor shape while dragging mouse. */
if (!NILP (do_mouse_tracking))
@@ -24708,10 +24255,8 @@ define_frame_cursor1 (f, cursor, pointer)
position relative to the start of the mode line. */
static void
-note_mode_line_or_margin_highlight (window, x, y, area)
- Lisp_Object window;
- int x, y;
- enum window_part area;
+note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
+ enum window_part area)
{
struct window *w = XWINDOW (window);
struct frame *f = XFRAME (w->frame);
@@ -24951,9 +24496,7 @@ note_mode_line_or_margin_highlight (window, x, y, area)
X and Y can be negative or out of range. */
void
-note_mouse_highlight (f, x, y)
- struct frame *f;
- int x, y;
+note_mouse_highlight (struct frame *f, int x, int y)
{
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
enum window_part part;
@@ -25419,8 +24962,7 @@ note_mouse_highlight (f, x, y)
functions to ensure the mouse-highlight is off. */
void
-x_clear_window_mouse_face (w)
- struct window *w;
+x_clear_window_mouse_face (struct window *w)
{
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame));
Lisp_Object window;
@@ -25438,8 +24980,7 @@ x_clear_window_mouse_face (w)
This is used when the size of F is changed. */
void
-cancel_mouse_face (f)
- struct frame *f;
+cancel_mouse_face (struct frame *f)
{
Lisp_Object window;
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -25467,11 +25008,8 @@ cancel_mouse_face (f)
which intersects rectangle R. R is in window-relative coordinates. */
static void
-expose_area (w, row, r, area)
- struct window *w;
- struct glyph_row *row;
- XRectangle *r;
- enum glyph_row_area area;
+expose_area (struct window *w, struct glyph_row *row, XRectangle *r,
+ enum glyph_row_area area)
{
struct glyph *first = row->glyphs[area];
struct glyph *end = row->glyphs[area] + row->used[area];
@@ -25525,10 +25063,7 @@ expose_area (w, row, r, area)
non-zero if mouse-face was overwritten. */
static int
-expose_line (w, row, r)
- struct window *w;
- struct glyph_row *row;
- XRectangle *r;
+expose_line (struct window *w, struct glyph_row *row, XRectangle *r)
{
xassert (row->enabled_p);
@@ -25560,11 +25095,10 @@ expose_line (w, row, r)
LAST_OVERLAPPING_ROW is the last such row. */
static void
-expose_overlaps (w, first_overlapping_row, last_overlapping_row, r)
- struct window *w;
- struct glyph_row *first_overlapping_row;
- struct glyph_row *last_overlapping_row;
- XRectangle *r;
+expose_overlaps (struct window *w,
+ struct glyph_row *first_overlapping_row,
+ struct glyph_row *last_overlapping_row,
+ XRectangle *r)
{
struct glyph_row *row;
@@ -25590,9 +25124,7 @@ expose_overlaps (w, first_overlapping_row, last_overlapping_row, r)
/* Return non-zero if W's cursor intersects rectangle R. */
static int
-phys_cursor_in_rect_p (w, r)
- struct window *w;
- XRectangle *r;
+phys_cursor_in_rect_p (struct window *w, XRectangle *r)
{
XRectangle cr, result;
struct glyph *cursor_glyph;
@@ -25638,8 +25170,7 @@ phys_cursor_in_rect_p (w, r)
have vertical scroll bars. */
void
-x_draw_vertical_border (w)
- struct window *w;
+x_draw_vertical_border (struct window *w)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
@@ -25689,9 +25220,7 @@ x_draw_vertical_border (w)
mouse-face. */
static int
-expose_window (w, fr)
- struct window *w;
- XRectangle *fr;
+expose_window (struct window *w, XRectangle *fr)
{
struct frame *f = XFRAME (w->frame);
XRectangle wr, r;
@@ -25824,9 +25353,7 @@ expose_window (w, fr)
non-zero if the exposure overwrites mouse-face. */
static int
-expose_window_tree (w, r)
- struct window *w;
- XRectangle *r;
+expose_window_tree (struct window *w, XRectangle *r)
{
struct frame *f = XFRAME (w->frame);
int mouse_face_overwritten_p = 0;
@@ -25856,9 +25383,7 @@ expose_window_tree (w, r)
the entire frame. */
void
-expose_frame (f, x, y, w, h)
- struct frame *f;
- int x, y, w, h;
+expose_frame (struct frame *f, int x, int y, int w, int h)
{
XRectangle r;
int mouse_face_overwritten_p = 0;
@@ -25946,8 +25471,7 @@ expose_frame (f, x, y, w, h)
empty. */
int
-x_intersect_rectangles (r1, r2, result)
- XRectangle *r1, *r2, *result;
+x_intersect_rectangles (XRectangle *r1, XRectangle *r2, XRectangle *result)
{
XRectangle *left, *right;
XRectangle *upper, *lower;
@@ -26002,7 +25526,7 @@ x_intersect_rectangles (r1, r2, result)
***********************************************************************/
void
-syms_of_xdisp ()
+syms_of_xdisp (void)
{
Vwith_echo_area_save_vector = Qnil;
staticpro (&Vwith_echo_area_save_vector);
@@ -26649,7 +26173,7 @@ Value must be an integer or float. */);
/* Initialize this module when Emacs starts. */
void
-init_xdisp ()
+init_xdisp (void)
{
Lisp_Object root_window;
struct window *mini_w;
@@ -26706,14 +26230,14 @@ init_xdisp ()
/* Return non-zero if houglass timer has been started or hourglass is shown. */
int
-hourglass_started ()
+hourglass_started (void)
{
return hourglass_shown_p || hourglass_atimer != NULL;
}
/* Cancel a currently active hourglass timer, and start a new one. */
void
-start_hourglass ()
+start_hourglass (void)
{
#if defined (HAVE_WINDOW_SYSTEM)
EMACS_TIME delay;
@@ -26745,7 +26269,7 @@ start_hourglass ()
/* Cancel the hourglass cursor timer if active, hide a busy cursor if
shown. */
void
-cancel_hourglass ()
+cancel_hourglass (void)
{
#if defined (HAVE_WINDOW_SYSTEM)
if (hourglass_atimer)
diff --git a/src/xfaces.c b/src/xfaces.c
index 6bde1c121d2..c0c53f3aa1f 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -510,56 +510,55 @@ int menu_face_changed_default;
struct table_entry;
struct named_merge_point;
-static void map_tty_color P_ ((struct frame *, struct face *,
- enum lface_attribute_index, int *));
-static Lisp_Object resolve_face_name P_ ((Lisp_Object, int));
-static int may_use_scalable_font_p P_ ((const char *));
-static void set_font_frame_param P_ ((Lisp_Object, Lisp_Object));
-static int get_lface_attributes P_ ((struct frame *, Lisp_Object, Lisp_Object *,
- int, struct named_merge_point *));
-static int load_pixmap P_ ((struct frame *, Lisp_Object, unsigned *, unsigned *));
-static struct frame *frame_or_selected_frame P_ ((Lisp_Object, int));
-static void load_face_colors P_ ((struct frame *, struct face *, Lisp_Object *));
-static void free_face_colors P_ ((struct frame *, struct face *));
-static int face_color_gray_p P_ ((struct frame *, char *));
-static struct face *realize_face P_ ((struct face_cache *, Lisp_Object *,
- int));
-static struct face *realize_non_ascii_face P_ ((struct frame *, Lisp_Object,
- struct face *));
-static struct face *realize_x_face P_ ((struct face_cache *, Lisp_Object *));
-static struct face *realize_tty_face P_ ((struct face_cache *, Lisp_Object *));
-static int realize_basic_faces P_ ((struct frame *));
-static int realize_default_face P_ ((struct frame *));
-static void realize_named_face P_ ((struct frame *, Lisp_Object, int));
-static int lface_fully_specified_p P_ ((Lisp_Object *));
-static int lface_equal_p P_ ((Lisp_Object *, Lisp_Object *));
-static unsigned hash_string_case_insensitive P_ ((Lisp_Object));
-static unsigned lface_hash P_ ((Lisp_Object *));
-static int lface_same_font_attributes_p P_ ((Lisp_Object *, Lisp_Object *));
-static struct face_cache *make_face_cache P_ ((struct frame *));
-static void clear_face_gcs P_ ((struct face_cache *));
-static void free_face_cache P_ ((struct face_cache *));
-static int face_fontset P_ ((Lisp_Object *));
-static void merge_face_vectors P_ ((struct frame *, Lisp_Object *, Lisp_Object*,
- struct named_merge_point *));
-static int merge_face_ref P_ ((struct frame *, Lisp_Object, Lisp_Object *,
- int, struct named_merge_point *));
-static int set_lface_from_font P_ ((struct frame *, Lisp_Object, Lisp_Object,
- int));
-static Lisp_Object lface_from_face_name P_ ((struct frame *, Lisp_Object, int));
-static struct face *make_realized_face P_ ((Lisp_Object *));
-static void cache_face P_ ((struct face_cache *, struct face *, unsigned));
-static void uncache_face P_ ((struct face_cache *, struct face *));
+static void map_tty_color (struct frame *, struct face *,
+ enum lface_attribute_index, int *);
+static Lisp_Object resolve_face_name (Lisp_Object, int);
+static void set_font_frame_param (Lisp_Object, Lisp_Object);
+static int get_lface_attributes (struct frame *, Lisp_Object, Lisp_Object *,
+ int, struct named_merge_point *);
+static int load_pixmap (struct frame *, Lisp_Object, unsigned *, unsigned *);
+static struct frame *frame_or_selected_frame (Lisp_Object, int);
+static void load_face_colors (struct frame *, struct face *, Lisp_Object *);
+static void free_face_colors (struct frame *, struct face *);
+static int face_color_gray_p (struct frame *, char *);
+static struct face *realize_face (struct face_cache *, Lisp_Object *,
+ int);
+static struct face *realize_non_ascii_face (struct frame *, Lisp_Object,
+ struct face *);
+static struct face *realize_x_face (struct face_cache *, Lisp_Object *);
+static struct face *realize_tty_face (struct face_cache *, Lisp_Object *);
+static int realize_basic_faces (struct frame *);
+static int realize_default_face (struct frame *);
+static void realize_named_face (struct frame *, Lisp_Object, int);
+static int lface_fully_specified_p (Lisp_Object *);
+static int lface_equal_p (Lisp_Object *, Lisp_Object *);
+static unsigned hash_string_case_insensitive (Lisp_Object);
+static unsigned lface_hash (Lisp_Object *);
+static int lface_same_font_attributes_p (Lisp_Object *, Lisp_Object *);
+static struct face_cache *make_face_cache (struct frame *);
+static void clear_face_gcs (struct face_cache *);
+static void free_face_cache (struct face_cache *);
+static int face_fontset (Lisp_Object *);
+static void merge_face_vectors (struct frame *, Lisp_Object *, Lisp_Object*,
+ struct named_merge_point *);
+static int merge_face_ref (struct frame *, Lisp_Object, Lisp_Object *,
+ int, struct named_merge_point *);
+static int set_lface_from_font (struct frame *, Lisp_Object, Lisp_Object,
+ int);
+static Lisp_Object lface_from_face_name (struct frame *, Lisp_Object, int);
+static struct face *make_realized_face (Lisp_Object *);
+static void cache_face (struct face_cache *, struct face *, unsigned);
+static void uncache_face (struct face_cache *, struct face *);
#ifdef HAVE_WINDOW_SYSTEM
-static GC x_create_gc P_ ((struct frame *, unsigned long, XGCValues *));
-static void x_free_gc P_ ((struct frame *, GC));
+static GC x_create_gc (struct frame *, unsigned long, XGCValues *);
+static void x_free_gc (struct frame *, GC);
#ifdef USE_X_TOOLKIT
-static void x_update_menu_appearance P_ ((struct frame *));
+static void x_update_menu_appearance (struct frame *);
-extern void free_frame_menubar P_ ((struct frame *));
+extern void free_frame_menubar (struct frame *);
#endif /* USE_X_TOOLKIT */
#endif /* HAVE_WINDOW_SYSTEM */
@@ -626,7 +625,7 @@ unregister_colors (pixels, n)
DEFUN ("dump-colors", Fdump_colors, Sdump_colors, 0, 0, 0,
doc: /* Dump currently allocated colors to stderr. */)
- ()
+ (void)
{
int i, n;
@@ -656,10 +655,7 @@ DEFUN ("dump-colors", Fdump_colors, Sdump_colors, 0, 0, 0,
is called. */
void
-x_free_colors (f, pixels, npixels)
- struct frame *f;
- unsigned long *pixels;
- int npixels;
+x_free_colors (struct frame *f, long unsigned int *pixels, int npixels)
{
int class = FRAME_X_DISPLAY_INFO (f)->visual->class;
@@ -681,12 +677,7 @@ x_free_colors (f, pixels, npixels)
is called. */
void
-x_free_dpy_colors (dpy, screen, cmap, pixels, npixels)
- Display *dpy;
- Screen *screen;
- Colormap cmap;
- unsigned long *pixels;
- int npixels;
+x_free_dpy_colors (Display *dpy, Screen *screen, Colormap cmap, long unsigned int *pixels, int npixels)
{
struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
int class = dpyinfo->visual->class;
@@ -707,10 +698,7 @@ x_free_dpy_colors (dpy, screen, cmap, pixels, npixels)
are given by XGCV and MASK. */
static INLINE GC
-x_create_gc (f, mask, xgcv)
- struct frame *f;
- unsigned long mask;
- XGCValues *xgcv;
+x_create_gc (struct frame *f, long unsigned int mask, XGCValues *xgcv)
{
GC gc;
BLOCK_INPUT;
@@ -724,9 +712,7 @@ x_create_gc (f, mask, xgcv)
/* Free GC which was used on frame F. */
static INLINE void
-x_free_gc (f, gc)
- struct frame *f;
- GC gc;
+x_free_gc (struct frame *f, GC gc)
{
eassert (interrupt_input_blocked);
IF_DEBUG (xassert (--ngcs >= 0));
@@ -739,10 +725,7 @@ x_free_gc (f, gc)
/* W32 emulation of GCs */
static INLINE GC
-x_create_gc (f, mask, xgcv)
- struct frame *f;
- unsigned long mask;
- XGCValues *xgcv;
+x_create_gc (struct frame *f, unsigned long mask, XGCValues *xgcv)
{
GC gc;
BLOCK_INPUT;
@@ -756,9 +739,7 @@ x_create_gc (f, mask, xgcv)
/* Free GC which was used on frame F. */
static INLINE void
-x_free_gc (f, gc)
- struct frame *f;
- GC gc;
+x_free_gc (struct frame *f, GC gc)
{
IF_DEBUG (xassert (--ngcs >= 0));
xfree (gc);
@@ -777,7 +758,7 @@ x_create_gc (f, mask, xgcv)
{
GC gc = xmalloc (sizeof (*gc));
if (gc)
- bcopy(xgcv, gc, sizeof(XGCValues));
+ memcpy (gc, xgcv, sizeof (XGCValues));
return gc;
}
@@ -794,8 +775,7 @@ x_free_gc (f, gc)
are in ISO8859-1. */
int
-xstrcasecmp (s1, s2)
- const unsigned char *s1, *s2;
+xstrcasecmp (const unsigned char *s1, const unsigned char *s2)
{
while (*s1 && *s2)
{
@@ -819,9 +799,7 @@ xstrcasecmp (s1, s2)
Lisp function definitions. */
static INLINE struct frame *
-frame_or_selected_frame (frame, nparam)
- Lisp_Object frame;
- int nparam;
+frame_or_selected_frame (Lisp_Object frame, int nparam)
{
if (NILP (frame))
frame = selected_frame;
@@ -838,8 +816,7 @@ frame_or_selected_frame (frame, nparam)
/* Initialize face cache and basic faces for frame F. */
void
-init_frame_faces (f)
- struct frame *f;
+init_frame_faces (struct frame *f)
{
/* Make a face cache, if F doesn't have one. */
if (FRAME_FACE_CACHE (f) == NULL)
@@ -877,8 +854,7 @@ init_frame_faces (f)
/* Free face cache of frame F. Called from delete_frame. */
void
-free_frame_faces (f)
- struct frame *f;
+free_frame_faces (struct frame *f)
{
struct face_cache *face_cache = FRAME_FACE_CACHE (f);
@@ -909,8 +885,7 @@ free_frame_faces (f)
of named faces. */
void
-recompute_basic_faces (f)
- struct frame *f;
+recompute_basic_faces (struct frame *f)
{
if (FRAME_FACE_CACHE (f))
{
@@ -925,8 +900,7 @@ recompute_basic_faces (f)
try to free unused fonts, too. */
void
-clear_face_cache (clear_fonts_p)
- int clear_fonts_p;
+clear_face_cache (int clear_fonts_p)
{
#ifdef HAVE_WINDOW_SYSTEM
Lisp_Object tail, frame;
@@ -971,8 +945,7 @@ clear_face_cache (clear_fonts_p)
DEFUN ("clear-face-cache", Fclear_face_cache, Sclear_face_cache, 0, 1, 0,
doc: /* Clear face caches on all frames.
Optional THOROUGHLY non-nil means try to free unused fonts, too. */)
- (thoroughly)
- Lisp_Object thoroughly;
+ (Lisp_Object thoroughly)
{
clear_face_cache (!NILP (thoroughly));
++face_change_count;
@@ -994,8 +967,7 @@ A bitmap specification is either a string, a file name, or a list
HEIGHT is its height, and DATA is a string containing the bits of
the pixmap. Bits are stored row by row, each row occupies
\(WIDTH + 7)/8 bytes. */)
- (object)
- Lisp_Object object;
+ (Lisp_Object object)
{
int pixmap_p = 0;
@@ -1045,10 +1017,7 @@ the pixmap. Bits are stored row by row, each row occupies
if these pointers are not null. */
static int
-load_pixmap (f, name, w_ptr, h_ptr)
- FRAME_PTR f;
- Lisp_Object name;
- unsigned int *w_ptr, *h_ptr;
+load_pixmap (FRAME_PTR f, Lisp_Object name, unsigned int *w_ptr, unsigned int *h_ptr)
{
int bitmap_id;
@@ -1117,9 +1086,7 @@ load_pixmap (f, name, w_ptr, h_ptr)
Return 0 if there's a problem with RGB_LIST, otherwise return 1. */
static int
-parse_rgb_list (rgb_list, color)
- Lisp_Object rgb_list;
- XColor *color;
+parse_rgb_list (Lisp_Object rgb_list, XColor *color)
{
#define PARSE_RGB_LIST_FIELD(field) \
if (CONSP (rgb_list) && INTEGERP (XCAR (rgb_list))) \
@@ -1144,10 +1111,7 @@ parse_rgb_list (rgb_list, color)
returned in it. */
static int
-tty_lookup_color (f, color, tty_color, std_color)
- struct frame *f;
- Lisp_Object color;
- XColor *tty_color, *std_color;
+tty_lookup_color (struct frame *f, Lisp_Object color, XColor *tty_color, XColor *std_color)
{
Lisp_Object frame, color_desc;
@@ -1207,11 +1171,7 @@ tty_lookup_color (f, color, tty_color, std_color)
/* A version of defined_color for non-X frames. */
int
-tty_defined_color (f, color_name, color_def, alloc)
- struct frame *f;
- char *color_name;
- XColor *color_def;
- int alloc;
+tty_defined_color (struct frame *f, char *color_name, XColor *color_def, int alloc)
{
int status = 1;
@@ -1246,11 +1206,7 @@ tty_defined_color (f, color_name, color_def, alloc)
This does the right thing for any type of frame. */
int
-defined_color (f, color_name, color_def, alloc)
- struct frame *f;
- char *color_name;
- XColor *color_def;
- int alloc;
+defined_color (struct frame *f, char *color_name, XColor *color_def, int alloc)
{
if (!FRAME_WINDOW_P (f))
return tty_defined_color (f, color_name, color_def, alloc);
@@ -1275,9 +1231,7 @@ defined_color (f, color_name, color_def, alloc)
Lisp string. */
Lisp_Object
-tty_color_name (f, idx)
- struct frame *f;
- int idx;
+tty_color_name (struct frame *f, int idx)
{
if (idx >= 0 && !NILP (Ffboundp (Qtty_color_by_index)))
{
@@ -1312,9 +1266,7 @@ tty_color_name (f, idx)
The criterion implemented here is not a terribly sophisticated one. */
static int
-face_color_gray_p (f, color_name)
- struct frame *f;
- char *color_name;
+face_color_gray_p (struct frame *f, char *color_name)
{
XColor color;
int gray_p;
@@ -1341,10 +1293,7 @@ face_color_gray_p (f, color_name)
color. */
static int
-face_color_supported_p (f, color_name, background_p)
- struct frame *f;
- char *color_name;
- int background_p;
+face_color_supported_p (struct frame *f, char *color_name, int background_p)
{
Lisp_Object frame;
XColor not_used;
@@ -1370,8 +1319,7 @@ DEFUN ("color-gray-p", Fcolor_gray_p, Scolor_gray_p, 1, 2, 0,
doc: /* Return non-nil if COLOR is a shade of gray (or white or black).
FRAME specifies the frame and thus the display for interpreting COLOR.
If FRAME is nil or omitted, use the selected frame. */)
- (color, frame)
- Lisp_Object color, frame;
+ (Lisp_Object color, Lisp_Object frame)
{
struct frame *f;
@@ -1392,8 +1340,7 @@ BACKGROUND-P non-nil means COLOR is used as a background.
Otherwise, this function tells whether it can be used as a foreground.
If FRAME is nil or omitted, use the selected frame.
COLOR must be a valid color name. */)
- (color, frame, background_p)
- Lisp_Object frame, color, background_p;
+ (Lisp_Object color, Lisp_Object frame, Lisp_Object background_p)
{
struct frame *f;
@@ -1419,11 +1366,7 @@ COLOR must be a valid color name. */)
these colors. */
unsigned long
-load_color (f, face, name, target_index)
- struct frame *f;
- struct face *face;
- Lisp_Object name;
- enum lface_attribute_index target_index;
+load_color (struct frame *f, struct face *face, Lisp_Object name, enum lface_attribute_index target_index)
{
XColor color;
@@ -1494,10 +1437,7 @@ load_color (f, face, name, target_index)
try to emulate gray colors with a stipple from Vface_default_stipple. */
static void
-load_face_colors (f, face, attrs)
- struct frame *f;
- struct face *face;
- Lisp_Object *attrs;
+load_face_colors (struct frame *f, struct face *face, Lisp_Object *attrs)
{
Lisp_Object fg, bg;
@@ -1533,9 +1473,7 @@ load_face_colors (f, face, attrs)
/* Free color PIXEL on frame F. */
void
-unload_color (f, pixel)
- struct frame *f;
- unsigned long pixel;
+unload_color (struct frame *f, long unsigned int pixel)
{
#ifdef HAVE_X_WINDOWS
if (pixel != -1)
@@ -1551,9 +1489,7 @@ unload_color (f, pixel)
/* Free colors allocated for FACE. */
static void
-free_face_colors (f, face)
- struct frame *f;
- struct face *face;
+free_face_colors (struct frame *f, struct face *face)
{
/* PENDING(NS): need to do something here? */
#ifdef HAVE_X_WINDOWS
@@ -1693,8 +1629,7 @@ static int font_sort_order[4];
static enum font_property_index font_props_for_sorting[FONT_SIZE_INDEX];
static int
-compare_fonts_by_sort_order (v1, v2)
- const void *v1, *v2;
+compare_fonts_by_sort_order (const void *v1, const void *v2)
{
Lisp_Object font1 = *(Lisp_Object *) v1;
Lisp_Object font2 = *(Lisp_Object *) v2;
@@ -1742,8 +1677,7 @@ FULL is the full name of the font, and REGISTRY-AND-ENCODING is a string
giving the registry and encoding of the font.
The result list is sorted according to the current setting of
the face font sort order. */)
- (family, frame)
- Lisp_Object family, frame;
+ (Lisp_Object family, Lisp_Object frame)
{
Lisp_Object font_spec, list, *drivers, vec;
int i, nfonts, ndrivers;
@@ -1840,8 +1774,7 @@ fonts to match. The first MAXIMUM fonts are reported.
The optional fifth argument WIDTH, if specified, is a number of columns
occupied by a character of a font. In that case, return only fonts
the WIDTH times as wide as FACE on FRAME. */)
- (pattern, face, frame, maximum, width)
- Lisp_Object pattern, face, frame, maximum, width;
+ (Lisp_Object pattern, Lisp_Object face, Lisp_Object frame, Lisp_Object maximum, Lisp_Object width)
{
struct frame *f;
int size, avgwidth;
@@ -2150,9 +2083,7 @@ resolve_face_name_error (ignore)
Return default face in case of errors. */
static Lisp_Object
-resolve_face_name (face_name, signal_p)
- Lisp_Object face_name;
- int signal_p;
+resolve_face_name (Lisp_Object face_name, int signal_p)
{
Lisp_Object orig_face;
Lisp_Object tortoise, hare;
@@ -2198,10 +2129,7 @@ resolve_face_name (face_name, signal_p)
signal an error if FACE_NAME is not a valid face name. If SIGNAL_P
is zero, value is nil if FACE_NAME is not a valid face name. */
static INLINE Lisp_Object
-lface_from_face_name_no_resolve (f, face_name, signal_p)
- struct frame *f;
- Lisp_Object face_name;
- int signal_p;
+lface_from_face_name_no_resolve (struct frame *f, Lisp_Object face_name, int signal_p)
{
Lisp_Object lface;
@@ -2229,10 +2157,7 @@ lface_from_face_name_no_resolve (f, face_name, signal_p)
If SIGNAL_P is zero, value is nil if FACE_NAME is not a valid face
name. */
static INLINE Lisp_Object
-lface_from_face_name (f, face_name, signal_p)
- struct frame *f;
- Lisp_Object face_name;
- int signal_p;
+lface_from_face_name (struct frame *f, Lisp_Object face_name, int signal_p)
{
face_name = resolve_face_name (face_name, signal_p);
return lface_from_face_name_no_resolve (f, face_name, signal_p);
@@ -2246,19 +2171,15 @@ lface_from_face_name (f, face_name, signal_p)
Otherwise, value is zero if FACE_NAME is not a face. */
static INLINE int
-get_lface_attributes_no_remap (f, face_name, attrs, signal_p)
- struct frame *f;
- Lisp_Object face_name;
- Lisp_Object *attrs;
- int signal_p;
+get_lface_attributes_no_remap (struct frame *f, Lisp_Object face_name, Lisp_Object *attrs, int signal_p)
{
Lisp_Object lface;
lface = lface_from_face_name_no_resolve (f, face_name, signal_p);
if (! NILP (lface))
- bcopy (XVECTOR (lface)->contents, attrs,
- LFACE_VECTOR_SIZE * sizeof *attrs);
+ memcpy (attrs, XVECTOR (lface)->contents,
+ LFACE_VECTOR_SIZE * sizeof *attrs);
return !NILP (lface);
}
@@ -2271,12 +2192,7 @@ get_lface_attributes_no_remap (f, face_name, attrs, signal_p)
Otherwise, value is zero if FACE_NAME is not a face. */
static INLINE int
-get_lface_attributes (f, face_name, attrs, signal_p, named_merge_points)
- struct frame *f;
- Lisp_Object face_name;
- Lisp_Object *attrs;
- int signal_p;
- struct named_merge_point *named_merge_points;
+get_lface_attributes (struct frame *f, Lisp_Object face_name, Lisp_Object *attrs, int signal_p, struct named_merge_point *named_merge_points)
{
Lisp_Object face_remapping;
@@ -2312,8 +2228,7 @@ get_lface_attributes (f, face_name, attrs, signal_p, named_merge_points)
specified, i.e. are non-nil. */
static int
-lface_fully_specified_p (attrs)
- Lisp_Object *attrs;
+lface_fully_specified_p (Lisp_Object *attrs)
{
int i;
@@ -2333,10 +2248,7 @@ lface_fully_specified_p (attrs)
of FORCE_P. */
static int
-set_lface_from_font (f, lface, font_object, force_p)
- struct frame *f;
- Lisp_Object lface, font_object;
- int force_p;
+set_lface_from_font (struct frame *f, Lisp_Object lface, Lisp_Object font_object, int force_p)
{
Lisp_Object val;
struct font *font = XFONT_OBJECT (font_object);
@@ -2397,8 +2309,7 @@ set_lface_from_font (f, lface, font_object, force_p)
unless both FROM and TO are relative. */
Lisp_Object
-merge_face_heights (from, to, invalid)
- Lisp_Object from, to, invalid;
+merge_face_heights (Lisp_Object from, Lisp_Object to, Lisp_Object invalid)
{
Lisp_Object result = invalid;
@@ -2447,10 +2358,7 @@ merge_face_heights (from, to, invalid)
other places. */
static INLINE void
-merge_face_vectors (f, from, to, named_merge_points)
- struct frame *f;
- Lisp_Object *from, *to;
- struct named_merge_point *named_merge_points;
+merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to, struct named_merge_point *named_merge_points)
{
int i;
@@ -2517,11 +2425,7 @@ merge_face_vectors (f, from, to, named_merge_points)
merging succeeded. */
static int
-merge_named_face (f, face_name, to, named_merge_points)
- struct frame *f;
- Lisp_Object face_name;
- Lisp_Object *to;
- struct named_merge_point *named_merge_points;
+merge_named_face (struct frame *f, Lisp_Object face_name, Lisp_Object *to, struct named_merge_point *named_merge_points)
{
struct named_merge_point named_merge_point;
@@ -2571,12 +2475,7 @@ merge_named_face (f, face_name, to, named_merge_points)
specifications. */
static int
-merge_face_ref (f, face_ref, to, err_msgs, named_merge_points)
- struct frame *f;
- Lisp_Object face_ref;
- Lisp_Object *to;
- int err_msgs;
- struct named_merge_point *named_merge_points;
+merge_face_ref (struct frame *f, Lisp_Object face_ref, Lisp_Object *to, int err_msgs, struct named_merge_point *named_merge_points)
{
int ok = 1; /* Succeed without an error? */
@@ -2806,8 +2705,7 @@ If FACE was not known as a face before, create a new one.
If optional argument FRAME is specified, make a frame-local face
for that frame. Otherwise operate on the global face definition.
Value is a vector of face attributes. */)
- (face, frame)
- Lisp_Object face, frame;
+ (Lisp_Object face, Lisp_Object frame)
{
Lisp_Object global_lface, lface;
struct frame *f;
@@ -2895,8 +2793,7 @@ FACE should be a symbol or string.
If optional second argument FRAME is non-nil, check for the
existence of a frame-local face with name FACE on that frame.
Otherwise check for the existence of a global face. */)
- (face, frame)
- Lisp_Object face, frame;
+ (Lisp_Object face, Lisp_Object frame)
{
Lisp_Object lface;
@@ -2924,8 +2821,7 @@ definition of TO on NEW-FRAME. If NEW-FRAME is nil,
FRAME controls where the data is copied to.
The value is TO. */)
- (from, to, frame, new_frame)
- Lisp_Object from, to, frame, new_frame;
+ (Lisp_Object from, Lisp_Object to, Lisp_Object frame, Lisp_Object new_frame)
{
Lisp_Object lface, copy;
@@ -2950,8 +2846,8 @@ The value is TO. */)
copy = Finternal_make_lisp_face (to, new_frame);
}
- bcopy (XVECTOR (lface)->contents, XVECTOR (copy)->contents,
- LFACE_VECTOR_SIZE * sizeof (Lisp_Object));
+ memcpy (XVECTOR (copy)->contents, XVECTOR (lface)->contents,
+ LFACE_VECTOR_SIZE * sizeof (Lisp_Object));
/* Changing a named face means that all realized faces depending on
that face are invalid. Since we cannot tell which realized faces
@@ -2976,8 +2872,7 @@ FRAME nil means change the face of the selected frame.
FRAME t means change the default for new frames.
FRAME 0 means change the face on all frames, and change the default
for new frames. */)
- (face, attr, value, frame)
- Lisp_Object face, attr, value, frame;
+ (Lisp_Object face, Lisp_Object attr, Lisp_Object value, Lisp_Object frame)
{
Lisp_Object lface;
Lisp_Object old_value = Qnil;
@@ -3490,44 +3385,11 @@ FRAME 0 means change the face on all frames, and change the default
}
-#ifdef HAVE_WINDOW_SYSTEM
-
-/* Set the `font' frame parameter of FRAME determined from the
- font-object set in `default' face attributes LFACE. */
-
-static void
-set_font_frame_param (frame, lface)
- Lisp_Object frame, lface;
-{
- struct frame *f = XFRAME (frame);
- Lisp_Object font;
-
- if (FRAME_WINDOW_P (f)
- /* Don't do anything if the font is `unspecified'. This can
- happen during frame creation. */
- && (font = LFACE_FONT (lface),
- ! UNSPECIFIEDP (font)))
- {
- if (FONT_SPEC_P (font))
- {
- font = font_load_for_lface (f, XVECTOR (lface)->contents, font);
- if (NILP (font))
- return;
- LFACE_FONT (lface) = font;
- }
- f->default_face_done_p = 0;
- Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font), Qnil));
- }
-}
-
-
/* Update the corresponding face when frame parameter PARAM on frame F
has been assigned the value NEW_VALUE. */
void
-update_face_from_frame_parameter (f, param, new_value)
- struct frame *f;
- Lisp_Object param, new_value;
+update_face_from_frame_parameter (struct frame *f, Lisp_Object param, Lisp_Object new_value)
{
Lisp_Object face = Qnil;
Lisp_Object lface;
@@ -3562,6 +3424,7 @@ update_face_from_frame_parameter (f, param, new_value)
? new_value : Qunspecified);
realize_basic_faces (f);
}
+#ifdef HAVE_WINDOW_SYSTEM
else if (EQ (param, Qborder_color))
{
face = Qborder;
@@ -3583,6 +3446,7 @@ update_face_from_frame_parameter (f, param, new_value)
LFACE_BACKGROUND (lface) = (STRINGP (new_value)
? new_value : Qunspecified);
}
+#endif
/* Changing a named face means that all realized faces depending on
that face are invalid. Since we cannot tell which realized faces
@@ -3598,14 +3462,43 @@ update_face_from_frame_parameter (f, param, new_value)
}
+#ifdef HAVE_WINDOW_SYSTEM
+
+/* Set the `font' frame parameter of FRAME determined from the
+ font-object set in `default' face attributes LFACE. */
+
+static void
+set_font_frame_param (Lisp_Object frame, Lisp_Object lface)
+{
+ struct frame *f = XFRAME (frame);
+ Lisp_Object font;
+
+ if (FRAME_WINDOW_P (f)
+ /* Don't do anything if the font is `unspecified'. This can
+ happen during frame creation. */
+ && (font = LFACE_FONT (lface),
+ ! UNSPECIFIEDP (font)))
+ {
+ if (FONT_SPEC_P (font))
+ {
+ font = font_load_for_lface (f, XVECTOR (lface)->contents, font);
+ if (NILP (font))
+ return;
+ LFACE_FONT (lface) = font;
+ }
+ f->default_face_done_p = 0;
+ Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font), Qnil));
+ }
+}
+
+
/* Get the value of X resource RESOURCE, class CLASS for the display
of frame FRAME. This is here because ordinary `x-get-resource'
doesn't take a frame argument. */
DEFUN ("internal-face-x-get-resource", Finternal_face_x_get_resource,
Sinternal_face_x_get_resource, 3, 3, 0, doc: /* */)
- (resource, class, frame)
- Lisp_Object resource, class, frame;
+ (Lisp_Object resource, Lisp_Object class, Lisp_Object frame)
{
Lisp_Object value = Qnil;
CHECK_STRING (resource);
@@ -3625,9 +3518,7 @@ DEFUN ("internal-face-x-get-resource", Finternal_face_x_get_resource,
error; if SIGNAL_P is zero, return 0. */
static Lisp_Object
-face_boolean_x_resource_value (value, signal_p)
- Lisp_Object value;
- int signal_p;
+face_boolean_x_resource_value (Lisp_Object value, int signal_p)
{
Lisp_Object result = make_number (0);
@@ -3652,8 +3543,7 @@ DEFUN ("internal-set-lisp-face-attribute-from-resource",
Finternal_set_lisp_face_attribute_from_resource,
Sinternal_set_lisp_face_attribute_from_resource,
3, 4, 0, doc: /* */)
- (face, attr, value, frame)
- Lisp_Object face, attr, value, frame;
+ (Lisp_Object face, Lisp_Object attr, Lisp_Object value, Lisp_Object frame)
{
CHECK_SYMBOL (face);
CHECK_SYMBOL (attr);
@@ -3703,8 +3593,7 @@ DEFUN ("internal-set-lisp-face-attribute-from-resource",
/* Make menus on frame F appear as specified by the `menu' face. */
static void
-x_update_menu_appearance (f)
- struct frame *f;
+x_update_menu_appearance (struct frame *f)
{
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
XrmDatabase rdb;
@@ -3778,7 +3667,7 @@ x_update_menu_appearance (f)
{
#if defined HAVE_X_I18N
extern char *xic_create_fontsetname
- P_ ((char *base_fontname, Bool motif));
+ (char *base_fontname, Bool motif);
char *fontsetname = xic_create_fontsetname (SDATA (xlfd), motif);
#else
char *fontsetname = (char *) SDATA (xlfd);
@@ -3814,8 +3703,7 @@ A relative value is one that doesn't entirely override whatever is
inherited from another face. For most possible attributes,
the only relative value that users see is `unspecified'.
However, for :height, floating point values are also relative. */)
- (attribute, value)
- Lisp_Object attribute, value;
+ (Lisp_Object attribute, Lisp_Object value)
{
if (EQ (value, Qunspecified) || (EQ (value, Qignore_defface)))
return Qt;
@@ -3830,8 +3718,7 @@ DEFUN ("merge-face-attribute", Fmerge_face_attribute, Smerge_face_attribute,
doc: /* Return face ATTRIBUTE VALUE1 merged with VALUE2.
If VALUE1 or VALUE2 are absolute (see `face-attribute-relative-p'), then
the result will be absolute, otherwise it will be relative. */)
- (attribute, value1, value2)
- Lisp_Object attribute, value1, value2;
+ (Lisp_Object attribute, Lisp_Object value1, Lisp_Object value2)
{
if (EQ (value1, Qunspecified) || EQ (value1, Qignore_defface))
return value2;
@@ -3851,8 +3738,7 @@ face attribute name, signal an error.
If the optional argument FRAME is given, report on face SYMBOL in that
frame. If FRAME is t, report on the defaults for face SYMBOL (for new
frames). If FRAME is omitted or nil, use the selected frame. */)
- (symbol, keyword, frame)
- Lisp_Object symbol, keyword, frame;
+ (Lisp_Object symbol, Lisp_Object keyword, Lisp_Object frame)
{
Lisp_Object lface, value = Qnil;
@@ -3919,8 +3805,7 @@ DEFUN ("internal-lisp-face-attribute-values",
Sinternal_lisp_face_attribute_values, 1, 1, 0,
doc: /* Return a list of valid discrete values for face attribute ATTR.
Value is nil if ATTR doesn't have a discrete set of valid values. */)
- (attr)
- Lisp_Object attr;
+ (Lisp_Object attr)
{
Lisp_Object result = Qnil;
@@ -3943,8 +3828,7 @@ DEFUN ("internal-merge-in-global-face", Finternal_merge_in_global_face,
Sinternal_merge_in_global_face, 2, 2, 0,
doc: /* Add attributes from frame-default definition of FACE to FACE on FRAME.
Default face attributes override any local face attributes. */)
- (face, frame)
- Lisp_Object face, frame;
+ (Lisp_Object face, Lisp_Object frame)
{
int i;
Lisp_Object global_lface, local_lface, *gvec, *lvec;
@@ -3982,9 +3866,9 @@ Default face attributes override any local face attributes. */)
{
/* Ensure that the face vector is fully specified by merging
the previously-cached vector. */
- bcopy (oldface->lface, attrs, sizeof attrs);
+ memcpy (attrs, oldface->lface, sizeof attrs);
merge_face_vectors (f, lvec, attrs, 0);
- bcopy (attrs, lvec, sizeof attrs);
+ memcpy (lvec, attrs, sizeof attrs);
newface = realize_face (c, lvec, DEFAULT_FACE_ID);
if ((! UNSPECIFIEDP (gvec[LFACE_FAMILY_INDEX])
@@ -4022,8 +3906,7 @@ If FRAME is t, report on the defaults for face FACE (for new frames).
If FRAME is omitted or nil, use the selected frame. And, in this case,
if the optional third argument CHARACTER is given,
return the font name used for CHARACTER. */)
- (face, frame, character)
- Lisp_Object face, frame, character;
+ (Lisp_Object face, Lisp_Object frame, Lisp_Object character)
{
if (EQ (frame, Qt))
{
@@ -4073,8 +3956,7 @@ return the font name used for CHARACTER. */)
is called quite often. */
static INLINE int
-face_attr_equal_p (v1, v2)
- Lisp_Object v1, v2;
+face_attr_equal_p (Lisp_Object v1, Lisp_Object v2)
{
/* Type can differ, e.g. when one attribute is unspecified, i.e. nil,
and the other is specified. */
@@ -4090,7 +3972,7 @@ face_attr_equal_p (v1, v2)
if (SBYTES (v1) != SBYTES (v2))
return 0;
- return bcmp (SDATA (v1), SDATA (v2), SBYTES (v1)) == 0;
+ return memcmp (SDATA (v1), SDATA (v2), SBYTES (v1)) == 0;
case_Lisp_Int:
case Lisp_Symbol:
@@ -4107,8 +3989,7 @@ face_attr_equal_p (v1, v2)
is called quite often. */
static INLINE int
-lface_equal_p (v1, v2)
- Lisp_Object *v1, *v2;
+lface_equal_p (Lisp_Object *v1, Lisp_Object *v2)
{
int i, equal_p = 1;
@@ -4125,8 +4006,7 @@ DEFUN ("internal-lisp-face-equal-p", Finternal_lisp_face_equal_p,
If the optional argument FRAME is given, report on FACE1 and FACE2 in that frame.
If FRAME is t, report on the defaults for FACE1 and FACE2 (for new frames).
If FRAME is omitted or nil, use the selected frame. */)
- (face1, face2, frame)
- Lisp_Object face1, face2, frame;
+ (Lisp_Object face1, Lisp_Object face2, Lisp_Object frame)
{
int equal_p;
struct frame *f;
@@ -4155,8 +4035,7 @@ DEFUN ("internal-lisp-face-empty-p", Finternal_lisp_face_empty_p,
If the optional argument FRAME is given, report on face FACE in that frame.
If FRAME is t, report on the defaults for face FACE (for new frames).
If FRAME is omitted or nil, use the selected frame. */)
- (face, frame)
- Lisp_Object face, frame;
+ (Lisp_Object face, Lisp_Object frame)
{
struct frame *f;
Lisp_Object lface;
@@ -4184,8 +4063,7 @@ DEFUN ("frame-face-alist", Fframe_face_alist, Sframe_face_alist,
0, 1, 0,
doc: /* Return an alist of frame-local faces defined on FRAME.
For internal use only. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct frame *f = frame_or_selected_frame (frame, 0);
return f->face_alist;
@@ -4196,8 +4074,7 @@ For internal use only. */)
below in computing a hash value for a Lisp face. */
static INLINE unsigned
-hash_string_case_insensitive (string)
- Lisp_Object string;
+hash_string_case_insensitive (Lisp_Object string)
{
const unsigned char *s;
unsigned hash = 0;
@@ -4211,8 +4088,7 @@ hash_string_case_insensitive (string)
/* Return a hash code for face attribute vector V. */
static INLINE unsigned
-lface_hash (v)
- Lisp_Object *v;
+lface_hash (Lisp_Object *v)
{
return (hash_string_case_insensitive (v[LFACE_FAMILY_INDEX])
^ hash_string_case_insensitive (v[LFACE_FOUNDRY_INDEX])
@@ -4231,8 +4107,7 @@ lface_hash (v)
LFACE1 and LFACE2 must be fully-specified. */
static INLINE int
-lface_same_font_attributes_p (lface1, lface2)
- Lisp_Object *lface1, *lface2;
+lface_same_font_attributes_p (Lisp_Object *lface1, Lisp_Object *lface2)
{
xassert (lface_fully_specified_p (lface1)
&& lface_fully_specified_p (lface2));
@@ -4263,13 +4138,12 @@ lface_same_font_attributes_p (lface1, lface2)
vector ATTR. */
static struct face *
-make_realized_face (attr)
- Lisp_Object *attr;
+make_realized_face (Lisp_Object *attr)
{
struct face *face = (struct face *) xmalloc (sizeof *face);
- bzero (face, sizeof *face);
+ memset (face, 0, sizeof *face);
face->ascii_face = face;
- bcopy (attr, face->lface, sizeof face->lface);
+ memcpy (face->lface, attr, sizeof face->lface);
return face;
}
@@ -4278,9 +4152,7 @@ make_realized_face (attr)
be null. */
void
-free_realized_face (f, face)
- struct frame *f;
- struct face *face;
+free_realized_face (struct frame *f, struct face *face)
{
if (face)
{
@@ -4315,9 +4187,7 @@ free_realized_face (f, face)
by clearing the face cache. */
void
-prepare_face_for_display (f, face)
- struct frame *f;
- struct face *face;
+prepare_face_for_display (struct frame *f, struct face *face)
{
#ifdef HAVE_WINDOW_SYSTEM
xassert (FRAME_WINDOW_P (f));
@@ -4354,8 +4224,7 @@ prepare_face_for_display (f, face)
/* Returns the `distance' between the colors X and Y. */
static int
-color_distance (x, y)
- XColor *x, *y;
+color_distance (XColor *x, XColor *y)
{
/* This formula is from a paper title `Colour metric' by Thiadmer Riemersma.
Quoting from that paper:
@@ -4384,8 +4253,7 @@ DEFUN ("color-distance", Fcolor_distance, Scolor_distance, 2, 3, 0,
COLOR1 and COLOR2 may be either strings containing the color name,
or lists of the form (RED GREEN BLUE).
If FRAME is unspecified or nil, the current frame is used. */)
- (color1, color2, frame)
- Lisp_Object color1, color2, frame;
+ (Lisp_Object color1, Lisp_Object color2, Lisp_Object frame)
{
struct frame *f;
XColor cdef1, cdef2;
@@ -4413,17 +4281,16 @@ If FRAME is unspecified or nil, the current frame is used. */)
/* Return a new face cache for frame F. */
static struct face_cache *
-make_face_cache (f)
- struct frame *f;
+make_face_cache (struct frame *f)
{
struct face_cache *c;
int size;
c = (struct face_cache *) xmalloc (sizeof *c);
- bzero (c, sizeof *c);
+ memset (c, 0, sizeof *c);
size = FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets;
c->buckets = (struct face **) xmalloc (size);
- bzero (c->buckets, size);
+ memset (c->buckets, 0, size);
c->size = 50;
c->faces_by_id = (struct face **) xmalloc (c->size * sizeof *c->faces_by_id);
c->f = f;
@@ -4437,8 +4304,7 @@ make_face_cache (f)
keeping too many graphics contexts that are no longer needed. */
static void
-clear_face_gcs (c)
- struct face_cache *c;
+clear_face_gcs (struct face_cache *c)
{
if (c && FRAME_WINDOW_P (c->f))
{
@@ -4468,8 +4334,7 @@ clear_face_gcs (c)
event doesn't try to use faces we destroyed. */
static void
-free_realized_faces (c)
- struct face_cache *c;
+free_realized_faces (struct face_cache *c)
{
if (c && c->used)
{
@@ -4489,7 +4354,7 @@ free_realized_faces (c)
c->used = 0;
size = FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets;
- bzero (c->buckets, size);
+ memset (c->buckets, 0, size);
/* Must do a thorough redisplay the next time. Mark current
matrices as invalid because they will reference faces freed
@@ -4509,9 +4374,7 @@ free_realized_faces (c)
/* Free all realized faces that are using FONTSET on frame F. */
void
-free_realized_faces_for_fontset (f, fontset)
- struct frame *f;
- int fontset;
+free_realized_faces_for_fontset (struct frame *f, int fontset)
{
struct face_cache *cache = FRAME_FACE_CACHE (f);
struct face *face;
@@ -4552,8 +4415,7 @@ free_realized_faces_for_fontset (f, fontset)
because we can't tell which realized faces depend on that face. */
void
-free_all_realized_faces (frame)
- Lisp_Object frame;
+free_all_realized_faces (Lisp_Object frame)
{
if (NILP (frame))
{
@@ -4569,8 +4431,7 @@ free_all_realized_faces (frame)
/* Free face cache C and faces in it, including their X resources. */
static void
-free_face_cache (c)
- struct face_cache *c;
+free_face_cache (struct face_cache *c)
{
if (c)
{
@@ -4590,10 +4451,7 @@ free_face_cache (c)
that a requested face is not cached. */
static void
-cache_face (c, face, hash)
- struct face_cache *c;
- struct face *face;
- unsigned hash;
+cache_face (struct face_cache *c, struct face *face, unsigned int hash)
{
int i = hash % FACE_CACHE_BUCKETS_SIZE;
@@ -4670,9 +4528,7 @@ cache_face (c, face, hash)
/* Remove face FACE from cache C. */
static void
-uncache_face (c, face)
- struct face_cache *c;
- struct face *face;
+uncache_face (struct face_cache *c, struct face *face)
{
int i = face->hash % FACE_CACHE_BUCKETS_SIZE;
@@ -4696,9 +4552,7 @@ uncache_face (c, face)
realize a new one. */
INLINE int
-lookup_face (f, attr)
- struct frame *f;
- Lisp_Object *attr;
+lookup_face (struct frame *f, Lisp_Object *attr)
{
struct face_cache *cache = FRAME_FACE_CACHE (f);
unsigned hash;
@@ -4744,10 +4598,7 @@ lookup_face (f, attr)
suitable face is found, realize a new one. */
int
-face_for_font (f, font_object, base_face)
- struct frame *f;
- Lisp_Object font_object;
- struct face *base_face;
+face_for_font (struct frame *f, Lisp_Object font_object, struct face *base_face)
{
struct face_cache *cache = FRAME_FACE_CACHE (f);
unsigned hash;
@@ -4782,10 +4633,7 @@ face_for_font (f, font_object, base_face)
face isn't realized and cannot be realized. */
int
-lookup_named_face (f, symbol, signal_p)
- struct frame *f;
- Lisp_Object symbol;
- int signal_p;
+lookup_named_face (struct frame *f, Lisp_Object symbol, int signal_p)
{
Lisp_Object attrs[LFACE_VECTOR_SIZE];
Lisp_Object symbol_attrs[LFACE_VECTOR_SIZE];
@@ -4803,7 +4651,7 @@ lookup_named_face (f, symbol, signal_p)
if (! get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0))
return -1;
- bcopy (default_face->lface, attrs, sizeof attrs);
+ memcpy (attrs, default_face->lface, sizeof attrs);
merge_face_vectors (f, symbol_attrs, attrs, 0);
return lookup_face (f, attrs);
@@ -4817,9 +4665,7 @@ lookup_named_face (f, symbol, signal_p)
rather than signal an error. */
int
-lookup_basic_face (f, face_id)
- struct frame *f;
- int face_id;
+lookup_basic_face (struct frame *f, int face_id)
{
Lisp_Object name, mapping;
int remapped_face_id;
@@ -4866,9 +4712,7 @@ lookup_basic_face (f, face_id)
LFACE_ID on frame F. Value is -1 if LFACE_ID isn't valid. */
int
-ascii_face_of_lisp_face (f, lface_id)
- struct frame *f;
- int lface_id;
+ascii_face_of_lisp_face (struct frame *f, int lface_id)
{
int face_id;
@@ -4889,9 +4733,7 @@ ascii_face_of_lisp_face (f, lface_id)
STEPS < 0 means larger. Value is the id of the face. */
int
-smaller_face (f, face_id, steps)
- struct frame *f;
- int face_id, steps;
+smaller_face (struct frame *f, int face_id, int steps)
{
#ifdef HAVE_WINDOW_SYSTEM
struct face *face;
@@ -4910,7 +4752,7 @@ smaller_face (f, face_id, steps)
steps = eabs (steps);
face = FACE_FROM_ID (f, face_id);
- bcopy (face->lface, attrs, sizeof attrs);
+ memcpy (attrs, face->lface, sizeof attrs);
pt = last_pt = XFASTINT (attrs[LFACE_HEIGHT_INDEX]);
new_face_id = face_id;
last_height = FONT_HEIGHT (face->font);
@@ -4950,10 +4792,7 @@ smaller_face (f, face_id, steps)
FACE_ID on frame F, but has height HEIGHT. */
int
-face_with_height (f, face_id, height)
- struct frame *f;
- int face_id;
- int height;
+face_with_height (struct frame *f, int face_id, int height)
{
#ifdef HAVE_WINDOW_SYSTEM
struct face *face;
@@ -4964,7 +4803,7 @@ face_with_height (f, face_id, height)
return face_id;
face = FACE_FROM_ID (f, face_id);
- bcopy (face->lface, attrs, sizeof attrs);
+ memcpy (attrs, face->lface, sizeof attrs);
attrs[LFACE_HEIGHT_INDEX] = make_number (height);
font_clear_prop (attrs, FONT_SIZE_INDEX);
face_id = lookup_face (f, attrs);
@@ -4982,11 +4821,7 @@ face_with_height (f, face_id, height)
default face. FACE_ID is assumed to be already realized. */
int
-lookup_derived_face (f, symbol, face_id, signal_p)
- struct frame *f;
- Lisp_Object symbol;
- int face_id;
- int signal_p;
+lookup_derived_face (struct frame *f, Lisp_Object symbol, int face_id, int signal_p)
{
Lisp_Object attrs[LFACE_VECTOR_SIZE];
Lisp_Object symbol_attrs[LFACE_VECTOR_SIZE];
@@ -4998,7 +4833,7 @@ lookup_derived_face (f, symbol, face_id, signal_p)
if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0))
return -1;
- bcopy (default_face->lface, attrs, sizeof attrs);
+ memcpy (attrs, default_face->lface, sizeof attrs);
merge_face_vectors (f, symbol_attrs, attrs, 0);
return lookup_face (f, attrs);
}
@@ -5006,8 +4841,7 @@ lookup_derived_face (f, symbol, face_id, signal_p)
DEFUN ("face-attributes-as-vector", Fface_attributes_as_vector,
Sface_attributes_as_vector, 1, 1, 0,
doc: /* Return a vector of face attributes corresponding to PLIST. */)
- (plist)
- Lisp_Object plist;
+ (Lisp_Object plist)
{
Lisp_Object lface;
lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE),
@@ -5043,10 +4877,7 @@ DEFUN ("face-attributes-as-vector", Fface_attributes_as_vector,
\(2) `close in spirit' to what the attributes specify, if not exact. */
static int
-x_supports_face_attributes_p (f, attrs, def_face)
- struct frame *f;
- Lisp_Object *attrs;
- struct face *def_face;
+x_supports_face_attributes_p (struct frame *f, Lisp_Object *attrs, struct face *def_face)
{
Lisp_Object *def_attrs = def_face->lface;
@@ -5092,7 +4923,7 @@ x_supports_face_attributes_p (f, attrs, def_face)
Lisp_Object merged_attrs[LFACE_VECTOR_SIZE];
int i;
- bcopy (def_attrs, merged_attrs, sizeof merged_attrs);
+ memcpy (merged_attrs, def_attrs, sizeof merged_attrs);
merge_face_vectors (f, attrs, merged_attrs, 0);
@@ -5147,10 +4978,7 @@ x_supports_face_attributes_p (f, attrs, def_face)
substitution of a `dim' face for italic. */
static int
-tty_supports_face_attributes_p (f, attrs, def_face)
- struct frame *f;
- Lisp_Object *attrs;
- struct face *def_face;
+tty_supports_face_attributes_p (struct frame *f, Lisp_Object *attrs, struct face *def_face)
{
int weight;
Lisp_Object val, fg, bg;
@@ -5330,8 +5158,7 @@ any display that can display bold, and a `:foreground \"yellow\"' as long
as it can display a yellowish color, but `:slant italic' will _not_ be
satisfied by the tty display code's automatic substitution of a `dim'
face for italic. */)
- (attributes, display)
- Lisp_Object attributes, display;
+ (Lisp_Object attributes, Lisp_Object display)
{
int supports = 0, i;
Lisp_Object frame;
@@ -5408,15 +5235,14 @@ first in ORDER are matched first, e.g. if `:height' appears before
`:weight' in ORDER, font selection first tries to find a font with
a suitable height, and then tries to match the font weight.
Value is ORDER. */)
- (order)
- Lisp_Object order;
+ (Lisp_Object order)
{
Lisp_Object list;
int i;
int indices[DIM (font_sort_order)];
CHECK_LIST (order);
- bzero (indices, sizeof indices);
+ memset (indices, 0, sizeof indices);
i = 0;
for (list = order;
@@ -5448,9 +5274,9 @@ Value is ORDER. */)
if (indices[i] == 0)
signal_error ("Invalid font sort order", order);
- if (bcmp (indices, font_sort_order, sizeof indices) != 0)
+ if (memcmp (indices, font_sort_order, sizeof indices) != 0)
{
- bcopy (indices, font_sort_order, sizeof font_sort_order);
+ memcpy (font_sort_order, indices, sizeof font_sort_order);
free_all_realized_faces (Qnil);
}
@@ -5467,8 +5293,7 @@ DEFUN ("internal-set-alternative-font-family-alist",
ALIST is an alist of (FAMILY ALTERNATIVE1 ALTERNATIVE2 ...) entries.
Each ALTERNATIVE is tried in order if no fonts of font family FAMILY can
be found. Value is ALIST. */)
- (alist)
- Lisp_Object alist;
+ (Lisp_Object alist)
{
Lisp_Object entry, tail, tail2;
@@ -5497,8 +5322,7 @@ DEFUN ("internal-set-alternative-font-registry-alist",
ALIST is an alist of (REGISTRY ALTERNATIVE1 ALTERNATIVE2 ...) entries.
Each ALTERNATIVE is tried in order if no fonts of font registry REGISTRY can
be found. Value is ALIST. */)
- (alist)
- Lisp_Object alist;
+ (Lisp_Object alist)
{
Lisp_Object entry, tail, tail2;
@@ -5530,8 +5354,7 @@ be found. Value is ALIST. */)
attribute of ATTRS doesn't name a fontset. */
static int
-face_fontset (attrs)
- Lisp_Object *attrs;
+face_fontset (Lisp_Object *attrs)
{
Lisp_Object name;
@@ -5554,8 +5377,7 @@ face_fontset (attrs)
face. */
static int
-realize_basic_faces (f)
- struct frame *f;
+realize_basic_faces (struct frame *f)
{
int success_p = 0;
int count = SPECPDL_INDEX ();
@@ -5603,8 +5425,7 @@ realize_basic_faces (f)
that are not explicitly specified are taken from frame parameters. */
static int
-realize_default_face (f)
- struct frame *f;
+realize_default_face (struct frame *f)
{
struct face_cache *c = FRAME_FACE_CACHE (f);
Lisp_Object lface;
@@ -5698,7 +5519,7 @@ realize_default_face (f)
/* Realize the face; it must be fully-specified now. */
xassert (lface_fully_specified_p (XVECTOR (lface)->contents));
check_lface (lface);
- bcopy (XVECTOR (lface)->contents, attrs, sizeof attrs);
+ memcpy (attrs, XVECTOR (lface)->contents, sizeof attrs);
face = realize_face (c, attrs, DEFAULT_FACE_ID);
#ifdef HAVE_WINDOW_SYSTEM
@@ -5727,10 +5548,7 @@ realize_default_face (f)
have. The default face must have been realized already. */
static void
-realize_named_face (f, symbol, id)
- struct frame *f;
- Lisp_Object symbol;
- int id;
+realize_named_face (struct frame *f, Lisp_Object symbol, int id)
{
struct face_cache *c = FRAME_FACE_CACHE (f);
Lisp_Object lface = lface_from_face_name (f, symbol, 0);
@@ -5766,10 +5584,7 @@ realize_named_face (f, symbol, id)
face. Value is a pointer to the newly created realized face. */
static struct face *
-realize_face (cache, attrs, former_face_id)
- struct face_cache *cache;
- Lisp_Object *attrs;
- int former_face_id;
+realize_face (struct face_cache *cache, Lisp_Object *attrs, int former_face_id)
{
struct face *face;
@@ -5783,6 +5598,7 @@ realize_face (cache, attrs, former_face_id)
struct face *former_face = cache->faces_by_id[former_face_id];
uncache_face (cache, former_face);
free_realized_face (cache->f, former_face);
+ SET_FRAME_GARBAGED (cache->f);
}
if (FRAME_WINDOW_P (cache->f))
@@ -5810,10 +5626,7 @@ realize_face (cache, attrs, former_face_id)
no-font. */
static struct face *
-realize_non_ascii_face (f, font_object, base_face)
- struct frame *f;
- Lisp_Object font_object;
- struct face *base_face;
+realize_non_ascii_face (struct frame *f, Lisp_Object font_object, struct face *base_face)
{
struct face_cache *cache = FRAME_FACE_CACHE (f);
struct face *face;
@@ -5847,9 +5660,7 @@ realize_non_ascii_face (f, font_object, base_face)
created realized face. */
static struct face *
-realize_x_face (cache, attrs)
- struct face_cache *cache;
- Lisp_Object *attrs;
+realize_x_face (struct face_cache *cache, Lisp_Object *attrs)
{
struct face *face = NULL;
#ifdef HAVE_WINDOW_SYSTEM
@@ -6056,11 +5867,7 @@ realize_x_face (cache, attrs)
default foreground/background colors. */
static void
-map_tty_color (f, face, idx, defaulted)
- struct frame *f;
- struct face *face;
- enum lface_attribute_index idx;
- int *defaulted;
+map_tty_color (struct frame *f, struct face *face, enum lface_attribute_index idx, int *defaulted)
{
Lisp_Object frame, color, def;
int foreground_p = idx == LFACE_FOREGROUND_INDEX;
@@ -6137,9 +5944,7 @@ map_tty_color (f, face, idx, defaulted)
Value is a pointer to the newly created realized face. */
static struct face *
-realize_tty_face (cache, attrs)
- struct face_cache *cache;
- Lisp_Object *attrs;
+realize_tty_face (struct face_cache *cache, Lisp_Object *attrs)
{
struct face *face;
int weight, slant;
@@ -6202,8 +6007,7 @@ This affects bold faces on TTYs whose foreground is the default background
color of the display and whose background is the default foreground color.
For such faces, the bold face attribute is ignored if this variable
is non-nil. */)
- (suppress)
- Lisp_Object suppress;
+ (Lisp_Object suppress)
{
tty_suppress_bold_inverse_default_colors_p = !NILP (suppress);
++face_change_count;
@@ -6220,10 +6024,7 @@ is non-nil. */)
property PROP on frame F in current_buffer. */
int
-compute_char_face (f, ch, prop)
- struct frame *f;
- int ch;
- Lisp_Object prop;
+compute_char_face (struct frame *f, int ch, Lisp_Object prop)
{
int face_id;
@@ -6239,7 +6040,7 @@ compute_char_face (f, ch, prop)
{
Lisp_Object attrs[LFACE_VECTOR_SIZE];
struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
- bcopy (default_face->lface, attrs, sizeof attrs);
+ memcpy (attrs, default_face->lface, sizeof attrs);
merge_face_ref (f, prop, attrs, 1, 0);
face_id = lookup_face (f, attrs);
}
@@ -6266,15 +6067,10 @@ compute_char_face (f, ch, prop)
The face returned is suitable for displaying ASCII characters. */
int
-face_at_buffer_position (w, pos, region_beg, region_end,
- endptr, limit, mouse, base_face_id)
- struct window *w;
- EMACS_INT pos;
- EMACS_INT region_beg, region_end;
- EMACS_INT *endptr;
- EMACS_INT limit;
- int mouse;
- int base_face_id;
+face_at_buffer_position (struct window *w, EMACS_INT pos,
+ EMACS_INT region_beg, EMACS_INT region_end,
+ EMACS_INT *endptr, EMACS_INT limit,
+ int mouse, int base_face_id)
{
struct frame *f = XFRAME (w->frame);
Lisp_Object attrs[LFACE_VECTOR_SIZE];
@@ -6328,7 +6124,7 @@ face_at_buffer_position (w, pos, region_beg, region_end,
return default_face->id;
/* Begin with attributes from the default face. */
- bcopy (default_face->lface, attrs, sizeof attrs);
+ memcpy (attrs, default_face->lface, sizeof attrs);
/* Merge in attributes specified via text properties. */
if (!NILP (prop))
@@ -6374,15 +6170,10 @@ face_at_buffer_position (w, pos, region_beg, region_end,
simply disregards the `face' properties of all overlays. */
int
-face_for_overlay_string (w, pos, region_beg, region_end,
- endptr, limit, mouse, overlay)
- struct window *w;
- EMACS_INT pos;
- EMACS_INT region_beg, region_end;
- EMACS_INT *endptr;
- EMACS_INT limit;
- int mouse;
- Lisp_Object overlay;
+face_for_overlay_string (struct window *w, EMACS_INT pos,
+ EMACS_INT region_beg, EMACS_INT region_end,
+ EMACS_INT *endptr, EMACS_INT limit,
+ int mouse, Lisp_Object overlay)
{
struct frame *f = XFRAME (w->frame);
Lisp_Object attrs[LFACE_VECTOR_SIZE];
@@ -6422,7 +6213,7 @@ face_for_overlay_string (w, pos, region_beg, region_end,
return DEFAULT_FACE_ID;
/* Begin with attributes from the default face. */
- bcopy (default_face->lface, attrs, sizeof attrs);
+ memcpy (attrs, default_face->lface, sizeof attrs);
/* Merge in attributes specified via text properties. */
if (!NILP (prop))
@@ -6467,15 +6258,11 @@ face_for_overlay_string (w, pos, region_beg, region_end,
for displaying ASCII characters. */
int
-face_at_string_position (w, string, pos, bufpos, region_beg,
- region_end, endptr, base_face_id, mouse_p)
- struct window *w;
- Lisp_Object string;
- EMACS_INT pos, bufpos;
- EMACS_INT region_beg, region_end;
- EMACS_INT *endptr;
- enum face_id base_face_id;
- int mouse_p;
+face_at_string_position (struct window *w, Lisp_Object string,
+ EMACS_INT pos, EMACS_INT bufpos,
+ EMACS_INT region_beg, EMACS_INT region_end,
+ EMACS_INT *endptr, enum face_id base_face_id,
+ int mouse_p)
{
Lisp_Object prop, position, end, limit;
struct frame *f = XFRAME (WINDOW_FRAME (w));
@@ -6523,7 +6310,7 @@ face_at_string_position (w, string, pos, bufpos, region_beg,
return base_face->id;
/* Begin with attributes from the base face. */
- bcopy (base_face->lface, attrs, sizeof attrs);
+ memcpy (attrs, base_face->lface, sizeof attrs);
/* Merge in attributes specified via text properties. */
if (!NILP (prop))
@@ -6557,10 +6344,7 @@ face_at_string_position (w, string, pos, bufpos, region_beg,
*/
int
-merge_faces (f, face_name, face_id, base_face_id)
- struct frame *f;
- Lisp_Object face_name;
- int face_id, base_face_id;
+merge_faces (struct frame *f, Lisp_Object face_name, int face_id, int base_face_id)
{
Lisp_Object attrs[LFACE_VECTOR_SIZE];
struct face *base_face;
@@ -6581,7 +6365,7 @@ merge_faces (f, face_name, face_id, base_face_id)
}
/* Begin with attributes from the base face. */
- bcopy (base_face->lface, attrs, sizeof attrs);
+ memcpy (attrs, base_face->lface, sizeof attrs);
if (!NILP (face_name))
{
@@ -6614,8 +6398,7 @@ DEFUN ("x-load-color-file", Fx_load_color_file,
The file should define one named RGB color per line like so:
R G B name
where R,G,B are numbers between 0 and 255 and name is an arbitrary string. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
FILE *fp;
Lisp_Object cmap = Qnil;
@@ -6697,8 +6480,7 @@ dump_realized_face (face)
DEFUN ("dump-face", Fdump_face, Sdump_face, 0, 1, 0, doc: /* */)
- (n)
- Lisp_Object n;
+ (Lisp_Object n)
{
if (NILP (n))
{
@@ -6732,7 +6514,7 @@ DEFUN ("dump-face", Fdump_face, Sdump_face, 0, 1, 0, doc: /* */)
DEFUN ("show-face-resources", Fshow_face_resources, Sshow_face_resources,
0, 0, 0, doc: /* */)
- ()
+ (void)
{
fprintf (stderr, "number of colors = %d\n", ncolors_allocated);
fprintf (stderr, "number of pixmaps = %d\n", npixmaps_allocated);
@@ -6749,7 +6531,7 @@ DEFUN ("show-face-resources", Fshow_face_resources, Sshow_face_resources,
***********************************************************************/
void
-syms_of_xfaces ()
+syms_of_xfaces (void)
{
Qface = intern_c_string ("face");
staticpro (&Qface);
@@ -6988,10 +6770,10 @@ Each element is of the form:
(FACE REPLACEMENT...),
which causes display of the face FACE to use REPLACEMENT... instead.
-REPLACEMENT... is interpreted the same way the value of a `face' text
-property is: it may be (1) A face name, (2) A list of face names, (3) A
-property-list of face attribute/value pairs, or (4) A list of face names
-intermixed with lists containing face attribute/value pairs.
+REPLACEMENT... is interpreted the same way as the value of a `face'
+text property: it may be (1) A face name, (2) A list of face names,
+(3) A property-list of face attribute/value pairs, or (4) A list of
+face names or lists containing face attribute/value pairs.
Multiple entries in REPLACEMENT... are merged together to form the final
result, with faces or attributes earlier in the list taking precedence
@@ -7015,7 +6797,11 @@ face definitions. For instance, the mode my-mode could define a face
`my-mode-default', and then in the mode setup function, do:
(set (make-local-variable 'face-remapping-alist)
- '((default my-mode-default)))). */);
+ '((default my-mode-default)))).
+
+Because Emacs normally only redraws screen areas when the underlying
+buffer contents change, you may need to call `redraw-display' after
+changing this variable for it to take effect. */);
Vface_remapping_alist = Qnil;
DEFVAR_LISP ("face-font-rescale-alist", &Vface_font_rescale_alist,
diff --git a/src/xfns.c b/src/xfns.c
index d19914e8dec..ee020371683 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -204,6 +204,9 @@ extern Lisp_Object Vsystem_name;
/* The below are defined in frame.c. */
+extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
+extern Lisp_Object Qtooltip;
+
#if GLYPH_DEBUG
int image_cache_refcount, dpyinfo_refcount;
#endif
@@ -216,7 +219,7 @@ char *x_last_font_name;
/* Error if we are not connected to X. */
void
-check_x ()
+check_x (void)
{
if (! x_in_use)
error ("X windows are not in use or not initialized");
@@ -226,7 +229,7 @@ check_x ()
You should not call this unless HAVE_MENUS is defined. */
int
-have_menus_p ()
+have_menus_p (void)
{
return x_in_use;
}
@@ -235,8 +238,7 @@ have_menus_p ()
and checking validity for X. */
FRAME_PTR
-check_x_frame (frame)
- Lisp_Object frame;
+check_x_frame (Lisp_Object frame)
{
FRAME_PTR f;
@@ -255,8 +257,7 @@ check_x_frame (frame)
the first X display on the list. */
struct x_display_info *
-check_x_display_info (object)
- Lisp_Object object;
+check_x_display_info (Lisp_Object object)
{
struct x_display_info *dpyinfo = NULL;
@@ -298,9 +299,7 @@ check_x_display_info (object)
/* This function can be called during GC, so use GC_xxx type test macros. */
struct frame *
-x_window_to_frame (dpyinfo, wdesc)
- struct x_display_info *dpyinfo;
- int wdesc;
+x_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
{
Lisp_Object tail, frame;
struct frame *f;
@@ -348,9 +347,7 @@ x_window_to_frame (dpyinfo, wdesc)
windows. */
struct frame *
-x_any_window_to_frame (dpyinfo, wdesc)
- struct x_display_info *dpyinfo;
- int wdesc;
+x_any_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
{
Lisp_Object tail, frame;
struct frame *f, *found;
@@ -401,10 +398,9 @@ x_any_window_to_frame (dpyinfo, wdesc)
/* Likewise, but consider only the menu bar widget. */
struct frame *
-x_menubar_window_to_frame (dpyinfo, wdesc)
- struct x_display_info *dpyinfo;
- int wdesc;
+x_menubar_window_to_frame (struct x_display_info *dpyinfo, XEvent *event)
{
+ Window wdesc = event->xany.window;
Lisp_Object tail, frame;
struct frame *f;
struct x_output *x;
@@ -420,21 +416,11 @@ x_menubar_window_to_frame (dpyinfo, wdesc)
if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
continue;
x = f->output_data.x;
- /* Match if the window is this frame's menubar. */
#ifdef USE_GTK
- if (x->menubar_widget)
- {
- GtkWidget *gwdesc = xg_win_to_widget (dpyinfo->display, wdesc);
-
- /* This gives false positives, but the rectangle check in xterm.c
- where this is called takes care of that. */
- if (gwdesc != 0
- && (gwdesc == x->menubar_widget
- || gtk_widget_is_ancestor (x->menubar_widget, gwdesc)
- || gtk_widget_is_ancestor (gwdesc, x->menubar_widget)))
- return f;
- }
+ if (x->menubar_widget && xg_event_is_for_menubar (f, event))
+ return f;
#else
+ /* Match if the window is this frame's menubar. */
if (x->menubar_widget
&& lw_window_is_in_menubar (wdesc, x->menubar_widget))
return f;
@@ -447,9 +433,7 @@ x_menubar_window_to_frame (dpyinfo, wdesc)
If WDESC is some other (smaller) window, we return 0. */
struct frame *
-x_top_window_to_frame (dpyinfo, wdesc)
- struct x_display_info *dpyinfo;
- int wdesc;
+x_top_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
{
Lisp_Object tail, frame;
struct frame *f;
@@ -497,33 +481,33 @@ x_top_window_to_frame (dpyinfo, wdesc)
-static void x_default_font_parameter P_ ((struct frame *, Lisp_Object));
-
-static Lisp_Object unwind_create_frame P_ ((Lisp_Object));
-static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object));
-
-void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
-static void x_set_wait_for_wm P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_mouse_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_cursor_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_border_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_cursor_type P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_icon_type P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_icon_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_explicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_title P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
-void x_set_scroll_bar_foreground P_ ((struct frame *, Lisp_Object,
- Lisp_Object));
-void x_set_scroll_bar_background P_ ((struct frame *, Lisp_Object,
- Lisp_Object));
-static Lisp_Object x_default_scroll_bar_color_parameter P_ ((struct frame *,
- Lisp_Object,
- Lisp_Object,
- char *, char *,
- int));
+static void x_default_font_parameter (struct frame *, Lisp_Object);
+
+static Lisp_Object unwind_create_frame (Lisp_Object);
+static Lisp_Object unwind_create_tip_frame (Lisp_Object);
+
+void x_set_foreground_color (struct frame *, Lisp_Object, Lisp_Object);
+static void x_set_wait_for_wm (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_background_color (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_mouse_color (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_cursor_color (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_border_color (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_cursor_type (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_icon_type (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_icon_name (struct frame *, Lisp_Object, Lisp_Object);
+void x_explicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_title (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
+void x_set_scroll_bar_foreground (struct frame *, Lisp_Object,
+ Lisp_Object);
+void x_set_scroll_bar_background (struct frame *, Lisp_Object,
+ Lisp_Object);
+static Lisp_Object x_default_scroll_bar_color_parameter (struct frame *,
+ Lisp_Object,
+ Lisp_Object,
+ char *, char *,
+ int);
/* Store the screen positions of frame F into XPTR and YPTR.
@@ -531,9 +515,7 @@ static Lisp_Object x_default_scroll_bar_color_parameter P_ ((struct frame *,
not Emacs's own window. */
void
-x_real_positions (f, xptr, yptr)
- FRAME_PTR f;
- int *xptr, *yptr;
+x_real_positions (FRAME_PTR f, int *xptr, int *yptr)
{
int win_x, win_y, outer_x, outer_y;
int real_x = 0, real_y = 0;
@@ -651,9 +633,7 @@ x_real_positions (f, xptr, yptr)
/* Gamma-correct COLOR on frame F. */
void
-gamma_correct (f, color)
- struct frame *f;
- XColor *color;
+gamma_correct (struct frame *f, XColor *color)
{
if (f->gamma)
{
@@ -670,11 +650,7 @@ gamma_correct (f, color)
no color could be allocated. */
int
-x_defined_color (f, color_name, color, alloc_p)
- struct frame *f;
- char *color_name;
- XColor *color;
- int alloc_p;
+x_defined_color (struct frame *f, char *color_name, XColor *color, int alloc_p)
{
int success_p;
Display *dpy = FRAME_X_DISPLAY (f);
@@ -695,10 +671,7 @@ x_defined_color (f, color_name, color, alloc_p)
Signal an error if color can't be allocated. */
int
-x_decode_color (f, color_name, mono_color)
- FRAME_PTR f;
- Lisp_Object color_name;
- int mono_color;
+x_decode_color (FRAME_PTR f, Lisp_Object color_name, int mono_color)
{
XColor cdef;
@@ -732,9 +705,7 @@ x_decode_color (f, color_name, mono_color)
See also the comment of wait_for_wm in struct x_output. */
static void
-x_set_wait_for_wm (f, new_value, old_value)
- struct frame *f;
- Lisp_Object new_value, old_value;
+x_set_wait_for_wm (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
f->output_data.x->wait_for_wm = !NILP (new_value);
}
@@ -745,9 +716,7 @@ x_set_wait_for_wm (f, new_value, old_value)
may be any format that GdkPixbuf knows about, i.e. not just bitmaps. */
int
-xg_set_icon (f, file)
- FRAME_PTR f;
- Lisp_Object file;
+xg_set_icon (FRAME_PTR f, Lisp_Object file)
{
int result = 0;
Lisp_Object found;
@@ -781,9 +750,7 @@ xg_set_icon (f, file)
}
int
-xg_set_icon_from_xpm_data (f, data)
- FRAME_PTR f;
- char **data;
+xg_set_icon_from_xpm_data (FRAME_PTR f, char **data)
{
int result = 0;
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) data);
@@ -807,9 +774,7 @@ xg_set_icon_from_xpm_data (f, data)
in the standard place; do not attempt to change the window. */
void
-x_set_foreground_color (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
struct x_output *x = f->output_data.x;
unsigned long fg, old_fg;
@@ -845,9 +810,7 @@ x_set_foreground_color (f, arg, oldval)
}
void
-x_set_background_color (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
struct x_output *x = f->output_data.x;
unsigned long bg;
@@ -893,8 +856,7 @@ x_set_background_color (f, arg, oldval)
}
static Cursor
-make_invisible_cursor (f)
- struct frame *f;
+make_invisible_cursor (struct frame *f)
{
Display *dpy = FRAME_X_DISPLAY (f);
static char const no_data[] = { 0 };
@@ -922,9 +884,7 @@ make_invisible_cursor (f)
}
void
-x_set_mouse_color (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
struct x_output *x = f->output_data.x;
Display *dpy = FRAME_X_DISPLAY (f);
@@ -1069,9 +1029,7 @@ x_set_mouse_color (f, arg, oldval)
}
void
-x_set_cursor_color (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
unsigned long fore_pixel, pixel;
int fore_pixel_allocated_p = 0, pixel_allocated_p = 0;
@@ -1142,9 +1100,7 @@ x_set_cursor_color (f, arg, oldval)
F has an x-window. */
void
-x_set_border_pixel (f, pix)
- struct frame *f;
- int pix;
+x_set_border_pixel (struct frame *f, int pix)
{
unload_color (f, f->output_data.x->border_pixel);
f->output_data.x->border_pixel = pix;
@@ -1173,9 +1129,7 @@ x_set_border_pixel (f, pix)
and so emacs' border colors may be overridden. */
void
-x_set_border_color (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int pix;
@@ -1187,9 +1141,7 @@ x_set_border_color (f, arg, oldval)
void
-x_set_cursor_type (f, arg, oldval)
- FRAME_PTR f;
- Lisp_Object arg, oldval;
+x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
{
set_frame_cursor_types (f, arg);
@@ -1198,9 +1150,7 @@ x_set_cursor_type (f, arg, oldval)
}
void
-x_set_icon_type (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int result;
@@ -1232,9 +1182,7 @@ x_set_icon_type (f, arg, oldval)
}
void
-x_set_icon_name (f, arg, oldval)
- struct frame *f;
- Lisp_Object arg, oldval;
+x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int result;
@@ -1272,9 +1220,7 @@ x_set_icon_name (f, arg, oldval)
void
-x_set_menu_bar_lines (f, value, oldval)
- struct frame *f;
- Lisp_Object value, oldval;
+x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
int nlines;
#if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
@@ -1364,9 +1310,7 @@ x_set_menu_bar_lines (f, value, oldval)
The frame's height doesn't change. */
void
-x_set_tool_bar_lines (f, value, oldval)
- struct frame *f;
- Lisp_Object value, oldval;
+x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
int delta, nlines, root_height;
Lisp_Object root_window;
@@ -1461,9 +1405,7 @@ x_set_tool_bar_lines (f, value, oldval)
the frame parameter. */
void
-x_set_scroll_bar_foreground (f, value, oldval)
- struct frame *f;
- Lisp_Object value, oldval;
+x_set_scroll_bar_foreground (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
unsigned long pixel;
@@ -1496,9 +1438,7 @@ x_set_scroll_bar_foreground (f, value, oldval)
parameter. */
void
-x_set_scroll_bar_background (f, value, oldval)
- struct frame *f;
- Lisp_Object value, oldval;
+x_set_scroll_bar_background (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
unsigned long pixel;
@@ -1561,11 +1501,7 @@ x_set_scroll_bar_background (f, value, oldval)
the result should be `COMPOUND_TEXT'. */
static unsigned char *
-x_encode_text (string, coding_system, selectionp, text_bytes, stringp, freep)
- Lisp_Object string, coding_system;
- int *text_bytes, *stringp;
- int selectionp;
- int *freep;
+x_encode_text (Lisp_Object string, Lisp_Object coding_system, int selectionp, int *text_bytes, int *stringp, int *freep)
{
int result = string_xstring_p (string);
struct coding_system coding;
@@ -1599,9 +1535,7 @@ x_encode_text (string, coding_system, selectionp, text_bytes, stringp, freep)
icon name to NAME. */
static void
-x_set_name_internal (f, name)
- FRAME_PTR f;
- Lisp_Object name;
+x_set_name_internal (FRAME_PTR f, Lisp_Object name)
{
if (FRAME_X_WINDOW (f))
{
@@ -1611,8 +1545,8 @@ x_set_name_internal (f, name)
int bytes, stringp;
int do_free_icon_value = 0, do_free_text_value = 0;
Lisp_Object coding_system;
-#ifdef USE_GTK
Lisp_Object encoded_name;
+ Lisp_Object encoded_icon_name;
struct gcpro gcpro1;
/* As ENCODE_UTF_8 may cause GC and relocation of string data,
@@ -1620,7 +1554,6 @@ x_set_name_internal (f, name)
GCPRO1 (name);
encoded_name = ENCODE_UTF_8 (name);
UNGCPRO;
-#endif
coding_system = Qcompound_text;
/* Note: Encoding strategy
@@ -1636,7 +1569,12 @@ x_set_name_internal (f, name)
We may also be able to use "UTF8_STRING" in text.encoding
in the future which can encode all Unicode characters.
But, for the moment, there's no way to know that the
- current window manager supports it or not. */
+ current window manager supports it or not.
+
+ Either way, we also set the _NET_WM_NAME and _NET_WM_ICON_NAME
+ properties. Per the EWMH specification, those two properties
+ are always UTF8_STRING. This matches what gtk_window_set_title()
+ does in the USE_GTK case. */
text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp,
&do_free_text_value);
text.encoding = (stringp ? XA_STRING
@@ -1647,6 +1585,7 @@ x_set_name_internal (f, name)
if (!STRINGP (f->icon_name))
{
icon = text;
+ encoded_icon_name = encoded_name;
}
else
{
@@ -1657,6 +1596,8 @@ x_set_name_internal (f, name)
: FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
icon.format = 8;
icon.nitems = bytes;
+
+ encoded_icon_name = ENCODE_UTF_8 (f->icon_name);
}
#ifdef USE_GTK
@@ -1664,9 +1605,21 @@ x_set_name_internal (f, name)
(char *) SDATA (encoded_name));
#else /* not USE_GTK */
XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text);
+ XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
+ FRAME_X_DISPLAY_INFO (f)->Xatom_net_wm_name,
+ FRAME_X_DISPLAY_INFO (f)->Xatom_UTF8_STRING,
+ 8, PropModeReplace,
+ (char *) SDATA (encoded_name),
+ SBYTES (encoded_name));
#endif /* not USE_GTK */
XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &icon);
+ XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
+ FRAME_X_DISPLAY_INFO (f)->Xatom_net_wm_icon_name,
+ FRAME_X_DISPLAY_INFO (f)->Xatom_UTF8_STRING,
+ 8, PropModeReplace,
+ (char *) SDATA (encoded_icon_name),
+ SBYTES (encoded_icon_name));
if (do_free_icon_value)
xfree (icon.value);
@@ -1689,10 +1642,7 @@ x_set_name_internal (f, name)
F->explicit_name is set, ignore the new name; otherwise, set it. */
void
-x_set_name (f, name, explicit)
- struct frame *f;
- Lisp_Object name;
- int explicit;
+x_set_name (struct frame *f, Lisp_Object name, int explicit)
{
/* Make sure that requests from lisp code override requests from
Emacs redisplay code. */
@@ -1739,9 +1689,7 @@ x_set_name (f, name, explicit)
specified a name for the frame; the name will override any set by the
redisplay code. */
void
-x_explicitly_set_name (f, arg, oldval)
- FRAME_PTR f;
- Lisp_Object arg, oldval;
+x_explicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
{
x_set_name (f, arg, 1);
}
@@ -1750,9 +1698,7 @@ x_explicitly_set_name (f, arg, oldval)
name; names set this way will never override names set by the user's
lisp code. */
void
-x_implicitly_set_name (f, arg, oldval)
- FRAME_PTR f;
- Lisp_Object arg, oldval;
+x_implicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
{
x_set_name (f, arg, 0);
}
@@ -1761,9 +1707,7 @@ x_implicitly_set_name (f, arg, oldval)
If NAME is nil, use the frame name as the title. */
void
-x_set_title (f, name, old_name)
- struct frame *f;
- Lisp_Object name, old_name;
+x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
{
/* Don't change the title if it's already NAME. */
if (EQ (name, f->title))
@@ -1782,8 +1726,7 @@ x_set_title (f, name, old_name)
}
void
-x_set_scroll_bar_default_width (f)
- struct frame *f;
+x_set_scroll_bar_default_width (struct frame *f)
{
int wid = FRAME_COLUMN_WIDTH (f);
@@ -1810,14 +1753,10 @@ x_set_scroll_bar_default_width (f)
named NAME. If that is not found either, use the value DEFLT. */
static Lisp_Object
-x_default_scroll_bar_color_parameter (f, alist, prop, xprop, xclass,
- foreground_p)
- struct frame *f;
- Lisp_Object alist;
- Lisp_Object prop;
- char *xprop;
- char *xclass;
- int foreground_p;
+x_default_scroll_bar_color_parameter (struct frame *f,
+ Lisp_Object alist, Lisp_Object prop,
+ char *xprop, char *xclass,
+ int foreground_p)
{
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
Lisp_Object tem;
@@ -1868,9 +1807,7 @@ x_default_scroll_bar_color_parameter (f, alist, prop, xprop, xclass,
for example, but Xt doesn't). */
static void
-hack_wm_protocols (f, widget)
- FRAME_PTR f;
- Widget widget;
+hack_wm_protocols (FRAME_PTR f, Widget widget)
{
Display *dpy = XtDisplay (widget);
Window w = XtWindow (widget);
@@ -1936,8 +1873,8 @@ hack_wm_protocols (f, widget)
#ifdef HAVE_X_I18N
-static XFontSet xic_create_xfontset P_ ((struct frame *));
-static XIMStyle best_xim_style P_ ((XIMStyles *, XIMStyles *));
+static XFontSet xic_create_xfontset (struct frame *);
+static XIMStyle best_xim_style (XIMStyles *, XIMStyles *);
/* Supported XIM styles, ordered by preference. */
@@ -1964,9 +1901,7 @@ char xic_defaut_fontset[] = "-*-*-*-r-normal--14-*-*-*-*-*-*-*";
/* Create an Xt fontset spec from the name of a base font.
If `motif' is True use the Motif syntax. */
char *
-xic_create_fontsetname (base_fontname, motif)
- char *base_fontname;
- Bool motif;
+xic_create_fontsetname (char *base_fontname, int motif)
{
const char *sep = motif ? ";" : ",";
char *fontsetname;
@@ -1976,7 +1911,7 @@ xic_create_fontsetname (base_fontname, motif)
{ /* There is no base font name, use the default. */
int len = strlen (base_fontname) + 2;
fontsetname = xmalloc (len);
- bzero (fontsetname, len);
+ memset (fontsetname, 0, len);
strcpy (fontsetname, base_fontname);
}
else
@@ -1997,7 +1932,7 @@ xic_create_fontsetname (base_fontname, motif)
Use the specified font plus the default. */
int len = strlen (base_fontname) + strlen (xic_defaut_fontset) + 3;
fontsetname = xmalloc (len);
- bzero (fontsetname, len);
+ memset (fontsetname, 0, len);
strcpy (fontsetname, base_fontname);
strcat (fontsetname, sep);
strcat (fontsetname, xic_defaut_fontset);
@@ -2034,7 +1969,7 @@ xic_create_fontsetname (base_fontname, motif)
int diff = (p2 - p3) - 2;
base = alloca (strlen (base_fontname) + 1);
- bcopy (base_fontname, base, p3 - base_fontname);
+ memcpy (base, base_fontname, p3 - base_fontname);
base[p3 - base_fontname] = '*';
base[(p3 - base_fontname) + 1] = '-';
strcpy (base + (p3 - base_fontname) + 2, p2);
@@ -2047,33 +1982,33 @@ xic_create_fontsetname (base_fontname, motif)
/* Build the font spec that matches all charsets. */
len = p - base_fontname + strlen (allcs) + 1;
font_allcs = (char *) alloca (len);
- bzero (font_allcs, len);
- bcopy (base_fontname, font_allcs, p - base_fontname);
+ memset (font_allcs, 0, len);
+ memcpy (font_allcs, base_fontname, p - base_fontname);
strcat (font_allcs, allcs);
/* Build the font spec that matches all families and
add-styles. */
len = p - p1 + strlen (allcs) + strlen (allfamilies) + 1;
font_allfamilies = (char *) alloca (len);
- bzero (font_allfamilies, len);
+ memset (font_allfamilies, 0, len);
strcpy (font_allfamilies, allfamilies);
- bcopy (p1, font_allfamilies + strlen (allfamilies), p - p1);
+ memcpy (font_allfamilies + strlen (allfamilies), p1, p - p1);
strcat (font_allfamilies, allcs);
/* Build the font spec that matches all. */
len = p - p2 + strlen (allcs) + strlen (all) + strlen (allfamilies) + 1;
font_all = (char *) alloca (len);
- bzero (font_all, len);
+ memset (font_all, 0, len);
strcpy (font_all, allfamilies);
strcat (font_all, all);
- bcopy (p2, font_all + strlen (all) + strlen (allfamilies), p - p2);
+ memcpy (font_all + strlen (all) + strlen (allfamilies), p2, p - p2);
strcat (font_all, allcs);
/* Build the actual font set name. */
len = strlen (base_fontname) + strlen (font_allcs)
+ strlen (font_allfamilies) + strlen (font_all) + 5;
fontsetname = xmalloc (len);
- bzero (fontsetname, len);
+ memset (fontsetname, 0, len);
strcpy (fontsetname, base_fontname);
strcat (fontsetname, sep);
strcat (fontsetname, font_allcs);
@@ -2112,8 +2047,7 @@ print_fontset_result (xfs, name, missing_list, missing_count)
#endif
static XFontSet
-xic_create_xfontset (f)
- struct frame *f;
+xic_create_xfontset (struct frame *f)
{
XFontSet xfs = NULL;
struct font *font = FRAME_FONT (f);
@@ -2212,8 +2146,7 @@ xic_create_xfontset (f)
/* Free the X fontset of frame F if it is the last frame using it. */
void
-xic_free_xfontset (f)
- struct frame *f;
+xic_free_xfontset (struct frame *f)
{
Lisp_Object rest, frame;
int shared_p = 0;
@@ -2250,9 +2183,7 @@ xic_free_xfontset (f)
input method XIM. */
static XIMStyle
-best_xim_style (user, xim)
- XIMStyles *user;
- XIMStyles *xim;
+best_xim_style (XIMStyles *user, XIMStyles *xim)
{
int i, j;
@@ -2270,8 +2201,7 @@ best_xim_style (user, xim)
static XIMStyle xic_style;
void
-create_frame_xic (f)
- struct frame *f;
+create_frame_xic (struct frame *f)
{
XIM xim;
XIC xic = NULL;
@@ -2346,8 +2276,7 @@ create_frame_xic (f)
/* Destroy XIC and free XIC fontset of frame F, if any. */
void
-free_frame_xic (f)
- struct frame *f;
+free_frame_xic (struct frame *f)
{
if (FRAME_XIC (f) == NULL)
return;
@@ -2363,9 +2292,7 @@ free_frame_xic (f)
pixel position X/Y. X and Y are relative to window W. */
void
-xic_set_preeditarea (w, x, y)
- struct window *w;
- int x, y;
+xic_set_preeditarea (struct window *w, int x, int y)
{
struct frame *f = XFRAME (w->frame);
XVaNestedList attr;
@@ -2382,8 +2309,7 @@ xic_set_preeditarea (w, x, y)
/* Place status area for XIC in bottom right corner of frame F.. */
void
-xic_set_statusarea (f)
- struct frame *f;
+xic_set_statusarea (struct frame *f)
{
XIC xic = FRAME_XIC (f);
XVaNestedList attr;
@@ -2427,9 +2353,7 @@ xic_set_statusarea (f)
BASE_FONTNAME. Called when a new Emacs fontset is chosen. */
void
-xic_set_xfontset (f, base_fontname)
- struct frame *f;
- char *base_fontname;
+xic_set_xfontset (struct frame *f, char *base_fontname)
{
XVaNestedList attr;
XFontSet xfs;
@@ -2457,10 +2381,7 @@ xic_set_xfontset (f, base_fontname)
/* Create and set up the X widget for frame F. */
static void
-x_window (f, window_prompting, minibuffer_only)
- struct frame *f;
- long window_prompting;
- int minibuffer_only;
+x_window (struct frame *f, long window_prompting, int minibuffer_only)
{
XClassHint class_hints;
XSetWindowAttributes attributes;
@@ -2512,6 +2433,7 @@ x_window (f, window_prompting, minibuffer_only)
XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++;
XtSetArg (al[ac], XtNdepth, FRAME_X_DISPLAY_INFO (f)->n_planes); ac++;
XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++;
+ XtSetArg (al[ac], XtNborderWidth, 0); ac++;
XtSetValues (pane_widget, al, ac);
f->output_data.x->column_widget = pane_widget;
@@ -2527,6 +2449,7 @@ x_window (f, window_prompting, minibuffer_only)
XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++;
XtSetArg (al[ac], XtNdepth, FRAME_X_DISPLAY_INFO (f)->n_planes); ac++;
XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++;
+ XtSetArg (al[ac], XtNborderWidth, 0); ac++;
frame_widget = XtCreateWidget (f->namebuf, emacsFrameClass, pane_widget,
al, ac);
@@ -2704,8 +2627,7 @@ x_window (f, window_prompting, minibuffer_only)
#else /* not USE_X_TOOLKIT */
#ifdef USE_GTK
void
-x_window (f)
- FRAME_PTR f;
+x_window (FRAME_PTR f)
{
if (! xg_create_frame_widgets (f))
error ("Unable to create window");
@@ -2745,9 +2667,7 @@ x_window (f)
/* Create and set up the X window for frame F. */
void
-x_window (f)
- struct frame *f;
-
+x_window (struct frame *f)
{
XClassHint class_hints;
XSetWindowAttributes attributes;
@@ -2852,9 +2772,7 @@ x_window (f)
/* Verify that the icon position args for this window are valid. */
static void
-x_icon_verify (f, parms)
- struct frame *f;
- Lisp_Object parms;
+x_icon_verify (struct frame *f, Lisp_Object parms)
{
Lisp_Object icon_x, icon_y;
@@ -2876,9 +2794,7 @@ x_icon_verify (f, parms)
well. */
static void
-x_icon (f, parms)
- struct frame *f;
- Lisp_Object parms;
+x_icon (struct frame *f, Lisp_Object parms)
{
Lisp_Object icon_x, icon_y;
#if 0
@@ -2924,8 +2840,7 @@ x_icon (f, parms)
mouse cursor and the gray border tile. */
static void
-x_make_gc (f)
- struct frame *f;
+x_make_gc (struct frame *f)
{
XGCValues gc_values;
@@ -2984,8 +2899,7 @@ x_make_gc (f)
/* Free what was allocated in x_make_gc. */
void
-x_free_gcs (f)
- struct frame *f;
+x_free_gcs (struct frame *f)
{
Display *dpy = FRAME_X_DISPLAY (f);
@@ -3024,8 +2938,7 @@ x_free_gcs (f)
constructed. */
static Lisp_Object
-unwind_create_frame (frame)
- Lisp_Object frame;
+unwind_create_frame (Lisp_Object frame)
{
struct frame *f = XFRAME (frame);
@@ -3057,32 +2970,34 @@ unwind_create_frame (frame)
static void
-x_default_font_parameter (f, parms)
- struct frame *f;
- Lisp_Object parms;
+x_default_font_parameter (struct frame *f, Lisp_Object parms)
{
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL,
RES_TYPE_STRING);
- Lisp_Object font;
- int got_from_gconf = 0;
+ Lisp_Object font = Qnil;
if (EQ (font_param, Qunbound))
font_param = Qnil;
if (NILP (font_param))
{
- /* System font takes precedendce over X resources. We must suggest this
+ /* System font should take precedendce over X resources. We suggest this
regardless of font-use-system-font because .emacs may not have been
read yet. */
const char *system_font = xsettings_get_system_font ();
- if (system_font) font_param = make_string (system_font,
- strlen (system_font));
+ if (system_font)
+ {
+ char *name = xstrdup (system_font);
+ font = font_open_by_name (f, name);
+ free (name);
+ }
}
-
- font = !NILP (font_param) ? font_param
- : x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING);
- if (! STRINGP (font))
+ if (NILP (font))
+ font = !NILP (font_param) ? font_param
+ : x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING);
+
+ if (! FONTP (font) && ! STRINGP (font))
{
char *names[]
= {
@@ -3119,10 +3034,8 @@ x_default_font_parameter (f, parms)
x_set_frame_parameters (f, Fcons (Fcons (Qfont_param, font_param), Qnil));
}
- x_default_parameter (f, parms, Qfont, font,
- got_from_gconf ? NULL : "font",
- got_from_gconf ? NULL : "Font",
- RES_TYPE_STRING);
+ /* This call will make X resources override any system font setting. */
+ x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING);
}
@@ -3130,8 +3043,7 @@ DEFUN ("x-wm-set-size-hint", Fx_wm_set_size_hint, Sx_wm_set_size_hint,
0, 1, 0,
doc: /* Send the size hints for frame FRAME to the window manager.
If FRAME is nil, use the selected frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct frame *f;
if (NILP (frame))
@@ -3186,8 +3098,7 @@ then `default-minibuffer-frame' must be a frame whose minibuffer can
be shared by the new frame.
This function is an internal primitive--use `make-frame' instead. */)
- (parms)
- Lisp_Object parms;
+ (Lisp_Object parms)
{
struct frame *f;
Lisp_Object frame, tem;
@@ -3264,7 +3175,7 @@ This function is an internal primitive--use `make-frame' instead. */)
f->output_method = output_x_window;
f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output));
- bzero (f->output_data.x, sizeof (struct x_output));
+ memset (f->output_data.x, 0, sizeof (struct x_output));
f->output_data.x->icon_bitmap = -1;
FRAME_FONTSET (f) = -1;
f->output_data.x->scroll_bar_foreground_pixel = -1;
@@ -3444,10 +3355,18 @@ This function is an internal primitive--use `make-frame' instead. */)
happen. */
init_frame_faces (f);
- x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1),
- "menuBar", "MenuBar", RES_TYPE_BOOLEAN_NUMBER);
- x_default_parameter (f, parms, Qtool_bar_lines, make_number (1),
- "toolBar", "ToolBar", RES_TYPE_NUMBER);
+ /* The X resources controlling the menu-bar and tool-bar are
+ processed specially at startup, and reflected in the mode
+ variables; ignore them here. */
+ x_default_parameter (f, parms, Qmenu_bar_lines,
+ NILP (Vmenu_bar_mode)
+ ? make_number (0) : make_number (1),
+ NULL, NULL, RES_TYPE_NUMBER);
+ x_default_parameter (f, parms, Qtool_bar_lines,
+ NILP (Vtool_bar_mode)
+ ? make_number (0) : make_number (1),
+ NULL, NULL, RES_TYPE_NUMBER);
+
x_default_parameter (f, parms, Qbuffer_predicate, Qnil,
"bufferPredicate", "BufferPredicate",
RES_TYPE_SYMBOL);
@@ -3599,8 +3518,7 @@ This function is an internal primitive--use `make-frame' instead. */)
know about that structure. */
Lisp_Object
-x_get_focus_frame (frame)
- struct frame *frame;
+x_get_focus_frame (struct frame *frame)
{
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (frame);
Lisp_Object xfocus;
@@ -3624,8 +3542,7 @@ x_get_focus_frame (frame)
DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
doc: /* Set the input focus to FRAME.
FRAME nil means use the selected frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
struct frame *f = check_x_frame (frame);
Display *dpy = FRAME_X_DISPLAY (f);
@@ -3644,8 +3561,7 @@ FRAME nil means use the selected frame. */)
DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
doc: /* Internal function called by `color-defined-p', which see. */)
- (color, frame)
- Lisp_Object color, frame;
+ (Lisp_Object color, Lisp_Object frame)
{
XColor foo;
FRAME_PTR f = check_x_frame (frame);
@@ -3660,8 +3576,7 @@ DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
doc: /* Internal function called by `color-values', which see. */)
- (color, frame)
- Lisp_Object color, frame;
+ (Lisp_Object color, Lisp_Object frame)
{
XColor foo;
FRAME_PTR f = check_x_frame (frame);
@@ -3678,8 +3593,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0,
doc: /* Internal function called by `display-color-p', which see. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
@@ -3706,8 +3620,7 @@ Note that color displays do support shades of gray.
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
@@ -3735,8 +3648,7 @@ DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width,
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
@@ -3749,8 +3661,7 @@ DEFUN ("x-display-pixel-height", Fx_display_pixel_height,
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
@@ -3763,8 +3674,7 @@ DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes,
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
@@ -3777,8 +3687,7 @@ DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells,
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
@@ -3802,8 +3711,7 @@ DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
@@ -3817,8 +3725,7 @@ that operating systems cannot be developed and distributed noncommercially.)
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
char *vendor = ServerVendor (dpyinfo->display);
@@ -3836,8 +3743,7 @@ number. See also the function `x-server-vendor'.
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
Display *dpy = dpyinfo->display;
@@ -3852,8 +3758,7 @@ DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
@@ -3865,8 +3770,7 @@ DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1,
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
@@ -3878,8 +3782,7 @@ DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
@@ -3893,8 +3796,7 @@ The value may be `always', `when-mapped', or `not-useful'.
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
Lisp_Object result;
@@ -3930,8 +3832,7 @@ The value is one of the symbols `static-gray', `gray-scale',
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
Lisp_Object result;
@@ -3970,8 +3871,7 @@ DEFUN ("x-display-save-under", Fx_display_save_under,
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
@@ -3982,36 +3882,31 @@ If omitted or nil, that stands for the selected frame's display. */)
}
int
-x_pixel_width (f)
- register struct frame *f;
+x_pixel_width (register struct frame *f)
{
return FRAME_PIXEL_WIDTH (f);
}
int
-x_pixel_height (f)
- register struct frame *f;
+x_pixel_height (register struct frame *f)
{
return FRAME_PIXEL_HEIGHT (f);
}
int
-x_char_width (f)
- register struct frame *f;
+x_char_width (register struct frame *f)
{
return FRAME_COLUMN_WIDTH (f);
}
int
-x_char_height (f)
- register struct frame *f;
+x_char_height (register struct frame *f)
{
return FRAME_LINE_HEIGHT (f);
}
int
-x_screen_planes (f)
- register struct frame *f;
+x_screen_planes (register struct frame *f)
{
return FRAME_X_DISPLAY_INFO (f)->n_planes;
}
@@ -4068,8 +3963,7 @@ XScreenNumberOfScreen (scr)
members of DPYINFO appropriately. Called from x_term_init. */
void
-select_visual (dpyinfo)
- struct x_display_info *dpyinfo;
+select_visual (struct x_display_info *dpyinfo)
{
Display *dpy = dpyinfo->display;
Screen *screen = dpyinfo->screen;
@@ -4091,7 +3985,7 @@ select_visual (dpyinfo)
XVisualInfo vinfo;
strcpy (s, SDATA (value));
- dash = index (s, '-');
+ dash = strchr (s, '-');
if (dash)
{
dpyinfo->n_planes = atoi (dash + 1);
@@ -4142,8 +4036,7 @@ select_visual (dpyinfo)
Open a new connection if necessary. */
struct x_display_info *
-x_display_info_for_name (name)
- Lisp_Object name;
+x_display_info_for_name (Lisp_Object name)
{
Lisp_Object names;
struct x_display_info *dpyinfo;
@@ -4190,8 +4083,7 @@ DISPLAY is the name of the display to connect to.
Optional second arg XRM-STRING is a string of resources in xrdb format.
If the optional third arg MUST-SUCCEED is non-nil,
terminate Emacs if we can't open the connection. */)
- (display, xrm_string, must_succeed)
- Lisp_Object display, xrm_string, must_succeed;
+ (Lisp_Object display, Lisp_Object xrm_string, Lisp_Object must_succeed)
{
unsigned char *xrm_option;
struct x_display_info *dpyinfo;
@@ -4242,8 +4134,7 @@ DEFUN ("x-close-connection", Fx_close_connection,
For TERMINAL, specify a terminal object, a frame or a display name (a
string). If TERMINAL is nil, that stands for the selected frame's
terminal. */)
- (terminal)
- Lisp_Object terminal;
+ (Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
@@ -4257,7 +4148,7 @@ terminal. */)
DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
doc: /* Return the list of display names that Emacs has connections to. */)
- ()
+ (void)
{
Lisp_Object tail, result;
@@ -4277,8 +4168,7 @@ easier.
The optional second argument TERMINAL specifies which display to act on.
TERMINAL should be a terminal object, a frame or a display name (a string).
If TERMINAL is omitted or nil, that stands for the selected frame's display. */)
- (on, terminal)
- Lisp_Object terminal, on;
+ (Lisp_Object on, Lisp_Object terminal)
{
struct x_display_info *dpyinfo = check_x_display_info (terminal);
@@ -4290,8 +4180,7 @@ If TERMINAL is omitted or nil, that stands for the selected frame's display. */
/* Wait for responses to all X commands issued so far for frame F. */
void
-x_sync (f)
- FRAME_PTR f;
+x_sync (FRAME_PTR f)
{
BLOCK_INPUT;
XSync (FRAME_X_DISPLAY (f), False);
@@ -4322,8 +4211,7 @@ If OUTER_P is non-nil, the property is changed for the outer X window of
FRAME. Default is to change on the edit X window.
Value is VALUE. */)
- (prop, value, frame, type, format, outer_p)
- Lisp_Object prop, value, frame, type, format, outer_p;
+ (Lisp_Object prop, Lisp_Object value, Lisp_Object frame, Lisp_Object type, Lisp_Object format, Lisp_Object outer_p)
{
struct frame *f = check_x_frame (frame);
Atom prop_atom;
@@ -4401,8 +4289,7 @@ DEFUN ("x-delete-window-property", Fx_delete_window_property,
Sx_delete_window_property, 1, 2, 0,
doc: /* Remove window property PROP from X window of FRAME.
FRAME nil or omitted means use the selected frame. Value is PROP. */)
- (prop, frame)
- Lisp_Object prop, frame;
+ (Lisp_Object prop, Lisp_Object frame)
{
struct frame *f = check_x_frame (frame);
Atom prop_atom;
@@ -4433,8 +4320,7 @@ If VECTOR_RET_P is non-nil, don't return a string but a vector of values.
Value is nil if FRAME hasn't a property with name PROP or if PROP has
no value of TYPE. */)
- (prop, frame, type, source, delete_p, vector_ret_p)
- Lisp_Object prop, frame, type, source, delete_p, vector_ret_p;
+ (Lisp_Object prop, Lisp_Object frame, Lisp_Object type, Lisp_Object source, Lisp_Object delete_p, Lisp_Object vector_ret_p)
{
struct frame *f = check_x_frame (frame);
Atom prop_atom;
@@ -4502,7 +4388,7 @@ no value of TYPE. */)
elements."
This applies even if long is more than 32 bits, the X library
converts from 32 bit elements received from the X server to long
- and passes the long array to us. Thus, for that case bcopy can not
+ and passes the long array to us. Thus, for that case memcpy can not
be used. We convert to a 32 bit type here, because so much code
assume on that.
@@ -4553,8 +4439,7 @@ no value of TYPE. */)
shown on the frames. */
void
-show_hourglass (timer)
- struct atimer *timer;
+show_hourglass (struct atimer *timer)
{
/* The timer implementation will cancel this timer automatically
after this function has run. Set hourglass_atimer to null
@@ -4618,7 +4503,7 @@ show_hourglass (timer)
shown. */
void
-hide_hourglass ()
+hide_hourglass (void)
{
if (hourglass_shown_p)
{
@@ -4653,10 +4538,10 @@ hide_hourglass ()
Tool tips
***********************************************************************/
-static Lisp_Object x_create_tip_frame P_ ((struct x_display_info *,
- Lisp_Object, Lisp_Object));
-static void compute_tip_xy P_ ((struct frame *, Lisp_Object, Lisp_Object,
- Lisp_Object, int, int, int *, int *));
+static Lisp_Object x_create_tip_frame (struct x_display_info *,
+ Lisp_Object, Lisp_Object);
+static void compute_tip_xy (struct frame *, Lisp_Object, Lisp_Object,
+ Lisp_Object, int, int, int *, int *);
/* The frame of a currently visible tooltip. */
@@ -4679,8 +4564,7 @@ Lisp_Object Vx_max_tooltip_size;
static Lisp_Object
-unwind_create_tip_frame (frame)
- Lisp_Object frame;
+unwind_create_tip_frame (Lisp_Object frame)
{
Lisp_Object deleted;
@@ -4705,9 +4589,7 @@ unwind_create_tip_frame (frame)
when this happens. */
static Lisp_Object
-x_create_tip_frame (dpyinfo, parms, text)
- struct x_display_info *dpyinfo;
- Lisp_Object parms, text;
+x_create_tip_frame (struct x_display_info *dpyinfo, Lisp_Object parms, Lisp_Object text)
{
struct frame *f;
Lisp_Object frame, tem;
@@ -4762,7 +4644,7 @@ x_create_tip_frame (dpyinfo, parms, text)
counts etc. */
f->output_method = output_x_window;
f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output));
- bzero (f->output_data.x, sizeof (struct x_output));
+ memset (f->output_data.x, 0, sizeof (struct x_output));
f->output_data.x->icon_bitmap = -1;
FRAME_FONTSET (f) = -1;
f->output_data.x->scroll_bar_foreground_pixel = -1;
@@ -4946,9 +4828,8 @@ x_create_tip_frame (dpyinfo, parms, text)
change_frame_size (f, height, width, 1, 0, 0);
/* Add `tooltip' frame parameter's default value. */
- if (NILP (Fframe_parameter (frame, intern ("tooltip"))))
- Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt),
- Qnil));
+ if (NILP (Fframe_parameter (frame, Qtooltip)))
+ Fmodify_frame_parameters (frame, Fcons (Fcons (Qtooltip, Qt), Qnil));
/* FIXME - can this be done in a similar way to normal frames?
http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */
@@ -5022,11 +4903,7 @@ x_create_tip_frame (dpyinfo, parms, text)
the display in *ROOT_X, and *ROOT_Y. */
static void
-compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y)
- struct frame *f;
- Lisp_Object parms, dx, dy;
- int width, height;
- int *root_x, *root_y;
+compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx, Lisp_Object dy, int width, int height, int *root_x, int *root_y)
{
Lisp_Object left, top;
int win_x, win_y;
@@ -5103,8 +4980,7 @@ DY added (default is -10).
A tooltip's maximum size is specified by `x-max-tooltip-size'.
Text larger than the specified size is clipped. */)
- (string, frame, parms, timeout, dx, dy)
- Lisp_Object string, frame, parms, timeout, dx, dy;
+ (Lisp_Object string, Lisp_Object frame, Lisp_Object parms, Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy)
{
struct frame *f;
struct window *w;
@@ -5295,7 +5171,7 @@ Text larger than the specified size is clipped. */)
DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0,
doc: /* Hide the current tooltip window, if there is any.
Value is t if tooltip was open, nil otherwise. */)
- ()
+ (void)
{
int count;
Lisp_Object deleted, frame, timer;
@@ -5329,7 +5205,7 @@ Value is t if tooltip was open, nil otherwise. */)
{
struct frame *f = SELECTED_FRAME ();
Widget w = f->output_data.x->menubar_widget;
- extern void xlwmenu_redisplay P_ ((Widget));
+ extern void xlwmenu_redisplay (Widget);
if (!DoesSaveUnders (FRAME_X_DISPLAY_INFO (f)->screen)
&& w != NULL)
@@ -5356,7 +5232,7 @@ DEFUN ("x-uses-old-gtk-dialog", Fx_uses_old_gtk_dialog,
Sx_uses_old_gtk_dialog,
0, 0, 0,
doc: /* Return t if the old Gtk+ file selection dialog is used. */)
- ()
+ (void)
{
#ifdef USE_GTK
extern int use_dialog_box;
@@ -5423,8 +5299,7 @@ DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0,
Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file
selection box, if specified. If MUSTMATCH is non-nil, the returned file
or directory must exist. ONLY-DIR-P is ignored." */)
- (prompt, dir, default_filename, mustmatch, only_dir_p)
- Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p;
+ (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p)
{
int result;
struct frame *f = SELECTED_FRAME ();
@@ -5582,8 +5457,7 @@ or directory must exist. ONLY-DIR-P is ignored." */)
#ifdef USE_GTK
static Lisp_Object
-clean_up_dialog (arg)
- Lisp_Object arg;
+clean_up_dialog (Lisp_Object arg)
{
x_menu_set_in_use (0);
@@ -5596,8 +5470,7 @@ Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file
selection box, if specified. If MUSTMATCH is non-nil, the returned file
or directory must exist. If ONLY-DIR-P is non-nil, the user can only select
directories. */)
- (prompt, dir, default_filename, mustmatch, only_dir_p)
- Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p;
+ (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p)
{
FRAME_PTR f = SELECTED_FRAME ();
char *fn;
@@ -5658,8 +5531,7 @@ DEFUN ("x-select-font", Fx_select_font, Sx_select_font, 0, 2, 0,
Return a GTK-style font string corresponding to the selection.
If FRAME is omitted or nil, it defaults to the selected frame. */)
- (frame, ignored)
- Lisp_Object frame, ignored;
+ (Lisp_Object frame, Lisp_Object ignored)
{
FRAME_PTR f = check_x_frame (frame);
char *name;
@@ -5747,8 +5619,7 @@ FRAME nil means use the selected frame.
Value is t if we know that both keys are present, and are mapped to the
usual X keysyms. Value is `lambda' if we cannot determine if both keys are
present and mapped to the usual X keysyms. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
#ifdef HAVE_XKBGETKEYBOARD
XkbDescPtr kb;
@@ -5809,9 +5680,9 @@ present and mapped to the usual X keysyms. */)
/* The XKB symbolic key names can be seen most easily in
the PS file generated by `xkbprint -label name
$DISPLAY'. */
- if (bcmp ("DELE", kb->names->keys[i].name, 4) == 0)
+ if (memcmp ("DELE", kb->names->keys[i].name, 4) == 0)
delete_keycode = i;
- else if (bcmp ("BKSP", kb->names->keys[i].name, 4) == 0)
+ else if (memcmp ("BKSP", kb->names->keys[i].name, 4) == 0)
backspace_keycode = i;
}
@@ -5879,7 +5750,7 @@ frame_parm_handler x_frame_parm_handlers[] =
};
void
-syms_of_xfns ()
+syms_of_xfns (void)
{
/* This is zero if not using X windows. */
x_in_use = 0;
diff --git a/src/xfont.c b/src/xfont.c
index d8fe40eaa93..b03bb1585d3 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -47,17 +47,15 @@ struct xfont_info
};
/* Prototypes of support functions. */
-extern void x_clear_errors P_ ((Display *));
+extern void x_clear_errors (Display *);
-static XCharStruct *xfont_get_pcm P_ ((XFontStruct *, XChar2b *));
+static XCharStruct *xfont_get_pcm (XFontStruct *, XChar2b *);
/* Get metrics of character CHAR2B in XFONT. Value is null if CHAR2B
is not contained in the font. */
static XCharStruct *
-xfont_get_pcm (xfont, char2b)
- XFontStruct *xfont;
- XChar2b *char2b;
+xfont_get_pcm (XFontStruct *xfont, XChar2b *char2b)
{
/* The result metric information. */
XCharStruct *pcm = NULL;
@@ -119,19 +117,19 @@ xfont_get_pcm (xfont, char2b)
? NULL : pcm);
}
-static Lisp_Object xfont_get_cache P_ ((FRAME_PTR));
-static Lisp_Object xfont_list P_ ((Lisp_Object, Lisp_Object));
-static Lisp_Object xfont_match P_ ((Lisp_Object, Lisp_Object));
-static Lisp_Object xfont_list_family P_ ((Lisp_Object));
-static Lisp_Object xfont_open P_ ((FRAME_PTR, Lisp_Object, int));
-static void xfont_close P_ ((FRAME_PTR, struct font *));
-static int xfont_prepare_face P_ ((FRAME_PTR, struct face *));
-static int xfont_has_char P_ ((Lisp_Object, int));
-static unsigned xfont_encode_char P_ ((struct font *, int));
-static int xfont_text_extents P_ ((struct font *, unsigned *, int,
- struct font_metrics *));
-static int xfont_draw P_ ((struct glyph_string *, int, int, int, int, int));
-static int xfont_check P_ ((FRAME_PTR, struct font *));
+static Lisp_Object xfont_get_cache (FRAME_PTR);
+static Lisp_Object xfont_list (Lisp_Object, Lisp_Object);
+static Lisp_Object xfont_match (Lisp_Object, Lisp_Object);
+static Lisp_Object xfont_list_family (Lisp_Object);
+static Lisp_Object xfont_open (FRAME_PTR, Lisp_Object, int);
+static void xfont_close (FRAME_PTR, struct font *);
+static int xfont_prepare_face (FRAME_PTR, struct face *);
+static int xfont_has_char (Lisp_Object, int);
+static unsigned xfont_encode_char (struct font *, int);
+static int xfont_text_extents (struct font *, unsigned *, int,
+ struct font_metrics *);
+static int xfont_draw (struct glyph_string *, int, int, int, int, int);
+static int xfont_check (FRAME_PTR, struct font *);
struct font_driver xfont_driver =
{
@@ -159,8 +157,7 @@ struct font_driver xfont_driver =
extern Lisp_Object QCname;
static Lisp_Object
-xfont_get_cache (f)
- FRAME_PTR f;
+xfont_get_cache (FRAME_PTR f)
{
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -497,8 +494,7 @@ xfont_list_pattern (Display *display, char *pattern,
}
static Lisp_Object
-xfont_list (frame, spec)
- Lisp_Object frame, spec;
+xfont_list (Lisp_Object frame, Lisp_Object spec)
{
FRAME_PTR f = XFRAME (frame);
Display *display = FRAME_X_DISPLAY_INFO (f)->display;
@@ -566,7 +562,7 @@ xfont_list (frame, spec)
val = assq_no_quit (QCname, AREF (spec, FONT_EXTRA_INDEX));
if (CONSP (val) && STRINGP (XCDR (val)) && SBYTES (XCDR (val)) < 512)
{
- bcopy (SDATA (XCDR (val)), name, SBYTES (XCDR (val)) + 1);
+ memcpy (name, SDATA (XCDR (val)), SBYTES (XCDR (val)) + 1);
if (xfont_encode_coding_xlfd (name) < 0)
return Qnil;
list = xfont_list_pattern (display, name, registry, script);
@@ -577,8 +573,7 @@ xfont_list (frame, spec)
}
static Lisp_Object
-xfont_match (frame, spec)
- Lisp_Object frame, spec;
+xfont_match (Lisp_Object frame, Lisp_Object spec)
{
FRAME_PTR f = XFRAME (frame);
Display *display = FRAME_X_DISPLAY_INFO (f)->display;
@@ -595,7 +590,7 @@ xfont_match (frame, spec)
return Qnil;
}
else if (SBYTES (XCDR (val)) < 512)
- bcopy (SDATA (XCDR (val)), name, SBYTES (XCDR (val)) + 1);
+ memcpy (name, SDATA (XCDR (val)), SBYTES (XCDR (val)) + 1);
else
return Qnil;
if (xfont_encode_coding_xlfd (name) < 0)
@@ -636,8 +631,7 @@ xfont_match (frame, spec)
}
static Lisp_Object
-xfont_list_family (frame)
- Lisp_Object frame;
+xfont_list_family (Lisp_Object frame)
{
FRAME_PTR f = XFRAME (frame);
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -675,7 +669,7 @@ xfont_list_family (frame)
if (! *p1 || p1 == p0)
continue;
if (last_len == p1 - p0
- && bcmp (last_family, p0, last_len) == 0)
+ && memcmp (last_family, p0, last_len) == 0)
continue;
last_len = p1 - p0;
last_family = p0;
@@ -696,10 +690,7 @@ xfont_list_family (frame)
extern Lisp_Object QCavgwidth;
static Lisp_Object
-xfont_open (f, entity, pixel_size)
- FRAME_PTR f;
- Lisp_Object entity;
- int pixel_size;
+xfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
{
Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
Display *display = dpyinfo->display;
@@ -911,9 +902,7 @@ xfont_open (f, entity, pixel_size)
}
static void
-xfont_close (f, font)
- FRAME_PTR f;
- struct font *font;
+xfont_close (FRAME_PTR f, struct font *font)
{
BLOCK_INPUT;
XFreeFont (FRAME_X_DISPLAY (f), ((struct xfont_info *) font)->xfont);
@@ -921,9 +910,7 @@ xfont_close (f, font)
}
static int
-xfont_prepare_face (f, face)
- FRAME_PTR f;
- struct face *face;
+xfont_prepare_face (FRAME_PTR f, struct face *face)
{
BLOCK_INPUT;
XSetFont (FRAME_X_DISPLAY (f), face->gc,
@@ -934,9 +921,7 @@ xfont_prepare_face (f, face)
}
static int
-xfont_has_char (font, c)
- Lisp_Object font;
- int c;
+xfont_has_char (Lisp_Object font, int c)
{
Lisp_Object registry = AREF (font, FONT_REGISTRY_INDEX);
struct charset *encoding;
@@ -965,9 +950,7 @@ xfont_has_char (font, c)
}
static unsigned
-xfont_encode_char (font, c)
- struct font *font;
- int c;
+xfont_encode_char (struct font *font, int c)
{
XFontStruct *xfont = ((struct xfont_info *) font)->xfont;
struct charset *charset;
@@ -990,18 +973,14 @@ xfont_encode_char (font, c)
}
static int
-xfont_text_extents (font, code, nglyphs, metrics)
- struct font *font;
- unsigned *code;
- int nglyphs;
- struct font_metrics *metrics;
+xfont_text_extents (struct font *font, unsigned int *code, int nglyphs, struct font_metrics *metrics)
{
XFontStruct *xfont = ((struct xfont_info *) font)->xfont;
int width = 0;
int i, first, x;
if (metrics)
- bzero (metrics, sizeof (struct font_metrics));
+ memset (metrics, 0, sizeof (struct font_metrics));
for (i = 0, x = 0, first = 1; i < nglyphs; i++)
{
XChar2b char2b;
@@ -1046,9 +1025,7 @@ xfont_text_extents (font, code, nglyphs, metrics)
}
static int
-xfont_draw (s, from, to, x, y, with_background)
- struct glyph_string *s;
- int from, to, x, y, with_background;
+xfont_draw (struct glyph_string *s, int from, int to, int x, int y, int with_background)
{
XFontStruct *xfont = ((struct xfont_info *) s->font)->xfont;
int len = to - from;
@@ -1123,9 +1100,7 @@ xfont_draw (s, from, to, x, y, with_background)
}
static int
-xfont_check (f, font)
- FRAME_PTR f;
- struct font *font;
+xfont_check (FRAME_PTR f, struct font *font)
{
struct xfont_info *xfont = (struct xfont_info *) font;
@@ -1134,7 +1109,7 @@ xfont_check (f, font)
void
-syms_of_xfont ()
+syms_of_xfont (void)
{
staticpro (&xfont_scripts_cache);
{ /* Here we rely on the fact that syms_of_xfont (via syms_of_font)
diff --git a/src/xftfont.c b/src/xftfont.c
index 5d4581be4e9..68dd0af762f 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -70,9 +70,9 @@ struct xftface_info
XftColor xft_bg; /* color for face->background */
};
-static void xftfont_get_colors P_ ((FRAME_PTR, struct face *, GC gc,
- struct xftface_info *,
- XftColor *fg, XftColor *bg));
+static void xftfont_get_colors (FRAME_PTR, struct face *, GC gc,
+ struct xftface_info *,
+ XftColor *fg, XftColor *bg);
/* Setup foreground and background colors of GC into FG and BG. If
@@ -80,12 +80,7 @@ static void xftfont_get_colors P_ ((FRAME_PTR, struct face *, GC gc,
may be NULL. */
static void
-xftfont_get_colors (f, face, gc, xftface_info, fg, bg)
- FRAME_PTR f;
- struct face *face;
- GC gc;
- struct xftface_info *xftface_info;
- XftColor *fg, *bg;
+xftfont_get_colors (FRAME_PTR f, struct face *face, GC gc, struct xftface_info *xftface_info, XftColor *fg, XftColor *bg)
{
if (xftface_info && face->gc == gc)
{
@@ -141,25 +136,23 @@ xftfont_get_colors (f, face, gc, xftface_info, fg, bg)
}
-static Lisp_Object xftfont_list P_ ((Lisp_Object, Lisp_Object));
-static Lisp_Object xftfont_match P_ ((Lisp_Object, Lisp_Object));
-static Lisp_Object xftfont_open P_ ((FRAME_PTR, Lisp_Object, int));
-static void xftfont_close P_ ((FRAME_PTR, struct font *));
-static int xftfont_prepare_face P_ ((FRAME_PTR, struct face *));
-static void xftfont_done_face P_ ((FRAME_PTR, struct face *));
-static int xftfont_has_char P_ ((Lisp_Object, int));
-static unsigned xftfont_encode_char P_ ((struct font *, int));
-static int xftfont_text_extents P_ ((struct font *, unsigned *, int,
- struct font_metrics *));
-static int xftfont_draw P_ ((struct glyph_string *, int, int, int, int, int));
-static int xftfont_end_for_frame P_ ((FRAME_PTR f));
+static Lisp_Object xftfont_list (Lisp_Object, Lisp_Object);
+static Lisp_Object xftfont_match (Lisp_Object, Lisp_Object);
+static Lisp_Object xftfont_open (FRAME_PTR, Lisp_Object, int);
+static void xftfont_close (FRAME_PTR, struct font *);
+static int xftfont_prepare_face (FRAME_PTR, struct face *);
+static void xftfont_done_face (FRAME_PTR, struct face *);
+static int xftfont_has_char (Lisp_Object, int);
+static unsigned xftfont_encode_char (struct font *, int);
+static int xftfont_text_extents (struct font *, unsigned *, int,
+ struct font_metrics *);
+static int xftfont_draw (struct glyph_string *, int, int, int, int, int);
+static int xftfont_end_for_frame (FRAME_PTR f);
struct font_driver xftfont_driver;
static Lisp_Object
-xftfont_list (frame, spec)
- Lisp_Object frame;
- Lisp_Object spec;
+xftfont_list (Lisp_Object frame, Lisp_Object spec)
{
Lisp_Object list = ftfont_driver.list (frame, spec), tail;
@@ -169,9 +162,7 @@ xftfont_list (frame, spec)
}
static Lisp_Object
-xftfont_match (frame, spec)
- Lisp_Object frame;
- Lisp_Object spec;
+xftfont_match (Lisp_Object frame, Lisp_Object spec)
{
Lisp_Object entity = ftfont_driver.match (frame, spec);
@@ -180,15 +171,14 @@ xftfont_match (frame, spec)
return entity;
}
-extern Lisp_Object ftfont_font_format P_ ((FcPattern *, Lisp_Object));
-extern FcCharSet *ftfont_get_fc_charset P_ ((Lisp_Object));
+extern Lisp_Object ftfont_font_format (FcPattern *, Lisp_Object);
+extern FcCharSet *ftfont_get_fc_charset (Lisp_Object);
extern Lisp_Object QCantialias;
static FcChar8 ascii_printable[95];
static void
-xftfont_fix_match (pat, match)
- FcPattern *pat, *match;
+xftfont_fix_match (FcPattern *pat, FcPattern *match)
{
/* These values are not used for matching (except antialias), but for
rendering, so make sure they are carried over to the match.
@@ -238,9 +228,7 @@ xftfont_fix_match (pat, match)
}
static void
-xftfont_add_rendering_parameters (pat, entity)
- FcPattern *pat;
- Lisp_Object entity;
+xftfont_add_rendering_parameters (FcPattern *pat, Lisp_Object entity)
{
Lisp_Object tail;
int ival;
@@ -288,10 +276,7 @@ xftfont_add_rendering_parameters (pat, entity)
}
static Lisp_Object
-xftfont_open (f, entity, pixel_size)
- FRAME_PTR f;
- Lisp_Object entity;
- int pixel_size;
+xftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
{
FcResult result;
Display *display = FRAME_X_DISPLAY (f);
@@ -429,7 +414,7 @@ xftfont_open (f, entity, pixel_size)
ascii_printable[i] = ' ' + i;
}
BLOCK_INPUT;
- if (spacing != FC_PROPORTIONAL)
+ if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL)
{
font->min_width = font->average_width = font->space_width
= xftfont->max_advance_width;
@@ -510,9 +495,7 @@ xftfont_open (f, entity, pixel_size)
}
static void
-xftfont_close (f, font)
- FRAME_PTR f;
- struct font *font;
+xftfont_close (FRAME_PTR f, struct font *font)
{
struct xftfont_info *xftfont_info = (struct xftfont_info *) font;
@@ -527,9 +510,7 @@ xftfont_close (f, font)
}
static int
-xftfont_prepare_face (f, face)
- FRAME_PTR f;
- struct face *face;
+xftfont_prepare_face (FRAME_PTR f, struct face *face)
{
struct xftface_info *xftface_info;
@@ -552,9 +533,7 @@ xftfont_prepare_face (f, face)
}
static void
-xftfont_done_face (f, face)
- FRAME_PTR f;
- struct face *face;
+xftfont_done_face (FRAME_PTR f, struct face *face)
{
struct xftface_info *xftface_info;
@@ -576,9 +555,7 @@ xftfont_done_face (f, face)
extern Lisp_Object Qja, Qko;
static int
-xftfont_has_char (font, c)
- Lisp_Object font;
- int c;
+xftfont_has_char (Lisp_Object font, int c)
{
struct xftfont_info *xftfont_info;
struct charset *cs = NULL;
@@ -600,9 +577,7 @@ xftfont_has_char (font, c)
}
static unsigned
-xftfont_encode_char (font, c)
- struct font *font;
- int c;
+xftfont_encode_char (struct font *font, int c)
{
struct xftfont_info *xftfont_info = (struct xftfont_info *) font;
unsigned code = XftCharIndex (xftfont_info->display, xftfont_info->xftfont,
@@ -612,11 +587,7 @@ xftfont_encode_char (font, c)
}
static int
-xftfont_text_extents (font, code, nglyphs, metrics)
- struct font *font;
- unsigned *code;
- int nglyphs;
- struct font_metrics *metrics;
+xftfont_text_extents (struct font *font, unsigned int *code, int nglyphs, struct font_metrics *metrics)
{
struct xftfont_info *xftfont_info = (struct xftfont_info *) font;
XGlyphInfo extents;
@@ -637,8 +608,7 @@ xftfont_text_extents (font, code, nglyphs, metrics)
}
static XftDraw *
-xftfont_get_xft_draw (f)
- FRAME_PTR f;
+xftfont_get_xft_draw (FRAME_PTR f)
{
XftDraw *xft_draw = font_get_frame_data (f, &xftfont_driver);
@@ -658,9 +628,7 @@ xftfont_get_xft_draw (f)
}
static int
-xftfont_draw (s, from, to, x, y, with_background)
- struct glyph_string *s;
- int from, to, x, y, with_background;
+xftfont_draw (struct glyph_string *s, int from, int to, int x, int y, int with_background)
{
FRAME_PTR f = s->f;
struct face *face = s->face;
@@ -703,8 +671,7 @@ xftfont_draw (s, from, to, x, y, with_background)
}
static int
-xftfont_end_for_frame (f)
- FRAME_PTR f;
+xftfont_end_for_frame (FRAME_PTR f)
{
XftDraw *xft_draw;
@@ -724,11 +691,7 @@ xftfont_end_for_frame (f)
}
static int
-xftfont_cached_font_ok (f, font_object, entity)
- struct frame *f;
- Lisp_Object font_object;
- Lisp_Object entity;
-
+xftfont_cached_font_ok (struct frame *f, Lisp_Object font_object, Lisp_Object entity)
{
struct xftfont_info *info = (struct xftfont_info *) XFONT_OBJECT (font_object);
FcPattern *oldpat = info->xftfont->pattern;
@@ -771,7 +734,7 @@ xftfont_cached_font_ok (f, font_object, entity)
}
void
-syms_of_xftfont ()
+syms_of_xftfont (void)
{
DEFSYM (Qxft, "xft");
DEFSYM (QChinting, ":hinting");
diff --git a/src/xgselect.c b/src/xgselect.c
index 42fff2d98da..56e14fe6e14 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -29,12 +29,8 @@ static GPollFD *gfds;
static int gfds_size;
int
-xg_select (max_fds, rfds, wfds, efds, timeout)
- int max_fds;
- SELECT_TYPE *rfds;
- SELECT_TYPE *wfds;
- SELECT_TYPE *efds;
- EMACS_TIME *timeout;
+xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
+ EMACS_TIME *timeout)
{
SELECT_TYPE all_rfds, all_wfds;
EMACS_TIME tmo, *tmop = timeout;
@@ -147,7 +143,7 @@ xg_select (max_fds, rfds, wfds, efds, timeout)
#endif /* defined (USE_GTK) || defined (HAVE_GCONF) */
void
-xgselect_initialize ()
+xgselect_initialize (void)
{
#if defined (USE_GTK) || defined (HAVE_GCONF)
gfds_size = 128;
diff --git a/src/xgselect.h b/src/xgselect.h
index bae084f0d5c..f120d8866cf 100644
--- a/src/xgselect.h
+++ b/src/xgselect.h
@@ -24,13 +24,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "systime.h"
#include "sysselect.h"
-extern int xg_select P_ ((int max_fds,
- SELECT_TYPE *rfds,
- SELECT_TYPE *wfds,
- SELECT_TYPE *efds,
- EMACS_TIME *timeout));
+extern int xg_select (int max_fds,
+ SELECT_TYPE *rfds,
+ SELECT_TYPE *wfds,
+ SELECT_TYPE *efds,
+ EMACS_TIME *timeout);
-extern void xgselect_initialize P_ ((void));
+extern void xgselect_initialize (void);
#endif /* XGSELECT_H */
diff --git a/src/xmenu.c b/src/xmenu.c
index 796dd3093e8..2fb39339b98 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -122,22 +122,22 @@ extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
extern Lisp_Object Qmenu_bar_update_hook;
#ifdef USE_X_TOOLKIT
-extern void set_frame_menubar P_ ((FRAME_PTR, int, int));
+extern void set_frame_menubar (FRAME_PTR, int, int);
extern XtAppContext Xt_app_con;
-static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, Lisp_Object,
- char **));
-static void popup_get_selection P_ ((XEvent *, struct x_display_info *,
- LWLIB_ID, int));
+static Lisp_Object xdialog_show (FRAME_PTR, int, Lisp_Object, Lisp_Object,
+ char **);
+static void popup_get_selection (XEvent *, struct x_display_info *,
+ LWLIB_ID, int);
#endif /* USE_X_TOOLKIT */
#ifdef USE_GTK
-extern void set_frame_menubar P_ ((FRAME_PTR, int, int));
-static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, Lisp_Object,
- char **));
+extern void set_frame_menubar (FRAME_PTR, int, int);
+static Lisp_Object xdialog_show (FRAME_PTR, int, Lisp_Object, Lisp_Object,
+ char **);
#endif
-static int update_frame_menubar P_ ((struct frame *));
+static int update_frame_menubar (struct frame *);
/* Flag which when set indicates a dialog or menu has been posted by
Xt on behalf of one of the widget sets. */
@@ -147,26 +147,17 @@ static int next_menubar_widget_id;
/* For NS and NTGUI, these prototypes are defined in keyboard.h. */
#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
-extern widget_value *xmalloc_widget_value P_ ((void));
-extern widget_value *digest_single_submenu P_ ((int, int, int));
+extern widget_value *xmalloc_widget_value (void);
+extern widget_value *digest_single_submenu (int, int, int);
#endif
-/* This is set nonzero after the user activates the menu bar, and set
- to zero again after the menu bars are redisplayed by prepare_menu_bar.
- While it is nonzero, all calls to set_frame_menubar go deep.
-
- I don't understand why this is needed, but it does seem to be
- needed on Motif, according to Marcus Daniels <marcus@sysc.pdx.edu>. */
-
-int pending_menu_activation;
#ifdef USE_X_TOOLKIT
/* Return the frame whose ->output_data.x->id equals ID, or 0 if none. */
static struct frame *
-menubar_id_to_frame (id)
- LWLIB_ID id;
+menubar_id_to_frame (LWLIB_ID id)
{
Lisp_Object tail, frame;
FRAME_PTR f;
@@ -196,10 +187,7 @@ menubar_id_to_frame (id)
the scroll bar or the edit window. Fx_popup_menu needs to be
sure it is the edit window. */
void
-mouse_position_for_popup (f, x, y)
- FRAME_PTR f;
- int *x;
- int *y;
+mouse_position_for_popup (FRAME_PTR f, int *x, int *y)
{
Window root, dummy_window;
int dummy;
@@ -263,8 +251,7 @@ otherwise it is "Question".
If the user gets rid of the dialog box without making a valid choice,
for instance using the window manager, then this produces a quit and
`x-popup-dialog' does not return. */)
- (position, contents, header)
- Lisp_Object position, contents, header;
+ (Lisp_Object position, Lisp_Object contents, Lisp_Object header)
{
FRAME_PTR f = NULL;
Lisp_Object window;
@@ -391,8 +378,7 @@ for instance using the window manager, then this produces a quit and
/* Set menu_items_inuse so no other popup menu or dialog is created. */
void
-x_menu_set_in_use (in_use)
- int in_use;
+x_menu_set_in_use (int in_use)
{
menu_items_inuse = in_use ? Qt : Qnil;
popup_activated_flag = in_use;
@@ -461,11 +447,7 @@ x_menu_wait_for_event (void *data)
with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */
static void
-popup_get_selection (initial_event, dpyinfo, id, do_timers)
- XEvent *initial_event;
- struct x_display_info *dpyinfo;
- LWLIB_ID id;
- int do_timers;
+popup_get_selection (XEvent *initial_event, struct x_display_info *dpyinfo, LWLIB_ID id, int do_timers)
{
XEvent event;
@@ -522,8 +504,7 @@ arrow keys, select a menu entry with the return key or cancel with the
escape key. If FRAME has no menu bar this function does nothing.
If FRAME is nil or not given, use the selected frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
XEvent ev;
FRAME_PTR f = check_x_frame (frame);
@@ -601,8 +582,7 @@ arrow keys, select a menu entry with the return key or cancel with the
escape key. If FRAME has no menu bar this function does nothing.
If FRAME is nil or not given, use the selected frame. */)
- (frame)
- Lisp_Object frame;
+ (Lisp_Object frame)
{
GtkWidget *menubar;
FRAME_PTR f;
@@ -638,9 +618,7 @@ If FRAME is nil or not given, use the selected frame. */)
Used for popup menus and dialogs. */
static void
-popup_widget_loop (do_timers, widget)
- int do_timers;
- GtkWidget *widget;
+popup_widget_loop (int do_timers, GtkWidget *widget)
{
++popup_activated_flag;
@@ -668,8 +646,7 @@ popup_widget_loop (do_timers, widget)
execute Lisp code. */
void
-x_activate_menubar (f)
- FRAME_PTR f;
+x_activate_menubar (FRAME_PTR f)
{
if (! FRAME_X_P (f))
abort ();
@@ -685,18 +662,14 @@ x_activate_menubar (f)
set_frame_menubar (f, 0, 1);
BLOCK_INPUT;
+ popup_activated_flag = 1;
#ifdef USE_GTK
XPutBackEvent (f->output_data.x->display_info->display,
f->output_data.x->saved_menu_event);
- popup_activated_flag = 1;
#else
XtDispatchEvent (f->output_data.x->saved_menu_event);
#endif
UNBLOCK_INPUT;
-#ifdef USE_MOTIF
- if (f->output_data.x->saved_menu_event->type == ButtonRelease)
- pending_menu_activation = 1;
-#endif
/* Ignore this if we get it a second time. */
f->output_data.x->saved_menu_event->type = 0;
@@ -707,10 +680,7 @@ x_activate_menubar (f)
#ifndef USE_GTK
static void
-popup_activate_callback (widget, id, client_data)
- Widget widget;
- LWLIB_ID id;
- XtPointer client_data;
+popup_activate_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
{
popup_activated_flag = 1;
#ifdef USE_X_TOOLKIT
@@ -724,18 +694,13 @@ popup_activate_callback (widget, id, client_data)
#ifdef USE_GTK
static void
-popup_deactivate_callback (widget, client_data)
- GtkWidget *widget;
- gpointer client_data;
+popup_deactivate_callback (GtkWidget *widget, gpointer client_data)
{
popup_activated_flag = 0;
}
#else
static void
-popup_deactivate_callback (widget, id, client_data)
- Widget widget;
- LWLIB_ID id;
- XtPointer client_data;
+popup_deactivate_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
{
popup_activated_flag = 0;
}
@@ -746,10 +711,7 @@ popup_deactivate_callback (widget, id, client_data)
for that widget.
F is the frame if known, or NULL if not known. */
static void
-show_help_event (f, widget, help)
- FRAME_PTR f;
- xt_or_gtk_widget widget;
- Lisp_Object help;
+show_help_event (FRAME_PTR f, xt_or_gtk_widget widget, Lisp_Object help)
{
Lisp_Object frame;
@@ -787,9 +749,7 @@ show_help_event (f, widget, help)
#ifdef USE_GTK
void
-menu_highlight_callback (widget, call_data)
- GtkWidget *widget;
- gpointer call_data;
+menu_highlight_callback (GtkWidget *widget, gpointer call_data)
{
xg_menu_item_cb_data *cb_data;
Lisp_Object help;
@@ -808,10 +768,7 @@ menu_highlight_callback (widget, call_data)
}
#else
void
-menu_highlight_callback (widget, id, call_data)
- Widget widget;
- LWLIB_ID id;
- void *call_data;
+menu_highlight_callback (Widget widget, LWLIB_ID id, void *call_data)
{
struct frame *f;
Lisp_Object help;
@@ -839,9 +796,7 @@ static int xg_crazy_callback_abort;
Figure out what the user chose
and put the appropriate events into the keyboard buffer. */
static void
-menubar_selection_callback (widget, client_data)
- GtkWidget *widget;
- gpointer client_data;
+menubar_selection_callback (GtkWidget *widget, gpointer client_data)
{
xg_menu_item_cb_data *cb_data = (xg_menu_item_cb_data*) client_data;
@@ -884,10 +839,7 @@ menubar_selection_callback (widget, client_data)
Figure out what the user chose
and put the appropriate events into the keyboard buffer. */
static void
-menubar_selection_callback (widget, id, client_data)
- Widget widget;
- LWLIB_ID id;
- XtPointer client_data;
+menubar_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
{
FRAME_PTR f;
@@ -903,8 +855,7 @@ menubar_selection_callback (widget, id, client_data)
changed. Value is non-zero if widgets were updated. */
static int
-update_frame_menubar (f)
- FRAME_PTR f;
+update_frame_menubar (FRAME_PTR f)
{
#ifdef USE_GTK
return xg_update_frame_menubar (f);
@@ -954,8 +905,7 @@ update_frame_menubar (f)
#ifdef USE_LUCID
static void
-apply_systemfont_to_dialog (w)
- Widget w;
+apply_systemfont_to_dialog (Widget w)
{
const char *fn = xsettings_get_system_normal_font ();
if (fn)
@@ -967,8 +917,7 @@ apply_systemfont_to_dialog (w)
}
static void
-apply_systemfont_to_menu (w)
- Widget w;
+apply_systemfont_to_menu (Widget w)
{
const char *fn = xsettings_get_system_normal_font ();
int defflt;
@@ -995,10 +944,7 @@ apply_systemfont_to_menu (w)
it is set the first time this is called, from initialize_frame_menubar. */
void
-set_frame_menubar (f, first_time, deep_p)
- FRAME_PTR f;
- int first_time;
- int deep_p;
+set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
{
xt_or_gtk_widget menubar_widget;
#ifdef USE_X_TOOLKIT
@@ -1025,8 +971,6 @@ set_frame_menubar (f, first_time, deep_p)
if (! menubar_widget)
deep_p = 1;
- else if (pending_menu_activation && !deep_p)
- deep_p = 1;
/* Make the first call for any given frame always go deep. */
else if (!f->output_data.x->saved_menu_event && !deep_p)
{
@@ -1087,8 +1031,8 @@ set_frame_menubar (f, first_time, deep_p)
/* Save the frame's previous menu bar contents data. */
if (previous_menu_items_used)
- bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items,
- previous_menu_items_used * sizeof (Lisp_Object));
+ memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents,
+ previous_menu_items_used * sizeof (Lisp_Object));
/* Fill in menu_items with the current menu bar contents.
This can evaluate Lisp code. */
@@ -1302,11 +1246,17 @@ set_frame_menubar (f, first_time, deep_p)
/* Make menu pop down on C-g. */
XtOverrideTranslations (menubar_widget, override);
+#ifdef USE_LUCID
apply_systemfont_to_menu (menubar_widget);
+#endif
}
{
- int menubar_size
+ int menubar_size;
+ if (f->output_data.x->menubar_widget)
+ XtRealizeWidget (f->output_data.x->menubar_widget);
+
+ menubar_size
= (f->output_data.x->menubar_widget
? (f->output_data.x->menubar_widget->core.height
+ f->output_data.x->menubar_widget->core.border_width)
@@ -1315,7 +1265,7 @@ set_frame_menubar (f, first_time, deep_p)
#if 1 /* Experimentally, we now get the right results
for -geometry -0-0 without this. 24 Aug 96, rms.
Maybe so, but the menu bar size is missing the pixels so the
- WM size hints are off by theses pixel. Jan D, oct 2009. */
+ WM size hints are off by these pixels. Jan D, oct 2009. */
#ifdef USE_LUCID
if (FRAME_EXTERNAL_MENU_BAR (f))
{
@@ -1347,8 +1297,7 @@ set_frame_menubar (f, first_time, deep_p)
is visible. */
void
-initialize_frame_menubar (f)
- FRAME_PTR f;
+initialize_frame_menubar (FRAME_PTR f)
{
/* This function is called before the first chance to redisplay
the frame. It has to be, so the frame will have the right size. */
@@ -1363,8 +1312,7 @@ initialize_frame_menubar (f)
#ifndef USE_GTK
void
-free_frame_menubar (f)
- FRAME_PTR f;
+free_frame_menubar (FRAME_PTR f)
{
Widget menubar_widget;
@@ -1399,15 +1347,15 @@ free_frame_menubar (f)
lw_destroy_all_widgets ((LWLIB_ID) f->output_data.x->id);
f->output_data.x->menubar_widget = NULL;
-#ifdef USE_MOTIF
if (f->output_data.x->widget)
{
+#ifdef USE_MOTIF
XtVaGetValues (f->output_data.x->widget, XtNx, &x1, XtNy, &y1, NULL);
if (x1 == 0 && y1 == 0)
XtVaSetValues (f->output_data.x->widget, XtNx, x0, XtNy, y0, NULL);
- }
#endif
-
+ x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
+ }
UNBLOCK_INPUT;
}
}
@@ -1458,12 +1406,7 @@ struct next_popup_x_y
Here only X and Y are used. */
static void
-menu_position_func (menu, x, y, push_in, user_data)
- GtkMenu *menu;
- gint *x;
- gint *y;
- gboolean *push_in;
- gpointer user_data;
+menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data)
{
struct next_popup_x_y* data = (struct next_popup_x_y*)user_data;
GtkRequisition req;
@@ -1484,9 +1427,7 @@ menu_position_func (menu, x, y, push_in, user_data)
}
static void
-popup_selection_callback (widget, client_data)
- GtkWidget *widget;
- gpointer client_data;
+popup_selection_callback (GtkWidget *widget, gpointer client_data)
{
xg_menu_item_cb_data *cb_data = (xg_menu_item_cb_data*) client_data;
@@ -1495,8 +1436,7 @@ popup_selection_callback (widget, client_data)
}
static Lisp_Object
-pop_down_menu (arg)
- Lisp_Object arg;
+pop_down_menu (Lisp_Object arg)
{
struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
@@ -1511,13 +1451,7 @@ pop_down_menu (arg)
menu pops down.
menu_item_selection will be set to the selection. */
static void
-create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp)
- FRAME_PTR f;
- widget_value *first_wv;
- int x;
- int y;
- int for_click;
- EMACS_UINT timestamp;
+create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y, int for_click, EMACS_UINT timestamp)
{
int i;
GtkWidget *menu;
@@ -1565,7 +1499,7 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp)
record_unwind_protect (pop_down_menu, make_save_value (menu, 0));
- if (GTK_WIDGET_MAPPED (menu))
+ if (gtk_widget_get_mapped (menu))
{
/* Set this to one. popup_widget_loop increases it by one, so it becomes
two. show_help_echo uses this to detect popup menus. */
@@ -1594,10 +1528,7 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp)
LWLIB_ID widget_id_tick;
static void
-popup_selection_callback (widget, id, client_data)
- Widget widget;
- LWLIB_ID id;
- XtPointer client_data;
+popup_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
{
menu_item_selection = (Lisp_Object *) client_data;
}
@@ -1606,8 +1537,7 @@ popup_selection_callback (widget, id, client_data)
as a Lisp object as (HIGHPART . LOWPART). */
static Lisp_Object
-pop_down_menu (arg)
- Lisp_Object arg;
+pop_down_menu (Lisp_Object arg)
{
LWLIB_ID id = (XINT (XCAR (arg)) << 4 * sizeof (LWLIB_ID)
| XINT (XCDR (arg)));
@@ -1624,13 +1554,8 @@ pop_down_menu (arg)
menu pops down.
menu_item_selection will be set to the selection. */
static void
-create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp)
- FRAME_PTR f;
- widget_value *first_wv;
- int x;
- int y;
- int for_click;
- EMACS_UINT timestamp;
+create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv,
+ int x, int y, int for_click, EMACS_UINT timestamp)
{
int i;
Arg av[2];
@@ -1649,7 +1574,9 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp)
popup_deactivate_callback,
menu_highlight_callback);
+#ifdef USE_LUCID
apply_systemfont_to_menu (menu);
+#endif
dummy.type = ButtonPress;
dummy.serial = 0;
@@ -1977,9 +1904,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
#ifdef USE_GTK
static void
-dialog_selection_callback (widget, client_data)
- GtkWidget *widget;
- gpointer client_data;
+dialog_selection_callback (GtkWidget *widget, gpointer client_data)
{
/* The EMACS_INT cast avoids a warning. There's no problem
as long as pointers have enough bits to hold small integers. */
@@ -1993,9 +1918,7 @@ dialog_selection_callback (widget, client_data)
dialog pops down.
menu_item_selection will be set to the selection. */
static void
-create_and_show_dialog (f, first_wv)
- FRAME_PTR f;
- widget_value *first_wv;
+create_and_show_dialog (FRAME_PTR f, widget_value *first_wv)
{
GtkWidget *menu;
@@ -2024,10 +1947,7 @@ create_and_show_dialog (f, first_wv)
#else /* not USE_GTK */
static void
-dialog_selection_callback (widget, id, client_data)
- Widget widget;
- LWLIB_ID id;
- XtPointer client_data;
+dialog_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
{
/* The EMACS_INT cast avoids a warning. There's no problem
as long as pointers have enough bits to hold small integers. */
@@ -2045,9 +1965,7 @@ dialog_selection_callback (widget, id, client_data)
dialog pops down.
menu_item_selection will be set to the selection. */
static void
-create_and_show_dialog (f, first_wv)
- FRAME_PTR f;
- widget_value *first_wv;
+create_and_show_dialog (FRAME_PTR f, widget_value *first_wv)
{
LWLIB_ID dialog_id;
@@ -2055,7 +1973,7 @@ create_and_show_dialog (f, first_wv)
abort();
dialog_id = widget_id_tick++;
-#ifdef HAVE_XFT
+#ifdef USE_LUCID
apply_systemfont_to_dialog (f->output_data.x->widget);
#endif
lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv,
@@ -2092,11 +2010,7 @@ static char * button_names [] = {
"button6", "button7", "button8", "button9", "button10" };
static Lisp_Object
-xdialog_show (f, keymaps, title, header, error_name)
- FRAME_PTR f;
- int keymaps;
- Lisp_Object title, header;
- char **error_name;
+xdialog_show (FRAME_PTR f, int keymaps, Lisp_Object title, Lisp_Object header, char **error_name)
{
int i, nb_buttons=0;
char dialog_name[6];
@@ -2294,9 +2208,7 @@ static struct frame *menu_help_frame;
keyboard events. */
static void
-menu_help_callback (help_string, pane, item)
- char *help_string;
- int pane, item;
+menu_help_callback (char *help_string, int pane, int item)
{
extern Lisp_Object Qmenu_item;
Lisp_Object *first_item;
@@ -2321,8 +2233,7 @@ menu_help_callback (help_string, pane, item)
}
static Lisp_Object
-pop_down_menu (arg)
- Lisp_Object arg;
+pop_down_menu (Lisp_Object arg)
{
struct Lisp_Save_Value *p1 = XSAVE_VALUE (Fcar (arg));
struct Lisp_Save_Value *p2 = XSAVE_VALUE (Fcdr (arg));
@@ -2357,14 +2268,8 @@ pop_down_menu (arg)
Lisp_Object
-xmenu_show (f, x, y, for_click, keymaps, title, error, timestamp)
- FRAME_PTR f;
- int x, y;
- int for_click;
- int keymaps;
- Lisp_Object title;
- char **error;
- EMACS_UINT timestamp;
+xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
+ Lisp_Object title, char **error, EMACS_UINT timestamp)
{
Window root;
XMenu *menu;
@@ -2495,12 +2400,10 @@ xmenu_show (f, x, y, for_click, keymaps, title, error, timestamp)
item_data
= (unsigned char *) alloca (maxwidth
+ SBYTES (descrip) + 1);
- bcopy (SDATA (item_name), item_data,
- SBYTES (item_name));
+ memcpy (item_data, SDATA (item_name), SBYTES (item_name));
for (j = SCHARS (item_name); j < maxwidth; j++)
item_data[j] = ' ';
- bcopy (SDATA (descrip), item_data + j,
- SBYTES (descrip));
+ memcpy (item_data + j, SDATA (descrip), SBYTES (descrip));
item_data[j + SBYTES (descrip)] = 0;
}
else
@@ -2658,7 +2561,7 @@ xmenu_show (f, x, y, for_click, keymaps, title, error, timestamp)
/* Detect if a dialog or menu has been posted. */
int
-popup_activated ()
+popup_activated (void)
{
return popup_activated_flag;
}
@@ -2667,7 +2570,7 @@ popup_activated ()
DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
doc: /* Return t if a menu or popup dialog is active. */)
- ()
+ (void)
{
#ifdef HAVE_MENUS
return (popup_activated ()) ? Qt : Qnil;
@@ -2677,7 +2580,7 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_
}
void
-syms_of_xmenu ()
+syms_of_xmenu (void)
{
Qdebug_on_next_call = intern_c_string ("debug-on-next-call");
staticpro (&Qdebug_on_next_call);
diff --git a/src/xrdb.c b/src/xrdb.c
index bd3474c0466..513768e3cde 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -50,7 +50,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "lisp.h"
-extern char *getenv ();
+extern char *getenv (const char *);
/* This does cause trouble on AIX. I'm going to take the comment at
face value. */
@@ -64,11 +64,11 @@ extern short getuid (); /* If this causes portability problems,
extern struct passwd *getpwuid (uid_t);
extern struct passwd *getpwnam (const char *);
#else
-extern struct passwd *getpwuid ();
-extern struct passwd *getpwnam ();
+extern struct passwd *getpwuid (uid_t);
+extern struct passwd *getpwnam (const char *);
#endif
-extern char *get_system_name ();
+extern char *get_system_name (void);
/* Make sure not to #include anything after these definitions. Let's
not step on anyone's prototypes. */
@@ -82,8 +82,8 @@ extern char *get_system_name ();
#define free xfree
#endif
-char *x_get_string_resource ();
-static int file_p ();
+char *x_get_string_resource (XrmDatabase rdb, char *name, char *class);
+static int file_p (char *filename);
/* X file search path processing. */
@@ -98,9 +98,7 @@ char *x_customization_string;
resource, for later use in search path decoding. If we find no
such resource, return zero. */
char *
-x_get_customization_string (db, name, class)
- XrmDatabase db;
- char *name, *class;
+x_get_customization_string (XrmDatabase db, char *name, char *class)
{
char *full_name
= (char *) alloca (strlen (name) + sizeof ("customization") + 3);
@@ -155,10 +153,7 @@ x_get_customization_string (db, name, class)
Return NULL otherwise. */
static char *
-magic_file_p (string, string_len, class, escaped_suffix, suffix)
- char *string;
- int string_len;
- char *class, *escaped_suffix, *suffix;
+magic_file_p (char *string, int string_len, char *class, char *escaped_suffix, char *suffix)
{
char *lang = getenv ("LANG");
@@ -238,7 +233,7 @@ magic_file_p (string, string_len, class, escaped_suffix, suffix)
path = (char *) realloc (path, path_size);
}
- bcopy (next, path + path_len, next_len);
+ memcpy (path + path_len, next, next_len);
path_len += next_len;
p++;
@@ -264,7 +259,7 @@ magic_file_p (string, string_len, class, escaped_suffix, suffix)
path = (char *) realloc (path, path_size);
}
- bcopy (suffix, path + path_len, suffix_len);
+ memcpy (path + path_len, suffix, suffix_len);
path_len += suffix_len;
}
@@ -281,7 +276,7 @@ magic_file_p (string, string_len, class, escaped_suffix, suffix)
static char *
-gethomedir ()
+gethomedir (void)
{
struct passwd *pw;
char *ptr;
@@ -311,8 +306,7 @@ gethomedir ()
static int
-file_p (filename)
- char *filename;
+file_p (char *filename)
{
struct stat status;
@@ -327,8 +321,7 @@ file_p (filename)
the path name of the one we found otherwise. */
static char *
-search_magic_path (search_path, class, escaped_suffix, suffix)
- char *search_path, *class, *escaped_suffix, *suffix;
+search_magic_path (char *search_path, char *class, char *escaped_suffix, char *suffix)
{
register char *s, *p;
@@ -363,8 +356,7 @@ search_magic_path (search_path, class, escaped_suffix, suffix)
/* Producing databases for individual sources. */
static XrmDatabase
-get_system_app (class)
- char *class;
+get_system_app (char *class)
{
XrmDatabase db = NULL;
char *path;
@@ -384,16 +376,14 @@ get_system_app (class)
static XrmDatabase
-get_fallback (display)
- Display *display;
+get_fallback (Display *display)
{
return NULL;
}
static XrmDatabase
-get_user_app (class)
- char *class;
+get_user_app (char *class)
{
char *path;
char *file = 0;
@@ -428,8 +418,7 @@ get_user_app (class)
static XrmDatabase
-get_user_db (display)
- Display *display;
+get_user_db (Display *display)
{
XrmDatabase db;
char *xdefs;
@@ -470,7 +459,7 @@ get_user_db (display)
}
static XrmDatabase
-get_environ_db ()
+get_environ_db (void)
{
XrmDatabase db;
char *p;
@@ -505,9 +494,7 @@ XrmRepresentation x_rm_string; /* Quark representation */
/* Load X resources based on the display and a possible -xrm option. */
XrmDatabase
-x_load_resources (display, xrm_string, myname, myclass)
- Display *display;
- char *xrm_string, *myname, *myclass;
+x_load_resources (Display *display, char *xrm_string, char *myname, char *myclass)
{
XrmDatabase user_database;
XrmDatabase rdb;
@@ -641,11 +628,7 @@ x_load_resources (display, xrm_string, myname, myclass)
and of type TYPE from database RDB. The value is returned in RET_VALUE. */
int
-x_get_resource (rdb, name, class, expected_type, ret_value)
- XrmDatabase rdb;
- char *name, *class;
- XrmRepresentation expected_type;
- XrmValue *ret_value;
+x_get_resource (XrmDatabase rdb, char *name, char *class, XrmRepresentation expected_type, XrmValue *ret_value)
{
XrmValue value;
XrmName namelist[100];
@@ -661,7 +644,7 @@ x_get_resource (rdb, name, class, expected_type, ret_value)
if (type == x_rm_string)
ret_value->addr = (char *) value.addr;
else
- bcopy (value.addr, ret_value->addr, ret_value->size);
+ memcpy (ret_value->addr, value.addr, ret_value->size);
return value.size;
}
@@ -673,9 +656,7 @@ x_get_resource (rdb, name, class, expected_type, ret_value)
database RDB. */
char *
-x_get_string_resource (rdb, name, class)
- XrmDatabase rdb;
- char *name, *class;
+x_get_string_resource (XrmDatabase rdb, char *name, char *class)
{
XrmValue value;
diff --git a/src/xselect.c b/src/xselect.c
index e2027736855..cd0307344ab 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -45,44 +45,44 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
struct prop_location;
-static Lisp_Object x_atom_to_symbol P_ ((Display *dpy, Atom atom));
-static Atom symbol_to_x_atom P_ ((struct x_display_info *, Display *,
- Lisp_Object));
-static void x_own_selection P_ ((Lisp_Object, Lisp_Object));
-static Lisp_Object x_get_local_selection P_ ((Lisp_Object, Lisp_Object, int));
-static void x_decline_selection_request P_ ((struct input_event *));
-static Lisp_Object x_selection_request_lisp_error P_ ((Lisp_Object));
-static Lisp_Object queue_selection_requests_unwind P_ ((Lisp_Object));
-static Lisp_Object some_frame_on_display P_ ((struct x_display_info *));
-static Lisp_Object x_catch_errors_unwind P_ ((Lisp_Object));
-static void x_reply_selection_request P_ ((struct input_event *, int,
- unsigned char *, int, Atom));
-static int waiting_for_other_props_on_window P_ ((Display *, Window));
-static struct prop_location *expect_property_change P_ ((Display *, Window,
- Atom, int));
-static void unexpect_property_change P_ ((struct prop_location *));
-static Lisp_Object wait_for_property_change_unwind P_ ((Lisp_Object));
-static void wait_for_property_change P_ ((struct prop_location *));
-static Lisp_Object x_get_foreign_selection P_ ((Lisp_Object,
- Lisp_Object,
- Lisp_Object));
-static void x_get_window_property P_ ((Display *, Window, Atom,
- unsigned char **, int *,
- Atom *, int *, unsigned long *, int));
-static void receive_incremental_selection P_ ((Display *, Window, Atom,
- Lisp_Object, unsigned,
- unsigned char **, int *,
- Atom *, int *, unsigned long *));
-static Lisp_Object x_get_window_property_as_lisp_data P_ ((Display *,
- Window, Atom,
- Lisp_Object, Atom));
-static Lisp_Object selection_data_to_lisp_data P_ ((Display *, unsigned char *,
- int, Atom, int));
-static void lisp_data_to_selection_data P_ ((Display *, Lisp_Object,
- unsigned char **, Atom *,
- unsigned *, int *, int *));
-static Lisp_Object clean_local_selection_data P_ ((Lisp_Object));
-static void initialize_cut_buffers P_ ((Display *, Window));
+static Lisp_Object x_atom_to_symbol (Display *dpy, Atom atom);
+static Atom symbol_to_x_atom (struct x_display_info *, Display *,
+ Lisp_Object);
+static void x_own_selection (Lisp_Object, Lisp_Object);
+static Lisp_Object x_get_local_selection (Lisp_Object, Lisp_Object, int);
+static void x_decline_selection_request (struct input_event *);
+static Lisp_Object x_selection_request_lisp_error (Lisp_Object);
+static Lisp_Object queue_selection_requests_unwind (Lisp_Object);
+static Lisp_Object some_frame_on_display (struct x_display_info *);
+static Lisp_Object x_catch_errors_unwind (Lisp_Object);
+static void x_reply_selection_request (struct input_event *, int,
+ unsigned char *, int, Atom);
+static int waiting_for_other_props_on_window (Display *, Window);
+static struct prop_location *expect_property_change (Display *, Window,
+ Atom, int);
+static void unexpect_property_change (struct prop_location *);
+static Lisp_Object wait_for_property_change_unwind (Lisp_Object);
+static void wait_for_property_change (struct prop_location *);
+static Lisp_Object x_get_foreign_selection (Lisp_Object,
+ Lisp_Object,
+ Lisp_Object);
+static void x_get_window_property (Display *, Window, Atom,
+ unsigned char **, int *,
+ Atom *, int *, unsigned long *, int);
+static void receive_incremental_selection (Display *, Window, Atom,
+ Lisp_Object, unsigned,
+ unsigned char **, int *,
+ Atom *, int *, unsigned long *);
+static Lisp_Object x_get_window_property_as_lisp_data (Display *,
+ Window, Atom,
+ Lisp_Object, Atom);
+static Lisp_Object selection_data_to_lisp_data (Display *, unsigned char *,
+ int, Atom, int);
+static void lisp_data_to_selection_data (Display *, Lisp_Object,
+ unsigned char **, Atom *,
+ unsigned *, int *, int *);
+static Lisp_Object clean_local_selection_data (Lisp_Object);
+static void initialize_cut_buffers (Display *, Window);
/* Printing traces to stderr. */
@@ -183,8 +183,7 @@ static int x_queue_selection_requests;
/* Queue up an SELECTION_REQUEST_EVENT *EVENT, to be processed later. */
static void
-x_queue_event (event)
- struct input_event *event;
+x_queue_event (struct input_event *event)
{
struct selection_event_queue *queue_tmp;
@@ -192,7 +191,7 @@ x_queue_event (event)
This only happens for large requests which uses the incremental protocol. */
for (queue_tmp = selection_queue; queue_tmp; queue_tmp = queue_tmp->next)
{
- if (!bcmp (&queue_tmp->event, event, sizeof (*event)))
+ if (!memcmp (&queue_tmp->event, event, sizeof (*event)))
{
TRACE1 ("DECLINE DUP SELECTION EVENT %08lx", (unsigned long)queue_tmp);
x_decline_selection_request (event);
@@ -215,7 +214,7 @@ x_queue_event (event)
/* Start queuing SELECTION_REQUEST_EVENT events. */
static void
-x_start_queuing_selection_requests ()
+x_start_queuing_selection_requests (void)
{
if (x_queue_selection_requests)
abort ();
@@ -227,7 +226,7 @@ x_start_queuing_selection_requests ()
/* Stop queuing SELECTION_REQUEST_EVENT events. */
static void
-x_stop_queuing_selection_requests ()
+x_stop_queuing_selection_requests (void)
{
TRACE1 ("x_stop_queuing_selection_requests %d", x_queue_selection_requests);
--x_queue_selection_requests;
@@ -250,10 +249,7 @@ x_stop_queuing_selection_requests ()
roundtrip whenever possible. */
static Atom
-symbol_to_x_atom (dpyinfo, display, sym)
- struct x_display_info *dpyinfo;
- Display *display;
- Lisp_Object sym;
+symbol_to_x_atom (struct x_display_info *dpyinfo, Display *display, Lisp_Object sym)
{
Atom val;
if (NILP (sym)) return 0;
@@ -297,9 +293,7 @@ symbol_to_x_atom (dpyinfo, display, sym)
and calls to intern whenever possible. */
static Lisp_Object
-x_atom_to_symbol (dpy, atom)
- Display *dpy;
- Atom atom;
+x_atom_to_symbol (Display *dpy, Atom atom)
{
struct x_display_info *dpyinfo;
char *str;
@@ -382,8 +376,7 @@ x_atom_to_symbol (dpy, atom)
our selection. */
static void
-x_own_selection (selection_name, selection_value)
- Lisp_Object selection_name, selection_value;
+x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value)
{
struct frame *sf = SELECTED_FRAME ();
Window selecting_window;
@@ -449,9 +442,7 @@ x_own_selection (selection_name, selection_value)
This calls random Lisp code, and may signal or gc. */
static Lisp_Object
-x_get_local_selection (selection_symbol, target_type, local_request)
- Lisp_Object selection_symbol, target_type;
- int local_request;
+x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type, int local_request)
{
Lisp_Object local_value;
Lisp_Object handler_fn, value, type, check;
@@ -561,8 +552,7 @@ x_get_local_selection (selection_symbol, target_type, local_request)
meaning we were unable to do what they wanted. */
static void
-x_decline_selection_request (event)
- struct input_event *event;
+x_decline_selection_request (struct input_event *event)
{
XSelectionEvent reply;
@@ -597,8 +587,7 @@ static struct x_display_info *selection_request_dpyinfo;
before we throw to top-level or go into the debugger or whatever. */
static Lisp_Object
-x_selection_request_lisp_error (ignore)
- Lisp_Object ignore;
+x_selection_request_lisp_error (Lisp_Object ignore)
{
if (x_selection_current_request != 0
&& selection_request_dpyinfo->display)
@@ -607,8 +596,7 @@ x_selection_request_lisp_error (ignore)
}
static Lisp_Object
-x_catch_errors_unwind (dummy)
- Lisp_Object dummy;
+x_catch_errors_unwind (Lisp_Object dummy)
{
BLOCK_INPUT;
x_uncatch_errors ();
@@ -634,10 +622,10 @@ struct prop_location
struct prop_location *next;
};
-static struct prop_location *expect_property_change ();
-static void wait_for_property_change ();
-static void unexpect_property_change ();
-static int waiting_for_other_props_on_window ();
+static struct prop_location *expect_property_change (Display *display, Window window, Atom property, int state);
+static void wait_for_property_change (struct prop_location *location);
+static void unexpect_property_change (struct prop_location *location);
+static int waiting_for_other_props_on_window (Display *display, Window window);
static int prop_location_identifier;
@@ -648,8 +636,7 @@ static struct prop_location *property_change_reply_object;
static struct prop_location *property_change_wait_list;
static Lisp_Object
-queue_selection_requests_unwind (tem)
- Lisp_Object tem;
+queue_selection_requests_unwind (Lisp_Object tem)
{
x_stop_queuing_selection_requests ();
return Qnil;
@@ -659,8 +646,7 @@ queue_selection_requests_unwind (tem)
Return nil if there is none. */
static Lisp_Object
-some_frame_on_display (dpyinfo)
- struct x_display_info *dpyinfo;
+some_frame_on_display (struct x_display_info *dpyinfo)
{
Lisp_Object list, frame;
@@ -684,11 +670,7 @@ static int x_reply_selection_request_cnt;
#endif /* TRACE_SELECTION */
static void
-x_reply_selection_request (event, format, data, size, type)
- struct input_event *event;
- int format, size;
- unsigned char *data;
- Atom type;
+x_reply_selection_request (struct input_event *event, int format, unsigned char *data, int size, Atom type)
{
XSelectionEvent reply;
Display *display = SELECTION_EVENT_DISPLAY (event);
@@ -881,8 +863,7 @@ x_reply_selection_request (event, format, data, size, type)
This is called from keyboard.c when such an event is found in the queue. */
static void
-x_handle_selection_request (event)
- struct input_event *event;
+x_handle_selection_request (struct input_event *event)
{
struct gcpro gcpro1, gcpro2, gcpro3;
Lisp_Object local_selection_data;
@@ -1002,8 +983,7 @@ x_handle_selection_request (event)
This is called from keyboard.c when such an event is found in the queue. */
static void
-x_handle_selection_clear (event)
- struct input_event *event;
+x_handle_selection_clear (struct input_event *event)
{
Display *display = SELECTION_EVENT_DISPLAY (event);
Atom selection = SELECTION_EVENT_SELECTION (event);
@@ -1085,8 +1065,7 @@ x_handle_selection_clear (event)
}
void
-x_handle_selection_event (event)
- struct input_event *event;
+x_handle_selection_event (struct input_event *event)
{
TRACE0 ("x_handle_selection_event");
@@ -1106,8 +1085,7 @@ x_handle_selection_event (event)
We do this when about to delete a frame. */
void
-x_clear_frame_selections (f)
- FRAME_PTR f;
+x_clear_frame_selections (FRAME_PTR f)
{
Lisp_Object frame;
Lisp_Object rest;
@@ -1168,9 +1146,7 @@ x_clear_frame_selections (f)
are on the list of what we are waiting for. */
static int
-waiting_for_other_props_on_window (display, window)
- Display *display;
- Window window;
+waiting_for_other_props_on_window (Display *display, Window window)
{
struct prop_location *rest = property_change_wait_list;
while (rest)
@@ -1187,11 +1163,7 @@ waiting_for_other_props_on_window (display, window)
this awaited property change. */
static struct prop_location *
-expect_property_change (display, window, property, state)
- Display *display;
- Window window;
- Atom property;
- int state;
+expect_property_change (Display *display, Window window, Atom property, int state)
{
struct prop_location *pl = (struct prop_location *) xmalloc (sizeof *pl);
pl->identifier = ++prop_location_identifier;
@@ -1209,8 +1181,7 @@ expect_property_change (display, window, property, state)
IDENTIFIER is the number that uniquely identifies the entry. */
static void
-unexpect_property_change (location)
- struct prop_location *location;
+unexpect_property_change (struct prop_location *location)
{
struct prop_location *prev = 0, *rest = property_change_wait_list;
while (rest)
@@ -1232,8 +1203,7 @@ unexpect_property_change (location)
/* Remove the property change expectation element for IDENTIFIER. */
static Lisp_Object
-wait_for_property_change_unwind (loc)
- Lisp_Object loc;
+wait_for_property_change_unwind (Lisp_Object loc)
{
struct prop_location *location = XSAVE_VALUE (loc)->pointer;
@@ -1247,8 +1217,7 @@ wait_for_property_change_unwind (loc)
IDENTIFIER should be the value that expect_property_change returned. */
static void
-wait_for_property_change (location)
- struct prop_location *location;
+wait_for_property_change (struct prop_location *location)
{
int secs, usecs;
int count = SPECPDL_INDEX ();
@@ -1286,8 +1255,7 @@ wait_for_property_change (location)
/* Called from XTread_socket in response to a PropertyNotify event. */
void
-x_handle_property_notify (event)
- XPropertyEvent *event;
+x_handle_property_notify (XPropertyEvent *event)
{
struct prop_location *prev = 0, *rest = property_change_wait_list;
@@ -1378,8 +1346,7 @@ static Window reading_selection_window;
Converts this to Lisp data and returns it. */
static Lisp_Object
-x_get_foreign_selection (selection_symbol, target_type, time_stamp)
- Lisp_Object selection_symbol, target_type, time_stamp;
+x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type, Lisp_Object time_stamp)
{
struct frame *sf = SELECTED_FRAME ();
Window requestor_window;
@@ -1486,18 +1453,10 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp)
/* Use xfree, not XFree, to free the data obtained with this function. */
static void
-x_get_window_property (display, window, property, data_ret, bytes_ret,
- actual_type_ret, actual_format_ret, actual_size_ret,
- delete_p)
- Display *display;
- Window window;
- Atom property;
- unsigned char **data_ret;
- int *bytes_ret;
- Atom *actual_type_ret;
- int *actual_format_ret;
- unsigned long *actual_size_ret;
- int delete_p;
+x_get_window_property (Display *display, Window window, Atom property,
+ unsigned char **data_ret, int *bytes_ret,
+ Atom *actual_type_ret, int *actual_format_ret,
+ unsigned long *actual_size_ret, int delete_p)
{
int total_size;
unsigned long bytes_remaining;
@@ -1567,7 +1526,7 @@ x_get_window_property (display, window, property, data_ret, bytes_ret,
elements."
This applies even if long is more than 32 bits, the X library
converts from 32 bit elements received from the X server to long
- and passes the long array to us. Thus, for that case bcopy can not
+ and passes the long array to us. Thus, for that case memcpy can not
be used. We convert to a 32 bit type here, because so much code
assume on that.
@@ -1589,7 +1548,7 @@ x_get_window_property (display, window, property, data_ret, bytes_ret,
else
{
*actual_size_ret *= *actual_format_ret / 8;
- bcopy (tmp_data, (*data_ret) + offset, *actual_size_ret);
+ memcpy ((*data_ret) + offset, tmp_data, *actual_size_ret);
offset += *actual_size_ret;
}
@@ -1605,19 +1564,12 @@ x_get_window_property (display, window, property, data_ret, bytes_ret,
/* Use xfree, not XFree, to free the data obtained with this function. */
static void
-receive_incremental_selection (display, window, property, target_type,
- min_size_bytes, data_ret, size_bytes_ret,
- type_ret, format_ret, size_ret)
- Display *display;
- Window window;
- Atom property;
- Lisp_Object target_type; /* for error messages only */
- unsigned int min_size_bytes;
- unsigned char **data_ret;
- int *size_bytes_ret;
- Atom *type_ret;
- unsigned long *size_ret;
- int *format_ret;
+receive_incremental_selection (Display *display, Window window, Atom property,
+ Lisp_Object target_type,
+ unsigned int min_size_bytes,
+ unsigned char **data_ret, int *size_bytes_ret,
+ Atom *type_ret, int *format_ret,
+ unsigned long *size_ret)
{
int offset = 0;
struct prop_location *wait_object;
@@ -1691,7 +1643,7 @@ receive_incremental_selection (display, window, property, target_type,
*data_ret = (unsigned char *) xrealloc (*data_ret, *size_bytes_ret);
}
- bcopy (tmp_data, (*data_ret) + offset, tmp_size_bytes);
+ memcpy ((*data_ret) + offset, tmp_data, tmp_size_bytes);
offset += tmp_size_bytes;
/* Use xfree, not XFree, because x_get_window_property
@@ -1706,13 +1658,10 @@ receive_incremental_selection (display, window, property, target_type,
TARGET_TYPE and SELECTION_ATOM are used in error message if this fails. */
static Lisp_Object
-x_get_window_property_as_lisp_data (display, window, property, target_type,
- selection_atom)
- Display *display;
- Window window;
- Atom property;
- Lisp_Object target_type; /* for error messages only */
- Atom selection_atom; /* for error messages only */
+x_get_window_property_as_lisp_data (Display *display, Window window,
+ Atom property,
+ Lisp_Object target_type,
+ Atom selection_atom)
{
Atom actual_type;
int actual_format;
@@ -1809,11 +1758,7 @@ x_get_window_property_as_lisp_data (display, window, property, target_type,
static Lisp_Object
-selection_data_to_lisp_data (display, data, size, type, format)
- Display *display;
- unsigned char *data;
- Atom type;
- int size, format;
+selection_data_to_lisp_data (Display *display, unsigned char *data, int size, Atom type, int format)
{
struct x_display_info *dpyinfo = x_display_info_for_display (display);
@@ -1906,16 +1851,10 @@ selection_data_to_lisp_data (display, data, size, type, format)
/* Use xfree, not XFree, to free the data obtained with this function. */
static void
-lisp_data_to_selection_data (display, obj,
- data_ret, type_ret, size_ret,
- format_ret, nofree_ret)
- Display *display;
- Lisp_Object obj;
- unsigned char **data_ret;
- Atom *type_ret;
- unsigned int *size_ret;
- int *format_ret;
- int *nofree_ret;
+lisp_data_to_selection_data (Display *display, Lisp_Object obj,
+ unsigned char **data_ret, Atom *type_ret,
+ unsigned int *size_ret,
+ int *format_ret, int *nofree_ret)
{
Lisp_Object type = Qnil;
struct x_display_info *dpyinfo = x_display_info_for_display (display);
@@ -2071,8 +2010,7 @@ lisp_data_to_selection_data (display, obj,
}
static Lisp_Object
-clean_local_selection_data (obj)
- Lisp_Object obj;
+clean_local_selection_data (Lisp_Object obj)
{
if (CONSP (obj)
&& INTEGERP (XCAR (obj))
@@ -2112,8 +2050,7 @@ clean_local_selection_data (obj)
We store t there if the reply is successful, lambda if not. */
void
-x_handle_selection_notify (event)
- XSelectionEvent *event;
+x_handle_selection_notify (XSelectionEvent *event)
{
if (event->requestor != reading_selection_window)
return;
@@ -2133,8 +2070,7 @@ TYPE is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
\(Those are literal upper-case symbol names, since that's what X expects.)
VALUE is typically a string, or a cons of two markers, but may be
anything that the functions on `selection-converter-alist' know about. */)
- (selection_name, selection_value)
- Lisp_Object selection_name, selection_value;
+ (Lisp_Object selection_name, Lisp_Object selection_value)
{
check_x ();
CHECK_SYMBOL (selection_name);
@@ -2156,8 +2092,7 @@ SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
TYPE is the type of data desired, typically `STRING'.
TIME_STAMP is the time to use in the XConvertSelection call for foreign
selections. If omitted, defaults to the time for the last event. */)
- (selection_symbol, target_type, time_stamp)
- Lisp_Object selection_symbol, target_type, time_stamp;
+ (Lisp_Object selection_symbol, Lisp_Object target_type, Lisp_Object time_stamp)
{
Lisp_Object val = Qnil;
struct gcpro gcpro1, gcpro2;
@@ -2202,9 +2137,7 @@ DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,
Sx_disown_selection_internal, 1, 2, 0,
doc: /* If we own the selection SELECTION, disown it.
Disowning it means there is no such selection. */)
- (selection, time)
- Lisp_Object selection;
- Lisp_Object time;
+ (Lisp_Object selection, Lisp_Object time)
{
Time timestamp;
Atom selection_atom;
@@ -2254,8 +2187,7 @@ Disowning it means there is no such selection. */)
This is used when we kill a buffer. */
void
-x_disown_buffer_selections (buffer)
- Lisp_Object buffer;
+x_disown_buffer_selections (Lisp_Object buffer)
{
Lisp_Object tail;
struct buffer *buf = XBUFFER (buffer);
@@ -2279,8 +2211,7 @@ the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
\(Those are literal upper-case symbol names, since that's what X expects.)
For convenience, the symbol nil is the same as `PRIMARY',
and t is the same as `SECONDARY'. */)
- (selection)
- Lisp_Object selection;
+ (Lisp_Object selection)
{
check_x ();
CHECK_SYMBOL (selection);
@@ -2300,8 +2231,7 @@ the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
\(Those are literal upper-case symbol names, since that's what X expects.)
For convenience, the symbol nil is the same as `PRIMARY',
and t is the same as `SECONDARY'. */)
- (selection)
- Lisp_Object selection;
+ (Lisp_Object selection)
{
Window owner;
Atom atom;
@@ -2332,9 +2262,7 @@ and t is the same as `SECONDARY'. */)
/* Ensure that all 8 cut buffers exist. ICCCM says we gotta... */
static void
-initialize_cut_buffers (display, window)
- Display *display;
- Window window;
+initialize_cut_buffers (Display *display, Window window)
{
unsigned char *data = (unsigned char *) "";
BLOCK_INPUT;
@@ -2365,8 +2293,7 @@ initialize_cut_buffers (display, window)
DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal,
Sx_get_cut_buffer_internal, 1, 1, 0,
doc: /* Returns the value of the named cut buffer (typically CUT_BUFFER0). */)
- (buffer)
- Lisp_Object buffer;
+ (Lisp_Object buffer)
{
Window window;
Atom buffer_atom;
@@ -2416,8 +2343,7 @@ DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal,
DEFUN ("x-store-cut-buffer-internal", Fx_store_cut_buffer_internal,
Sx_store_cut_buffer_internal, 2, 2, 0,
doc: /* Sets the value of the named cut buffer (typically CUT_BUFFER0). */)
- (buffer, string)
- Lisp_Object buffer, string;
+ (Lisp_Object buffer, Lisp_Object string)
{
Window window;
Atom buffer_atom;
@@ -2482,8 +2408,7 @@ DEFUN ("x-rotate-cut-buffers-internal", Fx_rotate_cut_buffers_internal,
Sx_rotate_cut_buffers_internal, 1, 1, 0,
doc: /* Rotate the values of the cut buffers by N steps.
Positive N means shift the values forward, negative means backward. */)
- (n)
- Lisp_Object n;
+ (Lisp_Object n)
{
Window window;
Atom props[8];
@@ -2530,8 +2455,7 @@ Positive N means shift the values forward, negative means backward. */)
bit parts of a 32 bit number). */
int
-x_check_property_data (data)
- Lisp_Object data;
+x_check_property_data (Lisp_Object data)
{
Lisp_Object iter;
int size = 0;
@@ -2564,11 +2488,7 @@ x_check_property_data (data)
XClientMessageEvent). */
void
-x_fill_property_data (dpy, data, ret, format)
- Display *dpy;
- Lisp_Object data;
- void *ret;
- int format;
+x_fill_property_data (Display *dpy, Lisp_Object data, void *ret, int format)
{
long val;
long *d32 = (long *) ret;
@@ -2620,12 +2540,7 @@ x_fill_property_data (dpy, data, ret, format)
Also see comment for selection_data_to_lisp_data above. */
Lisp_Object
-x_property_data_to_lisp (f, data, type, format, size)
- struct frame *f;
- unsigned char *data;
- Atom type;
- int format;
- unsigned long size;
+x_property_data_to_lisp (struct frame *f, unsigned char *data, Atom type, int format, long unsigned int size)
{
return selection_data_to_lisp_data (FRAME_X_DISPLAY (f),
data, size*format/8, type, format);
@@ -2634,10 +2549,7 @@ x_property_data_to_lisp (f, data, type, format, size)
/* Get the mouse position in frame relative coordinates. */
static void
-mouse_position_for_drop (f, x, y)
- FRAME_PTR f;
- int *x;
- int *y;
+mouse_position_for_drop (FRAME_PTR f, int *x, int *y)
{
Window root, dummy_window;
int dummy;
@@ -2679,8 +2591,7 @@ the cdr is the lower 16 bits of a 32 bit value.
Use the display for FRAME or the current frame if FRAME is not given or nil.
If the value is 0 or the atom is not known, return the empty string. */)
- (value, frame)
- Lisp_Object value, frame;
+ (Lisp_Object value, Lisp_Object frame)
{
struct frame *f = check_x_frame (frame);
char *name = 0;
@@ -2720,8 +2631,7 @@ DEFUN ("x-register-dnd-atom", Fx_register_dnd_atom,
doc: /* Request that dnd events are made for ClientMessages with ATOM.
ATOM can be a symbol or a string. The ATOM is interned on the display that
FRAME is on. If FRAME is nil, the selected frame is used. */)
- (atom, frame)
- Lisp_Object atom, frame;
+ (Lisp_Object atom, Lisp_Object frame)
{
Atom x_atom;
struct frame *f = check_x_frame (frame);
@@ -2759,11 +2669,7 @@ FRAME is on. If FRAME is nil, the selected frame is used. */)
/* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. */
int
-x_handle_dnd_message (f, event, dpyinfo, bufp)
- struct frame *f;
- XClientMessageEvent *event;
- struct x_display_info *dpyinfo;
- struct input_event *bufp;
+x_handle_dnd_message (struct frame *f, XClientMessageEvent *event, struct x_display_info *dpyinfo, struct input_event *bufp)
{
Lisp_Object vec;
Lisp_Object frame;
@@ -2842,8 +2748,7 @@ the Atom is sent. If a value is a cons, it is converted to a 32 bit number
with the high 16 bits from the car and the lower 16 bit from the cdr.
If more values than fits into the event is given, the excessive values
are ignored. */)
- (display, dest, from, message_type, format, values)
- Lisp_Object display, dest, from, message_type, format, values;
+ (Lisp_Object display, Lisp_Object dest, Lisp_Object from, Lisp_Object message_type, Lisp_Object format, Lisp_Object values)
{
struct x_display_info *dpyinfo = check_x_display_info (display);
Window wdest;
@@ -2935,7 +2840,7 @@ are ignored. */)
void
-syms_of_xselect ()
+syms_of_xselect (void)
{
defsubr (&Sx_get_selection_internal);
defsubr (&Sx_own_selection_internal);
diff --git a/src/xsettings.c b/src/xsettings.c
index 8cfcafe126d..c02c850ac85 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -54,9 +54,7 @@ static GConfClient *gconf_client;
static void
-store_config_changed_event (arg, display_name)
- Lisp_Object arg;
- Lisp_Object display_name;
+store_config_changed_event (Lisp_Object arg, Lisp_Object display_name)
{
struct input_event event;
EVENT_INIT (event);
@@ -102,11 +100,10 @@ struct xsettings
that is SYSTEM_MONO_FONT. */
static void
-something_changedCB (client, cnxn_id, entry, user_data)
- GConfClient *client;
- guint cnxn_id;
- GConfEntry *entry;
- gpointer user_data;
+something_changedCB (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer user_data)
{
GConfValue *v = gconf_entry_get_value (entry);
@@ -114,7 +111,6 @@ something_changedCB (client, cnxn_id, entry, user_data)
if (v->type == GCONF_VALUE_STRING)
{
const char *value = gconf_value_get_string (v);
- int i;
if (current_mono_font != NULL && strcmp (value, current_mono_font) == 0)
return; /* No change. */
@@ -156,8 +152,7 @@ something_changedCB (client, cnxn_id, entry, user_data)
/* Find the window that contains the XSETTINGS property values. */
static void
-get_prop_window (dpyinfo)
- struct x_display_info *dpyinfo;
+get_prop_window (struct x_display_info *dpyinfo)
{
Display *dpy = dpyinfo->display;
@@ -229,10 +224,9 @@ get_prop_window (dpyinfo)
*/
static int
-parse_settings (prop, bytes, settings)
- unsigned char *prop;
- unsigned long bytes;
- struct xsettings *settings;
+parse_settings (unsigned char *prop,
+ long unsigned int bytes,
+ struct xsettings *settings)
{
Lisp_Object byteorder = Fbyteorder ();
int my_bo = XFASTINT (byteorder) == 'B' ? MSBFirst : LSBFirst;
@@ -402,11 +396,8 @@ parse_settings (prop, bytes, settings)
}
static int
-read_settings (dpyinfo, settings)
- struct x_display_info *dpyinfo;
- struct xsettings *settings;
+read_settings (struct x_display_info *dpyinfo, struct xsettings *settings)
{
- long long_len;
Atom act_type;
int act_form;
unsigned long nitems, bytes_after;
@@ -435,10 +426,9 @@ read_settings (dpyinfo, settings)
static void
-apply_xft_settings (dpyinfo, send_event_p, settings)
- struct x_display_info *dpyinfo;
- int send_event_p;
- struct xsettings *settings;
+apply_xft_settings (struct x_display_info *dpyinfo,
+ int send_event_p,
+ struct xsettings *settings)
{
#ifdef HAVE_XFT
FcPattern *pat;
@@ -546,9 +536,7 @@ apply_xft_settings (dpyinfo, send_event_p, settings)
}
static void
-read_and_apply_settings (dpyinfo, send_event_p)
- struct x_display_info *dpyinfo;
- int send_event_p;
+read_and_apply_settings (struct x_display_info *dpyinfo, int send_event_p)
{
struct xsettings settings;
Lisp_Object dpyname = XCAR (dpyinfo->name_list_element);
@@ -592,9 +580,7 @@ read_and_apply_settings (dpyinfo, send_event_p)
}
void
-xft_settings_event (dpyinfo, event)
- struct x_display_info *dpyinfo;
- XEvent *event;
+xft_settings_event (struct x_display_info *dpyinfo, XEvent *event)
{
int check_window_p = 0;
int apply_settings = 0;
@@ -636,10 +622,9 @@ xft_settings_event (dpyinfo, event)
static void
-init_gconf ()
+init_gconf (void)
{
#if defined (HAVE_GCONF) && defined (HAVE_XFT)
- int i;
char *s;
g_type_init ();
@@ -669,8 +654,7 @@ init_gconf ()
}
static void
-init_xsettings (dpyinfo)
- struct x_display_info *dpyinfo;
+init_xsettings (struct x_display_info *dpyinfo)
{
char sel[64];
Display *dpy = dpyinfo->display;
@@ -696,8 +680,7 @@ init_xsettings (dpyinfo)
}
void
-xsettings_initialize (dpyinfo)
- struct x_display_info *dpyinfo;
+xsettings_initialize (struct x_display_info *dpyinfo)
{
if (first_dpyinfo == NULL) first_dpyinfo = dpyinfo;
init_gconf ();
@@ -705,13 +688,13 @@ xsettings_initialize (dpyinfo)
}
const char *
-xsettings_get_system_font ()
+xsettings_get_system_font (void)
{
return current_mono_font;
}
const char *
-xsettings_get_system_normal_font ()
+xsettings_get_system_normal_font (void)
{
return current_font;
}
@@ -719,20 +702,20 @@ xsettings_get_system_normal_font ()
DEFUN ("font-get-system-normal-font", Ffont_get_system_normal_font,
Sfont_get_system_normal_font,
0, 0, 0,
- doc: /* Get the system default font. */)
- ()
+ doc: /* Get the system default application font. */)
+ (void)
{
- return current_font && use_system_font
+ return current_font
? make_string (current_font, strlen (current_font))
: Qnil;
}
DEFUN ("font-get-system-font", Ffont_get_system_font, Sfont_get_system_font,
0, 0, 0,
- doc: /* Get the system default monospaced font. */)
- ()
+ doc: /* Get the system default fixed width font. */)
+ (void)
{
- return current_mono_font && use_system_font
+ return current_mono_font
? make_string (current_mono_font, strlen (current_mono_font))
: Qnil;
}
@@ -742,7 +725,7 @@ DEFUN ("tool-bar-get-system-style", Ftool_bar_get_system_style, Stool_bar_get_sy
doc: /* Get the system tool bar style.
If no system tool bar style is known, return `tool-bar-style' if set to a
known style. Otherwise return image. */)
- ()
+ (void)
{
if (EQ (Vtool_bar_style, Qimage)
|| EQ (Vtool_bar_style, Qtext)
@@ -755,7 +738,7 @@ known style. Otherwise return image. */)
}
void
-syms_of_xsettings ()
+syms_of_xsettings (void)
{
current_mono_font = NULL;
current_font = NULL;
@@ -774,7 +757,10 @@ syms_of_xsettings ()
defsubr (&Sfont_get_system_normal_font);
DEFVAR_BOOL ("font-use-system-font", &use_system_font,
- doc: /* *Non-nil means to use the system defined font. */);
+ doc: /* *Non-nil means to apply the system defined font dynamically.
+When this is non-nil and the system defined fixed width font changes, we
+update frames dynamically.
+If this variable is nil, Emacs ignores system font changes. */);
use_system_font = 0;
DEFVAR_LISP ("xft-settings", &Vxft_settings,
diff --git a/src/xsettings.h b/src/xsettings.h
index 53fca2ad6b5..50819d456c8 100644
--- a/src/xsettings.h
+++ b/src/xsettings.h
@@ -24,11 +24,11 @@ EXFUN (Ffont_get_system_font, 0);
EXFUN (Ffont_get_system_normal_font, 0);
EXFUN (Ftool_bar_get_system_style, 0);
-extern void xsettings_initialize P_ ((struct x_display_info *dpyinfo));
-extern void xft_settings_event P_ ((struct x_display_info *dpyinfo,
- XEvent *));
-extern const char *xsettings_get_system_font P_ ((void));
-extern const char *xsettings_get_system_normal_font P_ ((void));
+extern void xsettings_initialize (struct x_display_info *dpyinfo);
+extern void xft_settings_event (struct x_display_info *dpyinfo,
+ XEvent *);
+extern const char *xsettings_get_system_font (void);
+extern const char *xsettings_get_system_normal_font (void);
#endif /* XSETTINGS_H */
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 78d7d9f6523..cb3773f7c40 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -42,6 +42,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "termopts.h"
#include "xterm.h"
+/* Avoid "differ in sign" warnings */
+#define SSDATA(x) ((char *) SDATA (x))
+
/* The user login name. */
extern Lisp_Object Vuser_login_name;
@@ -95,7 +98,7 @@ Lisp_Object Vx_session_previous_id;
#define CHDIR_OPT "--chdir="
static void
-ice_connection_closed ()
+ice_connection_closed (void)
{
if (ice_fd >= 0)
delete_keyboard_wait_descriptor (ice_fd);
@@ -108,8 +111,7 @@ ice_connection_closed ()
Otherwise returns 1 if SAVE_SESSION_EVENT is stored in buffer BUFP. */
int
-x_session_check_input (bufp)
- struct input_event *bufp;
+x_session_check_input (struct input_event *bufp)
{
SELECT_TYPE read_fds;
EMACS_TIME tmout;
@@ -152,7 +154,7 @@ x_session_check_input (bufp)
/* Check if smc_interact_CB was called and we shall generate a
SAVE_SESSION_EVENT. */
if (emacs_event.kind != NO_EVENT)
- bcopy (&emacs_event, bufp, sizeof (struct input_event));
+ memcpy (bufp, &emacs_event, sizeof (struct input_event));
return emacs_event.kind != NO_EVENT ? 1 : 0;
}
@@ -160,7 +162,7 @@ x_session_check_input (bufp)
/* Return non-zero if we have a connection to a session manager. */
int
-x_session_have_connection ()
+x_session_have_connection (void)
{
return ice_fd != -1;
}
@@ -170,9 +172,7 @@ x_session_have_connection ()
Then lisp code can interact with the user. */
static void
-smc_interact_CB (smcConn, clientData)
- SmcConn smcConn;
- SmPointer clientData;
+smc_interact_CB (SmcConn smcConn, SmPointer clientData)
{
doing_interact = True;
emacs_event.kind = SAVE_SESSION_EVENT;
@@ -187,18 +187,12 @@ smc_interact_CB (smcConn, clientData)
we do so, because we don't know what the lisp code might do. */
static void
-smc_save_yourself_CB (smcConn,
- clientData,
- saveType,
- shutdown,
- interactStyle,
- fast)
- SmcConn smcConn;
- SmPointer clientData;
- int saveType;
- Bool shutdown;
- int interactStyle;
- Bool fast;
+smc_save_yourself_CB (SmcConn smcConn,
+ SmPointer clientData,
+ int saveType,
+ Bool shutdown,
+ int interactStyle,
+ Bool fast)
{
#define NR_PROPS 5
@@ -228,7 +222,7 @@ smc_save_yourself_CB (smcConn,
props[props_idx]->type = SmARRAY8;
props[props_idx]->num_vals = 1;
props[props_idx]->vals = &values[val_idx++];
- props[props_idx]->vals[0].length = strlen (SDATA (Vinvocation_name));
+ props[props_idx]->vals[0].length = strlen (SSDATA (Vinvocation_name));
props[props_idx]->vals[0].value = SDATA (Vinvocation_name);
++props_idx;
@@ -272,7 +266,7 @@ smc_save_yourself_CB (smcConn,
props[props_idx]->type = SmARRAY8;
props[props_idx]->num_vals = 1;
props[props_idx]->vals = &values[val_idx++];
- props[props_idx]->vals[0].length = strlen (SDATA (Vuser_login_name));
+ props[props_idx]->vals[0].length = strlen (SSDATA (Vuser_login_name));
props[props_idx]->vals[0].value = SDATA (Vuser_login_name);
++props_idx;
@@ -311,9 +305,7 @@ smc_save_yourself_CB (smcConn,
/* According to the SM specification, this shall close the connection. */
static void
-smc_die_CB (smcConn, clientData)
- SmcConn smcConn;
- SmPointer clientData;
+smc_die_CB (SmcConn smcConn, SmPointer clientData)
{
SmcCloseConnection (smcConn, 0, 0);
ice_connection_closed ();
@@ -326,17 +318,13 @@ smc_die_CB (smcConn, clientData)
even seem necessary. */
static void
-smc_save_complete_CB (smcConn, clientData)
- SmcConn smcConn;
- SmPointer clientData;
+smc_save_complete_CB (SmcConn smcConn, SmPointer clientData)
{
/* Empty */
}
static void
-smc_shutdown_cancelled_CB (smcConn, clientData)
- SmcConn smcConn;
- SmPointer clientData;
+smc_shutdown_cancelled_CB (SmcConn smcConn, SmPointer clientData)
{
/* Empty */
}
@@ -345,47 +333,32 @@ smc_shutdown_cancelled_CB (smcConn, clientData)
because there is some error in the session management. */
static void
-smc_error_handler (smcConn,
- swap,
- offendingMinorOpcode,
- offendingSequence,
- errorClass,
- severity,
- values)
- SmcConn smcConn;
- Bool swap;
- int offendingMinorOpcode;
- unsigned long offendingSequence;
- int errorClass;
- int severity;
- SmPointer values;
+smc_error_handler (SmcConn smcConn,
+ Bool swap,
+ int offendingMinorOpcode,
+ unsigned long offendingSequence,
+ int errorClass,
+ int severity,
+ SmPointer values)
{
/* Empty */
}
static void
-ice_error_handler (iceConn,
- swap,
- offendingMinorOpcode,
- offendingSequence,
- errorClass,
- severity,
- values)
- IceConn iceConn;
- Bool swap;
- int offendingMinorOpcode;
- unsigned long offendingSequence;
- int errorClass;
- int severity;
- IcePointer values;
+ice_error_handler (IceConn iceConn,
+ Bool swap,
+ int offendingMinorOpcode,
+ unsigned long offendingSequence,
+ int errorClass,
+ int severity,
+ IcePointer values)
{
/* Empty */
}
static void
-ice_io_error_handler (iceConn)
- IceConn iceConn;
+ice_io_error_handler (IceConn iceConn)
{
/* Connection probably gone. */
ice_connection_closed ();
@@ -395,11 +368,7 @@ ice_io_error_handler (iceConn)
uses ICE as it transport protocol. */
static void
-ice_conn_watch_CB (iceConn, clientData, opening, watchData)
- IceConn iceConn;
- IcePointer clientData;
- Bool opening;
- IcePointer *watchData;
+ice_conn_watch_CB (IceConn iceConn, IcePointer clientData, int opening, IcePointer *watchData)
{
if (! opening)
{
@@ -422,10 +391,9 @@ ice_conn_watch_CB (iceConn, clientData, opening, watchData)
/* Create the client leader window. */
+#ifndef USE_GTK
static void
-create_client_leader_window (dpyinfo, client_id)
- struct x_display_info *dpyinfo;
- char *client_id;
+create_client_leader_window (struct x_display_info *dpyinfo, char *client_id)
{
Window w;
XClassHint class_hints;
@@ -443,16 +411,17 @@ create_client_leader_window (dpyinfo, client_id)
sm_id = XInternAtom (dpyinfo->display, "SM_CLIENT_ID", False);
XChangeProperty (dpyinfo->display, w, sm_id, XA_STRING, 8, PropModeReplace,
- client_id, strlen (client_id));
+ (unsigned char *)client_id, strlen (client_id));
dpyinfo->client_leader_window = w;
}
+#endif /* ! USE_GTK */
+
/* Try to open a connection to the session manager. */
void
-x_session_initialize (dpyinfo)
- struct x_display_info *dpyinfo;
+x_session_initialize (struct x_display_info *dpyinfo)
{
#define SM_ERRORSTRING_LEN 512
char errorstring[SM_ERRORSTRING_LEN];
@@ -466,12 +435,12 @@ x_session_initialize (dpyinfo)
/* Check if we where started by the session manager. If so, we will
have a previous id. */
if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id))
- previous_id = SDATA (Vx_session_previous_id);
+ previous_id = SSDATA (Vx_session_previous_id);
/* Construct the path to the Emacs program. */
if (! EQ (Vinvocation_directory, Qnil))
- name_len += strlen (SDATA (Vinvocation_directory));
- name_len += strlen (SDATA (Vinvocation_name));
+ name_len += strlen (SSDATA (Vinvocation_directory));
+ name_len += strlen (SSDATA (Vinvocation_name));
/* This malloc will not be freed, but it is only done once, and hopefully
not very large */
@@ -479,8 +448,8 @@ x_session_initialize (dpyinfo)
emacs_program[0] = '\0';
if (! EQ (Vinvocation_directory, Qnil))
- strcpy (emacs_program, SDATA (Vinvocation_directory));
- strcat (emacs_program, SDATA (Vinvocation_name));
+ strcpy (emacs_program, SSDATA (Vinvocation_directory));
+ strcat (emacs_program, SSDATA (Vinvocation_name));
/* The SM protocol says all callbacks are mandatory, so set up all
here and in the mask passed to SmcOpenConnection. */
@@ -532,7 +501,7 @@ x_session_initialize (dpyinfo)
/* Ensure that the session manager is not contacted again. */
void
-x_session_close ()
+x_session_close (void)
{
ice_connection_closed ();
}
@@ -550,8 +519,7 @@ from `emacs-session-save' If the return value is non-nil the session manager
is told to abort the window system shutdown.
Do not call this function yourself. */)
- (event)
- Lisp_Object event;
+ (Lisp_Object event)
{
/* Check doing_interact so that we don't do anything if someone called
this at the wrong time. */
@@ -575,7 +543,7 @@ Do not call this function yourself. */)
Initialization
***********************************************************************/
void
-syms_of_xsmfns ()
+syms_of_xsmfns (void)
{
DEFVAR_LISP ("x-session-id", &Vx_session_id,
doc: /* The session id Emacs got from the session manager for this session.
diff --git a/src/xterm.c b/src/xterm.c
index f195c4fbbd5..ddc7a167684 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -104,13 +104,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#ifdef USE_LUCID
-extern int xlwmenu_window_p P_ ((Widget w, Window window));
-extern void xlwmenu_redisplay P_ ((Widget));
+extern int xlwmenu_window_p (Widget w, Window window);
+extern void xlwmenu_redisplay (Widget);
#endif
#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
-extern void free_frame_menubar P_ ((struct frame *));
+extern void free_frame_menubar (struct frame *);
#endif
#ifdef USE_X_TOOLKIT
@@ -332,61 +332,60 @@ Lisp_Object Qx_gtk_map_stock;
extern Lisp_Object Vinhibit_redisplay;
-extern XrmDatabase x_load_resources P_ ((Display *, char *, char *, char *));
-extern int x_bitmap_mask P_ ((FRAME_PTR, int));
-
-static int x_alloc_nearest_color_1 P_ ((Display *, Colormap, XColor *));
-static void x_set_window_size_1 P_ ((struct frame *, int, int, int));
-static const XColor *x_color_cells P_ ((Display *, int *));
-static void x_update_window_end P_ ((struct window *, int, int));
-
-static int x_io_error_quitter P_ ((Display *));
-static struct terminal *x_create_terminal P_ ((struct x_display_info *));
-void x_delete_terminal P_ ((struct terminal *));
-static void x_update_end P_ ((struct frame *));
-static void XTframe_up_to_date P_ ((struct frame *));
-static void XTset_terminal_modes P_ ((struct terminal *));
-static void XTreset_terminal_modes P_ ((struct terminal *));
-static void x_clear_frame P_ ((struct frame *));
-static void frame_highlight P_ ((struct frame *));
-static void frame_unhighlight P_ ((struct frame *));
-static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *));
-static void x_focus_changed P_ ((int, int, struct x_display_info *,
- struct frame *, struct input_event *));
-static void x_detect_focus_change P_ ((struct x_display_info *,
- XEvent *, struct input_event *));
-static void XTframe_rehighlight P_ ((struct frame *));
-static void x_frame_rehighlight P_ ((struct x_display_info *));
-static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
-static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int,
- enum text_cursor_kinds));
-
-static void x_clip_to_row P_ ((struct window *, struct glyph_row *, int, GC));
-static void x_flush P_ ((struct frame *f));
-static void x_update_begin P_ ((struct frame *));
-static void x_update_window_begin P_ ((struct window *));
-static void x_after_update_window_line P_ ((struct glyph_row *));
-static struct scroll_bar *x_window_to_scroll_bar P_ ((Display *, Window));
-static void x_scroll_bar_report_motion P_ ((struct frame **, Lisp_Object *,
- enum scroll_bar_part *,
- Lisp_Object *, Lisp_Object *,
- unsigned long *));
-static void x_handle_net_wm_state P_ ((struct frame *, XPropertyEvent *));
-static void x_check_fullscreen P_ ((struct frame *));
-static void x_check_expected_move P_ ((struct frame *, int, int));
-static void x_sync_with_move P_ ((struct frame *, int, int, int));
-static int handle_one_xevent P_ ((struct x_display_info *, XEvent *,
- int *, struct input_event *));
+extern XrmDatabase x_load_resources (Display *, char *, char *, char *);
+extern int x_bitmap_mask (FRAME_PTR, int);
+
+static int x_alloc_nearest_color_1 (Display *, Colormap, XColor *);
+static void x_set_window_size_1 (struct frame *, int, int, int);
+static const XColor *x_color_cells (Display *, int *);
+static void x_update_window_end (struct window *, int, int);
+
+static int x_io_error_quitter (Display *);
+static struct terminal *x_create_terminal (struct x_display_info *);
+void x_delete_terminal (struct terminal *);
+static void x_update_end (struct frame *);
+static void XTframe_up_to_date (struct frame *);
+static void XTset_terminal_modes (struct terminal *);
+static void XTreset_terminal_modes (struct terminal *);
+static void x_clear_frame (struct frame *);
+static void frame_highlight (struct frame *);
+static void frame_unhighlight (struct frame *);
+static void x_new_focus_frame (struct x_display_info *, struct frame *);
+static void x_focus_changed (int, int, struct x_display_info *,
+ struct frame *, struct input_event *);
+static void x_detect_focus_change (struct x_display_info *,
+ XEvent *, struct input_event *);
+static void XTframe_rehighlight (struct frame *);
+static void x_frame_rehighlight (struct x_display_info *);
+static void x_draw_hollow_cursor (struct window *, struct glyph_row *);
+static void x_draw_bar_cursor (struct window *, struct glyph_row *, int,
+ enum text_cursor_kinds);
+
+static void x_clip_to_row (struct window *, struct glyph_row *, int, GC);
+static void x_flush (struct frame *f);
+static void x_update_begin (struct frame *);
+static void x_update_window_begin (struct window *);
+static void x_after_update_window_line (struct glyph_row *);
+static struct scroll_bar *x_window_to_scroll_bar (Display *, Window);
+static void x_scroll_bar_report_motion (struct frame **, Lisp_Object *,
+ enum scroll_bar_part *,
+ Lisp_Object *, Lisp_Object *,
+ unsigned long *);
+static void x_handle_net_wm_state (struct frame *, XPropertyEvent *);
+static void x_check_fullscreen (struct frame *);
+static void x_check_expected_move (struct frame *, int, int);
+static void x_sync_with_move (struct frame *, int, int, int);
+static int handle_one_xevent (struct x_display_info *, XEvent *,
+ int *, struct input_event *);
/* Don't declare this NO_RETURN because we want no
interference with debugging failing X calls. */
-static SIGTYPE x_connection_closed P_ ((Display *, char *));
+static SIGTYPE x_connection_closed (Display *, char *);
/* Flush display of frame F, or of all frames if F is null. */
static void
-x_flush (f)
- struct frame *f;
+x_flush (struct frame *f)
{
/* Don't call XFlush when it is not safe to redisplay; the X
connection may be broken. */
@@ -455,8 +454,7 @@ record_event (locus, type)
/* Return the struct x_display_info corresponding to DPY. */
struct x_display_info *
-x_display_info_for_display (dpy)
- Display *dpy;
+x_display_info_for_display (Display *dpy)
{
struct x_display_info *dpyinfo;
@@ -471,8 +469,7 @@ x_display_info_for_display (dpy)
#define OPACITY "_NET_WM_WINDOW_OPACITY"
void
-x_set_frame_alpha (f)
- struct frame *f;
+x_set_frame_alpha (struct frame *f)
{
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
Display *dpy = FRAME_X_DISPLAY (f);
@@ -484,7 +481,7 @@ x_set_frame_alpha (f)
if (FRAME_X_DISPLAY_INFO (f)->root_window != FRAME_X_OUTPUT (f)->parent_desc)
/* Since the WM decoration lies under the FRAME_OUTER_WINDOW,
we must treat the former instead of the latter. */
- win = FRAME_X_OUTPUT(f)->parent_desc;
+ win = FRAME_X_OUTPUT (f)->parent_desc;
if (dpyinfo->x_highlight_frame == f)
alpha = f->alpha[0];
@@ -513,10 +510,10 @@ x_set_frame_alpha (f)
unsigned long n, left;
x_catch_errors (dpy);
- rc = XGetWindowProperty(dpy, win, XInternAtom(dpy, OPACITY, False),
- 0L, 1L, False, XA_CARDINAL,
- &actual, &format, &n, &left,
- &data);
+ rc = XGetWindowProperty (dpy, win, XInternAtom(dpy, OPACITY, False),
+ 0L, 1L, False, XA_CARDINAL,
+ &actual, &format, &n, &left,
+ &data);
if (rc == Success && actual != None)
if (*(unsigned long *)data == opac)
@@ -538,15 +535,13 @@ x_set_frame_alpha (f)
}
int
-x_display_pixel_height (dpyinfo)
- struct x_display_info *dpyinfo;
+x_display_pixel_height (struct x_display_info *dpyinfo)
{
return HeightOfScreen (dpyinfo->screen);
}
int
-x_display_pixel_width (dpyinfo)
- struct x_display_info *dpyinfo;
+x_display_pixel_width (struct x_display_info *dpyinfo)
{
return WidthOfScreen (dpyinfo->screen);
}
@@ -563,8 +558,7 @@ x_display_pixel_width (dpyinfo)
because all interesting stuff is done on a window basis. */
static void
-x_update_begin (f)
- struct frame *f;
+x_update_begin (struct frame *f)
{
/* Nothing to do. */
}
@@ -575,8 +569,7 @@ x_update_begin (f)
position of W. */
static void
-x_update_window_begin (w)
- struct window *w;
+x_update_window_begin (struct window *w)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
struct x_display_info *display_info = FRAME_X_DISPLAY_INFO (f);
@@ -604,9 +597,7 @@ x_update_window_begin (w)
/* Draw a vertical window border from (x,y0) to (x,y1) */
static void
-x_draw_vertical_window_border (w, x, y0, y1)
- struct window *w;
- int x, y0, y1;
+x_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
struct face *face;
@@ -634,9 +625,7 @@ x_draw_vertical_window_border (w, x, y0, y1)
here. */
static void
-x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
- struct window *w;
- int cursor_on_p, mouse_face_overwritten_p;
+x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p)
{
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame));
@@ -672,8 +661,7 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
update_end. */
static void
-x_update_end (f)
- struct frame *f;
+x_update_end (struct frame *f)
{
/* Mouse highlight may be displayed again. */
FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 0;
@@ -691,8 +679,7 @@ x_update_end (f)
updated_window is not available here. */
static void
-XTframe_up_to_date (f)
- struct frame *f;
+XTframe_up_to_date (struct frame *f)
{
if (FRAME_X_P (f))
{
@@ -721,8 +708,7 @@ XTframe_up_to_date (f)
between bitmaps to be drawn between current row and DESIRED_ROW. */
static void
-x_after_update_window_line (desired_row)
- struct glyph_row *desired_row;
+x_after_update_window_line (struct glyph_row *desired_row)
{
struct window *w = updated_window;
struct frame *f;
@@ -760,34 +746,16 @@ x_after_update_window_line (desired_row)
}
static void
-x_draw_fringe_bitmap (w, row, p)
- struct window *w;
- struct glyph_row *row;
- struct draw_fringe_bitmap_params *p;
+x_draw_fringe_bitmap (struct window *w, struct glyph_row *row, struct draw_fringe_bitmap_params *p)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
Display *display = FRAME_X_DISPLAY (f);
Window window = FRAME_X_WINDOW (f);
GC gc = f->output_data.x->normal_gc;
struct face *face = p->face;
- int rowY;
/* Must clip because of partially visible lines. */
- rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
- if (p->y < rowY)
- {
- /* Adjust position of "bottom aligned" bitmap on partially
- visible last row. */
- int oldY = row->y;
- int oldVH = row->visible_height;
- row->visible_height = p->h;
- row->y -= rowY - p->y;
- x_clip_to_row (w, row, -1, gc);
- row->y = oldY;
- row->visible_height = oldVH;
- }
- else
- x_clip_to_row (w, row, -1, gc);
+ x_clip_to_row (w, row, -1, gc);
if (!p->overlay_p)
{
@@ -931,37 +899,37 @@ XTreset_terminal_modes (struct terminal *terminal)
-static void x_set_glyph_string_clipping P_ ((struct glyph_string *));
-static void x_set_glyph_string_gc P_ ((struct glyph_string *));
-static void x_draw_glyph_string_background P_ ((struct glyph_string *,
- int));
-static void x_draw_glyph_string_foreground P_ ((struct glyph_string *));
-static void x_draw_composite_glyph_string_foreground P_ ((struct glyph_string *));
-static void x_draw_glyph_string_box P_ ((struct glyph_string *));
-static void x_draw_glyph_string P_ ((struct glyph_string *));
-static void x_compute_glyph_string_overhangs P_ ((struct glyph_string *));
-static void x_set_cursor_gc P_ ((struct glyph_string *));
-static void x_set_mode_line_face_gc P_ ((struct glyph_string *));
-static void x_set_mouse_face_gc P_ ((struct glyph_string *));
-static int x_alloc_lighter_color P_ ((struct frame *, Display *, Colormap,
- unsigned long *, double, int));
-static void x_setup_relief_color P_ ((struct frame *, struct relief *,
- double, int, unsigned long));
-static void x_setup_relief_colors P_ ((struct glyph_string *));
-static void x_draw_image_glyph_string P_ ((struct glyph_string *));
-static void x_draw_image_relief P_ ((struct glyph_string *));
-static void x_draw_image_foreground P_ ((struct glyph_string *));
-static void x_draw_image_foreground_1 P_ ((struct glyph_string *, Pixmap));
-static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int,
- int, int, int));
-static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int,
- int, int, int, int, int, int,
- XRectangle *));
-static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int,
- int, int, int, XRectangle *));
+static void x_set_glyph_string_clipping (struct glyph_string *);
+static void x_set_glyph_string_gc (struct glyph_string *);
+static void x_draw_glyph_string_background (struct glyph_string *,
+ int);
+static void x_draw_glyph_string_foreground (struct glyph_string *);
+static void x_draw_composite_glyph_string_foreground (struct glyph_string *);
+static void x_draw_glyph_string_box (struct glyph_string *);
+static void x_draw_glyph_string (struct glyph_string *);
+static void x_compute_glyph_string_overhangs (struct glyph_string *);
+static void x_set_cursor_gc (struct glyph_string *);
+static void x_set_mode_line_face_gc (struct glyph_string *);
+static void x_set_mouse_face_gc (struct glyph_string *);
+static int x_alloc_lighter_color (struct frame *, Display *, Colormap,
+ unsigned long *, double, int);
+static void x_setup_relief_color (struct frame *, struct relief *,
+ double, int, unsigned long);
+static void x_setup_relief_colors (struct glyph_string *);
+static void x_draw_image_glyph_string (struct glyph_string *);
+static void x_draw_image_relief (struct glyph_string *);
+static void x_draw_image_foreground (struct glyph_string *);
+static void x_draw_image_foreground_1 (struct glyph_string *, Pixmap);
+static void x_clear_glyph_string_rect (struct glyph_string *, int,
+ int, int, int);
+static void x_draw_relief_rect (struct frame *, int, int, int, int,
+ int, int, int, int, int, int,
+ XRectangle *);
+static void x_draw_box_rect (struct glyph_string *, int, int, int, int,
+ int, int, int, XRectangle *);
#if GLYPH_DEBUG
-static void x_check_font P_ ((struct frame *, struct font *));
+static void x_check_font (struct frame *, struct font *);
#endif
@@ -969,8 +937,7 @@ static void x_check_font P_ ((struct frame *, struct font *));
face. */
static void
-x_set_cursor_gc (s)
- struct glyph_string *s;
+x_set_cursor_gc (struct glyph_string *s)
{
if (s->font == FRAME_FONT (s->f)
&& s->face->background == FRAME_BACKGROUND_PIXEL (s->f)
@@ -1021,8 +988,7 @@ x_set_cursor_gc (s)
/* Set up S->gc of glyph string S for drawing text in mouse face. */
static void
-x_set_mouse_face_gc (s)
- struct glyph_string *s;
+x_set_mouse_face_gc (struct glyph_string *s)
{
int face_id;
struct face *face;
@@ -1073,8 +1039,7 @@ x_set_mouse_face_gc (s)
matrix was built, so there isn't much to do, here. */
static INLINE void
-x_set_mode_line_face_gc (s)
- struct glyph_string *s;
+x_set_mode_line_face_gc (struct glyph_string *s)
{
s->gc = s->face->gc;
}
@@ -1085,8 +1050,7 @@ x_set_mode_line_face_gc (s)
pattern. */
static INLINE void
-x_set_glyph_string_gc (s)
- struct glyph_string *s;
+x_set_glyph_string_gc (struct glyph_string *s)
{
PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
@@ -1131,8 +1095,7 @@ x_set_glyph_string_gc (s)
line or menu if we don't have X toolkit support. */
static INLINE void
-x_set_glyph_string_clipping (s)
- struct glyph_string *s;
+x_set_glyph_string_clipping (struct glyph_string *s)
{
XRectangle *r = s->clip;
int n = get_glyph_string_clip_rects (s, r, 2);
@@ -1148,8 +1111,7 @@ x_set_glyph_string_clipping (s)
the area of SRC. */
static void
-x_set_glyph_string_clipping_exactly (src, dst)
- struct glyph_string *src, *dst;
+x_set_glyph_string_clipping_exactly (struct glyph_string *src, struct glyph_string *dst)
{
XRectangle r;
@@ -1167,8 +1129,7 @@ x_set_glyph_string_clipping_exactly (src, dst)
Compute left and right overhang of glyph string S. */
static void
-x_compute_glyph_string_overhangs (s)
- struct glyph_string *s;
+x_compute_glyph_string_overhangs (struct glyph_string *s)
{
if (s->cmp == NULL
&& (s->first_glyph->type == CHAR_GLYPH
@@ -1207,9 +1168,7 @@ x_compute_glyph_string_overhangs (s)
/* Fill rectangle X, Y, W, H with background color of glyph string S. */
static INLINE void
-x_clear_glyph_string_rect (s, x, y, w, h)
- struct glyph_string *s;
- int x, y, w, h;
+x_clear_glyph_string_rect (struct glyph_string *s, int x, int y, int w, int h)
{
XGCValues xgcv;
XGetGCValues (s->display, s->gc, GCForeground | GCBackground, &xgcv);
@@ -1226,9 +1185,7 @@ x_clear_glyph_string_rect (s, x, y, w, h)
contains the first component of a composition. */
static void
-x_draw_glyph_string_background (s, force_p)
- struct glyph_string *s;
- int force_p;
+x_draw_glyph_string_background (struct glyph_string *s, int force_p)
{
/* Nothing to do if background has already been drawn or if it
shouldn't be drawn in the first place. */
@@ -1264,8 +1221,7 @@ x_draw_glyph_string_background (s, force_p)
/* Draw the foreground of glyph string S. */
static void
-x_draw_glyph_string_foreground (s)
- struct glyph_string *s;
+x_draw_glyph_string_foreground (struct glyph_string *s)
{
int i, x;
@@ -1313,8 +1269,7 @@ x_draw_glyph_string_foreground (s)
/* Draw the foreground of composite glyph string S. */
static void
-x_draw_composite_glyph_string_foreground (s)
- struct glyph_string *s;
+x_draw_composite_glyph_string_foreground (struct glyph_string *s)
{
int i, j, x;
struct font *font = s->font;
@@ -1401,19 +1356,18 @@ x_draw_composite_glyph_string_foreground (s)
#ifdef USE_X_TOOLKIT
-static struct frame *x_frame_of_widget P_ ((Widget));
-static Boolean cvt_string_to_pixel P_ ((Display *, XrmValue *, Cardinal *,
- XrmValue *, XrmValue *, XtPointer *));
-static void cvt_pixel_dtor P_ ((XtAppContext, XrmValue *, XtPointer,
- XrmValue *, Cardinal *));
+static struct frame *x_frame_of_widget (Widget);
+static Boolean cvt_string_to_pixel (Display *, XrmValue *, Cardinal *,
+ XrmValue *, XrmValue *, XtPointer *);
+static void cvt_pixel_dtor (XtAppContext, XrmValue *, XtPointer,
+ XrmValue *, Cardinal *);
/* Return the frame on which widget WIDGET is used.. Abort if frame
cannot be determined. */
static struct frame *
-x_frame_of_widget (widget)
- Widget widget;
+x_frame_of_widget (Widget widget)
{
struct x_display_info *dpyinfo;
Lisp_Object tail;
@@ -1449,10 +1403,7 @@ x_frame_of_widget (widget)
if successful. This is called from lwlib. */
int
-x_alloc_nearest_color_for_widget (widget, cmap, color)
- Widget widget;
- Colormap cmap;
- XColor *color;
+x_alloc_nearest_color_for_widget (Widget widget, Colormap cmap, XColor *color)
{
struct frame *f = x_frame_of_widget (widget);
return x_alloc_nearest_color (f, cmap, color);
@@ -1467,13 +1418,8 @@ x_alloc_nearest_color_for_widget (widget, cmap, color)
Value is non-zero if successful. */
int
-x_alloc_lighter_color_for_widget (widget, display, cmap, pixel, factor, delta)
- Widget widget;
- Display *display;
- Colormap cmap;
- unsigned long *pixel;
- double factor;
- int delta;
+x_alloc_lighter_color_for_widget (Widget widget, Display *display, Colormap cmap,
+ unsigned long *pixel, double factor, int delta)
{
struct frame *f = x_frame_of_widget (widget);
return x_alloc_lighter_color (f, display, cmap, pixel, factor, delta);
@@ -1516,12 +1462,9 @@ static Pixel cvt_string_to_pixel_value;
Value is True if successful, False otherwise. */
static Boolean
-cvt_string_to_pixel (dpy, args, nargs, from, to, closure_ret)
- Display *dpy;
- XrmValue *args;
- Cardinal *nargs;
- XrmValue *from, *to;
- XtPointer *closure_ret;
+cvt_string_to_pixel (Display *dpy, XrmValue *args, Cardinal *nargs,
+ XrmValue *from, XrmValue *to,
+ XtPointer *closure_ret)
{
Screen *screen;
Colormap cmap;
@@ -1605,12 +1548,8 @@ cvt_string_to_pixel (dpy, args, nargs, from, to, closure_ret)
ARGS and NARGS are like for cvt_string_to_pixel. */
static void
-cvt_pixel_dtor (app, to, closure, args, nargs)
- XtAppContext app;
- XrmValuePtr to;
- XtPointer closure;
- XrmValuePtr args;
- Cardinal *nargs;
+cvt_pixel_dtor (XtAppContext app, XrmValuePtr to, XtPointer closure, XrmValuePtr args,
+ Cardinal *nargs)
{
if (*nargs != 2)
{
@@ -1639,9 +1578,7 @@ cvt_pixel_dtor (app, to, closure, args, nargs)
say a 24-bit TrueColor map. */
static const XColor *
-x_color_cells (dpy, ncells)
- Display *dpy;
- int *ncells;
+x_color_cells (Display *dpy, int *ncells)
{
struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
@@ -1672,10 +1609,7 @@ x_color_cells (dpy, ncells)
colors in COLORS. Use cached information, if available. */
void
-x_query_colors (f, colors, ncolors)
- struct frame *f;
- XColor *colors;
- int ncolors;
+x_query_colors (struct frame *f, XColor *colors, int ncolors)
{
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -1699,9 +1633,7 @@ x_query_colors (f, colors, ncolors)
COLOR. Use cached information, if available. */
void
-x_query_color (f, color)
- struct frame *f;
- XColor *color;
+x_query_color (struct frame *f, XColor *color)
{
x_query_colors (f, color, 1);
}
@@ -1713,10 +1645,7 @@ x_query_color (f, color)
allocated. */
static int
-x_alloc_nearest_color_1 (dpy, cmap, color)
- Display *dpy;
- Colormap cmap;
- XColor *color;
+x_alloc_nearest_color_1 (Display *dpy, Colormap cmap, XColor *color)
{
int rc;
@@ -1786,10 +1715,7 @@ x_alloc_nearest_color_1 (dpy, cmap, color)
allocated. */
int
-x_alloc_nearest_color (f, cmap, color)
- struct frame *f;
- Colormap cmap;
- XColor *color;
+x_alloc_nearest_color (struct frame *f, Colormap cmap, XColor *color)
{
gamma_correct (f, color);
return x_alloc_nearest_color_1 (FRAME_X_DISPLAY (f), cmap, color);
@@ -1801,9 +1727,7 @@ x_alloc_nearest_color (f, cmap, color)
get color reference counts right. */
unsigned long
-x_copy_color (f, pixel)
- struct frame *f;
- unsigned long pixel;
+x_copy_color (struct frame *f, long unsigned int pixel)
{
XColor color;
@@ -1824,10 +1748,7 @@ x_copy_color (f, pixel)
get color reference counts right. */
unsigned long
-x_copy_dpy_color (dpy, cmap, pixel)
- Display *dpy;
- Colormap cmap;
- unsigned long pixel;
+x_copy_dpy_color (Display *dpy, Colormap cmap, long unsigned int pixel)
{
XColor color;
@@ -1865,13 +1786,7 @@ x_copy_dpy_color (dpy, cmap, pixel)
Value is non-zero if successful. */
static int
-x_alloc_lighter_color (f, display, cmap, pixel, factor, delta)
- struct frame *f;
- Display *display;
- Colormap cmap;
- unsigned long *pixel;
- double factor;
- int delta;
+x_alloc_lighter_color (struct frame *f, Display *display, Colormap cmap, long unsigned int *pixel, double factor, int delta)
{
XColor color, new;
long bright;
@@ -1947,12 +1862,7 @@ x_alloc_lighter_color (f, display, cmap, pixel, factor, delta)
be allocated, use DEFAULT_PIXEL, instead. */
static void
-x_setup_relief_color (f, relief, factor, delta, default_pixel)
- struct frame *f;
- struct relief *relief;
- double factor;
- int delta;
- unsigned long default_pixel;
+x_setup_relief_color (struct frame *f, struct relief *relief, double factor, int delta, long unsigned int default_pixel)
{
XGCValues xgcv;
struct x_output *di = f->output_data.x;
@@ -2000,8 +1910,7 @@ x_setup_relief_color (f, relief, factor, delta, default_pixel)
/* Set up colors for the relief lines around glyph string S. */
static void
-x_setup_relief_colors (s)
- struct glyph_string *s;
+x_setup_relief_colors (struct glyph_string *s)
{
struct x_output *di = s->f->output_data.x;
unsigned long color;
@@ -2042,12 +1951,10 @@ x_setup_relief_colors (s)
when drawing. */
static void
-x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
- raised_p, top_p, bot_p, left_p, right_p, clip_rect)
- struct frame *f;
- int left_x, top_y, right_x, bottom_y, width;
- int top_p, bot_p, left_p, right_p, raised_p;
- XRectangle *clip_rect;
+x_draw_relief_rect (struct frame *f,
+ int left_x, int top_y, int right_x, int bottom_y, int width,
+ int raised_p, int top_p, int bot_p, int left_p, int right_p,
+ XRectangle *clip_rect)
{
Display *dpy = FRAME_X_DISPLAY (f);
Window window = FRAME_X_WINDOW (f);
@@ -2105,11 +2012,9 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
rectangle to use when drawing. */
static void
-x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
- left_p, right_p, clip_rect)
- struct glyph_string *s;
- int left_x, top_y, right_x, bottom_y, width, left_p, right_p;
- XRectangle *clip_rect;
+x_draw_box_rect (struct glyph_string *s,
+ int left_x, int top_y, int right_x, int bottom_y, int width,
+ int left_p, int right_p, XRectangle *clip_rect)
{
XGCValues xgcv;
@@ -2143,8 +2048,7 @@ x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
/* Draw a box around glyph string S. */
static void
-x_draw_glyph_string_box (s)
- struct glyph_string *s;
+x_draw_glyph_string_box (struct glyph_string *s)
{
int width, left_x, right_x, top_y, bottom_y, last_x, raised_p;
int left_p, right_p;
@@ -2195,8 +2099,7 @@ x_draw_glyph_string_box (s)
/* Draw foreground of image glyph string S. */
static void
-x_draw_image_foreground (s)
- struct glyph_string *s;
+x_draw_image_foreground (struct glyph_string *s)
{
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
@@ -2286,8 +2189,7 @@ x_draw_image_foreground (s)
/* Draw a relief around the image glyph string S. */
static void
-x_draw_image_relief (s)
- struct glyph_string *s;
+x_draw_image_relief (struct glyph_string *s)
{
int x0, y0, x1, y1, thick, raised_p, extra;
XRectangle r;
@@ -2322,7 +2224,7 @@ x_draw_image_relief (s)
extra = s->face->id == TOOL_BAR_FACE_ID
? XINT (Vtool_bar_button_margin) : 0;
-
+
x0 = x - thick - extra;
y0 = y - thick - extra;
x1 = x + s->slice.width + thick - 1 + extra;
@@ -2342,9 +2244,7 @@ x_draw_image_relief (s)
/* Draw the foreground of image glyph string S to PIXMAP. */
static void
-x_draw_image_foreground_1 (s, pixmap)
- struct glyph_string *s;
- Pixmap pixmap;
+x_draw_image_foreground_1 (struct glyph_string *s, Pixmap pixmap)
{
int x = 0;
int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice);
@@ -2420,9 +2320,7 @@ x_draw_image_foreground_1 (s, pixmap)
give the rectangle to draw. */
static void
-x_draw_glyph_string_bg_rect (s, x, y, w, h)
- struct glyph_string *s;
- int x, y, w, h;
+x_draw_glyph_string_bg_rect (struct glyph_string *s, int x, int y, int w, int h)
{
if (s->stippled_p)
{
@@ -2451,8 +2349,7 @@ x_draw_glyph_string_bg_rect (s, x, y, w, h)
*/
static void
-x_draw_image_glyph_string (s)
- struct glyph_string *s;
+x_draw_image_glyph_string (struct glyph_string *s)
{
int box_line_hwidth = eabs (s->face->box_line_width);
int box_line_vwidth = max (s->face->box_line_width, 0);
@@ -2556,8 +2453,7 @@ x_draw_image_glyph_string (s)
/* Draw stretch glyph string S. */
static void
-x_draw_stretch_glyph_string (s)
- struct glyph_string *s;
+x_draw_stretch_glyph_string (struct glyph_string *s)
{
xassert (s->first_glyph->type == STRETCH_GLYPH);
@@ -2640,8 +2536,7 @@ x_draw_stretch_glyph_string (s)
/* Draw glyph string S. */
static void
-x_draw_glyph_string (s)
- struct glyph_string *s;
+x_draw_glyph_string (struct glyph_string *s)
{
int relief_drawn_p = 0;
@@ -2895,9 +2790,7 @@ x_draw_glyph_string (s)
/* Shift display to make room for inserted glyphs. */
void
-x_shift_glyphs_for_insert (f, x, y, width, height, shift_by)
- struct frame *f;
- int x, y, width, height, shift_by;
+x_shift_glyphs_for_insert (struct frame *f, int x, int y, int width, int height, int shift_by)
{
XCopyArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), FRAME_X_WINDOW (f),
f->output_data.x->normal_gc,
@@ -2909,9 +2802,7 @@ x_shift_glyphs_for_insert (f, x, y, width, height, shift_by)
for X frames. */
static void
-x_delete_glyphs (f, n)
- struct frame *f;
- register int n;
+x_delete_glyphs (struct frame *f, register int n)
{
abort ();
}
@@ -2921,12 +2812,7 @@ x_delete_glyphs (f, n)
If they are <= 0, this is probably an error. */
void
-x_clear_area (dpy, window, x, y, width, height, exposures)
- Display *dpy;
- Window window;
- int x, y;
- int width, height;
- int exposures;
+x_clear_area (Display *dpy, Window window, int x, int y, int width, int height, int exposures)
{
xassert (width > 0 && height > 0);
XClearArea (dpy, window, x, y, width, height, exposures);
@@ -2958,7 +2844,7 @@ x_clear_frame (struct frame *f)
redisplay, do it here. */
gtk_widget_queue_draw (FRAME_GTK_WIDGET (f));
#endif
-
+
XFlush (FRAME_X_DISPLAY (f));
UNBLOCK_INPUT;
@@ -2978,8 +2864,7 @@ x_clear_frame (struct frame *f)
*RESULT. Return 1 if the difference is negative, otherwise 0. */
static int
-timeval_subtract (result, x, y)
- struct timeval *result, x, y;
+timeval_subtract (struct timeval *result, struct timeval x, struct timeval y)
{
/* Perform the carry for the later subtraction by updating y. This
is safer because on some systems the tv_sec member is unsigned. */
@@ -3008,8 +2893,7 @@ timeval_subtract (result, x, y)
}
void
-XTflash (f)
- struct frame *f;
+XTflash (struct frame *f)
{
BLOCK_INPUT;
@@ -3017,18 +2901,16 @@ XTflash (f)
#ifdef USE_GTK
/* Use Gdk routines to draw. This way, we won't draw over scroll bars
when the scroll bars and the edit widget share the same X window. */
+ GdkWindow *window = gtk_widget_get_window (FRAME_GTK_WIDGET (f));
GdkGCValues vals;
GdkGC *gc;
vals.foreground.pixel = (FRAME_FOREGROUND_PIXEL (f)
^ FRAME_BACKGROUND_PIXEL (f));
vals.function = GDK_XOR;
- gc = gdk_gc_new_with_values (FRAME_GTK_WIDGET (f)->window,
- &vals,
- GDK_GC_FUNCTION
- | GDK_GC_FOREGROUND);
+ gc = gdk_gc_new_with_values (window,
+ &vals, GDK_GC_FUNCTION | GDK_GC_FOREGROUND);
#define XFillRectangle(d, win, gc, x, y, w, h) \
- gdk_draw_rectangle (FRAME_GTK_WIDGET (f)->window, \
- gc, TRUE, x, y, w, h)
+ gdk_draw_rectangle (window, gc, TRUE, x, y, w, h)
#else
GC gc;
@@ -3166,12 +3048,10 @@ XTflash (f)
static void
-XTtoggle_invisible_pointer (f, invisible)
- FRAME_PTR f;
- int invisible;
+XTtoggle_invisible_pointer (FRAME_PTR f, int invisible)
{
BLOCK_INPUT;
- if (invisible)
+ if (invisible)
{
if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor != 0)
XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
@@ -3188,10 +3068,8 @@ XTtoggle_invisible_pointer (f, invisible)
/* Make audible bell. */
void
-XTring_bell ()
+XTring_bell (struct frame *f)
{
- struct frame *f = SELECTED_FRAME ();
-
if (FRAME_X_DISPLAY (f))
{
#if defined (HAVE_TIMEVAL) && defined (HAVE_SELECT)
@@ -3215,8 +3093,7 @@ XTring_bell ()
that is bounded by calls to x_update_begin and x_update_end. */
static void
-XTset_terminal_window (n)
- register int n;
+XTset_terminal_window (struct frame *f, int n)
{
/* This function intentionally left blank. */
}
@@ -3231,9 +3108,7 @@ XTset_terminal_window (n)
lines or deleting -N lines at vertical position VPOS. */
static void
-x_ins_del_lines (f, vpos, n)
- struct frame *f;
- int vpos, n;
+x_ins_del_lines (struct frame *f, int vpos, int n)
{
abort ();
}
@@ -3242,9 +3117,7 @@ x_ins_del_lines (f, vpos, n)
/* Scroll part of the display as described by RUN. */
static void
-x_scroll_run (w, run)
- struct window *w;
- struct run *run;
+x_scroll_run (struct window *w, struct run *run)
{
struct frame *f = XFRAME (w->frame);
int x, y, width, height, from_y, to_y, bottom_y;
@@ -3301,8 +3174,7 @@ x_scroll_run (w, run)
static void
-frame_highlight (f)
- struct frame *f;
+frame_highlight (struct frame *f)
{
/* We used to only do this if Vx_no_window_manager was non-nil, but
the ICCCM (section 4.1.6) says that the window's border pixmap
@@ -3317,8 +3189,7 @@ frame_highlight (f)
}
static void
-frame_unhighlight (f)
- struct frame *f;
+frame_unhighlight (struct frame *f)
{
/* We used to only do this if Vx_no_window_manager was non-nil, but
the ICCCM (section 4.1.6) says that the window's border pixmap
@@ -3339,9 +3210,7 @@ frame_unhighlight (f)
Lisp code can tell when the switch took place by examining the events. */
static void
-x_new_focus_frame (dpyinfo, frame)
- struct x_display_info *dpyinfo;
- struct frame *frame;
+x_new_focus_frame (struct x_display_info *dpyinfo, struct frame *frame)
{
struct frame *old_focus = dpyinfo->x_focus_frame;
@@ -3368,12 +3237,7 @@ x_new_focus_frame (dpyinfo, frame)
a FOCUS_IN_EVENT into *BUFP. */
static void
-x_focus_changed (type, state, dpyinfo, frame, bufp)
- int type;
- int state;
- struct x_display_info *dpyinfo;
- struct frame *frame;
- struct input_event *bufp;
+x_focus_changed (int type, int state, struct x_display_info *dpyinfo, struct frame *frame, struct input_event *bufp)
{
if (type == FocusIn)
{
@@ -3425,10 +3289,7 @@ x_focus_changed (type, state, dpyinfo, frame, bufp)
Returns FOCUS_IN_EVENT event in *BUFP. */
static void
-x_detect_focus_change (dpyinfo, event, bufp)
- struct x_display_info *dpyinfo;
- XEvent *event;
- struct input_event *bufp;
+x_detect_focus_change (struct x_display_info *dpyinfo, XEvent *event, struct input_event *bufp)
{
struct frame *frame;
@@ -3477,8 +3338,7 @@ x_detect_focus_change (dpyinfo, event, bufp)
/* Handle an event saying the mouse has moved out of an Emacs frame. */
void
-x_mouse_leave (dpyinfo)
- struct x_display_info *dpyinfo;
+x_mouse_leave (struct x_display_info *dpyinfo)
{
x_new_focus_frame (dpyinfo, dpyinfo->x_focus_event_frame);
}
@@ -3492,15 +3352,13 @@ x_mouse_leave (dpyinfo)
the appropriate X display info. */
static void
-XTframe_rehighlight (frame)
- struct frame *frame;
+XTframe_rehighlight (struct frame *frame)
{
x_frame_rehighlight (FRAME_X_DISPLAY_INFO (frame));
}
static void
-x_frame_rehighlight (dpyinfo)
- struct x_display_info *dpyinfo;
+x_frame_rehighlight (struct x_display_info *dpyinfo)
{
struct frame *old_highlight = dpyinfo->x_highlight_frame;
@@ -3534,8 +3392,7 @@ x_frame_rehighlight (dpyinfo)
/* Initialize mode_switch_bit and modifier_meaning. */
static void
-x_find_modifier_meanings (dpyinfo)
- struct x_display_info *dpyinfo;
+x_find_modifier_meanings (struct x_display_info *dpyinfo)
{
int min_code, max_code;
KeySym *syms;
@@ -3646,9 +3503,7 @@ x_find_modifier_meanings (dpyinfo)
Emacs uses. */
unsigned int
-x_x_to_emacs_modifiers (dpyinfo, state)
- struct x_display_info *dpyinfo;
- unsigned int state;
+x_x_to_emacs_modifiers (struct x_display_info *dpyinfo, unsigned int state)
{
EMACS_UINT mod_meta = meta_modifier;
EMACS_UINT mod_alt = alt_modifier;
@@ -3675,9 +3530,7 @@ x_x_to_emacs_modifiers (dpyinfo, state)
}
static unsigned int
-x_emacs_to_x_modifiers (dpyinfo, state)
- struct x_display_info *dpyinfo;
- unsigned int state;
+x_emacs_to_x_modifiers (struct x_display_info *dpyinfo, unsigned int state)
{
EMACS_UINT mod_meta = meta_modifier;
EMACS_UINT mod_alt = alt_modifier;
@@ -3707,8 +3560,7 @@ x_emacs_to_x_modifiers (dpyinfo, state)
/* Convert a keysym to its name. */
char *
-x_get_keysym_name (keysym)
- KeySym keysym;
+x_get_keysym_name (int keysym)
{
char *value;
@@ -3729,10 +3581,7 @@ x_get_keysym_name (keysym)
the mouse. */
static Lisp_Object
-construct_mouse_click (result, event, f)
- struct input_event *result;
- XButtonEvent *event;
- struct frame *f;
+construct_mouse_click (struct input_event *result, XButtonEvent *event, struct frame *f)
{
/* Make the event type NO_EVENT; we'll change that when we decide
otherwise. */
@@ -3765,9 +3614,7 @@ static XMotionEvent last_mouse_motion_event;
static Lisp_Object last_mouse_motion_frame;
static int
-note_mouse_movement (frame, event)
- FRAME_PTR frame;
- XMotionEvent *event;
+note_mouse_movement (FRAME_PTR frame, XMotionEvent *event)
{
last_mouse_movement_time = event->time;
last_mouse_motion_event = *event;
@@ -3811,7 +3658,7 @@ note_mouse_movement (frame, event)
************************************************************************/
static void
-redo_mouse_highlight ()
+redo_mouse_highlight (void)
{
if (!NILP (last_mouse_motion_frame)
&& FRAME_LIVE_P (XFRAME (last_mouse_motion_frame)))
@@ -3843,13 +3690,7 @@ redo_mouse_highlight ()
movement. */
static void
-XTmouse_position (fp, insist, bar_window, part, x, y, time)
- FRAME_PTR *fp;
- int insist;
- Lisp_Object *bar_window;
- enum scroll_bar_part *part;
- Lisp_Object *x, *y;
- unsigned long *time;
+XTmouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, long unsigned int *time)
{
FRAME_PTR f1;
@@ -4051,9 +3892,7 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time)
bits. */
static struct scroll_bar *
-x_window_to_scroll_bar (display, window_id)
- Display *display;
- Window window_id;
+x_window_to_scroll_bar (Display *display, Window window_id)
{
Lisp_Object tail;
@@ -4098,8 +3937,7 @@ x_window_to_scroll_bar (display, window_id)
if WINDOW is not part of a menu bar. */
static Widget
-x_window_to_menu_bar (window)
- Window window;
+x_window_to_menu_bar (Window window)
{
Lisp_Object tail;
@@ -4127,12 +3965,12 @@ x_window_to_menu_bar (window)
#ifdef USE_TOOLKIT_SCROLL_BARS
-static void x_scroll_bar_to_input_event P_ ((XEvent *, struct input_event *));
-static void x_send_scroll_bar_event P_ ((Lisp_Object, int, int, int));
-static void x_create_toolkit_scroll_bar P_ ((struct frame *,
- struct scroll_bar *));
-static void x_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *,
- int, int, int));
+static void x_scroll_bar_to_input_event (XEvent *, struct input_event *);
+static void x_send_scroll_bar_event (Lisp_Object, int, int, int);
+static void x_create_toolkit_scroll_bar (struct frame *,
+ struct scroll_bar *);
+static void x_set_toolkit_scroll_bar_thumb (struct scroll_bar *,
+ int, int, int);
/* Lisp window being scrolled. Set when starting to interact with
@@ -4166,14 +4004,8 @@ static Boolean xaw3d_pick_top;
a `end-scroll' SCROLL_BAR_CLICK_EVENT' event if so. */
static void
-xt_action_hook (widget, client_data, action_name, event, params,
- num_params)
- Widget widget;
- XtPointer client_data;
- String action_name;
- XEvent *event;
- String *params;
- Cardinal *num_params;
+xt_action_hook (Widget widget, XtPointer client_data, String action_name,
+ XEvent *event, String *params, Cardinal *num_params)
{
int scroll_bar_p;
char *end_action;
@@ -4224,9 +4056,7 @@ static int scroll_bar_windows_size;
amount to scroll of a whole of WHOLE. */
static void
-x_send_scroll_bar_event (window, part, portion, whole)
- Lisp_Object window;
- int part, portion, whole;
+x_send_scroll_bar_event (Lisp_Object window, int part, int portion, int whole)
{
XEvent event;
XClientMessageEvent *ev = (XClientMessageEvent *) &event;
@@ -4259,7 +4089,7 @@ x_send_scroll_bar_event (window, part, portion, whole)
scroll_bar_windows = (struct window **) xrealloc (scroll_bar_windows,
nbytes);
- bzero (&scroll_bar_windows[i], nbytes - old_nbytes);
+ memset (&scroll_bar_windows[i], 0, nbytes - old_nbytes);
scroll_bar_windows_size = new_size;
}
@@ -4288,9 +4118,7 @@ x_send_scroll_bar_event (window, part, portion, whole)
in *IEVENT. */
static void
-x_scroll_bar_to_input_event (event, ievent)
- XEvent *event;
- struct input_event *ievent;
+x_scroll_bar_to_input_event (XEvent *event, struct input_event *ievent)
{
XClientMessageEvent *ev = (XClientMessageEvent *) event;
Lisp_Object window;
@@ -4331,9 +4159,7 @@ x_scroll_bar_to_input_event (event, ievent)
CALL_DATA is a pointer to a XmScrollBarCallbackStruct. */
static void
-xm_scroll_callback (widget, client_data, call_data)
- Widget widget;
- XtPointer client_data, call_data;
+xm_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data)
{
struct scroll_bar *bar = (struct scroll_bar *) client_data;
XmScrollBarCallbackStruct *cs = (XmScrollBarCallbackStruct *) call_data;
@@ -4428,7 +4254,8 @@ xg_scroll_callback (GtkRange *range,
&& FRAME_X_DISPLAY_INFO (f)->grabbed < (1 << 4))
{
part = scroll_bar_handle;
- whole = adj->upper - adj->page_size;
+ whole = gtk_adjustment_get_upper (adj) -
+ gtk_adjustment_get_page_size (adj);
portion = min ((int)position, whole);
bar->dragging = make_number ((int)portion);
}
@@ -4489,9 +4316,7 @@ xg_end_scroll_callback (GtkWidget *widget,
the thumb is. */
static void
-xaw_jump_callback (widget, client_data, call_data)
- Widget widget;
- XtPointer client_data, call_data;
+xaw_jump_callback (Widget widget, XtPointer client_data, XtPointer call_data)
{
struct scroll_bar *bar = (struct scroll_bar *) client_data;
float top = *(float *) call_data;
@@ -4533,9 +4358,7 @@ xaw_jump_callback (widget, client_data, call_data)
Values < height of scroll bar mean line-wise movement. */
static void
-xaw_scroll_callback (widget, client_data, call_data)
- Widget widget;
- XtPointer client_data, call_data;
+xaw_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data)
{
struct scroll_bar *bar = (struct scroll_bar *) client_data;
/* The position really is stored cast to a pointer. */
@@ -4573,9 +4396,7 @@ xaw_scroll_callback (widget, client_data, call_data)
#ifdef USE_GTK
static void
-x_create_toolkit_scroll_bar (f, bar)
- struct frame *f;
- struct scroll_bar *bar;
+x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
{
char *scroll_bar_name = SCROLL_BAR_NAME;
@@ -4589,9 +4410,7 @@ x_create_toolkit_scroll_bar (f, bar)
#else /* not USE_GTK */
static void
-x_create_toolkit_scroll_bar (f, bar)
- struct frame *f;
- struct scroll_bar *bar;
+x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
{
Window xwindow;
Widget widget;
@@ -4684,7 +4503,7 @@ x_create_toolkit_scroll_bar (f, bar)
if (f->output_data.x->scroll_bar_top_shadow_pixel == -1)
{
pixel = f->output_data.x->scroll_bar_background_pixel;
- if (pixel != -1)
+ if (pixel != -1)
{
if (!x_alloc_lighter_color (f, FRAME_X_DISPLAY (f),
FRAME_X_COLORMAP (f),
@@ -4696,7 +4515,7 @@ x_create_toolkit_scroll_bar (f, bar)
if (f->output_data.x->scroll_bar_bottom_shadow_pixel == -1)
{
pixel = f->output_data.x->scroll_bar_background_pixel;
- if (pixel != -1)
+ if (pixel != -1)
{
if (!x_alloc_lighter_color (f, FRAME_X_DISPLAY (f),
FRAME_X_COLORMAP (f),
@@ -4791,18 +4610,15 @@ x_create_toolkit_scroll_bar (f, bar)
#ifdef USE_GTK
static void
-x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
- struct scroll_bar *bar;
- int portion, position, whole;
+x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position, int whole)
{
xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole);
}
#else /* not USE_GTK */
static void
-x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
- struct scroll_bar *bar;
- int portion, position, whole;
+x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int position,
+ int whole)
{
struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
Widget widget = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar);
@@ -4917,9 +4733,7 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
scroll bar. */
static struct scroll_bar *
-x_scroll_bar_create (w, top, left, width, height)
- struct window *w;
- int top, left, width, height;
+x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
{
struct frame *f = XFRAME (w->frame);
struct scroll_bar *bar
@@ -4998,7 +4812,6 @@ x_scroll_bar_create (w, top, left, width, height)
left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
max (height, 1));
- xg_show_scroll_bar (bar->x_window);
#else /* not USE_GTK */
Widget scroll_bar = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar);
XtConfigureWidget (scroll_bar,
@@ -5034,10 +4847,7 @@ x_scroll_bar_create (w, top, left, width, height)
to move to the very end of the buffer. */
static void
-x_scroll_bar_set_handle (bar, start, end, rebuild)
- struct scroll_bar *bar;
- int start, end;
- int rebuild;
+x_scroll_bar_set_handle (struct scroll_bar *bar, int start, int end, int rebuild)
{
int dragging = ! NILP (bar->dragging);
Window w = bar->x_window;
@@ -5135,8 +4945,7 @@ x_scroll_bar_set_handle (bar, start, end, rebuild)
nil. */
static void
-x_scroll_bar_remove (bar)
- struct scroll_bar *bar;
+x_scroll_bar_remove (struct scroll_bar *bar)
{
struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
BLOCK_INPUT;
@@ -5164,9 +4973,7 @@ x_scroll_bar_remove (bar)
create one. */
static void
-XTset_vertical_scroll_bar (w, portion, whole, position)
- struct window *w;
- int portion, whole, position;
+XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int position)
{
struct frame *f = XFRAME (w->frame);
struct scroll_bar *bar;
@@ -5383,8 +5190,7 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
`*redeem_scroll_bar_hook' is applied to its window before the judgment. */
static void
-XTcondemn_scroll_bars (frame)
- FRAME_PTR frame;
+XTcondemn_scroll_bars (FRAME_PTR frame)
{
/* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */
while (! NILP (FRAME_SCROLL_BARS (frame)))
@@ -5405,8 +5211,7 @@ XTcondemn_scroll_bars (frame)
Note that WINDOW isn't necessarily condemned at all. */
static void
-XTredeem_scroll_bar (window)
- struct window *window;
+XTredeem_scroll_bar (struct window *window)
{
struct scroll_bar *bar;
struct frame *f;
@@ -5451,8 +5256,7 @@ XTredeem_scroll_bar (window)
last call to `*condemn_scroll_bars_hook'. */
static void
-XTjudge_scroll_bars (f)
- FRAME_PTR f;
+XTjudge_scroll_bars (FRAME_PTR f)
{
Lisp_Object bar, next;
@@ -5485,9 +5289,7 @@ XTjudge_scroll_bars (f)
mark bits. */
static void
-x_scroll_bar_expose (bar, event)
- struct scroll_bar *bar;
- XEvent *event;
+x_scroll_bar_expose (struct scroll_bar *bar, XEvent *event)
{
Window w = bar->x_window;
FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
@@ -5529,10 +5331,7 @@ x_scroll_bar_expose (bar, event)
static void
-x_scroll_bar_handle_click (bar, event, emacs_event)
- struct scroll_bar *bar;
- XEvent *event;
- struct input_event *emacs_event;
+x_scroll_bar_handle_click (struct scroll_bar *bar, XEvent *event, struct input_event *emacs_event)
{
if (! WINDOWP (bar->window))
abort ();
@@ -5590,9 +5389,7 @@ x_scroll_bar_handle_click (bar, event, emacs_event)
mark bits. */
static void
-x_scroll_bar_note_movement (bar, event)
- struct scroll_bar *bar;
- XEvent *event;
+x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event)
{
FRAME_PTR f = XFRAME (XWINDOW (bar->window)->frame);
@@ -5622,12 +5419,7 @@ x_scroll_bar_note_movement (bar, event)
on the scroll bar. */
static void
-x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
- FRAME_PTR *fp;
- Lisp_Object *bar_window;
- enum scroll_bar_part *part;
- Lisp_Object *x, *y;
- unsigned long *time;
+x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, long unsigned int *time)
{
struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar);
Window w = bar->x_window;
@@ -5699,8 +5491,7 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
redraw them. */
void
-x_scroll_bar_clear (f)
- FRAME_PTR f;
+x_scroll_bar_clear (FRAME_PTR f)
{
#ifndef USE_TOOLKIT_SCROLL_BARS
Lisp_Object bar;
@@ -5753,22 +5544,18 @@ struct x_display_info *XTread_socket_fake_io_error;
static struct x_display_info *next_noop_dpyinfo;
-#define SET_SAVED_MENU_EVENT(size) \
+#define SET_SAVED_BUTTON_EVENT \
do \
{ \
if (f->output_data.x->saved_menu_event == 0) \
f->output_data.x->saved_menu_event \
= (XEvent *) xmalloc (sizeof (XEvent)); \
- bcopy (&event, f->output_data.x->saved_menu_event, size); \
+ *f->output_data.x->saved_menu_event = event; \
inev.ie.kind = MENU_BAR_ACTIVATE_EVENT; \
XSETFRAME (inev.ie.frame_or_window, f); \
} \
while (0)
-#define SET_SAVED_BUTTON_EVENT SET_SAVED_MENU_EVENT (sizeof (XButtonEvent))
-#define SET_SAVED_KEY_EVENT SET_SAVED_MENU_EVENT (sizeof (XKeyEvent))
-
-
enum
{
X_EVENT_NORMAL,
@@ -5786,9 +5573,7 @@ enum
#ifdef HAVE_X_I18N
static int
-x_filter_event (dpyinfo, event)
- struct x_display_info *dpyinfo;
- XEvent *event;
+x_filter_event (struct x_display_info *dpyinfo, XEvent *event)
{
/* XFilterEvent returns non-zero if the input method has
consumed the event. We pass the frame's X window to
@@ -5811,10 +5596,7 @@ static struct input_event *current_hold_quit;
It is invoked before the XEvent is translated to a GdkEvent,
so we have a chance to act on the event before GTK. */
static GdkFilterReturn
-event_handler_gdk (gxev, ev, data)
- GdkXEvent *gxev;
- GdkEvent *ev;
- gpointer data;
+event_handler_gdk (GdkXEvent *gxev, GdkEvent *ev, gpointer data)
{
XEvent *xev = (XEvent *) gxev;
@@ -5867,11 +5649,7 @@ event_handler_gdk (gxev, ev, data)
We return the number of characters stored into the buffer. */
static int
-handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
- struct x_display_info *dpyinfo;
- XEvent *eventp;
- int *finish;
- struct input_event *hold_quit;
+handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish, struct input_event *hold_quit)
{
union {
struct input_event ie;
@@ -5889,10 +5667,10 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
EVENT_INIT (inev.ie);
inev.ie.kind = NO_EVENT;
inev.ie.arg = Qnil;
-
+
if (pending_event_wait.eventtype == event.type)
pending_event_wait.eventtype = 0; /* Indicates we got it. */
-
+
switch (event.type)
{
case ClientMessage:
@@ -6405,7 +6183,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
this enables ComposeCharacter to work whether or
not it is combined with Meta. */
if (modifiers & dpyinfo->meta_mod_mask)
- bzero (&compose_status, sizeof (compose_status));
+ memset (&compose_status, 0, sizeof (compose_status));
#ifdef HAVE_X_I18N
if (FRAME_XIC (f))
@@ -6453,7 +6231,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
if (compose_status.chars_matched > 0 && nbytes == 0)
break;
- bzero (&compose_status, sizeof (compose_status));
+ memset (&compose_status, 0, sizeof (compose_status));
orig_keysym = keysym;
/* Common for all keysym input events. */
@@ -6812,7 +6590,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
event.xconfigure.height);
f = 0;
}
-#endif
+#endif
if (f)
{
#ifndef USE_X_TOOLKIT
@@ -6846,7 +6624,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
/* GTK creates windows but doesn't map them.
Only get real positions when mapped. */
if (FRAME_GTK_OUTER_WIDGET (f)
- && GTK_WIDGET_MAPPED (FRAME_GTK_OUTER_WIDGET (f)))
+ && gtk_widget_get_mapped (FRAME_GTK_OUTER_WIDGET (f)))
#endif
{
x_real_positions (f, &f->left_pos, &f->top_pos);
@@ -6867,7 +6645,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
by the rest of Emacs, we put it here. */
int tool_bar_p = 0;
- bzero (&compose_status, sizeof (compose_status));
+ memset (&compose_status, 0, sizeof (compose_status));
last_mouse_glyph_frame = 0;
last_user_time = event.xbutton.time;
@@ -6965,20 +6743,18 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
f->mouse_moved = 0;
#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
- f = x_menubar_window_to_frame (dpyinfo, event.xbutton.window);
+ f = x_menubar_window_to_frame (dpyinfo, &event);
/* For a down-event in the menu bar,
don't pass it to Xt right now.
Instead, save it away
and we will pass it to Xt from kbd_buffer_get_event.
That way, we can run some Lisp code first. */
- if (
+ if (! popup_activated ()
#ifdef USE_GTK
- ! popup_activated ()
/* Gtk+ menus only react to the first three buttons. */
&& event.xbutton.button < 3
- &&
#endif
- f && event.type == ButtonPress
+ && f && event.type == ButtonPress
/* Verify the event is really within the menu bar
and not just sent to it due to grabbing. */
&& event.xbutton.x >= 0
@@ -6989,30 +6765,13 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
{
SET_SAVED_BUTTON_EVENT;
XSETFRAME (last_mouse_press_frame, f);
-#ifdef USE_GTK
*finish = X_EVENT_DROP;
-#endif
}
else if (event.type == ButtonPress)
{
last_mouse_press_frame = Qnil;
goto OTHER;
}
-
-#ifdef USE_MOTIF /* This should do not harm for Lucid,
- but I am trying to be cautious. */
- else if (event.type == ButtonRelease)
- {
- if (!NILP (last_mouse_press_frame))
- {
- f = XFRAME (last_mouse_press_frame);
- if (f->output_data.x)
- SET_SAVED_BUTTON_EVENT;
- }
- else
- goto OTHER;
- }
-#endif /* USE_MOTIF */
else
goto OTHER;
#endif /* USE_X_TOOLKIT || USE_GTK */
@@ -7098,9 +6857,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
Returns the value handle_one_xevent sets in the finish argument. */
int
-x_dispatch_event (event, display)
- XEvent *event;
- Display *display;
+x_dispatch_event (XEvent *event, Display *display)
{
struct x_display_info *dpyinfo;
int finish = X_EVENT_NORMAL;
@@ -7126,10 +6883,7 @@ x_dispatch_event (event, display)
EXPECTED is nonzero if the caller knows input is available. */
static int
-XTread_socket (terminal, expected, hold_quit)
- struct terminal *terminal;
- int expected;
- struct input_event *hold_quit;
+XTread_socket (struct terminal *terminal, int expected, struct input_event *hold_quit)
{
int count = 0;
XEvent event;
@@ -7280,11 +7034,7 @@ XTread_socket (terminal, expected, hold_quit)
mode lines must be clipped to the whole window. */
static void
-x_clip_to_row (w, row, area, gc)
- struct window *w;
- struct glyph_row *row;
- int area;
- GC gc;
+x_clip_to_row (struct window *w, struct glyph_row *row, int area, GC gc)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
XRectangle clip_rect;
@@ -7305,9 +7055,7 @@ x_clip_to_row (w, row, area, gc)
/* Draw a hollow box cursor on window W in glyph row ROW. */
static void
-x_draw_hollow_cursor (w, row)
- struct window *w;
- struct glyph_row *row;
+x_draw_hollow_cursor (struct window *w, struct glyph_row *row)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -7352,11 +7100,7 @@ x_draw_hollow_cursor (w, row)
--gerd. */
static void
-x_draw_bar_cursor (w, row, width, kind)
- struct window *w;
- struct glyph_row *row;
- int width;
- enum text_cursor_kinds kind;
+x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text_cursor_kinds kind)
{
struct frame *f = XFRAME (w->frame);
struct glyph *cursor_glyph;
@@ -7447,9 +7191,7 @@ x_draw_bar_cursor (w, row, width, kind)
/* RIF: Define cursor CURSOR on frame F. */
static void
-x_define_frame_cursor (f, cursor)
- struct frame *f;
- Cursor cursor;
+x_define_frame_cursor (struct frame *f, Cursor cursor)
{
if (!f->pointer_invisible
&& f->output_data.x->current_cursor != cursor)
@@ -7461,9 +7203,7 @@ x_define_frame_cursor (f, cursor)
/* RIF: Clear area on frame F. */
static void
-x_clear_frame_area (f, x, y, width, height)
- struct frame *f;
- int x, y, width, height;
+x_clear_frame_area (struct frame *f, int x, int y, int width, int height)
{
x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
x, y, width, height, False);
@@ -7478,12 +7218,7 @@ x_clear_frame_area (f, x, y, width, height)
/* RIF: Draw cursor on window W. */
static void
-x_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, active_p)
- struct window *w;
- struct glyph_row *glyph_row;
- int x, y;
- int cursor_type, cursor_width;
- int on_p, active_p;
+x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x, int y, int cursor_type, int cursor_width, int on_p, int active_p)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
@@ -7547,9 +7282,7 @@ x_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, activ
/* Make the x-window of frame F use the gnu icon bitmap. */
int
-x_bitmap_icon (f, file)
- struct frame *f;
- Lisp_Object file;
+x_bitmap_icon (struct frame *f, Lisp_Object file)
{
int bitmap_id;
@@ -7626,9 +7359,7 @@ x_bitmap_icon (f, file)
Use ICON_NAME as the text. */
int
-x_text_icon (f, icon_name)
- struct frame *f;
- char *icon_name;
+x_text_icon (struct frame *f, char *icon_name)
{
if (FRAME_X_WINDOW (f) == 0)
return 1;
@@ -7671,9 +7402,7 @@ static struct x_error_message_stack *x_error_message;
x_catch_errors is in effect. */
static void
-x_error_catcher (display, error)
- Display *display;
- XErrorEvent *error;
+x_error_catcher (Display *display, XErrorEvent *error)
{
XGetErrorText (display, error->error_code,
x_error_message->string,
@@ -7693,11 +7422,10 @@ x_error_catcher (display, error)
Calling x_uncatch_errors resumes the normal error handling. */
-void x_check_errors ();
+void x_check_errors (Display *dpy, char *format);
void
-x_catch_errors (dpy)
- Display *dpy;
+x_catch_errors (Display *dpy)
{
struct x_error_message_stack *data = xmalloc (sizeof (*data));
@@ -7714,7 +7442,7 @@ x_catch_errors (dpy)
DPY should be the display that was passed to x_catch_errors. */
void
-x_uncatch_errors ()
+x_uncatch_errors (void)
{
struct x_error_message_stack *tmp;
@@ -7736,9 +7464,7 @@ x_uncatch_errors ()
sprintf (a buffer, FORMAT, the x error message text) as the text. */
void
-x_check_errors (dpy, format)
- Display *dpy;
- char *format;
+x_check_errors (Display *dpy, char *format)
{
/* Make sure to catch any errors incurred so far. */
XSync (dpy, False);
@@ -7746,7 +7472,7 @@ x_check_errors (dpy, format)
if (x_error_message->string[0])
{
char string[X_ERROR_MESSAGE_SIZE];
- bcopy (x_error_message->string, string, X_ERROR_MESSAGE_SIZE);
+ memcpy (string, x_error_message->string, X_ERROR_MESSAGE_SIZE);
x_uncatch_errors ();
error (format, string);
}
@@ -7756,8 +7482,7 @@ x_check_errors (dpy, format)
since we did x_catch_errors on DPY. */
int
-x_had_errors_p (dpy)
- Display *dpy;
+x_had_errors_p (Display *dpy)
{
/* Make sure to catch any errors incurred so far. */
XSync (dpy, False);
@@ -7768,8 +7493,7 @@ x_had_errors_p (dpy)
/* Forget about any errors we have had, since we did x_catch_errors on DPY. */
void
-x_clear_errors (dpy)
- Display *dpy;
+x_clear_errors (Display *dpy)
{
x_error_message->string[0] = 0;
}
@@ -7779,7 +7503,7 @@ x_clear_errors (dpy)
/* Close off all unclosed x_catch_errors calls. */
void
-x_fully_uncatch_errors ()
+x_fully_uncatch_errors (void)
{
while (x_error_message)
x_uncatch_errors ();
@@ -7789,14 +7513,14 @@ x_fully_uncatch_errors ()
/* Nonzero if x_catch_errors has been done and not yet canceled. */
int
-x_catching_errors ()
+x_catching_errors (void)
{
return x_error_message != 0;
}
#if 0
static unsigned int x_wire_count;
-x_trace_wire ()
+x_trace_wire (void)
{
fprintf (stderr, "Lib call: %d\n", ++x_wire_count);
}
@@ -7810,8 +7534,8 @@ x_trace_wire ()
which will do the appropriate cleanup for us. */
static SIGTYPE
-x_connection_signal (signalnum) /* If we don't have an argument, */
- int signalnum; /* some compilers complain in signal calls. */
+x_connection_signal (int signalnum) /* If we don't have an argument, */
+ /* some compilers complain in signal calls. */
{
#ifdef USG
/* USG systems forget handlers when they are used;
@@ -7834,7 +7558,7 @@ static char *error_msg;
instead of dumping core when XtCloseDisplay fails. */
static void
-x_fatal_error_signal ()
+x_fatal_error_signal (void)
{
fprintf (stderr, "%s\n", error_msg);
exit (70);
@@ -7844,9 +7568,7 @@ x_fatal_error_signal ()
the text of an error message that lead to the connection loss. */
static SIGTYPE
-x_connection_closed (dpy, error_message)
- Display *dpy;
- char *error_message;
+x_connection_closed (Display *dpy, char *error_message)
{
struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
Lisp_Object frame, tail;
@@ -7921,7 +7643,7 @@ x_connection_closed (dpy, error_message)
/* If DPYINFO is null, this means we didn't open the display
in the first place, so don't try to close it. */
{
- extern void (*fatal_error_signal_hook) P_ ((void));
+ extern void (*fatal_error_signal_hook) (void);
fatal_error_signal_hook = x_fatal_error_signal;
XtCloseDisplay (dpy);
fatal_error_signal_hook = NULL;
@@ -7982,15 +7704,13 @@ x_connection_closed (dpy, error_message)
/* We specifically use it before defining it, so that gcc doesn't inline it,
otherwise gdb doesn't know how to properly put a breakpoint on it. */
-static void x_error_quitter P_ ((Display *, XErrorEvent *));
+static void x_error_quitter (Display *, XErrorEvent *);
/* This is the first-level handler for X protocol errors.
It calls x_error_quitter or x_error_catcher. */
static int
-x_error_handler (display, error)
- Display *display;
- XErrorEvent *error;
+x_error_handler (Display *display, XErrorEvent *error)
{
if (x_error_message)
x_error_catcher (display, error);
@@ -8021,9 +7741,7 @@ x_error_handler (display, error)
after x_error_handler prevents inlining into the former. */
static void NO_INLINE
-x_error_quitter (display, error)
- Display *display;
- XErrorEvent *error;
+x_error_quitter (Display *display, XErrorEvent *error)
{
char buf[256], buf1[356];
@@ -8048,8 +7766,7 @@ x_error_quitter (display, error)
If that was the only one, it prints an error message and kills Emacs. */
static int
-x_io_error_quitter (display)
- Display *display;
+x_io_error_quitter (Display *display)
{
char buf[256];
@@ -8066,10 +7783,7 @@ x_io_error_quitter (display)
FONT-OBJECT. */
Lisp_Object
-x_new_font (f, font_object, fontset)
- struct frame *f;
- Lisp_Object font_object;
- int fontset;
+x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
{
struct font *font = XFONT_OBJECT (font_object);
@@ -8138,10 +7852,7 @@ x_new_font (f, font_object, fontset)
pointer to the x_display_info structure corresponding to XIM. */
static void
-xim_destroy_callback (xim, client_data, call_data)
- XIM xim;
- XPointer client_data;
- XPointer call_data;
+xim_destroy_callback (XIM xim, XPointer client_data, XPointer call_data)
{
struct x_display_info *dpyinfo = (struct x_display_info *) client_data;
Lisp_Object frame, tail;
@@ -8169,16 +7880,14 @@ xim_destroy_callback (xim, client_data, call_data)
#ifdef HAVE_X11R6
/* This isn't prototyped in OSF 5.0 or 5.1a. */
-extern char *XSetIMValues P_ ((XIM, ...));
+extern char *XSetIMValues (XIM, ...);
#endif
/* Open the connection to the XIM server on display DPYINFO.
RESOURCE_NAME is the resource name Emacs uses. */
static void
-xim_open_dpy (dpyinfo, resource_name)
- struct x_display_info *dpyinfo;
- char *resource_name;
+xim_open_dpy (struct x_display_info *dpyinfo, char *resource_name)
{
XIM xim;
@@ -8222,10 +7931,7 @@ xim_open_dpy (dpyinfo, resource_name)
when the callback was registered. */
static void
-xim_instantiate_callback (display, client_data, call_data)
- Display *display;
- XPointer client_data;
- XPointer call_data;
+xim_instantiate_callback (Display *display, XPointer client_data, XPointer call_data)
{
struct xim_inst_t *xim_inst = (struct xim_inst_t *) client_data;
struct x_display_info *dpyinfo = xim_inst->dpyinfo;
@@ -8275,9 +7981,7 @@ xim_instantiate_callback (display, client_data, call_data)
in the XIM instantiate callback function. */
static void
-xim_initialize (dpyinfo, resource_name)
- struct x_display_info *dpyinfo;
- char *resource_name;
+xim_initialize (struct x_display_info *dpyinfo, char *resource_name)
{
dpyinfo->xim = NULL;
#ifdef HAVE_XIM
@@ -8292,7 +7996,7 @@ xim_initialize (dpyinfo, resource_name)
xim_inst->dpyinfo = dpyinfo;
len = strlen (resource_name);
xim_inst->resource_name = (char *) xmalloc (len + 1);
- bcopy (resource_name, xim_inst->resource_name, len + 1);
+ memcpy (xim_inst->resource_name, resource_name, len + 1);
XRegisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb,
resource_name, EMACS_CLASS,
xim_instantiate_callback,
@@ -8311,8 +8015,7 @@ xim_initialize (dpyinfo, resource_name)
/* Close the connection to the XIM server on display DPYINFO. */
static void
-xim_close_dpy (dpyinfo)
- struct x_display_info *dpyinfo;
+xim_close_dpy (struct x_display_info *dpyinfo)
{
#ifdef HAVE_XIM
if (use_xim)
@@ -8341,8 +8044,7 @@ xim_close_dpy (dpyinfo)
from its current recorded position values and gravity. */
void
-x_calc_absolute_position (f)
- struct frame *f;
+x_calc_absolute_position (struct frame *f)
{
int flags = f->size_hint_flags;
@@ -8394,10 +8096,7 @@ x_calc_absolute_position (f)
which means, do adjust for borders but don't change the gravity. */
void
-x_set_offset (f, xoff, yoff, change_gravity)
- struct frame *f;
- register int xoff, yoff;
- int change_gravity;
+x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity)
{
int modified_top, modified_left;
@@ -8466,9 +8165,7 @@ x_set_offset (f, xoff, yoff, change_gravity)
http://freedesktop.org/wiki/Specifications/wm-spec. */
static int
-wm_supports (f, atomname)
- struct frame *f;
- const char *atomname;
+wm_supports (struct frame *f, const char *atomname)
{
Atom actual_type;
unsigned long actual_size, bytes_remaining;
@@ -8557,11 +8254,7 @@ wm_supports (f, atomname)
}
static void
-set_wm_state (frame, add, what, what2)
- Lisp_Object frame;
- int add;
- const char *what;
- const char *what2;
+set_wm_state (Lisp_Object frame, int add, const char *what, const char *what2)
{
const char *atom = "_NET_WM_STATE";
Fx_send_client_event (frame, make_number (0), frame,
@@ -8579,9 +8272,7 @@ set_wm_state (frame, add, what, what2)
}
void
-x_set_sticky (f, new_value, old_value)
- struct frame *f;
- Lisp_Object new_value, old_value;
+x_set_sticky (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
Lisp_Object frame;
@@ -8593,8 +8284,7 @@ x_set_sticky (f, new_value, old_value)
/* Do fullscreen as specified in extended window manager hints */
static int
-do_ewmh_fullscreen (f)
- struct frame *f;
+do_ewmh_fullscreen (struct frame *f)
{
int have_net_atom = wm_supports (f, "_NET_WM_STATE");
@@ -8615,7 +8305,7 @@ do_ewmh_fullscreen (f)
set_wm_state (frame, 0, fs, NULL);
set_wm_state (frame, 0, fh, NULL);
set_wm_state (frame, 0, fw, NULL);
-
+
/* If there are _NET_ atoms we assume we have extended window manager
hints. */
switch (f->want_fullscreen)
@@ -8642,8 +8332,7 @@ do_ewmh_fullscreen (f)
}
static void
-XTfullscreen_hook (f)
- FRAME_PTR f;
+XTfullscreen_hook (FRAME_PTR f)
{
if (f->async_visible)
{
@@ -8656,9 +8345,7 @@ XTfullscreen_hook (f)
static void
-x_handle_net_wm_state (f, event)
- struct frame *f;
- XPropertyEvent *event;
+x_handle_net_wm_state (struct frame *f, XPropertyEvent *event)
{
Atom actual_type;
unsigned long actual_size, bytes_remaining;
@@ -8691,7 +8378,7 @@ x_handle_net_wm_state (f, event)
for (i = 0; i < actual_size; ++i)
{
Atom a = ((Atom*)tmp_data)[i];
- if (a == dpyinfo->Xatom_net_wm_state_maximized_horz)
+ if (a == dpyinfo->Xatom_net_wm_state_maximized_horz)
{
if (value == FULLSCREEN_HEIGHT)
value = FULLSCREEN_MAXIMIZED;
@@ -8712,7 +8399,7 @@ x_handle_net_wm_state (f, event)
}
lval = Qnil;
- switch (value)
+ switch (value)
{
case FULLSCREEN_WIDTH:
lval = Qfullwidth;
@@ -8727,7 +8414,7 @@ x_handle_net_wm_state (f, event)
lval = Qmaximized;
break;
}
-
+
store_frame_param (f, Qfullscreen, lval);
store_frame_param (f, Qsticky, sticky ? Qt : Qnil);
@@ -8738,8 +8425,7 @@ x_handle_net_wm_state (f, event)
/* Check if we need to resize the frame due to a fullscreen request.
If so needed, resize the frame. */
static void
-x_check_fullscreen (f)
- struct frame *f;
+x_check_fullscreen (struct frame *f)
{
if (do_ewmh_fullscreen (f))
return;
@@ -8766,7 +8452,7 @@ x_check_fullscreen (f)
case FULLSCREEN_HEIGHT:
height = x_display_pixel_height (dpyinfo);
}
-
+
if (FRAME_COLS (f) != width || FRAME_LINES (f) != height)
{
change_frame_size (f, height, width, 0, 1, 0);
@@ -8785,10 +8471,7 @@ x_check_fullscreen (f)
compensate by moving the window right and down by the proper amount. */
static void
-x_check_expected_move (f, expected_left, expected_top)
- struct frame *f;
- int expected_left;
- int expected_top;
+x_check_expected_move (struct frame *f, int expected_left, int expected_top)
{
int current_left = 0, current_top = 0;
@@ -8833,9 +8516,7 @@ x_check_expected_move (f, expected_left, expected_top)
of an exact comparison. */
static void
-x_sync_with_move (f, left, top, fuzzy)
- struct frame *f;
- int left, top, fuzzy;
+x_sync_with_move (struct frame *f, int left, int top, int fuzzy)
{
int count = 0;
@@ -8872,9 +8553,7 @@ x_sync_with_move (f, left, top, fuzzy)
/* Wait for an event on frame F matching EVENTTYPE. */
void
-x_wait_for_event (f, eventtype)
- struct frame *f;
- int eventtype;
+x_wait_for_event (struct frame *f, int eventtype)
{
int level = interrupt_input_blocked;
@@ -8901,7 +8580,7 @@ x_wait_for_event (f, eventtype)
FD_ZERO (&fds);
FD_SET (fd, &fds);
-
+
EMACS_GET_TIME (time_now);
EMACS_SUB_TIME (tmo, tmo_at, time_now);
@@ -8919,10 +8598,7 @@ x_wait_for_event (f, eventtype)
size changes. Otherwise we leave the window gravity unchanged. */
static void
-x_set_window_size_1 (f, change_gravity, cols, rows)
- struct frame *f;
- int change_gravity;
- int cols, rows;
+x_set_window_size_1 (struct frame *f, int change_gravity, int cols, int rows)
{
int pixelwidth, pixelheight;
@@ -8930,9 +8606,7 @@ x_set_window_size_1 (f, change_gravity, cols, rows)
f->scroll_bar_actual_width
= (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
? 0
- : FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0
- ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f)
- : (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)));
+ : FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f));
compute_fringe_widths (f, 0);
@@ -8987,17 +8661,14 @@ x_set_window_size_1 (f, change_gravity, cols, rows)
Otherwise we leave the window gravity unchanged. */
void
-x_set_window_size (f, change_gravity, cols, rows)
- struct frame *f;
- int change_gravity;
- int cols, rows;
+x_set_window_size (struct frame *f, int change_gravity, int cols, int rows)
{
BLOCK_INPUT;
if (NILP (tip_frame) || XFRAME (tip_frame) != f)
{
int r, c;
-
+
/* When the frame is maximized/fullscreen or running under for
example Xmonad, x_set_window_size_1 will be a no-op.
In that case, the right thing to do is extend rows/cols to
@@ -9046,9 +8717,7 @@ x_set_window_size (f, change_gravity, cols, rows)
/* Mouse warping. */
void
-x_set_mouse_position (f, x, y)
- struct frame *f;
- int x, y;
+x_set_mouse_position (struct frame *f, int x, int y)
{
int pix_x, pix_y;
@@ -9071,9 +8740,7 @@ x_set_mouse_position (f, x, y)
/* Move the mouse to position pixel PIX_X, PIX_Y relative to frame F. */
void
-x_set_mouse_pixel_position (f, pix_x, pix_y)
- struct frame *f;
- int pix_x, pix_y;
+x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
{
BLOCK_INPUT;
@@ -9085,8 +8752,7 @@ x_set_mouse_pixel_position (f, pix_x, pix_y)
/* focus shifting, raising and lowering. */
void
-x_focus_on_frame (f)
- struct frame *f;
+x_focus_on_frame (struct frame *f)
{
#if 0
/* I don't think that the ICCCM allows programs to do things like this
@@ -9098,8 +8764,7 @@ x_focus_on_frame (f)
}
void
-x_unfocus_frame (f)
- struct frame *f;
+x_unfocus_frame (struct frame *f)
{
#if 0
/* Look at the remarks in x_focus_on_frame. */
@@ -9112,8 +8777,7 @@ x_unfocus_frame (f)
/* Raise frame F. */
void
-x_raise_frame (f)
- struct frame *f;
+x_raise_frame (struct frame *f)
{
BLOCK_INPUT;
if (f->async_visible)
@@ -9126,8 +8790,7 @@ x_raise_frame (f)
/* Lower frame F. */
void
-x_lower_frame (f)
- struct frame *f;
+x_lower_frame (struct frame *f)
{
if (f->async_visible)
{
@@ -9141,8 +8804,7 @@ x_lower_frame (f)
/* Activate frame with Extended Window Manager Hints */
void
-x_ewmh_activate_frame (f)
- FRAME_PTR f;
+x_ewmh_activate_frame (FRAME_PTR f)
{
/* See Window Manager Specification/Extended Window Manager Hints at
http://freedesktop.org/wiki/Specifications/wm-spec */
@@ -9162,9 +8824,7 @@ x_ewmh_activate_frame (f)
}
static void
-XTframe_raise_lower (f, raise_flag)
- FRAME_PTR f;
- int raise_flag;
+XTframe_raise_lower (FRAME_PTR f, int raise_flag)
{
if (raise_flag)
x_raise_frame (f);
@@ -9175,9 +8835,7 @@ XTframe_raise_lower (f, raise_flag)
/* XEmbed implementation. */
void
-xembed_set_info (f, flags)
- struct frame *f;
- enum xembed_info flags;
+xembed_set_info (struct frame *f, enum xembed_info flags)
{
Atom atom;
unsigned long data[2];
@@ -9192,13 +8850,7 @@ xembed_set_info (f, flags)
}
void
-xembed_send_message (f, time, message, detail, data1, data2)
- struct frame *f;
- Time time;
- enum xembed_message message;
- long detail;
- long data1;
- long data2;
+xembed_send_message (struct frame *f, Time time, enum xembed_message message, long int detail, long int data1, long int data2)
{
XEvent event;
@@ -9227,8 +8879,7 @@ xembed_send_message (f, time, message, detail, data1, data2)
finishes with it. */
void
-x_make_frame_visible (f)
- struct frame *f;
+x_make_frame_visible (struct frame *f)
{
Lisp_Object type;
int original_top, original_left;
@@ -9359,7 +9010,7 @@ x_make_frame_visible (f)
/* It could be confusing if a real alarm arrives while
processing the fake one. Turn it off and let the
handler reset it. */
- extern void poll_for_input_1 P_ ((void));
+ extern void poll_for_input_1 (void);
int old_poll_suppress_count = poll_suppress_count;
poll_suppress_count = 1;
poll_for_input_1 ();
@@ -9391,8 +9042,7 @@ x_make_frame_visible (f)
/* Make the frame visible (mapped and not iconified). */
void
-x_make_frame_invisible (f)
- struct frame *f;
+x_make_frame_invisible (struct frame *f)
{
Window window;
@@ -9449,8 +9099,7 @@ x_make_frame_invisible (f)
/* Change window state from mapped to iconified. */
void
-x_iconify_frame (f)
- struct frame *f;
+x_iconify_frame (struct frame *f)
{
int result;
Lisp_Object type;
@@ -9576,8 +9225,7 @@ x_iconify_frame (f)
/* Free X resources of frame F. */
void
-x_free_frame_resources (f)
- struct frame *f;
+x_free_frame_resources (struct frame *f)
{
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
Lisp_Object bar;
@@ -9700,8 +9348,7 @@ x_free_frame_resources (f)
/* Destroy the X window of frame F. */
void
-x_destroy_window (f)
- struct frame *f;
+x_destroy_window (struct frame *f)
{
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -9725,10 +9372,7 @@ x_destroy_window (f)
#ifndef USE_GTK
void
-x_wm_set_size_hint (f, flags, user_position)
- struct frame *f;
- long flags;
- int user_position;
+x_wm_set_size_hint (struct frame *f, long flags, int user_position)
{
XSizeHints size_hints;
Window window = FRAME_OUTER_WINDOW (f);
@@ -9828,9 +9472,7 @@ x_wm_set_size_hint (f, flags, user_position)
/* Used for IconicState or NormalState */
void
-x_wm_set_window_state (f, state)
- struct frame *f;
- int state;
+x_wm_set_window_state (struct frame *f, int state)
{
#ifdef USE_X_TOOLKIT
Arg al[1];
@@ -9848,9 +9490,7 @@ x_wm_set_window_state (f, state)
}
void
-x_wm_set_icon_pixmap (f, pixmap_id)
- struct frame *f;
- int pixmap_id;
+x_wm_set_icon_pixmap (struct frame *f, int pixmap_id)
{
Pixmap icon_pixmap, icon_mask;
@@ -9898,9 +9538,7 @@ x_wm_set_icon_pixmap (f, pixmap_id)
}
void
-x_wm_set_icon_position (f, icon_x, icon_y)
- struct frame *f;
- int icon_x, icon_y;
+x_wm_set_icon_position (struct frame *f, int icon_x, int icon_y)
{
Window window = FRAME_OUTER_WINDOW (f);
@@ -9922,9 +9560,7 @@ x_wm_set_icon_position (f, icon_x, icon_y)
font table. */
static void
-x_check_font (f, font)
- struct frame *f;
- struct font *font;
+x_check_font (struct frame *f, struct font *font)
{
Lisp_Object frame;
@@ -9973,8 +9609,7 @@ static int x_session_initialized;
/* Test whether two display-name strings agree up to the dot that separates
the screen number from the server number. */
static int
-same_x_server (name1, name2)
- const char *name1, *name2;
+same_x_server (const char *name1, const char *name2)
{
int seen_colon = 0;
const unsigned char *system_name = SDATA (Vsystem_name);
@@ -10021,10 +9656,7 @@ same_x_server (name1, name2)
get to the first bit. With MASK 0x7e0, *BITS is set to 6, and *OFFSET
to 5. */
static void
-get_bits_and_offset (mask, bits, offset)
- unsigned long mask;
- int *bits;
- int *offset;
+get_bits_and_offset (long unsigned int mask, int *bits, int *offset)
{
int nr = 0;
int off = 0;
@@ -10049,8 +9681,7 @@ get_bits_and_offset (mask, bits, offset)
But don't permanently open it, just test its availability. */
int
-x_display_ok (display)
- const char *display;
+x_display_ok (const char *display)
{
int dpy_ok = 1;
Display *dpy;
@@ -10065,26 +9696,19 @@ x_display_ok (display)
#ifdef USE_GTK
static void
-my_log_handler (log_domain, log_level, message, user_data)
- const gchar *log_domain;
- GLogLevelFlags log_level;
- const gchar *message;
- gpointer user_data;
+my_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data)
{
if (!strstr (message, "g_set_prgname"))
fprintf (stderr, "%s-WARNING **: %s\n", log_domain, message);
}
#endif
-
+
/* Open a connection to X display DISPLAY_NAME, and return
the structure that describes the open display.
If we cannot contact the display, return null. */
struct x_display_info *
-x_term_init (display_name, xrm_option, resource_name)
- Lisp_Object display_name;
- char *xrm_option;
- char *resource_name;
+x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
{
int connection;
Display *dpy;
@@ -10110,20 +9734,10 @@ x_term_init (display_name, xrm_option, resource_name)
char *argv[NUM_ARGV];
char **argv2 = argv;
guint id;
-#ifndef HAVE_GTK_MULTIDISPLAY
- if (!EQ (Vinitial_window_system, Qx))
- error ("Sorry, you cannot connect to X servers with the GTK toolkit");
-#endif
if (x_initialized++ > 1)
{
-#ifdef HAVE_GTK_MULTIDISPLAY
- /* Opening another display. If xg_display_open returns less
- than zero, we are probably on GTK 2.0, which can only handle
- one display. GTK 2.2 or later can handle more than one. */
- if (xg_display_open (SDATA (display_name), &dpy) < 0)
-#endif
- error ("Sorry, this version of GTK can only handle one display");
+ xg_display_open (SDATA (display_name), &dpy);
}
else
{
@@ -10227,7 +9841,7 @@ x_term_init (display_name, xrm_option, resource_name)
/* We have definitely succeeded. Record the new connection. */
dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info));
- bzero (dpyinfo, sizeof *dpyinfo);
+ memset (dpyinfo, 0, sizeof *dpyinfo);
terminal = x_create_terminal (dpyinfo);
@@ -10505,7 +10119,11 @@ x_term_init (display_name, xrm_option, resource_name)
= XInternAtom (dpyinfo->display, "_NET_WM_WINDOW_TYPE", False);
dpyinfo->Xatom_net_window_type_tooltip
= XInternAtom (dpyinfo->display, "_NET_WM_WINDOW_TYPE_TOOLTIP", False);
-
+ dpyinfo->Xatom_net_wm_icon_name
+ = XInternAtom (dpyinfo->display, "_NET_WM_ICON_NAME", False);
+ dpyinfo->Xatom_net_wm_name
+ = XInternAtom (dpyinfo->display, "_NET_WM_NAME", False);
+
dpyinfo->cut_buffers_initialized = 0;
dpyinfo->x_dnd_atoms_size = 8;
@@ -10536,11 +10154,9 @@ x_term_init (display_name, xrm_option, resource_name)
xsettings_initialize (dpyinfo);
-#ifdef subprocesses
/* This is only needed for distinguishing keyboard and process input. */
if (connection != 0)
add_keyboard_wait_descriptor (connection);
-#endif
#ifdef F_SETOWN
fcntl (connection, F_SETOWN, getpid ());
@@ -10622,8 +10238,7 @@ x_term_init (display_name, xrm_option, resource_name)
and without sending any more commands to the X server. */
void
-x_delete_display (dpyinfo)
- struct x_display_info *dpyinfo;
+x_delete_display (struct x_display_info *dpyinfo)
{
struct terminal *t;
@@ -10635,7 +10250,7 @@ x_delete_display (dpyinfo)
#ifdef HAVE_X_SM
/* Close X session management when we close its display. */
if (t->id == 1 && x_session_have_connection ())
- x_session_close();
+ x_session_close ();
#endif
delete_terminal (t);
break;
@@ -10692,8 +10307,7 @@ x_delete_display (dpyinfo)
that slows us down. */
static void
-x_process_timeouts (timer)
- struct atimer *timer;
+x_process_timeouts (struct atimer *timer)
{
BLOCK_INPUT;
x_timeout_atimer_activated_flag = 0;
@@ -10716,7 +10330,7 @@ x_process_timeouts (timer)
processed, these widgets don't behave normally. */
void
-x_activate_timeout_atimer ()
+x_activate_timeout_atimer (void)
{
BLOCK_INPUT;
if (!x_timeout_atimer_activated_flag)
@@ -10892,7 +10506,7 @@ x_create_terminal (struct x_display_info *dpyinfo)
}
void
-x_initialize ()
+x_initialize (void)
{
baud_rate = 19200;
@@ -10950,7 +10564,7 @@ x_initialize ()
void
-syms_of_xterm ()
+syms_of_xterm (void)
{
x_error_message = NULL;
diff --git a/src/xterm.h b/src/xterm.h
index a766f863c4d..5c1213d2bf1 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -370,6 +370,9 @@ struct x_display_info
/* XSettings atoms and windows. */
Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr;
Window xsettings_window;
+
+ /* Frame name and icon name */
+ Atom Xatom_net_wm_name, Xatom_net_wm_icon_name;
};
#ifdef HAVE_X_I18N
@@ -378,13 +381,16 @@ extern int use_xim;
#endif
/* This checks to make sure we have a display. */
-extern void check_x P_ ((void));
-extern struct frame *x_window_to_frame P_ ((struct x_display_info *, int));
+extern void check_x (void);
+
+extern struct frame *x_window_to_frame (struct x_display_info *, int);
-extern struct frame *x_any_window_to_frame P_ ((struct x_display_info *, int));
-extern struct frame *x_menubar_window_to_frame P_ ((struct x_display_info *, int));
-extern struct frame *x_top_window_to_frame P_ ((struct x_display_info *, int));
+extern struct frame *x_any_window_to_frame (struct x_display_info *, int);
+extern struct frame *x_menubar_window_to_frame (struct x_display_info *,
+ XEvent *);
+
+extern struct frame *x_top_window_to_frame (struct x_display_info *, int);
#if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
#define x_any_window_to_frame x_window_to_frame
@@ -403,14 +409,14 @@ extern Lisp_Object x_display_name_list;
/* Regexp matching a font name whose width is the same as `PIXEL_SIZE'. */
extern Lisp_Object Vx_pixel_size_width_font_regexp;
-extern struct x_display_info *x_display_info_for_display P_ ((Display *));
-extern struct x_display_info *x_display_info_for_name P_ ((Lisp_Object));
-extern void x_set_frame_alpha P_ ((struct frame *));
+extern struct x_display_info *x_display_info_for_display (Display *);
+extern struct x_display_info *x_display_info_for_name (Lisp_Object);
+extern void x_set_frame_alpha (struct frame *);
-extern struct x_display_info *x_term_init P_ ((Lisp_Object, char *, char *));
-extern int x_display_ok P_ ((const char *));
+extern struct x_display_info *x_term_init (Lisp_Object, char *, char *);
+extern int x_display_ok (const char *);
-extern void select_visual P_ ((struct x_display_info *));
+extern void select_visual (struct x_display_info *);
struct font;
@@ -661,8 +667,22 @@ enum
FRAME_X_WINDOW (f))
#else
#ifdef USE_GTK
+/* Functions not present in older Gtk+ */
+
+#ifndef HAVE_GTK_WIDGET_GET_WINDOW
+#define gtk_widget_get_window(w) ((w)->window)
+#endif
+#ifndef HAVE_GTK_WIDGET_GET_MAPPED
+#define gtk_widget_get_mapped(w) (GTK_WIDGET_MAPPED (w))
+#endif
+#ifndef HAVE_GTK_ADJUSTMENT_GET_PAGE_SIZE
+#define gtk_adjustment_get_page_size(w) ((w)->page_size)
+#define gtk_adjustment_get_upper(w) ((w)->upper)
+#endif
+
#define GTK_WIDGET_TO_X_WIN(w) \
- ((w) && (w)->window ? GDK_WINDOW_XWINDOW ((w)->window) : 0)
+ ((w) && gtk_widget_get_window (w) \
+ ? GDK_WINDOW_XWINDOW (gtk_widget_get_window (w)) : 0)
#define FRAME_GTK_OUTER_WIDGET(f) ((f)->output_data.x->widget)
#define FRAME_GTK_WIDGET(f) ((f)->output_data.x->edit_widget)
@@ -901,168 +921,168 @@ struct image;
/* From xselect.c. */
-void x_handle_selection_notify P_ ((XSelectionEvent *));
-void x_handle_property_notify P_ ((XPropertyEvent *));
+void x_handle_selection_notify (XSelectionEvent *);
+void x_handle_property_notify (XPropertyEvent *);
/* From xfns.c. */
-Lisp_Object display_x_get_resource P_ ((struct x_display_info *,
- Lisp_Object, Lisp_Object,
- Lisp_Object, Lisp_Object));
-struct frame *check_x_frame P_ ((Lisp_Object));
+Lisp_Object display_x_get_resource (struct x_display_info *,
+ Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object);
+struct frame *check_x_frame (Lisp_Object);
EXFUN (Fx_display_color_p, 1);
EXFUN (Fx_display_grayscale_p, 1);
-extern void x_free_gcs P_ ((struct frame *));
+extern void x_free_gcs (struct frame *);
/* From xrdb.c. */
-char *x_get_customization_string P_ ((XrmDatabase, char *, char *));
-XrmDatabase x_load_resources P_ ((Display *, char *, char *, char *));
-int x_get_resource P_ ((XrmDatabase, char *, char *,
- XrmRepresentation, XrmValue *));
-void x_delete_display P_ ((struct x_display_info *));
-void x_make_frame_visible P_ ((struct frame *));
-void x_iconify_frame P_ ((struct frame *));
-void x_wm_set_size_hint P_ ((struct frame *, long, int));
-int x_text_icon P_ ((struct frame *, char *));
-int x_bitmap_icon P_ ((struct frame *, Lisp_Object));
-void x_set_window_size P_ ((struct frame *, int, int, int));
-void x_wm_set_window_state P_ ((struct frame *, int));
-int x_alloc_nearest_color P_ ((struct frame *, Colormap, XColor *));
+char *x_get_customization_string (XrmDatabase, char *, char *);
+XrmDatabase x_load_resources (Display *, char *, char *, char *);
+int x_get_resource (XrmDatabase, char *, char *,
+ XrmRepresentation, XrmValue *);
+void x_delete_display (struct x_display_info *);
+void x_make_frame_visible (struct frame *);
+void x_iconify_frame (struct frame *);
+void x_wm_set_size_hint (struct frame *, long, int);
+int x_text_icon (struct frame *, char *);
+int x_bitmap_icon (struct frame *, Lisp_Object);
+void x_set_window_size (struct frame *, int, int, int);
+void x_wm_set_window_state (struct frame *, int);
+int x_alloc_nearest_color (struct frame *, Colormap, XColor *);
/* Defined in xterm.c */
-extern void cancel_mouse_face P_ ((struct frame *));
-extern void x_scroll_bar_clear P_ ((struct frame *));
-extern int x_text_icon P_ ((struct frame *, char *));
-extern int x_bitmap_icon P_ ((struct frame *, Lisp_Object));
-extern void x_catch_errors P_ ((Display *));
-extern void x_check_errors P_ ((Display *, char *));
-extern int x_had_errors_p P_ ((Display *));
-extern int x_catching_errors P_ ((void));
-extern void x_uncatch_errors P_ ((void));
-extern void x_clear_errors P_ ((Display *));
-extern void x_set_window_size P_ ((struct frame *, int, int, int));
-extern void x_set_mouse_position P_ ((struct frame *, int, int));
-extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int));
-extern void x_ewmh_activate_frame P_ ((struct frame *));
-extern void x_raise_frame P_ ((struct frame *));
-extern void x_lower_frame P_ ((struct frame *));
-extern void x_make_frame_visible P_ ((struct frame *));
-extern void x_make_frame_invisible P_ ((struct frame *));
-extern void x_iconify_frame P_ ((struct frame *));
-extern void x_free_frame_resources P_ ((struct frame *));
-extern void x_destroy_window P_ ((struct frame *));
-extern void x_wm_set_size_hint P_ ((struct frame *, long, int));
-extern void x_wm_set_window_state P_ ((struct frame *, int));
-extern void x_wm_set_icon_pixmap P_ ((struct frame *, int));
-extern void x_delete_display P_ ((struct x_display_info *));
-extern void x_delete_terminal P_ ((struct terminal *terminal));
-extern void x_initialize P_ ((void));
-extern unsigned long x_copy_color P_ ((struct frame *, unsigned long));
+extern void cancel_mouse_face (struct frame *);
+extern void x_scroll_bar_clear (struct frame *);
+extern int x_text_icon (struct frame *, char *);
+extern int x_bitmap_icon (struct frame *, Lisp_Object);
+extern void x_catch_errors (Display *);
+extern void x_check_errors (Display *, char *);
+extern int x_had_errors_p (Display *);
+extern int x_catching_errors (void);
+extern void x_uncatch_errors (void);
+extern void x_clear_errors (Display *);
+extern void x_set_window_size (struct frame *, int, int, int);
+extern void x_set_mouse_position (struct frame *, int, int);
+extern void x_set_mouse_pixel_position (struct frame *, int, int);
+extern void x_ewmh_activate_frame (struct frame *);
+extern void x_raise_frame (struct frame *);
+extern void x_lower_frame (struct frame *);
+extern void x_make_frame_visible (struct frame *);
+extern void x_make_frame_invisible (struct frame *);
+extern void x_iconify_frame (struct frame *);
+extern void x_free_frame_resources (struct frame *);
+extern void x_destroy_window (struct frame *);
+extern void x_wm_set_size_hint (struct frame *, long, int);
+extern void x_wm_set_window_state (struct frame *, int);
+extern void x_wm_set_icon_pixmap (struct frame *, int);
+extern void x_delete_display (struct x_display_info *);
+extern void x_delete_terminal (struct terminal *terminal);
+extern void x_initialize (void);
+extern unsigned long x_copy_color (struct frame *, unsigned long);
#ifdef USE_X_TOOLKIT
extern XtAppContext Xt_app_con;
-extern int x_alloc_lighter_color_for_widget __P ((Widget, Display*, Colormap,
- unsigned long *,
- double, int));
-extern void x_activate_timeout_atimer P_ ((void));
+extern int x_alloc_lighter_color_for_widget (Widget, Display*, Colormap,
+ unsigned long *,
+ double, int);
+extern void x_activate_timeout_atimer (void);
#endif
-extern void x_query_colors P_ ((struct frame *f, XColor *, int));
-extern void x_query_color P_ ((struct frame *f, XColor *));
-extern void x_clear_area P_ ((Display *, Window, int, int, int, int, int));
-extern void set_vertical_scroll_bar P_ ((struct window *));
+extern void x_query_colors (struct frame *f, XColor *, int);
+extern void x_query_color (struct frame *f, XColor *);
+extern void x_clear_area (Display *, Window, int, int, int, int, int);
+extern void set_vertical_scroll_bar (struct window *);
-extern int x_dispatch_event P_ ((XEvent *, Display *));
-extern unsigned int x_x_to_emacs_modifiers P_ ((struct x_display_info *,
- unsigned));
-extern int x_display_pixel_height P_ ((struct x_display_info *));
-extern int x_display_pixel_width P_ ((struct x_display_info *));
+extern int x_dispatch_event (XEvent *, Display *);
+extern unsigned int x_x_to_emacs_modifiers (struct x_display_info *,
+ unsigned);
+extern int x_display_pixel_height (struct x_display_info *);
+extern int x_display_pixel_width (struct x_display_info *);
-extern void x_set_sticky P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void x_wait_for_event P_ ((struct frame *, int));
+extern void x_set_sticky (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_wait_for_event (struct frame *, int);
/* Defined in xselect.c */
-extern void x_handle_property_notify P_ ((XPropertyEvent *));
-extern void x_handle_selection_notify P_ ((XSelectionEvent *));
-extern void x_handle_selection_event P_ ((struct input_event *));
-extern void x_clear_frame_selections P_ ((struct frame *));
-
-extern int x_handle_dnd_message P_ ((struct frame *,
- XClientMessageEvent *,
- struct x_display_info *,
- struct input_event *bufp));
-extern int x_check_property_data P_ ((Lisp_Object));
-extern void x_fill_property_data P_ ((Display *,
- Lisp_Object,
- void *,
- int));
-extern Lisp_Object x_property_data_to_lisp P_ ((struct frame *,
- unsigned char *,
- Atom,
- int,
- unsigned long));
+extern void x_handle_property_notify (XPropertyEvent *);
+extern void x_handle_selection_notify (XSelectionEvent *);
+extern void x_handle_selection_event (struct input_event *);
+extern void x_clear_frame_selections (struct frame *);
+
+extern int x_handle_dnd_message (struct frame *,
+ XClientMessageEvent *,
+ struct x_display_info *,
+ struct input_event *bufp);
+extern int x_check_property_data (Lisp_Object);
+extern void x_fill_property_data (Display *,
+ Lisp_Object,
+ void *,
+ int);
+extern Lisp_Object x_property_data_to_lisp (struct frame *,
+ unsigned char *,
+ Atom,
+ int,
+ unsigned long);
/* Defined in xfns.c */
-extern struct x_display_info * check_x_display_info P_ ((Lisp_Object frame));
+extern struct x_display_info * check_x_display_info (Lisp_Object frame);
#ifdef USE_GTK
-extern int xg_set_icon P_ ((struct frame *, Lisp_Object));
-extern int xg_set_icon_from_xpm_data P_ ((struct frame *, char**));
+extern int xg_set_icon (struct frame *, Lisp_Object);
+extern int xg_set_icon_from_xpm_data (struct frame *, char**);
#endif /* USE_GTK */
-extern void x_real_positions P_ ((struct frame *, int *, int *));
-extern int defined_color P_ ((struct frame *, char *, XColor *, int));
-extern void x_set_border_pixel P_ ((struct frame *, int));
-extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern void xic_free_xfontset P_ ((struct frame *));
-extern void create_frame_xic P_ ((struct frame *));
-extern void destroy_frame_xic P_ ((struct frame *));
-extern void xic_set_preeditarea P_ ((struct window *, int, int));
-extern void xic_set_statusarea P_ ((struct frame *));
-extern void xic_set_xfontset P_ ((struct frame *, char *));
-extern int x_pixel_width P_ ((struct frame *));
-extern int x_pixel_height P_ ((struct frame *));
-extern int x_char_width P_ ((struct frame *));
-extern int x_char_height P_ ((struct frame *));
-extern int x_screen_planes P_ ((struct frame *));
-extern void x_sync P_ ((struct frame *));
-extern int x_defined_color P_ ((struct frame *, char *, XColor *, int));
+extern void x_real_positions (struct frame *, int *, int *);
+extern int defined_color (struct frame *, char *, XColor *, int);
+extern void x_set_border_pixel (struct frame *, int);
+extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
+extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
+extern void xic_free_xfontset (struct frame *);
+extern void create_frame_xic (struct frame *);
+extern void destroy_frame_xic (struct frame *);
+extern void xic_set_preeditarea (struct window *, int, int);
+extern void xic_set_statusarea (struct frame *);
+extern void xic_set_xfontset (struct frame *, char *);
+extern int x_pixel_width (struct frame *);
+extern int x_pixel_height (struct frame *);
+extern int x_char_width (struct frame *);
+extern int x_char_height (struct frame *);
+extern int x_screen_planes (struct frame *);
+extern void x_sync (struct frame *);
+extern int x_defined_color (struct frame *, char *, XColor *, int);
#ifdef HAVE_X_I18N
-extern void free_frame_xic P_ ((struct frame *));
+extern void free_frame_xic (struct frame *);
#endif
-extern void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
+extern void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
/* Defined in xfaces.c */
-extern int compute_glyph_face P_ ((struct frame *, int, int));
-extern int compute_glyph_face_1 P_ ((struct frame *, Lisp_Object, int));
-extern void x_free_dpy_colors P_ ((Display *, Screen *, Colormap,
- unsigned long *, int));
+extern int compute_glyph_face (struct frame *, int, int);
+extern int compute_glyph_face_1 (struct frame *, Lisp_Object, int);
+extern void x_free_dpy_colors (Display *, Screen *, Colormap,
+ unsigned long *, int);
/* Defined in xmenu.c */
-extern void x_menu_set_in_use P_ ((int));
-extern void x_menu_wait_for_event P_ ((void *data));
-extern void x_activate_menubar P_ ((struct frame *));
-extern int popup_activated P_ ((void));
-extern void initialize_frame_menubar P_ ((struct frame *));
-extern void free_frame_menubar P_ ((struct frame *));
+extern void x_menu_set_in_use (int);
+extern void x_menu_wait_for_event (void *data);
+extern void x_activate_menubar (struct frame *);
+extern int popup_activated (void);
+extern void initialize_frame_menubar (struct frame *);
+extern void free_frame_menubar (struct frame *);
/* Defined in widget.c */
#ifdef USE_X_TOOLKIT
-extern void widget_store_internal_border P_ ((Widget));
+extern void widget_store_internal_border (Widget);
#endif
/* Defined in xsmfns.c */
#ifdef HAVE_X_SM
-extern void x_session_initialize P_ ((struct x_display_info *dpyinfo));
-extern int x_session_check_input P_ ((struct input_event *bufp));
-extern int x_session_have_connection P_ ((void));
-extern void x_session_close P_ ((void));
+extern void x_session_initialize (struct x_display_info *dpyinfo);
+extern int x_session_check_input (struct input_event *bufp);
+extern int x_session_have_connection (void);
+extern void x_session_close (void);
#endif
/* XEmbed implementation. */
@@ -1115,10 +1135,10 @@ enum xembed_accelerator
/* Defined in xterm.c */
-extern void xembed_set_info P_ ((struct frame *f, enum xembed_info flags));
-extern void xembed_send_message P_ ((struct frame *f, Time time,
- enum xembed_message message,
- long detail, long data1, long data2));
+extern void xembed_set_info (struct frame *f, enum xembed_info flags);
+extern void xembed_send_message (struct frame *f, Time time,
+ enum xembed_message message,
+ long detail, long data1, long data2);
/* Is the frame embedded into another application? */