changeset 86065:2557aa084b57

(Fw32_registered_hot_keys): Don't return the nil values corresponding to deleted entries; they are an implementation detail. (gray_bitmap_width, gray_bitmap_height, gray_bitmap_bits): Remove variables. (w32_pass_extra_mouse_buttons_to_system, w32_strict_fontnames, w32_pass_multimedia_buttons_to_system, w32_strict_painting, Vw32_charset_info_alist, w32_to_x_color, w32_init_class, w32_createscrollbar, w32_createwindow, my_post_msg, w32_get_modifiers, w32_grabbed_keys, cancel_all_deferred_msgs): Make static. (syms_of_w32fns) <w32-pass-multimedia-buttons-to-system>: Fix typo in docstring.
author Juanma Barranquero <lekktu@gmail.com>
date Wed, 14 Nov 2007 15:33:31 +0000
parents 31d99cc7cfc9
children 3d5cac1d55ea
files src/w32fns.c
diffstat 1 files changed, 107 insertions(+), 112 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32fns.c	Wed Nov 14 11:18:54 2007 +0000
+++ b/src/w32fns.c	Wed Nov 14 15:33:31 2007 +0000
@@ -77,10 +77,6 @@
    it, and including `bitmaps/gray' more than once is a problem when
    config.h defines `static' as an empty replacement string.  */
 
-int gray_bitmap_width = gray_width;
-int gray_bitmap_height = gray_height;
-unsigned char *gray_bitmap_bits = gray_bits;
-
 /* The colormap for converting color names to RGB values */
 Lisp_Object Vw32_color_map;
 
@@ -143,10 +139,10 @@
 int w32_mouse_move_interval;
 
 /* Flag to indicate if XBUTTON events should be passed on to Windows.  */
-int w32_pass_extra_mouse_buttons_to_system;
+static int w32_pass_extra_mouse_buttons_to_system;
 
 /* Flag to indicate if media keys should be passed on to Windows.  */
-int w32_pass_multimedia_buttons_to_system;
+static int w32_pass_multimedia_buttons_to_system;
 
 /* Non nil if no window manager is in use.  */
 Lisp_Object Vx_no_window_manager;
@@ -185,14 +181,14 @@
 Lisp_Object Vw32_bdf_filename_alist;
 
 /* A flag to control whether fonts are matched strictly or not.  */
-int w32_strict_fontnames;
+static int w32_strict_fontnames;
 
 /* A flag to control whether we should only repaint if GetUpdateRect
    indicates there is an update region.  */
-int w32_strict_painting;
+static int w32_strict_painting;
 
 /* Associative list linking character set strings to Windows codepages. */
-Lisp_Object Vw32_charset_info_alist;
+static Lisp_Object Vw32_charset_info_alist;
 
 /* VIETNAMESE_CHARSET is not defined in some versions of MSVC.  */
 #ifndef VIETNAMESE_CHARSET
@@ -478,7 +474,7 @@
   CHECK_NUMBER (blue);
   CHECK_STRING (name);
 
-  XSETINT (rgb, RGB(XUINT (red), XUINT (green), XUINT (blue)));
+  XSETINT (rgb, RGB (XUINT (red), XUINT (green), XUINT (blue)));
 
   BLOCK_INPUT;
 
@@ -821,7 +817,7 @@
   return (cmap);
 }
 
-Lisp_Object
+static Lisp_Object
 w32_to_x_color (rgb)
      Lisp_Object rgb;
 {
@@ -938,7 +934,7 @@
       int size;
       color = colorname + 1;
 
-      size = strlen(color);
+      size = strlen (color);
       if (size == 3 || size == 6 || size == 9 || size == 12)
 	{
 	  UINT colorval;
@@ -956,11 +952,11 @@
 	      /* The check for 'x' in the following conditional takes into
 		 account the fact that strtol allows a "0x" in front of
 		 our numbers, and we don't.  */
-	      if (!isxdigit(color[0]) || color[1] == 'x')
+	      if (!isxdigit (color[0]) || color[1] == 'x')
 		break;
 	      t = color[size];
 	      color[size] = '\0';
-	      value = strtoul(color, &end, 16);
+	      value = strtoul (color, &end, 16);
 	      color[size] = t;
 	      if (errno == ERANGE || end - color != size)
 		break;
@@ -990,7 +986,7 @@
 	    }
 	}
     }
