aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-08-26 15:31:55 +0200
committerbfredl <bjorn.linse@gmail.com>2023-09-10 13:09:44 +0200
commitbf36b0f8ec35281dd7e7e350d7d5d2810019d402 (patch)
treeed58d866e04b5a3877be717cd0e868b5177e204b
parent87cde88c41d003988e7d5dbc4ddb26687d24923d (diff)
downloadrneovim-bf36b0f8ec35281dd7e7e350d7d5d2810019d402.tar.gz
rneovim-bf36b0f8ec35281dd7e7e350d7d5d2810019d402.tar.bz2
rneovim-bf36b0f8ec35281dd7e7e350d7d5d2810019d402.zip
refactor(mch): last mch_ function/macro hits the dust
Also remove some stray comments.
-rw-r--r--src/nvim/bufwrite.c2
-rw-r--r--src/nvim/macros.h9
-rw-r--r--src/nvim/memfile.c2
-rw-r--r--src/nvim/menu.c2
-rw-r--r--src/nvim/window.c1
5 files changed, 2 insertions, 14 deletions
diff --git a/src/nvim/bufwrite.c b/src/nvim/bufwrite.c
index 2796ed1f0b..445e946543 100644
--- a/src/nvim/bufwrite.c
+++ b/src/nvim/bufwrite.c
@@ -1402,7 +1402,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
while ((fd = os_open(wfname, fflags, mode)) < 0) {
// A forced write will try to create a new file if the old one
// is still readonly. This may also happen when the directory
- // is read-only. In that case the mch_remove() will fail.
+ // is read-only. In that case the os_remove() will fail.
if (err.msg == NULL) {
#ifdef UNIX
FileInfo file_info;
diff --git a/src/nvim/macros.h b/src/nvim/macros.h
index 57cb298572..5eaf97ff87 100644
--- a/src/nvim/macros.h
+++ b/src/nvim/macros.h
@@ -82,15 +82,6 @@
#define READBIN "rb"
#define APPENDBIN "ab"
-// mch_open_rw(): invoke os_open() with third argument for user R/W.
-#if defined(UNIX) // open in rw------- mode
-# define MCH_OPEN_RW(n, f) os_open((n), (f), (mode_t)0600)
-#elif defined(MSWIN)
-# define MCH_OPEN_RW(n, f) os_open((n), (f), S_IREAD | S_IWRITE)
-#else
-# define MCH_OPEN_RW(n, f) os_open((n), (f), 0)
-#endif
-
#define REPLACE_NORMAL(s) (((s)& REPLACE_FLAG) && !((s)& VREPLACE_FLAG))
// MB_PTR_ADV(): advance a pointer to the next character, taking care of
diff --git a/src/nvim/memfile.c b/src/nvim/memfile.c
index b1aab0690c..6722d6bd8a 100644
--- a/src/nvim/memfile.c
+++ b/src/nvim/memfile.c
@@ -752,7 +752,7 @@ static bool mf_do_open(memfile_T *mfp, char *fname, int flags)
emsg(_("E300: Swap file already exists (symlink attack?)"));
} else {
// try to open the file
- mfp->mf_fd = MCH_OPEN_RW(mfp->mf_fname, flags | O_NOFOLLOW);
+ mfp->mf_fd = os_open(mfp->mf_fname, flags | O_NOFOLLOW, S_IREAD | S_IWRITE);
}
// If the file cannot be opened, use memory only
diff --git a/src/nvim/menu.c b/src/nvim/menu.c
index 1d35c97b39..3b2e45e2a4 100644
--- a/src/nvim/menu.c
+++ b/src/nvim/menu.c
@@ -618,8 +618,6 @@ static void free_menu(vimmenu_T **menup)
{
vimmenu_T *menu = *menup;
- // Don't change *menup until after calling gui_mch_destroy_menu(). The
- // MacOS code needs the original structure to properly delete the menu.
*menup = menu->next;
xfree(menu->name);
xfree(menu->dname);
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 9d804ecae7..a615bd6797 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -5171,7 +5171,6 @@ static void win_free(win_T *wp, tabpage_T *tp)
alist_unlink(wp->w_alist);
// Don't execute autocommands while the window is halfway being deleted.
- // gui_mch_destroy_scrollbar() may trigger a FocusGained event.
block_autocmds();
clear_winopt(&wp->w_onebuf_opt);