diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-02-28 12:05:02 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-02-28 12:05:02 (GMT) |
commit | 1d2fbf0b67d3ebfca3632d712654d9bc01af76dd (patch) | |
tree | 2ec07b8daf001f18e7432b25d0c9167aaa3838ec /unix | |
parent | 8ef8de11eed562a7015b9e8ff11a6a77124b1d19 (diff) | |
parent | 4d4bf9a051a30dad87a2b518e2641851b702dd3c (diff) | |
download | tk-1d2fbf0b67d3ebfca3632d712654d9bc01af76dd.zip tk-1d2fbf0b67d3ebfca3632d712654d9bc01af76dd.tar.gz tk-1d2fbf0b67d3ebfca3632d712654d9bc01af76dd.tar.bz2 |
Implement TIP #557: C++ support for Tcl
Diffstat (limited to 'unix')
-rwxr-xr-x | unix/configure | 10 | ||||
-rw-r--r-- | unix/tcl.m4 | 10 | ||||
-rw-r--r-- | unix/tkAppInit.c | 6 | ||||
-rw-r--r-- | unix/tkUnix.c | 5 | ||||
-rw-r--r-- | unix/tkUnix3d.c | 2 | ||||
-rw-r--r-- | unix/tkUnixButton.c | 8 | ||||
-rw-r--r-- | unix/tkUnixColor.c | 14 | ||||
-rw-r--r-- | unix/tkUnixConfig.c | 4 | ||||
-rw-r--r-- | unix/tkUnixCursor.c | 4 | ||||
-rw-r--r-- | unix/tkUnixDraw.c | 2 | ||||
-rw-r--r-- | unix/tkUnixEmbed.c | 41 | ||||
-rw-r--r-- | unix/tkUnixEvent.c | 20 | ||||
-rw-r--r-- | unix/tkUnixFont.c | 48 | ||||
-rw-r--r-- | unix/tkUnixInit.c | 4 | ||||
-rw-r--r-- | unix/tkUnixKey.c | 6 | ||||
-rw-r--r-- | unix/tkUnixMenu.c | 49 | ||||
-rw-r--r-- | unix/tkUnixMenubu.c | 7 | ||||
-rw-r--r-- | unix/tkUnixPort.h | 3 | ||||
-rw-r--r-- | unix/tkUnixRFont.c | 14 | ||||
-rw-r--r-- | unix/tkUnixScale.c | 6 | ||||
-rw-r--r-- | unix/tkUnixScrlbr.c | 10 | ||||
-rw-r--r-- | unix/tkUnixSelect.c | 27 | ||||
-rw-r--r-- | unix/tkUnixSend.c | 48 | ||||
-rw-r--r-- | unix/tkUnixWm.c | 88 |
24 files changed, 290 insertions, 146 deletions
diff --git a/unix/configure b/unix/configure index f05e8f8..2d64dcc 100755 --- a/unix/configure +++ b/unix/configure @@ -4239,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 diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 2547d1e..271bd03 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -966,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="" 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/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 7ea67a1..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; diff --git a/unix/tkUnixButton.c b/unix/tkUnixButton.c index 24ac8cc..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. */ { - TkButton *butPtr = clientData; + TkButton *butPtr = (TkButton *)clientData; GC gc; Tk_3DBorder border; Pixmap pixmap; diff --git a/unix/tkUnixColor.c b/unix/tkUnixColor.c index 96e8937..a909fb3 100644 --- a/unix/tkUnixColor.c +++ b/unix/tkUnixColor.c @@ -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 4c58adf..bcd7cc3 100644 --- a/unix/tkUnixCursor.c +++ b/unix/tkUnixCursor.c @@ -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/tkUnixDraw.c b/unix/tkUnixDraw.c index e6886e8..fec05ee 100644 --- a/unix/tkUnixDraw.c +++ b/unix/tkUnixDraw.c @@ -202,6 +202,8 @@ TkpDrawHighlightBorder( int highlightWidth, Drawable drawable) { + (void)bgGC; + TkDrawInsetFocusHighlight(tkwin, fgGC, highlightWidth, drawable, 0); } diff --git a/unix/tkUnixEmbed.c b/unix/tkUnixEmbed.c index 5653b75..d4654a8 100644 --- a/unix/tkUnixEmbed.c +++ b/unix/tkUnixEmbed.c @@ -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 d605ef0..ee2013b 100644 --- a/unix/tkUnixEvent.c +++ b/unix/tkUnixEvent.c @@ -15,7 +15,7 @@ #ifdef HAVE_XKBKEYCODETOKEYSYM # include <X11/XKBlib.h> #else -# define XkbOpenDisplay(D,V,E,M,m,R) ((V),(E),(M),(m),(R),(NULL)) +# define XkbOpenDisplay(D,V,E,M,m,R) ((V),(E),(M),(m),(R),(Display *)NULL) #endif /* @@ -92,10 +92,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; @@ -175,7 +176,7 @@ TkpOpenDisplay( 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; @@ -311,11 +312,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; @@ -443,10 +445,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; @@ -481,9 +484,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); @@ -694,6 +698,8 @@ InstantiateIMCallback( XPointer call_data) { TkDisplay *dispPtr; + (void)display; + (void)call_data; dispPtr = (TkDisplay *) client_data; OpenIM(dispPtr); @@ -708,6 +714,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 610342e..800d1e5 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -266,10 +266,11 @@ static int UtfToUcs2beProc(ClientData clientData, const char*src, static void FontPkgCleanup( - ClientData clientData) + ClientData dummy) { - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + (void)dummy; if (tsdPtr->controlFamily.encoding != NULL) { FontFamily *familyPtr = &tsdPtr->controlFamily; @@ -307,11 +308,12 @@ void TkpFontPkgInit( TkMainInfo *mainPtr) /* The application being created. */ { - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); SubFont dummy; int i; Tcl_Encoding ucs2; + (void)mainPtr; if (tsdPtr->controlFamily.encoding == NULL) { @@ -361,7 +363,7 @@ TkpFontPkgInit( static int ControlUtfProc( - ClientData clientData, /* Not used. */ + ClientData dummy, /* Not used. */ const char *src, /* Source string in UTF-8. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ @@ -394,6 +396,9 @@ ControlUtfProc( 0, 0, 0, 0, 0, 0, 0, 'a', 'b', 't', 'n', 'v', 'f', 'r' }; + (void)dummy; + (void)flags; + (void)statePtr; result = TCL_OK; @@ -459,7 +464,7 @@ ControlUtfProc( static int Ucs2beToUtfProc( - ClientData clientData, /* Not used. */ + ClientData dummy, /* Not used. */ const char *src, /* Source string in Unicode. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ @@ -488,6 +493,8 @@ Ucs2beToUtfProc( const char *dstEnd, *dstStart; int result, numChars, charLimit = INT_MAX; unsigned short ch; + (void)dummy; + (void)statePtr; if (flags & TCL_ENCODING_CHAR_LIMIT) { charLimit = *dstCharsPtr; @@ -555,7 +562,7 @@ Ucs2beToUtfProc( static int UtfToUcs2beProc( - ClientData clientData, /* TableEncodingData that specifies + ClientData dummy, /* TableEncodingData that specifies * encoding. */ const char *src, /* Source string in UTF-8. */ int srcLen, /* Source string length in bytes. */ @@ -584,6 +591,8 @@ UtfToUcs2beProc( const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd; int result, numChars; int ch; + (void)dummy; + (void)statePtr; srcStart = src; srcEnd = src + srcLen; @@ -719,7 +728,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; @@ -775,7 +784,7 @@ TkpGetFontFromAttributes( fontPtr = (UnixFont *) tkFontPtr; if (fontPtr == NULL) { - fontPtr = ckalloc(sizeof(UnixFont)); + fontPtr = (UnixFont *)ckalloc(sizeof(UnixFont)); } else { ReleaseFont(fontPtr); } @@ -838,7 +847,7 @@ TkpGetFontFamilies( Tcl_Interp *interp, /* Interp to hold result. */ Tk_Window tkwin) /* For display to query. */ { - int i, new, numNames; + int i, isNew, numNames; const char *family, **nameList; Tcl_HashTable familyTable; Tcl_HashEntry *hPtr; @@ -867,14 +876,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); } @@ -1574,7 +1583,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; @@ -1827,8 +1836,9 @@ AllocFontFamily( FontFamily *familyPtr; FontAttributes fa; Tcl_Encoding encoding; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + (void)base; GetFontAttributes(display, fontStructPtr, &fa); encoding = Tcl_GetEncoding(NULL, GetEncodingAlias(fa.xa.charset)); @@ -1846,7 +1856,7 @@ AllocFontFamily( } } - familyPtr = ckalloc(sizeof(FontFamily)); + familyPtr = (FontFamily *)ckalloc(sizeof(FontFamily)); memset(familyPtr, 0, sizeof(FontFamily)); familyPtr->nextPtr = tsdPtr->fontFamilyList; tsdPtr->fontFamilyList = familyPtr; @@ -1903,7 +1913,7 @@ FreeFontFamily( FontFamily *familyPtr) /* The FontFamily to delete. */ { FontFamily **familyPtrPtr; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); int i; @@ -2216,10 +2226,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) { @@ -2551,7 +2561,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; @@ -2596,7 +2606,7 @@ 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) { diff --git a/unix/tkUnixInit.c b/unix/tkUnixInit.c index b0aa2fa..6fa7970 100644 --- a/unix/tkUnixInit.c +++ b/unix/tkUnixInit.c @@ -37,8 +37,10 @@ static int GetLibraryPath(Tcl_Interp *interp); int TkpInit( - Tcl_Interp *interp) + Tcl_Interp *dummy) { + (void)dummy; + TkCreateXEventSource(); GetLibraryPath(interp); return TCL_OK; diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index 6681ad9..89e8d0a 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -229,7 +229,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); @@ -486,7 +486,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 +513,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 6abb2fd..095af3b 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. */ @@ -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,6 +873,8 @@ DrawMenuUnderline( int x, int y, int width, int height) { + (void)width; + if ((mePtr->underline >= 0) && (mePtr->labelPtr != NULL)) { int len; @@ -930,13 +952,14 @@ 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 >= (int)menuPtr->numEntries) { index = menuPtr->numEntries - 1; @@ -1027,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; } @@ -1056,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; @@ -1279,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; @@ -1327,6 +1360,9 @@ TkpInitializeMenuBindings( Tk_BindingTable bindingTable) /* The table to add to. */ { + (void)interp; + (void)bindingTable; + /* * Nothing to do. */ @@ -1375,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)); @@ -1851,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 eb0af47..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,7 +60,7 @@ void TkpDisplayMenuButton( ClientData clientData) /* Information about widget. */ { - TkMenuButton *mbPtr = clientData; + TkMenuButton *mbPtr = (TkMenuButton *)clientData; GC gc; Tk_3DBorder border; Pixmap pixmap; @@ -321,6 +323,7 @@ void TkpDestroyMenuButton( TkMenuButton *mbPtr) { + (void)mbPtr; } /* diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h index eee7845..fae2f16 100644 --- a/unix/tkUnixPort.h +++ b/unix/tkUnixPort.h @@ -50,6 +50,9 @@ # include <inttypes.h> #endif #include <unistd.h> +#if defined(__GNUC__) && !defined(__cplusplus) +# pragma GCC diagnostic ignored "-Wc++-compat" +#endif #include <X11/Xlib.h> #include <X11/cursorfont.h> #include <X11/keysym.h> diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index b27e3f2..e86d959 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -87,6 +87,7 @@ void TkpFontPkgInit( TkMainInfo *mainPtr) /* The application being created. */ { + (void)mainPtr; } static XftFont * @@ -272,7 +273,7 @@ InitFont( int i, iWidth; if (!fontPtr) { - fontPtr = ckalloc(sizeof(UnixFtFont)); + fontPtr = (UnixFtFont *)ckalloc(sizeof(UnixFtFont)); } FcConfigSubstitute(0, pattern, FcMatchPattern); @@ -290,7 +291,7 @@ InitFont( 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; /* @@ -639,6 +640,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; @@ -898,7 +900,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; @@ -948,7 +950,7 @@ Tk_DrawChars( } doUnderlineStrikeout: - if (tsdPtr->clipRegion != None) { + if (tsdPtr->clipRegion != NULL) { XftDrawSetClip(fontPtr->ftDraw, NULL); } if (fontPtr->font.fa.underline != 0) { @@ -1142,7 +1144,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; @@ -1194,7 +1196,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) { diff --git a/unix/tkUnixScale.c b/unix/tkUnixScale.c index ca5183d..b090c4f 100644 --- a/unix/tkUnixScale.c +++ b/unix/tkUnixScale.c @@ -52,7 +52,9 @@ TkScale * TkpCreateScale( Tk_Window tkwin) { - return ckalloc(sizeof(TkScale)); + (void)tkwin; + + return (TkScale *)ckalloc(sizeof(TkScale)); } /* @@ -546,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; diff --git a/unix/tkUnixScrlbr.c b/unix/tkUnixScrlbr.c index c51aa18..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,7 +97,7 @@ void TkpDisplayScrollbar( ClientData clientData) /* Information about window. */ { - TkScrollbar *scrollPtr = clientData; + TkScrollbar *scrollPtr = (TkScrollbar *)clientData; Tk_Window tkwin = scrollPtr->tkwin; XPoint points[7]; Tk_3DBorder border; @@ -399,17 +399,17 @@ TkpConfigureScrollbar( * 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, diff --git a/unix/tkUnixSelect.c b/unix/tkUnixSelect.c index 11161b7..58c3abc 100644 --- a/unix/tkUnixSelect.c +++ b/unix/tkUnixSelect.c @@ -250,7 +250,7 @@ TkSelPropProc( 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. @@ -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. */ { - TkSelRetrievalInfo *retrPtr = clientData; + TkSelRetrievalInfo *retrPtr = (TkSelRetrievalInfo *)clientData; /* * Make sure that the retrieval is still in progress. Then see how long @@ -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,7 +893,7 @@ 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; @@ -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) { @@ -1126,7 +1126,7 @@ SelRcvIncrProc( ClientData clientData, /* Information about retrieval. */ XEvent *eventPtr) /* X PropertyChange event. */ { - 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. */ { - 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. @@ -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 4a24a89..ca588df 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -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. */ @@ -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); } } @@ -1780,10 +1782,11 @@ AppendErrorProc( ClientData clientData, /* Command to mark complete, or NULL. */ XErrorEvent *errorPtr) /* Information about error. */ { - PendingCommand *pendingPtr = clientData; + PendingCommand *pendingPtr = (PendingCommand *)clientData; PendingCommand *pcPtr; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + (void)errorPtr; if (pendingPtr == NULL) { return 0; @@ -1796,7 +1799,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 +1832,10 @@ DeleteProc( ClientData clientData) /* Info about registration, passed as * ClientData. */ { - RegisteredInterp *riPtr = clientData; + 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); @@ -1877,10 +1880,11 @@ DeleteProc( /* ARGSUSED */ static Tk_RestrictAction SendRestrictProc( - ClientData clientData, /* Not used. */ + ClientData dummy, /* Not used. */ XEvent *eventPtr) /* Event that just arrived. */ { TkDisplay *dispPtr; + (void)dummy; if (eventPtr->type != PropertyNotify) { return TK_DEFER_EVENT; @@ -1921,7 +1925,7 @@ UpdateCommWindow( { Tcl_DString names; RegisteredInterp *riPtr; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_DStringInit(&names); @@ -1968,7 +1972,7 @@ TkpTestsendCmd( static const char *const testsendOptions[] = { "bogus", "prop", "serial", NULL }; - TkWindow *winPtr = clientData; + TkWindow *winPtr = (TkWindow *)clientData; Tk_ErrorHandler handler; int index; diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index 490a1ea..65cfceb 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -567,7 +567,7 @@ TkWmNewWindow( 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; @@ -1013,7 +1013,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", @@ -1190,6 +1190,7 @@ WmAspectCmd( { WmInfo *wmPtr = winPtr->wmInfoPtr; int numer1, denom1, numer2, denom2; + (void)tkwin; if ((objc != 3) && (objc != 7)) { Tcl_WrongNumArgs(interp, 2, objv, @@ -1392,6 +1393,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 +1402,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 +1411,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 +1421,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; } } @@ -1457,6 +1459,7 @@ WmClientCmd( { WmInfo *wmPtr = winPtr->wmInfoPtr; const char *argv3; + (void)tkwin; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?name?"); @@ -1485,7 +1488,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; @@ -1583,7 +1586,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; @@ -1645,6 +1648,7 @@ WmCommandCmd( const char *argv3; int cmdArgc; const char **cmdArgv; + (void)tkwin; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?value?"); @@ -1711,6 +1715,7 @@ WmDeiconifyCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { WmInfo *wmPtr = winPtr->wmInfoPtr; + (void)tkwin; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "window"); @@ -1766,6 +1771,7 @@ WmFocusmodelCmd( enum options { OPT_ACTIVE, OPT_PASSIVE }; int index; + (void)tkwin; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?active|passive?"); @@ -1816,6 +1822,10 @@ WmForgetCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window frameWin = (Tk_Window) winPtr; + (void)tkwin; + (void)interp; + (void)objc; + (void)objv; if (Tk_IsTopLevel(frameWin)) { TkFocusJoin(winPtr); @@ -1871,6 +1881,7 @@ WmFrameCmd( WmInfo *wmPtr = winPtr->wmInfoPtr; Window window; char buf[TCL_INTEGER_SPACE]; + (void)tkwin; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "window"); @@ -1914,6 +1925,7 @@ WmGeometryCmd( char xSign, ySign; int width, height; const char *argv3; + (void)tkwin; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?newGeometry?"); @@ -1972,6 +1984,7 @@ WmGridCmd( { WmInfo *wmPtr = winPtr->wmInfoPtr; int reqWidth, reqHeight, widthInc, heightInc; + (void)tkwin; if ((objc != 3) && (objc != 7)) { Tcl_WrongNumArgs(interp, 2, objv, @@ -2112,7 +2125,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); @@ -2147,6 +2160,7 @@ WmIconbitmapCmd( WmInfo *wmPtr = winPtr->wmInfoPtr; Pixmap pixmap; const char *argv3; + (void)tkwin; if ((objc < 3) || (objc > 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?bitmap?"); @@ -2205,6 +2219,7 @@ WmIconifyCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { WmInfo *wmPtr = winPtr->wmInfoPtr; + (void)tkwin; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "window"); @@ -2334,6 +2349,7 @@ WmIconnameCmd( { WmInfo *wmPtr = winPtr->wmInfoPtr; const char *argv3; + (void)tkwin; if (objc > 4) { Tcl_WrongNumArgs(interp, 2, objv, "window ?newName?"); @@ -2349,7 +2365,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); @@ -2388,6 +2404,7 @@ WmIconphotoCmd( 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, @@ -2434,7 +2451,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; } @@ -2535,6 +2552,7 @@ WmIconpositionCmd( { WmInfo *wmPtr = winPtr->wmInfoPtr; int x, y; + (void)tkwin; if ((objc != 3) && (objc != 5)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?x y?"); @@ -2712,6 +2730,9 @@ WmManageCmd( { Tk_Window frameWin = (Tk_Window) winPtr; WmInfo *wmPtr = winPtr->wmInfoPtr; + (void)tkwin; + (void)objc; + (void)objv; if (!Tk_IsTopLevel(frameWin)) { if (!Tk_IsManageable(frameWin)) { @@ -2774,6 +2795,7 @@ WmMaxsizeCmd( { WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; + (void)tkwin; if ((objc != 3) && (objc != 5)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?"); @@ -2833,6 +2855,7 @@ WmMinsizeCmd( { WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; + (void)tkwin; if ((objc != 3) && (objc != 5)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?"); @@ -2884,6 +2907,7 @@ WmOverrideredirectCmd( { int boolean, curValue; XSetWindowAttributes atts; + (void)tkwin; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?boolean?"); @@ -2946,6 +2970,7 @@ WmPositionfromCmd( enum options { OPT_PROGRAM, OPT_USER }; int index; + (void)tkwin; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?user/program?"); @@ -3012,6 +3037,7 @@ WmProtocolCmd( Atom protocol; const char *cmd; TkSizeT cmdLength; + (void)tkwin; if ((objc < 3) || (objc > 5)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?name? ?command?"); @@ -3079,7 +3105,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; @@ -3119,6 +3145,7 @@ WmResizableCmd( { WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; + (void)tkwin; if ((objc != 3) && (objc != 5)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?"); @@ -3182,6 +3209,7 @@ WmSizefromCmd( enum options { OPT_PROGRAM, OPT_USER }; int index; + (void)tkwin; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?user|program?"); @@ -3374,6 +3402,7 @@ WmStateCmd( enum options { OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN }; int index; + (void)tkwin; if ((objc < 3) || (objc > 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?state?"); @@ -3476,6 +3505,7 @@ WmTitleCmd( { WmInfo *wmPtr = winPtr->wmInfoPtr; const char *argv3; + (void)tkwin; if (objc > 4) { Tcl_WrongNumArgs(interp, 2, objv, "window ?newTitle?"); @@ -3492,7 +3522,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)) { @@ -3677,6 +3707,7 @@ WmWithdrawCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { WmInfo *wmPtr = winPtr->wmInfoPtr; + (void)tkwin; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "window"); @@ -3725,7 +3756,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) { @@ -4414,7 +4445,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; @@ -4502,6 +4533,7 @@ TopLevelReqProc( { TkWindow *winPtr = (TkWindow *) tkwin; WmInfo *wmPtr = winPtr->wmInfoPtr; + (void)dummy; if (wmPtr == NULL) { return; @@ -4564,7 +4596,7 @@ static void UpdateGeometryInfo( ClientData clientData) /* Pointer to the window's record. */ { - TkWindow *winPtr = clientData; + TkWindow *winPtr = (TkWindow *)clientData; WmInfo *wmPtr = winPtr->wmInfoPtr; int x, y, width, height, min, max; unsigned long serial; @@ -5303,7 +5335,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; @@ -5459,7 +5491,7 @@ SetNetWmType( } if (objc > 0) { - atoms = ckalloc(sizeof(Atom) * objc); + atoms = (Atom *)ckalloc(sizeof(Atom) * objc); } for (n = 0; n < objc; ++n) { @@ -6242,7 +6274,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"); @@ -6433,7 +6465,7 @@ 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; } @@ -6449,7 +6481,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; } @@ -6467,7 +6499,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; } } @@ -6640,7 +6672,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]; } @@ -6875,7 +6907,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); @@ -6993,7 +7025,7 @@ CreateWrapper( TkWindow *winPtr, *wrapperPtr; Window parent; Tcl_HashEntry *hPtr; - int new; + int isNew; winPtr = wmPtr->winPtr; if (winPtr->window == None) { @@ -7037,7 +7069,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++; @@ -7256,7 +7288,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) { @@ -7338,8 +7370,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); |