-  else if (strnicmp(colorname, "rgb:", 4) == 0)
+  else if (strnicmp (colorname, "rgb:", 4) == 0)
     {
       char *color;
       UINT colorval;
@@ -1007,9 +1003,9 @@
 	  /* The check for 'x' in the following conditional takes into
 	     account the fact that strtol allows a "0x" in front of
 	     our numbers, and we don't.  */
-	  if (!isxdigit(color[0]) || color[1] == 'x')
+	  if (!isxdigit (color[0]) || color[1] == 'x')
 	    break;
-	  value = strtoul(color, &end, 16);
+	  value = strtoul (color, &end, 16);
 	  if (errno == ERANGE)
 	    break;
 	  switch (end - color)
@@ -1045,7 +1041,7 @@
 	  color = end + 1;
 	}
     }
-  else if (strnicmp(colorname, "rgbi:", 5) == 0)
+  else if (strnicmp (colorname, "rgbi:", 5) == 0)
     {
       /* This is an RGB Intensity specification.  */
       char *color;
@@ -1061,7 +1057,7 @@
 	  double value;
 	  UINT val;
 
-	  value = strtod(color, &end);
+	  value = strtod (color, &end);
 	  if (errno == ERANGE)
 	    break;
 	  if (value < 0.0 || value > 1.0)
@@ -1559,7 +1555,6 @@
 #endif /* TODO */
 }
 
-/* Defined in w32term.c. */
 void
 x_set_cursor_color (f, arg, oldval)
      struct frame *f;
@@ -1911,7 +1906,7 @@
 	name = ENCODE_SYSTEM (name);
 
       BLOCK_INPUT;
-      SetWindowText(FRAME_W32_WINDOW (f), SDATA (name));
+      SetWindowText (FRAME_W32_WINDOW (f), SDATA (name));
       UNBLOCK_INPUT;
     }
 }
@@ -1963,7 +1958,7 @@
 	name = ENCODE_SYSTEM (name);
 
       BLOCK_INPUT;
-      SetWindowText(FRAME_W32_WINDOW (f), SDATA (name));
+      SetWindowText (FRAME_W32_WINDOW (f), SDATA (name));
       UNBLOCK_INPUT;
     }
 }
@@ -2010,7 +2005,7 @@
 w32_load_cursor (LPCTSTR name)
 {
   /* Try first to load cursor from application resource.  */
-  Cursor cursor = LoadImage ((HINSTANCE) GetModuleHandle(NULL),
+  Cursor cursor = LoadImage ((HINSTANCE) GetModuleHandle (NULL),
 			     name, IMAGE_CURSOR, 0, 0,
 			     LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED);
   if (!cursor)
@@ -2024,7 +2019,7 @@
 
 extern LRESULT CALLBACK w32_wnd_proc ();
 
-BOOL
+static BOOL
 w32_init_class (hinst)
      HINSTANCE hinst;
 {
@@ -2044,24 +2039,24 @@
   return (RegisterClass (&wc));
 }
 
-HWND
+static HWND
 w32_createscrollbar (f, bar)
      struct frame *f;
      struct scroll_bar * bar;
 {
   return (CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE,
 			/* Position and size of scroll bar.  */
-			XINT(bar->left) + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
-                        XINT(bar->top),
-			XINT(bar->width) - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
-                        XINT(bar->height),
+			XINT (bar->left) + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
+                        XINT (bar->top),
+			XINT (bar->width) - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
+                        XINT (bar->height),
 			FRAME_W32_WINDOW (f),
 			NULL,
 			hinst,
 			NULL));
 }
 
-void
+static void
 w32_createwindow (f)
      struct frame *f;
 {
@@ -2131,7 +2126,7 @@
     }
 }
 
-void
+static void
 my_post_msg (wmsg, hwnd, msg, wParam, lParam)
      W32Msg * wmsg;
      HWND hwnd;
@@ -2363,7 +2358,7 @@
   return 0;
 }
 
