]> code.delx.au - gnu-emacs/blobdiff - src/w32fns.c
Merge changes from emacs-23 branch.
[gnu-emacs] / src / w32fns.c
index 9df243ede7fddc28b5812551fc2a6b0270366988..57786d76795c57719eef45b3be90355f8cc25de4 100644 (file)
@@ -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;
 
@@ -294,6 +294,8 @@ 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
@@ -319,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);
 
 
 \f
 /* 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");
@@ -340,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;
 }
@@ -349,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;
 
@@ -368,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))
     {
@@ -400,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;
@@ -423,26 +421,26 @@ x_window_to_frame (dpyinfo, wdesc)
 }
 
 \f
-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);
+static void x_edge_detection (struct frame *, struct image *, Lisp_Object,
+                              Lisp_Object);
 
 
 \f
@@ -452,9 +450,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;
@@ -484,8 +480,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;
@@ -771,7 +766,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;
@@ -793,8 +788,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;
 
@@ -813,8 +807,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;
 
@@ -846,8 +839,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;
 
@@ -895,8 +887,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;
 
@@ -1207,9 +1198,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)
     {
@@ -1226,11 +1215,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;
@@ -1302,10 +1287,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;
 
@@ -1339,9 +1321,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;
@@ -1365,9 +1345,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));
@@ -1385,9 +1363,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;
@@ -1534,9 +1510,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;
 
@@ -1583,9 +1557,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;
@@ -1604,9 +1576,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;
 
@@ -1618,9 +1588,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);
 
@@ -1629,9 +1597,7 @@ x_set_cursor_type (f, arg, oldval)
 }
 \f
 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;
 
@@ -1658,9 +1624,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))
     {
@@ -1708,9 +1672,7 @@ x_set_icon_name (f, arg, oldval)
 
 \f
 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);
@@ -1753,9 +1715,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;
@@ -1835,10 +1795,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.  */
@@ -1893,9 +1850,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);
 }
@@ -1904,9 +1859,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);
 }
@@ -1915,9 +1868,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))
@@ -1942,8 +1893,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);
 
@@ -1971,11 +1922,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;
 
@@ -1994,9 +1944,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.  */
@@ -2011,8 +1959,7 @@ w32_createscrollbar (f, bar)
 }
 
 static void
-w32_createwindow (f)
-     struct frame *f;
+w32_createwindow (struct frame *f)
 {
   HWND hwnd;
   RECT rect;
@@ -2082,12 +2029,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;
@@ -2181,7 +2123,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;
 
@@ -2228,7 +2170,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;
@@ -2314,7 +2256,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) |
@@ -2331,7 +2273,7 @@ w32_get_modifiers ()
    and window input.  */
 
 static int
-construct_console_modifiers ()
+construct_console_modifiers (void)
 {
   int mods;
 
@@ -2403,8 +2345,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;
 
@@ -2423,8 +2364,7 @@ register_hot_keys (hwnd)
 }
 
 static void
-unregister_hot_keys (hwnd)
-     HWND hwnd;
+unregister_hot_keys (HWND hwnd)
 {
   Lisp_Object keylist;
 
@@ -2630,7 +2570,7 @@ complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result)
 }
 
 static void
-cancel_all_deferred_msgs ()
+cancel_all_deferred_msgs (void)
 {
   deferred_msg * item;
 
@@ -2675,7 +2615,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))
@@ -2693,13 +2633,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;
 
@@ -2759,11 +2695,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;
@@ -2821,7 +2753,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)
@@ -3169,7 +3101,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);
@@ -4013,8 +3945,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;
 
@@ -4029,8 +3960,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;
 
@@ -4073,10 +4003,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;
 
@@ -4124,9 +4051,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;
@@ -4165,8 +4090,7 @@ x_icon (f, parms)
 
 
 static void
-x_make_gc (f)
-     struct frame *f;
+x_make_gc (struct frame *f)
 {
   XGCValues gc_values;
 
@@ -4199,8 +4123,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);
 
@@ -4225,9 +4148,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,
@@ -4277,8 +4198,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;
@@ -4361,7 +4281,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
@@ -4469,10 +4389,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);
@@ -4586,8 +4513,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;
@@ -4600,8 +4526,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;
@@ -4610,8 +4535,7 @@ DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
 \f
 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);
@@ -4626,8 +4550,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);
@@ -4647,8 +4570,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);
 
@@ -4665,8 +4587,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);
 
@@ -4682,8 +4603,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);
 
@@ -4696,8 +4616,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);
 
@@ -4710,8 +4629,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);
 
@@ -4724,8 +4642,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;
@@ -4754,8 +4671,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);
 
@@ -4767,8 +4683,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.");
 }
@@ -4782,8 +4697,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),
@@ -4795,8 +4709,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);
 }
@@ -4807,8 +4720,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;
@@ -4828,8 +4740,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);
 
@@ -4852,8 +4763,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");
 }
@@ -4867,8 +4777,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;
@@ -4891,43 +4800,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;
 }
 \f
 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;
 }
@@ -4936,8 +4839,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;
@@ -4977,8 +4879,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;
@@ -5066,8 +4967,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;
@@ -5086,7 +4986,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;
 
@@ -5099,8 +4999,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;
 }
@@ -5129,8 +5028,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);
@@ -5159,8 +5057,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 */
 
@@ -5187,8 +5084,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 */
 
@@ -5252,7 +5148,7 @@ extern Lisp_Object Vhourglass_delay;
            xdisp.c could be used. */
 
 int
-hourglass_started ()
+hourglass_started (void)
 {
   return hourglass_shown_p || hourglass_timer;
 }
@@ -5260,7 +5156,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;
@@ -5296,7 +5192,7 @@ start_hourglass ()
    cursor if shown.  */
 
 void
-cancel_hourglass ()
+cancel_hourglass (void)
 {
   if (hourglass_timer)
     {
@@ -5315,8 +5211,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)
     {
@@ -5331,7 +5226,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)
     {
@@ -5359,10 +5254,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.  */
 
@@ -5385,8 +5280,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;
 
@@ -5411,9 +5305,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;
@@ -5477,7 +5370,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;
@@ -5652,11 +5545,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;
@@ -5760,8 +5651,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;
@@ -5990,7 +5880,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;
@@ -6035,11 +5925,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)
     {
@@ -6090,8 +5976,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;
@@ -6140,7 +6025,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)
@@ -6219,8 +6104,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;
@@ -6251,10 +6135,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;
@@ -6282,8 +6166,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);
 
@@ -6336,8 +6219,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;
@@ -6393,8 +6275,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;
@@ -6475,8 +6356,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);
 
@@ -6508,8 +6388,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;
 
@@ -6541,7 +6420,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));
 }
@@ -6550,8 +6429,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;
@@ -6585,8 +6463,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;
 
@@ -6622,8 +6499,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;
 
@@ -6652,7 +6528,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;
 
@@ -6756,8 +6632,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;
 
@@ -6849,7 +6724,7 @@ If the underlying system call fails, value is nil.  */)
 \f
 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;
@@ -6961,7 +6836,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.  */
@@ -7318,7 +7193,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");
   /*
@@ -7361,7 +7236,7 @@ globals_of_w32fns ()
 #undef abort
 
 void
-w32_abort ()
+w32_abort (void)
 {
   int button;
   button = MessageBox (NULL,
@@ -7389,7 +7264,7 @@ w32_abort ()
 
 /* For convenience when debugging.  */
 int
-w32_last_error ()
+w32_last_error (void)
 {
   return GetLastError ();
 }