diff options
Diffstat (limited to 'ncurses/tinfo/MKcodes.awk')
| -rw-r--r-- | ncurses/tinfo/MKcodes.awk | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ncurses/tinfo/MKcodes.awk b/ncurses/tinfo/MKcodes.awk index 48f4800b310a..1c7f5a9e69ca 100644 --- a/ncurses/tinfo/MKcodes.awk +++ b/ncurses/tinfo/MKcodes.awk @@ -1,5 +1,5 @@ ############################################################################## -# Copyright 2019,2020 Thomas E. Dickey # +# Copyright 2019-2020,2024 Thomas E. Dickey # # Copyright 2007-2009,2010 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -26,7 +26,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: MKcodes.awk,v 1.11 2020/02/02 23:34:34 tom Exp $ +# $Id: MKcodes.awk,v 1.13 2024/12/14 23:45:36 tom Exp $ function large_item(value) { result = sprintf("%d,", offset); offset = offset + length(value) + 1; @@ -63,7 +63,7 @@ function print_offsets(name,value) { printf "%s", value print "};" print "" - printf "static NCURSES_CONST char ** ptr_%s = 0;\n", name + printf "static NCURSES_CONST char ** ptr_%s = NULL;\n", name print "" } @@ -105,7 +105,7 @@ END { print "#if BROKEN_LINKER || USE_REENTRANT" print "" if (bigstrings) { - printf "static const char _nc_code_blob[] = \n" + printf "static const char _nc_code_blob[] =\n" printf "%s;\n", bigstr; print_offsets("boolcodes", large_boolcodes); print_offsets("numcodes", large_numcodes); @@ -114,8 +114,8 @@ END { print "static IT *" print "alloc_array(NCURSES_CONST char ***value, const short *offsets, unsigned size)" print "{" - print " if (*value == 0) {" - print " if ((*value = typeCalloc(NCURSES_CONST char *, size + 1)) != 0) {" + print " if (*value == NULL) {" + print " if ((*value = typeCalloc(NCURSES_CONST char *, size + 1)) != NULL) {" print " unsigned n;" print " for (n = 0; n < size; ++n) {" print " (*value)[n] = (NCURSES_CONST char *) _nc_code_blob + offsets[n];" |