-unsigned int
+static unsigned int
 w32_get_modifiers ()
 {
   return ((modifier_set (VK_SHIFT)   ? shift_modifier : 0) |
@@ -2434,12 +2429,12 @@
 }
 
 /* List of special key combinations which w32 would normally capture,
-   but emacs should grab instead.  Not directly visible to lisp, to
+   but Emacs should grab instead.  Not directly visible to lisp, to
    simplify synchronization.  Each item is an integer encoding a virtual
    key code and modifier combination to capture.  */
-Lisp_Object w32_grabbed_keys;
-
-#define HOTKEY(vk,mods)       make_number (((vk) & 255) | ((mods) << 8))
+static Lisp_Object w32_grabbed_keys;
+
+#define HOTKEY(vk, mods)      make_number (((vk) & 255) | ((mods) << 8))
 #define HOTKEY_ID(k)          (XFASTINT (k) & 0xbfff)
 #define HOTKEY_VK_CODE(k)     (XFASTINT (k) & 255)
 #define HOTKEY_MODIFIERS(k)   (XFASTINT (k) >> 8)
@@ -2666,7 +2661,7 @@
   deferred_msg * msg_buf = find_deferred_msg (hwnd, msg);
 
   if (msg_buf == NULL)
-    /* Message may have been cancelled, so don't abort().  */
+    /* Message may have been cancelled, so don't abort.  */
     return;
 
   msg_buf->result = result;
@@ -2676,7 +2671,7 @@
   PostThreadMessage (dwWindowsThreadId, WM_NULL, 0, 0);
 }
 
-void
+static void
 cancel_all_deferred_msgs ()
 {
   deferred_msg * item;
@@ -2754,7 +2749,7 @@
 
   /* Detect quit_char and set quit-flag directly.  Note that we
      still need to post a message to ensure the main thread will be
-     woken up if blocked in sys_select(), but we do NOT want to post
+     woken up if blocked in sys_select, but we do NOT want to post
      the quit_char message itself (because it will usually be as if
      the user had typed quit_char twice).  Instead, we post a dummy
      message that has no particular effect. */
@@ -2909,7 +2904,7 @@
 
 	/* If GetUpdateRect returns 0 (meaning there is no update
            region), assume the whole window needs to be repainted.  */
-	GetClientRect(hwnd, &wmsg.rect);
+	GetClientRect (hwnd, &wmsg.rect);
 	my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
         return 0;
       }
@@ -3703,7 +3698,7 @@
 	    DWORD scrollbar_extra;
 	    RECT wr;
 
-	    wp.length = sizeof(wp);
+	    wp.length = sizeof (wp);
 	    GetWindowRect (hwnd, &wr);
 
 	    enter_crit ();
@@ -4498,11 +4493,12 @@
 
 
 /* Return the charset portion of a font name.  */
-char * xlfd_charset_of_font (char * fontname)
+char *
+xlfd_charset_of_font (char * fontname)
 {
   char *charset, *encoding;
 
-  encoding = strrchr(fontname, '-');
+  encoding = strrchr (fontname, '-');
   if (!encoding || encoding == fontname)
     return NULL;
 
@@ -4510,7 +4506,7 @@
     if (*charset == '-')
       break;
 
-  if (charset == fontname || strcmp(charset, "-*-*") == 0)
+  if (charset == fontname || strcmp (charset, "-*-*") == 0)
     return NULL;
 
   return charset + 1;
@@ -4524,7 +4520,7 @@
 static BOOL x_to_w32_font (char *lpxstr, LOGFONT *lplogfont);
 
 static struct font_info *
-w32_load_system_font (f,fontname,size)
+w32_load_system_font (f, fontname, size)
      struct frame *f;
      char * fontname;
      int size;
@@ -4627,7 +4623,7 @@
                GetFontLanguageInfo, we check the properties of the
                codepage directly, since that is ultimately what we are
                working from anyway.  */
-	    /* font->double_byte_p = GetFontLanguageInfo(hdc) & GCP_DBCS; */
+	    /* font->double_byte_p = GetFontLanguageInfo (hdc) & GCP_DBCS; */
 	    CPINFO cpi = {0};
 	    GetCPInfo (codepage, &cpi);
 	    font->double_byte_p = cpi.MaxCharSize > 1;
@@ -4763,10 +4759,10 @@
    pointer to the structure font_info while allocating it dynamically.
    If loading fails, return NULL. */
 struct font_info *
-w32_load_font (f,fontname,size)
-struct frame *f;
-char * fontname;
-int size;
+w32_load_font (f, fontname, size)
+     struct frame *f;
+     char * fontname;
+     int size;
 {
   Lisp_Object bdf_fonts;
   struct font_info *retval = NULL;
@@ -4802,7 +4798,7 @@
   if (retval)
     return retval;
 
-  return w32_load_system_font(f, fontname, size);
+  return w32_load_system_font (f, fontname, size);
 }
 
 
@@ -4816,7 +4812,7 @@
       if (font->per_char) xfree (font->per_char);
       if (font->bdf) w32_free_bdf_font (font->bdf);
 
-      if (font->hfont) DeleteObject(font->hfont);
+      if (font->hfont) DeleteObject (font->hfont);
       xfree (font);
     }
 }
