]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1715: Some functions need to be re-ordered v9.1.1715
authorHirohito Higashi <h.east.727@gmail.com>
Sun, 31 Aug 2025 16:52:32 +0000 (18:52 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 31 Aug 2025 16:52:32 +0000 (18:52 +0200)
Problem:  Some functions need to be re-ordered
Solution: Re-order and move functions around favoring mch_*() functions
          inside os_*.c files, Change scope of dos_expandpath() to
          global instead of static (Hirohito Higashi)

The following fixes and tweaks have been made:

- Moved the definition of mch_expandpath() from filepath.c to os_win32.c
  in MS-Windows builds (essentially, the mch_~() function should be
  defined in os_~.c.)
- In accordance with the above, the scope of dos_expandpath() has been
  changed from static to global.
- Other miscellaneous changes.

closes: #18176

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/filepath.c
src/os_win32.c
src/proto/cmdexpand.pro
src/proto/filepath.pro
src/proto/if_xcmdsrv.pro
src/proto/os_win32.pro
src/proto/typval.pro
src/version.c

index d8a1dce742777e0edca3a73ac6957aa072e99bb4..0048fab595592a301a6fc15752c941af0c5f26e9 100644 (file)
@@ -3523,7 +3523,7 @@ pstrcmp(const void *a, const void *b)
  * Return the number of matches found.
  * NOTE: much of this is identical to unix_expandpath(), keep in sync!
  */
-    static int
+    int
 dos_expandpath(
     garray_T   *gap,
     char_u     *path,
@@ -3751,15 +3751,6 @@ dos_expandpath(
                                                   sizeof(char_u *), pstrcmp);
     return matches;
 }
-
-    int
-mch_expandpath(
-    garray_T   *gap,
-    char_u     *path,
-    int                flags)          // EW_* flags
-{
-    return dos_expandpath(gap, path, 0, flags, FALSE);
-}
 #endif // MSWIN
 
 #if (defined(UNIX) && !defined(VMS)) || defined(USE_UNIXFILENAME) \
index 056a5a2239694eac14f882add9f05371333db0a8..3873a2b37f96a398e24c4d78f4657d6b73c024d1 100644 (file)
@@ -7698,6 +7698,21 @@ mch_total_mem(int special UNUSED)
     return (long_u)((ms.ullTotalPhys - WINNT_RESERVE_BYTES) / 1024);
 }
 
+/*
+ * Expand a path into all matching files and/or directories.  Handles "*",
+ * "?", "[a-z]", "**", etc.
+ * "path" has backslashes before chars that are not to be expanded.
+ * Returns the number of matches found.
+ */
+    int
+mch_expandpath(
+    garray_T   *gap,
+    char_u     *path,
+    int                flags)          // EW_* flags
+{
+    return dos_expandpath(gap, path, 0, flags, FALSE);
+}
+
 /*
  * mch_wrename() works around a bug in rename (aka MoveFile) in
  * Windows, the bug can be demonstrated with the following scenario:
index ff065145fd27fe155d71d7df5eef024f088ac662..388523d6f05106ad036a96be8dd7df3f75187b91 100644 (file)
@@ -25,5 +25,5 @@ int wildmenu_process_key(cmdline_info_T *cclp, int key, expand_T *xp);
 void wildmenu_cleanup(cmdline_info_T *cclp);
 void f_getcompletion(typval_T *argvars, typval_T *rettv);
 void f_getcompletiontype(typval_T *argvars, typval_T *rettv);
-void f_cmdcomplete_info(typval_T *argvars UNUSED, typval_T *rettv);
+void f_cmdcomplete_info(typval_T *argvars, typval_T *rettv);
 /* vim: set ft=c : */
index 668662115607588fa7433a376cec6b612dd9388c..d82652ce71aab6a8a4eeeef7d2082fad66ebad35 100644 (file)
@@ -55,6 +55,7 @@ int vim_fexists(char_u *fname);
 int expand_wildcards_eval(char_u **pat, int *num_file, char_u ***file, int flags);
 int expand_wildcards(int num_pat, char_u **pat, int *num_files, char_u ***files, int flags);
 int match_suffix(char_u *fname);
+int dos_expandpath(garray_T *gap, char_u *path, size_t wildoff, int flags, int didstar);
 int unix_expandpath(garray_T *gap, char_u *path, size_t wildoff, int flags, int didstar);
 int gen_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file, int flags);
 void addfile(garray_T *gap, char_u *f, int flags);
index 801dc00e0c7c3ef9c878b6d516995358b97e83c5..74245b75a20808f8fde0dc384729a4fc37e027ad 100644 (file)
@@ -1,7 +1,7 @@
 /* if_xcmdsrv.c */
 int serverRegisterName(Display *dpy, char_u *name);
 void serverChangeRegisteredWindow(Display *dpy, Window newwin);
-int serverSendToVim(Display *dpy, char_u *name, char_u *cmd, char_u **result, Window *server, int asExpr, int timeout, int localLoop, int silent);
+int serverSendToVim(Display *dpy, char_u *name, char_u *cmd, char_u **result, Window *server, Bool asExpr, int timeout, Bool localLoop, int silent);
 char_u *serverGetVimNames(Display *dpy);
 Window serverStrToWin(char_u *str);
 int serverSendReply(char_u *name, char_u *str);
index cb84585311ba177eeb6e4e0ffcc6259f4a4edfc6..c84e308acb46d5c764dee32af008e89db64dc20d 100644 (file)
@@ -61,6 +61,7 @@ void mch_delay(long msec, int flags);
 int mch_remove(char_u *name);
 void mch_breakcheck(int force);
 long_u mch_total_mem(int special);
+int mch_expandpath(garray_T *gap, char_u *path, int flags);
 int mch_wrename(WCHAR *wold, WCHAR *wnew);
 int mch_rename(const char *pszOldFile, const char *pszNewFile);
 char *default_shell(void);
index 05283a173290d1162fd61c3643df9b6025d7e874..2080a262c65f2eb02ac962815a13b7f2f987560d 100644 (file)
@@ -67,8 +67,8 @@ char_u *tv_get_string_buf_chk_strict(typval_T *varp, char_u *buf, int strict);
 char_u *tv_stringify(typval_T *varp, char_u *buf);
 int tv_check_lock(typval_T *tv, char_u *name, int use_gettext);
 void copy_tv(typval_T *from, typval_T *to);
-int typval_compare(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic);
 int typval_compare2(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res);
+int typval_compare(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic);
 int typval_compare_list(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res);
 int typval_compare_tuple(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res);
 int typval_compare_null(typval_T *tv1, typval_T *tv2);
index aa70f4c25d5c428eded8aa4fffa1506635bdd15f..b700067fc250b5568be21b0a76a61e0ae013ff9b 100644 (file)
@@ -724,6 +724,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1715,
 /**/
     1714,
 /**/