aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2013-12-17 19:46:31 +0200
committerEli Zaretskii2013-12-17 19:46:31 +0200
commitaf025ae850c8f30431cf79876c4452d9f1679250 (patch)
tree708b8ba45eaffd8e9b3b28d7dec0192d2a517bd7 /src
parentcf2b7efc78f0004a58b14a1eb470a306a139197d (diff)
downloademacs-af025ae850c8f30431cf79876c4452d9f1679250.tar.gz
emacs-af025ae850c8f30431cf79876c4452d9f1679250.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog20
-rw-r--r--src/fileio.c10
-rw-r--r--src/frame.c6
-rw-r--r--src/w32font.c2
-rw-r--r--src/w32menu.c11
-rw-r--r--src/w32term.c2
-rw-r--r--src/w32uniscribe.c2
7 files changed, 41 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 36378fd911e..aaa8788c2ba 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,23 @@
12013-12-17 Eli Zaretskii <eliz@gnu.org>
2
3 * w32term.c (w32_initialize): Declare the argument of
4 set_user_model as const.
5
6 * w32menu.c <MessageBoxW_Proc>: Fix argument declarations.
7 (w32_menu_show): Constify some arguments passed to MessageBox.
8
9 * w32uniscribe.c (uniscribe_font_driver): Use LISP_INITIALLY_ZERO
10 to initialize Lisp objects.
11
12 * w32font.c (w32font_driver): Use LISP_INITIALLY_ZERO to
13 initialize Lisp objects.
14
15 * frame.c (x_set_frame_parameters) [HAVE_X_WINDOWS]: Declare and
16 use variables used only on X under that condition.
17
18 * fileio.c (Fcopy_file) [!WINDOWSNT]: Don't declare on Windows
19 variables not used there.
20
12013-12-16 Paul Eggert <eggert@cs.ucla.edu> 212013-12-16 Paul Eggert <eggert@cs.ucla.edu>
2 22
3 Fix problems with CANNOT_DUMP and EMACSLOADPATH. 23 Fix problems with CANNOT_DUMP and EMACSLOADPATH.
diff --git a/src/fileio.c b/src/fileio.c
index 47736d2b1b7..295d9d748ad 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1942,10 +1942,7 @@ attributes of FILE to NEWNAME, such as its SELinux context and ACL
1942entries (depending on how Emacs was built). */) 1942entries (depending on how Emacs was built). */)
1943 (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) 1943 (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)
1944{ 1944{
1945 int ifd, ofd; 1945 struct stat out_st;
1946 int n;
1947 char buf[16 * 1024];
1948 struct stat st, out_st;
1949 Lisp_Object handler; 1946 Lisp_Object handler;
1950 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 1947 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
1951 ptrdiff_t count = SPECPDL_INDEX (); 1948 ptrdiff_t count = SPECPDL_INDEX ();
@@ -1956,6 +1953,11 @@ entries (depending on how Emacs was built). */)
1956#endif 1953#endif
1957#ifdef WINDOWSNT 1954#ifdef WINDOWSNT
1958 int result; 1955 int result;
1956#else
1957 int ifd, ofd;
1958 int n;
1959 char buf[16 * 1024];
1960 struct stat st;
1959#endif 1961#endif
1960 1962
1961 encoded_file = encoded_newname = Qnil; 1963 encoded_file = encoded_newname = Qnil;
diff --git a/src/frame.c b/src/frame.c
index 43e549235df..7699f24fbb1 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -2807,7 +2807,9 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
2807 Lisp_Object *values; 2807 Lisp_Object *values;
2808 ptrdiff_t i, p; 2808 ptrdiff_t i, p;
2809 bool left_no_change = 0, top_no_change = 0; 2809 bool left_no_change = 0, top_no_change = 0;
2810#ifdef HAVE_X_WINDOWS
2810 bool icon_left_no_change = 0, icon_top_no_change = 0; 2811 bool icon_left_no_change = 0, icon_top_no_change = 0;
2812#endif
2811 bool size_changed = 0; 2813 bool size_changed = 0;
2812 struct gcpro gcpro1, gcpro2; 2814 struct gcpro gcpro1, gcpro2;
2813 2815
@@ -2954,14 +2956,18 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
2954 /* If one of the icon positions was not set, preserve or default it. */ 2956 /* If one of the icon positions was not set, preserve or default it. */
2955 if (! TYPE_RANGED_INTEGERP (int, icon_left)) 2957 if (! TYPE_RANGED_INTEGERP (int, icon_left))
2956 { 2958 {
2959#ifdef HAVE_X_WINDOWS
2957 icon_left_no_change = 1; 2960 icon_left_no_change = 1;
2961#endif
2958 icon_left = Fcdr (Fassq (Qicon_left, f->param_alist)); 2962 icon_left = Fcdr (Fassq (Qicon_left, f->param_alist));
2959 if (NILP (icon_left)) 2963 if (NILP (icon_left))
2960 XSETINT (icon_left, 0); 2964 XSETINT (icon_left, 0);
2961 } 2965 }
2962 if (! TYPE_RANGED_INTEGERP (int, icon_top)) 2966 if (! TYPE_RANGED_INTEGERP (int, icon_top))
2963 { 2967 {
2968#ifdef HAVE_X_WINDOWS
2964 icon_top_no_change = 1; 2969 icon_top_no_change = 1;
2970#endif
2965 icon_top = Fcdr (Fassq (Qicon_top, f->param_alist)); 2971 icon_top = Fcdr (Fassq (Qicon_top, f->param_alist));
2966 if (NILP (icon_top)) 2972 if (NILP (icon_top))
2967 XSETINT (icon_top, 0); 2973 XSETINT (icon_top, 0);
diff --git a/src/w32font.c b/src/w32font.c
index 654e0d9cae4..fb83ec16a5f 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -2562,7 +2562,7 @@ w32font_filter_properties (Lisp_Object font, Lisp_Object alist)
2562 2562
2563struct font_driver w32font_driver = 2563struct font_driver w32font_driver =
2564 { 2564 {
2565 0, /* Qgdi */ 2565 LISP_INITIALLY_ZERO, /* Qgdi */
2566 0, /* case insensitive */ 2566 0, /* case insensitive */
2567 w32font_get_cache, 2567 w32font_get_cache,
2568 w32font_list, 2568 w32font_list,
diff --git a/src/w32menu.c b/src/w32menu.c
index 4f8e8dbef05..68fbd3aa98e 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -82,8 +82,8 @@ typedef BOOL (WINAPI * SetMenuItemInfoA_Proc) (
82 IN LPCMENUITEMINFOA); 82 IN LPCMENUITEMINFOA);
83typedef int (WINAPI * MessageBoxW_Proc) ( 83typedef int (WINAPI * MessageBoxW_Proc) (
84 IN HWND window, 84 IN HWND window,
85 IN WCHAR *text, 85 IN const WCHAR *text,
86 IN WCHAR *caption, 86 IN const WCHAR *caption,
87 IN UINT type); 87 IN UINT type);
88 88
89#ifdef NTGUI_UNICODE 89#ifdef NTGUI_UNICODE
@@ -629,7 +629,7 @@ w32_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
629 { 629 {
630 /* Create a new pane. */ 630 /* Create a new pane. */
631 Lisp_Object pane_name, prefix; 631 Lisp_Object pane_name, prefix;
632 char *pane_string; 632 const char *pane_string;
633 pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); 633 pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME);
634 prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); 634 prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
635 635
@@ -1145,7 +1145,8 @@ simple_dialog_show (struct frame *f, Lisp_Object contents, Lisp_Object header)
1145 /* Use Unicode if possible, so any language can be displayed. */ 1145 /* Use Unicode if possible, so any language can be displayed. */
1146 if (unicode_message_box) 1146 if (unicode_message_box)
1147 { 1147 {
1148 WCHAR *text, *title; 1148 WCHAR *text;
1149 const WCHAR *title;
1149 USE_SAFE_ALLOCA; 1150 USE_SAFE_ALLOCA;
1150 1151
1151 if (STRINGP (temp)) 1152 if (STRINGP (temp))
@@ -1180,7 +1181,7 @@ simple_dialog_show (struct frame *f, Lisp_Object contents, Lisp_Object header)
1180 } 1181 }
1181 else 1182 else
1182 { 1183 {
1183 char *text, *title; 1184 const char *text, *title;
1184 1185
1185 /* Fall back on ANSI message box, but at least use system 1186 /* Fall back on ANSI message box, but at least use system
1186 encoding so questions representable by the system codepage 1187 encoding so questions representable by the system codepage
diff --git a/src/w32term.c b/src/w32term.c
index 0a8dbb39f7b..a66aca1e846 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -6468,7 +6468,7 @@ static void
6468w32_initialize (void) 6468w32_initialize (void)
6469{ 6469{
6470 HANDLE shell; 6470 HANDLE shell;
6471 HRESULT (WINAPI * set_user_model) (wchar_t * id); 6471 HRESULT (WINAPI * set_user_model) (const wchar_t * id);
6472 6472
6473 baud_rate = 19200; 6473 baud_rate = 19200;
6474 6474
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index fb3fbd0d607..bf1d903df0b 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -964,7 +964,7 @@ font_table_error:
964 964
965struct font_driver uniscribe_font_driver = 965struct font_driver uniscribe_font_driver =
966 { 966 {
967 0, /* Quniscribe */ 967 LISP_INITIALLY_ZERO, /* Quniscribe */
968 0, /* case insensitive */ 968 0, /* case insensitive */
969 w32font_get_cache, 969 w32font_get_cache,
970 uniscribe_list, 970 uniscribe_list,