@@ -4850,16 +4846,16 @@
 {
   if (!lpw) return (FW_DONTCARE);
 
-  if (stricmp (lpw,"heavy") == 0)             return FW_HEAVY;
-  else if (stricmp (lpw,"extrabold") == 0)    return FW_EXTRABOLD;
-  else if (stricmp (lpw,"bold") == 0)         return FW_BOLD;
-  else if (stricmp (lpw,"demibold") == 0)     return FW_SEMIBOLD;
-  else if (stricmp (lpw,"semibold") == 0)     return FW_SEMIBOLD;
-  else if (stricmp (lpw,"medium") == 0)       return FW_MEDIUM;
-  else if (stricmp (lpw,"normal") == 0)       return FW_NORMAL;
-  else if (stricmp (lpw,"light") == 0)        return FW_LIGHT;
-  else if (stricmp (lpw,"extralight") == 0)   return FW_EXTRALIGHT;
-  else if (stricmp (lpw,"thin") == 0)         return FW_THIN;
+  if (stricmp (lpw, "heavy") == 0)             return FW_HEAVY;
+  else if (stricmp (lpw, "extrabold") == 0)    return FW_EXTRABOLD;
+  else if (stricmp (lpw, "bold") == 0)         return FW_BOLD;
+  else if (stricmp (lpw, "demibold") == 0)     return FW_SEMIBOLD;
+  else if (stricmp (lpw, "semibold") == 0)     return FW_SEMIBOLD;
+  else if (stricmp (lpw, "medium") == 0)       return FW_MEDIUM;
+  else if (stricmp (lpw, "normal") == 0)       return FW_NORMAL;
+  else if (stricmp (lpw, "light") == 0)        return FW_LIGHT;
+  else if (stricmp (lpw, "extralight") == 0)   return FW_EXTRALIGHT;
+  else if (stricmp (lpw, "thin") == 0)         return FW_THIN;
   else
     return FW_DONTCARE;
 }
@@ -4905,12 +4901,12 @@
      Format of each entry is
        (CHARSET_NAME . (WINDOWS_CHARSET . CODEPAGE)).
   */
-  this_entry = Fassoc (build_string(charset), Vw32_charset_info_alist);
-
-  if (NILP(this_entry))
+  this_entry = Fassoc (build_string (charset), Vw32_charset_info_alist);
+
+  if (NILP (this_entry))
     {
       /* At startup, we want iso8859-1 fonts to come up properly. */
-      if (stricmp(charset, "iso8859-1") == 0)
+      if (stricmp (charset, "iso8859-1") == 0)
         return ANSI_CHARSET;
       else
         return DEFAULT_CHARSET;
@@ -4978,7 +4974,7 @@
     case ANSI_CHARSET:
       /* Handle startup case of w32-charset-info-alist not
          being set up yet. */
-      if (NILP(Vw32_charset_info_alist))
+      if (NILP (Vw32_charset_info_alist))
         return "iso8859-1";
       charset_type = Qw32_charset_ansi;
       break;
@@ -5117,7 +5113,7 @@
         return buf;
       }
 
