1
0
forked from aniani/vim

patch 8.2.5073: clang on MS-Windows produces warnings

Problem:    Clang on MS-Windows produces warnings.
Solution:   Avoid the warnings. (Yegappan Lakshmanan, closes #10546)
This commit is contained in:
Bram Moolenaar
2022-06-09 20:53:54 +01:00
parent 63f3260378
commit 35d7a2fb13
12 changed files with 137 additions and 105 deletions

View File

@@ -439,7 +439,7 @@ static int num_windows;
*/ */
//ARGSUSED //ARGSUSED
static BOOL CALLBACK static BOOL CALLBACK
window_cb(HWND hwnd, LPARAM lparam) window_cb(HWND hwnd, LPARAM lparam UNUSED)
{ {
char title[256]; char title[256];
@@ -1170,7 +1170,7 @@ init_bat_choices(void)
* Install the vimrc file. * Install the vimrc file.
*/ */
static void static void
install_vimrc(int idx) install_vimrc(int idx UNUSED)
{ {
FILE *fd, *tfd; FILE *fd, *tfd;
char *fname; char *fname;
@@ -1891,7 +1891,7 @@ build_shortcut(
* Create shortcut(s) in the Start Menu\Programs\Vim folder. * Create shortcut(s) in the Start Menu\Programs\Vim folder.
*/ */
static void static void
install_start_menu(int idx) install_start_menu(int idx UNUSED)
{ {
need_uninstall_entry = 1; need_uninstall_entry = 1;
printf("Creating start menu\n"); printf("Creating start menu\n");

View File

@@ -73,6 +73,12 @@ char *searchpath(char *name);
# define KEY_WOW64_32KEY 0x0200 # define KEY_WOW64_32KEY 0x0200
# endif # endif
#ifdef __MINGW32__
# define UNUSED __attribute__((unused))
#else
# define UNUSED
#endif
#define VIM_STARTMENU "Programs\\Vim " VIM_VERSION_SHORT #define VIM_STARTMENU "Programs\\Vim " VIM_VERSION_SHORT
int interactive; // non-zero when running interactively int interactive; // non-zero when running interactively
@@ -450,7 +456,7 @@ mch_chdir(char *path)
* Expand the executable name into a full path name. * Expand the executable name into a full path name.
*/ */
static char * static char *
my_fullpath(char *buf, char *fname, int len) my_fullpath(char *buf, char *fname UNUSED, int len)
{ {
// Only GetModuleFileName() will get the long file name path. // Only GetModuleFileName() will get the long file name path.
// GetFullPathName() may still use the short (FAT) name. // GetFullPathName() may still use the short (FAT) name.

View File

@@ -52,6 +52,12 @@
# define __out SAL__out # define __out SAL__out
#endif #endif
#ifdef __MINGW32__
# define UNUSED __attribute__((unused))
#else
# define UNUSED
#endif
#if (defined(_MSC_VER) && (_MSC_VER >= 1700)) || (__cplusplus >= 201103L) #if (defined(_MSC_VER) && (_MSC_VER >= 1700)) || (__cplusplus >= 201103L)
# define FINAL final # define FINAL final
#else #else
@@ -419,7 +425,7 @@ public:
} }
IFACEMETHOD(IsPixelSnappingDisabled)( IFACEMETHOD(IsPixelSnappingDisabled)(
__maybenull void* clientDrawingContext, __maybenull void* clientDrawingContext UNUSED,
__out BOOL* isDisabled) __out BOOL* isDisabled)
{ {
*isDisabled = FALSE; *isDisabled = FALSE;
@@ -427,7 +433,7 @@ public:
} }
IFACEMETHOD(GetCurrentTransform)( IFACEMETHOD(GetCurrentTransform)(
__maybenull void* clientDrawingContext, __maybenull void* clientDrawingContext UNUSED,
__out DWRITE_MATRIX* transform) __out DWRITE_MATRIX* transform)
{ {
// forward the render target's transform // forward the render target's transform
@@ -437,7 +443,7 @@ public:
} }
IFACEMETHOD(GetPixelsPerDip)( IFACEMETHOD(GetPixelsPerDip)(
__maybenull void* clientDrawingContext, __maybenull void* clientDrawingContext UNUSED,
__out FLOAT* pixelsPerDip) __out FLOAT* pixelsPerDip)
{ {
float dpiX, unused; float dpiX, unused;
@@ -447,33 +453,33 @@ public:
} }
IFACEMETHOD(DrawUnderline)( IFACEMETHOD(DrawUnderline)(
__maybenull void* clientDrawingContext, __maybenull void* clientDrawingContext UNUSED,
FLOAT baselineOriginX, FLOAT baselineOriginX UNUSED,
FLOAT baselineOriginY, FLOAT baselineOriginY UNUSED,
__in DWRITE_UNDERLINE const* underline, __in DWRITE_UNDERLINE const* underline UNUSED,
IUnknown* clientDrawingEffect) IUnknown* clientDrawingEffect UNUSED)
{ {
return E_NOTIMPL; return E_NOTIMPL;
} }
IFACEMETHOD(DrawStrikethrough)( IFACEMETHOD(DrawStrikethrough)(
__maybenull void* clientDrawingContext, __maybenull void* clientDrawingContext UNUSED,
FLOAT baselineOriginX, FLOAT baselineOriginX UNUSED,
FLOAT baselineOriginY, FLOAT baselineOriginY UNUSED,
__in DWRITE_STRIKETHROUGH const* strikethrough, __in DWRITE_STRIKETHROUGH const* strikethrough UNUSED,
IUnknown* clientDrawingEffect) IUnknown* clientDrawingEffect UNUSED)
{ {
return E_NOTIMPL; return E_NOTIMPL;
} }
IFACEMETHOD(DrawInlineObject)( IFACEMETHOD(DrawInlineObject)(
__maybenull void* clientDrawingContext, __maybenull void* clientDrawingContext UNUSED,
FLOAT originX, FLOAT originX UNUSED,
FLOAT originY, FLOAT originY UNUSED,
IDWriteInlineObject* inlineObject, IDWriteInlineObject* inlineObject UNUSED,
BOOL isSideways, BOOL isSideways UNUSED,
BOOL isRightToLeft, BOOL isRightToLeft UNUSED,
IUnknown* clientDrawingEffect) IUnknown* clientDrawingEffect UNUSED)
{ {
return E_NOTIMPL; return E_NOTIMPL;
} }
@@ -482,10 +488,10 @@ public:
__maybenull void* clientDrawingContext, __maybenull void* clientDrawingContext,
FLOAT baselineOriginX, FLOAT baselineOriginX,
FLOAT baselineOriginY, FLOAT baselineOriginY,
DWRITE_MEASURING_MODE measuringMode, DWRITE_MEASURING_MODE measuringMode UNUSED,
__in DWRITE_GLYPH_RUN const* glyphRun, __in DWRITE_GLYPH_RUN const* glyphRun,
__in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription, __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription UNUSED,
IUnknown* clientDrawingEffect) IUnknown* clientDrawingEffect UNUSED)
{ {
TextRendererContext *context = TextRendererContext *context =
reinterpret_cast<TextRendererContext*>(clientDrawingContext); reinterpret_cast<TextRendererContext*>(clientDrawingContext);

View File

@@ -392,7 +392,7 @@ stubGetDpiForSystem(void)
} }
static int WINAPI static int WINAPI
stubGetSystemMetricsForDpi(int nIndex, UINT dpi) stubGetSystemMetricsForDpi(int nIndex, UINT dpi UNUSED)
{ {
return GetSystemMetrics(nIndex); return GetSystemMetrics(nIndex);
} }
@@ -4149,7 +4149,7 @@ init_mouse_wheel(void)
* Mouse scroll event handler. * Mouse scroll event handler.
*/ */
static void static void
_OnMouseWheel(HWND hwnd, WPARAM wParam, LPARAM lParam, int horizontal) _OnMouseWheel(HWND hwnd UNUSED, WPARAM wParam, LPARAM lParam, int horizontal)
{ {
int button; int button;
win_T *wp; win_T *wp;
@@ -4336,9 +4336,10 @@ static HWND hwndTip = NULL;
static void static void
show_sizing_tip(int cols, int rows) show_sizing_tip(int cols, int rows)
{ {
TOOLINFOA ti = {sizeof(ti)}; TOOLINFOA ti;
char buf[32]; char buf[32];
ti.cbSize = sizeof(ti);
ti.hwnd = s_hwnd; ti.hwnd = s_hwnd;
ti.uId = (UINT_PTR)s_hwnd; ti.uId = (UINT_PTR)s_hwnd;
ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND; ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND;
@@ -4636,7 +4637,7 @@ _OnMenuSelect(HWND hwnd, WPARAM wParam, LPARAM lParam)
#endif #endif
static LRESULT static LRESULT
_OnDpiChanged(HWND hwnd, UINT xdpi, UINT ydpi, RECT *rc) _OnDpiChanged(HWND hwnd, UINT xdpi UNUSED, UINT ydpi, RECT *rc UNUSED)
{ {
s_dpi = ydpi; s_dpi = ydpi;
s_in_dpichanged = TRUE; s_in_dpichanged = TRUE;
@@ -5106,12 +5107,12 @@ load_dpi_func(void)
if (hUser32 == NULL) if (hUser32 == NULL)
goto fail; goto fail;
pGetDpiForSystem = (void*)GetProcAddress(hUser32, "GetDpiForSystem"); pGetDpiForSystem = (UINT (WINAPI *)(void))GetProcAddress(hUser32, "GetDpiForSystem");
pGetDpiForWindow = (void*)GetProcAddress(hUser32, "GetDpiForWindow"); pGetDpiForWindow = (UINT (WINAPI *)(HWND))GetProcAddress(hUser32, "GetDpiForWindow");
pGetSystemMetricsForDpi = (void*)GetProcAddress(hUser32, "GetSystemMetricsForDpi"); pGetSystemMetricsForDpi = (int (WINAPI *)(int, UINT))GetProcAddress(hUser32, "GetSystemMetricsForDpi");
//pGetWindowDpiAwarenessContext = (void*)GetProcAddress(hUser32, "GetWindowDpiAwarenessContext"); //pGetWindowDpiAwarenessContext = (void*)GetProcAddress(hUser32, "GetWindowDpiAwarenessContext");
pSetThreadDpiAwarenessContext = (void*)GetProcAddress(hUser32, "SetThreadDpiAwarenessContext"); pSetThreadDpiAwarenessContext = (DPI_AWARENESS_CONTEXT (WINAPI *)(DPI_AWARENESS_CONTEXT))GetProcAddress(hUser32, "SetThreadDpiAwarenessContext");
pGetAwarenessFromDpiAwarenessContext = (void*)GetProcAddress(hUser32, "GetAwarenessFromDpiAwarenessContext"); pGetAwarenessFromDpiAwarenessContext = (DPI_AWARENESS (WINAPI *)(DPI_AWARENESS_CONTEXT))GetProcAddress(hUser32, "GetAwarenessFromDpiAwarenessContext");
if (pSetThreadDpiAwarenessContext != NULL) if (pSetThreadDpiAwarenessContext != NULL)
{ {
@@ -7799,8 +7800,9 @@ initialise_toolbar(void)
update_toolbar_size(void) update_toolbar_size(void)
{ {
int w, h; int w, h;
TBMETRICS tbm = {sizeof(TBMETRICS)}; TBMETRICS tbm;
tbm.cbSize = sizeof(TBMETRICS);
tbm.dwMask = TBMF_PAD | TBMF_BUTTONSPACING; tbm.dwMask = TBMF_PAD | TBMF_BUTTONSPACING;
SendMessage(s_toolbarhwnd, TB_GETMETRICS, 0, (LPARAM)&tbm); SendMessage(s_toolbarhwnd, TB_GETMETRICS, 0, (LPARAM)&tbm);
//TRACE("Pad: %d, %d", tbm.cxPad, tbm.cyPad); //TRACE("Pad: %d, %d", tbm.cxPad, tbm.cyPad);
@@ -8043,27 +8045,27 @@ dyn_imm_load(void)
return; return;
pImmGetCompositionStringW pImmGetCompositionStringW
= (void *)GetProcAddress(hLibImm, "ImmGetCompositionStringW"); = (LONG (WINAPI *)(HIMC, DWORD, LPVOID, DWORD))GetProcAddress(hLibImm, "ImmGetCompositionStringW");
pImmGetContext pImmGetContext
= (void *)GetProcAddress(hLibImm, "ImmGetContext"); = (HIMC (WINAPI *)(HWND))GetProcAddress(hLibImm, "ImmGetContext");
pImmAssociateContext pImmAssociateContext
= (void *)GetProcAddress(hLibImm, "ImmAssociateContext"); = (HIMC (WINAPI *)(HWND, HIMC))GetProcAddress(hLibImm, "ImmAssociateContext");
pImmReleaseContext pImmReleaseContext
= (void *)GetProcAddress(hLibImm, "ImmReleaseContext"); = (BOOL (WINAPI *)(HWND, HIMC))GetProcAddress(hLibImm, "ImmReleaseContext");
pImmGetOpenStatus pImmGetOpenStatus
= (void *)GetProcAddress(hLibImm, "ImmGetOpenStatus"); = (BOOL (WINAPI *)(HIMC))GetProcAddress(hLibImm, "ImmGetOpenStatus");
pImmSetOpenStatus pImmSetOpenStatus
= (void *)GetProcAddress(hLibImm, "ImmSetOpenStatus"); = (BOOL (WINAPI *)(HIMC, BOOL))GetProcAddress(hLibImm, "ImmSetOpenStatus");
pImmGetCompositionFontW pImmGetCompositionFontW
= (void *)GetProcAddress(hLibImm, "ImmGetCompositionFontW"); = (BOOL (WINAPI *)(HIMC, LPLOGFONTW))GetProcAddress(hLibImm, "ImmGetCompositionFontW");
pImmSetCompositionFontW pImmSetCompositionFontW
= (void *)GetProcAddress(hLibImm, "ImmSetCompositionFontW"); = (BOOL (WINAPI *)(HIMC, LPLOGFONTW))GetProcAddress(hLibImm, "ImmSetCompositionFontW");
pImmSetCompositionWindow pImmSetCompositionWindow
= (void *)GetProcAddress(hLibImm, "ImmSetCompositionWindow"); = (BOOL (WINAPI *)(HIMC, LPCOMPOSITIONFORM))GetProcAddress(hLibImm, "ImmSetCompositionWindow");
pImmGetConversionStatus pImmGetConversionStatus
= (void *)GetProcAddress(hLibImm, "ImmGetConversionStatus"); = (BOOL (WINAPI *)(HIMC, LPDWORD, LPDWORD))GetProcAddress(hLibImm, "ImmGetConversionStatus");
pImmSetConversionStatus pImmSetConversionStatus
= (void *)GetProcAddress(hLibImm, "ImmSetConversionStatus"); = (BOOL (WINAPI *)(HIMC, DWORD, DWORD))GetProcAddress(hLibImm, "ImmSetConversionStatus");
if ( pImmGetCompositionStringW == NULL if ( pImmGetCompositionStringW == NULL
|| pImmGetContext == NULL || pImmGetContext == NULL

View File

@@ -56,6 +56,11 @@
# endif # endif
#endif // USE_FILEEXTD #endif // USE_FILEEXTD
#ifdef __MINGW32__
# define UNUSED __attribute__((unused))
#else
# define UNUSED
#endif
#include "iscygpty.h" #include "iscygpty.h"
@@ -70,10 +75,10 @@ static pfnGetFileInformationByHandleEx pGetFileInformationByHandleEx = NULL;
# ifndef USE_FILEEXTD # ifndef USE_FILEEXTD
static BOOL WINAPI stub_GetFileInformationByHandleEx( static BOOL WINAPI stub_GetFileInformationByHandleEx(
HANDLE hFile, HANDLE hFile UNUSED,
FILE_INFO_BY_HANDLE_CLASS FileInformationClass, FILE_INFO_BY_HANDLE_CLASS FileInformationClass UNUSED,
LPVOID lpFileInformation, LPVOID lpFileInformation UNUSED,
DWORD dwBufferSize) DWORD dwBufferSize UNUSED)
{ {
return FALSE; return FALSE;
} }

View File

@@ -7,9 +7,13 @@
#if defined(__GNUC__) && !defined(__MINGW32__) #if defined(__GNUC__) && !defined(__MINGW32__)
# define INTERNAL __attribute__((visibility("internal"))) # define INTERNAL __attribute__((visibility("internal")))
# define UNUSED __attribute__((unused))
#else #else
# define INTERNAL # define INTERNAL
#endif
#if defined(__GNUC__) || defined(__MINGW32__)
# define UNUSED __attribute__((unused))
#else
# define UNUSED # define UNUSED
#endif #endif

View File

@@ -4922,13 +4922,18 @@ iconv_enabled(int verbose)
return FALSE; return FALSE;
} }
iconv = (void *)GetProcAddress(hIconvDLL, "libiconv"); iconv = (size_t (*)(iconv_t, const char **,
iconv_open = (void *)GetProcAddress(hIconvDLL, "libiconv_open"); size_t *, char **, size_t *))
iconv_close = (void *)GetProcAddress(hIconvDLL, "libiconv_close"); GetProcAddress(hIconvDLL, "libiconv");
iconvctl = (void *)GetProcAddress(hIconvDLL, "libiconvctl"); iconv_open = (iconv_t (*)(const char *, const char *))
iconv_errno = get_dll_import_func(hIconvDLL, "_errno"); GetProcAddress(hIconvDLL, "libiconv_open");
iconv_close = (int (*)(iconv_t))
GetProcAddress(hIconvDLL, "libiconv_close");
iconvctl = (int (*)(iconv_t, int, void *))
GetProcAddress(hIconvDLL, "libiconvctl");
iconv_errno = (int *(*)(void))get_dll_import_func(hIconvDLL, "_errno");
if (iconv_errno == NULL) if (iconv_errno == NULL)
iconv_errno = (void *)GetProcAddress(hMsvcrtDLL, "_errno"); iconv_errno = (int *(*)(void))GetProcAddress(hMsvcrtDLL, "_errno");
if (iconv == NULL || iconv_open == NULL || iconv_close == NULL if (iconv == NULL || iconv_open == NULL || iconv_close == NULL
|| iconvctl == NULL || iconv_errno == NULL) || iconvctl == NULL || iconv_errno == NULL)
{ {

View File

@@ -273,11 +273,12 @@ typedef BOOL (WINAPI *PfnRtlGetVersion)(LPOSVERSIONINFOW);
static DWORD static DWORD
get_build_number(void) get_build_number(void)
{ {
OSVERSIONINFOW osver = {sizeof(OSVERSIONINFOW)}; OSVERSIONINFOW osver;
HMODULE hNtdll; HMODULE hNtdll;
PfnRtlGetVersion pRtlGetVersion; PfnRtlGetVersion pRtlGetVersion;
DWORD ver = MAKE_VER(0, 0, 0); DWORD ver = MAKE_VER(0, 0, 0);
osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
hNtdll = GetModuleHandle("ntdll.dll"); hNtdll = GetModuleHandle("ntdll.dll");
if (hNtdll != NULL) if (hNtdll != NULL)
{ {
@@ -325,7 +326,7 @@ make_ambiwidth_event(
read_console_input( read_console_input(
HANDLE hInput, HANDLE hInput,
INPUT_RECORD *lpBuffer, INPUT_RECORD *lpBuffer,
DWORD nLength, int nLength,
LPDWORD lpEvents) LPDWORD lpEvents)
{ {
enum enum
@@ -423,7 +424,7 @@ peek_console_input(
DWORD nLength UNUSED, DWORD nLength UNUSED,
LPDWORD lpEvents) LPDWORD lpEvents)
{ {
return read_console_input(hInput, lpBuffer, (DWORD)-1, lpEvents); return read_console_input(hInput, lpBuffer, -1, lpEvents);
} }
# ifdef FEAT_CLIENTSERVER # ifdef FEAT_CLIENTSERVER
@@ -435,7 +436,7 @@ msg_wait_for_multiple_objects(
DWORD dwMilliseconds, DWORD dwMilliseconds,
DWORD dwWakeMask) DWORD dwWakeMask)
{ {
if (read_console_input(NULL, NULL, (DWORD)-2, NULL)) if (read_console_input(NULL, NULL, -2, NULL))
return WAIT_OBJECT_0; return WAIT_OBJECT_0;
return MsgWaitForMultipleObjects(nCount, pHandles, fWaitAll, return MsgWaitForMultipleObjects(nCount, pHandles, fWaitAll,
dwMilliseconds, dwWakeMask); dwMilliseconds, dwWakeMask);
@@ -448,7 +449,7 @@ wait_for_single_object(
HANDLE hHandle, HANDLE hHandle,
DWORD dwMilliseconds) DWORD dwMilliseconds)
{ {
if (read_console_input(NULL, NULL, (DWORD)-2, NULL)) if (read_console_input(NULL, NULL, -2, NULL))
return WAIT_OBJECT_0; return WAIT_OBJECT_0;
return WaitForSingleObject(hHandle, dwMilliseconds); return WaitForSingleObject(hHandle, dwMilliseconds);
} }
@@ -760,8 +761,8 @@ dyn_libintl_init(void)
} }
// The bind_textdomain_codeset() function is optional. // The bind_textdomain_codeset() function is optional.
dyn_libintl_bind_textdomain_codeset = (void *)GetProcAddress(hLibintlDLL, dyn_libintl_bind_textdomain_codeset = (char *(*)(const char *, const char *))
"bind_textdomain_codeset"); GetProcAddress(hLibintlDLL, "bind_textdomain_codeset");
if (dyn_libintl_bind_textdomain_codeset == NULL) if (dyn_libintl_bind_textdomain_codeset == NULL)
dyn_libintl_bind_textdomain_codeset = dyn_libintl_bind_textdomain_codeset =
null_libintl_bind_textdomain_codeset; null_libintl_bind_textdomain_codeset;
@@ -769,7 +770,8 @@ dyn_libintl_init(void)
// _wputenv() function for the libintl.dll is optional. // _wputenv() function for the libintl.dll is optional.
hmsvcrt = find_imported_module_by_funcname(hLibintlDLL, "getenv"); hmsvcrt = find_imported_module_by_funcname(hLibintlDLL, "getenv");
if (hmsvcrt != NULL) if (hmsvcrt != NULL)
dyn_libintl_wputenv = (void *)GetProcAddress(hmsvcrt, "_wputenv"); dyn_libintl_wputenv = (int (*)(const wchar_t *))
GetProcAddress(hmsvcrt, "_wputenv");
if (dyn_libintl_wputenv == NULL || dyn_libintl_wputenv == _wputenv) if (dyn_libintl_wputenv == NULL || dyn_libintl_wputenv == _wputenv)
dyn_libintl_wputenv = null_libintl_wputenv; dyn_libintl_wputenv = null_libintl_wputenv;
@@ -4224,7 +4226,7 @@ sub_process_writer(LPVOID param)
s == NULL ? l : (DWORD)(s - (lp + written)), s == NULL ? l : (DWORD)(s - (lp + written)),
&len, NULL); &len, NULL);
} }
if (len == (int)l) if (len == l)
{ {
// Finished a line, add a NL, unless this line should not have // Finished a line, add a NL, unless this line should not have
// one. // one.
@@ -8338,7 +8340,7 @@ static int *timeout_flag = &timeout_flags[0];
static void CALLBACK static void CALLBACK
set_flag(void *param, BOOLEAN unused2) set_flag(void *param, BOOLEAN unused2 UNUSED)
{ {
int *timeout_flag = (int *)param; int *timeout_flag = (int *)param;

View File

@@ -198,7 +198,7 @@ Trace(char *pszFormat, ...);
// These macros should all compile away to nothing // These macros should all compile away to nothing
# define ASSERT(f) ((void)0) # define ASSERT(f) ((void)0)
# define TRACE 1 ? (void)0 : printf # define TRACE 1 ? (void)0 : (void)printf
# define TRACE0(sz) # define TRACE0(sz)
# define TRACE1(sz, p1) # define TRACE1(sz, p1)
# define TRACE2(sz, p1, p2) # define TRACE2(sz, p1, p2)

View File

@@ -50,21 +50,6 @@
#undef tgetstr #undef tgetstr
/*
* Here are the builtin termcap entries. They are not stored as complete
* structures with all entries, as such a structure is too big.
*
* The entries are compact, therefore they normally are included even when
* HAVE_TGETENT is defined. When HAVE_TGETENT is defined, the builtin entries
* can be accessed with "builtin_amiga", "builtin_ansi", "builtin_debug", etc.
*
* Each termcap is a list of builtin_term structures. It always starts with
* KS_NAME, which separates the entries. See parse_builtin_tcap() for all
* details.
* bt_entry is either a KS_xxx code (>= 0), or a K_xxx code.
*
* Entries marked with "guessed" may be wrong.
*/
struct builtin_term struct builtin_term
{ {
int bt_entry; int bt_entry;
@@ -221,6 +206,21 @@ static int initial_cursor_shape_blink = FALSE;
static int initial_cursor_blink = FALSE; static int initial_cursor_blink = FALSE;
#endif #endif
/*
* Here are the builtin termcap entries. They are not stored as complete
* structures with all entries to save space.
*
* The entries are also included even when HAVE_TGETENT is defined, the systerm
* termcap may be incomplee. When HAVE_TGETENT is defined, the builtin entries
* can be accessed with "builtin_amiga", "builtin_ansi", "builtin_debug", etc.
*
* Each termcap is a list of builtin_term structures. It always starts with
* KS_NAME, which separates the entries. See parse_builtin_tcap() for all
* details.
* bt_entry is either a KS_xxx code (>= 0), or a K_xxx code.
*
* Entries marked with "guessed" may be wrong.
*/
static struct builtin_term builtin_termcaps[] = static struct builtin_term builtin_termcaps[] =
{ {
@@ -6603,28 +6603,28 @@ struct ks_tbl_S
static struct ks_tbl_S ks_tbl[] = static struct ks_tbl_S ks_tbl[] =
{ {
{(int)KS_ME, "\033|0m", "\033|0m"}, // normal {(int)KS_ME, "\033|0m", "\033|0m", {""}}, // normal
{(int)KS_MR, "\033|7m", "\033|7m"}, // reverse {(int)KS_MR, "\033|7m", "\033|7m", {""}}, // reverse
{(int)KS_MD, "\033|1m", "\033|1m"}, // bold {(int)KS_MD, "\033|1m", "\033|1m", {""}}, // bold
{(int)KS_SO, "\033|91m", "\033|91m"}, // standout: bright red text {(int)KS_SO, "\033|91m", "\033|91m", {""}}, // standout: bright red text
{(int)KS_SE, "\033|39m", "\033|39m"}, // standout end: default color {(int)KS_SE, "\033|39m", "\033|39m", {""}}, // standout end: default color
{(int)KS_CZH, "\033|3m", "\033|3m"}, // italic {(int)KS_CZH, "\033|3m", "\033|3m", {""}}, // italic
{(int)KS_CZR, "\033|0m", "\033|0m"}, // italic end {(int)KS_CZR, "\033|0m", "\033|0m", {""}}, // italic end
{(int)KS_US, "\033|4m", "\033|4m"}, // underscore {(int)KS_US, "\033|4m", "\033|4m", {""}}, // underscore
{(int)KS_UE, "\033|24m", "\033|24m"}, // underscore end {(int)KS_UE, "\033|24m", "\033|24m", {""}}, // underscore end
# ifdef TERMINFO # ifdef TERMINFO
{(int)KS_CAB, "\033|%p1%db", "\033|%p14%dm"}, // set background color {(int)KS_CAB, "\033|%p1%db", "\033|%p14%dm", {""}}, // set background color
{(int)KS_CAF, "\033|%p1%df", "\033|%p13%dm"}, // set foreground color {(int)KS_CAF, "\033|%p1%df", "\033|%p13%dm", {""}}, // set foreground color
{(int)KS_CS, "\033|%p1%d;%p2%dR", "\033|%p1%d;%p2%dR"}, {(int)KS_CS, "\033|%p1%d;%p2%dR", "\033|%p1%d;%p2%dR", {""}},
{(int)KS_CSV, "\033|%p1%d;%p2%dV", "\033|%p1%d;%p2%dV"}, {(int)KS_CSV, "\033|%p1%d;%p2%dV", "\033|%p1%d;%p2%dV", {""}},
# else # else
{(int)KS_CAB, "\033|%db", "\033|4%dm"}, // set background color {(int)KS_CAB, "\033|%db", "\033|4%dm", {""}}, // set background color
{(int)KS_CAF, "\033|%df", "\033|3%dm"}, // set foreground color {(int)KS_CAF, "\033|%df", "\033|3%dm", {""}}, // set foreground color
{(int)KS_CS, "\033|%d;%dR", "\033|%d;%dR"}, {(int)KS_CS, "\033|%d;%dR", "\033|%d;%dR", {""}},
{(int)KS_CSV, "\033|%d;%dV", "\033|%d;%dV"}, {(int)KS_CSV, "\033|%d;%dV", "\033|%d;%dV", {""}},
# endif # endif
{(int)KS_CCO, "256", "256"}, // colors {(int)KS_CCO, "256", "256", {""}}, // colors
{(int)KS_NAME} // terminator {(int)KS_NAME, NULL, NULL, {""}} // terminator
}; };
static struct builtin_term * static struct builtin_term *

View File

@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
5073,
/**/ /**/
5072, 5072,
/**/ /**/

View File

@@ -33,7 +33,7 @@
// Mark unused function arguments with UNUSED, so that gcc -Wunused-parameter // Mark unused function arguments with UNUSED, so that gcc -Wunused-parameter
// can be used to check for mistakes. // can be used to check for mistakes.
#ifdef HAVE_ATTRIBUTE_UNUSED #if defined(HAVE_ATTRIBUTE_UNUSED) || defined(__MINGW32__)
# define UNUSED __attribute__((unused)) # define UNUSED __attribute__((unused))
#else #else
# define UNUSED # define UNUSED