emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115570: Fix some warnings in w32 specific code.


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r115570: Fix some warnings in w32 specific code.
Date: Tue, 17 Dec 2013 17:47:19 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115570
revision-id: address@hidden
parent: address@hidden
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Tue 2013-12-17 19:46:31 +0200
message:
  Fix some warnings in w32 specific code.
  
   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.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/fileio.c                   fileio.c-20091113204419-o5vbwnq5f7feedwu-210
  src/frame.c                    frame.c-20091113204419-o5vbwnq5f7feedwu-243
  src/w32font.c                  w32font.c-20091113204419-o5vbwnq5f7feedwu-8545
  src/w32menu.c                  w32menu.c-20091113204419-o5vbwnq5f7feedwu-947
  src/w32term.c                  w32term.c-20091113204419-o5vbwnq5f7feedwu-950
  src/w32uniscribe.c             
w32uniscribe.c-20091113204419-o5vbwnq5f7feedwu-8619
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-12-16 22:35:57 +0000
+++ b/src/ChangeLog     2013-12-17 17:46:31 +0000
@@ -1,3 +1,23 @@
+2013-12-17  Eli Zaretskii  <address@hidden>
+
+       * 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  <address@hidden>
 
        Fix problems with CANNOT_DUMP and EMACSLOADPATH.

=== modified file 'src/fileio.c'
--- a/src/fileio.c      2013-12-15 20:39:36 +0000
+++ b/src/fileio.c      2013-12-17 17:46:31 +0000
@@ -1942,20 +1942,22 @@
 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)
 {
+  struct stat out_st;
+  Lisp_Object handler;
+  struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
+  ptrdiff_t count = SPECPDL_INDEX ();
+  Lisp_Object encoded_file, encoded_newname;
+#if HAVE_LIBSELINUX
+  security_context_t con;
+  int conlength = 0;
+#endif
+#ifdef WINDOWSNT
+  int result;
+#else
   int ifd, ofd;
   int n;
   char buf[16 * 1024];
-  struct stat st, out_st;
-  Lisp_Object handler;
-  struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
-  ptrdiff_t count = SPECPDL_INDEX ();
-  Lisp_Object encoded_file, encoded_newname;
-#if HAVE_LIBSELINUX
-  security_context_t con;
-  int conlength = 0;
-#endif
-#ifdef WINDOWSNT
-  int result;
+  struct stat st;
 #endif
 
   encoded_file = encoded_newname = Qnil;

=== modified file 'src/frame.c'
--- a/src/frame.c       2013-12-09 20:46:07 +0000
+++ b/src/frame.c       2013-12-17 17:46:31 +0000
@@ -2807,7 +2807,9 @@
   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 @@
   /* 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);

=== modified file 'src/w32font.c'
--- a/src/w32font.c     2013-12-13 15:55:23 +0000
+++ b/src/w32font.c     2013-12-17 17:46:31 +0000
@@ -2562,7 +2562,7 @@
 
 struct font_driver w32font_driver =
   {
-    0, /* Qgdi */
+    LISP_INITIALLY_ZERO, /* Qgdi */
     0, /* case insensitive */
     w32font_get_cache,
     w32font_list,

=== modified file 'src/w32menu.c'
--- a/src/w32menu.c     2013-11-30 09:25:31 +0000
+++ b/src/w32menu.c     2013-12-17 17:46:31 +0000
@@ -82,8 +82,8 @@
     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 @@
        {
          /* 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 @@
   /* 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 @@
     }
   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

=== modified file 'src/w32term.c'
--- a/src/w32term.c     2013-12-16 09:58:44 +0000
+++ b/src/w32term.c     2013-12-17 17:46:31 +0000
@@ -6468,7 +6468,7 @@
 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;
 

=== modified file 'src/w32uniscribe.c'
--- a/src/w32uniscribe.c        2013-10-25 09:52:37 +0000
+++ b/src/w32uniscribe.c        2013-12-17 17:46:31 +0000
@@ -964,7 +964,7 @@
 
 struct font_driver uniscribe_font_driver =
   {
-    0, /* Quniscribe */
+    LISP_INITIALLY_ZERO, /* Quniscribe */
     0, /* case insensitive */
     w32font_get_cache,
     uniscribe_list,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]