-    strncpy(buf, best_match, 31);
+    strncpy (buf, best_match, 31);
     buf[31] = '\0';
     return buf;
   }
@@ -5138,7 +5134,7 @@
     case ANSI_CHARSET:
       /* Handle startup case of w32-charset-info-alist not
          being set up yet. */
-      if (NILP(Vw32_charset_info_alist))
+      if (NILP (Vw32_charset_info_alist))
         return Fcons (build_string ("iso8859-1"), Qnil);
 
       charset_type = Qw32_charset_ansi;
@@ -5298,7 +5294,7 @@
         *end = '\0';
       }
 
-  entry = Fassoc (build_string(charset), Vw32_charset_info_alist);
+  entry = Fassoc (build_string (charset), Vw32_charset_info_alist);
   if (NILP (entry))
     return CP_UNKNOWN;
 
@@ -5355,9 +5351,9 @@
   coding.composing = COMPOSITION_DISABLED;
   bufsz = decoding_buffer_size (&coding, LF_FACESIZE);
 
-  fontname = alloca(sizeof(*fontname) * bufsz);
+  fontname = alloca (sizeof (*fontname) * bufsz);
   decode_coding (&coding, lplogfont->lfFaceName, fontname,
-                 strlen(lplogfont->lfFaceName), bufsz - 1);
+                 strlen (lplogfont->lfFaceName), bufsz - 1);
   *(fontname + coding.produced) = '\0';
 
   /* Replace dashes with underscores so the dashes are not
@@ -5568,7 +5564,7 @@
 
       if (fields > 0)
         {
-	  strncpy (lplogfont->lfFaceName,name, LF_FACESIZE);
+	  strncpy (lplogfont->lfFaceName, name, LF_FACESIZE);
 	  lplogfont->lfFaceName[LF_FACESIZE-1] = 0;
 	}
       else
@@ -5767,7 +5763,7 @@
   }
 
   return (fast_string_match_ignore_case (build_string (regex),
-                                         build_string(font_name_copy)) >= 0);
+                                         build_string (font_name_copy)) >= 0);
 }
 
 /* Callback functions, and a structure holding info they need, for
@@ -6002,7 +5998,8 @@
 /* Interface to fontset handler. (adapted from mw32font.c in Meadow
    and xterm.c in Emacs 20.3) */
 
-static Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names)
+static Lisp_Object
+w32_list_bdf_fonts (Lisp_Object pattern, int max_names)
 {
   char *fontname, *ptnstr;
   Lisp_Object list, tem, newlist = Qnil;
@@ -6073,7 +6070,7 @@
       codepage = w32_codepage_for_font (SDATA (tpat));
       if (codepage != CP_8BIT && codepage != CP_UNICODE
           && codepage != CP_DEFAULT && codepage != CP_UNKNOWN
-	  && !IsValidCodePage(codepage))
+	  && !IsValidCodePage (codepage))
         continue;
 
       /* See if we cached the result for this particular query.
@@ -6184,7 +6181,7 @@
                 XSETCDR (tem, make_number (0));
               SelectObject (hdc, oldobj);
               ReleaseDC (dpyinfo->root_window, hdc);
-              DeleteObject(thisinfo.hfont);
+              DeleteObject (thisinfo.hfont);
               UNBLOCK_INPUT;
             }
           found_size = XINT (XCDR (tem));
@@ -6233,7 +6230,7 @@
     Lisp_Object combined[2];
     combined[0] = w32_list_bdf_fonts (pattern, maxnames - n_fonts);
     combined[1] = newlist;
-    newlist = Fnconc(2, combined);
+    newlist = Fnconc (2, combined);
   }
 
   return newlist;
@@ -6260,7 +6257,7 @@
 
   for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++)
     {
-      if (stricmp(pfi->name, fontname) == 0) return pfi;
+      if (stricmp (pfi->name, fontname) == 0) return pfi;
     }
 
   return NULL;
@@ -6297,7 +6294,7 @@
 }
 
 /* directory-files from dired.c.  */
