Problem: Issues with proto files: missing or inconsistent prototypes.
Solution: Update ifdefs, move typedefs, fix prototype declaration
(Hirohito Higashi)
This change focuses on fixes and tweaks found while working on #18045 for
the proto/*.pro files.
The following fixes and tweaks have been made:
- Fixed a prototype declaration where the variable name differed from
the function definition.
- Removed a prototype declaration without a function body.
- Fixed a problem where a prototype declaration was not created for a
function definition enclosed in a #if directive because it lacked ||
defined(PROTO).
- Moved typedef struct soundcb_S soundcb_T; from proto/sound.pro to
vim.h.
- Other small tweaks.
The make proto mechanism remains unchanged.
closes: #18058
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
regmatch_T *regmatch,
char_u ***matches,
int *numMatches,
- char_u *((*func)(expand_T *, int)),
+ char_u *(*func)(expand_T *, int),
// returns a string from the list
int escaped)
{
regmatch_T *regmatch,
char_u ***matches,
int *numMatches,
- char_u *((*func)(expand_T *, int)),
+ char_u *(*func)(expand_T *, int),
// returns a string from the list
int escaped,
int sortStartIdx)
}
#endif // !USE_GNOME_SESSION
-#ifdef FEAT_SOCKETSERVER
+#if defined(FEAT_SOCKETSERVER) || defined(PROTO)
/*
* Callback for new events from the socket server listening socket
return count;
}
-#ifdef FEAT_VARTABS
+#if defined(FEAT_VARTABS) || defined(PROTO)
/*
* Count the size (in window cells) of the indent in line "ptr", using
* variable tabstops.
}
#endif
-#if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+#if defined(HAVE_LOCALE_H) || defined(X_LOCALE) || defined(PROTO)
/*
* Setup to use the current locale (for ctype() and many other things).
*/
# undef HAVE_LSTAT // VMS does not have lstat()
# define mch_stat(n, p) stat(vms_fixfilename(n), (p))
#else
-# ifndef MSWIN
+# if !defined(MSWIN) && !defined(PROTO)
# define mch_access(n, p) access((n), (p))
# endif
return len;
}
-#ifndef HAVE_MEMSET
+#if !defined(HAVE_MEMSET) && !defined(PROTO)
void *
vim_memset(void *ptr, int c, size_t size)
{
}
#endif
-#ifndef HAVE_QSORT
+#if !defined(HAVE_QSORT) && !defined(PROTO)
/*
* Our own qsort(), for systems that don't have it.
* It's simple and slow. From the K&R C book.
* (history removed, not very interesting. See the "screen" sources.)
*/
-#if !defined(HAVE_SETENV) && !defined(HAVE_PUTENV)
+#if !defined(HAVE_SETENV) && !defined(HAVE_PUTENV) && !defined(PROTO)
#define EXTRASIZE 5 // increment to add to env. size
return errmsg;
}
-#ifdef FEAT_WAYLAND_CLIPBOARD
+#if defined(FEAT_WAYLAND_CLIPBOARD) || defined(PROTO)
/*
* Process the new 'wlsteal' option value.
*/
}
#endif
-#ifdef FEAT_WAYLAND
+#if defined(FEAT_WAYLAND) || defined(PROTO)
/*
* Process the new 'wltimeoutlen' option value.
*/
#endif
}
-#if defined(FEAT_TABPANEL)
+#if defined(FEAT_TABPANEL) || defined(PROTO)
/*
* Process the new 'showtabpanel' option value.
*/
}
#endif
-#if defined(FEAT_TABPANEL)
+#if defined(FEAT_TABPANEL) || defined(PROTO)
/*
* Process the new 'tabpanelopt' option value.
*/
* Export the environment variable $MYVIMDIR to the first item in runtimepath
*/
void
-export_myvimdir()
+export_myvimdir(void)
{
int dofree = FALSE;
char_u *p;
#endif
-#ifndef PROTO
/*
* Save the instance handle of the exe/dll.
*/
{
g_hinst = hInst;
}
-#endif
#if defined(FEAT_GUI_MSWIN) || defined(PROTO)
/*
Display *x11_display = NULL;
#endif
-#ifdef FEAT_SOCKETSERVER
+#if defined(FEAT_SOCKETSERVER) || defined(PROTO)
# include <sys/socket.h>
# include <sys/un.h>
# endif
#endif
-#if defined(FEAT_X11)
+#if defined(FEAT_X11) || defined(PROTO)
/*
* A few functions shared by X11 title and clipboard code.
*/
return TRUE;
}
-#if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)
+#if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) || defined(PROTO)
# if defined(USING_SETJMP)
/*
* An X IO Error handler, used to catch error while opening the display.
}
#endif // HAVE_SMACK
-#ifdef FEAT_XATTR
+#if defined(FEAT_XATTR) || defined(PROTO)
/*
* Copy extended attributes from_file to to_file
*/
return fd;
}
-#ifdef FEAT_SOCKETSERVER
+#if defined(FEAT_SOCKETSERVER) || defined(PROTO)
/*
* Initialize socket server called "name" (the socket filename). If "name" is a
}
#endif // FEAT_EVAL
-#ifdef MCH_CURSOR_SHAPE
+#if defined(MCH_CURSOR_SHAPE) || defined(PROTO)
/*
* Set the shape of the cursor.
* 'thickness' can be from 1 (thin) to 99 (block)
# endif // FEAT_PROFILE || FEAT_RELTIME
-#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_PROFILE)
+#if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_PROFILE) || defined(PROTO)
# if defined(HAVE_MATH_H)
# include <math.h>
# endif
void set_expand_context(expand_T *xp);
void set_cmd_context(expand_T *xp, char_u *str, int len, int col, int use_ccline);
int expand_cmdline(expand_T *xp, char_u *str, int col, int *matchcount, char_u ***matches);
-int ExpandGeneric(char_u *pat, expand_T *xp, regmatch_T *regmatch, char_u ***matches, int *numMatches, char_u *((*func)(expand_T *, int)), int escaped);
-int ExpandGenericExt(char_u *pat, expand_T *xp, regmatch_T *regmatch, char_u ***matches, int *numMatches, char_u *((*func)(expand_T *, int)), int escaped, int sortStartIdx);
+int ExpandGeneric(char_u *pat, expand_T *xp, regmatch_T *regmatch, char_u ***matches, int *numMatches, char_u *(*func)(expand_T *, int), int escaped);
+int ExpandGenericExt(char_u *pat, expand_T *xp, regmatch_T *regmatch, char_u ***matches, int *numMatches, char_u *(*func)(expand_T *, int), int escaped, int sortStartIdx);
void globpath(char_u *path, char_u *file, garray_T *ga, int expand_options, int dirs);
int wildmenu_translate_key(cmdline_info_T *cclp, int key, expand_T *xp, int did_wild_list);
int wildmenu_process_key(cmdline_info_T *cclp, int key, expand_T *xp);
int gui_mch_showing_tabline(void);
void gui_mch_update_tabline(void);
void gui_mch_set_curtab(int nr);
-void gui_gtk_set_selection_targets(GdkAtom);
+void gui_gtk_set_selection_targets(GdkAtom selection);
void gui_gtk_set_dnd_targets(void);
int gui_mch_init(void);
void gui_mch_forked(void);
void python_buffer_free(buf_T *buf);
void python_window_free(win_T *win);
void python_tabpage_free(tabpage_T *tab);
-void do_pyeval(char_u *str, dict_T* locals, typval_T *rettv);
+void do_pyeval(char_u *str, dict_T *locals, typval_T *rettv);
int set_ref_in_python(int copyID);
/* vim: set ft=c : */
void python3_buffer_free(buf_T *buf);
void python3_window_free(win_T *win);
void python3_tabpage_free(tabpage_T *tab);
-void do_py3eval(char_u *str, dict_T* locals, typval_T *rettv);
+void do_py3eval(char_u *str, dict_T *locals, typval_T *rettv);
int set_ref_in_python3(int copyID);
int python3_version(void);
/* vim: set ft=c : */
char *did_set_shiftwidth_tabstop(optset_T *args);
char *did_set_showtabline(optset_T *args);
char *did_set_smoothscroll(optset_T *args);
-char *did_set_socktimeoutlen(optset_T *args);
char *did_set_spell(optset_T *args);
char *did_set_swapfile(optset_T *args);
char *did_set_termguicolors(optset_T *args);
int expand_set_clipboard(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_clipmethod(optset_T *args);
int expand_set_clipmethod(optexpand_T *args, int *numMatches, char_u ***matches);
-char *did_set_clientserver(optset_T *args UNUSED);
-int expand_set_clientserver(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_chars_option(optset_T *args);
int expand_set_chars_option(optexpand_T *args, int *numMatches, char_u ***matches);
char *did_set_cinoptions(optset_T *args);
volatile sig_atomic_t *start_timeout(long msec);
void delete_timer(void);
int mch_create_anon_file(void);
-int socket_server_init(char_u *sock_path);
+int socket_server_init(char_u *name);
void socket_server_uninit(void);
char_u *socket_server_list_sockets(void);
void socket_server_accept_client(void);
int socket_server_valid(void);
-int socket_server_send(char_u *sock_path, char_u *cmd, char_u **result, char_u **receiver, int is_expr, int timeout, int silent);
-int socket_server_read_reply(char_u *sender, char_u **str, int timeout);
+int socket_server_send(char_u *name, char_u *str, char_u **result, char_u **receiver, int is_expr, int timeout, int silent);
+int socket_server_read_reply(char_u *client, char_u **str, int timeout);
int socket_server_peek_reply(char_u *sender, char_u **str);
int socket_server_send_reply(char_u *client, char_u *str);
int socket_server_get_fd(void);
/* sound.c */
-typedef struct soundcb_S soundcb_T;
-
int has_any_sound_callback(void);
-int has_sound_callback_in_queue(void);
-void call_sound_callback(soundcb_T *soundcb, long sound_id, int result);
+void call_sound_callback(soundcb_T *soundcb, long snd_id, int result);
void delete_sound_callback(soundcb_T *soundcb);
+int has_sound_callback_in_queue(void);
void invoke_sound_callback(void);
void f_sound_playevent(typval_T *argvars, typval_T *rettv);
void f_sound_playfile(typval_T *argvars, typval_T *rettv);
return Magic(x);
}
-#ifdef FEAT_RELTIME
+#if defined(FEAT_RELTIME) || defined(PROTO)
static int timeout_nesting = 0;
/*
static long sound_id = 0;
-// soundcb_T is typedef'ed in proto/sound.pro
+// soundcb_T is typedef'ed in vim.h
struct soundcb_S
{
}
#endif // HAVE_TGETENT
-#if defined(HAVE_TGETENT) && (defined(UNIX) || defined(VMS) || defined(MACOS_X))
+#if defined(HAVE_TGETENT) && (defined(UNIX) || defined(VMS) || defined(MACOS_X)) || defined(PROTO)
/*
* Get Columns and Rows from the termcap. Used after a window signal if the
* ioctl() fails. It doesn't make sense to call tgetent each time if the "co"
rettv->vval.v_blob = NULL;
}
-#ifdef FEAT_JOB_CHANNEL
+#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
void
f_test_null_channel(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv_dict_set(rettv, NULL);
}
-#ifdef FEAT_JOB_CHANNEL
+#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
void
f_test_null_job(typval_T *argvars UNUSED, typval_T *rettv)
{
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1662,
/**/
1661,
/**/
#endif
#if defined(HAVE_WAYLAND) && defined(WANT_WAYLAND)
-#define FEAT_WAYLAND
+# define FEAT_WAYLAND
#endif
#ifdef NO_X11_INCLUDES
#if (defined(UNIX) || defined(VMS)) \
&& (!defined(MACOS_X) || defined(HAVE_CONFIG_H))
# include "os_unix.h" // bring lots of system header files
-#else
+#elif !defined(PROTO)
// For all non-Unix systems: use old-fashioned signal().
# define mch_signal(signum, sighandler) signal(signum, sighandler)
#endif
# define USE_INPUT_BUF
#endif
-#ifndef EINTR
+#if !defined(EINTR) && !defined(PROTO)
# define read_eintr(fd, buf, count) vim_read((fd), (buf), (count))
# define write_eintr(fd, buf, count) vim_write((fd), (buf), (count))
#endif
typedef struct stat stat_T;
#endif
+typedef struct soundcb_S soundcb_T;
+
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__MINGW32__)
# define ATTRIBUTE_FORMAT_PRINTF(fmt_idx, arg_idx) \
__attribute__((format(printf, fmt_idx, arg_idx)))
// This must come after including proto.h.
// For VMS this is defined in macros.h.
-#if !defined(MSWIN) && !defined(VMS)
+#if !defined(MSWIN) && !defined(VMS) && !defined(PROTO)
# define mch_open(n, m, p) open((n), (m), (p))
# define mch_fopen(n, p) fopen((n), (p))
#endif
// values for vim_handle_signal() that are not a signal
#define SIGNAL_BLOCK (-1)
#define SIGNAL_UNBLOCK (-2)
-#if !defined(UNIX) && !defined(VMS)
+#if !defined(UNIX) && !defined(VMS) && !defined(PROTO)
# define vim_handle_signal(x) 0
#endif
}
}
-#ifdef FEAT_JOB_CHANNEL
+#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
void
leaving_window(win_T *win)
{