summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-01 15:46:47 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-01 15:46:47 +0100
commitea8b7aecab9cc6d9c2d2845ad53203b26de14f85 (patch)
tree20743f4792f2a172e2b9761b9ee1236cde670854
parentbb062c1588c324a1ce4cf01fd5e0780e83aaabe4 (diff)
patch 8.2.0073: initializing globals with COMMA is clumsyv8.2.0073
Problem: Initializing globals with COMMA is clumsy. Solution: Use INIT2(), INIT3(), etc.
-rw-r--r--src/globals.h10
-rw-r--r--src/version.c2
-rw-r--r--src/vim.h9
3 files changed, 15 insertions, 6 deletions
diff --git a/src/globals.h b/src/globals.h
index acdce70968..e1738693de 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -270,7 +270,7 @@ EXTERN int msg_no_more INIT(= FALSE); // don't use more prompt, truncate
* Stack of execution contexts. Each entry is an estack_T.
* Current context is at ga_len - 1.
*/
-EXTERN garray_T exestack INIT(= {0 COMMA 0 COMMA sizeof(estack_T) COMMA 50 COMMA NULL});
+EXTERN garray_T exestack INIT5(0, 0, sizeof(estack_T), 50, NULL);
// name of error message source
#define SOURCING_NAME (((estack_T *)exestack.ga_data)[exestack.ga_len - 1].es_name)
// line number in the message source or zero
@@ -285,7 +285,7 @@ EXTERN int debug_backtrace_level INIT(= 0); // breakpoint backtrace level
# ifdef FEAT_PROFILE
EXTERN int do_profiling INIT(= PROF_NONE); // PROF_ values
# endif
-EXTERN garray_T script_items INIT(= {0 COMMA 0 COMMA sizeof(scriptitem_T) COMMA 4 COMMA NULL});
+EXTERN garray_T script_items INIT5(0, 0, sizeof(scriptitem_T), 4, NULL);
#define SCRIPT_ITEM(id) (((scriptitem_T *)script_items.ga_data)[(id) - 1])
#define FUNCLINE(fp, j) ((char_u **)(fp->uf_lines.ga_data))[j]
@@ -375,7 +375,7 @@ EXTERN int want_garbage_collect INIT(= FALSE);
EXTERN int garbage_collect_at_exit INIT(= FALSE);
// Script CTX being sourced or was sourced to define the current function.
-EXTERN sctx_T current_sctx INIT(= {0 COMMA 0 COMMA 0 COMMA 0});
+EXTERN sctx_T current_sctx INIT4(0, 0, 0, 0);
#endif
EXTERN int did_source_packages INIT(= FALSE);
@@ -468,7 +468,7 @@ EXTERN int au_did_filetype INIT(= FALSE);
// When deleting the current buffer, another one must be loaded. If we know
// which one is preferred, au_new_curbuf is set to it
-EXTERN bufref_T au_new_curbuf INIT(= {NULL COMMA 0 COMMA 0});
+EXTERN bufref_T au_new_curbuf INIT3(NULL, 0, 0);
// When deleting a buffer/window and autocmd_busy is TRUE, do not free the
// buffer/window. but link it in the list starting with
@@ -1412,7 +1412,7 @@ EXTERN int term_is_xterm INIT(= FALSE); // xterm-like 'term'
EXTERN char psepc INIT(= '\\'); // normal path separator character
EXTERN char psepcN INIT(= '/'); // abnormal path separator character
// normal path separator string
-EXTERN char pseps[2] INIT(= {'\\' COMMA 0});
+EXTERN char pseps[2] INIT2('\\', 0);
#endif
// Set to TRUE when an operator is being executed with virtual editing, MAYBE
diff --git a/src/version.c b/src/version.c
index c8cd6f12ca..c8df547e4d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -743,6 +743,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 73,
+/**/
72,
/**/
71,
diff --git a/src/vim.h b/src/vim.h
index d69272edd9..1fd24ad3fd 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -1775,11 +1775,18 @@ void *vim_memset(void *, int, size_t);
#ifndef EXTERN
# define EXTERN extern
# define INIT(x)
+# define INIT2(a, b)
+# define INIT3(a, b, c)
+# define INIT4(a, b, c, d)
+# define INIT5(a, b, c, d, e)
#else
# ifndef INIT
# define INIT(x) x
+# define INIT2(a, b) = {a, b}
+# define INIT3(a, b, c) = {a, b, c}
+# define INIT4(a, b, c, d) = {a, b, c, d}
+# define INIT5(a, b, c, d, e) = {a, b, c, d, e}
# define DO_INIT
-# define COMMA ,
# endif
#endif