-Lisp_Object Fdirectory_files P_((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
+Lisp_Object Fdirectory_files P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
 
 
 /* Find BDF files in a specified directory.  (use GCPRO when calling,
@@ -6308,13 +6305,13 @@
   Lisp_Object filelist, list = Qnil;
   char fontname[100];
 
-  if (!STRINGP(directory))
+  if (!STRINGP (directory))
     return Qnil;
 
   filelist = Fdirectory_files (directory, Qt,
 			       build_string (".*\\.[bB][dD][fF]"), Qt);
 
-  for ( ; CONSP(filelist); filelist = XCDR (filelist))
+  for ( ; CONSP (filelist); filelist = XCDR (filelist))
     {
       Lisp_Object filename = XCAR (filelist);
       if (w32_BDF_to_x_font (SDATA (filename), fontname, 100))
@@ -6344,8 +6341,8 @@
       pair[0] = list;
       pair[1] = Qnil;
       GCPRO2 (directory, list);
-      pair[1] = w32_find_bdf_fonts_in_dir( XCAR (directory) );
-      list = Fnconc( 2, pair );
+      pair[1] = w32_find_bdf_fonts_in_dir ( XCAR (directory) );
+      list = Fnconc ( 2, pair );
       UNGCPRO;
     }
   return list;
@@ -6484,7 +6481,7 @@
   /* We force 24+ bit depths to 24-bit, both to prevent an overflow
      and because probably is more meaningful on Windows anyway */
   if (cap < 0)
-    cap = 1 << min(dpyinfo->n_planes * dpyinfo->n_cbits, 24);
+    cap = 1 << min (dpyinfo->n_planes * dpyinfo->n_cbits, 24);
 
   ReleaseDC (dpyinfo->root_window, hdc);
 
@@ -6747,7 +6744,7 @@
     Lisp_Object color_file;
     struct gcpro gcpro1;
 
-    color_file = build_string("~/rgb.txt");
+    color_file = build_string ("~/rgb.txt");
 
     GCPRO1 (color_file);
 
@@ -7985,7 +7982,7 @@
 	    *last = '\0';
 	  }
 
-	file = DECODE_FILE(build_string (filename));
+	file = DECODE_FILE (build_string (filename));
       }
     /* User cancelled the dialog without making a selection.  */
     else if (!CommDlgExtendedError ())
@@ -8311,7 +8308,6 @@
 #else
       if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY,
 			     (WPARAM) XINT (XCAR (item)), (LPARAM) item))
