Skip to content

Commit 983f2f1

Browse files
committed
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.
1 parent 8a5c7ef commit 983f2f1

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

src/option.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6135,9 +6135,9 @@ set_string_option(
61356135
char_u *s;
61366136
char_u **varp;
61376137
char_u *oldval;
6138+
#if defined(FEAT_EVAL)
61386139
char_u *oldval_l = NULL;
61396140
char_u *oldval_g = NULL;
6140-
#if defined(FEAT_EVAL)
61416141
char_u *saved_oldval = NULL;
61426142
char_u *saved_oldval_l = NULL;
61436143
char_u *saved_oldval_g = NULL;
@@ -6158,13 +6158,15 @@ set_string_option(
61586158
? OPT_GLOBAL : OPT_LOCAL)
61596159
: opt_flags);
61606160
oldval = *varp;
6161+
#if defined(FEAT_EVAL)
61616162
if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0)
61626163
{
61636164
oldval_l = *(char_u **)get_varp_scope(&(options[opt_idx]),
61646165
OPT_LOCAL);
61656166
oldval_g = *(char_u **)get_varp_scope(&(options[opt_idx]),
61666167
OPT_GLOBAL);
61676168
}
6169+
#endif
61686170
*varp = s;
61696171

61706172
#if defined(FEAT_EVAL)
@@ -8525,7 +8527,9 @@ set_bool_option(
85258527
int opt_flags) /* OPT_LOCAL and/or OPT_GLOBAL */
85268528
{
85278529
int old_value = *(int *)varp;
8530+
#if defined(FEAT_EVAL)
85288531
int old_global_value = 0;
8532+
#endif
85298533

85308534
/* Disallow changing some options from secure mode */
85318535
if ((secure
@@ -8535,12 +8539,14 @@ set_bool_option(
85358539
) && (options[opt_idx].flags & P_SECURE))
85368540
return e_secure;
85378541

8542+
#if defined(FEAT_EVAL)
85388543
// Save the global value before changing anything. This is needed as for
85398544
// a global-only option setting the "local value" in fact sets the global
85408545
// value (since there is only one value).
85418546
if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0)
85428547
old_global_value = *(int *)get_varp_scope(&(options[opt_idx]),
85438548
OPT_GLOBAL);
8549+
#endif
85448550

85458551
*(int *)varp = value; /* set the new value */
85468552
#ifdef FEAT_EVAL
@@ -9130,8 +9136,10 @@ set_num_option(
91309136
{
91319137
char *errmsg = NULL;
91329138
long old_value = *(long *)varp;
9139+
#if defined(FEAT_EVAL)
91339140
long old_global_value = 0; // only used when setting a local and
91349141
// global option
9142+
#endif
91359143
long old_Rows = Rows; // remember old Rows
91369144
long old_Columns = Columns; // remember old Columns
91379145
long *pp = (long *)varp;
@@ -9144,11 +9152,14 @@ set_num_option(
91449152
) && (options[opt_idx].flags & P_SECURE))
91459153
return e_secure;
91469154

9155+
#if defined(FEAT_EVAL)
91479156
// Save the global value before changing anything. This is needed as for
91489157
// a global-only option setting the "local value" infact sets the global
91499158
// value (since there is only one value).
91509159
if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0)
9151-
old_global_value = *(long *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL);
9160+
old_global_value = *(long *)get_varp_scope(&(options[opt_idx]),
9161+
OPT_GLOBAL);
9162+
#endif
91529163

91539164
*pp = value;
91549165
#ifdef FEAT_EVAL

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,8 @@ static char *(features[]) =
777777

778778
static int included_patches[] =
779779
{ /* Add new patch number below this line */
780+
/**/
781+
1557,
780782
/**/
781783
1556,
782784
/**/

0 commit comments

Comments
 (0)