From e762154f0bff6ba4f30c05b791f85c1ea8c5840f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 5 Oct 2018 21:26:32 +0000 Subject: More code cleanup, related to (unused) wchar_t, TCL_THREADS macro, and better use of size_t --- generic/tkEntry.c | 4 +--- unix/tkConfig.h.in | 6 ------ unix/tkUnixEvent.c | 2 +- win/rc/tk.rc | 8 +------- win/rc/wish.rc | 8 +------- xlib/X11/Xlib.h | 15 --------------- xlib/X11/Xutil.h | 25 ------------------------- 7 files changed, 4 insertions(+), 64 deletions(-) diff --git a/generic/tkEntry.c b/generic/tkEntry.c index cf15974..600bc44 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -2132,9 +2132,7 @@ InsertChars( const char *value) /* New characters to add (NULL-terminated * string). */ { - ptrdiff_t byteIndex; - size_t byteCount, newByteCount; - int oldChars, charsAdded; + size_t byteIndex, byteCount, newByteCount, oldChars, charsAdded; const char *string; char *newStr; diff --git a/unix/tkConfig.h.in b/unix/tkConfig.h.in index 4fd7726..edd7aa6 100644 --- a/unix/tkConfig.h.in +++ b/unix/tkConfig.h.in @@ -133,9 +133,6 @@ /* Is this a static build? */ #undef STATIC_BUILD -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - /* Is this a 64-bit build? */ #undef TCL_CFG_DO64BIT @@ -154,9 +151,6 @@ /* What is the default extension for shared libraries? */ #undef TCL_SHLIB_EXT -/* Are we building with threads enabled? */ -#undef TCL_THREADS - /* Are wide integers to be implemented with C 'long's? */ #undef TCL_WIDE_INT_IS_LONG diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c index 111d430..cc626c2 100644 --- a/unix/tkUnixEvent.c +++ b/unix/tkUnixEvent.c @@ -131,7 +131,7 @@ TkpOpenDisplay( int reason = 0; unsigned int use_xkb = 0; /* Disabled, until we have a better test. See [Bug 3613668] */ -#if 0 && defined(XKEYCODETOKEYSYM_IS_DEPRECATED) && defined(TCL_THREADS) +#if 0 && defined(XKEYCODETOKEYSYM_IS_DEPRECATED) static int xinited = 0; static Tcl_Mutex xinitMutex = NULL; diff --git a/win/rc/tk.rc b/win/rc/tk.rc index 6a74be3..35a9a8a 100644 --- a/win/rc/tk.rc +++ b/win/rc/tk.rc @@ -8,19 +8,13 @@ // // build-up the name suffix that defines the type of build this is. // -#if TCL_THREADS -#define SUFFIX_THREADS "t" -#else -#define SUFFIX_THREADS "" -#endif - #if DEBUG && !UNCHECKED #define SUFFIX_DEBUG "g" #else #define SUFFIX_DEBUG "" #endif -#define SUFFIX SUFFIX_THREADS SUFFIX_DEBUG +#define SUFFIX SUFFIX_DEBUG VS_VERSION_INFO VERSIONINFO diff --git a/win/rc/wish.rc b/win/rc/wish.rc index 53e02fa..4a889f4 100644 --- a/win/rc/wish.rc +++ b/win/rc/wish.rc @@ -8,12 +8,6 @@ // // build-up the name suffix that defines the type of build this is. // -#if TCL_THREADS -#define SUFFIX_THREADS "t" -#else -#define SUFFIX_THREADS "" -#endif - #if STATIC_BUILD #define SUFFIX_STATIC "s" #else @@ -26,7 +20,7 @@ #define SUFFIX_DEBUG "" #endif -#define SUFFIX SUFFIX_THREADS SUFFIX_STATIC SUFFIX_DEBUG +#define SUFFIX SUFFIX_STATIC SUFFIX_DEBUG VS_VERSION_INFO VERSIONINFO diff --git a/xlib/X11/Xlib.h b/xlib/X11/Xlib.h index b027e28..09dc518 100644 --- a/xlib/X11/Xlib.h +++ b/xlib/X11/Xlib.h @@ -45,13 +45,6 @@ #endif #endif -#ifndef X_WCHAR -#include -#else -/* replace this with #include or typedef appropriate for your system */ -typedef unsigned long wchar_t; -#endif - typedef char *XPointer; #define Bool int @@ -1053,13 +1046,6 @@ typedef struct { XFontSet font_set; } XmbTextItem; -typedef struct { - wchar_t *chars; - int nchars; - int delta; - XFontSet font_set; -} XwcTextItem; - typedef void (*XIMProc)(); typedef struct _XIM *XIM; @@ -1143,7 +1129,6 @@ typedef struct _XIMText { Bool encoding_is_wchar; union { char *multi_byte; - wchar_t *wide_char; } string; } XIMText; diff --git a/xlib/X11/Xutil.h b/xlib/X11/Xutil.h index 8141b1d..38ae9f5 100644 --- a/xlib/X11/Xutil.h +++ b/xlib/X11/Xutil.h @@ -748,22 +748,6 @@ extern int XmbTextListToTextProperty( #endif ); -extern int XwcTextListToTextProperty( -#if NeedFunctionPrototypes - Display* /* display */, - wchar_t** /* list */, - int /* count */, - XICCEncodingStyle /* style */, - XTextProperty* /* text_prop_return */ -#endif -); - -extern void XwcFreeStringList( -#if NeedFunctionPrototypes - wchar_t** /* list */ -#endif -); - extern Status XTextPropertyToStringList( #if NeedFunctionPrototypes XTextProperty* /* text_prop */, @@ -781,15 +765,6 @@ extern int XmbTextPropertyToTextList( #endif ); -extern int XwcTextPropertyToTextList( -#if NeedFunctionPrototypes - Display* /* display */, - XTextProperty* /* text_prop */, - wchar_t*** /* list_return */, - int* /* count_return */ -#endif -); - extern void XUnionRectWithRegion( #if NeedFunctionPrototypes XRectangle* /* rectangle */, -- cgit v0.12