emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master d4352f8: Include file cleanup for w32 files in src


From: Eli Zaretskii
Subject: [Emacs-diffs] master d4352f8: Include file cleanup for w32 files in src directory
Date: Thu, 22 Oct 2015 16:53:53 +0000

branch: master
commit d4352f813a0703cc7f7a873525131b272ef0c105
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Include file cleanup for w32 files in src directory
    
    * src/w32xfns.c: Don't include keyboard.h, window.h, charset.h,
    fontset.h, blockinput.h.
    * src/w32uniscribe.c: Don't include dispextern.h, character.h,
    charset.h, fontset.h.
    * src/w32term.c: Don't include systty.h, systime.h, charset.h,
    character.h, ccl.h, dispextern.h, disptab.h, intervals.h,
    process.h, atimer.h, keymap.h, w32heap.h.  Include bitmap/gray.xbm
    in an ifdef-ed away block.
    Include fcntl.h for CYGWIN.
    (set_frame_param): Remove unused function.
    * src/w32select.c: Don't include charset.h and composite.h.
    (setup_config, Fw32_get_clipboard_data): Avoid compiler warnings
    due to pointer signedness mismatches.
    * src/w32reg.c (w32_get_string_resource): Avoid compiler warnings
    due to pointer signedness mismatches.
    * src/w32proc.c: Include unistd.h.  Don't include systime.h,
    process.h, dispextern.h.
    (sys_spawnve, Fw32_short_file_name, Fw32_long_file_name)
    (Fw32_application_type): Avoid compiler warnings due to pointer
    signedness mismatches.
    * src/w32menu.c: Don't include keymap.h, termhooks.h, window.h,
    character.h, charset.h, dispextern.h.
    (simple_dialog_show, add_menu_item): Avoid compiler warnings due
    to pointer signedness mismatches.
    * src/w32inevt.c: Don't include dispextern.h, window.h,
    termhooks.h, w32heap.h.
    * src/w32font.c: Don't include dispextern.h, character.h,
    charset.h, fontset.h, font.h.
    (intern_font_name, add_font_entity_to_list)
    (registry_to_w32_charset, w32_to_x_charset, fill_in_logfont)
    (list_all_matching_fonts): Avoid compiler warnings due to pointer
    signedness mismatches.
    * src/w32fns.c: Don't include character.h, intervals.h,
    dispextern.h, epaths.h, charset.h, ccl.h, fontset.h, systime.h,
    termhooks.h, w32heap.h, bitmap/gray.xbm, font.h, w32font.h.
    (w32_color_map_lookup, add_system_logical_colors_to_map)
    (x_decode_color, x_set_name, FPRINTF_WM_CHARS, Fxw_color_defined_p)
    (Fxw_color_values, x_display_info_for_name, Fset_message_beep)
    (x_create_tip_frame, Fx_file_dialog, Fsystem_move_file_to_trash)
    (w32_parse_hot_key, Ffile_system_info, w32_kbd_patch_key): Avoid
    compiler warnings, mainly due to pointer signedness mismatches.
    (unwind_create_frame_1): Remove unused function.
    * src/w32console.c: Don't include character.h, disptab.h, frame.h,
    window.h, termhooks.h, dispextern.h.
    (w32con_write_glyphs, w32con_write_glyphs_with_face): Fix pointer
    signedness mismatch.
    * src/w32.c: Include c-strcase.h and systty.h.  Don't include
    w32heap.h.
---
 src/w32.c          |   10 ++++--
 src/w32console.c   |   19 +++--------
 src/w32fns.c       |   85 +++++++++++++++++++---------------------------------
 src/w32font.c      |   21 +++++--------
 src/w32heap.c      |    2 +-
 src/w32inevt.c     |    6 +---
 src/w32menu.c      |   17 +++-------
 src/w32proc.c      |   18 +++++------
 src/w32reg.c       |    6 ++--
 src/w32select.c    |    8 ++---
 src/w32term.c      |   34 +++++----------------
 src/w32uniscribe.c |    4 --
 src/w32xfns.c      |    8 +----
 13 files changed, 81 insertions(+), 157 deletions(-)

diff --git a/src/w32.c b/src/w32.c
index bb51496..15cfd92 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -67,7 +67,7 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #undef localtime
 
 #include "lisp.h"
-#include "epaths.h"    /* for SHELL */
+#include "epaths.h"    /* for PATH_EXEC */
 
 #include <pwd.h>
 #include <grp.h>
