Problem: Functions without arguments are not always declared properly.
Solution: Use "(void)" instead of "()". (Yegappan Lakshmanan, closes #12031)
* Return TRUE when there is any channel with a keep_open flag.
*/
int
-channel_any_keep_open()
+channel_any_keep_open(void)
{
channel_T *channel;
* columns (bytes) at the start of a given line
*/
int
-getwhitecols_curline()
+getwhitecols_curline(void)
{
return getwhitecols(ml_get_curline());
}
* right text.
*/
static int
-is_clipboard_needs_update()
+is_clipboard_needs_update(void)
{
return clipboard_needs_update;
}
// to avoid that a text file is recognized as encrypted.
};
-#ifdef FEAT_SODIUM
+#if defined(FEAT_SODIUM) || defined(PROTO)
typedef struct {
size_t count;
unsigned char key[crypto_box_SEEDBYTES];
* Get maximum crypt method specific length of the file header in bytes.
*/
int
-crypt_get_max_header_len()
+crypt_get_max_header_len(void)
{
int i;
int max = 0;
}
static void
-update_has_expr_breakpoint()
+update_has_expr_breakpoint(void)
{
int i;
* Return TRUE if there is any expression breakpoint.
*/
int
-debug_has_expr_breakpoint()
+debug_has_expr_breakpoint(void)
{
return has_expr_breakpoint;
}
}
static void
-ins_s_left()
+ins_s_left(void)
{
int end_change = dont_sync_undo == FALSE; // end undoable change
#ifdef FEAT_FOLDING
}
static void
-ins_s_right()
+ins_s_right(void)
{
int end_change = dont_sync_undo == FALSE; // end undoable change
#ifdef FEAT_FOLDING
* Handle when "did_throw" is set after executing commands.
*/
void
-handle_did_throw()
+handle_did_throw(void)
{
char *p = NULL;
msglist_T *messages = NULL;
* This list is empty when there are no outstanding resize requests.
*/
static void
-clear_resize_hists()
+clear_resize_hists(void)
{
# ifdef ENABLE_RESIZE_HISTORY_LOG
int i = 0;
# if defined(EXITFREE)
static void
-free_all_resize_hist()
+free_all_resize_hist(void)
{
clear_resize_hists();
vim_free(latest_resize_hist);
}
static void
-im_preedit_window_open()
+im_preedit_window_open(void)
{
char *preedit_string;
#if !GTK_CHECK_VERSION(3,16,0)
}
static void
-im_preedit_window_close()
+im_preedit_window_close(void)
{
if (preedit_window != NULL)
gtk_widget_hide(preedit_window);
}
static void
-im_show_preedit()
+im_show_preedit(void)
{
im_preedit_window_open();
* the user to override the color values. Only loaded once.
*/
static void
-load_default_colors_lists()
+load_default_colors_lists(void)
{
// Lacking a default color list isn't the end of the world but it is likely
// an inconvenience so users should know when it is missing.
}
void
-update_package_paths_in_lua()
+update_package_paths_in_lua(void)
{
if (!lua_isopen())
return;
* Return TRUE if the conditions are OK for smart indenting.
*/
int
-may_do_si()
+may_do_si(void)
{
return curbuf->b_p_si
&& !curbuf->b_p_cin
* one assigned yet.
*/
static void
-ins_compl_update_sequence_numbers()
+ins_compl_update_sequence_numbers(void)
{
int number = 0;
compl_T *match;
* Get the next set of command-line completions matching "compl_pattern".
*/
static void
-get_next_cmdline_completion()
+get_next_cmdline_completion(void)
{
char_u **matches;
int num_matches;
* Return TRUE when there is any running job that we care about.
*/
int
-job_any_running()
+job_any_running(void)
{
job_T *job;
* Return TRUE if the cursor is in the editable position of the prompt line.
*/
int
-prompt_curpos_editable()
+prompt_curpos_editable(void)
{
return curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count
&& curwin->w_cursor.col >= (int)STRLEN(prompt_text());
#if defined(MSWIN) || defined(PROTO)
/*
- * Initilize $VIM and $VIMRUNTIME when 'enc' is updated.
+ * Initialize $VIM and $VIMRUNTIME when 'enc' is updated.
*/
void
init_vimdir(void)
* Fires a ModeChanged autocmd event if appropriate.
*/
void
-may_trigger_modechanged()
+may_trigger_modechanged(void)
{
#ifdef FEAT_EVAL
dict_T *v_event;
static int held_button = MOUSE_RELEASE;
void
-reset_held_button()
+reset_held_button(void)
{
held_button = MOUSE_RELEASE;
}
// Reset finish_op, in case it was set
#ifdef CURSOR_SHAPE
- c = finish_op;
+ int prev_finish_op = finish_op;
#endif
finish_op = FALSE;
may_trigger_modechanged();
#ifdef CURSOR_SHAPE
// Redraw the cursor with another shape, if we were in Operator-pending
// mode or did a replace command.
- if (c || ca.cmdchar == 'r')
+ if (prev_finish_op || ca.cmdchar == 'r')
{
ui_cursor_shape(); // may show different cursor shape
# ifdef FEAT_MOUSESHAPE
* from do_pending_operator().
*/
void
-end_visual_mode()
+end_visual_mode(void)
{
end_visual_mode_keep_button();
reset_held_button();
}
void
-end_visual_mode_keep_button()
+end_visual_mode_keep_button(void)
{
#ifdef FEAT_CLIPBOARD
// If we are using the clipboard, then remember what was selected in case
else if (cap->oap->op_type != OP_NOP
&& (cap->oap->start.lnum > curbuf->b_ml.ml_line_count
|| cap->oap->start.col >
- (colnr_T)STRLEN(ml_get(cap->oap->start.lnum))
+ (colnr_T)STRLEN(ml_get(cap->oap->start.lnum))
|| did_emsg
))
// The start of the operator has become invalid by the Ex command.
* restore_shm_value() exactly the same number of times.
*/
void
-save_clear_shm_value()
+save_clear_shm_value(void)
{
if (STRLEN(p_shm) >= SHM_LEN)
{
* Restore the shortmess Flags set from the save_clear_shm_value() function.
*/
void
-restore_shm_value()
+restore_shm_value(void)
{
if (--set_shm_recursive == 0)
{
* This will avoid clearing and redrawing the popup menu, prevent flicker.
*/
void
-pum_call_update_screen()
+pum_call_update_screen(void)
{
call_update_screen = TRUE;
* Return FALSE when the job has ended.
*/
int
-error_if_term_popup_window()
+error_if_term_popup_window(void)
{
if (WIN_IS_POPUP(curwin) && curbuf->b_term != NULL
&& term_job_running(curbuf->b_term))
* cursor moved far enough.
*/
void
-popup_check_cursor_pos()
+popup_check_cursor_pos(void)
{
win_T *wp;
/* filepath.c */
int modify_fname(char_u *src, int tilde_file, int *usedlen, char_u **fnamep, char_u **bufp, int *fnamelen);
void shorten_dir(char_u *str);
+int file_is_readable(char_u *fname);
void f_chdir(typval_T *argvars, typval_T *rettv);
void f_delete(typval_T *argvars, typval_T *rettv);
void f_executable(typval_T *argvars, typval_T *rettv);
void f_exepath(typval_T *argvars, typval_T *rettv);
-int file_is_readable(char_u *fname);
void f_filereadable(typval_T *argvars, typval_T *rettv);
void f_filewritable(typval_T *argvars, typval_T *rettv);
void f_finddir(typval_T *argvars, typval_T *rettv);
Window gui_x11_get_wid(void);
char_u *gui_mch_browse(int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter);
int gui_mch_dialog(int type, char_u *title, char_u *message, char_u *button_names, int dfltbutton, char_u *textfield, int ex_cmd);
-void gui_mch_enable_footer(int showit);
-void gui_mch_set_footer(char_u *s);
void gui_mch_show_toolbar(int showit);
int gui_mch_compute_toolbar_height(void);
void motif_get_toolbar_colors(Pixel *bgp, Pixel *fgp, Pixel *bsp, Pixel *tsp, Pixel *hsp);
# if defined(EXITFREE) || defined(PROTO)
void
-free_quickfix()
+free_quickfix(void)
{
win_T *win;
tabpage_T *tab;
* Shift the delete registers: "9 is cleared, "8 becomes "9, etc.
*/
void
-shift_delete_registers()
+shift_delete_registers(void)
{
int n;
* Return the index of the register "" points to.
*/
int
-get_unname_register()
+get_unname_register(void)
{
return y_previous == NULL ? -1 : y_previous - &y_regs[0];
}
* Return the index in ScreenLines[] for the current screen line.
*/
int
-screen_get_current_line_off()
+screen_get_current_line_off(void)
{
return (int)(current_ScreenLine - ScreenLines);
}
* or inside a mapping.
*/
int
-skip_showmode()
+skip_showmode(void)
{
// Call char_avail() only when we are going to show something, because it
// takes a bit of time. redrawing() may also call char_avail().
}
static HWND
-sound_window()
+sound_window(void)
{
if (g_hWndSound == NULL)
{
#endif
{
// Use the 'keyprotocol' option to adjust the t_TE and t_TI
- // termcap entries if there is an entry maching "term".
+ // termcap entries if there is an entry matching "term".
keyprot_T kpc = match_keyprotocol(term);
if (kpc == KEYPROTOCOL_KITTY)
apply_builtin_tcap(term, builtin_kitty, TRUE);
// There is no good way to detect that the terminal supports RGB
// colors. Since these termcap entries are non-standard anyway and
// only used when the user sets 'termguicolors' we might as well add
- // them. But not when one of them was alredy set.
+ // them. But not when one of them was already set.
if (term_strings_not_set(KS_8F)
&& term_strings_not_set(KS_8B)
&& term_strings_not_set(KS_8U))
* Avoids that valgrind reports possibly lost memory.
*/
void
-free_cur_term()
+free_cur_term(void)
{
# ifdef HAVE_DEL_CURTERM
if (cur_term)
* Return TRUE if we can request the terminal for a response.
*/
static int
-can_get_termresponse()
+can_get_termresponse(void)
{
return cur_tmode == TMODE_RAW
&& termcap_active
* Return TRUE if any of the requests are in STATUS_SENT.
*/
static int
-termrequest_any_pending()
+termrequest_any_pending(void)
{
int i;
time_t now = time(NULL);
# endif
int
-blink_state_is_inverted()
+blink_state_is_inverted(void)
{
#ifdef FEAT_TERMRESPONSE
return rbm_status.tr_progress == STATUS_GOT
* Flush messages on channels.
*/
static void
-term_flush_messages()
+term_flush_messages(void)
{
mch_check_messages();
parse_queued_messages();
}
void
-free_unused_terminals()
+free_unused_terminals(void)
{
while (terminals_to_free != NULL)
{
* Restores updating the terminal window.
*/
void
-term_enter_job_mode()
+term_enter_job_mode(void)
{
term_T *term = curbuf->b_term;
* closed and ++close was used. This may even happen before we get here.
*/
static int
-term_vgetc()
+term_vgetc(void)
{
int c;
int save_State = State;
* terminal should be displayed.
*/
int
-terminal_is_active()
+terminal_is_active(void)
{
return in_terminal_loop != NULL;
}
* we may want to change state.
*/
void
-term_win_entered()
+term_win_entered(void)
{
term_T *term = curbuf->b_term;
* channel was closed.
*/
void
-term_check_channel_closed_recently()
+term_check_channel_closed_recently(void)
{
term_T *term;
term_T *next_term;
* or when any highlight is changed.
*/
void
-term_update_wincolor_all()
+term_update_wincolor_all(void)
{
win_T *wp = NULL;
int did_curwin = FALSE;
* "ansi_colors" argument in term_start()) shall be applied.
*/
static int
-term_use_palette()
+term_use_palette(void)
{
if (0
#ifdef FEAT_GUI
* Called when option 'termguicolors' is changed.
*/
void
-term_update_palette_all()
+term_update_palette_all(void)
{
term_T *term;
* Return FAIL when this is not possible.
*/
int
-term_swap_diff()
+term_swap_diff(void)
{
term_T *term = curbuf->b_term;
linenr_T line_count;
# if defined(EXITFREE) || defined(PROTO)
void
-timer_free_all()
+timer_free_all(void)
{
while (first_timer != NULL)
{
static void handle_defer_one(funccall_T *funccal);
void
-func_init()
+func_init(void)
{
hash_init(&func_hashtab);
}
* current_funccal.
*/
void
-remove_funccal()
+remove_funccal(void)
{
funccall_T *fc = current_funccal;
* Return NULL if there is no current funccal.
*/
hashtab_T *
-get_funccal_local_ht()
+get_funccal_local_ht(void)
{
if (current_funccal == NULL || current_funccal->fc_l_vars.dv_refcount == 0)
return NULL;
* Return NULL if there is no current funccal.
*/
dictitem_T *
-get_funccal_local_var()
+get_funccal_local_var(void)
{
if (current_funccal == NULL || current_funccal->fc_l_vars.dv_refcount == 0)
return NULL;
* Return NULL if there is no current funccal.
*/
hashtab_T *
-get_funccal_args_ht()
+get_funccal_args_ht(void)
{
if (current_funccal == NULL || current_funccal->fc_l_vars.dv_refcount == 0)
return NULL;
* Return NULL if there is no current funccal.
*/
dictitem_T *
-get_funccal_args_var()
+get_funccal_args_var(void)
{
if (current_funccal == NULL || current_funccal->fc_l_vars.dv_refcount == 0)
return NULL;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1336,
/**/
1335,
/**/
/*
* Type for the callback function that is invoked after an option value is
* changed to validate and apply the new value.
+ *
+ * Returns NULL if the option value is valid is successfully applied.
+ * Otherwise returns an error message.
*/
typedef char *(*opt_did_set_cb_T)(optset_T *args);
* Return TRUE if the script context is Vim9 script.
*/
int
-script_is_vim9()
+script_is_vim9(void)
{
return SCRIPT_ITEM(current_sctx.sc_sid)->sn_version == SCRIPT_VERSION_VIM9;
}
* Otherwise return OK.
*/
static int
-check_split_disallowed()
+check_split_disallowed(void)
{
if (split_disallowed > 0)
{
* Make the current window show at least one line and one column.
*/
void
-win_ensure_size()
+win_ensure_size(void)
{
if (curwin->w_height == 0)
win_setheight(1);
* check_lnums() must have been called first!
*/
void
-reset_lnums()
+reset_lnums(void)
{
win_T *wp;
tabpage_T *tp;