]> granicus.if.org Git - vim/commitdiff
patch 8.1.1102: Win32 exe file contains unused code v8.1.1102
authorBram Moolenaar <Bram@vim.org>
Tue, 2 Apr 2019 20:02:32 +0000 (22:02 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 2 Apr 2019 20:02:32 +0000 (22:02 +0200)
Problem:    Win32 exe file contains unused code.
Solution:   Remove unused #ifdefs and code. (Ken Takata, closes #4198)

src/os_w32exe.c
src/version.c

index 93817adfa531d823976e9db2d4e46d9e6f4a94de..6c45ec2ea4894b4a6bc11da85a29e181d17f2d99 100644 (file)
@@ -10,7 +10,8 @@
 /*
  * Windows GUI: main program (EXE) entry point:
  *
- * Ron Aaron <ronaharon@yahoo.com> wrote this and the DLL support code.
+ * Ron Aaron <ronaharon@yahoo.com> wrote this and the (now deleted) DLL support
+ * code.
  */
 #include "vim.h"
 
 # endif
 #endif
 
-/* cproto doesn't create a prototype for main() */
-int _cdecl
-#if defined(FEAT_GUI_MSWIN)
-VimMain
-#else
-    main
-#endif
-       (int argc, char **argv);
-static int (_cdecl *pmain)(int, char **);
-
-#ifndef PROTO
+// cproto doesn't create a prototype for VimMain()
+int _cdecl VimMain(int argc, char **argv);
 #ifdef FEAT_GUI
 void _cdecl SaveInst(HINSTANCE hInst);
-static void (_cdecl *pSaveInst)(HINSTANCE);
 #endif
 
+#ifndef PROTO
     int WINAPI
 WinMain(
-    HINSTANCE  hInstance UNUSED,
+    HINSTANCE  hInstance,
     HINSTANCE  hPrevInst UNUSED,
     LPSTR      lpszCmdLine UNUSED,
     int                nCmdShow UNUSED)
 {
     int                argc = 0;
     char       **argv = NULL;
-#ifdef FEAT_GUI
-    pSaveInst = SaveInst;
-#endif
-    pmain =
-#if defined(FEAT_GUI_MSWIN)
-    //&& defined(__MINGW32__)
-       VimMain
-#else
-       main
-#endif
-       ;
-#ifdef FEAT_GUI
-    pSaveInst(
-#ifdef __MINGW32__
-           GetModuleHandle(NULL)
-#else
-           hInstance
-#endif
-           );
-#endif
-    pmain(argc, argv);
 
-    free_cmd_argsW();
+# ifdef FEAT_GUI
+    SaveInst(hInstance);
+# endif
+    VimMain(argc, argv);
 
     return 0;
 }
index fe7112807cf1bb86f29971a9821b9f8cda74db64..7400a3798eea2546ab08671af4942254ff704aed 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1102,
 /**/
     1101,
 /**/