]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix some warnings in w32 specific code.
authorEli Zaretskii <eliz@gnu.org>
Tue, 17 Dec 2013 17:46:31 +0000 (19:46 +0200)
committerEli Zaretskii <eliz@gnu.org>
Tue, 17 Dec 2013 17:46:31 +0000 (19:46 +0200)
 src/w32term.c (w32_initialize): Declare the argument of
 set_user_model as const.
 src/w32menu.c <MessageBoxW_Proc>: Fix argument declarations.
 (w32_menu_show): Constify some arguments passed to MessageBox.
 src/w32uniscribe.c (uniscribe_font_driver): Use LISP_INITIALLY_ZERO
 to initialize Lisp objects.
 src/w32font.c (w32font_driver): Use LISP_INITIALLY_ZERO to
 initialize Lisp objects.
 src/frame.c (x_set_frame_parameters) [HAVE_X_WINDOWS]: Declare and
 use variables used only on X under that condition.
 src/fileio.c (Fcopy_file) [!WINDOWSNT]: Don't declare on Windows
 variables not used there.

src/ChangeLog
src/fileio.c
src/frame.c
src/w32font.c
src/w32menu.c
src/w32term.c
src/w32uniscribe.c

index 36378fd911e88f4c6d6eb8211fbeb87ec8d7b6c1..aaa8788c2baa7e1e1cc548944214421a8e0bf6d0 100644 (file)
@@ -1,3 +1,23 @@
+2013-12-17  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32term.c (w32_initialize): Declare the argument of
+       set_user_model as const.
+
+       * w32menu.c <MessageBoxW_Proc>: Fix argument declarations.
+       (w32_menu_show): Constify some arguments passed to MessageBox.
+
+       * w32uniscribe.c (uniscribe_font_driver): Use LISP_INITIALLY_ZERO
+       to initialize Lisp objects.
+
+       * w32font.c (w32font_driver): Use LISP_INITIALLY_ZERO to
+       initialize Lisp objects.
+
+       * frame.c (x_set_frame_parameters) [HAVE_X_WINDOWS]: Declare and
+       use variables used only on X under that condition.
+
+       * fileio.c (Fcopy_file) [!WINDOWSNT]: Don't declare on Windows
+       variables not used there.
+
 2013-12-16  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix problems with CANNOT_DUMP and EMACSLOADPATH.
index 47736d2b1b7232340562c4b8121f7212b8c16544..295d9d748ad53de4ac43c8dd58e8ca0a7d552ead 100644 (file)
@@ -1942,10 +1942,7 @@ attributes of FILE to NEWNAME, such as its SELinux context and ACL
 entries (depending on how Emacs was built).  */)
   (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists, Lisp_Object keep_time, Lisp_Object preserve_uid_gid, Lisp_Object preserve_extended_attributes)
 {
-  int ifd, ofd;
-  int n;
-  char buf[16 * 1024];
-  struct stat st, out_st;
+  struct stat out_st;
   Lisp_Object handler;
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
   ptrdiff_t count = SPECPDL_INDEX ();
@@ -1956,6 +1953,11 @@ entries (depending on how Emacs was built).  */)
 #endif
 #ifdef WINDOWSNT
   int result;
+#else
+  int ifd, ofd;
+  int n;
+  char buf[16 * 1024];
+  struct stat st;
 #endif
 
   encoded_file = encoded_newname = Qnil;
index 43e549235dff61d7922925f190ef2bfb3999b4ed..7699f24fbb1c60fed835f7ab495da58fd4c37d79 100644 (file)
@@ -2807,7 +2807,9 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
   Lisp_Object *values;
   ptrdiff_t i, p;
   bool left_no_change = 0, top_no_change = 0;
+#ifdef HAVE_X_WINDOWS
   bool icon_left_no_change = 0, icon_top_no_change = 0;
