refactor: fix incorrect use of enum (#30924)

refactor: fix incorrect use of enum (#30631)

(cherry picked from commit 184d5e7543)

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
neovim-backports[bot]
2024-10-24 12:43:15 +08:00
committed by GitHub
parent 94f44122ad
commit b286ba419a
2 changed files with 8 additions and 6 deletions

View File

@ -1169,7 +1169,7 @@ static void do_filter(linenr_T line1, linenr_T line2, exarg_T *eap, char *cmd, b
linenr_T read_linecount = curbuf->b_ml.ml_line_count;
// Pass on the kShellOptDoOut flag when the output is being redirected.
call_shell(cmd_buf, (ShellOpts)(kShellOptFilter | shell_flags), NULL);
call_shell(cmd_buf, kShellOptFilter | shell_flags, NULL);
xfree(cmd_buf);
did_check_timestamps = false;
@ -1314,7 +1314,7 @@ void do_shell(char *cmd, int flags)
// This ui_cursor_goto is required for when the '\n' resulted in a "delete line
// 1" command to the terminal.
ui_cursor_goto(msg_row, msg_col);
call_shell(cmd, (ShellOpts)flags, NULL);
call_shell(cmd, flags, NULL);
if (msg_silent == 0) {
msg_didout = true;
}

View File

@ -122,7 +122,7 @@ int os_expand_wildcards(int num_pat, char **pat, int *num_file, char ***file, in
size_t len;
char *p;
char *extra_shell_arg = NULL;
ShellOpts shellopts = kShellOptExpand | kShellOptSilent;
int shellopts = kShellOptExpand | kShellOptSilent;
int j;
char *tempname;
#define STYLE_ECHO 0 // use "echo", the default
@ -666,7 +666,7 @@ char *shell_argv_to_str(char **const argv)
/// @param extra_args Extra arguments to the shell, or NULL.
///
/// @return shell command exit code
int os_call_shell(char *cmd, ShellOpts opts, char *extra_args)
int os_call_shell(char *cmd, int opts, char *extra_args)
{
DynamicBuffer input = DYNAMIC_BUFFER_INIT;
char *output = NULL;
@ -721,8 +721,10 @@ int os_call_shell(char *cmd, ShellOpts opts, char *extra_args)
/// os_call_shell() wrapper. Handles 'verbose', :profile, and v:shell_error.
/// Invalidates cached tags.
///
/// @param opts a combination of ShellOpts flags
///
/// @return shell command exit code
int call_shell(char *cmd, ShellOpts opts, char *extra_shell_arg)
int call_shell(char *cmd, int opts, char *extra_shell_arg)
{
int retval;
proftime_T wait_time;
@ -766,7 +768,7 @@ int call_shell(char *cmd, ShellOpts opts, char *extra_shell_arg)
/// @param ret_len length of the stdout
///
/// @return an allocated string, or NULL for error.
char *get_cmd_output(char *cmd, char *infile, ShellOpts flags, size_t *ret_len)
char *get_cmd_output(char *cmd, char *infile, int flags, size_t *ret_len)
{
char *buffer = NULL;