summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2020-05-24 15:44:22 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2020-05-24 15:44:22 (GMT)
commite9d72bbaa4a4cef256b3d3480ed1136b8651d019 (patch)
tree5b555bb43f3c32b4ff86fe07b3b06f5000ade4d9 /unix
parenta48a5b55179978d3f31371c90d9be6eaa6931f17 (diff)
parentad1ded4a7f409e06bd6e1b33da463e6c7cd844af (diff)
downloadtk-e9d72bbaa4a4cef256b3d3480ed1136b8651d019.zip
tk-e9d72bbaa4a4cef256b3d3480ed1136b8651d019.tar.gz
tk-e9d72bbaa4a4cef256b3d3480ed1136b8651d019.tar.bz2
Merge trunk
Diffstat (limited to 'unix')
-rw-r--r--unix/Makefile.in99
-rw-r--r--unix/README4
-rwxr-xr-xunix/configure745
-rw-r--r--unix/configure.ac88
-rwxr-xr-xunix/installManPage10
-rw-r--r--unix/tcl.m4134
-rw-r--r--unix/tk.pc.in3
-rw-r--r--unix/tk.spec4
-rw-r--r--unix/tkAppInit.c6
-rw-r--r--unix/tkConfig.h.in12
-rw-r--r--unix/tkConfig.sh.in3
-rw-r--r--unix/tkUnix.c5
-rw-r--r--unix/tkUnix3d.c4
-rw-r--r--unix/tkUnixButton.c10
-rw-r--r--unix/tkUnixColor.c28
-rw-r--r--unix/tkUnixConfig.c4
-rw-r--r--unix/tkUnixCursor.c6
-rw-r--r--unix/tkUnixDefault.h17
-rw-r--r--unix/tkUnixDialog.c2
-rw-r--r--unix/tkUnixDraw.c27
-rw-r--r--unix/tkUnixEmbed.c43
-rw-r--r--unix/tkUnixEvent.c87
-rw-r--r--unix/tkUnixFont.c282
-rw-r--r--unix/tkUnixInit.c11
-rw-r--r--unix/tkUnixKey.c51
-rw-r--r--unix/tkUnixMenu.c73
-rw-r--r--unix/tkUnixMenubu.c9
-rw-r--r--unix/tkUnixPort.h64
-rw-r--r--unix/tkUnixRFont.c125
-rw-r--r--unix/tkUnixScale.c93
-rw-r--r--unix/tkUnixScrlbr.c20
-rw-r--r--unix/tkUnixSelect.c59
-rw-r--r--unix/tkUnixSend.c63
-rw-r--r--unix/tkUnixWm.c270
34 files changed, 1253 insertions, 1208 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 86a8a61..271cb07 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -35,6 +35,7 @@ bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
datarootdir = @datarootdir@
+runstatedir = @runstatedir@
mandir = @mandir@
# The following definition can be set to non-null for special systems
@@ -95,16 +96,17 @@ HTML_INSTALL_DIR = $(INSTALL_ROOT)$(HTML_DIR)
CONFIG_INSTALL_DIR = $(INSTALL_ROOT)$(libdir)
# Directory in which to install the demo files:
-DEMO_INSTALL_DIR = $(INSTALL_ROOT)$(TK_LIBRARY)/demos
+DEMO_INSTALL_DIR = $(INSTALL_ROOT)@DEMO_DIR@
# The directory containing the Tcl sources and headers appropriate
# for this version of Tk ("srcdir" will be replaced or has already
# been replaced by the configure script):
-TCL_GENERIC_DIR = @TCL_SRC_DIR@/generic
+TCLDIR = @TCL_SRC_DIR@
+TCL_GENERIC_DIR = $(TCLDIR)/generic
# The directory containing the platform specific Tcl sources and headers
# appropriate for this version of Tk:
-TCL_PLATFORM_DIR = @TCL_SRC_DIR@/unix
+TCL_PLATFORM_DIR = $(TCLDIR)/unix
# The directory containing the Tcl library archive file appropriate
# for this version of Tk:
@@ -310,7 +312,7 @@ GENERIC_DIR = $(TOP_DIR)/generic
TTK_DIR = $(GENERIC_DIR)/ttk
UNIX_DIR = $(TOP_DIR)/unix
BMAP_DIR = $(TOP_DIR)/bitmaps
-TOOL_DIR = @TCL_SRC_DIR@/tools
+TOOL_DIR = $(TCLDIR)/tools
TEST_DIR = $(TOP_DIR)/tests
MAC_OSX_DIR = $(TOP_DIR)/macosx
XLIB_DIR = $(TOP_DIR)/xlib
@@ -327,9 +329,9 @@ MAN_FLAGS = @MAN_FLAGS@
CC = @CC@
-CC_SWITCHES_NO_STUBS = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
--I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} -I${TCL_GENERIC_DIR} \
--I${TCL_PLATFORM_DIR} ${@TK_WINDOWINGSYSTEM@_INCLUDES} ${AC_FLAGS} \
+CC_SWITCHES_NO_STUBS = -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \
+${@TK_WINDOWINGSYSTEM@_INCLUDES} ${CFLAGS} ${CFLAGS_WARNING} \
+${SHLIB_CFLAGS} -I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${AC_FLAGS} \
${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} \
${NO_DEPRECATED_FLAGS} @EXTRA_CC_SWITCHES@
@@ -337,10 +339,10 @@ CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @TCL_STUB_FLAGS@
APP_CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @EXTRA_APP_CC_SWITCHES@
-DEPEND_SWITCHES = ${CFLAGS} -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \
--I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${@TK_WINDOWINGSYSTEM@_INCLUDES} \
-${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} \
-${KEYSYM_FLAGS} @EXTRA_CC_SWITCHES@
+DEPEND_SWITCHES = -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \
+${@TK_WINDOWINGSYSTEM@_INCLUDES} ${CFLAGS} -I${TCL_GENERIC_DIR} \
+-I${TCL_PLATFORM_DIR} ${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} \
+${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} @EXTRA_CC_SWITCHES@
WISH_OBJS = tkAppInit.o
@@ -356,7 +358,7 @@ CANV_OBJS = tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvImg.o \
tkCanvUtil.o tkCanvWind.o tkRectOval.o tkTrig.o
IMAGE_OBJS = tkImage.o tkImgBmap.o tkImgGIF.o tkImgPNG.o tkImgPPM.o \
- tkImgPhoto.o tkImgPhInstance.o tkImgListFormat.o
+ tkImgPhoto.o tkImgPhInstance.o tkImgListFormat.o tkImgSVGnano.o
TEXT_OBJS = tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o tkTextIndex.o \
tkTextMark.o tkTextTag.o tkTextWind.o
@@ -369,8 +371,9 @@ GENERIC_OBJS = tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkBusy.o \
tkClipboard.o \
tkCmds.o tkColor.o tkConfig.o tkConsole.o tkCursor.o tkError.o \
tkEvent.o tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o \
- tkGrid.o tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o tkPlace.o \
- tkSelect.o tkStyle.o tkUndo.o tkUtil.o tkVisual.o tkWindow.o
+ tkGrid.o tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o \
+ tkPkgConfig.o tkPlace.o tkSelect.o tkStyle.o tkUndo.o tkUtil.o \
+ tkVisual.o tkWindow.o
TTK_OBJS = \
ttkBlink.o ttkButton.o ttkCache.o ttkClamTheme.o ttkClassicTheme.o \
@@ -395,10 +398,11 @@ AQUA_OBJS = tkMacOSXBitmap.o tkMacOSXButton.o tkMacOSXClipboard.o \
tkMacOSXColor.o tkMacOSXConfig.o tkMacOSXCursor.o tkMacOSXDebug.o \
tkMacOSXDialog.o tkMacOSXDraw.o tkMacOSXEmbed.o tkMacOSXEntry.o \
tkMacOSXEvent.o tkMacOSXFont.o tkMacOSXHLEvents.o tkMacOSXImage.o \
- tkMacOSXInit.o tkMacOSXKeyboard.o tkMacOSXKeyEvent.o tkMacOSXMenu.o \
+ tkMacOSXInit.o tkMacOSXKeyboard.o tkMacOSXKeyEvent.o \
+ tkMacOSXMenu.o \
tkMacOSXMenubutton.o tkMacOSXMenus.o tkMacOSXMouseEvent.o \
tkMacOSXNotify.o tkMacOSXRegion.o tkMacOSXScrlbr.o tkMacOSXSend.o \
- tkMacOSXSubwindows.o tkMacOSXWindowEvent.o \
+ tkMacOSXServices.o tkMacOSXSubwindows.o tkMacOSXWindowEvent.o \
tkMacOSXWm.o tkMacOSXXStubs.o \
tkFileFilter.o tkMacWinMenu.o tkPointer.o tkUnix3d.o tkUnixScale.o \
xcolors.o xdraw.o xgc.o ximage.o xutil.o \
@@ -431,6 +435,7 @@ GENERIC_SRCS = \
$(GENERIC_DIR)/tkGrid.c $(GENERIC_DIR)/tkConsole.c \
$(GENERIC_DIR)/tkMain.c $(GENERIC_DIR)/tkOption.c \
$(GENERIC_DIR)/tkPack.c $(GENERIC_DIR)/tkPlace.c \
+ $(GENERIC_DIR)/tkPkgConfig.c \
$(GENERIC_DIR)/tkSelect.c $(GENERIC_DIR)/tkStyle.c \
$(GENERIC_DIR)/tkUndo.c $(GENERIC_DIR)/tkUtil.c \
$(GENERIC_DIR)/tkVisual.c $(GENERIC_DIR)/tkWindow.c \
@@ -449,6 +454,7 @@ GENERIC_SRCS = \
$(GENERIC_DIR)/tkTrig.c $(GENERIC_DIR)/tkImage.c \
$(GENERIC_DIR)/tkImgBmap.c $(GENERIC_DIR)/tkImgGIF.c \
$(GENERIC_DIR)/tkImgPNG.c $(GENERIC_DIR)/tkImgPPM.c \
+ $(GENERIC_DIR)/tkImgSVGnano.c $(GENERIC_DIR)/tkImgSVGnano.c \
$(GENERIC_DIR)/tkImgPhoto.c $(GENERIC_DIR)/tkImgPhInstance.c \
$(GENERIC_DIR)/tkImgListFormat.c $(GENERIC_DIR)/tkText.c \
$(GENERIC_DIR)/tkTextBTree.c $(GENERIC_DIR)/tkTextDisp.c \
@@ -521,10 +527,12 @@ AQUA_SRCS = \
$(MAC_OSX_DIR)/tkMacOSXFont.c $(MAC_OSX_DIR)/tkMacOSXHLEvents.c \
$(MAC_OSX_DIR)/tkMacOSXImage.c \
$(MAC_OSX_DIR)/tkMacOSXInit.c $(MAC_OSX_DIR)/tkMacOSXKeyboard.c \
- $(MAC_OSX_DIR)/tkMacOSXKeyEvent.c $(MAC_OSX_DIR)/tkMacOSXMenu.c \
+ $(MAC_OSX_DIR)/tkMacOSXKeyEvent.c \
+ $(MAC_OSX_DIR)/tkMacOSXMenu.c \
$(MAC_OSX_DIR)/tkMacOSXMenubutton.c $(MAC_OSX_DIR)/tkMacOSXMenus.c \
$(MAC_OSX_DIR)/tkMacOSXMouseEvent.c $(MAC_OSX_DIR)/tkMacOSXNotify.c \
$(MAC_OSX_DIR)/tkMacOSXRegion.c $(MAC_OSX_DIR)/tkMacOSXScrlbr.c \
+ $(MAC_OSX_DIR)/tkMacOSXServices.c \
$(MAC_OSX_DIR)/tkMacOSXSend.c $(MAC_OSX_DIR)/tkMacOSXSubwindows.c \
$(MAC_OSX_DIR)/tkMacOSXTest.c $(MAC_OSX_DIR)/tkMacOSXWindowEvent.c \
$(MAC_OSX_DIR)/tkMacOSXWm.c $(MAC_OSX_DIR)/tkMacOSXXStubs.c \
@@ -566,20 +574,15 @@ DEMOPROGS = browse hello ixset rmt rolodex square tcolor timer widget
SHELL_ENV = \
@LD_LIBRARY_PATH_VAR@="`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}"; \
export @LD_LIBRARY_PATH_VAR@; \
- TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \
+ TCL_LIBRARY=$(TCLDIR)/library; export TCL_LIBRARY; \
TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY;
-all: binaries libraries doc
+all: binaries libraries
binaries: ${LIB_FILE} ${WISH_EXE}
libraries:
-$(TOP_DIR)/doc/man.macros:
- $(INSTALL_DATA) @TCL_SRC_DIR@/doc/man.macros $(TOP_DIR)/doc/man.macros
-
-doc: $(TOP_DIR)/doc/man.macros
-
# The following target is configured by autoconf to generate either
# a shared library or non-shared library for Tk.
${LIB_FILE}: ${STUB_LIB_FILE} @LIB_RSRC_FILE@ ${OBJS}
@@ -682,7 +685,7 @@ demo:
# This target can be used to run wish inside either gdb or insight
gdb: ${WISH_EXE}
@echo "set env @LD_LIBRARY_PATH_VAR@=\"`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}\"" > gdb.run
- @echo "set env TCL_LIBRARY=@TCL_SRC_DIR@/library" >> gdb.run
+ @echo "set env TCL_LIBRARY=$(TCLDIR)/library" >> gdb.run
@echo "set env TK_LIBRARY=@TK_SRC_DIR@/library" >> gdb.run
gdb ./${WISH_EXE} --command=gdb.run
rm gdb.run
@@ -1010,6 +1013,32 @@ tkOption.o: $(GENERIC_DIR)/tkOption.c
tkPack.o: $(GENERIC_DIR)/tkPack.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkPack.c
+# TIP #59, embedding of configuration information into the binary library.
+#
+# Part of Tk's configuration information are the paths where it was installed
+# and where it will look for its libraries (which can be different). We derive
+# this information from the variables which can be overridden by the user. As
+# every path can be configured separately we do not remember one general
+# prefix/exec_prefix but all the different paths individually.
+
+tkPkgConfig.o: $(GENERIC_DIR)/tkPkgConfig.c
+ $(CC) -c $(CC_SWITCHES) \
+ -DCFG_INSTALL_LIBDIR="\"$(LIB_INSTALL_DIR)\"" \
+ -DCFG_INSTALL_BINDIR="\"$(BIN_INSTALL_DIR)\"" \
+ -DCFG_INSTALL_SCRDIR="\"$(SCRIPT_INSTALL_DIR)\"" \
+ -DCFG_INSTALL_INCDIR="\"$(INCLUDE_INSTALL_DIR)\"" \
+ -DCFG_INSTALL_DOCDIR="\"$(MAN_INSTALL_DIR)\"" \
+ -DCFG_INSTALL_DEMODIR="\"$(DEMO_INSTALL_DIR)\"" \
+ \
+ -DCFG_RUNTIME_LIBDIR="\"$(libdir)\"" \
+ -DCFG_RUNTIME_BINDIR="\"$(bindir)\"" \
+ -DCFG_RUNTIME_SCRDIR="\"$(TK_LIBRARY)\"" \
+ -DCFG_RUNTIME_INCDIR="\"$(includedir)\"" \
+ -DCFG_RUNTIME_DOCDIR="\"$(mandir)\"" \
+ -DCFG_RUNTIME_DEMODIR="\"$(DEMO_INSTALL_DIR)\"" \
+ \
+ $(GENERIC_DIR)/tkPkgConfig.c
+
tkPlace.o: $(GENERIC_DIR)/tkPlace.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkPlace.c
@@ -1118,6 +1147,9 @@ tkImgPNG.o: $(GENERIC_DIR)/tkImgPNG.c
tkImgPPM.o: $(GENERIC_DIR)/tkImgPPM.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPPM.c
+tkImgSVGnano.o: $(GENERIC_DIR)/tkImgSVGnano.c
+ $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgSVGnano.c
+
tkImgPhoto.o: $(GENERIC_DIR)/tkImgPhoto.c $(GENERIC_DIR)/tkImgPhoto.h
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPhoto.c
@@ -1316,6 +1348,9 @@ tkMacOSXScrlbr.o: $(MAC_OSX_DIR)/tkMacOSXScrlbr.c
tkMacOSXSend.o: $(MAC_OSX_DIR)/tkMacOSXSend.c
$(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXSend.c
+tkMacOSXServices.o: $(MAC_OSX_DIR)/tkMacOSXServices.c
+ $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXServices.c
+
tkMacOSXSubwindows.o: $(MAC_OSX_DIR)/tkMacOSXSubwindows.c
$(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXSubwindows.c
@@ -1534,7 +1569,6 @@ DISTROOT = /tmp/dist
DISTNAME = tk${VERSION}${PATCH_LEVEL}
ZIPNAME = tk${MAJOR_VERSION}${MINOR_VERSION}${PATCH_LEVEL}-src.zip
DISTDIR = $(DISTROOT)/$(DISTNAME)
-TCLDIR = @TCL_SRC_DIR@
DIST_INSTALL_DATA = CPPROG='cp -p' $(INSTALL) -m 644
DIST_INSTALL_SCRIPT = CPPROG='cp -p' $(INSTALL) -m 755
@@ -1546,14 +1580,14 @@ $(MAC_OSX_DIR)/configure: $(MAC_OSX_DIR)/configure.ac $(UNIX_DIR)/configure
$(UNIX_DIR)/tkConfig.h.in: $(MAC_OSX_DIR)/configure
cd $(MAC_OSX_DIR); autoheader; touch $@
-dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(MAC_OSX_DIR)/configure genstubs
+dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(MAC_OSX_DIR)/configure $(TOP_DIR)/doc/man.macros genstubs
rm -rf $(DISTDIR)
$(INSTALL_DATA_DIR) $(DISTDIR)/unix
$(DIST_INSTALL_DATA) $(UNIX_DIR)/*.c $(UNIX_DIR)/*.h $(DISTDIR)/unix
$(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(UNIX_DIR)/Makefile.in $(DISTDIR)/unix
$(DIST_INSTALL_DATA) $(UNIX_DIR)/configure.ac $(UNIX_DIR)/tk.spec \
$(UNIX_DIR)/aclocal.m4 $(UNIX_DIR)/tcl.m4 \
- $(UNIX_DIR)/tkConfig.sh.in $(TCLDIR)/unix/install-sh \
+ $(UNIX_DIR)/tkConfig.sh.in $(UNIX_DIR)/install-sh \
$(UNIX_DIR)/README $(UNIX_DIR)/installManPage \
$(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(DISTDIR)/unix
$(DIST_INSTALL_SCRIPT) $(UNIX_DIR)/configure $(DISTDIR)/unix
@@ -1569,7 +1603,7 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(MAC
$(DIST_INSTALL_DATA) $(GENERIC_DIR)/*.decls $(DISTDIR)/generic
$(DIST_INSTALL_DATA) $(GENERIC_DIR)/README $(DISTDIR)/generic
$(DIST_INSTALL_DATA) $(TOP_DIR)/changes $(TOP_DIR)/ChangeLog \
- $(TOP_DIR)/ChangeLog.2??? $(TOP_DIR)/README \
+ $(TOP_DIR)/ChangeLog.2??? $(TOP_DIR)/README.md \
$(TOP_DIR)/license.terms $(DISTDIR)
rm -f $(DISTDIR)/generic/blt*.[ch]
$(INSTALL_DATA_DIR) $(DISTDIR)/generic/ttk
@@ -1607,9 +1641,8 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(MAC
$(MAC_OSX_DIR)/Tk.xcodeproj/default.pbxuser \
$(DISTDIR)/macosx/Tk.xcodeproj
$(INSTALL_DATA_DIR) $(DISTDIR)/compat
- $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(TCLDIR)/compat/unistd.h \
- $(TCLDIR)/compat/stdlib.h \
- $(DISTDIR)/compat
+ $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(TOP_DIR)/compat/stdint.h \
+ $(TOP_DIR)/compat/stdbool.h $(DISTDIR)/compat
$(INSTALL_DATA_DIR) $(DISTDIR)/xlib
$(DIST_INSTALL_DATA) $(XLIB_DIR)/*.[ch] $(DISTDIR)/xlib
$(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(DISTDIR)/xlib
@@ -1655,7 +1688,7 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(MAC
done;)
$(INSTALL_DATA_DIR) $(DISTDIR)/doc
$(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(TOP_DIR)/doc/*.[13n] \
- $(TCLDIR)/doc/man.macros $(DISTDIR)/doc
+ $(TOP_DIR)/doc/man.macros $(DISTDIR)/doc
$(INSTALL_DATA_DIR) $(DISTDIR)/tests
$(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(TEST_DIR)/*.{test,tcl} \
$(TEST_DIR)/README $(TEST_DIR)/*.{gif,png,ppm,xbm} \
diff --git a/unix/README b/unix/README
index ea5c8fe..d4be49d 100644
--- a/unix/README
+++ b/unix/README
@@ -6,11 +6,11 @@ versions of Tk. This directory also contains source files for Tk that are
specific to UNIX.
The information in this file is maintained at:
- http://www.tcl.tk/doc/howto/compile.html
+ https://www.tcl-lang.org//doc/howto/compile.html
For information on platforms where Tcl/Tk is known to compile, along with any
porting notes for getting it to work on those platforms, see:
- http://www.tcl.tk/software/tcltk/platforms.html
+ https://www.tcl-lang.org//software/tcltk/platforms.html
The rest of this file contains instructions on how to do this. The release
should compile and run either "out of the box" or with trivial changes on any
diff --git a/unix/configure b/unix/configure
index cf5ce30..dceb0a1 100755
--- a/unix/configure
+++ b/unix/configure
@@ -661,6 +661,8 @@ TK_PATCH_LEVEL
TK_MINOR_VERSION
TK_MAJOR_VERSION
TK_VERSION
+TK_DEMO_DIR
+DEMO_DIR
UNIX_FONT_OBJS
XFT_LIBS
XFT_CFLAGS
@@ -692,13 +694,13 @@ PLAT_OBJS
DL_OBJS
DL_LIBS
TCL_LIBS
+EGREP
+GREP
+CPP
LIBOBJS
AR
RANLIB
SHARED_BUILD
-EGREP
-GREP
-CPP
OBJEXT
EXEEXT
ac_ct_CC
@@ -765,6 +767,7 @@ with_tcl
enable_man_symlinks
enable_man_compression
enable_man_suffix
+with_encoding
enable_shared
enable_64bit
enable_64bit_vis
@@ -1427,6 +1430,8 @@ Optional Packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-tcl directory containing tcl configuration
(tclConfig.sh)
+ --with-encoding encoding for configuration values (default:
+ iso8859-1)
--with-x use the X Window System
Some influential environment variables:
@@ -1558,6 +1563,52 @@ fi
} # ac_fn_c_try_compile
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
# ac_fn_c_try_cpp LINENO
# ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
@@ -1755,52 +1806,6 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_c_check_header_compile
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -2280,7 +2285,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
TK_VERSION=8.7
TK_MAJOR_VERSION=8
TK_MINOR_VERSION=7
-TK_PATCH_LEVEL="a2"
+TK_PATCH_LEVEL="a4"
VERSION=${TK_VERSION}
LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv"
@@ -2355,7 +2360,6 @@ $as_echo "$as_me: WARNING: --with-tcl argument should refer to directory contain
for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
`ls -d /Library/Frameworks 2>/dev/null` \
`ls -d /Network/Library/Frameworks 2>/dev/null` \
- `ls -d /System/Library/Frameworks 2>/dev/null` \
; do
if test -f "$i/Tcl.framework/tclConfig.sh" ; then
ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`"
@@ -2372,6 +2376,7 @@ $as_echo "$as_me: WARNING: --with-tcl argument should refer to directory contain
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/pkg/lib 2>/dev/null` \
+ `ls -d /usr/lib/tcl8.7 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
`ls -d /usr/local/lib/tcl8.7 2>/dev/null` \
@@ -2425,10 +2430,6 @@ $as_echo "loading" >&6; }
$as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
fi
- # eval is required to do the TCL_DBGX substitution
- eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
- eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
-
# If the TCL_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable TCL_LIB_SPEC will be set to the value
@@ -2462,12 +2463,6 @@ $as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
esac
fi
- # eval is required to do the TCL_DBGX substitution
- eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
- eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
- eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
- eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
-
@@ -3457,11 +3452,201 @@ _ACEOF
esac
+#------------------------------------------------------------------------
+# If we're using GCC, see if the compiler understands -pipe. If so, use it.
+# It makes compiling go faster. (This is only a performance feature.)
+#------------------------------------------------------------------------
+
+if test -z "$no_pipe" && test -n "$GCC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5
+$as_echo_n "checking if the compiler understands -pipe... " >&6; }
+if ${tcl_cv_cc_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_cc_pipe=yes
+else
+ tcl_cv_cc_pipe=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5
+$as_echo "$tcl_cv_cc_pipe" >&6; }
+ if test $tcl_cv_cc_pipe = yes; then
+ CFLAGS="$CFLAGS -pipe"
+ fi
+fi
+
+#------------------------------------------------------------------------
+# Embedded configuration information, encoding to use for the values, TIP #59
+#------------------------------------------------------------------------
+
+
+
+# Check whether --with-encoding was given.
+if test "${with_encoding+set}" = set; then :
+ withval=$with_encoding; with_tcencoding=${withval}
+fi
+
+
+ if test x"${with_tcencoding}" != x ; then
+
+cat >>confdefs.h <<_ACEOF
+#define TCL_CFGVAL_ENCODING "${with_tcencoding}"
+_ACEOF
+
+ else
+
+$as_echo "#define TCL_CFGVAL_ENCODING \"iso8859-1\"" >>confdefs.h
+
+ fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5
+$as_echo_n "checking how to build libraries... " >&6; }
+ # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; tcl_ok=$enableval
+else
+ tcl_ok=yes
+fi
+
+
+ if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ tcl_ok=$enableval
+ else
+ tcl_ok=yes
+ fi
+
+ if test "$tcl_ok" = "yes" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
+$as_echo "shared" >&6; }
+ SHARED_BUILD=1
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
+$as_echo "static" >&6; }
+ SHARED_BUILD=0
+
+$as_echo "#define STATIC_BUILD 1" >>confdefs.h
+
+ fi
+
+
+
#--------------------------------------------------------------------
-# Supply a substitute for stdlib.h if it doesn't define strtol,
-# strtoul, or strtod (which it doesn't in some versions of SunOS).
+# The statements below define a collection of compile flags. This
+# macro depends on the value of SHARED_BUILD, and should be called
+# after SC_ENABLE_SHARED checks the configure switches.
#--------------------------------------------------------------------
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3859,229 +4044,6 @@ fi
done
-ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = xyes; then :
- tk_ok=1
-else
- tk_ok=0
-fi
-
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "strtol" >/dev/null 2>&1; then :
-
-else
- tk_ok=0
-fi
-rm -f conftest*
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "strtoul" >/dev/null 2>&1; then :
-
-else
- tk_ok=0
-fi
-rm -f conftest*
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "strtod" >/dev/null 2>&1; then :
-
-else
- tk_ok=0
-fi
-rm -f conftest*
-
-if test $tk_ok = 0; then
-
-$as_echo "#define NO_STDLIB_H 1" >>confdefs.h
-
-fi
-
-#------------------------------------------------------------------------
-# If we're using GCC, see if the compiler understands -pipe. If so, use it.
-# It makes compiling go faster. (This is only a performance feature.)
-#------------------------------------------------------------------------
-
-if test -z "$no_pipe" && test -n "$GCC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5
-$as_echo_n "checking if the compiler understands -pipe... " >&6; }
-if ${tcl_cv_cc_pipe+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- tcl_cv_cc_pipe=yes
-else
- tcl_cv_cc_pipe=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS=$hold_cflags
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5
-$as_echo "$tcl_cv_cc_pipe" >&6; }
- if test $tcl_cv_cc_pipe = yes; then
- CFLAGS="$CFLAGS -pipe"
- fi
-fi
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5
-$as_echo_n "checking how to build libraries... " >&6; }
- # Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
- enableval=$enable_shared; tcl_ok=$enableval
-else
- tcl_ok=yes
-fi
-
-
- if test "${enable_shared+set}" = set; then
- enableval="$enable_shared"
- tcl_ok=$enableval
- else
- tcl_ok=yes
- fi
-
- if test "$tcl_ok" = "yes" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
-$as_echo "shared" >&6; }
- SHARED_BUILD=1
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
-$as_echo "static" >&6; }
- SHARED_BUILD=0
-
-$as_echo "#define STATIC_BUILD 1" >>confdefs.h
-
- fi
-
-
-
-#--------------------------------------------------------------------
-# The statements below define a collection of compile flags. This
-# macro depends on the value of SHARED_BUILD, and should be called
-# after SC_ENABLE_SHARED checks the configure switches.
-#--------------------------------------------------------------------
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
# Step 0.a: Enable 64 bit support?
@@ -4197,6 +4159,9 @@ $as_echo "$as_me: WARNING: can't find uname command" >&2;}
if test "`uname -s`" = "AIX" ; then
tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
fi
+ if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then
+ tcl_cv_sys_version=NetBSD-Debian
+ fi
fi
fi
@@ -4274,7 +4239,15 @@ fi
if test "$GCC" = yes; then :
CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wdeclaration-after-statement -Wpointer-arith"
+ CFLAGS_WARNING="-Wall -Wextra -Wwrite-strings -Wpointer-arith"
+ case "${CC}" in
+ *++)
+ ;;
+ *)
+ CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -Wdeclaration-after-statement"
+ ;;
+ esac
+
else
@@ -4551,7 +4524,7 @@ fi
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
TCL_NEEDS_EXP_FILE=1
- TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a'
+ TCL_EXPORT_FILE_SUFFIX='${VERSION}.dll.a'
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$@.a"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cygwin version of gcc" >&5
$as_echo_n "checking for Cygwin version of gcc... " >&6; }
@@ -4754,7 +4727,7 @@ fi
SHLIB_LD='${CC} -shared'
if test $doRpath = yes; then :
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
fi
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
;;
@@ -4844,7 +4817,7 @@ esac
if test $doRpath = yes; then :
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
fi
;;
@@ -4862,7 +4835,7 @@ esac
if test $doRpath = yes; then :
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
fi
if test "$GCC" = yes; then :
@@ -4899,7 +4872,7 @@ esac
if test $doRpath = yes; then :
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
fi
@@ -4939,7 +4912,7 @@ fi
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
if test $doRpath = yes; then :
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
fi
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
if test "`uname -m`" = "alpha"; then :
@@ -4987,7 +4960,7 @@ fi
fi
# The combo of gcc + glibc has a bug related to inlining of
- # functions like strtod(). The -fno-builtin flag should address
+ # functions like strtol()/strtoul(). The -fno-builtin flag should address
# this problem but it does not work. The -fno-inline flag is kind
# of overkill but it works. Disable inlining only when one of the
# files in compat/*.c is being linked in.
@@ -5006,8 +4979,8 @@ fi
LD_FLAGS="-Wl,--export-dynamic"
if test $doRpath = yes; then :
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
fi
;;
OpenBSD-*)
@@ -5026,7 +4999,7 @@ fi
DL_LIBS=""
if test $doRpath = yes; then :
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
fi
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
@@ -5050,7 +5023,7 @@ fi
LDFLAGS="$LDFLAGS -export-dynamic"
if test $doRpath = yes; then :
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
fi
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
# The -pthread needs to go in the CFLAGS, not LIBS
@@ -5066,11 +5039,10 @@ fi
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- LDFLAGS=""
if test $doRpath = yes; then :
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
fi
# The -pthread needs to go in the LDFLAGS, not LIBS
LIBS=`echo $LIBS | sed s/-pthread//`
@@ -5229,12 +5201,6 @@ fi
SHLIB_SUFFIX=".dylib"
DL_OBJS="tclLoadDyld.o"
DL_LIBS=""
- # Don't use -prebind when building for Mac OS X 10.4 or later only:
- if test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \
- "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then :
-
- LDFLAGS="$LDFLAGS -prebind"
-fi
LDFLAGS="$LDFLAGS -headerpad_max_install_names"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5
$as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; }
@@ -5276,6 +5242,7 @@ fi
$as_echo "#define MODULE_SCOPE __private_extern__" >>confdefs.h
+ tcl_cv_cc_visibility_hidden=yes
fi
CC_SEARCH_FLAGS=""
@@ -5427,7 +5394,7 @@ fi
DL_LIBS=""
if test $doRpath = yes; then :
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
fi
if test "$GCC" = yes; then :
@@ -5470,13 +5437,13 @@ fi
# below.
if test "$GCC" = yes; then :
- SHLIB_CFLAGS="-fPIC -melf"
- LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
+ SHLIB_CFLAGS="-fPIC -melf"
+ LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
else
- SHLIB_CFLAGS="-Kpic -belf"
- LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
+ SHLIB_CFLAGS="-Kpic -belf"
+ LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
fi
SHLIB_LD="ld -G"
@@ -5827,7 +5794,7 @@ fi
if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""; then :
LIB_SUFFIX=${SHARED_LIB_SUFFIX}
- MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
+ MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${LDFLAGS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
if test "${SHLIB_SUFFIX}" = ".dll"; then :
INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;'
@@ -5916,6 +5883,15 @@ $as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h
fi
+ ac_fn_c_check_header_mongrel "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdbool_h" = xyes; then :
+
+$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
+
+fi
+
+
+
# FIXME: This subst was left in only because the TCL_DL_LIBS
# entry in tclConfig.sh uses it. It is not clear why someone
# would use TCL_DL_LIBS instead of TCL_LIBS.
@@ -5968,7 +5944,6 @@ else
fi
# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
- DBGX=""
if test "$tcl_ok" = "no"; then
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
@@ -7684,8 +7659,8 @@ $as_echo "$enable_xft" >&6; }
XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no"
if test "$found_xft" = "no" ; then
found_xft=yes
- XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no"
- XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no"
+ XFT_CFLAGS=`pkg-config --cflags xft fontconfig 2>/dev/null` || found_xft="no"
+ XFT_LIBS=`pkg-config --libs xft fontconfig 2>/dev/null` || found_xft="no"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_xft" >&5
$as_echo "$found_xft" >&6; }
@@ -7841,130 +7816,6 @@ $as_echo "#define HAVE_XFT 1" >>confdefs.h
fi
#--------------------------------------------------------------------
-# Check for XkbKeycodeToKeysym.
-#--------------------------------------------------------------------
-
-if test $tk_aqua = no; then
- tk_oldCFlags=$CFLAGS
- tk_oldLibs=$LIBS
- CFLAGS="$CFLAGS $XINCLUDES"
- LIBS="$LIBS $XLIBSW"
- ac_fn_c_check_header_compile "$LINENO" "X11/XKBlib.h" "ac_cv_header_X11_XKBlib_h" "#include <X11/Xlib.h>
-"
-if test "x$ac_cv_header_X11_XKBlib_h" = xyes; then :
-
- xkblib_header_found=yes
-
-else
-
- xkblib_header_found=no
-
-fi
-
-
- if test $xkblib_header_found = "yes" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XkbKeycodeToKeysym in -lX11" >&5
-$as_echo_n "checking for XkbKeycodeToKeysym in -lX11... " >&6; }
-if ${ac_cv_lib_X11_XkbKeycodeToKeysym+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lX11 $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XkbKeycodeToKeysym ();
-int
-main ()
-{
-return XkbKeycodeToKeysym ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_X11_XkbKeycodeToKeysym=yes
-else
- ac_cv_lib_X11_XkbKeycodeToKeysym=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XkbKeycodeToKeysym" >&5
-$as_echo "$ac_cv_lib_X11_XkbKeycodeToKeysym" >&6; }
-if test "x$ac_cv_lib_X11_XkbKeycodeToKeysym" = xyes; then :
-
- xkbkeycodetokeysym_found=yes
-
-else
-
- xkbkeycodetokeysym_found=no
-
-fi
-
- else
- xkbkeycodetokeysym_found=no
- fi
- if test $xkbkeycodetokeysym_found = "yes" ; then
-
-$as_echo "#define HAVE_XKBKEYCODETOKEYSYM 1" >>confdefs.h
-
- fi
- CFLAGS=$tk_oldCFlags
- LIBS=$tk_oldLibs
-fi
-
-#--------------------------------------------------------------------
-# Check whether XKeycodeToKeysym is deprecated in X11 headers.
-#--------------------------------------------------------------------
-
-if test $tk_aqua = no && test "$GCC" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether XKeycodeToKeysym is deprecated" >&5
-$as_echo_n "checking whether XKeycodeToKeysym is deprecated... " >&6; }
- tk_oldCFlags=$CFLAGS
- CFLAGS="$CFLAGS -Werror"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #include <X11/Xlib.h>
-
-int
-main ()
-{
-
- XKeycodeToKeysym(0,0,0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define XKEYCODETOKEYSYM_IS_DEPRECATED 1" >>confdefs.h
-
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- CFLAGS=$tk_oldCFlags
-fi
-
-#--------------------------------------------------------------------
# XXX Do this last.
# It might modify XLIBSW which could affect other tests.
#
@@ -8175,7 +8026,7 @@ if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then
TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
fi
-TK_LIBRARY='$(prefix)/lib/tk$(VERSION)'
+test -z "$TK_LIBRARY" && TK_LIBRARY='$(prefix)/lib/tk$(VERSION)'
PRIVATE_INCLUDE_DIR='$(includedir)'
HTML_DIR='$(DISTDIR)/html'
TK_PKG_DIR='tk$(VERSION)'
@@ -8327,6 +8178,18 @@ TK_STUB_LIB_PATH="${TK_STUB_LIB_DIR}/${TK_STUB_LIB_FILE}"
eval "TK_INCLUDE_SPEC=\"-I${includedir}\""
#------------------------------------------------------------------------
+# Demo dir
+#------------------------------------------------------------------------
+
+if test x"${DEMO_DIR}" = x; then :
+ DEMO_DIR='$(TK_LIBRARY)/demos'
+fi
+eval "TK_DEMO_DIR=\"`echo ${DEMO_DIR} | tr '()' '{}'`\""
+eval "TK_DEMO_DIR=\"`echo ${TK_DEMO_DIR} | tr '()' '{}'`\""
+
+
+
+#------------------------------------------------------------------------
# tkConfig.sh refers to this by a different name
#------------------------------------------------------------------------
diff --git a/unix/configure.ac b/unix/configure.ac
index 5f5213d..b765f13 100644
--- a/unix/configure.ac
+++ b/unix/configure.ac
@@ -25,7 +25,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [
TK_VERSION=8.7
TK_MAJOR_VERSION=8
TK_MINOR_VERSION=7
-TK_PATCH_LEVEL="a2"
+TK_PATCH_LEVEL="a4"
VERSION=${TK_VERSION}
LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv"
@@ -83,19 +83,6 @@ fi
AC_PROG_CC
AC_C_INLINE
-#--------------------------------------------------------------------
-# Supply a substitute for stdlib.h if it doesn't define strtol,
-# strtoul, or strtod (which it doesn't in some versions of SunOS).
-#--------------------------------------------------------------------
-
-AC_CHECK_HEADER(stdlib.h, tk_ok=1, tk_ok=0)
-AC_EGREP_HEADER(strtol, stdlib.h, , tk_ok=0)
-AC_EGREP_HEADER(strtoul, stdlib.h, , tk_ok=0)
-AC_EGREP_HEADER(strtod, stdlib.h, , tk_ok=0)
-if test $tk_ok = 0; then
- AC_DEFINE(NO_STDLIB_H, 1, [Do we have <stdlib.h>?])
-fi
-
#------------------------------------------------------------------------
# If we're using GCC, see if the compiler understands -pipe. If so, use it.
# It makes compiling go faster. (This is only a performance feature.)
@@ -112,6 +99,12 @@ if test -z "$no_pipe" && test -n "$GCC"; then
fi
fi
+#------------------------------------------------------------------------
+# Embedded configuration information, encoding to use for the values, TIP #59
+#------------------------------------------------------------------------
+
+SC_TCL_CFG_ENCODING
+
SC_ENABLE_SHARED
#--------------------------------------------------------------------
@@ -463,8 +456,8 @@ if test $tk_aqua = no; then
XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no"
if test "$found_xft" = "no" ; then
found_xft=yes
- XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no"
- XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no"
+ XFT_CFLAGS=`pkg-config --cflags xft fontconfig 2>/dev/null` || found_xft="no"
+ XFT_LIBS=`pkg-config --libs xft fontconfig 2>/dev/null` || found_xft="no"
fi
AC_MSG_RESULT([$found_xft])
dnl make sure that compiling against Xft header file doesn't bomb
@@ -527,57 +520,6 @@ if test $tk_aqua = no; then
fi
#--------------------------------------------------------------------
-# Check for XkbKeycodeToKeysym.
-#--------------------------------------------------------------------
-
-if test $tk_aqua = no; then
- tk_oldCFlags=$CFLAGS
- tk_oldLibs=$LIBS
- CFLAGS="$CFLAGS $XINCLUDES"
- LIBS="$LIBS $XLIBSW"
- AC_CHECK_HEADER(X11/XKBlib.h, [
- xkblib_header_found=yes
- ], [
- xkblib_header_found=no
- ], [#include <X11/Xlib.h>])
- if test $xkblib_header_found = "yes" ; then
- AC_CHECK_LIB(X11, XkbKeycodeToKeysym, [
- xkbkeycodetokeysym_found=yes
- ], [
- xkbkeycodetokeysym_found=no
- ])
- else
- xkbkeycodetokeysym_found=no
- fi
- if test $xkbkeycodetokeysym_found = "yes" ; then
- AC_DEFINE(HAVE_XKBKEYCODETOKEYSYM, 1, [Do we have XkbKeycodeToKeysym?])
- fi
- CFLAGS=$tk_oldCFlags
- LIBS=$tk_oldLibs
-fi
-
-#--------------------------------------------------------------------
-# Check whether XKeycodeToKeysym is deprecated in X11 headers.
-#--------------------------------------------------------------------
-
-if test $tk_aqua = no && test "$GCC" = yes; then
- AC_MSG_CHECKING([whether XKeycodeToKeysym is deprecated])
- tk_oldCFlags=$CFLAGS
- CFLAGS="$CFLAGS -Werror"
- AC_TRY_LINK([
- #include <X11/Xlib.h>
- ], [
- XKeycodeToKeysym(0,0,0);
- ], [
- AC_MSG_RESULT([no])
- ], [
- AC_MSG_RESULT([yes])
- AC_DEFINE(XKEYCODETOKEYSYM_IS_DEPRECATED, 1, [Is XKeycodeToKeysym deprecated?])
- ])
- CFLAGS=$tk_oldCFlags
-fi
-
-#--------------------------------------------------------------------
# XXX Do this last.
# It might modify XLIBSW which could affect other tests.
#
@@ -656,7 +598,7 @@ if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then
TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
fi
-TK_LIBRARY='$(prefix)/lib/tk$(VERSION)'
+test -z "$TK_LIBRARY" && TK_LIBRARY='$(prefix)/lib/tk$(VERSION)'
PRIVATE_INCLUDE_DIR='$(includedir)'
HTML_DIR='$(DISTDIR)/html'
TK_PKG_DIR='tk$(VERSION)'
@@ -773,6 +715,16 @@ TK_STUB_LIB_PATH="${TK_STUB_LIB_DIR}/${TK_STUB_LIB_FILE}"
eval "TK_INCLUDE_SPEC=\"-I${includedir}\""
#------------------------------------------------------------------------
+# Demo dir
+#------------------------------------------------------------------------
+
+AS_IF([test x"${DEMO_DIR}" = x], [DEMO_DIR='$(TK_LIBRARY)/demos'])
+eval "TK_DEMO_DIR=\"`echo ${DEMO_DIR} | tr '()' '{}'`\""
+eval "TK_DEMO_DIR=\"`echo ${TK_DEMO_DIR} | tr '()' '{}'`\""
+AC_SUBST(DEMO_DIR)
+AC_SUBST(TK_DEMO_DIR)
+
+#------------------------------------------------------------------------
# tkConfig.sh refers to this by a different name
#------------------------------------------------------------------------
diff --git a/unix/installManPage b/unix/installManPage
index 4d615bf..935bbcd 100755
--- a/unix/installManPage
+++ b/unix/installManPage
@@ -92,12 +92,20 @@ case $ManPage in
exit 2 ;;
esac
+Name=`basename $ManPage .$Section`
SrcDir=`dirname $ManPage`
########################################################################
### Process Page to Create Target Pages
###
+Specials="FindPhoto FontId MeasureChar"
+for n in $Specials; do
+ if [ "$Name" = "$n" ] ; then
+ Names="$n $Names"
+ fi
+done
+
First=""
for Target in $Names; do
Target=$Target.$Section$Suffix
@@ -106,7 +114,7 @@ for Target in $Names; do
First=$Target
sed -e "/man\.macros/r $SrcDir/man.macros" -e "/man\.macros/d" \
$ManPage > $Dir/$First
- chmod 444 $Dir/$First
+ chmod 644 $Dir/$First
$Gzip $Dir/$First
else
ln $SymOrLoc$First$Gz $Dir/$Target$Gz
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 2f114d7..0a2920b 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -77,7 +77,6 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
`ls -d /Library/Frameworks 2>/dev/null` \
`ls -d /Network/Library/Frameworks 2>/dev/null` \
- `ls -d /System/Library/Frameworks 2>/dev/null` \
; do
if test -f "$i/Tcl.framework/tclConfig.sh" ; then
ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`"
@@ -94,6 +93,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/pkg/lib 2>/dev/null` \
+ `ls -d /usr/lib/tcl8.7 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
`ls -d /usr/local/lib/tcl8.7 2>/dev/null` \
@@ -210,7 +210,6 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
`ls -d /Library/Frameworks 2>/dev/null` \
`ls -d /Network/Library/Frameworks 2>/dev/null` \
- `ls -d /System/Library/Frameworks 2>/dev/null` \
; do
if test -f "$i/Tk.framework/tkConfig.sh" ; then
ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`"
@@ -227,6 +226,7 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/pkg/lib 2>/dev/null` \
+ `ls -d /usr/lib/tk8.7 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
`ls -d /usr/local/lib/tk8.7 2>/dev/null` \
@@ -293,10 +293,6 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [
AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
fi
- # eval is required to do the TCL_DBGX substitution
- eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
- eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
-
# If the TCL_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable TCL_LIB_SPEC will be set to the value
@@ -330,12 +326,6 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [
esac
fi
- # eval is required to do the TCL_DBGX substitution
- eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
- eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
- eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
- eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
-
AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_PATCH_LEVEL)
AC_SUBST(TCL_BIN_DIR)
@@ -376,10 +366,6 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [
AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
fi
- # eval is required to do the TK_DBGX substitution
- eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
- eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
-
# If the TK_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable TK_LIB_SPEC will be set to the value
@@ -413,12 +399,6 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [
esac
fi
- # eval is required to do the TK_DBGX substitution
- eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
- eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
- eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
- eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
-
AC_SUBST(TK_VERSION)
AC_SUBST(TK_BIN_DIR)
AC_SUBST(TK_SRC_DIR)
@@ -624,8 +604,6 @@ AC_DEFUN([SC_ENABLE_FRAMEWORK], [
# Sets to $(CFLAGS_OPTIMIZE) if false
# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
# Sets to $(LDFLAGS_OPTIMIZE) if false
-# DBGX Formerly used as debug library extension;
-# always blank now.
#------------------------------------------------------------------------
AC_DEFUN([SC_ENABLE_SYMBOLS], [
@@ -635,7 +613,6 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [
[build with debugging symbols (default: off)]),
[tcl_ok=$enableval], [tcl_ok=no])
# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
- DBGX=""
if test "$tcl_ok" = "no"; then
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
@@ -814,6 +791,9 @@ AC_DEFUN([SC_CONFIG_SYSTEM], [
if test "`uname -s`" = "AIX" ; then
tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
fi
+ if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then
+ tcl_cv_sys_version=NetBSD-Debian
+ fi
fi
fi
])
@@ -986,7 +966,15 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_DEBUG=-g
AS_IF([test "$GCC" = yes], [
CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wdeclaration-after-statement -Wpointer-arith"
+ CFLAGS_WARNING="-Wall -Wextra -Wwrite-strings -Wpointer-arith"
+ case "${CC}" in
+ *++)
+ ;;
+ *)
+ CFLAGS_WARNING="${CFLAGS_WARNING} -Wc++-compat -Wdeclaration-after-statement"
+ ;;
+ esac
+
], [
CFLAGS_OPTIMIZE=-O
CFLAGS_WARNING=""
@@ -1106,7 +1094,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
TCL_NEEDS_EXP_FILE=1
- TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a'
+ TCL_EXPORT_FILE_SUFFIX='${VERSION}.dll.a'
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$[@].a"
AC_CACHE_CHECK(for Cygwin version of gcc,
ac_cv_cygwin,
@@ -1192,7 +1180,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
do64bit_ok=yes
SHLIB_LD='${CC} -shared'
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
;;
*)
@@ -1227,7 +1215,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_LIBS=""
AC_LIBOBJ(mkstemp)
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
;;
IRIX-6.*)
@@ -1238,7 +1226,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_LIBS=""
AC_LIBOBJ(mkstemp)
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
AS_IF([test "$GCC" = yes], [
CFLAGS="$CFLAGS -mabi=n32"
@@ -1264,7 +1252,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_LIBS=""
AC_LIBOBJ(mkstemp)
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
# Check to enable 64-bit flags for compiler/linker
@@ -1295,7 +1283,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"])
AS_IF([test $do64bit = yes], [
@@ -1311,7 +1299,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
])
# The combo of gcc + glibc has a bug related to inlining of
- # functions like strtod(). The -fno-builtin flag should address
+ # functions like strtol()/strtoul(). The -fno-builtin flag should address
# this problem but it does not work. The -fno-inline flag is kind
# of overkill but it works. Disable inlining only when one of the
# files in compat/*.c is being linked in.
@@ -1327,8 +1315,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_LIBS="-mshared -ldl"
LD_FLAGS="-Wl,--export-dynamic"
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
;;
OpenBSD-*)
arch=`arch -s`
@@ -1345,7 +1333,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
LDFLAGS="-Wl,-export-dynamic"
@@ -1367,7 +1355,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_LIBS=""
LDFLAGS="$LDFLAGS -export-dynamic"
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
# The -pthread needs to go in the CFLAGS, not LIBS
LIBS=`echo $LIBS | sed s/-pthread//`
@@ -1382,10 +1370,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- LDFLAGS=""
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
+ LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
# The -pthread needs to go in the LDFLAGS, not LIBS
LIBS=`echo $LIBS | sed s/-pthread//`
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
@@ -1459,10 +1446,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
SHLIB_SUFFIX=".dylib"
DL_OBJS="tclLoadDyld.o"
DL_LIBS=""
- # Don't use -prebind when building for Mac OS X 10.4 or later only:
- AS_IF([test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \
- "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4], [
- LDFLAGS="$LDFLAGS -prebind"])
LDFLAGS="$LDFLAGS -headerpad_max_install_names"
AC_CACHE_CHECK([if ld accepts -search_paths_first flag],
tcl_cv_ld_search_paths_first, [
@@ -1477,6 +1460,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
AC_DEFINE(MODULE_SCOPE, [__private_extern__],
[Compiler support for module scope symbols])
+ tcl_cv_cc_visibility_hidden=yes
])
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
@@ -1556,7 +1540,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
AS_IF([test $doRpath = yes], [
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [
CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"])
@@ -1589,11 +1573,11 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
# this test works, since "uname -s" was non-standard in 3.2.4 and
# below.
AS_IF([test "$GCC" = yes], [
- SHLIB_CFLAGS="-fPIC -melf"
- LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
+ SHLIB_CFLAGS="-fPIC -melf"
+ LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
], [
- SHLIB_CFLAGS="-Kpic -belf"
- LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
+ SHLIB_CFLAGS="-Kpic -belf"
+ LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
])
SHLIB_LD="ld -G"
SHLIB_LD_LIBS=""
@@ -1822,7 +1806,7 @@ dnl # preprocessing tests use only CPPFLAGS.
AS_IF([test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""], [
LIB_SUFFIX=${SHARED_LIB_SUFFIX}
- MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
+ MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${LDFLAGS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
AS_IF([test "${SHLIB_SUFFIX}" = ".dll"], [
INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;'
DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)"
@@ -1874,6 +1858,8 @@ dnl # preprocessing tests use only CPPFLAGS.
[Defined when compiler supports casting to union type.])
fi
+ AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, [Do we have <stdbool.h>?])],)
+
# FIXME: This subst was left in only because the TCL_DL_LIBS
# entry in tclConfig.sh uses it. It is not clear why someone
# would use TCL_DL_LIBS instead of TCL_LIBS.
@@ -1917,8 +1903,8 @@ dnl # preprocessing tests use only CPPFLAGS.
#
# Supply substitutes for missing POSIX header files. Special
# notes:
-# - stdlib.h doesn't define strtol, strtoul, or
-# strtod insome versions of SunOS
+# - stdlib.h doesn't define strtol or strtoul in some
+# versions of SunOS
# - some versions of string.h don't declare procedures such
# as strstr
#
@@ -1934,7 +1920,6 @@ dnl # preprocessing tests use only CPPFLAGS.
# NO_SYS_WAIT_H
# NO_DLFCN_H
# HAVE_SYS_PARAM_H
-#
# HAVE_STRING_H ?
#
#--------------------------------------------------------------------
@@ -1969,7 +1954,6 @@ closedir(d);
AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0)
- AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0)
if test $tcl_ok = 0; then
AC_DEFINE(NO_STDLIB_H, 1, [Do we have <stdlib.h>?])
fi
@@ -2523,7 +2507,20 @@ AC_DEFUN([SC_TCL_CHECK_BROKEN_FUNC],[
#
#--------------------------------------------------------------------
-AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [AC_CHECK_FUNC(gethostbyaddr_r, [
+AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [
+ # Avoids picking hidden internal symbol from libc
+ SC_TCL_GETHOSTBYADDR_R_DECL
+
+ if test "$tcl_cv_api_gethostbyaddr_r" = yes; then
+ SC_TCL_GETHOSTBYADDR_R_TYPE
+ fi
+])
+
+AC_DEFUN([SC_TCL_GETHOSTBYADDR_R_DECL], [AC_CHECK_DECLS(gethostbyaddr_r, [
+ tcl_cv_api_gethostbyaddr_r=yes],[tcl_cv_api_gethostbyaddr_r=no],[#include <netdb.h>])
+])
+
+AC_DEFUN([SC_TCL_GETHOSTBYADDR_R_TYPE], [AC_CHECK_FUNC(gethostbyaddr_r, [
AC_CACHE_CHECK([for gethostbyaddr_r with 7 args], tcl_cv_api_gethostbyaddr_r_7, [
AC_TRY_COMPILE([
#include <netdb.h>
@@ -2584,14 +2581,27 @@ AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [AC_CHECK_FUNC(gethostbyaddr_r, [
# Results:
#
# Might define the following vars:
-# HAVE_GETHOSTBYADDR_R
-# HAVE_GETHOSTBYADDR_R_3
-# HAVE_GETHOSTBYADDR_R_5
-# HAVE_GETHOSTBYADDR_R_6
+# HAVE_GETHOSTBYNAME_R
+# HAVE_GETHOSTBYNAME_R_3
+# HAVE_GETHOSTBYNAME_R_5
+# HAVE_GETHOSTBYNAME_R_6
#
#--------------------------------------------------------------------
-AC_DEFUN([SC_TCL_GETHOSTBYNAME_R], [AC_CHECK_FUNC(gethostbyname_r, [
+AC_DEFUN([SC_TCL_GETHOSTBYNAME_R], [
+ # Avoids picking hidden internal symbol from libc
+ SC_TCL_GETHOSTBYNAME_R_DECL
+
+ if test "$tcl_cv_api_gethostbyname_r" = yes; then
+ SC_TCL_GETHOSTBYNAME_R_TYPE
+ fi
+])
+
+AC_DEFUN([SC_TCL_GETHOSTBYNAME_R_DECL], [AC_CHECK_DECLS(gethostbyname_r, [
+ tcl_cv_api_gethostbyname_r=yes],[tcl_cv_api_gethostbyname_r=no],[#include <netdb.h>])
+])
+
+AC_DEFUN([SC_TCL_GETHOSTBYNAME_R_TYPE], [AC_CHECK_FUNC(gethostbyname_r, [
AC_CACHE_CHECK([for gethostbyname_r with 6 args], tcl_cv_api_gethostbyname_r_6, [
AC_TRY_COMPILE([
#include <netdb.h>
@@ -3014,7 +3024,7 @@ AC_DEFUN([SC_ZIPFS_SUPPORT], [
ZIP_PROG="$ac_cv_path_zip"
AC_MSG_RESULT([$ZIP_PROG])
ZIP_PROG_OPTIONS="-rq"
- ZIP_PROG_VFSSEARCH="."
+ ZIP_PROG_VFSSEARCH="*"
AC_MSG_RESULT([Found INFO Zip in environment])
# Use standard arguments for zip
else
@@ -3022,7 +3032,7 @@ AC_DEFUN([SC_ZIPFS_SUPPORT], [
# We can use the locally distributed minizip instead
ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"
ZIP_PROG_OPTIONS="-o -r"
- ZIP_PROG_VFSSEARCH="."
+ ZIP_PROG_VFSSEARCH="*"
ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}"
AC_MSG_RESULT([No zip found on PATH. Building minizip])
fi
diff --git a/unix/tk.pc.in b/unix/tk.pc.in
index 68f2130..940184e 100644
--- a/unix/tk.pc.in
+++ b/unix/tk.pc.in
@@ -4,10 +4,11 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
+demodir=@TK_DEMO_DIR@
Name: The Tk Toolkit
Description: Tk is a cross-platform graphical user interface toolkit, the standard GUI not only for Tcl, but for many other dynamic languages as well.
-URL: http://www.tcl.tk/
+URL: https://www.tcl-lang.org/
Version: @TK_VERSION@@TK_PATCH_LEVEL@
Requires: tcl >= 8.6
Libs: -L${libdir} @TK_LIB_FLAG@ @TK_STUB_LIB_FLAG@
diff --git a/unix/tk.spec b/unix/tk.spec
index 590c2c0..be98664 100644
--- a/unix/tk.spec
+++ b/unix/tk.spec
@@ -4,12 +4,12 @@
Name: tk
Summary: Tk graphical toolkit for the Tcl scripting language.
-Version: 8.7a2
+Version: 8.7a4
Release: 2
License: BSD
Group: Development/Languages
Source: http://prdownloads.sourceforge.net/tcl/tk%{version}-src.tar.gz
-URL: http://www.tcl.tk/
+URL: https://www.tcl-lang.org/
Buildroot: /var/tmp/%{name}%{version}
Buildrequires: XFree86-devel tcl >= 8.6.0
Requires: tcl >= 8.6.0
diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c
index 91dcba7..9e6c112 100644
--- a/unix/tkAppInit.c
+++ b/unix/tkAppInit.c
@@ -17,7 +17,13 @@
#include "tk.h"
#ifdef TK_TEST
+#ifdef __cplusplus
+extern "C" {
+#endif
extern Tcl_PackageInitProc Tktest_Init;
+#ifdef __cplusplus
+}
+#endif
#endif /* TK_TEST */
/*
diff --git a/unix/tkConfig.h.in b/unix/tkConfig.h.in
index d598ca3..6753fb5 100644
--- a/unix/tkConfig.h.in
+++ b/unix/tkConfig.h.in
@@ -91,9 +91,6 @@
/* Have we turned on XFT (antialiased fonts)? */
#undef HAVE_XFT
-/* Do we have XkbKeycodeToKeysym? */
-#undef HAVE_XKBKEYCODETOKEYSYM
-
/* Is XScreenSaver available? */
#undef HAVE_XSS
@@ -136,6 +133,12 @@
/* Is this a static build? */
#undef STATIC_BUILD
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* What encoding should be used for embedded configuration info? */
+#undef TCL_CFGVAL_ENCODING
+
/* Is this a 64-bit build? */
#undef TCL_CFG_DO64BIT
@@ -176,9 +179,6 @@
first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
-/* Is XKeycodeToKeysym deprecated? */
-#undef XKEYCODETOKEYSYM_IS_DEPRECATED
-
/* Are Darwin SUSv3 extensions available? */
#undef _DARWIN_C_SOURCE
diff --git a/unix/tkConfig.sh.in b/unix/tkConfig.sh.in
index bb85ad0..e08861b 100644
--- a/unix/tkConfig.sh.in
+++ b/unix/tkConfig.sh.in
@@ -95,3 +95,6 @@ TK_BUILD_STUB_LIB_PATH='@TK_BUILD_STUB_LIB_PATH@'
# Path to the Tk stub library in the install directory.
TK_STUB_LIB_PATH='@TK_STUB_LIB_PATH@'
+
+# Top-level directory in which Tk's demo files are installed.
+TK_DEMO_DIR='@TK_DEMO_DIR@'
diff --git a/unix/tkUnix.c b/unix/tkUnix.c
index c6fff82..df70cb0 100644
--- a/unix/tkUnix.c
+++ b/unix/tkUnix.c
@@ -108,6 +108,11 @@ Tk_UpdatePointer(
int x, int y, /* Pointer location in root coords. */
int state) /* Modifier state mask. */
{
+ (void)tkwin;
+ (void)x;
+ (void)y;
+ (void)state;
+
/*
* This function intentionally left blank
*/
diff --git a/unix/tkUnix3d.c b/unix/tkUnix3d.c
index 2969de1..dfa08fb 100644
--- a/unix/tkUnix3d.c
+++ b/unix/tkUnix3d.c
@@ -46,7 +46,7 @@ typedef struct {
TkBorder *
TkpGetBorder(void)
{
- UnixBorder *borderPtr = ckalloc(sizeof(UnixBorder));
+ UnixBorder *borderPtr = (UnixBorder *)ckalloc(sizeof(UnixBorder));
borderPtr->solidGC = NULL;
return (TkBorder *) borderPtr;
@@ -443,7 +443,7 @@ TkpGetShadows(
}
if (borderPtr->shadow == None) {
- borderPtr->shadow = Tk_GetBitmap((Tcl_Interp *) NULL, tkwin,
+ borderPtr->shadow = Tk_GetBitmap(NULL, tkwin,
Tk_GetUid("gray50"));
if (borderPtr->shadow == None) {
Tcl_Panic("TkpGetShadows couldn't allocate bitmap for border");
diff --git a/unix/tkUnixButton.c b/unix/tkUnixButton.c
index 975fca8..8d13db7 100644
--- a/unix/tkUnixButton.c
+++ b/unix/tkUnixButton.c
@@ -173,7 +173,7 @@ TkpDrawCheckIndicator(
* Sanity check.
*/
- if (tkwin == NULL || display == None || d == None || bgBorder == NULL
+ if (tkwin == NULL || display == NULL || d == None || bgBorder == NULL
|| indicatorColor == NULL) {
return;
}
@@ -328,9 +328,9 @@ TkButton *
TkpCreateButton(
Tk_Window tkwin)
{
- UnixButton *butPtr = ckalloc(sizeof(UnixButton));
+ (void)tkwin;
- return (TkButton *) butPtr;
+ return (TkButton *)ckalloc(sizeof(UnixButton));
}
/*
@@ -396,7 +396,7 @@ void
TkpDisplayButton(
ClientData clientData) /* Information about widget. */
{
- register TkButton *butPtr = clientData;
+ TkButton *butPtr = (TkButton *)clientData;
GC gc;
Tk_3DBorder border;
Pixmap pixmap;
@@ -860,7 +860,7 @@ TkpDisplayButton(
void
TkpComputeButtonGeometry(
- register TkButton *butPtr) /* Button whose geometry may have changed. */
+ TkButton *butPtr) /* Button whose geometry may have changed. */
{
int width, height, avgWidth, txtWidth, txtHeight;
int haveImage = 0, haveText = 0;
diff --git a/unix/tkUnixColor.c b/unix/tkUnixColor.c
index 43500ad..a909fb3 100644
--- a/unix/tkUnixColor.c
+++ b/unix/tkUnixColor.c
@@ -85,7 +85,7 @@ TkpFreeColor(
*/
visual = tkColPtr->visual;
- if ((visual->class != StaticGray) && (visual->class != StaticColor)
+ if ((visual->c_class != StaticGray) && (visual->c_class != StaticColor)
&& (tkColPtr->color.pixel != BlackPixelOfScreen(screen))
&& (tkColPtr->color.pixel != WhitePixelOfScreen(screen))) {
Tk_ErrorHandler handler;
@@ -136,17 +136,17 @@ TkpGetColor(
if (*name != '#') {
XColor screen;
- if (((*name - 'A') & 0xdf) < sizeof(tkWebColors)/sizeof(tkWebColors[0])) {
- if (!((name[0] - 'G') & 0xdf) && !((name[1] - 'R') & 0xdf)
- && !((name[2] - 'A') & 0xdb) && !((name[3] - 'Y') & 0xdf)
+ if (((*name - 'A') & 0xDF) < sizeof(tkWebColors)/sizeof(tkWebColors[0])) {
+ if (!((name[0] - 'G') & 0xDF) && !((name[1] - 'R') & 0xDF)
+ && !((name[2] - 'A') & 0xDB) && !((name[3] - 'Y') & 0xDF)
&& !name[4]) {
name = "#808080808080";
goto gotWebColor;
} else {
- const char *p = tkWebColors[((*name - 'A') & 0x1f)];
+ const char *p = tkWebColors[((*name - 'A') & 0x1F)];
if (p) {
const char *q = name;
- while (!((*p - *(++q)) & 0xdf)) {
+ while (!((*p - *(++q)) & 0xDF)) {
if (!*p++) {
name = p;
goto gotWebColor;
@@ -157,7 +157,7 @@ TkpGetColor(
}
if (strlen(name) > 99) {
/* Don't bother to parse this. [Bug 2809525]*/
- return (TkColor *) NULL;
+ return NULL;
} else if (XAllocNamedColor(display, colormap, name, &screen, &color) != 0) {
DeleteStressedCmap(display, colormap);
} else {
@@ -185,7 +185,7 @@ TkpGetColor(
}
}
- tkColPtr = ckalloc(sizeof(TkColor));
+ tkColPtr = (TkColor *)ckalloc(sizeof(TkColor));
tkColPtr->color = color;
return tkColPtr;
@@ -220,7 +220,7 @@ TkpGetColorByValue(
{
Display *display = Tk_Display(tkwin);
Colormap colormap = Tk_Colormap(tkwin);
- TkColor *tkColPtr = ckalloc(sizeof(TkColor));
+ TkColor *tkColPtr = (TkColor *)ckalloc(sizeof(TkColor));
tkColPtr->color.red = colorPtr->red;
tkColPtr->color.green = colorPtr->green;
@@ -269,7 +269,7 @@ FindClosestColor(
XColor *colorPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
Colormap colormap = Tk_Colormap(tkwin);
- XVisualInfo template, *visInfoPtr;
+ XVisualInfo templ, *visInfoPtr;
/*
* Find the TkStressedCmap structure for this colormap, or create a new
@@ -278,19 +278,19 @@ FindClosestColor(
for (stressPtr = dispPtr->stressPtr; ; stressPtr = stressPtr->nextPtr) {
if (stressPtr == NULL) {
- stressPtr = ckalloc(sizeof(TkStressedCmap));
+ stressPtr = (TkStressedCmap *)ckalloc(sizeof(TkStressedCmap));
stressPtr->colormap = colormap;
- template.visualid = XVisualIDFromVisual(Tk_Visual(tkwin));
+ templ.visualid = XVisualIDFromVisual(Tk_Visual(tkwin));
visInfoPtr = XGetVisualInfo(Tk_Display(tkwin),
- VisualIDMask, &template, &numFound);
+ VisualIDMask, &templ, &numFound);
if (numFound < 1) {
Tcl_Panic("FindClosestColor couldn't lookup visual");
}
stressPtr->numColors = visInfoPtr->colormap_size;
XFree((char *) visInfoPtr);
- stressPtr->colorPtr =
+ stressPtr->colorPtr = (XColor *)
ckalloc(stressPtr->numColors * sizeof(XColor));
for (i = 0; i < stressPtr->numColors; i++) {
stressPtr->colorPtr[i].pixel = (unsigned long) i;
diff --git a/unix/tkUnixConfig.c b/unix/tkUnixConfig.c
index 3584494..acd8bb5 100644
--- a/unix/tkUnixConfig.c
+++ b/unix/tkUnixConfig.c
@@ -38,6 +38,10 @@ TkpGetSystemDefault(
const char *dbName, /* The option database name. */
const char *className) /* The name of the option class. */
{
+ (void)tkwin;
+ (void)dbName;
+ (void)className;
+
return NULL;
}
diff --git a/unix/tkUnixCursor.c b/unix/tkUnixCursor.c
index 8afb92d..bcd7cc3 100644
--- a/unix/tkUnixCursor.c
+++ b/unix/tkUnixCursor.c
@@ -245,7 +245,7 @@ TkGetCursorByName(
if ((argv[0][0] != '@') && !inTkTable) {
XColor fg, bg;
unsigned int maskIndex;
- register const struct CursorName *namePtr;
+ const struct CursorName *namePtr;
TkDisplay *dispPtr;
/*
@@ -338,7 +338,7 @@ TkGetCursorByName(
}
if (cursor != None) {
- cursorPtr = ckalloc(sizeof(TkUnixCursor));
+ cursorPtr = (TkUnixCursor *)ckalloc(sizeof(TkUnixCursor));
cursorPtr->info.cursor = (Tk_Cursor) cursor;
cursorPtr->display = display;
}
@@ -608,7 +608,7 @@ TkCreateCursorFromData(
Tk_FreePixmap(display, maskPixmap);
if (cursor != None) {
- cursorPtr = ckalloc(sizeof(TkUnixCursor));
+ cursorPtr = (TkUnixCursor *)ckalloc(sizeof(TkUnixCursor));
cursorPtr->info.cursor = (Tk_Cursor) cursor;
cursorPtr->display = display;
}
diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h
index bc7cd93..fa1f120 100644
--- a/unix/tkUnixDefault.h
+++ b/unix/tkUnixDefault.h
@@ -31,8 +31,7 @@
#define ACTIVE_BG "#ececec"
#define SELECT_BG "#c3c3c3"
#define TROUGH "#b3b3b3"
-#define CHECK_INDICATOR WHITE
-#define MENU_INDICATOR BLACK
+#define INDICATOR WHITE
#define DISABLED "#a3a3a3"
/*
@@ -79,7 +78,7 @@
#define DEF_LABCHKRAD_RELIEF "flat"
#define DEF_BUTTON_REPEAT_DELAY "0"
#define DEF_BUTTON_REPEAT_INTERVAL "0"
-#define DEF_BUTTON_SELECT_COLOR CHECK_INDICATOR
+#define DEF_BUTTON_SELECT_COLOR INDICATOR
#define DEF_BUTTON_SELECT_MONO BLACK
#define DEF_BUTTON_SELECT_IMAGE NULL
#define DEF_BUTTON_STATE "normal"
@@ -176,7 +175,9 @@
*/
#define DEF_FRAME_BG_COLOR NORMAL_BG
+#define DEF_FRAME_BG_IMAGE NULL
#define DEF_FRAME_BG_MONO WHITE
+#define DEF_FRAME_BG_TILE "0"
#define DEF_FRAME_BORDER_WIDTH "0"
#define DEF_FRAME_CLASS "Frame"
#define DEF_FRAME_COLORMAP ""
@@ -287,7 +288,7 @@
#define DEF_MENU_FG BLACK
#define DEF_MENU_POST_COMMAND ""
#define DEF_MENU_RELIEF "raised"
-#define DEF_MENU_SELECT_COLOR MENU_INDICATOR
+#define DEF_MENU_SELECT_COLOR BLACK
#define DEF_MENU_SELECT_MONO BLACK
#define DEF_MENU_TAKE_FOCUS "0"
#define DEF_MENU_TEAROFF "0"
@@ -518,6 +519,14 @@
#define DEF_CANVTEXT_FONT "TkDefaultFont"
/*
+ * Defaults for canvas items
+ * (arcs, bitmaps, lines, polygons, rectangles, and ovals):
+ */
+
+#define DEF_CANVBMAP_FG BLACK
+#define DEF_CANVITEM_OUTLINE BLACK
+
+/*
* Defaults for toplevels (most of the defaults for frames also apply
* to toplevels):
*/
diff --git a/unix/tkUnixDialog.c b/unix/tkUnixDialog.c
index afe443f..2f1f079 100644
--- a/unix/tkUnixDialog.c
+++ b/unix/tkUnixDialog.c
@@ -46,7 +46,7 @@ EvalObjv(
cmdObj = Tcl_NewStringObj(cmdName, -1);
Tcl_IncrRefCount(cmdObj);
- objs = ckalloc(sizeof(Tcl_Obj *) * (objc+1));
+ objs = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *) * (objc+1));
objs[0] = cmdObj;
memcpy(objs+1, objv, sizeof(Tcl_Obj *) * (unsigned)objc);
diff --git a/unix/tkUnixDraw.c b/unix/tkUnixDraw.c
index acc0565..fec05ee 100644
--- a/unix/tkUnixDraw.c
+++ b/unix/tkUnixDraw.c
@@ -24,7 +24,7 @@ typedef struct ScrollInfo {
int done; /* Flag is 0 until filtering is done. */
Display *display; /* Display to filter. */
Window window; /* Window to filter. */
- TkRegion region; /* Region into which damage is accumulated. */
+ Region region; /* Region into which damage is accumulated. */
int dx, dy; /* Amount by which window was shifted. */
} ScrollInfo;
@@ -61,7 +61,7 @@ TkScrollWindow(
int x, int y, int width, int height,
/* Position rectangle to be scrolled. */
int dx, int dy, /* Distance rectangle should be moved. */
- TkRegion damageRgn) /* Region to accumulate damage in. */
+ Region damageRgn) /* Region to accumulate damage in. */
{
Tk_RestrictProc *prevProc;
ClientData prevArg;
@@ -90,7 +90,7 @@ TkScrollWindow(
}
Tk_RestrictEvents(prevProc, prevArg, &prevArg);
- if (XEmptyRegion((Region) damageRgn)) {
+ if (XEmptyRegion(damageRgn)) {
return 0;
} else {
return 1;
@@ -141,8 +141,8 @@ ScrollRestrictProc(
rect.y = eventPtr->xgraphicsexpose.y;
rect.width = eventPtr->xgraphicsexpose.width;
rect.height = eventPtr->xgraphicsexpose.height;
- XUnionRectWithRegion(&rect, (Region) info->region,
- (Region) info->region);
+ XUnionRectWithRegion(&rect, info->region,
+ info->region);
if (eventPtr->xgraphicsexpose.count == 0) {
info->done = 1;
@@ -160,12 +160,12 @@ ScrollRestrictProc(
rect.y = eventPtr->xexpose.y;
rect.width = eventPtr->xexpose.width;
rect.height = eventPtr->xexpose.height;
- XUnionRectWithRegion(&rect, (Region) info->region,
- (Region) info->region);
+ XUnionRectWithRegion(&rect, info->region,
+ info->region);
rect.x += info->dx;
rect.y += info->dy;
- XUnionRectWithRegion(&rect, (Region) info->region,
- (Region) info->region);
+ XUnionRectWithRegion(&rect, info->region,
+ info->region);
} else {
return TK_DEFER_EVENT;
}
@@ -202,13 +202,15 @@ TkpDrawHighlightBorder(
int highlightWidth,
Drawable drawable)
{
+ (void)bgGC;
+
TkDrawInsetFocusHighlight(tkwin, fgGC, highlightWidth, drawable, 0);
}
/*
*----------------------------------------------------------------------
*
- * TkpDrawFrame --
+ * TkpDrawFrameEx --
*
* This function draws the rectangular frame area.
*
@@ -222,14 +224,15 @@ TkpDrawHighlightBorder(
*/
void
-TkpDrawFrame(
+TkpDrawFrameEx(
Tk_Window tkwin,
+ Drawable drawable,
Tk_3DBorder border,
int highlightWidth,
int borderWidth,
int relief)
{
- Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, highlightWidth,
+ Tk_Fill3DRectangle(tkwin, drawable, border, highlightWidth,
highlightWidth, Tk_Width(tkwin) - 2*highlightWidth,
Tk_Height(tkwin) - 2*highlightWidth, borderWidth, relief);
}
diff --git a/unix/tkUnixEmbed.c b/unix/tkUnixEmbed.c
index 2ac3013..d4654a8 100644
--- a/unix/tkUnixEmbed.c
+++ b/unix/tkUnixEmbed.c
@@ -42,7 +42,7 @@ typedef struct Container {
* process. */
} Container;
-typedef struct ThreadSpecificData {
+typedef struct {
Container *firstContainerPtr;
/* First in list of all containers managed by
* this process. */
@@ -106,7 +106,7 @@ TkpUseWindow(
Tk_ErrorHandler handler;
Container *containerPtr;
XWindowAttributes parentAtts;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (winPtr->window != None) {
@@ -178,7 +178,7 @@ TkpUseWindow(
}
}
if (containerPtr == NULL) {
- containerPtr = ckalloc(sizeof(Container));
+ containerPtr = (Container *)ckalloc(sizeof(Container));
containerPtr->parent = parent;
containerPtr->parentRoot = parentAtts.root;
containerPtr->parentPtr = NULL;
@@ -216,7 +216,7 @@ TkpMakeWindow(
* the window is to be created. */
{
Container *containerPtr;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (winPtr->flags & TK_EMBEDDED) {
@@ -272,7 +272,7 @@ TkpMakeContainer(
{
TkWindow *winPtr = (TkWindow *) tkwin;
Container *containerPtr;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -281,7 +281,7 @@ TkpMakeContainer(
*/
Tk_MakeWindowExist(tkwin);
- containerPtr = ckalloc(sizeof(Container));
+ containerPtr = (Container *)ckalloc(sizeof(Container));
containerPtr->parent = Tk_WindowId(tkwin);
containerPtr->parentRoot = RootWindowOfScreen(Tk_Screen(tkwin));
containerPtr->parentPtr = winPtr;
@@ -332,7 +332,8 @@ EmbedErrorProc(
XErrorEvent *errEventPtr) /* Points to information about error (not
* used). */
{
- int *iPtr = clientData;
+ int *iPtr = (int *)clientData;
+ (void)errEventPtr;
*iPtr = 1;
return 0;
@@ -362,7 +363,7 @@ EmbeddedEventProc(
ClientData clientData, /* Token for container window. */
XEvent *eventPtr) /* ResizeRequest event. */
{
- TkWindow *winPtr = clientData;
+ TkWindow *winPtr = (TkWindow *)clientData;
if (eventPtr->type == DestroyNotify) {
EmbedWindowDeleted(winPtr);
@@ -394,10 +395,10 @@ ContainerEventProc(
ClientData clientData, /* Token for container window. */
XEvent *eventPtr) /* ResizeRequest event. */
{
- TkWindow *winPtr = clientData;
+ TkWindow *winPtr = (TkWindow *)clientData;
Container *containerPtr;
Tk_ErrorHandler errHandler;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -499,7 +500,7 @@ EmbedStructureProc(
ClientData clientData, /* Token for container window. */
XEvent *eventPtr) /* ResizeRequest event. */
{
- Container *containerPtr = clientData;
+ Container *containerPtr = (Container *)clientData;
Tk_ErrorHandler errHandler;
if (eventPtr->type == ConfigureNotify) {
@@ -507,7 +508,7 @@ EmbedStructureProc(
* Send a ConfigureNotify to the embedded application.
*/
- if (containerPtr->embeddedPtr != None) {
+ if (containerPtr->embeddedPtr != NULL) {
TkDoConfigureNotify(containerPtr->embeddedPtr);
}
if (containerPtr->wrapper != None) {
@@ -554,7 +555,7 @@ EmbedFocusProc(
ClientData clientData, /* Token for container window. */
XEvent *eventPtr) /* ResizeRequest event. */
{
- Container *containerPtr = clientData;
+ Container *containerPtr = (Container *)clientData;
Tk_ErrorHandler errHandler;
Display *display;
@@ -712,7 +713,7 @@ TkpGetOtherWindow(
* window. */
{
Container *containerPtr;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
for (containerPtr = tsdPtr->firstContainerPtr;
@@ -758,7 +759,7 @@ TkpRedirectKeyEvent(
{
Container *containerPtr;
Window saved;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -830,7 +831,7 @@ TkpClaimFocus(
{
XEvent event;
Container *containerPtr;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!(topLevelPtr->flags & TK_EMBEDDED)) {
@@ -872,7 +873,7 @@ TkpClaimFocus(
int
TkpTestembedCmd(
- ClientData clientData, /* Main window for application. */
+ ClientData dummy, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument strings. */
@@ -882,8 +883,9 @@ TkpTestembedCmd(
Tcl_DString dString;
char buffer[50];
Tcl_Interp *embeddedInterp = NULL, *parentInterp = NULL;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ (void)dummy;
if ((objc > 1) && (strcmp(Tcl_GetString(objv[1]), "all") == 0)) {
all = 1;
@@ -967,7 +969,7 @@ EmbedWindowDeleted(
* deleted. */
{
Container *containerPtr, *prevPtr;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -1025,7 +1027,7 @@ TkUnixContainerId(
TkWindow *winPtr) /* Tk's structure for an embedded window. */
{
Container *containerPtr;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
for (containerPtr = tsdPtr->firstContainerPtr;
@@ -1178,6 +1180,7 @@ TkpCreateBusy(
{
Window root, parent, *dummy;
unsigned int count;
+ (void)busy;
if (winPtr->flags & TK_REPARENTED) {
/*
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index a3867a4..d31b5c1 100644
--- a/unix/tkUnixEvent.c
+++ b/unix/tkUnixEvent.c
@@ -12,18 +12,17 @@
#include "tkUnixInt.h"
#include <signal.h>
-#ifdef HAVE_XKBKEYCODETOKEYSYM
-# include <X11/XKBlib.h>
-#else
-# define XkbOpenDisplay(D,V,E,M,m,R) ((V),(E),(M),(m),(R),(NULL))
-#endif
+#undef register /* Keyword "register" is used in XKBlib.h, so don't try tricky things here */
+#define XkbOpenDisplay XkbOpenDisplay_ /* Move out of the way, conflicting definitions */
+#include <X11/XKBlib.h>
+#undef XkbOpenDisplay
/*
* The following static indicates whether this module has been initialized in
* the current thread.
*/
-typedef struct ThreadSpecificData {
+typedef struct {
int initialized;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
@@ -92,10 +91,11 @@ TkCreateXEventSource(void)
static void
DisplayExitHandler(
- ClientData clientData) /* Not used. */
+ ClientData dummy) /* Not used. */
{
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ (void)dummy;
Tcl_DeleteEventSource(DisplaySetupProc, DisplayCheckProc, NULL);
tsdPtr->initialized = 0;
@@ -129,9 +129,8 @@ TkpOpenDisplay(
int major = 1;
int minor = 0;
int reason = 0;
- unsigned int use_xkb = 0;
/* Disabled, until we have a better test. See [Bug 3613668] */
-#if 0 && defined(XKEYCODETOKEYSYM_IS_DEPRECATED)
+#if 0
static int xinited = 0;
static Tcl_Mutex xinitMutex = NULL;
@@ -154,31 +153,19 @@ TkpOpenDisplay(
/*
** Bug [3607830]: Before using Xkb, it must be initialized and confirmed
- ** that the serve supports it. The XkbOpenDisplay call
+ ** that the server supports it. The XkbOpenDisplay call
** will perform this check and return NULL if the extension
** is not supported.
- **
- ** Work around un-const-ified Xkb headers using (char *) cast.
*/
- display = XkbOpenDisplay((char *)displayNameStr, &event, &error, &major,
+ display = XkbOpenDisplay(displayNameStr, &event, &error, &major,
&minor, &reason);
if (display == NULL) {
- /*fprintf(stderr,"event=%d error=%d major=%d minor=%d reason=%d\nDisabling xkb\n",
- event, error, major, minor, reason);*/
- display = XOpenDisplay(displayNameStr);
- } else {
- use_xkb = TK_DISPLAY_USE_XKB;
- /*fprintf(stderr, "Using xkb %d.%d\n", major, minor);*/
- }
-
- if (display == NULL) {
return NULL;
}
- dispPtr = ckalloc(sizeof(TkDisplay));
+ dispPtr = (TkDisplay *)ckalloc(sizeof(TkDisplay));
memset(dispPtr, 0, sizeof(TkDisplay));
dispPtr->display = display;
- dispPtr->flags |= use_xkb;
#ifdef TK_USE_INPUT_METHODS
OpenIM(dispPtr);
XRegisterIMInstantiateCallback(dispPtr->display, NULL, NULL, NULL,
@@ -186,6 +173,31 @@ TkpOpenDisplay(
#endif
Tcl_CreateFileHandler(ConnectionNumber(display), TCL_READABLE,
DisplayFileProc, dispPtr);
+
+ /*
+ * Observed weird WidthMMOfScreen() in X on Wayland on a
+ * Fedora 30/i386 running in a VM. Fallback to 75 dpi,
+ * otherwise many other strange things may happen later.
+ * See: [https://core.tcl-lang.org/tk/tktview?name=a01b6f7227]
+ */
+ if (WidthMMOfScreen(DefaultScreenOfDisplay(display)) <= 0) {
+ int mm;
+
+ mm = WidthOfScreen(DefaultScreenOfDisplay(display)) * (25.4 / 75.0);
+ WidthMMOfScreen(DefaultScreenOfDisplay(display)) = mm;
+ }
+ if (HeightMMOfScreen(DefaultScreenOfDisplay(display)) <= 0) {
+ int mm;
+
+ mm = HeightOfScreen(DefaultScreenOfDisplay(display)) * (25.4 / 75.0);
+ HeightMMOfScreen(DefaultScreenOfDisplay(display)) = mm;
+ }
+
+ /*
+ * Key map info must be available immediately, because of "send event".
+ */
+ TkpInitKeymapInfo(dispPtr);
+
return dispPtr;
}
@@ -286,11 +298,12 @@ TkClipCleanup(
static void
DisplaySetupProc(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
int flags)
{
TkDisplay *dispPtr;
static Tcl_Time blockTime = { 0, 0 };
+ (void)dummy;
if (!(flags & TCL_WINDOW_EVENTS)) {
return;
@@ -335,9 +348,6 @@ TransferXEventsToTcl(
int type;
XEvent x;
TkKeyEvent k;
-#ifdef GenericEvent
- xGenericEvent xge;
-#endif
} event;
Window w;
TkDisplay *dispPtr = NULL;
@@ -355,12 +365,9 @@ TransferXEventsToTcl(
while (QLength(display) > 0) {
XNextEvent(display, &event.x);
-#ifdef GenericEvent
- if (event.type == GenericEvent) {
- Tcl_Panic("Wild GenericEvent; panic! (extension=%d,evtype=%d)",
- event.xge.extension, event.xge.evtype);
+ if (event.type > MappingNotify) {
+ continue;
}
-#endif
w = None;
if (event.type == KeyPress || event.type == KeyRelease) {
for (dispPtr = TkGetDisplayList(); ; dispPtr = dispPtr->nextPtr) {
@@ -424,10 +431,11 @@ TransferXEventsToTcl(
static void
DisplayCheckProc(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
int flags)
{
TkDisplay *dispPtr;
+ (void)dummy;
if (!(flags & TCL_WINDOW_EVENTS)) {
return;
@@ -462,9 +470,10 @@ DisplayFileProc(
ClientData clientData, /* The display pointer. */
int flags) /* Should be TCL_READABLE. */
{
- TkDisplay *dispPtr = clientData;
+ TkDisplay *dispPtr = (TkDisplay *)clientData;
Display *display = dispPtr->display;
int numFound;
+ (void)flags;
XFlush(display);
numFound = XEventsQueued(display, QueuedAfterReading);
@@ -489,9 +498,9 @@ DisplayFileProc(
* nice (?!) message.
*/
- void (*oldHandler)();
+ void (*oldHandler)(int);
- oldHandler = (void (*)()) signal(SIGPIPE, SIG_IGN);
+ oldHandler = (void (*)(int)) signal(SIGPIPE, SIG_IGN);
XNoOp(display);
XFlush(display);
(void) signal(SIGPIPE, oldHandler);
@@ -675,6 +684,8 @@ InstantiateIMCallback(
XPointer call_data)
{
TkDisplay *dispPtr;
+ (void)display;
+ (void)call_data;
dispPtr = (TkDisplay *) client_data;
OpenIM(dispPtr);
@@ -689,6 +700,8 @@ DestroyIMCallback(
XPointer call_data)
{
TkDisplay *dispPtr;
+ (void)im;
+ (void)call_data;
dispPtr = (TkDisplay *) client_data;
dispPtr->inputMethod = NULL;
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index 168e8c9..1b7b50d 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -12,8 +12,6 @@
#include "tkUnixInt.h"
#include "tkFont.h"
-#include <netinet/in.h> /* for htons() prototype */
-#include <arpa/inet.h> /* inet_ntoa() */
/*
* The preferred font encodings.
@@ -35,10 +33,11 @@ static const char encodingList[][10] = {
* family": the foundry, face name, and charset.
*/
-#define FONTMAP_SHIFT 12
+#define FONTMAP_SHIFT 10
-#define FONTMAP_PAGES (1 << (21 - FONTMAP_SHIFT))
#define FONTMAP_BITSPERPAGE (1 << FONTMAP_SHIFT)
+#define FONTMAP_NUMCHARS 0x40000
+#define FONTMAP_PAGES (FONTMAP_NUMCHARS / FONTMAP_BITSPERPAGE)
typedef struct FontFamily {
struct FontFamily *nextPtr; /* Next in list of all known font families. */
@@ -63,7 +62,7 @@ typedef struct FontFamily {
/* Two-level sparse table used to determine
* quickly if the specified character exists.
* As characters are encountered, more pages
- * in this table are dynamically alloced. The
+ * in this table are dynamically allocated. The
* contents of each page is a bitmask
* consisting of FONTMAP_BITSPERPAGE bits,
* representing whether this font can be used
@@ -153,7 +152,7 @@ typedef struct FontAttributes {
TkXLFDAttributes xa;
} FontAttributes;
-typedef struct ThreadSpecificData {
+typedef struct {
FontFamily *fontFamilyList; /* The list of font families that are
* currently loaded. As screen fonts are
* loaded, this list grows to hold information
@@ -186,14 +185,7 @@ static const EncodingAlias encodingAliases[] = {
{"tis620", "tis620*"},
{"ksc5601", "ksc5601*"},
{"dingbats", "*dingbats"},
-#ifdef WORDS_BIGENDIAN
- {"unicode", "iso10646-1"},
-#else
- /*
- * ucs-2be is needed if native order isn't BE.
- */
{"ucs-2be", "iso10646-1"},
-#endif
{NULL, NULL}
};
@@ -201,7 +193,7 @@ static const EncodingAlias encodingAliases[] = {
* Functions used only in this file.
*/
-static void FontPkgCleanup(ClientData clientData);
+static void FontPkgCleanup(void *clientData);
static FontFamily * AllocFontFamily(Display *display,
XFontStruct *fontStructPtr, int base);
static SubFont * CanUseFallback(UnixFont *fontPtr,
@@ -211,7 +203,7 @@ static SubFont * CanUseFallbackWithAliases(UnixFont *fontPtr,
const char *fallbackName, int ch,
Tcl_DString *nameTriedPtr,
SubFont **fixSubFontPtrPtr);
-static int ControlUtfProc(ClientData clientData, const char *src,
+static int ControlUtfProc(void *clientData, const char *src,
int srcLen, int flags, Tcl_EncodingState*statePtr,
char *dst, int dstLen, int *srcReadPtr,
int *dstWrotePtr, int *dstCharsPtr);
@@ -246,16 +238,14 @@ static unsigned RankAttributes(FontAttributes *wantPtr,
static void ReleaseFont(UnixFont *fontPtr);
static void ReleaseSubFont(Display *display, SubFont *subFontPtr);
static int SeenName(const char *name, Tcl_DString *dsPtr);
-#ifndef WORDS_BIGENDIAN
-static int Ucs2beToUtfProc(ClientData clientData, const char*src,
+static int Ucs2beToUtfProc(void *clientData, const char*src,
int srcLen, int flags, Tcl_EncodingState*statePtr,
char *dst, int dstLen, int *srcReadPtr,
int *dstWrotePtr, int *dstCharsPtr);
-static int UtfToUcs2beProc(ClientData clientData, const char*src,
+static int UtfToUcs2beProc(void *clientData, const char*src,
int srcLen, int flags, Tcl_EncodingState*statePtr,
char *dst, int dstLen, int *srcReadPtr,
int *dstWrotePtr, int *dstCharsPtr);
-#endif
/*
*-------------------------------------------------------------------------
@@ -277,9 +267,9 @@ static int UtfToUcs2beProc(ClientData clientData, const char*src,
static void
FontPkgCleanup(
- ClientData clientData)
+ TCL_UNUSED(void *))
{
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->controlFamily.encoding != NULL) {
@@ -316,22 +306,17 @@ FontPkgCleanup(
void
TkpFontPkgInit(
- TkMainInfo *mainPtr) /* The application being created. */
+ TCL_UNUSED(TkMainInfo *)) /* The application being created. */
{
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- Tcl_EncodingType type;
SubFont dummy;
int i;
+ Tcl_Encoding ucs2;
if (tsdPtr->controlFamily.encoding == NULL) {
- 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;
@@ -343,20 +328,18 @@ TkpFontPkgInit(
FontMapInsert(&dummy, i + 0x80);
}
-#ifndef WORDS_BIGENDIAN
/*
* UCS-2BE is unicode (UCS-2) in big-endian format. Define this if
- * native order isn't BE. It is used in iso10646 fonts.
+ * if it doesn't exist yet. It is used in iso10646 fonts.
*/
- type.encodingName = "ucs-2be";
- type.toUtfProc = Ucs2beToUtfProc;
- type.fromUtfProc = UtfToUcs2beProc;
- type.freeProc = NULL;
- type.clientData = NULL;
- type.nullSize = 2;
- Tcl_CreateEncoding(&type);
-#endif
+ ucs2 = Tcl_GetEncoding(NULL, "ucs-2be");
+ if (ucs2 == NULL) {
+ Tcl_EncodingType ucs2type = {"ucs-2be", Ucs2beToUtfProc, UtfToUcs2beProc, NULL, NULL, 2};
+ Tcl_CreateEncoding(&ucs2type);
+ } else {
+ Tcl_FreeEncoding(ucs2);
+ }
Tcl_CreateThreadExitHandler(FontPkgCleanup, NULL);
}
}
@@ -379,11 +362,11 @@ TkpFontPkgInit(
static int
ControlUtfProc(
- ClientData clientData, /* Not used. */
+ TCL_UNUSED(void *), /* Not used. */
const char *src, /* Source string in UTF-8. */
int srcLen, /* Source string length in bytes. */
- int flags, /* Conversion control flags. */
- Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
+ TCL_UNUSED(int), /* Conversion control flags. */
+ TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state
* information used during a piecewise
* conversion. Contents of statePtr are
* initialized and/or reset by conversion
@@ -407,7 +390,7 @@ ControlUtfProc(
const char *srcStart, *srcEnd;
char *dstStart, *dstEnd;
int ch, result;
- static const char hexChars[] = "0123456789abcdef";
+ static const char hexChars[] = "0123456789ABCDEF";
static const char mapChars[] = {
0, 0, 0, 0, 0, 0, 0,
'a', 'b', 't', 'n', 'v', 'f', 'r'
@@ -428,28 +411,28 @@ ControlUtfProc(
}
src += TkUtfToUniChar(src, &ch);
dst[0] = '\\';
- if (((size_t) ch < sizeof(mapChars)) && (mapChars[ch] != 0)) {
+ if (((size_t)ch < sizeof(mapChars)) && (mapChars[ch] != 0)) {
dst[1] = mapChars[ch];
dst += 2;
- } else if (ch < 256) {
+ } else if ((size_t)ch < 256) {
dst[1] = 'x';
- dst[2] = hexChars[(ch >> 4) & 0xf];
- dst[3] = hexChars[ch & 0xf];
+ dst[2] = hexChars[(ch >> 4) & 0xF];
+ dst[3] = hexChars[ch & 0xF];
dst += 4;
- } else if (ch < 0x10000) {
+ } else if ((size_t)ch < 0x10000) {
dst[1] = 'u';
- dst[2] = hexChars[(ch >> 12) & 0xf];
- dst[3] = hexChars[(ch >> 8) & 0xf];
- dst[4] = hexChars[(ch >> 4) & 0xf];
- dst[5] = hexChars[ch & 0xf];
+ dst[2] = hexChars[(ch >> 12) & 0xF];
+ dst[3] = hexChars[(ch >> 8) & 0xF];
+ dst[4] = hexChars[(ch >> 4) & 0xF];
+ dst[5] = hexChars[ch & 0xF];
dst += 6;
} else {
/* TODO we can do better here */
dst[1] = 'u';
- dst[2] = 'f';
- dst[3] = 'f';
- dst[4] = 'f';
- dst[5] = 'd';
+ dst[2] = 'F';
+ dst[3] = 'F';
+ dst[4] = 'F';
+ dst[5] = 'D';
dst += 6;
}
}
@@ -459,14 +442,12 @@ ControlUtfProc(
return result;
}
-#ifndef WORDS_BIGENDIAN
/*
*-------------------------------------------------------------------------
*
* Ucs2beToUtfProc --
*
* Convert from UCS-2BE (big-endian 16-bit Unicode) to UTF-8.
- * This is only defined on LE machines.
*
* Results:
* Returns TCL_OK if conversion was successful.
@@ -479,11 +460,11 @@ ControlUtfProc(
static int
Ucs2beToUtfProc(
- ClientData clientData, /* Not used. */
+ TCL_UNUSED(void *), /* Not used. */
const char *src, /* Source string in Unicode. */
int srcLen, /* Source string length in bytes. */
int flags, /* Conversion control flags. */
- Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
+ TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state
* information used during a piecewise
* conversion. Contents of statePtr are
* initialized and/or reset by conversion
@@ -505,9 +486,13 @@ Ucs2beToUtfProc(
* output buffer. */
{
const char *srcStart, *srcEnd;
- char *dstEnd, *dstStart;
- int result, numChars;
+ const char *dstEnd, *dstStart;
+ int result, numChars, charLimit = INT_MAX;
+ unsigned short ch;
+ if (flags & TCL_ENCODING_CHAR_LIMIT) {
+ charLimit = *dstCharsPtr;
+ }
result = TCL_OK;
/* check alignment with ucs-2 (2 == sizeof(UCS-2)) */
@@ -515,6 +500,11 @@ Ucs2beToUtfProc(
result = TCL_CONVERT_MULTIBYTE;
srcLen--;
}
+ /* If last code point is a high surrogate, we cannot handle that yet */
+ if ((srcLen >= 2) && ((src[srcLen - 2] & 0xFC) == 0xD8)) {
+ result = TCL_CONVERT_MULTIBYTE;
+ srcLen -= 2;
+ }
srcStart = src;
srcEnd = src + srcLen;
@@ -522,19 +512,24 @@ Ucs2beToUtfProc(
dstStart = dst;
dstEnd = dst + dstLen - 4;
- for (numChars = 0; src < srcEnd; numChars++) {
+ for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
if (dst > dstEnd) {
result = TCL_CONVERT_NOSPACE;
break;
}
+ ch = (src[0] & 0xFF) << 8 | (src[1] & 0xFF);
+ src += 2 /* sizeof(UTF-16) */;
+
/*
- * Need to swap byte-order on little-endian machines (x86) for
- * UCS-2BE. We know this is an LE->BE swap.
+ * Special case for 1-byte utf chars for speed. Make sure we work with
+ * unsigned short-size data.
*/
-
- dst += Tcl_UniCharToUtf(htons(*((short *)src)), dst);
- src += 2 /* sizeof(UCS-2) */;
+ if (ch && ch < 0x80) {
+ *dst++ = (ch & 0xFF);
+ } else {
+ dst += Tcl_UniCharToUtf(ch, dst);
+ }
}
*srcReadPtr = src - srcStart;
@@ -561,12 +556,12 @@ Ucs2beToUtfProc(
static int
UtfToUcs2beProc(
- ClientData clientData, /* TableEncodingData that specifies
+ TCL_UNUSED(void *), /* TableEncodingData that specifies
* encoding. */
const char *src, /* Source string in UTF-8. */
int srcLen, /* Source string length in bytes. */
int flags, /* Conversion control flags. */
- Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
+ TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state
* information used during a piecewise
* conversion. Contents of statePtr are
* initialized and/or reset by conversion
@@ -589,13 +584,13 @@ UtfToUcs2beProc(
{
const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd;
int result, numChars;
- Tcl_UniChar ch;
+ int ch;
srcStart = src;
srcEnd = src + srcLen;
srcClose = srcEnd;
if (!(flags & TCL_ENCODING_END)) {
- srcClose -= 4;
+ srcClose -= 6;
}
dstStart = dst;
@@ -608,31 +603,30 @@ UtfToUcs2beProc(
* If there is more string to follow, this will ensure that the
* last UTF-8 character in the source buffer hasn't been cut off.
*/
-
result = TCL_CONVERT_MULTIBYTE;
break;
}
if (dst > dstEnd) {
result = TCL_CONVERT_NOSPACE;
break;
- }
- src += Tcl_UtfToUniChar(src, &ch);
+ }
+ src += TkUtfToUniChar(src, &ch);
+ if (ch > 0xFFFF) {
+ ch = 0xFFFD;
+ }
/*
* Ensure big-endianness (store big bits first).
- * XXX: This hard-codes the assumed size of Tcl_UniChar as 2. Make
- * sure to work in char* for Tcl_UtfToUniChar alignment. [Bug 1122671]
*/
- *dst++ = (ch >> 8);
- *dst++ = (ch & 0xFF);
+ *dst++ = (char)((ch >> 8) & 0xFF);
+ *dst++ = (char)(ch & 0xFF);
}
*srcReadPtr = src - srcStart;
*dstWrotePtr = dst - dstStart;
*dstCharsPtr = numChars;
return result;
}
-#endif /* WORDS_BIGENDIAN */
/*
*---------------------------------------------------------------------------
@@ -726,7 +720,7 @@ TkpGetNativeFont(
}
fontStructPtr = CreateClosestFont(tkwin, &fa.fa, &fa.xa);
}
- fontPtr = ckalloc(sizeof(UnixFont));
+ fontPtr = (UnixFont *)ckalloc(sizeof(UnixFont));
InitFont(tkwin, fontStructPtr, fontPtr);
return (TkFont *) fontPtr;
@@ -782,7 +776,7 @@ TkpGetFontFromAttributes(
fontPtr = (UnixFont *) tkFontPtr;
if (fontPtr == NULL) {
- fontPtr = ckalloc(sizeof(UnixFont));
+ fontPtr = (UnixFont *)ckalloc(sizeof(UnixFont));
} else {
ReleaseFont(fontPtr);
}
@@ -845,7 +839,7 @@ TkpGetFontFamilies(
Tcl_Interp *interp, /* Interp to hold result. */
Tk_Window tkwin) /* For display to query. */
{
- int i, new, numNames;
+ int i, isNew, numNames;
char *family, **nameList;
Tcl_HashTable familyTable;
Tcl_HashEntry *hPtr;
@@ -874,14 +868,14 @@ TkpGetFontFamilies(
continue; /* See comment above. */
}
*familyEnd = '\0';
- Tcl_CreateHashEntry(&familyTable, family, &new);
+ Tcl_CreateHashEntry(&familyTable, family, &isNew);
}
XFreeFontNames(nameList);
hPtr = Tcl_FirstHashEntry(&familyTable, &search);
resultPtr = Tcl_NewObj();
while (hPtr != NULL) {
- strPtr = Tcl_NewStringObj(Tcl_GetHashKey(&familyTable, hPtr), -1);
+ strPtr = Tcl_NewStringObj((const char *)Tcl_GetHashKey(&familyTable, hPtr), -1);
Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
hPtr = Tcl_NextHashEntry(&search);
}
@@ -1209,7 +1203,7 @@ TkpMeasureCharsInContext(
Tk_Font tkfont, /* Font in which characters will be drawn. */
const char *source, /* UTF-8 string to be displayed. Need not be
* '\0' terminated. */
- int numBytes, /* Maximum number of bytes to consider from
+ TCL_UNUSED(int), /* Maximum number of bytes to consider from
* source string in all. */
int rangeStart, /* Index of first byte to measure. */
int rangeLength, /* Length of range to measure in bytes. */
@@ -1231,7 +1225,6 @@ TkpMeasureCharsInContext(
int *lengthPtr) /* Filled with x-location just after the
* terminating character. */
{
- (void) numBytes; /*unused*/
return Tk_MeasureChars(tkfont, source + rangeStart, rangeLength,
maxLength, flags, lengthPtr);
}
@@ -1403,7 +1396,7 @@ TkpDrawCharsInContext(
* is passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
- int numBytes, /* Number of bytes in string. */
+ TCL_UNUSED(int), /* Number of bytes in string. */
int rangeStart, /* Index of first byte to draw. */
int rangeLength, /* Length of range to draw in bytes. */
int x, int y) /* Coordinates at which to place origin of the
@@ -1412,8 +1405,6 @@ TkpDrawCharsInContext(
{
int widthUntilStart;
- (void) numBytes; /*unused*/
-
Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
Tk_DrawChars(display, drawable, gc, tkfont, source + rangeStart,
rangeLength, x+widthUntilStart, y);
@@ -1581,7 +1572,7 @@ InitFont(
UnixFont *fontPtr) /* Filled with information constructed from
* the above arguments. */
{
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
unsigned long value;
int minHi, maxHi, minLo, maxLo, fixed, width, limit, i, n;
@@ -1828,13 +1819,13 @@ AllocFontFamily(
Display *display, /* Display in which font will be used. */
XFontStruct *fontStructPtr, /* Screen font whose FontFamily is to be
* returned. */
- int base) /* Non-zero if this font family is to be used
+ TCL_UNUSED(int)) /* Non-zero if this font family is to be used
* in the base font of a font object. */
{
FontFamily *familyPtr;
FontAttributes fa;
Tcl_Encoding encoding;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
GetFontAttributes(display, fontStructPtr, &fa);
@@ -1853,7 +1844,7 @@ AllocFontFamily(
}
}
- familyPtr = ckalloc(sizeof(FontFamily));
+ familyPtr = (FontFamily *)ckalloc(sizeof(FontFamily));
memset(familyPtr, 0, sizeof(FontFamily));
familyPtr->nextPtr = tsdPtr->fontFamilyList;
tsdPtr->fontFamilyList = familyPtr;
@@ -1910,7 +1901,7 @@ FreeFontFamily(
FontFamily *familyPtr) /* The FontFamily to delete. */
{
FontFamily **familyPtrPtr;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
int i;
@@ -1985,11 +1976,11 @@ FindSubFontForChar(
SubFont *subFontPtr;
Tcl_DString ds;
- if (FontMapLookup(&fontPtr->subFontArray[0], ch)) {
- return &fontPtr->subFontArray[0];
+ if (ch < 0 || ch >= FONTMAP_NUMCHARS) {
+ ch = 0xFFFD;
}
- for (i = 1; i < fontPtr->numSubFonts; i++) {
+ for (i = 0; i < fontPtr->numSubFonts; i++) {
if (FontMapLookup(&fontPtr->subFontArray[i], ch)) {
return &fontPtr->subFontArray[i];
}
@@ -2139,6 +2130,9 @@ FontMapLookup(
{
int row, bitOffset;
+ if (ch < 0 || ch >= FONTMAP_NUMCHARS) {
+ return 0;
+ }
row = ch >> FONTMAP_SHIFT;
if (subFontPtr->fontMap[row] == NULL) {
FontMapLoadPage(subFontPtr, row);
@@ -2179,12 +2173,14 @@ FontMapInsert(
{
int row, bitOffset;
- row = ch >> FONTMAP_SHIFT;
- if (subFontPtr->fontMap[row] == NULL) {
- FontMapLoadPage(subFontPtr, row);
+ if (ch >= 0 && ch < FONTMAP_NUMCHARS) {
+ row = ch >> FONTMAP_SHIFT;
+ if (subFontPtr->fontMap[row] == NULL) {
+ FontMapLoadPage(subFontPtr, row);
+ }
+ bitOffset = ch & (FONTMAP_BITSPERPAGE - 1);
+ subFontPtr->fontMap[row][bitOffset >> 3] |= 1 << (bitOffset & 7);
}
- bitOffset = ch & (FONTMAP_BITSPERPAGE - 1);
- subFontPtr->fontMap[row][bitOffset >> 3] |= 1 << (bitOffset & 7);
}
/*
@@ -2218,10 +2214,10 @@ FontMapLoadPage(
Tcl_Encoding encoding;
XFontStruct *fontStructPtr;
XCharStruct *widths;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- subFontPtr->fontMap[row] = ckalloc(FONTMAP_BITSPERPAGE / 8);
+ subFontPtr->fontMap[row] = (char *)ckalloc(FONTMAP_BITSPERPAGE / 8);
memset(subFontPtr->fontMap[row], 0, FONTMAP_BITSPERPAGE / 8);
if (subFontPtr->familyPtr == &tsdPtr->controlFamily) {
@@ -2459,7 +2455,7 @@ CanUseFallback(
numEncodings = 0;
Tcl_DStringInit(&dsEncodings);
- charset = NULL; /* lint, since numNames must be > 0 to get here. */
+ charset = NULL; /* numNames must be > 0 to get here. */
retry:
bestIdx[0] = -1;
@@ -2553,7 +2549,7 @@ CanUseFallback(
* make a copy.
*/
- nameList = ckalloc(numNames * sizeof(char *));
+ nameList = (char **)ckalloc(numNames * sizeof(char *));
memcpy(nameList, nameListOrig, numNames * sizeof(char *));
}
nameList[nameIdx] = NULL;
@@ -2598,11 +2594,11 @@ CanUseFallback(
if (fontPtr->numSubFonts >= SUBFONT_SPACE) {
SubFont *newPtr;
- newPtr = ckalloc(sizeof(SubFont) * (fontPtr->numSubFonts + 1));
+ newPtr = (SubFont *)ckalloc(sizeof(SubFont) * (fontPtr->numSubFonts + 1));
memcpy(newPtr, fontPtr->subFontArray,
fontPtr->numSubFonts * sizeof(SubFont));
if (fixSubFontPtrPtr != NULL) {
- register SubFont *fixSubFontPtr = *fixSubFontPtrPtr;
+ SubFont *fixSubFontPtr = *fixSubFontPtrPtr;
if (fixSubFontPtr != &fontPtr->controlSubFont) {
*fixSubFontPtrPtr =
@@ -3017,7 +3013,7 @@ GetEncodingAlias(
const EncodingAlias *aliasPtr;
for (aliasPtr = encodingAliases; aliasPtr->aliasPattern != NULL; ) {
- if (Tcl_StringMatch(name, aliasPtr->aliasPattern)) {
+ if (Tcl_StringCaseMatch(name, aliasPtr->aliasPattern, 0)) {
return aliasPtr->realName;
}
aliasPtr++;
@@ -3067,29 +3063,31 @@ GetImageOfText(
Pixmap bitmap;
GC bitmapGC;
XGCValues values;
- XImage *image;
+ XImage *image = NULL;
(void) Tk_MeasureChars(tkfont, source, numBytes, -1, 0, &width);
height = fontPtr->fm.ascent + fontPtr->fm.descent;
- bitmap = Tk_GetPixmap(display, drawable, width, height, 1);
- values.graphics_exposures = False;
- values.foreground = BlackPixel(display, DefaultScreen(display));
- bitmapGC = XCreateGC(display, bitmap, GCGraphicsExposures|GCForeground,
- &values);
- XFillRectangle(display, bitmap, bitmapGC, 0, 0, width, height);
-
- values.font = Tk_FontId(tkfont);
- values.foreground = WhitePixel(display, DefaultScreen(display));
- values.background = BlackPixel(display, DefaultScreen(display));
- XChangeGC(display, bitmapGC, GCFont|GCForeground|GCBackground, &values);
- Tk_DrawChars(display, bitmap, bitmapGC, tkfont, source, numBytes, 0,
- fontPtr->fm.ascent);
- XFreeGC(display, bitmapGC);
-
- image = XGetImage(display, bitmap, 0, 0, width, height, AllPlanes,
- ZPixmap);
- Tk_FreePixmap(display, bitmap);
+ if ((width > 0) && (height > 0)) {
+ bitmap = Tk_GetPixmap(display, drawable, width, height, 1);
+ values.graphics_exposures = False;
+ values.foreground = BlackPixel(display, DefaultScreen(display));
+ bitmapGC = XCreateGC(display, bitmap, GCGraphicsExposures|GCForeground,
+ &values);
+ XFillRectangle(display, bitmap, bitmapGC, 0, 0, width, height);
+
+ values.font = Tk_FontId(tkfont);
+ values.foreground = WhitePixel(display, DefaultScreen(display));
+ values.background = BlackPixel(display, DefaultScreen(display));
+ XChangeGC(display, bitmapGC, GCFont|GCForeground|GCBackground, &values);
+ Tk_DrawChars(display, bitmap, bitmapGC, tkfont, source, numBytes, 0,
+ fontPtr->fm.ascent);
+ XFreeGC(display, bitmapGC);
+
+ image = XGetImage(display, bitmap, 0, 0, width, height, AllPlanes,
+ ZPixmap);
+ Tk_FreePixmap(display, bitmap);
+ }
*realWidthPtr = width;
*realHeightPtr = height;
@@ -3104,21 +3102,23 @@ InitDestImage(
int height,
Pixmap *bitmapPtr)
{
- Pixmap bitmap;
- XImage *image;
+ Pixmap bitmap = None;
+ XImage *image = NULL;
GC bitmapGC;
XGCValues values;
- bitmap = Tk_GetPixmap(display, drawable, width, height, 1);
- values.graphics_exposures = False;
- values.foreground = BlackPixel(display, DefaultScreen(display));
- bitmapGC = XCreateGC(display, bitmap, GCGraphicsExposures|GCForeground,
- &values);
- XFillRectangle(display, bitmap, bitmapGC, 0, 0, width, height);
- XFreeGC(display, bitmapGC);
+ if ((width > 0) && (height > 0)) {
+ bitmap = Tk_GetPixmap(display, drawable, width, height, 1);
+ values.graphics_exposures = False;
+ values.foreground = BlackPixel(display, DefaultScreen(display));
+ bitmapGC = XCreateGC(display, bitmap, GCGraphicsExposures|GCForeground,
+ &values);
+ XFillRectangle(display, bitmap, bitmapGC, 0, 0, width, height);
+ XFreeGC(display, bitmapGC);
- image = XGetImage(display, bitmap, 0, 0, width, height, AllPlanes,
- ZPixmap);
+ image = XGetImage(display, bitmap, 0, 0, width, height, AllPlanes,
+ ZPixmap);
+ }
*bitmapPtr = bitmap;
return image;
}
diff --git a/unix/tkUnixInit.c b/unix/tkUnixInit.c
index b0aa2fa..cffe605 100644
--- a/unix/tkUnixInit.c
+++ b/unix/tkUnixInit.c
@@ -14,7 +14,7 @@
#ifdef HAVE_COREFOUNDATION
static int GetLibraryPath(Tcl_Interp *interp);
#else
-#define GetLibraryPath(dummy) (void)0
+#define GetLibraryPath(dummy) (void)dummy
#endif /* HAVE_COREFOUNDATION */
/*
@@ -132,11 +132,11 @@ TkpDisplayWarning(
*----------------------------------------------------------------------
*/
+#ifdef TK_FRAMEWORK
static int
GetLibraryPath(
Tcl_Interp *interp)
{
-#ifdef TK_FRAMEWORK
int foundInFramework = TCL_ERROR;
char tkLibPath[PATH_MAX + 1];
@@ -147,10 +147,15 @@ GetLibraryPath(
Tcl_SetVar2(interp, "tk_library", NULL, tkLibPath, TCL_GLOBAL_ONLY);
}
return foundInFramework;
+}
#else
+static int
+GetLibraryPath(
+ TCL_UNUSED(Tcl_Interp *))
+{
return TCL_ERROR;
-#endif
}
+#endif
#endif /* HAVE_COREFOUNDATION */
/*
diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c
index baba11e..1a5cb7d 100644
--- a/unix/tkUnixKey.c
+++ b/unix/tkUnixKey.c
@@ -12,20 +12,10 @@
#include "tkInt.h"
-/*
-** Bug [3607830]: Before using Xkb, it must be initialized. TkpOpenDisplay
-** does this and sets the USE_XKB flag if xkb is supported.
-** (should this be function ptr?)
-*/
-#ifdef HAVE_XKBKEYCODETOKEYSYM
-# include <X11/XKBlib.h>
-#else
-# define XkbKeycodeToKeysym(D,K,G,L) XKeycodeToKeysym(D,K,L)
-#endif
-#define TkKeycodeToKeysym(D,K,G,L) \
- ((D)->flags & TK_DISPLAY_USE_XKB) ? \
- XkbKeycodeToKeysym((D)->display,K,G,L) : \
- XKeycodeToKeysym((D)->display,K,L)
+#undef register /* Keyword "register" is used in XKBlib.h, so don't try tricky things here */
+#define XkbOpenDisplay XkbOpenDisplay_ /* Move out of the way, conflicting definitions */
+#include <X11/XKBlib.h>
+#undef XkbOpenDisplay
/*
* Prototypes for local functions defined in this file:
@@ -110,7 +100,7 @@ TkpGetString(
XEvent *eventPtr, /* X keyboard event. */
Tcl_DString *dsPtr) /* Initialized, empty string to hold result. */
{
- size_t len;
+ TkSizeT len;
Tcl_DString buf;
TkKeyEvent *kePtr = (TkKeyEvent *) eventPtr;
@@ -138,8 +128,7 @@ TkpGetString(
#ifdef TK_USE_INPUT_METHODS
if ((winPtr->dispPtr->flags & TK_DISPLAY_USE_IM)
- && (winPtr->inputContext != NULL)
- && (eventPtr->type == KeyPress)) {
+ && (winPtr->inputContext != NULL)) {
Status status;
#if X_HAVE_UTF8_STRING
@@ -194,8 +183,7 @@ TkpGetString(
{
/*
* Fall back to convert a keyboard event to a UTF-8 string using
- * XLookupString. This is used when input methods are turned off and
- * for KeyRelease events.
+ * XLookupString. This is used when input methods are turned off.
*
* Note: XLookupString() normally returns a single ISO Latin 1 or
* ASCII control character.
@@ -208,7 +196,7 @@ TkpGetString(
Tcl_DStringValue(&buf)[len] = '\0';
if (len == 1) {
- len = Tcl_UniCharToUtf((unsigned char) Tcl_DStringValue(&buf)[0],
+ len = TkUniCharToUtf((unsigned char) Tcl_DStringValue(&buf)[0],
Tcl_DStringValue(dsPtr));
Tcl_DStringSetLength(dsPtr, len);
} else {
@@ -229,7 +217,7 @@ TkpGetString(
*/
done:
- kePtr->charValuePtr = ckalloc(len + 1);
+ kePtr->charValuePtr = (char *)ckalloc(len + 1);
kePtr->charValueLen = len;
memcpy(kePtr->charValuePtr, Tcl_DStringValue(dsPtr), len + 1);
return Tcl_DStringValue(dsPtr);
@@ -237,7 +225,7 @@ done:
/*
* When mapping from a keysym to a keycode, need information about the
- * modifier state to be used so that when they call TkKeycodeToKeysym taking
+ * modifier state to be used so that when they call XbkKeycodeToKeysym taking
* into account the xkey.state, they will get back the original keysym.
*/
@@ -279,9 +267,9 @@ TkpSetKeycodeAndState(
mincode = 0;
maxcode = -1;
XDisplayKeycodes(dispPtr->display, &mincode, &maxcode);
- if (keycode < mincode) {
+ if (keycode < (KeyCode)mincode) {
keycode = mincode;
- } else if (keycode > maxcode) {
+ } else if (keycode > (KeyCode)maxcode) {
keycode = maxcode;
}
@@ -363,7 +351,7 @@ TkpGetKeySym(
&& (eventPtr->xkey.state & LockMask))) {
index += 1;
}
- sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode, 0,
+ sym = XkbKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode, 0,
index);
/*
@@ -378,7 +366,7 @@ TkpGetKeySym(
|| ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis))
|| ((sym >= XK_Ooblique) && (sym <= XK_Thorn)))) {
index &= ~1;
- sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode,
+ sym = XkbKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode,
0, index);
}
}
@@ -389,7 +377,7 @@ TkpGetKeySym(
*/
if ((index & 1) && (sym == NoSymbol)) {
- sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode,
+ sym = XkbKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode,
0, index & ~1);
}
return sym;
@@ -439,7 +427,7 @@ TkpInitKeymapInfo(
if (*codePtr == 0) {
continue;
}
- keysym = TkKeycodeToKeysym(dispPtr, *codePtr, 0, 0);
+ keysym = XkbKeycodeToKeysym(dispPtr->display, *codePtr, 0, 0);
if (keysym == XK_Shift_Lock) {
dispPtr->lockUsage = LU_SHIFT;
break;
@@ -465,7 +453,8 @@ TkpInitKeymapInfo(
if (*codePtr == 0) {
continue;
}
- keysym = TkKeycodeToKeysym(dispPtr, *codePtr, 0, 0);
+ keysym = XkbKeycodeToKeysym(dispPtr->display, *codePtr, 0, 0);
+
if (keysym == XK_Mode_switch) {
dispPtr->modeModMask |= ShiftMask << (i/modMapPtr->max_keypermod);
}
@@ -486,7 +475,7 @@ TkpInitKeymapInfo(
}
dispPtr->numModKeyCodes = 0;
arraySize = KEYCODE_ARRAY_SIZE;
- dispPtr->modKeyCodes = ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode));
+ dispPtr->modKeyCodes = (KeyCode *)ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode));
for (i = 0, codePtr = modMapPtr->modifiermap; i < max; i++, codePtr++) {
if (*codePtr == 0) {
continue;
@@ -513,7 +502,7 @@ TkpInitKeymapInfo(
*/
arraySize *= 2;
- newCodes = ckalloc(arraySize * sizeof(KeyCode));
+ newCodes = (KeyCode *)ckalloc(arraySize * sizeof(KeyCode));
memcpy(newCodes, dispPtr->modKeyCodes,
dispPtr->numModKeyCodes * sizeof(KeyCode));
ckfree(dispPtr->modKeyCodes);
diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c
index d62cd50..7c7ed26 100644
--- a/unix/tkUnixMenu.c
+++ b/unix/tkUnixMenu.c
@@ -147,6 +147,8 @@ void
TkpDestroyMenu(
TkMenu *menuPtr)
{
+ (void)menuPtr;
+
/*
* Nothing to do.
*/
@@ -173,6 +175,8 @@ void
TkpDestroyMenuEntry(
TkMenuEntry *mEntryPtr)
{
+ (void)mEntryPtr;
+
/*
* Nothing to do.
*/
@@ -199,7 +203,7 @@ TkpDestroyMenuEntry(
int
TkpConfigureMenuEntry(
- register TkMenuEntry *mePtr)/* Information about menu entry; may or may
+ TkMenuEntry *mePtr)/* Information about menu entry; may or may
* not already have values for some fields. */
{
/*
@@ -241,6 +245,8 @@ int
TkpMenuNewEntry(
TkMenuEntry *mePtr)
{
+ (void)mePtr;
+
return TCL_OK;
}
@@ -296,6 +302,10 @@ TkpSetMainMenubar(
Tk_Window tkwin,
const char *menuName)
{
+ (void)interp;
+ (void)tkwin;
+ (void)menuName;
+
/*
* Nothing to do.
*/
@@ -329,6 +339,8 @@ GetMenuIndicatorGeometry(
int *heightPtr) /* The resulting height */
{
int borderWidth;
+ (void)tkfont;
+ (void)fmPtr;
if ((mePtr->type == CHECK_BUTTON_ENTRY)
|| (mePtr->type == RADIO_BUTTON_ENTRY)) {
@@ -560,6 +572,10 @@ DrawMenuEntryIndicator(
int width, /* Width of menu entry */
int height) /* Height of menu entry */
{
+ (void)tkfont;
+ (void)fmPtr;
+ (void)width;
+
/*
* Draw check-button indicator.
*/
@@ -632,6 +648,10 @@ DrawMenuSeparator(
{
XPoint points[2];
Tk_3DBorder border;
+ (void)mePtr;
+ (void)gc;
+ (void)tkfont;
+ (void)fmPtr;
if (menuPtr->menuType == MENUBAR) {
return;
@@ -789,7 +809,7 @@ DrawMenuEntryLabel(
imageHeight, d, leftEdge + imageXOffset,
(int) (y + (mePtr->height-imageHeight)/2 + imageYOffset));
}
- } else if (mePtr->bitmapPtr != None) {
+ } else if (mePtr->bitmapPtr != NULL) {
Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
XCopyPlane(menuPtr->display, bitmap, d, gc, 0, 0,
@@ -817,7 +837,7 @@ DrawMenuEntryLabel(
XFillRectangle(menuPtr->display, d, menuPtr->disabledGC, x, y,
(unsigned) width, (unsigned) height);
} else if ((mePtr->image != NULL)
- && (menuPtr->disabledImageGC != None)) {
+ && (menuPtr->disabledImageGC != NULL)) {
XFillRectangle(menuPtr->display, d, menuPtr->disabledImageGC,
leftEdge + imageXOffset,
(int) (y + (mePtr->height - imageHeight)/2 + imageYOffset),
@@ -853,21 +873,19 @@ DrawMenuUnderline(
int x, int y,
int width, int height)
{
+ (void)width;
+
if ((mePtr->underline >= 0) && (mePtr->labelPtr != NULL)) {
int len;
- /*
- * Do the unicode call just to prevent overruns.
- */
-
- Tcl_GetUnicodeFromObj(mePtr->labelPtr, &len);
+ len = Tcl_GetCharLength(mePtr->labelPtr);
if (mePtr->underline < len) {
- int activeBorderWidth, leftEdge;
+ int activeBorderWidth, leftEdge, ch;
const char *label, *start, *end;
label = Tcl_GetString(mePtr->labelPtr);
start = Tcl_UtfAtIndex(label, mePtr->underline);
- end = Tcl_UtfNext(start);
+ end = start + TkUtfToUniChar(start, &ch);
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin,
menuPtr->activeBorderWidthPtr, &activeBorderWidth);
@@ -934,15 +952,16 @@ TkpPostMenu(
int
TkpPostTearoffMenu(
- Tcl_Interp *interp, /* The interpreter of the menu */
+ Tcl_Interp *dummy, /* The interpreter of the menu */
TkMenu *menuPtr, /* The menu we are posting */
int x, int y, int index) /* The root X,Y coordinates where the
* specified entry will be posted */
{
int vRootX, vRootY, vRootWidth, vRootHeight;
int result;
+ (void)dummy;
- if (index >= menuPtr->numEntries) {
+ if (index >= (int)menuPtr->numEntries) {
index = menuPtr->numEntries - 1;
}
if (index >= 0) {
@@ -1031,6 +1050,10 @@ GetMenuSeparatorGeometry(
int *widthPtr, /* The resulting width */
int *heightPtr) /* The resulting height */
{
+ (void)menuPtr;
+ (void)mePtr;
+ (void)tkfont;
+
*widthPtr = 0;
*heightPtr = fmPtr->linespace;
}
@@ -1060,6 +1083,8 @@ GetTearoffEntryGeometry(
int *widthPtr, /* The resulting width */
int *heightPtr) /* The resulting height */
{
+ (void)mePtr;
+
if (menuPtr->menuType != MASTER_MENU) {
*heightPtr = 0;
*widthPtr = 0;
@@ -1114,7 +1139,7 @@ TkpComputeMenubarGeometry(
maxWindowWidth = Tk_Width(menuPtr->tkwin);
if (maxWindowWidth == 1) {
- maxWindowWidth = 0x7ffffff;
+ maxWindowWidth = 0x7FFFFFF;
}
currentRowHeight = 0;
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr,
@@ -1134,7 +1159,7 @@ TkpComputeMenubarGeometry(
menuFont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr);
Tk_GetFontMetrics(menuFont, &menuMetrics);
- for (i = 0; i < menuPtr->numEntries; i++) {
+ for (i = 0; i < (int)menuPtr->numEntries; i++) {
mePtr = menuPtr->entries[i];
mePtr->entryFlags &= ~ENTRY_LAST_COLUMN;
if (mePtr->fontPtr != NULL) {
@@ -1211,7 +1236,7 @@ TkpComputeMenubarGeometry(
maxWidth = x + menuPtr->entries[lastEntry]->width + borderWidth;
}
x = borderWidth;
- for (j = lastRowBreak; j < menuPtr->numEntries; j++) {
+ for (j = lastRowBreak; j < (int)menuPtr->numEntries; j++) {
if (j == helpMenuIndex) {
continue;
}
@@ -1283,6 +1308,10 @@ DrawTearoffEntry(
XPoint points[2];
int segmentWidth, maxX;
Tk_3DBorder border;
+ (void)mePtr;
+ (void)gc;
+ (void)tkfont;
+ (void)fmPtr;
if (menuPtr->menuType != MASTER_MENU) {
return;
@@ -1331,6 +1360,9 @@ TkpInitializeMenuBindings(
Tk_BindingTable bindingTable)
/* The table to add to. */
{
+ (void)interp;
+ (void)bindingTable;
+
/*
* Nothing to do.
*/
@@ -1379,7 +1411,7 @@ SetHelpMenu(
&& (cascadeEntryPtr->menuPtr->masterMenuPtr->tkwin != NULL)
&& (menuPtr->masterMenuPtr->tkwin != NULL)) {
TkMenu *masterMenuPtr = cascadeEntryPtr->menuPtr->masterMenuPtr;
- char *helpMenuName = ckalloc(strlen(Tk_PathName(
+ char *helpMenuName = (char *)ckalloc(strlen(Tk_PathName(
masterMenuPtr->tkwin)) + strlen(".help") + 1);
strcpy(helpMenuName, Tk_PathName(masterMenuPtr->tkwin));
@@ -1713,7 +1745,7 @@ TkpComputeStandardMenuGeometry(
Tk_GetFontMetrics(menuFont, &menuMetrics);
accelSpace = Tk_TextWidth(menuFont, "M", 1);
- for (i = 0; i < menuPtr->numEntries; i++) {
+ for (i = 0; i < (int)menuPtr->numEntries; i++) {
mePtr = menuPtr->entries[i];
if (mePtr->fontPtr == NULL) {
tkfont = menuFont;
@@ -1808,7 +1840,7 @@ TkpComputeStandardMenuGeometry(
if (accelWidth != 0) {
labelWidth += accelSpace;
}
- for (j = lastColumnBreak; j < menuPtr->numEntries; j++) {
+ for (j = lastColumnBreak; j < (int)menuPtr->numEntries; j++) {
menuPtr->entries[j]->indicatorSpace = indicatorSpace;
menuPtr->entries[j]->labelWidth = labelWidth;
menuPtr->entries[j]->width = indicatorSpace + labelWidth
@@ -1855,9 +1887,12 @@ TkpComputeStandardMenuGeometry(
void
TkpMenuNotifyToplevelCreate(
- Tcl_Interp *interp, /* The interp the menu lives in. */
+ Tcl_Interp *dummy, /* The interp the menu lives in. */
const char *menuName) /* The name of the menu to reconfigure. */
{
+ (void)dummy;
+ (void)menuName;
+
/*
* Nothing to do.
*/
diff --git a/unix/tkUnixMenubu.c b/unix/tkUnixMenubu.c
index c49f15b..407dc30 100644
--- a/unix/tkUnixMenubu.c
+++ b/unix/tkUnixMenubu.c
@@ -34,7 +34,9 @@ TkMenuButton *
TkpCreateMenuButton(
Tk_Window tkwin)
{
- return ckalloc(sizeof(TkMenuButton));
+ (void)tkwin;
+
+ return (TkMenuButton *)ckalloc(sizeof(TkMenuButton));
}
/*
@@ -58,14 +60,14 @@ void
TkpDisplayMenuButton(
ClientData clientData) /* Information about widget. */
{
- register TkMenuButton *mbPtr = clientData;
+ TkMenuButton *mbPtr = (TkMenuButton *)clientData;
GC gc;
Tk_3DBorder border;
Pixmap pixmap;
int x = 0; /* Initialization needed only to stop compiler
* warning. */
int y = 0;
- register Tk_Window tkwin = mbPtr->tkwin;
+ Tk_Window tkwin = mbPtr->tkwin;
int fullWidth, fullHeight;
int textXOffset, textYOffset;
int imageWidth, imageHeight;
@@ -321,6 +323,7 @@ void
TkpDestroyMenuButton(
TkMenuButton *mbPtr)
{
+ (void)mbPtr;
}
/*
diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h
index dbd5e09..347c9d8 100644
--- a/unix/tkUnixPort.h
+++ b/unix/tkUnixPort.h
@@ -18,17 +18,15 @@
#define __UNIX__ 1
#include <stdio.h>
-#include <ctype.h>
+#include <pwd.h>
+#include <assert.h>
+#include <errno.h>
#include <fcntl.h>
-#include <limits.h>
+#include <ctype.h>
#include <math.h>
-#include <pwd.h>
-#ifdef NO_STDLIB_H
-# include "../compat/stdlib.h"
-#else
-# include <stdlib.h>
-#endif
#include <string.h>
+#include <limits.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/file.h>
#ifdef HAVE_SYS_SELECT_H
@@ -43,18 +41,17 @@
# include <time.h>
#else
# if HAVE_SYS_TIME_H
-# include <sys/time.h>
+# include <sys/time.h>
# else
-# include <time.h>
+# include <time.h>
# endif
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
-#ifndef NO_UNISTD_H
-# include <unistd.h>
-#else
-# include "../compat/unistd.h"
+#include <unistd.h>
+#if defined(__GNUC__) && !defined(__cplusplus)
+# pragma GCC diagnostic ignored "-Wc++-compat"
#endif
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
@@ -109,32 +106,19 @@
# define NBBY 8
#endif
-#ifdef __CYGWIN__
-# include "tkIntXlibDecls.h"
-# define UINT unsigned int
-# define HWND void *
-# define HDC void *
-# define HINSTANCE void *
-# define COLORREF void *
-# define HMENU void *
-# define TkWinDCState void
-# define HPALETTE void *
-# define WNDPROC void *
-# define WPARAM void *
-# define LPARAM void *
-# define LRESULT void *
-
-#else /* !__CYGWIN__ */
- /*
- * The TkPutImage macro strips off the color table information, which isn't
- * needed for X.
- */
-
-# define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \
- XPutImage(display, pixels, gc, image, srcx, srcy, destx, \
- desty, width, height);
-
-#endif /* !__CYGWIN__ */
+#include "tkIntXlibDecls.h"
+#define UINT unsigned int
+#define HWND void *
+#define HDC void *
+#define HINSTANCE void *
+#define COLORREF void *
+#define HMENU void *
+#define TkWinDCState void
+#define HPALETTE void *
+#define WNDPROC void *
+#define WPARAM void *
+#define LPARAM void *
+#define LRESULT void *
/*
* Supply macros for seek offsets, if they're not already provided by
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index 9c15369..c154f96 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -50,31 +50,44 @@ typedef struct {
* the information isn't retrievable from the GC.
*/
-typedef struct ThreadSpecificData {
+typedef struct {
Region clipRegion; /* The clipping region, or None. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
/*
- * Package initialization:
- * Nothing to do here except register the fact that we're using Xft in
- * the TIP 59 configuration database.
+ *-------------------------------------------------------------------------
+ *
+ * TkpFontPkgInit --
+ *
+ * This procedure is called when an application is created. It
+ * initializes all the structures that are used by the
+ * platform-dependant code on a per application basis.
+ * Note that this is called before TkpInit() !
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *-------------------------------------------------------------------------
*/
-#ifndef TCL_CFGVAL_ENCODING
-#define TCL_CFGVAL_ENCODING "ascii"
-#endif
+
+static int utf8ToUcs4(const char *source, FcChar32 *c, int numBytes)
+{
+ if (numBytes >= 6) {
+ return TkUtfToUniChar(source, (int *)c);
+ }
+ return FcUtf8ToUcs4((const FcChar8 *)source, c, numBytes);
+}
void
TkpFontPkgInit(
TkMainInfo *mainPtr) /* The application being created. */
{
- static const Tcl_Config cfg[] = {
- { "fontsystem", "xft" },
- { 0,0 }
- };
-
- Tcl_RegisterConfig(mainPtr->interp, "tk", cfg, TCL_CFGVAL_ENCODING);
+ (void)mainPtr;
}
static XftFont *
@@ -247,6 +260,23 @@ GetTkFontMetrics(
*---------------------------------------------------------------------------
*/
+static void
+FinishedWithFont(
+ UnixFtFont *fontPtr);
+
+static int
+InitFontErrorProc(
+ ClientData clientData,
+ TCL_UNUSED(XErrorEvent *))
+{
+ int *errorFlagPtr = (int *)clientData;
+
+ if (errorFlagPtr != NULL) {
+ *errorFlagPtr = 1;
+ }
+ return 0;
+}
+
static UnixFtFont *
InitFont(
Tk_Window tkwin,
@@ -257,10 +287,11 @@ InitFont(
FcCharSet *charset;
FcResult result;
XftFont *ftFont;
- int i, iWidth;
+ int i, iWidth, errorFlag;
+ Tk_ErrorHandler handler;
if (!fontPtr) {
- fontPtr = ckalloc(sizeof(UnixFtFont));
+ fontPtr = (UnixFtFont *)ckalloc(sizeof(UnixFtFont));
}
FcConfigSubstitute(0, pattern, FcMatchPattern);
@@ -271,14 +302,14 @@ InitFont(
*/
set = FcFontSort(0, pattern, FcTrue, NULL, &result);
- if (!set) {
+ if (!set || set->nfont == 0) {
ckfree(fontPtr);
return NULL;
}
fontPtr->fontset = set;
fontPtr->pattern = pattern;
- fontPtr->faces = ckalloc(set->nfont * sizeof(UnixFtFace));
+ fontPtr->faces = (UnixFtFace *)ckalloc(set->nfont * sizeof(UnixFtFace));
fontPtr->nfaces = set->nfont;
/*
@@ -308,10 +339,25 @@ InitFont(
* Fill in platform-specific fields of TkFont.
*/
+ errorFlag = 0;
+ handler = Tk_CreateErrorHandler(Tk_Display(tkwin),
+ -1, -1, -1, InitFontErrorProc, (ClientData) &errorFlag);
ftFont = GetFont(fontPtr, 0, 0.0);
+ if ((ftFont == NULL) || errorFlag) {
+ Tk_DeleteErrorHandler(handler);
+ FinishedWithFont(fontPtr);
+ ckfree(fontPtr);
+ return NULL;
+ }
fontPtr->font.fid = XLoadFont(Tk_Display(tkwin), "fixed");
GetTkFontAttributes(ftFont, &fontPtr->font.fa);
GetTkFontMetrics(ftFont, &fontPtr->font.fm);
+ Tk_DeleteErrorHandler(handler);
+ if (errorFlag) {
+ FinishedWithFont(fontPtr);
+ ckfree(fontPtr);
+ return NULL;
+ }
/*
* Fontconfig can't report any information about the position or thickness
@@ -336,7 +382,16 @@ InitFont(
TkFont *fPtr = &fontPtr->font;
fPtr->underlinePos = fPtr->fm.descent / 2;
+ handler = Tk_CreateErrorHandler(Tk_Display(tkwin),
+ -1, -1, -1, InitFontErrorProc, (ClientData) &errorFlag);
+ errorFlag = 0;
Tk_MeasureChars((Tk_Font) fPtr, "I", 1, -1, 0, &iWidth);
+ Tk_DeleteErrorHandler(handler);
+ if (errorFlag) {
+ FinishedWithFont(fontPtr);
+ ckfree(fontPtr);
+ return NULL;
+ }
fPtr->underlineHeight = iWidth / 3;
if (fPtr->underlineHeight == 0) {
fPtr->underlineHeight = 1;
@@ -627,6 +682,7 @@ TkpGetFontAttrsForChar(
/* UCS-4 character to map */
XftFont *ftFont = GetFont(fontPtr, ucs4, 0.0);
/* Actual font used to render the character */
+ (void)tkwin;
GetTkFontAttributes(ftFont, faPtr);
faPtr->underline = fontPtr->font.fa.underline;
@@ -661,12 +717,15 @@ Tk_MeasureChars(
FcChar32 c;
XGlyphInfo extents;
int clen, curX, newX, curByte, newByte, sawNonSpace;
- int termByte = 0, termX = 0;
+ int termByte = 0, termX = 0, errorFlag = 0;
+ Tk_ErrorHandler handler;
#if DEBUG_FONTSEL
char string[256];
int len = 0;
#endif /* DEBUG_FONTSEL */
+ handler = Tk_CreateErrorHandler(fontPtr->display,
+ -1, -1, -1, InitFontErrorProc, &errorFlag);
curX = 0;
curByte = 0;
sawNonSpace = 0;
@@ -702,7 +761,12 @@ Tk_MeasureChars(
#endif /* DEBUG_FONTSEL */
ftFont = GetFont(fontPtr, c, 0.0);
- XftTextExtents32(fontPtr->display, ftFont, &c, 1, &extents);
+ if (!errorFlag) {
+ XftTextExtents32(fontPtr->display, ftFont, &c, 1, &extents);
+ } else {
+ extents.xOff = 0;
+ errorFlag = 0;
+ }
newX = curX + extents.xOff;
newByte = curByte + clen;
@@ -731,6 +795,7 @@ Tk_MeasureChars(
curX = newX;
curByte = newByte;
}
+ Tk_DeleteErrorHandler(handler);
#if DEBUG_FONTSEL
string[len] = '\0';
printf("MeasureChars %s length %d bytes %d\n", string, curX, curByte);
@@ -824,7 +889,7 @@ LookUpColor(Display *display, /* Display to lookup colors on */
fontPtr->colors[last].color.color.red = xcolor.red;
fontPtr->colors[last].color.color.green = xcolor.green;
fontPtr->colors[last].color.color.blue = xcolor.blue;
- fontPtr->colors[last].color.color.alpha = 0xffff;
+ fontPtr->colors[last].color.color.alpha = 0xFFFF;
fontPtr->colors[last].color.pixel = pixel;
/*
@@ -886,7 +951,7 @@ Tk_DrawChars(
}
XGetGCValues(display, gc, GCForeground, &values);
xftcolor = LookUpColor(display, fontPtr, values.foreground);
- if (tsdPtr->clipRegion != None) {
+ if (tsdPtr->clipRegion != NULL) {
XftDrawSetClip(fontPtr->ftDraw, tsdPtr->clipRegion);
}
nspec = 0;
@@ -894,7 +959,7 @@ Tk_DrawChars(
XftFont *ftFont;
FcChar32 c;
- clen = FcUtf8ToUcs4((FcChar8 *) source, &c, numBytes);
+ clen = utf8ToUcs4(source, &c, numBytes);
if (clen <= 0) {
/*
* This should not happen, but it can.
@@ -936,7 +1001,7 @@ Tk_DrawChars(
}
doUnderlineStrikeout:
- if (tsdPtr->clipRegion != None) {
+ if (tsdPtr->clipRegion != NULL) {
XftDrawSetClip(fontPtr->ftDraw, NULL);
}
if (fontPtr->font.fa.underline != 0) {
@@ -1028,13 +1093,13 @@ TkDrawAngledChars(
nglyph = 0;
currentFtFont = NULL;
- originX = originY = 0; /* lint */
+ originX = originY = 0;
while (numBytes > 0) {
XftFont *ftFont;
FcChar32 c;
- clen = FcUtf8ToUcs4((FcChar8 *) source, &c, numBytes);
+ clen = utf8ToUcs4(source, &c, numBytes);
if (clen <= 0) {
/*
* This should not happen, but it can.
@@ -1130,7 +1195,7 @@ TkDrawAngledChars(
}
XGetGCValues(display, gc, GCForeground, &values);
xftcolor = LookUpColor(display, fontPtr, values.foreground);
- if (tsdPtr->clipRegion != None) {
+ if (tsdPtr->clipRegion != NULL) {
XftDrawSetClip(fontPtr->ftDraw, tsdPtr->clipRegion);
}
nspec = 0;
@@ -1138,7 +1203,7 @@ TkDrawAngledChars(
XftFont *ftFont, *ft0Font;
FcChar32 c;
- clen = FcUtf8ToUcs4((FcChar8 *) source, &c, numBytes);
+ clen = utf8ToUcs4(source, &c, numBytes);
if (clen <= 0) {
/*
* This should not happen, but it can.
@@ -1182,7 +1247,7 @@ TkDrawAngledChars(
#endif /* XFT_HAS_FIXED_ROTATED_PLACEMENT */
doUnderlineStrikeout:
- if (tsdPtr->clipRegion != None) {
+ if (tsdPtr->clipRegion != NULL) {
XftDrawSetClip(fontPtr->ftDraw, NULL);
}
if (fontPtr->font.fa.underline || fontPtr->font.fa.overstrike) {
@@ -1243,12 +1308,12 @@ TkDrawAngledChars(
void
TkUnixSetXftClipRegion(
- TkRegion clipRegion) /* The clipping region to install. */
+ Region clipRegion) /* The clipping region to install. */
{
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- tsdPtr->clipRegion = (Region) clipRegion;
+ tsdPtr->clipRegion = clipRegion;
}
/*
diff --git a/unix/tkUnixScale.c b/unix/tkUnixScale.c
index 8427cfe..b090c4f 100644
--- a/unix/tkUnixScale.c
+++ b/unix/tkUnixScale.c
@@ -24,11 +24,13 @@
static void DisplayHorizontalScale(TkScale *scalePtr,
Drawable drawable, XRectangle *drawnAreaPtr);
static void DisplayHorizontalValue(TkScale *scalePtr,
- Drawable drawable, double value, int top);
+ Drawable drawable, double value, int top,
+ const char *format);
static void DisplayVerticalScale(TkScale *scalePtr,
Drawable drawable, XRectangle *drawnAreaPtr);
static void DisplayVerticalValue(TkScale *scalePtr,
- Drawable drawable, double value, int rightEdge);
+ Drawable drawable, double value, int rightEdge,
+ const char *format);
/*
*----------------------------------------------------------------------
@@ -50,7 +52,9 @@ TkScale *
TkpCreateScale(
Tk_Window tkwin)
{
- return ckalloc(sizeof(TkScale));
+ (void)tkwin;
+
+ return (TkScale *)ckalloc(sizeof(TkScale));
}
/*
@@ -165,7 +169,7 @@ DisplayVerticalScale(
}
}
DisplayVerticalValue(scalePtr, drawable, tickValue,
- scalePtr->vertTickRightX);
+ scalePtr->vertTickRightX, scalePtr->tickFormat);
}
}
}
@@ -176,7 +180,7 @@ DisplayVerticalScale(
if (scalePtr->showValue) {
DisplayVerticalValue(scalePtr, drawable, scalePtr->value,
- scalePtr->vertValueRightX);
+ scalePtr->vertValueRightX, scalePtr->valueFormat);
}
/*
@@ -228,8 +232,8 @@ DisplayVerticalScale(
Tk_GetFontMetrics(scalePtr->tkfont, &fm);
Tk_DrawChars(scalePtr->display, drawable, scalePtr->textGC,
scalePtr->tkfont, scalePtr->label,
- scalePtr->labelLength, scalePtr->vertLabelX,
- scalePtr->inset + (3*fm.ascent)/2);
+ scalePtr->labelLength, scalePtr->vertLabelX,
+ scalePtr->inset + (3 * fm.ascent) / 2);
}
}
@@ -254,25 +258,26 @@ DisplayVerticalScale(
static void
DisplayVerticalValue(
- register TkScale *scalePtr, /* Information about widget in which to
+ TkScale *scalePtr, /* Information about widget in which to
* display value. */
Drawable drawable, /* Pixmap or window in which to draw the
* value. */
double value, /* Y-coordinate of number to display,
* specified in application coords, not in
* pixels (we'll compute pixels). */
- int rightEdge) /* X-coordinate of right edge of text,
+ int rightEdge, /* X-coordinate of right edge of text,
* specified in pixels. */
+ const char *format) /* Format string to use for the value */
{
- register Tk_Window tkwin = scalePtr->tkwin;
+ Tk_Window tkwin = scalePtr->tkwin;
int y, width, length;
char valueString[TCL_DOUBLE_SPACE];
Tk_FontMetrics fm;
Tk_GetFontMetrics(scalePtr->tkfont, &fm);
y = TkScaleValueToPixel(scalePtr, value) + fm.ascent/2;
- if (snprintf(valueString, TCL_DOUBLE_SPACE, scalePtr->format, value) < 0) {
- valueString[TCL_DOUBLE_SPACE - 1] = '\0';
+ if (snprintf(valueString, TCL_DOUBLE_SPACE, format, value) < 0) {
+ valueString[TCL_DOUBLE_SPACE - 1] = '\0';
}
length = (int) strlen(valueString);
width = Tk_TextWidth(scalePtr->tkfont, valueString, length);
@@ -282,10 +287,10 @@ DisplayVerticalValue(
* the window.
*/
- if ((y - fm.ascent) < (scalePtr->inset + SPACING)) {
+ if (y - fm.ascent < scalePtr->inset + SPACING) {
y = scalePtr->inset + SPACING + fm.ascent;
}
- if ((y + fm.descent) > (Tk_Height(tkwin) - scalePtr->inset - SPACING)) {
+ if (y + fm.descent > Tk_Height(tkwin) - scalePtr->inset - SPACING) {
y = Tk_Height(tkwin) - scalePtr->inset - SPACING - fm.descent;
}
Tk_DrawChars(scalePtr->display, drawable, scalePtr->textGC,
@@ -322,9 +327,9 @@ DisplayHorizontalScale(
* to reflect the part of the window that was
* redrawn. */
{
- register Tk_Window tkwin = scalePtr->tkwin;
+ Tk_Window tkwin = scalePtr->tkwin;
int x, y, width, height, shadowWidth;
- double tickValue, tickInterval = scalePtr->tickInterval;
+ double tickInterval = scalePtr->tickInterval;
Tk_3DBorder sliderBorder;
/*
@@ -348,7 +353,7 @@ DisplayHorizontalScale(
if (tickInterval != 0) {
char valueString[TCL_DOUBLE_SPACE];
- double ticks, maxTicks;
+ double ticks, maxTicks, tickValue;
/*
* Ensure that we will only draw enough of the tick values such
@@ -358,17 +363,17 @@ DisplayHorizontalScale(
ticks = fabs((scalePtr->toValue - scalePtr->fromValue)
/ tickInterval);
- if (snprintf(valueString, TCL_DOUBLE_SPACE, scalePtr->format,
- scalePtr->fromValue) < 0) {
- valueString[TCL_DOUBLE_SPACE - 1] = '\0';
- }
+ if (snprintf(valueString, TCL_DOUBLE_SPACE, scalePtr->tickFormat,
+ scalePtr->fromValue) < 0) {
+ valueString[TCL_DOUBLE_SPACE - 1] = '\0';
+ }
maxTicks = (double) Tk_Width(tkwin)
/ (double) Tk_TextWidth(scalePtr->tkfont, valueString, -1);
if (ticks > maxTicks) {
- tickInterval *= (ticks / maxTicks);
+ tickInterval *= ticks / maxTicks;
}
- for (tickValue = scalePtr->fromValue; ;
- tickValue += tickInterval) {
+ tickValue = scalePtr->fromValue;
+ while (1) {
/*
* The TkRoundValueToResolution call gets rid of accumulated
* round-off errors, if any.
@@ -385,7 +390,8 @@ DisplayHorizontalScale(
}
}
DisplayHorizontalValue(scalePtr, drawable, tickValue,
- scalePtr->horizTickY);
+ scalePtr->horizTickY, scalePtr->tickFormat);
+ tickValue += tickInterval;
}
}
}
@@ -396,7 +402,7 @@ DisplayHorizontalScale(
if (scalePtr->showValue) {
DisplayHorizontalValue(scalePtr, drawable, scalePtr->value,
- scalePtr->horizValueY);
+ scalePtr->horizValueY, scalePtr->valueFormat);
}
/*
@@ -449,8 +455,8 @@ DisplayHorizontalScale(
Tk_GetFontMetrics(scalePtr->tkfont, &fm);
Tk_DrawChars(scalePtr->display, drawable, scalePtr->textGC,
scalePtr->tkfont, scalePtr->label,
- scalePtr->labelLength, scalePtr->inset + fm.ascent/2,
- scalePtr->horizLabelY + fm.ascent);
+ scalePtr->labelLength, scalePtr->inset + fm.ascent/2,
+ scalePtr->horizLabelY + fm.ascent);
}
}
@@ -475,17 +481,18 @@ DisplayHorizontalScale(
static void
DisplayHorizontalValue(
- register TkScale *scalePtr, /* Information about widget in which to
+ TkScale *scalePtr, /* Information about widget in which to
* display value. */
Drawable drawable, /* Pixmap or window in which to draw the
* value. */
double value, /* X-coordinate of number to display,
* specified in application coords, not in
* pixels (we'll compute pixels). */
- int top) /* Y-coordinate of top edge of text, specified
+ int top, /* Y-coordinate of top edge of text, specified
* in pixels. */
+ const char *format) /* Format string to use for the value */
{
- register Tk_Window tkwin = scalePtr->tkwin;
+ Tk_Window tkwin = scalePtr->tkwin;
int x, y, length, width;
char valueString[TCL_DOUBLE_SPACE];
Tk_FontMetrics fm;
@@ -493,8 +500,8 @@ DisplayHorizontalValue(
x = TkScaleValueToPixel(scalePtr, value);
Tk_GetFontMetrics(scalePtr->tkfont, &fm);
y = top + fm.ascent;
- if (snprintf(valueString, TCL_DOUBLE_SPACE, scalePtr->format, value) < 0) {
- valueString[TCL_DOUBLE_SPACE - 1] = '\0';
+ if (snprintf(valueString, TCL_DOUBLE_SPACE, format, value) < 0) {
+ valueString[TCL_DOUBLE_SPACE - 1] = '\0';
}
length = (int) strlen(valueString);
width = Tk_TextWidth(scalePtr->tkfont, valueString, length);
@@ -504,8 +511,8 @@ DisplayHorizontalValue(
* the window.
*/
- x -= (width)/2;
- if (x < (scalePtr->inset + SPACING)) {
+ x -= width / 2;
+ if (x < scalePtr->inset + SPACING) {
x = scalePtr->inset + SPACING;
}
@@ -541,7 +548,7 @@ void
TkpDisplayScale(
ClientData clientData) /* Widget record for scale. */
{
- TkScale *scalePtr = clientData;
+ TkScale *scalePtr = (TkScale *)clientData;
Tk_Window tkwin = scalePtr->tkwin;
Tcl_Interp *interp = scalePtr->interp;
Pixmap pixmap;
@@ -562,10 +569,10 @@ TkpDisplayScale(
Tcl_Preserve(scalePtr);
if ((scalePtr->flags & INVOKE_COMMAND) && (scalePtr->command != NULL)) {
Tcl_Preserve(interp);
- if (snprintf(string, TCL_DOUBLE_SPACE, scalePtr->format,
- scalePtr->value) < 0) {
- string[TCL_DOUBLE_SPACE - 1] = '\0';
- }
+ if (snprintf(string, TCL_DOUBLE_SPACE, scalePtr->valueFormat,
+ scalePtr->value) < 0) {
+ string[TCL_DOUBLE_SPACE - 1] = '\0';
+ }
Tcl_DStringInit(&buf);
Tcl_DStringAppend(&buf, scalePtr->command, -1);
Tcl_DStringAppend(&buf, " ", -1);
@@ -634,7 +641,7 @@ TkpDisplayScale(
gc = Tk_GCForColor(scalePtr->highlightColorPtr, pixmap);
} else {
gc = Tk_GCForColor(
- Tk_3DBorderColor(scalePtr->highlightBorder), pixmap);
+ Tk_3DBorderColor(scalePtr->highlightBorder), pixmap);
}
Tk_DrawFocusHighlight(tkwin, gc, scalePtr->highlightWidth, pixmap);
}
@@ -696,7 +703,7 @@ TkpScaleElement(
if (y < sliderFirst) {
return TROUGH1;
}
- if (y < (sliderFirst+scalePtr->sliderLength)) {
+ if (y < sliderFirst + scalePtr->sliderLength) {
return SLIDER;
}
return TROUGH2;
@@ -716,7 +723,7 @@ TkpScaleElement(
if (x < sliderFirst) {
return TROUGH1;
}
- if (x < (sliderFirst+scalePtr->sliderLength)) {
+ if (x < sliderFirst + scalePtr->sliderLength) {
return SLIDER;
}
return TROUGH2;
diff --git a/unix/tkUnixScrlbr.c b/unix/tkUnixScrlbr.c
index d3e4436..69843db 100644
--- a/unix/tkUnixScrlbr.c
+++ b/unix/tkUnixScrlbr.c
@@ -63,7 +63,7 @@ TkScrollbar *
TkpCreateScrollbar(
Tk_Window tkwin)
{
- UnixScrollbar *scrollPtr = ckalloc(sizeof(UnixScrollbar));
+ UnixScrollbar *scrollPtr = (UnixScrollbar *)ckalloc(sizeof(UnixScrollbar));
scrollPtr->troughGC = NULL;
scrollPtr->copyGC = NULL;
@@ -97,8 +97,8 @@ void
TkpDisplayScrollbar(
ClientData clientData) /* Information about window. */
{
- register TkScrollbar *scrollPtr = clientData;
- register Tk_Window tkwin = scrollPtr->tkwin;
+ TkScrollbar *scrollPtr = (TkScrollbar *)clientData;
+ Tk_Window tkwin = scrollPtr->tkwin;
XPoint points[7];
Tk_3DBorder border;
int relief, width, elementBorderWidth;
@@ -277,7 +277,7 @@ TkpDisplayScrollbar(
extern void
TkpComputeScrollbarGeometry(
- register TkScrollbar *scrollPtr)
+ TkScrollbar *scrollPtr)
/* Scrollbar whose geometry may have
* changed. */
{
@@ -394,22 +394,22 @@ TkpDestroyScrollbar(
void
TkpConfigureScrollbar(
- register TkScrollbar *scrollPtr)
+ TkScrollbar *scrollPtr)
/* Information about widget; may or may not
* already have values for some fields. */
{
XGCValues gcValues;
- GC new;
+ GC newGC;
UnixScrollbar *unixScrollPtr = (UnixScrollbar *) scrollPtr;
Tk_SetBackgroundFromBorder(scrollPtr->tkwin, scrollPtr->bgBorder);
gcValues.foreground = scrollPtr->troughColorPtr->pixel;
- new = Tk_GetGC(scrollPtr->tkwin, GCForeground, &gcValues);
+ newGC = Tk_GetGC(scrollPtr->tkwin, GCForeground, &gcValues);
if (unixScrollPtr->troughGC != NULL) {
Tk_FreeGC(scrollPtr->display, unixScrollPtr->troughGC);
}
- unixScrollPtr->troughGC = new;
+ unixScrollPtr->troughGC = newGC;
if (unixScrollPtr->copyGC == NULL) {
gcValues.graphics_exposures = False;
unixScrollPtr->copyGC = Tk_GetGC(scrollPtr->tkwin,
@@ -437,12 +437,12 @@ TkpConfigureScrollbar(
int
TkpScrollbarPosition(
- register TkScrollbar *scrollPtr,
+ TkScrollbar *scrollPtr,
/* Scrollbar widget record. */
int x, int y) /* Coordinates within scrollPtr's window. */
{
int length, width, tmp;
- register const int inset = scrollPtr->inset;
+ const int inset = scrollPtr->inset;
if (scrollPtr->vertical) {
length = Tk_Height(scrollPtr->tkwin);
diff --git a/unix/tkUnixSelect.c b/unix/tkUnixSelect.c
index 6155f54..58c3abc 100644
--- a/unix/tkUnixSelect.c
+++ b/unix/tkUnixSelect.c
@@ -21,7 +21,7 @@ typedef struct ConvertInfo {
* offset of the next chunk of data to
* transfer. */
Tcl_EncodingState state; /* The encoding state needed across chunks. */
- char buffer[4]; /* A buffer to hold part of a UTF character
+ char buffer[4]; /* A buffer to hold part of a UTF character
* that is split across chunks.*/
} ConvertInfo;
@@ -68,7 +68,7 @@ typedef struct IncrInfo {
* currently pending. */
} IncrInfo;
-typedef struct ThreadSpecificData {
+typedef struct {
IncrInfo *pendingIncrs; /* List of all incr structures currently
* active. */
} ThreadSpecificData;
@@ -240,17 +240,17 @@ TkSelGetSelection(
void
TkSelPropProc(
- register XEvent *eventPtr) /* X PropertyChange event. */
+ XEvent *eventPtr) /* X PropertyChange event. */
{
- register IncrInfo *incrPtr;
- register TkSelHandler *selPtr;
+ IncrInfo *incrPtr;
+ TkSelHandler *selPtr;
int length, numItems;
unsigned long i;
Atom target, formatType;
long buffer[TK_SEL_WORDS_AT_ONCE];
TkDisplay *dispPtr = TkGetDisplay(eventPtr->xany.display);
Tk_ErrorHandler errorHandler;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -356,7 +356,7 @@ TkSelPropProc(
((char *) buffer)[numItems] = 0;
errorHandler = Tk_CreateErrorHandler(eventPtr->xproperty.display,
- -1, -1, -1, (int (*)()) NULL, NULL);
+ -1, -1, -1, NULL, NULL);
/*
* Encode the data using the proper format for each type.
@@ -446,10 +446,10 @@ TkSelPropProc(
* Preserve any left-over bytes.
*/
- if (srcLen > 4) {
+ if (srcLen > 3) {
Tcl_Panic("selection conversion left too many bytes unconverted");
}
- memcpy(incrPtr->converts[i].buffer, src, (size_t) srcLen+1);
+ memcpy(incrPtr->converts[i].buffer, src, srcLen + 1);
Tcl_DStringFree(&ds);
} else {
/*
@@ -519,10 +519,10 @@ TkSelPropProc(
void
TkSelEventProc(
Tk_Window tkwin, /* Window for which event was targeted. */
- register XEvent *eventPtr) /* X event: either SelectionClear,
+ XEvent *eventPtr) /* X event: either SelectionClear,
* SelectionRequest, or SelectionNotify. */
{
- register TkWindow *winPtr = (TkWindow *) tkwin;
+ TkWindow *winPtr = (TkWindow *) tkwin;
TkDisplay *dispPtr = winPtr->dispPtr;
Tcl_Interp *interp;
@@ -540,7 +540,7 @@ TkSelEventProc(
*/
if (eventPtr->type == SelectionNotify) {
- register TkSelRetrievalInfo *retrPtr;
+ TkSelRetrievalInfo *retrPtr;
char *propInfo, **propInfoPtr = &propInfo;
Atom type;
int format, result;
@@ -649,7 +649,7 @@ TkSelEventProc(
}
if (propInfo[numItems] != '\0') {
- propData = ckalloc(numItems + 1);
+ propData = (char *)ckalloc(numItems + 1);
strcpy(propData, propInfo);
propData[numItems] = '\0';
}
@@ -742,7 +742,7 @@ static void
SelTimeoutProc(
ClientData clientData) /* Information about retrieval in progress. */
{
- register TkSelRetrievalInfo *retrPtr = clientData;
+ TkSelRetrievalInfo *retrPtr = (TkSelRetrievalInfo *)clientData;
/*
* Make sure that the retrieval is still in progress. Then see how long
@@ -796,7 +796,7 @@ ConvertSelection(
* request; may not be selection's current
* owner, be we set it to the current
* owner. */
- register XSelectionRequestEvent *eventPtr)
+ XSelectionRequestEvent *eventPtr)
/* Event describing request. */
{
union {
@@ -813,11 +813,11 @@ ConvertSelection(
Tk_ErrorHandler errorHandler;
TkSelectionInfo *infoPtr;
TkSelInProgress ip;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- errorHandler = Tk_CreateErrorHandler(eventPtr->display, -1, -1,-1,
- (int (*)()) NULL, NULL);
+ errorHandler = Tk_CreateErrorHandler(eventPtr->display, -1, -1,
+ -1, NULL, NULL);
/*
* Initialize the reply event.
@@ -893,12 +893,12 @@ ConvertSelection(
* below).
*/
- incr.converts = ckalloc(incr.numConversions * sizeof(ConvertInfo));
+ incr.converts = (ConvertInfo *)ckalloc(incr.numConversions * sizeof(ConvertInfo));
incr.numIncrs = 0;
for (i = 0; i < incr.numConversions; i++) {
Atom target, property, type;
long buffer[TK_SEL_WORDS_AT_ONCE];
- register TkSelHandler *selPtr;
+ TkSelHandler *selPtr;
int numItems, format;
char *propPtr;
@@ -919,7 +919,7 @@ ConvertSelection(
/*
* Nobody seems to know about this kind of request. If it's of a
* sort that we can handle without any help, do it. Otherwise mark
- * the request as an errror.
+ * the request as an error.
*/
numItems = TkSelDefaultSelection(infoPtr, target, (char *) buffer,
@@ -1064,7 +1064,7 @@ ConvertSelection(
}
Tcl_DeleteTimerHandler(incr.timeout);
errorHandler = Tk_CreateErrorHandler(winPtr->display,
- -1, -1, -1, (int (*)()) NULL, NULL);
+ -1, -1, -1, NULL, NULL);
XSelectInput(reply.xsel.display, reply.xsel.requestor, 0L);
Tk_DeleteErrorHandler(errorHandler);
if (tsdPtr->pendingIncrs == &incr) {
@@ -1124,9 +1124,9 @@ ConvertSelection(
static void
SelRcvIncrProc(
ClientData clientData, /* Information about retrieval. */
- register XEvent *eventPtr) /* X PropertyChange event. */
+ XEvent *eventPtr) /* X PropertyChange event. */
{
- register TkSelRetrievalInfo *retrPtr = clientData;
+ TkSelRetrievalInfo *retrPtr = (TkSelRetrievalInfo *)clientData;
char *propInfo, **propInfoPtr = &propInfo;
Atom type;
int format, result;
@@ -1374,7 +1374,7 @@ IncrTimeoutProc(
* retrieval for which we are selection
* owner. */
{
- register IncrInfo *incrPtr = clientData;
+ IncrInfo *incrPtr = (IncrInfo *)clientData;
incrPtr->idleTime++;
if (incrPtr->idleTime >= 5) {
@@ -1435,7 +1435,7 @@ SelCvtToX(
if (Tcl_SplitList(NULL, string, &numFields, &field) != TCL_OK) {
return NULL;
}
- propPtr = ckalloc(numFields * sizeof(long));
+ propPtr = (long *)ckalloc(numFields * sizeof(long));
/*
* Convert the fields one-by-one.
@@ -1487,7 +1487,7 @@ SelCvtToX(
static void
SelCvtFromX32(
- register long *propPtr, /* Property value from X. */
+ long *propPtr, /* Property value from X. */
int numValues, /* Number of 32-bit values in property. */
Atom type, /* Type of property Should not be XA_STRING
* (if so, don't bother calling this function
@@ -1520,7 +1520,7 @@ SelCvtFromX32(
static void
SelCvtFromX8(
- register char *propPtr, /* Property value from X. */
+ char *propPtr, /* Property value from X. */
int numValues, /* Number of 8-bit values in property. */
Atom type, /* Type of property Should not be XA_STRING
* (if so, don't bother calling this function
@@ -1528,6 +1528,9 @@ SelCvtFromX8(
Tk_Window tkwin, /* Window to use for atom conversion. */
Tcl_DString *dsPtr) /* Where to store the converted string. */
{
+ (void)type;
+ (void)tkwin;
+
/*
* Convert each long in the property to a string value, which is a
* hexadecimal string. We build the list in a Tcl_DString because this is
diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c
index 0b4f05d..6cf711c 100644
--- a/unix/tkUnixSend.c
+++ b/unix/tkUnixSend.c
@@ -97,7 +97,7 @@ typedef struct PendingCommand {
* NULL means end of list. */
} PendingCommand;
-typedef struct ThreadSpecificData {
+typedef struct {
PendingCommand *pendingCommands;
/* List of all commands currently being waited
* for. */
@@ -269,7 +269,7 @@ RegOpen(
handler = Tk_CreateErrorHandler(dispPtr->display, -1, -1, -1, NULL, NULL);
- regPtr = ckalloc(sizeof(NameRegistry));
+ regPtr = (NameRegistry *)ckalloc(sizeof(NameRegistry));
regPtr->dispPtr = dispPtr;
regPtr->locked = 0;
regPtr->modified = 0;
@@ -479,7 +479,7 @@ RegAddName(
sprintf(id, "%x ", (unsigned) commWindow);
idLength = strlen(id);
newBytes = idLength + strlen(name) + 1;
- newProp = ckalloc(regPtr->propLength + newBytes);
+ newProp = (char *)ckalloc(regPtr->propLength + newBytes);
strcpy(newProp, id);
strcpy(newProp+idLength, name);
if (regPtr->property != NULL) {
@@ -808,7 +808,7 @@ Tk_SetAppName(
const char *actualName;
Tcl_DString dString;
int offset, i;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
interp = winPtr->mainPtr->interp;
@@ -830,7 +830,7 @@ Tk_SetAppName(
* the "send" command to the interpreter.
*/
- riPtr = ckalloc(sizeof(RegisteredInterp));
+ riPtr = (RegisteredInterp *)ckalloc(sizeof(RegisteredInterp));
riPtr->interp = interp;
riPtr->dispPtr = winPtr->dispPtr;
riPtr->nextPtr = tsdPtr->interpListPtr;
@@ -914,7 +914,7 @@ Tk_SetAppName(
RegAddName(regPtr, actualName, Tk_WindowId(dispPtr->commTkwin));
RegClose(regPtr);
- riPtr->name = ckalloc(strlen(actualName) + 1);
+ riPtr->name = (char *)ckalloc(strlen(actualName) + 1);
strcpy(riPtr->name, actualName);
if (actualName != name) {
Tcl_DStringFree(&dString);
@@ -943,7 +943,7 @@ Tk_SetAppName(
int
Tk_SendObjCmd(
- ClientData clientData, /* Information about sender (only dispPtr
+ ClientData dummy, /* Information about sender (only dispPtr
* field is used). */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -958,7 +958,7 @@ Tk_SendObjCmd(
TkWindow *winPtr;
Window commWindow;
PendingCommand pending;
- register RegisteredInterp *riPtr;
+ RegisteredInterp *riPtr;
const char *destName;
int result, index, async, i, firstArg;
Tk_RestrictProc *prevProc;
@@ -967,10 +967,11 @@ Tk_SendObjCmd(
Tcl_Time timeout;
NameRegistry *regPtr;
Tcl_DString request;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_Interp *localInterp; /* Used when the interpreter to send the
* command to is within the same process. */
+ (void)dummy;
/*
* Process options, if any.
@@ -1175,7 +1176,7 @@ Tk_SendObjCmd(
msg = "target application died";
}
pending.code = TCL_ERROR;
- pending.result = ckalloc(strlen(msg) + 1);
+ pending.result = (char *)ckalloc(strlen(msg) + 1);
strcpy(pending.result, msg);
pending.gotResponse = 1;
} else {
@@ -1356,12 +1357,13 @@ TkSendCleanup(
static int
SendInit(
- Tcl_Interp *interp, /* Interpreter to use for error reporting (no
+ Tcl_Interp *dummy, /* Interpreter to use for error reporting (no
* errors are ever returned, but the
* interpreter is needed anyway). */
TkDisplay *dispPtr) /* Display to initialize. */
{
XSetWindowAttributes atts;
+ (void)dummy;
/*
* Create the window used for communication, and set up an event handler
@@ -1419,14 +1421,14 @@ SendEventProc(
ClientData clientData, /* Display information. */
XEvent *eventPtr) /* Information about event. */
{
- TkDisplay *dispPtr = clientData;
+ TkDisplay *dispPtr = (TkDisplay *)clientData;
char *propInfo, **propInfoPtr = &propInfo;
const char *p;
int result, actualFormat;
unsigned long numItems, bytesAfter;
Atom actualType;
Tcl_Interp *remoteInterp; /* Interp in which to execute the command. */
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if ((eventPtr->xproperty.atom != dispPtr->commProperty)
@@ -1698,16 +1700,16 @@ SendEventProc(
}
pcPtr->code = code;
if (resultString != NULL) {
- pcPtr->result = ckalloc(strlen(resultString) + 1);
+ pcPtr->result = (char *)ckalloc(strlen(resultString) + 1);
strcpy(pcPtr->result, resultString);
}
if (code == TCL_ERROR) {
if (errorInfo != NULL) {
- pcPtr->errorInfo = ckalloc(strlen(errorInfo) + 1);
+ pcPtr->errorInfo = (char *)ckalloc(strlen(errorInfo) + 1);
strcpy(pcPtr->errorInfo, errorInfo);
}
if (errorCode != NULL) {
- pcPtr->errorCode = ckalloc(strlen(errorCode) + 1);
+ pcPtr->errorCode = (char *)ckalloc(strlen(errorCode) + 1);
strcpy(pcPtr->errorCode, errorCode);
}
}
@@ -1774,16 +1776,16 @@ AppendPropCarefully(
* operation above.
*/
- /* ARGSUSED */
static int
AppendErrorProc(
ClientData clientData, /* Command to mark complete, or NULL. */
XErrorEvent *errorPtr) /* Information about error. */
{
- PendingCommand *pendingPtr = clientData;
- register PendingCommand *pcPtr;
- ThreadSpecificData *tsdPtr =
+ PendingCommand *pendingPtr = (PendingCommand *)clientData;
+ PendingCommand *pcPtr;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ (void)errorPtr;
if (pendingPtr == NULL) {
return 0;
@@ -1796,7 +1798,7 @@ AppendErrorProc(
for (pcPtr = tsdPtr->pendingCommands; pcPtr != NULL;
pcPtr = pcPtr->nextPtr) {
if ((pcPtr == pendingPtr) && (pcPtr->result == NULL)) {
- pcPtr->result = ckalloc(strlen(pcPtr->target) + 50);
+ pcPtr->result = (char *)ckalloc(strlen(pcPtr->target) + 50);
sprintf(pcPtr->result, "no application named \"%s\"",
pcPtr->target);
pcPtr->code = TCL_ERROR;
@@ -1829,10 +1831,10 @@ DeleteProc(
ClientData clientData) /* Info about registration, passed as
* ClientData. */
{
- RegisteredInterp *riPtr = clientData;
- register RegisteredInterp *riPtr2;
+ RegisteredInterp *riPtr = (RegisteredInterp *)clientData;
+ RegisteredInterp *riPtr2;
NameRegistry *regPtr;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
regPtr = RegOpen(riPtr->interp, riPtr->dispPtr, 1);
@@ -1874,13 +1876,13 @@ DeleteProc(
*----------------------------------------------------------------------
*/
- /* ARGSUSED */
static Tk_RestrictAction
SendRestrictProc(
- ClientData clientData, /* Not used. */
- register XEvent *eventPtr) /* Event that just arrived. */
+ ClientData dummy, /* Not used. */
+ XEvent *eventPtr) /* Event that just arrived. */
{
TkDisplay *dispPtr;
+ (void)dummy;
if (eventPtr->type != PropertyNotify) {
return TK_DEFER_EVENT;
@@ -1921,7 +1923,7 @@ UpdateCommWindow(
{
Tcl_DString names;
RegisteredInterp *riPtr;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_DStringInit(&names);
@@ -1954,7 +1956,6 @@ UpdateCommWindow(
*----------------------------------------------------------------------
*/
- /* ARGSUSED */
int
TkpTestsendCmd(
ClientData clientData, /* Main window for application. */
@@ -1968,7 +1969,7 @@ TkpTestsendCmd(
static const char *const testsendOptions[] = {
"bogus", "prop", "serial", NULL
};
- TkWindow *winPtr = clientData;
+ TkWindow *winPtr = (TkWindow *)clientData;
Tk_ErrorHandler handler;
int index;
@@ -2052,7 +2053,7 @@ TkpTestsendCmd(
Tcl_DStringFree(&tmp);
}
} else if (index == TESTSEND_SERIAL) {
- Tcl_SetObjResult(interp, Tcl_NewIntObj(localData.sendSerial+1));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(localData.sendSerial+1));
}
return TCL_OK;
}
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index f548bcd..155a988 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.c
@@ -36,7 +36,7 @@ typedef struct ProtocolHandler {
} ProtocolHandler;
#define HANDLER_SIZE(cmdLength) \
- (Tk_Offset(ProtocolHandler, command) + 1 + cmdLength)
+ (offsetof(ProtocolHandler, command) + 1 + cmdLength)
/*
* Data for [wm attributes] command:
@@ -564,10 +564,10 @@ void
TkWmNewWindow(
TkWindow *winPtr) /* Newly-created top-level window. */
{
- register WmInfo *wmPtr;
+ WmInfo *wmPtr;
TkDisplay *dispPtr = winPtr->dispPtr;
- wmPtr = ckalloc(sizeof(WmInfo));
+ wmPtr = (WmInfo *)ckalloc(sizeof(WmInfo));
memset(wmPtr, 0, sizeof(WmInfo));
wmPtr->winPtr = winPtr;
wmPtr->reparent = None;
@@ -659,7 +659,7 @@ TkWmMapWindow(
TkWindow *winPtr) /* Top-level window that's about to be
* mapped. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
XTextProperty textProp;
if (wmPtr->flags & WM_NEVER_MAPPED) {
@@ -827,7 +827,7 @@ void
TkWmDeadWindow(
TkWindow *winPtr) /* Top-level window that's being deleted. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
WmInfo *wmPtr2;
if (wmPtr == NULL) {
@@ -836,7 +836,7 @@ TkWmDeadWindow(
if ((WmInfo *) winPtr->dispPtr->firstWmPtr == wmPtr) {
winPtr->dispPtr->firstWmPtr = wmPtr->nextPtr;
} else {
- register WmInfo *prevPtr;
+ WmInfo *prevPtr;
for (prevPtr = (WmInfo *) winPtr->dispPtr->firstWmPtr; ;
prevPtr = prevPtr->nextPtr) {
@@ -980,18 +980,18 @@ TkWmSetClass(
if (winPtr->classUid != NULL) {
XClassHint *classPtr;
- Tcl_DString name, class;
+ Tcl_DString name, ds;
Tcl_UtfToExternalDString(NULL, winPtr->nameUid, -1, &name);
- Tcl_UtfToExternalDString(NULL, winPtr->classUid, -1, &class);
+ Tcl_UtfToExternalDString(NULL, winPtr->classUid, -1, &ds);
classPtr = XAllocClassHint();
classPtr->res_name = Tcl_DStringValue(&name);
- classPtr->res_class = Tcl_DStringValue(&class);
+ classPtr->res_class = Tcl_DStringValue(&ds);
XSetClassHint(winPtr->display, winPtr->wmInfoPtr->wrapperPtr->window,
classPtr);
XFree((char *) classPtr);
Tcl_DStringFree(&name);
- Tcl_DStringFree(&class);
+ Tcl_DStringFree(&ds);
}
}
@@ -1005,7 +1005,6 @@ TkWmSetClass(
*----------------------------------------------------------------------
*/
- /* ARGSUSED */
int
Tk_WmObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
@@ -1013,7 +1012,7 @@ Tk_WmObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = clientData;
+ Tk_Window tkwin = (Tk_Window)clientData;
static const char *const optionStrings[] = {
"aspect", "attributes", "client", "colormapwindows",
"command", "deiconify", "focusmodel", "forget",
@@ -1055,8 +1054,8 @@ Tk_WmObjCmd(
return TCL_ERROR;
}
if (objc == 2) {
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
- dispPtr->flags & TK_DISPLAY_WM_TRACING));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
+ (dispPtr->flags & TK_DISPLAY_WM_TRACING) != 0));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[2], &wmTracing) != TCL_OK) {
@@ -1188,8 +1187,9 @@ WmAspectCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
int numer1, denom1, numer2, denom2;
+ (void)tkwin;
if ((objc != 3) && (objc != 7)) {
Tcl_WrongNumArgs(interp, 2, objv,
@@ -1200,10 +1200,10 @@ WmAspectCmd(
if (wmPtr->sizeHintsFlags & PAspect) {
Tcl_Obj *results[4];
- results[0] = Tcl_NewIntObj(wmPtr->minAspect.x);
- results[1] = Tcl_NewIntObj(wmPtr->minAspect.y);
- results[2] = Tcl_NewIntObj(wmPtr->maxAspect.x);
- results[3] = Tcl_NewIntObj(wmPtr->maxAspect.y);
+ results[0] = Tcl_NewWideIntObj(wmPtr->minAspect.x);
+ results[1] = Tcl_NewWideIntObj(wmPtr->minAspect.y);
+ results[2] = Tcl_NewWideIntObj(wmPtr->maxAspect.x);
+ results[3] = Tcl_NewWideIntObj(wmPtr->maxAspect.y);
Tcl_SetObjResult(interp, Tcl_NewListObj(4, results));
}
return TCL_OK;
@@ -1315,7 +1315,7 @@ WmSetAttribute(
SetNetWmState(winPtr, "_NET_WM_STATE_FULLSCREEN",
wmPtr->reqState.fullscreen);
break;
- case _WMATT_LAST_ATTRIBUTE: /* NOTREACHED */
+ case _WMATT_LAST_ATTRIBUTE:
return TCL_ERROR;
}
return TCL_OK;
@@ -1345,17 +1345,16 @@ WmGetAttribute(
case WMATT_ALPHA:
return Tcl_NewDoubleObj(wmPtr->attributes.alpha);
case WMATT_TOPMOST:
- return Tcl_NewBooleanObj(wmPtr->attributes.topmost);
+ return Tcl_NewWideIntObj(wmPtr->attributes.topmost != 0);
case WMATT_ZOOMED:
- return Tcl_NewBooleanObj(wmPtr->attributes.zoomed);
+ return Tcl_NewWideIntObj(wmPtr->attributes.zoomed != 0);
case WMATT_FULLSCREEN:
- return Tcl_NewBooleanObj(wmPtr->attributes.fullscreen);
+ return Tcl_NewWideIntObj(wmPtr->attributes.fullscreen != 0);
case WMATT_TYPE:
return GetNetWmType(winPtr);
- case _WMATT_LAST_ATTRIBUTE: /*NOTREACHED*/
+ case _WMATT_LAST_ATTRIBUTE:
break;
}
- /*NOTREACHED*/
return NULL;
}
@@ -1392,6 +1391,7 @@ WmAttributesCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int attribute = 0;
+ (void)tkwin;
if (objc == 3) { /* wm attributes $win */
Tcl_Obj *result = Tcl_NewListObj(0,0);
@@ -1400,7 +1400,7 @@ WmAttributesCmd(
Tcl_ListObjAppendElement(interp, result,
Tcl_NewStringObj(WmAttributeNames[attribute], -1));
Tcl_ListObjAppendElement(interp, result,
- WmGetAttribute(winPtr, attribute));
+ WmGetAttribute(winPtr, (WmAttribute)attribute));
}
Tcl_SetObjResult(interp, result);
return TCL_OK;
@@ -1409,7 +1409,7 @@ WmAttributesCmd(
sizeof(char *), "attribute", 0, &attribute) != TCL_OK) {
return TCL_ERROR;
}
- Tcl_SetObjResult(interp, WmGetAttribute(winPtr, attribute));
+ Tcl_SetObjResult(interp, WmGetAttribute(winPtr, (WmAttribute)attribute));
return TCL_OK;
} else if ((objc - 3) % 2 == 0) { /* wm attributes $win -att value... */
int i;
@@ -1419,7 +1419,7 @@ WmAttributesCmd(
sizeof(char *), "attribute", 0, &attribute) != TCL_OK) {
return TCL_ERROR;
}
- if (WmSetAttribute(winPtr,interp,attribute,objv[i+1]) != TCL_OK) {
+ if (WmSetAttribute(winPtr,interp,(WmAttribute)attribute,objv[i+1]) != TCL_OK) {
return TCL_ERROR;
}
}
@@ -1455,8 +1455,9 @@ WmClientCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
const char *argv3;
+ (void)tkwin;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?name?");
@@ -1485,7 +1486,7 @@ WmClientCmd(
if (wmPtr->clientMachine != NULL) {
ckfree(wmPtr->clientMachine);
}
- wmPtr->clientMachine = ckalloc(objv[3]->length + 1);
+ wmPtr->clientMachine = (char *)ckalloc(objv[3]->length + 1);
strcpy(wmPtr->clientMachine, argv3);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
XTextProperty textProp;
@@ -1540,7 +1541,7 @@ WmColormapwindowsCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
Window *cmapList;
TkWindow *winPtr2;
int count, i, windowObjc, gotToplevel;
@@ -1583,7 +1584,7 @@ WmColormapwindowsCmd(
!= TCL_OK) {
return TCL_ERROR;
}
- cmapList = ckalloc((windowObjc+1) * sizeof(Window));
+ cmapList = (Window *)ckalloc((windowObjc+1) * sizeof(Window));
gotToplevel = 0;
for (i = 0; i < windowObjc; i++) {
Tk_Window mapWin;
@@ -1641,10 +1642,11 @@ WmCommandCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
const char *argv3;
int cmdArgc;
const char **cmdArgv;
+ (void)tkwin;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?value?");
@@ -1710,7 +1712,8 @@ WmDeiconifyCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ (void)tkwin;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
@@ -1760,12 +1763,13 @@ WmFocusmodelCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
static const char *const optionStrings[] = {
"active", "passive", NULL };
enum options {
OPT_ACTIVE, OPT_PASSIVE };
int index;
+ (void)tkwin;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?active|passive?");
@@ -1815,7 +1819,11 @@ WmForgetCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register Tk_Window frameWin = (Tk_Window) winPtr;
+ Tk_Window frameWin = (Tk_Window) winPtr;
+ (void)tkwin;
+ (void)interp;
+ (void)objc;
+ (void)objv;
if (Tk_IsTopLevel(frameWin)) {
TkFocusJoin(winPtr);
@@ -1868,8 +1876,10 @@ WmFrameCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
Window window;
+ char buf[TCL_INTEGER_SPACE];
+ (void)tkwin;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
@@ -1879,7 +1889,8 @@ WmFrameCmd(
if (window == None) {
window = Tk_WindowId((Tk_Window) winPtr);
}
- Tcl_SetObjResult(interp, Tcl_ObjPrintf("0x%x", (unsigned) window));
+ sprintf(buf, "0x%" TCL_Z_MODIFIER "x", (size_t)window);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1));
return TCL_OK;
}
@@ -1908,10 +1919,11 @@ WmGeometryCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
char xSign, ySign;
int width, height;
const char *argv3;
+ (void)tkwin;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?newGeometry?");
@@ -1968,8 +1980,9 @@ WmGridCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
int reqWidth, reqHeight, widthInc, heightInc;
+ (void)tkwin;
if ((objc != 3) && (objc != 7)) {
Tcl_WrongNumArgs(interp, 2, objv,
@@ -1980,10 +1993,10 @@ WmGridCmd(
if (wmPtr->sizeHintsFlags & PBaseSize) {
Tcl_Obj *results[4];
- results[0] = Tcl_NewIntObj(wmPtr->reqGridWidth);
- results[1] = Tcl_NewIntObj(wmPtr->reqGridHeight);
- results[2] = Tcl_NewIntObj(wmPtr->widthInc);
- results[3] = Tcl_NewIntObj(wmPtr->heightInc);
+ results[0] = Tcl_NewWideIntObj(wmPtr->reqGridWidth);
+ results[1] = Tcl_NewWideIntObj(wmPtr->reqGridHeight);
+ results[2] = Tcl_NewWideIntObj(wmPtr->widthInc);
+ results[3] = Tcl_NewWideIntObj(wmPtr->heightInc);
Tcl_SetObjResult(interp, Tcl_NewListObj(4, results));
}
return TCL_OK;
@@ -2067,7 +2080,7 @@ WmGroupCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
Tk_Window tkwin2;
WmInfo *wmPtr2;
const char *argv3;
@@ -2110,7 +2123,7 @@ WmGroupCmd(
}
wmPtr->hints.window_group = Tk_WindowId(wmPtr2->wrapperPtr);
wmPtr->hints.flags |= WindowGroupHint;
- wmPtr->leaderName = ckalloc(objv[3]->length + 1);
+ wmPtr->leaderName = (char *)ckalloc(objv[3]->length + 1);
strcpy(wmPtr->leaderName, argv3);
}
UpdateHints(winPtr);
@@ -2142,9 +2155,10 @@ WmIconbitmapCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
Pixmap pixmap;
const char *argv3;
+ (void)tkwin;
if ((objc < 3) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?bitmap?");
@@ -2202,7 +2216,8 @@ WmIconifyCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ (void)tkwin;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
@@ -2271,7 +2286,7 @@ WmIconmaskCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
Pixmap pixmap;
const char *argv3;
@@ -2330,8 +2345,9 @@ WmIconnameCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
const char *argv3;
+ (void)tkwin;
if (objc > 4) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?newName?");
@@ -2347,7 +2363,7 @@ WmIconnameCmd(
ckfree(wmPtr->iconName);
}
argv3 = Tcl_GetString(objv[3]);
- wmPtr->iconName = ckalloc(objv[3]->length + 1);
+ wmPtr->iconName = (char *)ckalloc(objv[3]->length + 1);
strcpy(wmPtr->iconName, argv3);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
UpdateTitle(winPtr);
@@ -2381,11 +2397,12 @@ WmIconphotoCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
Tk_PhotoHandle photo;
Tk_PhotoImageBlock block;
int i, size = 0, width, height, index = 0, x, y, isDefault = 0;
unsigned long *iconPropertyData;
+ (void)tkwin;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 2, objv,
@@ -2432,7 +2449,7 @@ WmIconphotoCmd(
* defines CARD32 arrays to use. [Bug 2902814]
*/
- iconPropertyData = attemptckalloc(sizeof(unsigned long) * size);
+ iconPropertyData = (unsigned long *)attemptckalloc(sizeof(unsigned long) * size);
if (iconPropertyData == NULL) {
return TCL_ERROR;
}
@@ -2441,7 +2458,11 @@ WmIconphotoCmd(
for (i = 3 + isDefault; i < objc; i++) {
photo = Tk_FindPhoto(interp, Tcl_GetString(objv[i]));
if (photo == NULL) {
- Tcl_Free((char *) iconPropertyData);
+ ckfree((char *) iconPropertyData);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "failed to create an iconphoto with image \"%s\"",
+ Tcl_GetString(objv[i])));
+ Tcl_SetErrorCode(interp, "TK", "WM", "ICONPHOTO", "IMAGE", NULL);
return TCL_ERROR;
}
Tk_PhotoGetSize(photo, &width, &height);
@@ -2470,9 +2491,9 @@ WmIconphotoCmd(
iconPropertyData[index++] = (unsigned long) height;
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
- register unsigned char *pixelPtr =
+ unsigned char *pixelPtr =
block.pixelPtr + x*block.pixelSize + y*block.pitch;
- register unsigned long R, G, B, A;
+ unsigned long R, G, B, A;
R = pixelPtr[block.offset[0]];
G = pixelPtr[block.offset[1]];
@@ -2527,8 +2548,9 @@ WmIconpositionCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
int x, y;
+ (void)tkwin;
if ((objc != 3) && (objc != 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?x y?");
@@ -2538,8 +2560,8 @@ WmIconpositionCmd(
if (wmPtr->hints.flags & IconPositionHint) {
Tcl_Obj *results[2];
- results[0] = Tcl_NewIntObj(wmPtr->hints.icon_x);
- results[1] = Tcl_NewIntObj(wmPtr->hints.icon_y);
+ results[0] = Tcl_NewWideIntObj(wmPtr->hints.icon_x);
+ results[1] = Tcl_NewWideIntObj(wmPtr->hints.icon_y);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
}
return TCL_OK;
@@ -2584,7 +2606,7 @@ WmIconwindowCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
Tk_Window tkwin2;
WmInfo *wmPtr2;
XSetWindowAttributes atts;
@@ -2704,8 +2726,11 @@ WmManageCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register Tk_Window frameWin = (Tk_Window) winPtr;
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Tk_Window frameWin = (Tk_Window) winPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ (void)tkwin;
+ (void)objc;
+ (void)objv;
if (!Tk_IsTopLevel(frameWin)) {
if (!Tk_IsManageable(frameWin)) {
@@ -2766,8 +2791,9 @@ WmMaxsizeCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
int width, height;
+ (void)tkwin;
if ((objc != 3) && (objc != 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
@@ -2777,8 +2803,8 @@ WmMaxsizeCmd(
Tcl_Obj *results[2];
GetMaxSize(wmPtr, &width, &height);
- results[0] = Tcl_NewIntObj(width);
- results[1] = Tcl_NewIntObj(height);
+ results[0] = Tcl_NewWideIntObj(width);
+ results[1] = Tcl_NewWideIntObj(height);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -2825,8 +2851,9 @@ WmMinsizeCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
int width, height;
+ (void)tkwin;
if ((objc != 3) && (objc != 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
@@ -2835,8 +2862,8 @@ WmMinsizeCmd(
if (objc == 3) {
Tcl_Obj *results[2];
- results[0] = Tcl_NewIntObj(wmPtr->minWidth);
- results[1] = Tcl_NewIntObj(wmPtr->minHeight);
+ results[0] = Tcl_NewWideIntObj(wmPtr->minWidth);
+ results[1] = Tcl_NewWideIntObj(wmPtr->minHeight);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -2878,6 +2905,7 @@ WmOverrideredirectCmd(
{
int boolean, curValue;
XSetWindowAttributes atts;
+ (void)tkwin;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?boolean?");
@@ -2885,7 +2913,7 @@ WmOverrideredirectCmd(
}
curValue = Tk_Attributes((Tk_Window) winPtr)->override_redirect;
if (objc == 3) {
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(curValue));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(curValue != 0));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[3], &boolean) != TCL_OK) {
@@ -2934,12 +2962,13 @@ WmPositionfromCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
static const char *const optionStrings[] = {
"program", "user", NULL };
enum options {
OPT_PROGRAM, OPT_USER };
int index;
+ (void)tkwin;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?user/program?");
@@ -3001,11 +3030,12 @@ WmProtocolCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
- register ProtocolHandler *protPtr, *prevPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ ProtocolHandler *protPtr, *prevPtr;
Atom protocol;
const char *cmd;
- size_t cmdLength;
+ TkSizeT cmdLength;
+ (void)tkwin;
if ((objc < 3) || (objc > 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?name? ?command?");
@@ -3073,7 +3103,7 @@ WmProtocolCmd(
}
cmd = TkGetStringFromObj(objv[4], &cmdLength);
if (cmdLength > 0) {
- protPtr = ckalloc(HANDLER_SIZE(cmdLength));
+ protPtr = (ProtocolHandler *)ckalloc(HANDLER_SIZE(cmdLength));
protPtr->protocol = protocol;
protPtr->nextPtr = wmPtr->protPtr;
wmPtr->protPtr = protPtr;
@@ -3111,8 +3141,9 @@ WmResizableCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
int width, height;
+ (void)tkwin;
if ((objc != 3) && (objc != 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
@@ -3121,8 +3152,8 @@ WmResizableCmd(
if (objc == 3) {
Tcl_Obj *results[2];
- results[0] = Tcl_NewBooleanObj(!(wmPtr->flags&WM_WIDTH_NOT_RESIZABLE));
- results[1] = Tcl_NewBooleanObj(!(wmPtr->flags&WM_HEIGHT_NOT_RESIZABLE));
+ results[0] = Tcl_NewWideIntObj(!(wmPtr->flags&WM_WIDTH_NOT_RESIZABLE));
+ results[1] = Tcl_NewWideIntObj(!(wmPtr->flags&WM_HEIGHT_NOT_RESIZABLE));
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -3170,12 +3201,13 @@ WmSizefromCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
static const char *const optionStrings[] = {
"program", "user", NULL };
enum options {
OPT_PROGRAM, OPT_USER };
int index;
+ (void)tkwin;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?user|program?");
@@ -3263,6 +3295,8 @@ WmStackorderCmd(
ckfree(windows);
Tcl_SetObjResult(interp, resultObj);
return TCL_OK;
+ } else {
+ return TCL_ERROR;
}
} else {
Tk_Window relWin;
@@ -3329,7 +3363,7 @@ WmStackorderCmd(
} else { /* OPT_ISBELOW */
result = index1 < index2;
}
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(result));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(result));
return TCL_OK;
}
return TCL_OK;
@@ -3360,12 +3394,13 @@ WmStateCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
static const char *const optionStrings[] = {
"normal", "iconic", "withdrawn", NULL };
enum options {
OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN };
int index;
+ (void)tkwin;
if ((objc < 3) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?state?");
@@ -3466,8 +3501,9 @@ WmTitleCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
const char *argv3;
+ (void)tkwin;
if (objc > 4) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?newTitle?");
@@ -3484,7 +3520,7 @@ WmTitleCmd(
ckfree(wmPtr->title);
}
argv3 = Tcl_GetString(objv[3]);
- wmPtr->title = ckalloc(objv[3]->length + 1);
+ wmPtr->title = (char *)ckalloc(objv[3]->length + 1);
strcpy(wmPtr->title, argv3);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
@@ -3519,7 +3555,7 @@ WmTransientCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
TkWindow *masterPtr = wmPtr->masterPtr, *w;
WmInfo *wmPtr2;
@@ -3668,7 +3704,8 @@ WmWithdrawCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ (void)tkwin;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
@@ -3717,7 +3754,7 @@ WmWaitMapProc(
ClientData clientData, /* Pointer to window. */
XEvent *eventPtr) /* Information about event. */
{
- TkWindow *winPtr = clientData;
+ TkWindow *winPtr = (TkWindow *)clientData;
TkWindow *masterPtr = winPtr->wmInfoPtr->masterPtr;
if (masterPtr == NULL) {
@@ -3768,7 +3805,7 @@ Tk_SetGrid(
* of one grid unit. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
- register WmInfo *wmPtr;
+ WmInfo *wmPtr;
/*
* Ensure widthInc and heightInc are greater than 0
@@ -3873,7 +3910,7 @@ Tk_UnsetGrid(
* controlling gridding. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
- register WmInfo *wmPtr;
+ WmInfo *wmPtr;
/*
* Find the top-level window for tkwin, plus the window manager
@@ -4406,7 +4443,7 @@ WrapperEventProc(
ClientData clientData, /* Information about toplevel window. */
XEvent *eventPtr) /* Event that just happened. */
{
- WmInfo *wmPtr = clientData;
+ WmInfo *wmPtr = (WmInfo *)clientData;
XEvent mapEvent;
TkDisplay *dispPtr = wmPtr->winPtr->dispPtr;
@@ -4486,7 +4523,6 @@ WrapperEventProc(
*----------------------------------------------------------------------
*/
- /* ARGSUSED */
static void
TopLevelReqProc(
ClientData dummy, /* Not used. */
@@ -4494,6 +4530,7 @@ TopLevelReqProc(
{
TkWindow *winPtr = (TkWindow *) tkwin;
WmInfo *wmPtr = winPtr->wmInfoPtr;
+ (void)dummy;
if (wmPtr == NULL) {
return;
@@ -4556,8 +4593,8 @@ static void
UpdateGeometryInfo(
ClientData clientData) /* Pointer to the window's record. */
{
- register TkWindow *winPtr = clientData;
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ TkWindow *winPtr = (TkWindow *)clientData;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
int x, y, width, height, min, max;
unsigned long serial;
@@ -4818,7 +4855,7 @@ UpdateSizeHints(
int newWidth,
int newHeight)
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
XSizeHints *hintsPtr;
int maxWidth, maxHeight;
@@ -5295,7 +5332,7 @@ WaitRestrictProc(
ClientData clientData, /* Pointer to WaitRestrictInfo structure. */
XEvent *eventPtr) /* Event that is about to be handled. */
{
- WaitRestrictInfo *infoPtr = clientData;
+ WaitRestrictInfo *infoPtr = (WaitRestrictInfo *)clientData;
if (eventPtr->type == ReparentNotify) {
return TK_PROCESS_EVENT;
@@ -5451,12 +5488,12 @@ SetNetWmType(
}
if (objc > 0) {
- atoms = ckalloc(sizeof(Atom) * objc);
+ atoms = (Atom *)ckalloc(sizeof(Atom) * objc);
}
for (n = 0; n < objc; ++n) {
Tcl_DString ds, dsName;
- size_t len;
+ TkSizeT len;
char *name = TkGetStringFromObj(objv[n], &len);
Tcl_UtfToUpper(name);
@@ -5564,10 +5601,10 @@ ParseGeometry(
TkWindow *winPtr) /* Pointer to top-level window whose geometry
* is to be changed. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
int x, y, width, height, flags;
char *end;
- register const char *p = string;
+ const char *p = string;
/*
* The leading "=" is optional.
@@ -5700,7 +5737,7 @@ Tk_GetRootCoords(
int *yPtr) /* Where to store y-displacement of (0,0). */
{
int x, y;
- register TkWindow *winPtr = (TkWindow *) tkwin;
+ TkWindow *winPtr = (TkWindow *) tkwin;
/*
* Search back through this window's parents all the way to a top-level
@@ -6167,7 +6204,7 @@ Tk_MoveToplevelWindow(
int x, int y) /* New location for window (within parent). */
{
TkWindow *winPtr = (TkWindow *) tkwin;
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
if (!(winPtr->flags & TK_TOP_LEVEL)) {
Tcl_Panic("Tk_MoveToplevelWindow called with non-toplevel window");
@@ -6215,9 +6252,9 @@ Tk_MoveToplevelWindow(
static void
UpdateWmProtocols(
- register WmInfo *wmPtr) /* Information about top-level window. */
+ WmInfo *wmPtr) /* Information about top-level window. */
{
- register ProtocolHandler *protPtr;
+ ProtocolHandler *protPtr;
Atom deleteWindowAtom, pingAtom;
int count;
Atom *arrayPtr, *atomPtr;
@@ -6234,7 +6271,7 @@ UpdateWmProtocols(
protPtr = protPtr->nextPtr, count++) {
/* Empty loop body; we're just counting the handlers. */
}
- arrayPtr = ckalloc(count * sizeof(Atom));
+ arrayPtr = (Atom *)ckalloc(count * sizeof(Atom));
deleteWindowAtom = Tk_InternAtom((Tk_Window) wmPtr->winPtr,
"WM_DELETE_WINDOW");
pingAtom = Tk_InternAtom((Tk_Window) wmPtr->winPtr, "_NET_WM_PING");
@@ -6276,7 +6313,7 @@ TkWmProtocolEventProc(
XEvent *eventPtr) /* X event. */
{
WmInfo *wmPtr;
- register ProtocolHandler *protPtr;
+ ProtocolHandler *protPtr;
Atom protocol;
int result;
const char *protocolName;
@@ -6425,7 +6462,10 @@ TkWmStackorderToplevel(
Tcl_InitHashTable(&table, TCL_ONE_WORD_KEYS);
TkWmStackorderToplevelWrapperMap(parentPtr, parentPtr->display, &table);
- window_ptr = windows = ckalloc((table.numEntries+1) * sizeof(TkWindow *));
+ window_ptr = windows = (TkWindow **)ckalloc((table.numEntries+1) * sizeof(TkWindow *));
+ if (windows == NULL) {
+ return NULL;
+ }
/*
* Special cases: If zero or one toplevels were mapped there is no need to
@@ -6438,7 +6478,7 @@ TkWmStackorderToplevel(
goto done;
case 1:
hPtr = Tcl_FirstHashEntry(&table, &search);
- windows[0] = Tcl_GetHashValue(hPtr);
+ windows[0] = (TkWindow *)Tcl_GetHashValue(hPtr);
windows[1] = NULL;
goto done;
}
@@ -6456,7 +6496,7 @@ TkWmStackorderToplevel(
for (i = 0; i < numChildren; i++) {
hPtr = Tcl_FindHashEntry(&table, children[i]);
if (hPtr != NULL) {
- childWinPtr = Tcl_GetHashValue(hPtr);
+ childWinPtr = (TkWindow *)Tcl_GetHashValue(hPtr);
*window_ptr++ = childWinPtr;
}
}
@@ -6629,7 +6669,7 @@ TkWmAddToColormapWindows(
* add the toplevel itself as the last element of the list.
*/
- newPtr = ckalloc((count+2) * sizeof(Window));
+ newPtr = (Window *)ckalloc((count+2) * sizeof(Window));
for (i = 0; i < count; i++) {
newPtr[i] = oldPtr[i];
}
@@ -6864,7 +6904,7 @@ GetMaxSize(
static void
TkSetTransientFor(Tk_Window tkwin, Tk_Window parent)
{
- if (parent == None) {
+ if (parent == NULL) {
parent = Tk_Parent(tkwin);
while (!Tk_IsTopLevel(parent))
parent = Tk_Parent(parent);
@@ -6982,7 +7022,7 @@ CreateWrapper(
TkWindow *winPtr, *wrapperPtr;
Window parent;
Tcl_HashEntry *hPtr;
- int new;
+ int isNew;
winPtr = wmPtr->winPtr;
if (winPtr->window == None) {
@@ -7026,7 +7066,7 @@ CreateWrapper(
InputOutput, wrapperPtr->visual,
wrapperPtr->dirtyAtts|CWOverrideRedirect, &wrapperPtr->atts);
hPtr = Tcl_CreateHashEntry(&wrapperPtr->dispPtr->winTable,
- (char *) wrapperPtr->window, &new);
+ (char *) wrapperPtr->window, &isNew);
Tcl_SetHashValue(hPtr, wrapperPtr);
wrapperPtr->mainPtr = winPtr->mainPtr;
wrapperPtr->mainPtr->refCount++;
@@ -7245,7 +7285,7 @@ MenubarReqProc(
* for tkwin's toplevel. */
Tk_Window tkwin) /* Handle for menubar window. */
{
- WmInfo *wmPtr = clientData;
+ WmInfo *wmPtr = (WmInfo *)clientData;
wmPtr->menuHeight = Tk_ReqHeight(tkwin);
if (wmPtr->menuHeight <= 0) {
@@ -7280,7 +7320,7 @@ TkWindow *
TkpGetWrapperWindow(
TkWindow *winPtr) /* A toplevel window pointer. */
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
if ((winPtr == NULL) || (wmPtr == NULL)) {
return NULL;
@@ -7310,7 +7350,7 @@ static void
UpdateCommand(
TkWindow *winPtr)
{
- register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
Tcl_DString cmds, ds;
int i, *offsets;
char **cmdArgv;
@@ -7327,8 +7367,8 @@ UpdateCommand(
* entire DString is done.
*/
- cmdArgv = ckalloc(sizeof(char *) * wmPtr->cmdArgc);
- offsets = ckalloc(sizeof(int) * wmPtr->cmdArgc);
+ cmdArgv = (char **)ckalloc(sizeof(char *) * wmPtr->cmdArgc);
+ offsets = (int *)ckalloc(sizeof(int) * wmPtr->cmdArgc);
Tcl_DStringInit(&cmds);
for (i = 0; i < wmPtr->cmdArgc; i++) {
Tcl_UtfToExternalDString(NULL, wmPtr->cmdArgv[i], -1, &ds);