Merge pull request #9859 from jamessan/gcc-9-compound-literal

Make SHM_ALL to a variable instead of a compound literal #define
This commit is contained in:
Justin M. Keyes 2019-04-08 21:57:43 +02:00 committed by GitHub
commit d5fd0732e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 27 deletions

View File

@ -310,6 +310,15 @@ static char *(p_scl_values[]) = { "yes", "no", "auto", "auto:1", "auto:2",
"yes:1", "yes:2", "yes:3", "yes:4", "yes:5", "yes:6", "yes:7", "yes:8", "yes:1", "yes:2", "yes:3", "yes:4", "yes:5", "yes:6", "yes:7", "yes:8",
"yes:9", NULL }; "yes:9", NULL };
/// All possible flags for 'shm'.
static char_u SHM_ALL[] = {
SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI,
SHM_ABBREVIATIONS, SHM_WRITE, SHM_TRUNC, SHM_TRUNCALL, SHM_OVER,
SHM_OVERALL, SHM_SEARCH, SHM_ATTENTION, SHM_INTRO, SHM_COMPLETIONMENU,
SHM_RECORDING, SHM_FILEINFO,
0,
};
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "option.c.generated.h" # include "option.c.generated.h"
#endif #endif
@ -2486,15 +2495,8 @@ static bool valid_filetype(char_u *val)
return true; return true;
} }
#ifdef _MSC_VER /// Handle string options that need some action to perform when changed.
// MSVC optimizations are disabled for this function because it /// Returns NULL for success, or an error message for an error.
// incorrectly generates an empty string for SHM_ALL.
#pragma optimize("", off)
#endif
/*
* Handle string options that need some action to perform when changed.
* Returns NULL for success, or an error message for an error.
*/
static char_u * static char_u *
did_set_string_option( did_set_string_option(
int opt_idx, // index in options[] table int opt_idx, // index in options[] table
@ -3382,22 +3384,16 @@ ambw_end:
return errmsg; return errmsg;
} }
#ifdef _MSC_VER
#pragma optimize("", on)
#endif
/* /// Simple int comparison function for use with qsort()
* Simple int comparison function for use with qsort()
*/
static int int_cmp(const void *a, const void *b) static int int_cmp(const void *a, const void *b)
{ {
return *(const int *)a - *(const int *)b; return *(const int *)a - *(const int *)b;
} }
/* /// Handle setting 'colorcolumn' or 'textwidth' in window "wp".
* Handle setting 'colorcolumn' or 'textwidth' in window "wp". ///
* Returns error message, NULL if it's OK. /// @return error message, NULL if it's OK.
*/
char_u *check_colorcolumn(win_T *wp) char_u *check_colorcolumn(win_T *wp)
{ {
char_u *s; char_u *s;

View File

@ -179,14 +179,6 @@ enum {
SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \ SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \
0, \ 0, \
}) })
/// All possible flags for 'shm'.
#define SHM_ALL ((char_u[]) { \
SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \
SHM_ABBREVIATIONS, SHM_WRITE, SHM_TRUNC, SHM_TRUNCALL, SHM_OVER, \
SHM_OVERALL, SHM_SEARCH, SHM_ATTENTION, SHM_INTRO, SHM_COMPLETIONMENU, \
SHM_RECORDING, SHM_FILEINFO, \
0, \
})
/* characters for p_go: */ /* characters for p_go: */
#define GO_ASEL 'a' /* autoselect */ #define GO_ASEL 'a' /* autoselect */