aboutsummaryrefslogtreecommitdiff
path: root/src/version.c
diff options
context:
space:
mode:
authorscott-linder <scott.b.linder@wmich.edu>2014-02-23 15:34:45 -0500
committerscott-linder <scott.b.linder@wmich.edu>2014-02-24 09:48:18 -0500
commitb76c358f3de9106a4bdbf853b4c4371f6f7a62c2 (patch)
treefef0339611c6e76afc3dc8da4b6bd2ab227e3066 /src/version.c
parent1bcbc42330d651f06b8a842e16fe36475afde05d (diff)
downloadrneovim-b76c358f3de9106a4bdbf853b4c4371f6f7a62c2.tar.gz
rneovim-b76c358f3de9106a4bdbf853b4c4371f6f7a62c2.tar.bz2
rneovim-b76c358f3de9106a4bdbf853b4c4371f6f7a62c2.zip
Convert function declarations from K&R to ANSI style.
cproto (http://invisible-island.net/cproto/) was used to do the bulk of the work in batch; even the most recent version had some issues with typedef'd parameters; a quick "patch" was to modify `lex.l` to explicitly include all vim typedefs as known types. One example from `vim.h` is typedef unsigned char char_u; which was added in `lex.l` as <INITIAL>char_u { save_text_offset(); return T_CHAR; } Even with these changes there were some problems: * Two files (`mbyte.c` and `os_unix.c`) were not cleanly converted. * Any function with the `UNUSED` macro in its parameter list was not converted. Rather than spend more time fixing the automated approach, the two files `mbyte.c` and `os_unix.c` were converted by hand. The `UNUSED` macros were compiler specific, and the alternative, generic version would require a different syntax, so in order to simplify the conversion all uses of `UNUSED` were stripped, and then the sources were run back through cproto. It is planned to reconsider each use of `UNUSED` manually using a new macro definition.
Diffstat (limited to 'src/version.c')
-rw-r--r--src/version.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/version.c b/src/version.c
index 62a7aa8bc8..a928e840bd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -568,7 +568,7 @@ static char *(extra_patches[]) =
NULL
};
-int highest_patch() {
+int highest_patch(void) {
int i;
int h = 0;
@@ -581,8 +581,7 @@ int highest_patch() {
/*
* Return TRUE if patch "n" has been included.
*/
-int has_patch(n)
-int n;
+int has_patch(int n)
{
int i;
@@ -592,8 +591,7 @@ int n;
return FALSE;
}
-void ex_version(eap)
-exarg_T *eap;
+void ex_version(exarg_T *eap)
{
/*
* Ignore a ":version 9.99" command.
@@ -607,7 +605,7 @@ exarg_T *eap;
/*
* List all features aligned in columns, dictionary style.
*/
-static void list_features() {
+static void list_features(void) {
int i;
int ncol;
int nrow;
@@ -662,7 +660,7 @@ static void list_features() {
}
}
-void list_version() {
+void list_version(void) {
int i;
int first;
char *s = "";
@@ -792,8 +790,7 @@ void list_version() {
* Output a string for the version message. If it's going to wrap, output a
* newline, unless the message is too long to fit on the screen anyway.
*/
-static void version_msg(s)
-char *s;
+static void version_msg(char *s)
{
int len = (int)STRLEN(s);
@@ -810,7 +807,7 @@ static void do_intro_line __ARGS((int row, char_u *mesg, int add_version,
/*
* Show the intro message when not editing a file.
*/
-void maybe_intro_message() {
+void maybe_intro_message(void) {
if (bufempty()
&& curbuf->b_fname == NULL
&& firstwin->w_next == NULL
@@ -823,8 +820,10 @@ void maybe_intro_message() {
* Only used when starting Vim on an empty file, without a file name.
* Or with the ":intro" command (for Sven :-).
*/
-void intro_message(colon)
-int colon; /* TRUE for ":intro" */
+void
+intro_message (
+ int colon /* TRUE for ":intro" */
+)
{
int i;
int row;
@@ -904,11 +903,7 @@ int colon; /* TRUE for ":intro" */
msg_row = row;
}
-static void do_intro_line(row, mesg, add_version, attr)
-int row;
-char_u *mesg;
-int add_version;
-int attr;
+static void do_intro_line(int row, char_u *mesg, int add_version, int attr)
{
char_u vers[20];
int col;
@@ -969,8 +964,7 @@ int attr;
/*
* ":intro": clear screen, display intro screen and wait for return.
*/
-void ex_intro(eap)
-exarg_T *eap UNUSED;
+void ex_intro(exarg_T *eap)
{
screenclear();
intro_message(TRUE);