summaryrefslogtreecommitdiff
path: root/ncurses/tinfo/lib_acs.c
diff options
context:
space:
mode:
Diffstat (limited to 'ncurses/tinfo/lib_acs.c')
-rw-r--r--ncurses/tinfo/lib_acs.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/ncurses/tinfo/lib_acs.c b/ncurses/tinfo/lib_acs.c
index 4ede53f6b995..52d0c5a6aa9a 100644
--- a/ncurses/tinfo/lib_acs.c
+++ b/ncurses/tinfo/lib_acs.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2024,2025 Thomas E. Dickey *
* Copyright 1998-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -40,14 +40,14 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_acs.c,v 1.50 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_acs.c,v 1.54 2025/12/27 12:33:34 tom Exp $")
#if BROKEN_LINKER || USE_REENTRANT
#define MyBuffer _nc_prescreen.real_acs_map
NCURSES_EXPORT(chtype *)
NCURSES_PUBLIC_VAR(acs_map) (void)
{
- if (MyBuffer == 0)
+ if (MyBuffer == NULL)
MyBuffer = typeCalloc(chtype, ACS_LEN);
return MyBuffer;
}
@@ -59,14 +59,14 @@ NCURSES_EXPORT_VAR (chtype) acs_map[ACS_LEN] =
};
#endif
-#ifdef USE_TERM_DRIVER
+#if USE_TERM_DRIVER
NCURSES_EXPORT(chtype)
NCURSES_SP_NAME(_nc_acs_char) (NCURSES_SP_DCLx int c)
{
chtype *map;
if (c < 0 || c >= ACS_LEN)
return (chtype) 0;
- map = (SP_PARM != 0) ? SP_PARM->_acs_map :
+ map = (SP_PARM != NULL) ? SP_PARM->_acs_map :
#if BROKEN_LINKER || USE_REENTRANT
_nc_prescreen.real_acs_map
#else
@@ -81,7 +81,7 @@ NCURSES_EXPORT(void)
NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0)
{
chtype *fake_map = acs_map;
- chtype *real_map = SP_PARM != 0 ? SP_PARM->_acs_map : fake_map;
+ chtype *real_map = SP_PARM != NULL ? SP_PARM->_acs_map : fake_map;
int j;
T(("initializing ACS map"));
@@ -166,7 +166,7 @@ NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0)
real_map['Y'] = '|'; /* vertical line */
real_map['E'] = '+'; /* large plus or crossover */
-#ifdef USE_TERM_DRIVER
+#if USE_TERM_DRIVER
CallDriver_2(SP_PARM, td_initacs, real_map, fake_map);
#else
if (ena_acs != NULL) {
@@ -183,7 +183,7 @@ NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0)
*
* test/blue.c uses this feature.
*/
-#define PCH_KLUDGE(a,b) (a != 0 && b != 0 && !strcmp(a,b))
+#define PCH_KLUDGE(a,b) (a != NULL && b != NULL && !strcmp(a,b))
if (PCH_KLUDGE(enter_pc_charset_mode, enter_alt_charset_mode) &&
PCH_KLUDGE(exit_pc_charset_mode, exit_alt_charset_mode)) {
size_t i;
@@ -191,7 +191,7 @@ NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0)
if (real_map[i] == 0) {
real_map[i] = (chtype) i;
if (real_map != fake_map) {
- if (SP != 0)
+ if (SP != NULL)
SP->_screen_acs_map[i] = TRUE;
}
}
@@ -210,7 +210,7 @@ NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0)
(int) i,
_tracechar(UChar(acs_chars[i])),
_tracechtype(real_map[UChar(acs_chars[i])])));
- if (SP != 0) {
+ if (SP != NULL) {
SP->_screen_acs_map[UChar(acs_chars[i])] = TRUE;
}
}
@@ -258,7 +258,7 @@ _nc_init_acs(void)
#if !NCURSES_WCWIDTH_GRAPHICS
NCURSES_EXPORT(int)
-_nc_wacs_width(unsigned ch)
+_nc_wacs_width(wchar_t ch)
{
int result;
switch (ch) {
@@ -318,7 +318,7 @@ _nc_wacs_width(unsigned ch)
result = 1;
break;
default:
- result = wcwidth(ch);
+ result = wcwidth((wchar_t) ch);
break;
}
return result;