-
 #endif
 	{
 	  MSG msg;
@@ -8327,7 +8323,7 @@
        doc: /* Return list of registered hot-key IDs.  */)
   ()
 {
-  return Fcopy_sequence (w32_grabbed_keys);
+  return Fdelq (Qnil, Fcopy_sequence (w32_grabbed_keys));
 }
 
 DEFUN ("w32-reconstruct-hot-key", Fw32_reconstruct_hot_key,
@@ -8490,10 +8486,10 @@
 	LARGE_INTEGER freebytes;
 	LARGE_INTEGER totalbytes;
 
-	if (pfn_GetDiskFreeSpaceEx(rootname,
-				   (ULARGE_INTEGER *)&availbytes,
-				   (ULARGE_INTEGER *)&totalbytes,
-				   (ULARGE_INTEGER *)&freebytes))
+	if (pfn_GetDiskFreeSpaceEx (rootname,
+				    (ULARGE_INTEGER *)&availbytes,
+				    (ULARGE_INTEGER *)&totalbytes,
+				    (ULARGE_INTEGER *)&freebytes))
 	  value = list3 (make_float ((double) totalbytes.QuadPart),
 			 make_float ((double) freebytes.QuadPart),
 			 make_float ((double) availbytes.QuadPart));
@@ -8505,11 +8501,11 @@
 	DWORD free_clusters;
 	DWORD total_clusters;
 
-	if (GetDiskFreeSpace(rootname,
-			     &sectors_per_cluster,
-			     &bytes_per_sector,
-			     &free_clusters,
-			     &total_clusters))
+	if (GetDiskFreeSpace (rootname,
+			      &sectors_per_cluster,
+			      &bytes_per_sector,
+			      &free_clusters,
+			      &total_clusters))
 	  value = list3 (make_float ((double) total_clusters
 				     * sectors_per_cluster * bytes_per_sector),
 			 make_float ((double) free_clusters
@@ -8555,12 +8551,12 @@
       ClosePrinter (hPrn);
       return Qnil;
     }
-  /* Call GetPrinter() again with big enouth memory block */
+  /* Call GetPrinter again with big enouth memory block */
   err = GetPrinter (hPrn, 2, (LPBYTE)ppi2, dwNeeded, &dwReturned);
   ClosePrinter (hPrn);
   if (!err)
     {
-      xfree(ppi2);
+      xfree (ppi2);
       return Qnil;
     }
 
@@ -8570,23 +8566,23 @@
         {
 	  /* a remote printer */
 	  if (*ppi2->pServerName == '\\')
-	    _snprintf(pname_buf, sizeof (pname_buf), "%s\\%s", ppi2->pServerName,
+	    _snprintf (pname_buf, sizeof (pname_buf), "%s\\%s", ppi2->pServerName,
 		      ppi2->pShareName);
 	  else
-	    _snprintf(pname_buf, sizeof (pname_buf), "\\\\%s\\%s", ppi2->pServerName,
+	    _snprintf (pname_buf, sizeof (pname_buf), "\\\\%s\\%s", ppi2->pServerName,
 		      ppi2->pShareName);
 	  pname_buf[sizeof (pname_buf) - 1] = '\0';
 	}
       else
         {
 	  /* a local printer */
-	  strncpy(pname_buf, ppi2->pPortName, sizeof (pname_buf));
+	  strncpy (pname_buf, ppi2->pPortName, sizeof (pname_buf));
 	  pname_buf[sizeof (pname_buf) - 1] = '\0';
 	  /* `pPortName' can include several ports, delimited by ','.
 	   * we only use the first one. */
-	  strtok(pname_buf, ",");
+	  strtok (pname_buf, ",");
 	}
-      xfree(ppi2);
+      xfree (ppi2);
     }
 
   return build_string (pname_buf);
@@ -8825,7 +8821,7 @@
                &w32_pass_multimedia_buttons_to_system,
                doc: /* If non-nil, media buttons are passed to Windows.
 Some modern keyboards contain buttons for controlling media players, web
-browsers and other applications. Generally these buttons are handled on a
+browsers and other applications.  Generally these buttons are handled on a
 system wide basis, but by setting this to nil they are made available
 to Emacs for binding.  Depending on your keyboard, additional keys that
 may be available are:
@@ -8841,8 +8837,7 @@
 media-channel-up, media-channel-down,
 volume-mute, volume-up, volume-down,
 mic-volume-mute, mic-volume-down, mic-volume-up, mic-toggle,
-bass-down, bass-boost, bass-up, treble-down, treble-up
-  */);
+bass-down, bass-boost, bass-up, treble-down, treble-up  */);
   w32_pass_multimedia_buttons_to_system = 1;
 
   DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape,
@@ -8871,14 +8866,14 @@
   Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY);
 
   DEFVAR_LISP ("x-sensitive-text-pointer-shape",
-	      &Vx_sensitive_text_pointer_shape,
+	       &Vx_sensitive_text_pointer_shape,
 	       doc: /* The shape of the pointer when over mouse-sensitive text.
 This variable takes effect when you create a new frame
 or when you set the mouse color.  */);
   Vx_sensitive_text_pointer_shape = Qnil;
 
   DEFVAR_LISP ("x-window-horizontal-drag-cursor",
-	      &Vx_window_horizontal_drag_shape,
+	       &Vx_window_horizontal_drag_shape,
 	       doc: /* Pointer shape to use for indicating a window can be dragged horizontally.
 This variable takes effect when you create a new frame
 or when you set the mouse color.  */);
@@ -9129,7 +9124,7 @@
 #undef abort
 
 void
-w32_abort()
+w32_abort ()
 {
   int button;
   button = MessageBox (NULL,
@@ -9157,7 +9152,7 @@
 
 /* For convenience when debugging.  */
 int
-w32_last_error()
+w32_last_error ()
 {
   return GetLastError ();
 }