summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-07-02 09:24:24 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-07-02 09:24:24 (GMT)
commit7b6e25bd97a76f688ed363cac924ea99a83fa5f4 (patch)
tree02b9e7616e32fd34431882da62f753f306da0913
parent4d37dc35b57252cbd904008b843dce0354c01669 (diff)
downloadtk-7b6e25bd97a76f688ed363cac924ea99a83fa5f4.zip
tk-7b6e25bd97a76f688ed363cac924ea99a83fa5f4.tar.gz
tk-7b6e25bd97a76f688ed363cac924ea99a83fa5f4.tar.bz2
Statically initialize "X11ControlChars" pseudo-encoding.
-rw-r--r--unix/tkUnixFont.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index dc80807..50033ec 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -316,14 +316,8 @@ TkpFontPkgInit(
Tcl_Encoding ucs2;
if (tsdPtr->controlFamily.encoding == NULL) {
- Tcl_EncodingType type;
- type.encodingName = "X11ControlChars";
- type.toUtfProc = ControlUtfProc;
- type.fromUtfProc = ControlUtfProc;
- type.freeProc = NULL;
- type.clientData = NULL;
- type.nullSize = 0;
+ Tcl_EncodingType type = {"X11ControlChars", ControlUtfProc, ControlUtfProc, NULL, NULL, 0};
tsdPtr->controlFamily.refCount = 2;
tsdPtr->controlFamily.encoding = Tcl_CreateEncoding(&type);
tsdPtr->controlFamily.isTwoByteFont = 0;
@@ -342,8 +336,8 @@ TkpFontPkgInit(
ucs2 = Tcl_GetEncoding(NULL, "ucs-2be");
if (ucs2 == NULL) {
- Tcl_EncodingType type = {"ucs-2be", Ucs2beToUtfProc, UtfToUcs2beProc, NULL, NULL, 2};
- Tcl_CreateEncoding(&type);
+ Tcl_EncodingType ucs2type = {"ucs-2be", Ucs2beToUtfProc, UtfToUcs2beProc, NULL, NULL, 2};
+ Tcl_CreateEncoding(&ucs2type);
} else {
Tcl_FreeEncoding(ucs2);
}