Merge #8142 'build/msvc: fix some warnings'

This commit is contained in:
Justin M. Keyes
2018-03-18 16:47:25 +01:00
committed by GitHub
12 changed files with 704 additions and 700 deletions

View File

@@ -121,6 +121,7 @@ cache:
directories:
- "$HOME/.cache/pip"
- "$HOME/.cache/nvim-deps"
- "$HOME/.cache/nvim-deps-downloads"
notifications:
webhooks:

View File

@@ -11,10 +11,17 @@ source "${CI_DIR}/common/suite.sh"
rm -rf "${HOME}/.cache/pip/log"
rm -f "${HOME}/.cache/pip/selfcheck.json"
echo "before_cache.sh: cache size"
du -d 2 "${HOME}/.cache" | sort -n
# Update the third-party dependency cache only if the build was successful.
if ended_successfully; then
rm -rf "${HOME}/.cache/nvim-deps"
mv "${DEPS_BUILD_DIR}" "${HOME}/.cache/nvim-deps"
rm -rf "${HOME}/.cache/nvim-deps-downloads"
mv "${DEPS_DOWNLOAD_DIR}" "${HOME}/.cache/nvim-deps-downloads"
touch "${CACHE_MARKER}"
echo "Updated third-party dependencies (timestamp: $(_stat "${CACHE_MARKER}"))."
fi

View File

@@ -26,13 +26,14 @@ build_deps() {
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
fi
rm -rf "${DEPS_BUILD_DIR}"
mkdir -p "${DEPS_BUILD_DIR}"
mkdir -p "${DEPS_DOWNLOAD_DIR}"
# Use cached dependencies if $CACHE_MARKER exists.
if test -f "${CACHE_MARKER}" && ! test "${CACHE_ENABLE}" = "false" ; then
echo "Using third-party dependencies from Travis cache (last update: $(_stat "${CACHE_MARKER}"))."
cp -r "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
cp -r "${HOME}/.cache/nvim-deps-downloads" "${DEPS_DOWNLOAD_DIR}"
fi
# Even if we're using cached dependencies, run CMake and make to

View File

@@ -47,7 +47,7 @@ typedef enum {
/// Internal call from lua code
#define LUA_INTERNAL_CALL (VIML_INTERNAL_CALL + 1)
static inline bool is_internal_call(uint64_t channel_id)
static inline bool is_internal_call(const uint64_t channel_id)
REAL_FATTR_ALWAYS_INLINE REAL_FATTR_CONST;
/// Check whether call is internal

View File

@@ -567,7 +567,7 @@ static inline void typval_encode_dict_end(EncodedData *const edata)
typval_encode_dict_end(edata)
#define TYPVAL_ENCODE_CONV_RECURSE(val, conv_type) \
TYPVAL_ENCODE_CONV_NIL()
TYPVAL_ENCODE_CONV_NIL(val)
#define TYPVAL_ENCODE_SCOPE static
#define TYPVAL_ENCODE_NAME object

View File

@@ -146,7 +146,7 @@ static inline bool ascii_isxdigit(int c)
/// Checks if `c` is an “identifier” character
///
/// That is, whether it is alphanumeric character or underscore.
static inline bool ascii_isident(const int c)
static inline bool ascii_isident(int c)
{
return ASCII_ISALNUM(c) || c == '_';
}

View File

@@ -206,11 +206,11 @@ struct dictitem_S {
char_u di_key[1]; ///< key (actually longer!)
};
#define TV_DICTITEM_STRUCT(KEY_LEN) \
#define TV_DICTITEM_STRUCT(...) \
struct { \
typval_T di_tv; /* Structure that holds scope dictionary itself. */ \
uint8_t di_flags; /* Flags. */ \
char_u di_key[KEY_LEN]; /* Key value. */ \
char_u di_key[__VA_ARGS__]; /* Key value. */ \
}
/// Structure to hold a scope dictionary

View File

@@ -423,7 +423,7 @@ nlua_pop_typval_table_processing_end:
#define TYPVAL_ENCODE_CONV_STR_STRING TYPVAL_ENCODE_CONV_STRING
#define TYPVAL_ENCODE_CONV_EXT_STRING(tv, str, len, type) \
TYPVAL_ENCODE_CONV_NIL()
TYPVAL_ENCODE_CONV_NIL(tv)
#define TYPVAL_ENCODE_CONV_FUNC_START(tv, fun) \
do { \

View File

@@ -145,10 +145,7 @@
#define ARRAY_SIZE(arr) ((sizeof(arr)/sizeof((arr)[0])) / ((size_t)(!(sizeof(arr) % sizeof((arr)[0])))))
// Duplicated in os/win_defs.h to avoid include-order sensitivity.
#if defined(WIN32) && defined(RGB)
# undef RGB
#endif
#define RGB(r, g, b) ((r << 16) | (g << 8) | b)
#define RGB_(r, g, b) ((r << 16) | (g << 8) | b)
#define STR_(x) #x
#define STR(x) STR_(x)

View File

@@ -32,11 +32,8 @@
// Windows defines a RGB macro that produces 0x00bbggrr color values for use
// with GDI. Our macro is different, and we don't use GDI.
#if defined(RGB)
# undef RGB
// Duplicated from macros.h to avoid include-order sensitivity.
# define RGB(r, g, b) ((r << 16) | (g << 8) | b)
#endif
// Duplicated from macros.h to avoid include-order sensitivity.
#define RGB_(r, g, b) ((r << 16) | (g << 8) | b)
#ifdef _MSC_VER
# ifndef inline

File diff suppressed because it is too large Load Diff

View File

@@ -180,13 +180,14 @@ void terminal_init(void)
vterm_state_get_palette_color(state, color_index, &color);
}
map_put(int, int)(color_indexes,
RGB(color.red, color.green, color.blue), color_index + 1);
RGB_(color.red, color.green, color.blue),
color_index + 1);
}
VTermColor fg, bg;
vterm_state_get_default_colors(state, &fg, &bg);
default_vt_fg = RGB(fg.red, fg.green, fg.blue);
default_vt_bg = RGB(bg.red, bg.green, bg.blue);
default_vt_fg = RGB_(fg.red, fg.green, fg.blue);
default_vt_bg = RGB_(bg.red, bg.green, bg.blue);
default_vt_bg_rgb = bg;
vterm_free(vt);
}
@@ -565,8 +566,8 @@ void terminal_get_line_attributes(Terminal *term, win_T *wp, int linenr,
VTermScreenCell cell;
fetch_cell(term, row, col, &cell);
// Get the rgb value set by libvterm.
int vt_fg = RGB(cell.fg.red, cell.fg.green, cell.fg.blue);
int vt_bg = RGB(cell.bg.red, cell.bg.green, cell.bg.blue);
int vt_fg = RGB_(cell.fg.red, cell.fg.green, cell.fg.blue);
int vt_bg = RGB_(cell.bg.red, cell.bg.green, cell.bg.blue);
vt_fg = vt_fg != default_vt_fg ? vt_fg : - 1;
vt_bg = vt_bg != default_vt_bg ? vt_bg : - 1;
// Since libvterm does not expose the color index used by the program, we