+#endif
   bool size_changed = 0;
   struct gcpro gcpro1, gcpro2;
 
@@ -2954,14 +2956,18 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
   /* If one of the icon positions was not set, preserve or default it.  */
   if (! TYPE_RANGED_INTEGERP (int, icon_left))
     {
+#ifdef HAVE_X_WINDOWS
       icon_left_no_change = 1;
+#endif
       icon_left = Fcdr (Fassq (Qicon_left, f->param_alist));
       if (NILP (icon_left))
        XSETINT (icon_left, 0);
     }
   if (! TYPE_RANGED_INTEGERP (int, icon_top))
     {
+#ifdef HAVE_X_WINDOWS
       icon_top_no_change = 1;
+#endif
       icon_top = Fcdr (Fassq (Qicon_top, f->param_alist));
       if (NILP (icon_top))
        XSETINT (icon_top, 0);
index 654e0d9cae40c0fdfff40975f7feae7d6a88b3c5..fb83ec16a5f99fb502e7eea0b10fce2baab47c94 100644 (file)
@@ -2562,7 +2562,7 @@ w32font_filter_properties (Lisp_Object font, Lisp_Object alist)
 
 struct font_driver w32font_driver =
   {
-    0, /* Qgdi */
+    LISP_INITIALLY_ZERO, /* Qgdi */
     0, /* case insensitive */
     w32font_get_cache,
     w32font_list,
index 4f8e8dbef052de8099875ac830dcd055c610b976..68fbd3aa98e3ee61f7fbd4c841c8483ab0c6c1e2 100644 (file)
@@ -82,8 +82,8 @@ typedef BOOL (WINAPI * SetMenuItemInfoA_Proc) (
     IN LPCMENUITEMINFOA);
 typedef int (WINAPI * MessageBoxW_Proc) (
     IN HWND window,
-    IN WCHAR *text,
-    IN WCHAR *caption,
+    IN const WCHAR *text,
+    IN const WCHAR *caption,
     IN UINT type);
 
 #ifdef NTGUI_UNICODE
@@ -629,7 +629,7 @@ w32_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
        {
          /* Create a new pane.  */
          Lisp_Object pane_name, prefix;
-         char *pane_string;
+         const char *pane_string;
          pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME);
          prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
 
@@ -1145,7 +1145,8 @@ simple_dialog_show (struct frame *f, Lisp_Object contents, Lisp_Object header)
   /* Use Unicode if possible, so any language can be displayed.  */
   if (unicode_message_box)
     {
-      WCHAR *text, *title;
+      WCHAR *text;
+      const WCHAR *title;
       USE_SAFE_ALLOCA;
 
       if (STRINGP (temp))
@@ -1180,7 +1181,7 @@ simple_dialog_show (struct frame *f, Lisp_Object contents, Lisp_Object header)
     }
   else
     {
-      char *text, *title;
+      const char *text, *title;
 
       /* Fall back on ANSI message box, but at least use system
         encoding so questions representable by the system codepage
index 0a8dbb39f7b0fa45946eed0cf45094cfb3174242..a66aca1e84648463edf974205a48693091c2cbc7 100644 (file)
@@ -6468,7 +6468,7 @@ static void
 w32_initialize (void)
 {
   HANDLE shell;
-  HRESULT (WINAPI * set_user_model) (wchar_t * id);
+  HRESULT (WINAPI * set_user_model) (const wchar_t * id);
 
   baud_rate = 19200;
 
index fb3fbd0d607452358805fbd1a095326d0ba9fc4c..bf1d903df0ba4e40af7e8c65b1efef24fa2c9749 100644 (file)
@@ -964,7 +964,7 @@ font_table_error:
 \f
 struct font_driver uniscribe_font_driver =
   {
-    0, /* Quniscribe */
+    LISP_INITIALLY_ZERO, /* Quniscribe */
     0, /* case insensitive */
     w32font_get_cache,
     uniscribe_list,