X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2FMKunctrl.awk;h=0b505d0ce9123b526ba157e6392920652c990fd9;hp=36fbeecb2e765f8443207aa1542d30b0ff99504f;hb=79695a2ff354087dca5006351286f741ee8c82c4;hpb=205f120bce7a338464e79ef846e4f07eff365d6c;ds=sidebyside diff --git a/ncurses/base/MKunctrl.awk b/ncurses/base/MKunctrl.awk index 36fbeecb..0b505d0c 100644 --- a/ncurses/base/MKunctrl.awk +++ b/ncurses/base/MKunctrl.awk @@ -1,6 +1,6 @@ -# $Id: MKunctrl.awk,v 1.23 2008/10/04 21:40:24 tom Exp $ +# $Id: MKunctrl.awk,v 1.28 2017/02/11 17:30:48 tom Exp $ ############################################################################## -# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. # +# Copyright (c) 1998-2012,2017 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -36,19 +36,12 @@ BEGIN { print "#include " print "#include " print "" - print "#if USE_WIDEC_SUPPORT" - print "#if HAVE_WCTYPE_H" - print "#include " - print "#endif" - print "#endif" - print "" print "#undef unctrl" print "" } END { - print "NCURSES_EXPORT(NCURSES_CONST char *) _nc_unctrl (SCREEN *sp, chtype ch)" + print "NCURSES_EXPORT(NCURSES_CONST char *) safe_unctrl(SCREEN *sp, chtype ch)" print "{" - blob="" offset=0 if (bigstrings) { @@ -147,9 +140,10 @@ END { } else { stringname = "unctrl" } - print "\tint check = ChCharOf(ch);" + print "\tint check = (int) ChCharOf(ch);" print "\tconst char *result;" print "" + print "(void) sp;" print "\tif (check >= 0 && check < (int)SIZEOF(unctrl_table)) {" print "#if NCURSES_EXT_FUNCS" print "\t\tif ((sp != 0)" @@ -158,16 +152,6 @@ END { print "\t\t && (check < 160))" printf "\t\t\tresult = %s_c1[check - 128];\n", stringname; print "\t\telse" - print "#if USE_WIDEC_SUPPORT" - print "\t\tif ((check >= 160)" - print "\t\t && (check < 256)" - print "\t\t && ((sp != 0)" - print "\t\t && ((sp->_legacy_coding > 0)" - print "\t\t || (sp->_legacy_coding == 0" - print "\t\t && (isprint(check) || iswprint(check))))))" - printf "\t\t\tresult = %s_c1[check - 128];\n", stringname; - print "\t\telse" - print "#else" print "\t\tif ((check >= 160)" print "\t\t && (check < 256)" print "\t\t && ((sp != 0)" @@ -176,7 +160,6 @@ END { print "\t\t && isprint(check)))))" printf "\t\t\tresult = %s_c1[check - 128];\n", stringname; print "\t\telse" - print "#endif /* USE_WIDEC_SUPPORT */" print "#endif /* NCURSES_EXT_FUNCS */" printf "\t\t\tresult = %s_table[check];\n", stringname; print "\t} else {" @@ -187,6 +170,6 @@ END { print "" print "NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype ch)" print "{" - print "\treturn _nc_unctrl(SP, ch);" + print "\treturn safe_unctrl(CURRENT_SCREEN, ch);" print "}" }