diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-04-08 21:57:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-08 21:57:43 +0200 |
commit | d5fd0732e0709c51b28191f6d8425cc924a94560 (patch) | |
tree | 014a3b9bb52035e180a5426e39cd8b7a0abf6d23 | |
parent | 2a6ccfccac189fecadbafa60a58b05815be3f09e (diff) | |
parent | 61eff5d23826e423e29bc21de09e181921028c7c (diff) | |
download | rneovim-d5fd0732e0709c51b28191f6d8425cc924a94560.tar.gz rneovim-d5fd0732e0709c51b28191f6d8425cc924a94560.tar.bz2 rneovim-d5fd0732e0709c51b28191f6d8425cc924a94560.zip |
Merge pull request #9859 from jamessan/gcc-9-compound-literal
Make SHM_ALL to a variable instead of a compound literal #define
-rw-r--r-- | src/nvim/option.c | 34 | ||||
-rw-r--r-- | src/nvim/option_defs.h | 8 |
2 files changed, 15 insertions, 27 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 3486490366..bfb1de096d 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -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: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 # include "option.c.generated.h" #endif @@ -2486,15 +2495,8 @@ static bool valid_filetype(char_u *val) return true; } -#ifdef _MSC_VER -// MSVC optimizations are disabled for this function because it -// 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. - */ +/// 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 * did_set_string_option( int opt_idx, // index in options[] table @@ -3382,22 +3384,16 @@ ambw_end: 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) { return *(const int *)a - *(const int *)b; } -/* - * Handle setting 'colorcolumn' or 'textwidth' in window "wp". - * Returns error message, NULL if it's OK. - */ +/// Handle setting 'colorcolumn' or 'textwidth' in window "wp". +/// +/// @return error message, NULL if it's OK. char_u *check_colorcolumn(win_T *wp) { char_u *s; diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index c71ce9175b..2075d2819c 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -179,14 +179,6 @@ enum { SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \ 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: */ #define GO_ASEL 'a' /* autoselect */ |