Mercurial > vim
changeset 17115:1c2d05cb4d1d v8.1.1557
patch 8.1.1557: compiler warning for unused variables in tiny version
commit https://github.com/vim/vim/commit/983f2f1403a591779f6edc4dd973c6cf31c65c8b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 16 16:41:41 2019 +0200
patch 8.1.1557: compiler warning for unused variables in tiny version
Problem: Compiler warning for unused variables in tiny version. (Tony
Mechelynck)
Solution: Add #ifdef.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 16 Jun 2019 16:45:05 +0200 |
parents | 90cb90ed8c2e |
children | 3cc7132b7a5c |
files | src/option.c src/version.c |
diffstat | 2 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/option.c +++ b/src/option.c @@ -6135,9 +6135,9 @@ set_string_option( char_u *s; char_u **varp; char_u *oldval; +#if defined(FEAT_EVAL) char_u *oldval_l = NULL; char_u *oldval_g = NULL; -#if defined(FEAT_EVAL) char_u *saved_oldval = NULL; char_u *saved_oldval_l = NULL; char_u *saved_oldval_g = NULL; @@ -6158,6 +6158,7 @@ set_string_option( ? OPT_GLOBAL : OPT_LOCAL) : opt_flags); oldval = *varp; +#if defined(FEAT_EVAL) if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0) { oldval_l = *(char_u **)get_varp_scope(&(options[opt_idx]), @@ -6165,6 +6166,7 @@ set_string_option( oldval_g = *(char_u **)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL); } +#endif *varp = s; #if defined(FEAT_EVAL) @@ -8525,7 +8527,9 @@ set_bool_option( int opt_flags) /* OPT_LOCAL and/or OPT_GLOBAL */ { int old_value = *(int *)varp; +#if defined(FEAT_EVAL) int old_global_value = 0; +#endif /* Disallow changing some options from secure mode */ if ((secure @@ -8535,12 +8539,14 @@ set_bool_option( ) && (options[opt_idx].flags & P_SECURE)) return e_secure; +#if defined(FEAT_EVAL) // Save the global value before changing anything. This is needed as for // a global-only option setting the "local value" in fact sets the global // value (since there is only one value). if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0) old_global_value = *(int *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL); +#endif *(int *)varp = value; /* set the new value */ #ifdef FEAT_EVAL @@ -9130,8 +9136,10 @@ set_num_option( { char *errmsg = NULL; long old_value = *(long *)varp; +#if defined(FEAT_EVAL) long old_global_value = 0; // only used when setting a local and // global option +#endif long old_Rows = Rows; // remember old Rows long old_Columns = Columns; // remember old Columns long *pp = (long *)varp; @@ -9144,11 +9152,14 @@ set_num_option( ) && (options[opt_idx].flags & P_SECURE)) return e_secure; +#if defined(FEAT_EVAL) // Save the global value before changing anything. This is needed as for // a global-only option setting the "local value" infact sets the global // value (since there is only one value). if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0) - old_global_value = *(long *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL); + old_global_value = *(long *)get_varp_scope(&(options[opt_idx]), + OPT_GLOBAL); +#endif *pp = value; #ifdef FEAT_EVAL