]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/MKunctrl.awk
ncurses 6.2 - patch 20210418
[ncurses.git] / ncurses / base / MKunctrl.awk
index 2c37d442c9d38e8818bc7066591878ade3d41ac6..9a2a6db63876c9fc4474ac89b979656c59c3722e 100644 (file)
@@ -1,6 +1,7 @@
-# $Id: MKunctrl.awk,v 1.25 2009/04/18 23:43:49 tom Exp $
+# $Id: MKunctrl.awk,v 1.29 2020/02/02 23:34:34 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.                #
+# Copyright 2020 Thomas E. Dickey                                            #
+# Copyright 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,12 +37,6 @@ BEGIN        {
                print "#include <curses.priv.h>"
                print "#include <ctype.h>"
                print ""
-               print "#if USE_WIDEC_SUPPORT"
-               print "#if HAVE_WCTYPE_H"
-               print "#include <wctype.h>"
-               print "#endif"
-               print "#endif"
-               print ""
                print "#undef unctrl"
                print ""
        }
@@ -146,9 +141,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)"
@@ -157,16 +153,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)"
@@ -175,7 +161,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 {"