@@ -224,20 +224,22 @@ typedef struct _REPARSE_DATA_BUFFER {
 
 #include <iphlpapi.h>  /* should be after winsock2.h */
 
+#include <c-strcase.h>
+
 #include "w32.h"
 #include <dirent.h>
 #include "w32common.h"
-#include "w32heap.h"
 #include "w32select.h"
-#include "systime.h"
+#include "systime.h"           /* for current_timespec, struct timespec */
 #include "dispextern.h"                /* for xstrcasecmp */
 #include "coding.h"            /* for Vlocale_coding_system */
 
 #include "careadlinkat.h"
 #include "allocator.h"
 
-/* For serial_configure and serial_open.  */
+/* For Lisp_Process, serial_configure and serial_open.  */
 #include "process.h"
+#include "systty.h"
 
 typedef HRESULT (WINAPI * ShGetFolderPath_fn)
   (IN HWND, IN int, IN HANDLE, IN DWORD, OUT char *);
diff --git a/src/w32console.c b/src/w32console.c
index a38a558..ec54f83 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -28,22 +28,13 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include <windows.h>
 
 #include "lisp.h"
-#include "character.h"
 #include "coding.h"
-#include "disptab.h"
-#include "frame.h"
-#include "window.h"
-#include "termhooks.h"
-#include "termchar.h"
-#include "dispextern.h"
+#include "termchar.h"  /* for FRAME_TTY */
 #include "menu.h"      /* for tty_menu_show */
 #include "w32term.h"
 #include "w32common.h" /* for os_subtype */
 #include "w32inevt.h"
 
-/* from window.c */
-extern Lisp_Object Frecenter (Lisp_Object);
-
 static void w32con_move_cursor (struct frame *f, int row, int col);
 static void w32con_clear_to_end (struct frame *f);
 static void w32con_clear_frame (struct frame *f);
@@ -297,7 +288,7 @@ w32con_write_glyphs (struct frame *f, register struct glyph 
*string,
 {
   DWORD r;
   WORD char_attr;
-  unsigned char *conversion_buffer;
+  LPCSTR conversion_buffer;
   struct coding_system *coding;
 
   if (len <= 0)
@@ -328,7 +319,7 @@ w32con_write_glyphs (struct frame *f, register struct glyph 
*string,
       if (n == len)
        /* This is the last run.  */
        coding->mode |= CODING_MODE_LAST_BLOCK;
-      conversion_buffer = encode_terminal_code (string, n, coding);
+      conversion_buffer = (LPCSTR) encode_terminal_code (string, n, coding);
       if (coding->produced > 0)
        {
          /* Set the attribute for these characters.  */
@@ -365,7 +356,7 @@ w32con_write_glyphs_with_face (struct frame *f, register 
int x, register int y,
                               register struct glyph *string, register int len,
                               register int face_id)
 {
-  unsigned char *conversion_buffer;
+  LPCSTR conversion_buffer;
   struct coding_system *coding;
 
   if (len <= 0)
@@ -380,7 +371,7 @@ w32con_write_glyphs_with_face (struct frame *f, register 
int x, register int y,
      they all have the same face.  So this _is_ the last block.  */
   coding->mode |= CODING_MODE_LAST_BLOCK;
 
-  conversion_buffer = encode_terminal_code (string, len, coding);
+  conversion_buffer = (LPCSTR) encode_terminal_code (string, len, coding);
   if (coding->produced > 0)
     {
       DWORD filled, written;
diff --git a/src/w32fns.c b/src/w32fns.c
index 7434215..d92352a 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -35,24 +35,14 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include "w32term.h"
 #include "frame.h"
 #include "window.h"
-#include "character.h"
 #include "buffer.h"
-#include "intervals.h"
-#include "dispextern.h"
 #include "keyboard.h"
 #include "blockinput.h"
-#include "epaths.h"
-#include "charset.h"
 #include "coding.h"
-#include "ccl.h"
-#include "fontset.h"
-#include "systime.h"
-#include "termhooks.h"
 
 #include "w32common.h"
 
 #ifdef WINDOWSNT
-#include "w32heap.h"
 #include <mbstring.h>
 #endif /* WINDOWSNT */
 
@@ -62,8 +52,6 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include "w32.h"
 #endif
 
-#include "bitmaps/gray.xbm"
-
 #include <commctrl.h>
 #include <commdlg.h>
 #include <shellapi.h>
@@ -75,9 +63,6 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include <imm.h>
 #include <windowsx.h>
 
-#include "font.h"
-#include "w32font.h"
-
 #ifndef FOF_NO_CONNECTED_ELEMENTS
 #define FOF_NO_CONNECTED_ELEMENTS 0x2000
 #endif
@@ -759,7 +744,7 @@ w32_color_map_lookup (const char *colorname)
 
       tem = XCAR (elt);
 
-      if (lstrcmpi (SDATA (tem), colorname) == 0)
+      if (lstrcmpi (SSDATA (tem), colorname) == 0)
        {
          ret = Fcdr (elt);
          break;
@@ -802,7 +787,7 @@ add_system_logical_colors_to_map (Lisp_Object 
*system_colors)
       strcpy (full_name_buffer, SYSTEM_COLOR_PREFIX);
 
       while (RegEnumValueA (colors_key, index, name_buffer, &name_size,
-                           NULL, NULL, color_buffer, &color_size)
+                           NULL, NULL, (LPBYTE)color_buffer, &color_size)
             == ERROR_SUCCESS)
        {
          int r, g, b;
@@ -1227,9 +1212,9 @@ x_decode_color (struct frame *f, Lisp_Object arg, int def)
 
   CHECK_STRING (arg);
 
-  if (strcmp (SDATA (arg), "black") == 0)
+  if (strcmp (SSDATA (arg), "black") == 0)
     return BLACK_PIX_DEFAULT (f);
-  else if (strcmp (SDATA (arg), "white") == 0)
+  else if (strcmp (SSDATA (arg), "white") == 0)
     return WHITE_PIX_DEFAULT (f);
 
   if ((FRAME_DISPLAY_INFO (f)->n_planes * FRAME_DISPLAY_INFO (f)->n_cbits) == 
1)
@@ -1237,7 +1222,7 @@ x_decode_color (struct frame *f, Lisp_Object arg, int def)
 
   /* w32_defined_color is responsible for coping with failures
      by looking for a near-miss.  */
-  if (w32_defined_color (f, SDATA (arg), &cdef, true))
+  if (w32_defined_color (f, SSDATA (arg), &cdef, true))
     return cdef.pixel;
 
   /* defined_color failed; return an ultimate default.  */
@@ -1866,7 +1851,7 @@ x_set_name (struct frame *f, Lisp_Object name, bool 
explicit)
       /* Check for no change needed in this very common case
         before we do any consing.  */
       if (!strcmp (FRAME_DISPLAY_INFO (f)->w32_id_name,
-                  SDATA (f->name)))
+                  SSDATA (f->name)))
        return;
       name = build_string (FRAME_DISPLAY_INFO (f)->w32_id_name);
     }
@@ -2955,7 +2940,7 @@ get_wm_chars (HWND aWnd, int *buf, int buflen, int 
ignore_ctrl, int ctrl,
 #ifdef DBG_WM_CHARS
 #  define FPRINTF_WM_CHARS(ARG)        fprintf ARG
 #else
-#  define FPRINTF_WM_CHARS(ARG)        0
+#  define FPRINTF_WM_CHARS(ARG)        (void)0
 #endif
 
 /* This is a heuristic only.  This is supposed to track the state of the
@@ -3142,25 +3127,25 @@ deliver_wm_chars (int do_translate, HWND hwnd, UINT 
msg, UINT wParam,
              && console_modifiers & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED))
            {
              type_CtrlAlt = "bB";   /* generic bindable Ctrl-Alt- modifiers */
-             if (console_modifiers & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)
+             if ((console_modifiers & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED))
                  == (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED))
                 /* double-Ctrl:
                    e.g. AltGr-rCtrl on some layouts (in this order!) */
                type_CtrlAlt = "dD";
-             else if (console_modifiers
-                      & (LEFT_CTRL_PRESSED | LEFT_ALT_PRESSED)
+             else if ((console_modifiers
+                       & (LEFT_CTRL_PRESSED | LEFT_ALT_PRESSED))
                       == (LEFT_CTRL_PRESSED | LEFT_ALT_PRESSED))
                type_CtrlAlt = "lL"; /* Ctrl-Alt- modifiers on the left */
              else if (!NILP (Vw32_recognize_altgr)
-                      && (console_modifiers
-                          & (RIGHT_ALT_PRESSED | LEFT_CTRL_PRESSED))
+                      && ((console_modifiers
+                           & (RIGHT_ALT_PRESSED | LEFT_CTRL_PRESSED)))
                          == (RIGHT_ALT_PRESSED | LEFT_CTRL_PRESSED))
                type_CtrlAlt = "gG"; /* modifiers as in AltGr */
            }
          else if (wmsg.dwModifiers & (alt_modifier | meta_modifier)
-                  || (console_modifiers
-                      & (LEFT_WIN_PRESSED | RIGHT_WIN_PRESSED
-                         | APPS_PRESSED | SCROLLLOCK_ON)))
+                  || ((console_modifiers
+                       & (LEFT_WIN_PRESSED | RIGHT_WIN_PRESSED
+                          | APPS_PRESSED | SCROLLLOCK_ON))))
            {
              /* Pure Alt (or combination of Alt, Win, APPS, scrolllock.  */
              type_CtrlAlt = "aA";
@@ -4828,12 +4813,6 @@ do_unwind_create_frame (Lisp_Object frame)
 }
 
 static void
-unwind_create_frame_1 (Lisp_Object val)
-{
-  inhibit_lisp_code = val;
-}
-
-static void
 x_default_font_parameter (struct frame *f, Lisp_Object parms)
 {
   struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
@@ -5239,7 +5218,7 @@ DEFUN ("xw-color-defined-p", Fxw_color_defined_p, 
Sxw_color_defined_p, 1, 2, 0,
 
   CHECK_STRING (color);
 
-  if (w32_defined_color (f, SDATA (color), &foo, false))
+  if (w32_defined_color (f, SSDATA (color), &foo, false))
     return Qt;
   else
     return Qnil;
@@ -5254,7 +5233,7 @@ DEFUN ("xw-color-values", Fxw_color_values, 
Sxw_color_values, 1, 2, 0,
 
   CHECK_STRING (color);
 
-  if (w32_defined_color (f, SDATA (color), &foo, false))
+  if (w32_defined_color (f, SSDATA (color), &foo, false))
     return list3i ((GetRValue (foo.pixel) << 8) | GetRValue (foo.pixel),
                   (GetGValue (foo.pixel) << 8) | GetGValue (foo.pixel),
                   (GetBValue (foo.pixel) << 8) | GetBValue (foo.pixel));
@@ -5759,8 +5738,7 @@ x_display_info_for_name (Lisp_Object name)
 
   validate_x_resource_name ();
 
-  dpyinfo = w32_term_init (name, (unsigned char *)0,
-                          SSDATA (Vx_resource_name));
+  dpyinfo = w32_term_init (name, NULL, SSDATA (Vx_resource_name));
 
   if (dpyinfo == 0)
     error ("Cannot connect to server %s", SDATA (name));
@@ -5779,7 +5757,7 @@ terminate Emacs if we can't open the connection.
 (In the Nextstep version, the last two arguments are currently ignored.)  */)
   (Lisp_Object display, Lisp_Object xrm_string, Lisp_Object must_succeed)
 {
-  unsigned char *xrm_option;
+  char *xrm_option;
   struct w32_display_info *dpyinfo;
 
   CHECK_STRING (display);
@@ -5821,9 +5799,9 @@ terminate Emacs if we can't open the connection.
   add_system_logical_colors_to_map (&Vw32_color_map);
 
   if (! NILP (xrm_string))
-    xrm_option = SDATA (xrm_string);
+    xrm_option = SSDATA (xrm_string);
   else
-    xrm_option = (unsigned char *) 0;
+    xrm_option = NULL;
 
   /* Use this general default value to start with.  */
   /* First remove .exe suffix from invocation-name - it looks ugly. */
@@ -5841,8 +5819,7 @@ terminate Emacs if we can't open the connection.
 
   /* This is what opens the connection and sets x_current_display.
      This also initializes many symbols, such as those used for input.  */
-  dpyinfo = w32_term_init (display, xrm_option,
-                          SSDATA (Vx_resource_name));
+  dpyinfo = w32_term_init (display, xrm_option, SSDATA (Vx_resource_name));
 
   if (dpyinfo == 0)
     {
@@ -6097,7 +6074,6 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
   struct frame *f;
   Lisp_Object frame;
   Lisp_Object name;
-  long window_prompting = 0;
   int width, height;
   ptrdiff_t count = SPECPDL_INDEX ();
   struct kboard *kb;
@@ -6235,7 +6211,7 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
   f->output_data.w32->dwStyle = WS_BORDER | WS_POPUP | WS_DISABLED;
   f->output_data.w32->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
 
-  window_prompting = x_figure_window_size (f, parms, true, &x_width, 
&x_height);
+  x_figure_window_size (f, parms, true, &x_width, &x_height);
 
   /* No fringes on tip frame.  */
   f->fringe_cols = 0;
@@ -6997,9 +6973,9 @@ value of DIR as in previous invocations; this is standard 
Windows behavior.  */)
 
     /* We modify these in-place, so make copies for safety.  */
     dir = Fcopy_sequence (dir);
-    unixtodos_filename (SDATA (dir));
+    unixtodos_filename (SSDATA (dir));
     filename = Fcopy_sequence (filename);
-    unixtodos_filename (SDATA (filename));
+    unixtodos_filename (SSDATA (filename));
     if (SBYTES (filename) >= MAX_UTF8_PATH)
       report_file_error ("filename too long", default_filename);
     if (w32_unicode_filenames)
@@ -7222,7 +7198,7 @@ DEFUN ("system-move-file-to-trash", 
Fsystem_move_file_to_trash,
 
       encoded_file = ENCODE_FILE (filename);
 
-      path = map_w32_filename (SDATA (encoded_file), NULL);
+      path = map_w32_filename (SSDATA (encoded_file), NULL);
 
       /* The Unicode version of SHFileOperation is not supported on
         Windows 9X. */
@@ -7261,7 +7237,8 @@ DEFUN ("system-move-file-to-trash", 
Fsystem_move_file_to_trash,
          /* If a file cannot be represented in ANSI codepage, don't
             let them inadvertently delete other files because some
             characters are interpreted as a wildcards.  */
-         if (_mbspbrk (tmp_path_a, "?*"))
+         if (_mbspbrk ((unsigned char *)tmp_path_a,
+                       (const unsigned char *)"?*"))
            result = ERROR_FILE_NOT_FOUND;
          else
            {
@@ -7679,7 +7656,7 @@ w32_parse_hot_key (Lisp_Object key)
       c = Fcar (c);
       if (!SYMBOLP (c))
        emacs_abort ();
-      vk_code = lookup_vk_code (SDATA (SYMBOL_NAME (c)));
+      vk_code = lookup_vk_code (SSDATA (SYMBOL_NAME (c)));
     }
   else if (INTEGERP (c))
     {
@@ -8282,7 +8259,7 @@ If the underlying system call fails, value is nil.  */)
     char rootname[MAX_UTF8_PATH];
     wchar_t rootname_w[MAX_PATH];
     char rootname_a[MAX_PATH];
-    char *name = SDATA (encoded);
+    char *name = SSDATA (encoded);
     BOOL result;
 
     /* find the root name of the volume if given */
@@ -8736,7 +8713,7 @@ w32_kbd_patch_key (KEY_EVENT_RECORD *event, int cpId)
 
          event->uChar.UnicodeChar = buf[isdead - 1];
          isdead = WideCharToMultiByte (cpId, 0, buf, isdead,
-                                       ansi_code, 4, NULL, NULL);
+                                       (LPSTR)ansi_code, 4, NULL, NULL);
        }
       else
        isdead = 0;
diff --git a/src/w32font.c b/src/w32font.c
index 1c2f966..2b6f610 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -26,12 +26,7 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include "lisp.h"
 #include "w32term.h"
 #include "frame.h"
-#include "dispextern.h"
-#include "character.h"
-#include "charset.h"
-#include "coding.h"
-#include "fontset.h"
-#include "font.h"
+#include "coding.h"    /* for ENCODE_SYSTEM, DECODE_SYSTEM */
 #include "w32font.h"
 #ifdef WINDOWSNT
 #include "w32.h"
@@ -244,7 +239,7 @@ intern_font_name (char * string)
   Lisp_Object str = DECODE_SYSTEM (build_string (string));
   ptrdiff_t len = SCHARS (str);
   Lisp_Object obarray = check_obarray (Vobarray);
-  Lisp_Object tem = oblookup (obarray, SDATA (str), len, len);
+  Lisp_Object tem = oblookup (obarray, SSDATA (str), len, len);
   /* This code is similar to intern function from lread.c.  */
   return SYMBOLP (tem) ? tem : intern_driver (str, obarray, tem);
 }
@@ -1478,12 +1473,12 @@ add_font_entity_to_list (ENUMLOGFONTEX *logical_font,
      by a foundry, we accept raster fonts if the font name is found
      anywhere within the full name.  */
   if ((logical_font->elfLogFont.lfOutPrecision == OUT_STRING_PRECIS
-       && !strstr (logical_font->elfFullName,
+       && !strstr ((char *)logical_font->elfFullName,
                   logical_font->elfLogFont.lfFaceName))
       /* Check for well known substitutions that mess things up in the
         presence of Type-1 fonts of the same name.  */
       || (!check_face_name (&logical_font->elfLogFont,
-                           logical_font->elfFullName)))
+                           (char *)logical_font->elfFullName)))
     return 1;
 
   /* Make a font entity for the font.  */
@@ -1660,7 +1655,7 @@ registry_to_w32_charset (Lisp_Object charset)
   else if (EQ (charset, Qiso8859_1))
     return ANSI_CHARSET;
   else if (SYMBOLP (charset))
-    return x_to_w32_charset (SDATA (SYMBOL_NAME (charset)));
+    return x_to_w32_charset (SSDATA (SYMBOL_NAME (charset)));
   else
     return DEFAULT_CHARSET;
 }
@@ -1782,7 +1777,7 @@ w32_to_x_charset (int fncharset, char *matching)
             || !SYMBOLP (XCAR (XCDR (this_entry))))
           continue;
 
-        x_charset = SDATA (XCAR (this_entry));
+        x_charset = SSDATA (XCAR (this_entry));
         w32_charset = XCAR (XCDR (this_entry));
         codepage = XCDR (XCDR (this_entry));
 
@@ -1987,7 +1982,7 @@ fill_in_logfont (struct frame *f, LOGFONT *logfont, 
Lisp_Object font_spec)
       else if (SYMBOLP (tmp))
        {
          strncpy (logfont->lfFaceName,
-                  SDATA (ENCODE_SYSTEM (SYMBOL_NAME (tmp))), LF_FACESIZE);
+                  SSDATA (ENCODE_SYSTEM (SYMBOL_NAME (tmp))), LF_FACESIZE);
          logfont->lfFaceName[LF_FACESIZE-1] = '\0';
        }
     }
@@ -2083,7 +2078,7 @@ list_all_matching_fonts (struct font_callback_data 
*match_data)
       if (NILP (family))
         continue;
       else if (SYMBOLP (family))
-        name = SDATA (ENCODE_SYSTEM (SYMBOL_NAME (family)));
+        name = SSDATA (ENCODE_SYSTEM (SYMBOL_NAME (family)));
       else
        continue;
 
diff --git a/src/w32heap.c b/src/w32heap.c
index 60afd1d..a74e7ad 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -52,7 +52,7 @@
 #include <sys/mman.h>
 #include "w32common.h"
 #include "w32heap.h"
-#include "lisp.h"  /* for VALMASK */
+#include "lisp.h"
 
 /* We chose to leave those declarations here.  They are used only in
    this file.  The RtlCreateHeap is available since XP.  It is located
diff --git a/src/w32inevt.c b/src/w32inevt.c
index ea2db26..db2e218 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -37,12 +37,8 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include "lisp.h"
 #include "keyboard.h"
 #include "frame.h"
-#include "dispextern.h"
-#include "window.h"
 #include "blockinput.h"
-#include "termhooks.h"
-#include "termchar.h"
-#include "w32heap.h"
+#include "termchar.h"  /* for Mouse_HLInfo, tty_display_info */
 #include "w32term.h"
 #include "w32inevt.h"
 
diff --git a/src/w32menu.c b/src/w32menu.c
index 40b8f5f..6af69f4 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -25,15 +25,10 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 
 #include "lisp.h"
 #include "keyboard.h"
-#include "keymap.h"
 #include "frame.h"
-#include "termhooks.h"
-#include "window.h"
 #include "blockinput.h"
-#include "character.h"
 #include "buffer.h"
-#include "charset.h"
-#include "coding.h"
+#include "coding.h"    /* for ENCODE_SYSTEM */
 #include "menu.h"
 
 /* This may include sys/types.h, and that somehow loses
@@ -54,8 +49,6 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include <sys/types.h>
 #endif
 
-#include "dispextern.h"
-
 #include "w32common.h" /* for osinfo_cache */
 
 #undef HAVE_DIALOGS /* TODO: Implement native dialogs.  */
@@ -1104,14 +1097,14 @@ simple_dialog_show (struct frame *f, Lisp_Object 
contents, Lisp_Object header)
 
       if (STRINGP (temp))
        {
-         char *utf8_text = SDATA (ENCODE_UTF_8 (temp));
+         char *utf8_text = SSDATA (ENCODE_UTF_8 (temp));
          /* Be pessimistic about the number of characters needed.
             Remember characters outside the BMP will take more than
             one utf16 word, so we cannot simply use the character
             length of temp.  */
          int utf8_len = strlen (utf8_text);
          text = SAFE_ALLOCA ((utf8_len + 1) * sizeof (WCHAR));
-         utf8to16 (utf8_text, utf8_len, text);
+         utf8to16 ((unsigned char *)utf8_text, utf8_len, text);
        }
       else
        {
@@ -1140,7 +1133,7 @@ simple_dialog_show (struct frame *f, Lisp_Object 
contents, Lisp_Object header)
         encoding so questions representable by the system codepage
         are encoded properly.  */
       if (STRINGP (temp))
-       text = SDATA (ENCODE_SYSTEM (temp));
+       text = SSDATA (ENCODE_SYSTEM (temp));
       else
        text = "";
 
@@ -1353,7 +1346,7 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
       else
        utf16_string = SAFE_ALLOCA ((utf8_len + 1) * sizeof (WCHAR));
 
-      utf8to16 (out_string, utf8_len, utf16_string);
+      utf8to16 ((unsigned char *)out_string, utf8_len, utf16_string);
       return_value = unicode_append_menu (menu, fuFlags,
                                          item != NULL ? (UINT_PTR) item
                                            : (UINT_PTR) wv->call_data,
diff --git a/src/w32proc.c b/src/w32proc.c
index 6659ed7..8a1e17e 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -29,6 +29,7 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include <ctype.h>
 #include <io.h>
 #include <fcntl.h>
+#include <unistd.h>
 #include <signal.h>
 #include <sys/file.h>
 #include <mbstring.h>
@@ -59,12 +60,9 @@ extern BOOL WINAPI IsValidLocale (LCID, DWORD);
 #include "w32.h"
 #include "w32common.h"
 #include "w32heap.h"
-#include "systime.h"
-#include "syswait.h"
-#include "process.h"
+#include "syswait.h"   /* for WNOHANG */
 #include "syssignal.h"
 #include "w32term.h"
-#include "dispextern.h"                /* for xstrcasecmp */
 #include "coding.h"
 
 #define RVA_TO_PTR(var,section,filedata) \
@@ -1757,7 +1755,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char 
**envp)
          return -1;
        }
       program = ENCODE_FILE (full);
-      cmdname = SDATA (program);
+      cmdname = SSDATA (program);
     }
   else
     {
@@ -1779,7 +1777,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char 
**envp)
   /* We explicitly require that the command's file name be encodable
      in the current ANSI codepage, because we will be invoking it via
      the ANSI APIs.  */
-  if (_mbspbrk (cmdname_a, "?"))
+  if (_mbspbrk ((unsigned char *)cmdname_a, (const unsigned char *)"?"))
     {
       errno = ENOENT;
       return -1;
@@ -2881,7 +2879,7 @@ All path elements in FILENAME are converted to their 
short names.  */)
   filename = Fexpand_file_name (filename, Qnil);
 
   /* luckily, this returns the short version of each element in the path.  */
-  if (w32_get_short_filename (SDATA (ENCODE_FILE (filename)),
+  if (w32_get_short_filename (SSDATA (ENCODE_FILE (filename)),
                              shortname, MAX_PATH) == 0)
     return Qnil;
 
@@ -2911,7 +2909,7 @@ All path elements in FILENAME are converted to their long 
names.  */)
   /* first expand it.  */
   filename = Fexpand_file_name (filename, Qnil);
 
-  if (!w32_get_long_filename (SDATA (ENCODE_FILE (filename)), longname,
+  if (!w32_get_long_filename (SSDATA (ENCODE_FILE (filename)), longname,
                              MAX_UTF8_PATH))
     return Qnil;
 
@@ -3011,12 +3009,12 @@ such programs cannot be invoked by Emacs anyway.  */)
 
   program = Fexpand_file_name (program, Qnil);
   encoded_progname = ENCODE_FILE (program);
-  progname = SDATA (encoded_progname);
+  progname = SSDATA (encoded_progname);
   unixtodos_filename (progname);
   filename_to_ansi (progname, progname_a);
   /* Reject file names that cannot be encoded in the current ANSI
      codepage.  */
-  if (_mbspbrk (progname_a, "?"))
+  if (_mbspbrk ((unsigned char *)progname_a, (const unsigned char *)"?"))
     return Qunknown;
 
   if (w32_executable_type (progname_a, &is_dos_app, &is_cygwin_app,
diff --git a/src/w32reg.c b/src/w32reg.c
index 261cfcd..a4ce218 100644
--- a/src/w32reg.c
+++ b/src/w32reg.c
@@ -21,7 +21,7 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 #include "lisp.h"
-#include "w32term.h"
+#include "w32term.h"   /* for XrmDatabase, xrdb */
 #include "blockinput.h"
 
 #include <stdio.h>
@@ -73,7 +73,7 @@ w32_get_rdb_resource (char *rdb, const char *resource)
   return NULL;
 }
 
-static LPBYTE
+static char *
 w32_get_string_resource (const char *name, const char *class, DWORD dwexptype)
 {
   LPBYTE lpvalue = NULL;
@@ -134,7 +134,7 @@ w32_get_string_resource (const char *name, const char 
*class, DWORD dwexptype)
       /* Check if there are Windows specific defaults defined.  */
       return w32_get_rdb_resource (SYSTEM_DEFAULT_RESOURCES, name);
     }
-  return (lpvalue);
+  return (char *)lpvalue;
 }
 
 /* Retrieve the string resource specified by NAME with CLASS from
diff --git a/src/w32select.c b/src/w32select.c
index 3c554c6..3962ac6 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -76,11 +76,9 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include "lisp.h"
 #include "w32common.h" /* os_subtype */
 #include "w32term.h"   /* for all of the w32 includes */
-#include "keyboard.h"
+#include "keyboard.h"  /* for waiting_for_input */
 #include "blockinput.h"
-#include "charset.h"
 #include "coding.h"
-#include "composite.h"
 
 #ifdef CYGWIN
 #include <string.h>
@@ -513,7 +511,7 @@ setup_config (void)
   cfg_clipboard_type = CF_TEXT;
 
   /* Interpret the coding system symbol name */
-  coding_name = SDATA (SYMBOL_NAME (cfg_coding_system));
+  coding_name = SSDATA (SYMBOL_NAME (cfg_coding_system));
 
   /* "(.*-)?utf-16.*" -> CF_UNICODETEXT */
   cp = strstr (coding_name, "utf-16");
@@ -857,7 +855,7 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
       {
        int i;
 
-       nbytes = strlen (src);
+       nbytes = strlen ((char *)src);
 
        for (i = 0; i < nbytes; i++)
          {
diff --git a/src/w32term.c b/src/w32term.c
index bd6070f..8317867 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -24,37 +24,27 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include "blockinput.h"
 #include "w32term.h"
 
-#include "systty.h"
-#include "systime.h"
-
 #include <ctype.h>
 #include <errno.h>
 #include <sys/stat.h>
+#ifdef CYGWIN
+#include <fcntl.h>     /* for O_RDWR */
+#endif
 #include <imm.h>
 
-#include "charset.h"
-#include "character.h"
 #include "coding.h"
-#include "ccl.h"
 #include "frame.h"
-#include "dispextern.h"
 #include "fontset.h"
 #include "termhooks.h"
 #include "termopts.h"
 #include "termchar.h"
-#include "disptab.h"
 #include "buffer.h"
 #include "window.h"
 #include "keyboard.h"
-#include "intervals.h"
-#include "process.h"
-#include "atimer.h"
-#include "keymap.h"
-#include "menu.h"
+#include "menu.h"      /* for w32_menu_show */
 
 #ifdef WINDOWSNT
 #include "w32.h"       /* for filename_from_utf16, filename_from_ansi */
-#include "w32heap.h"
 #endif
 
 #ifndef WINDOWSNT
@@ -65,6 +55,10 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 
 #include "font.h"
 #include "w32font.h"
+
+#if 0  /* TODO: stipple */
+#include "bitmaps/gray.xbm"
+#endif
 
 /* Fringe bitmaps.  */
 
@@ -4509,18 +4503,6 @@ x_scroll_bar_clear (struct frame *f)
       }
 }
 
-static void
-set_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
-{
-  register Lisp_Object old_alist_elt;
-
-  old_alist_elt = Fassq (prop, f->param_alist);
-  if (EQ (old_alist_elt, Qnil))
-    fset_param_alist (f, Fcons (Fcons (prop, val), f->param_alist));
-  else
-    Fsetcdr (old_alist_elt, val);
-}
-
 /* The main W32 event-reading loop - w32_read_socket.  */
 
 /* Record the last 100 characters stored
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index e5efec7..a8b5932 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -33,11 +33,7 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include "lisp.h"
 #include "w32term.h"
 #include "frame.h"
-#include "dispextern.h"
-#include "character.h"
-#include "charset.h"
 #include "composite.h"
-#include "fontset.h"
 #include "font.h"
 #include "w32font.h"
 
diff --git a/src/w32xfns.c b/src/w32xfns.c
index 35e12fd..48da14d 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -20,16 +20,12 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include <config.h>
 #include <signal.h>
 #include <stdio.h>
+#include <windows.h>
+#include <windowsx.h>
 
 #include "lisp.h"
-#include "keyboard.h"
 #include "frame.h"
-#include "window.h"
-#include "charset.h"
-#include "fontset.h"
-#include "blockinput.h"
 #include "w32term.h"
-#include "windowsx.h"
 
 #define myalloc(cb) GlobalAllocPtr (GPTR, cb)
 #define myfree(lp) GlobalFreePtr (lp)



reply via email to

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