From: Paul Eggert Date: Mon, 8 Oct 2012 22:14:39 +0000 (-0700) Subject: Minor tweaks to recently-changed code. X-Git-Tag: emacs-24.2.90~237^2~31 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a9e7a9d5430ba48645cc475c101a26b6531acfd6;p=emacs.git Minor tweaks to recently-changed code. Space before paren, avoid overparenthesization, etc. --- diff --git a/src/conf_post.h b/src/conf_post.h index 53fc941f464..aa008107ba6 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -142,19 +142,19 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ #endif #endif -#if defined(HAVE_NTGUI) && !defined(DebPrint) -# if defined(EMACSDEBUG) +#if defined HAVE_NTGUI && !defined DebPrint +# ifdef EMACSDEBUG extern void _DebPrint (const char *fmt, ...); # define DebPrint(stuff) _DebPrint stuff # else # define DebPrint(stuff) -# endif /* EMACSDEBUG */ -#endif /* DebPrint */ +# endif +#endif -#if defined(CYGWIN) && defined(HAVE_NTGUI) -#define NTGUI_UNICODE /* Cygwin runs only on UNICODE-supporting systems */ -#define _WIN32_WINNT 0x500 /* Win2k */ -#endif /* CYGWIN && HAVE_NTGUI */ +#if defined CYGWIN && defined HAVE_NTGUI +# define NTGUI_UNICODE /* Cygwin runs only on UNICODE-supporting systems */ +# define _WIN32_WINNT 0x500 /* Win2k */ +#endif #ifdef emacs /* Don't do this for lib-src. */ /* Tell regex.c to use a type compatible with Emacs. */ diff --git a/src/emacs.c b/src/emacs.c index 203514fe204..0a2a60bee0c 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -34,18 +34,15 @@ along with GNU Emacs. If not, see . */ #ifdef WINDOWSNT #include #include "w32.h" -#endif - -#if defined (WINDOWSNT) #include "w32heap.h" #endif -#if defined (WINDOWSNT) || defined (HAVE_NTGUI) +#if defined WINDOWSNT || defined HAVE_NTGUI #include "w32select.h" #include "w32font.h" #endif -#if defined (HAVE_NTGUI) && defined (CYGWIN) +#if defined HAVE_NTGUI && defined CYGWIN #include "cygw32.h" #endif @@ -179,7 +176,7 @@ static uprintmax_t heap_bss_diff; We mark being in the exec'd process by a daemon name argument of form "--daemon=\nFD0,FD1\nNAME" where FD are the pipe file descriptors, NAME is the original daemon name, if any. */ -#if defined (NS_IMPL_COCOA) || (defined (HAVE_NTGUI) && defined (CYGWIN)) +#if defined NS_IMPL_COCOA || (defined HAVE_NTGUI && defined CYGWIN) # define DAEMON_MUST_EXEC #endif @@ -698,7 +695,7 @@ main (int argc, char **argv) char *dname_arg = 0; #ifdef DAEMON_MUST_EXEC char dname_arg2[80]; -#endif /* DAEMON_MUST_EXEC */ +#endif char *ch_to_dir; #if GC_MARK_STACK @@ -1378,9 +1375,9 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem #ifdef WINDOWSNT syms_of_ntproc (); #endif /* WINDOWSNT */ -#if defined (CYGWIN) && defined (HAVE_NTGUI) +#if defined CYGWIN && defined HAVE_NTGUI syms_of_cygw32 (); -#endif /* defined(CYGWIN) && defined (HAVE_NTGUI) */ +#endif syms_of_window (); syms_of_xdisp (); syms_of_font (); @@ -1415,9 +1412,9 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem syms_of_fontset (); #endif /* HAVE_NTGUI */ -#if defined (WINDOWSNT) || defined (HAVE_NTGUI) +#if defined WINDOWSNT || defined HAVE_NTGUI syms_of_w32select (); -#endif /* WINDOWSNT || HAVE_NTGUI */ +#endif #ifdef MSDOS syms_of_xmenu (); @@ -1465,10 +1462,9 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem globals_of_w32menu (); #endif /* HAVE_NTGUI */ -#if defined (WINDOWSNT) || defined (HAVE_NTGUI) +#if defined WINDOWSNT || defined HAVE_NTGUI globals_of_w32select (); -#endif /* WINDOWSNT || HAVE_NTGUI */ - +#endif } init_charset (); diff --git a/src/image.c b/src/image.c index 6058bdf444c..9b41cf74993 100644 --- a/src/image.c +++ b/src/image.c @@ -75,11 +75,12 @@ typedef struct x_bitmap_record Bitmap_Record; #endif /* HAVE_X_WINDOWS */ #ifdef HAVE_NTGUI -# ifdef WINDOWSNT -/* We only need (or want) w32.h when we're _not_ - * compiling for Cygwin */ + +/* We need (or want) w32.h only when we're _not_ compiling for Cygwin. */ +#ifdef WINDOWSNT # include "w32.h" -# endif /* WINDOWSNT */ +#endif + /* W32_TODO : Color tables on W32. */ #undef COLOR_TABLE_SUPPORT @@ -571,7 +572,7 @@ extern Lisp_Object Vlibrary_cache; do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0) #else #define CACHE_IMAGE_TYPE(type, status) -#endif /* WINDOWSNT */ +#endif #define ADD_IMAGE_TYPE(type) \ do { Vimage_types = Fcons (type, Vimage_types); } while (0) @@ -594,7 +595,7 @@ define_image_type (struct image_type *type) if (type->init) { -#if defined (HAVE_NTGUI) && defined (WINDOWSNT) +#if defined HAVE_NTGUI && defined WINDOWSNT /* If we failed to load the library before, don't try again. */ Lisp_Object tested = Fassq (target_type, Vlibrary_cache); if (CONSP (tested) && NILP (XCDR (tested))) @@ -3013,7 +3014,7 @@ static const struct image_keyword xpm_format[XPM_LAST] = {":background", IMAGE_STRING_OR_NIL_VALUE, 0} }; -#if defined(HAVE_NTGUI) && defined(WINDOWSNT) +#if defined HAVE_NTGUI && defined WINDOWSNT static bool init_xpm_functions (void); #else #define init_xpm_functions NULL @@ -3240,7 +3241,7 @@ init_xpm_functions (void) #endif /* WINDOWSNT */ -#if defined (HAVE_NTGUI) && !defined (WINDOWSNT) +#if defined HAVE_NTGUI && !defined WINDOWSNT /* Glue for code below */ #define fn_XpmReadFileToImage XpmReadFileToImage #define fn_XpmCreateImageFromBuffer XpmCreateImageFromBuffer @@ -5352,7 +5353,7 @@ static const struct image_keyword png_format[PNG_LAST] = {":background", IMAGE_STRING_OR_NIL_VALUE, 0} }; -#if defined(HAVE_NTGUI) && defined (WINDOWSNT) +#if defined HAVE_NTGUI && defined WINDOWSNT static bool init_png_functions (void); #else #define init_png_functions NULL @@ -6011,7 +6012,7 @@ static const struct image_keyword jpeg_format[JPEG_LAST] = {":background", IMAGE_STRING_OR_NIL_VALUE, 0} }; -#if defined(HAVE_NTGUI) && defined(WINDOWSNT) +#if defined HAVE_NTGUI && defined WINDOWSNT static bool init_jpeg_functions (void); #else #define init_jpeg_functions NULL @@ -6075,7 +6076,7 @@ jpeg_image_p (Lisp_Object object) different name. This name, jpeg_boolean, remains in effect through the rest of image.c. */ -#if defined (CYGWIN) && defined (HAVE_NTGUI) +#if defined CYGWIN && defined HAVE_NTGUI #define boolean jpeg_boolean #endif #include @@ -7071,7 +7072,7 @@ static const struct image_keyword gif_format[GIF_LAST] = {":background", IMAGE_STRING_OR_NIL_VALUE, 0} }; -#if defined(HAVE_NTGUI) && defined(WINDOWSNT) +#if defined HAVE_NTGUI && defined WINDOWSNT static bool init_gif_functions (void); #else #define init_gif_functions NULL diff --git a/src/keyboard.c b/src/keyboard.c index 05b9a9dde01..61481c5f0f6 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -313,7 +313,7 @@ static Lisp_Object Qmouse_fixup_help_message; /* Symbols to denote kinds of events. */ static Lisp_Object Qfunction_key; Lisp_Object Qmouse_click; -#if defined (HAVE_NTGUI) +#ifdef HAVE_NTGUI Lisp_Object Qlanguage_change; #endif static Lisp_Object Qdrag_n_drop; @@ -3947,7 +3947,7 @@ kbd_buffer_get_event (KBOARD **kbp, x_activate_menubar (XFRAME (event->frame_or_window)); } #endif -#if defined (HAVE_NTGUI) +#ifdef HAVE_NTGUI else if (event->kind == LANGUAGE_CHANGE_EVENT) { /* Make an event (language-change (FRAME CODEPAGE LANGUAGE-ID)). */ @@ -11394,7 +11394,7 @@ syms_of_keyboard (void) DEFSYM (Qconfig_changed_event, "config-changed-event"); DEFSYM (Qmenu_enable, "menu-enable"); -#if defined (HAVE_NTGUI) +#ifdef HAVE_NTGUI DEFSYM (Qlanguage_change, "language-change"); #endif diff --git a/src/termhooks.h b/src/termhooks.h index 42f2e16e577..c33c2dd1587 100644 --- a/src/termhooks.h +++ b/src/termhooks.h @@ -107,7 +107,7 @@ enum event_kind HORIZ_WHEEL_EVENT, /* A wheel event generated by a second horizontal wheel that is present on some mice. See WHEEL_EVENT. */ -#if defined (HAVE_NTGUI) +#ifdef HAVE_NTGUI LANGUAGE_CHANGE_EVENT, /* A LANGUAGE_CHANGE_EVENT is generated when HAVE_NTGUI or on Mac OS when the keyboard layout or input