diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-03-19 10:17:47 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-03-19 10:17:47 (GMT) |
commit | 55b8b289c6821cff7faa7552c53d0ee5d11e93f4 (patch) | |
tree | 474d53f2d504d06b3609cf250c1e92180025d642 | |
parent | 1c9d56a0f8ddd1cdc87789648eb7032671b2607e (diff) | |
parent | 2697ce46a4ddd06efb4c543aeeee43b6f3dcf94b (diff) | |
download | tk-55b8b289c6821cff7faa7552c53d0ee5d11e93f4.zip tk-55b8b289c6821cff7faa7552c53d0ee5d11e93f4.tar.gz tk-55b8b289c6821cff7faa7552c53d0ee5d11e93f4.tar.bz2 |
Merge 8.6. More TCL_UNUSED() usage.
-rw-r--r-- | .travis.yml | 57 | ||||
-rw-r--r-- | generic/tkCanvPoly.c | 18 | ||||
-rw-r--r-- | generic/tkUtil.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXMenu.c | 20 | ||||
-rw-r--r-- | macosx/tkMacOSXMenubutton.c | 14 | ||||
-rw-r--r-- | macosx/tkMacOSXMenus.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 18 | ||||
-rw-r--r-- | macosx/tkMacOSXXStubs.c | 206 | ||||
-rw-r--r-- | macosx/ttkMacOSXTheme.c | 142 | ||||
-rw-r--r-- | unix/tkUnixFont.c | 54 | ||||
-rw-r--r-- | win/tkWinFont.c | 50 |
11 files changed, 296 insertions, 291 deletions
diff --git a/.travis.yml b/.travis.yml index 64163ed..ea87be9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -113,20 +113,55 @@ matrix: - BUILD_DIR=unix - CFGOPT="--enable-symbols" # Testing on Mac, various styles - - name: "macOS/Xcode 11.3/Shared/Unix-like" + - name: "macOS/Xcode 11.3/Shared" os: osx osx_image: xcode11.3 env: - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --disable-corefoundation --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib CFLAGS=-I/usr/local/opt/tcl-tk/include" -# - name: "macOS/Xcode 11.3/Shared" -# os: osx -# osx_image: xcode11.3 -# env: -# - BUILD_DIR=macosx -# install: [] -# script: -# - make INSTALL_PATH=/usr/local/opt/tcl-tk/lib TCL_INSTALL_PATH=/usr/local/opt/tcl-tk/lib CFLAGS=-I/usr/local/opt/tcl-tk/include tk + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" + - name: "macOS/Xcode 11.3/Static" + os: osx + osx_image: xcode11.3 + env: + - BUILD_DIR=unix + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua --disable-shared CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" + - name: "macOS/Xcode 11.3/Debug" + os: osx + osx_image: xcode11.3 + env: + - BUILD_DIR=unix + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua --enable-symbols CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" + - name: "macOS/Xcode 11.3/Shared/XQuartz" + os: osx + osx_image: xcode11.3 + env: + - BUILD_DIR=unix + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --disable-corefoundation --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" +# Older MacOS versions + - name: "macOS/Xcode 11/Shared" + os: osx + osx_image: xcode11 + env: + - BUILD_DIR=unix + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" + - name: "macOS/Xcode 10/Shared" + os: osx + osx_image: xcode10.3 + env: + - BUILD_DIR=unix + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" + - name: "macOS/Xcode 9/Shared" + os: osx + osx_image: xcode9 + env: + - BUILD_DIR=unix + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" + - name: "macOS/Xcode 8/Shared" + os: osx + osx_image: xcode8 + env: + - BUILD_DIR=unix + - CFGOPT="--prefix=/usr/local/opt/tcl-tk --with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CC=clang CFLAGS=-I/usr/local/opt/tcl-tk/include" # Test on Windows with MSVC native # - name: "Windows/MSVC/Shared" # os: windows @@ -158,7 +193,7 @@ install: before_script: - export ERROR_ON_FAILURES=1 script: - - make binaries libraries tktest + - make all tktest cache: directories: - $HOME/AppData/Local/Temp/chocolatey diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index 1fd71bc..f2fef26 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.c @@ -566,12 +566,11 @@ ConfigurePolygon( static void DeletePolygon( - Tk_Canvas canvas, /* Info about overall canvas widget. */ + TCL_UNUSED(Tk_Canvas), /* Info about overall canvas widget. */ Tk_Item *itemPtr, /* Item that is being deleted. */ Display *display) /* Display containing window for canvas. */ { PolygonItem *polyPtr = (PolygonItem *) itemPtr; - (void)canvas; Tk_DeleteOutline(display, &polyPtr->outline); if (polyPtr->coordPtr != NULL) { @@ -877,7 +876,10 @@ DisplayPolygon( Tk_Item *itemPtr, /* Item to be displayed. */ Display *display, /* Display on which to draw item. */ Drawable drawable, /* Pixmap or window in which to draw item. */ - int x, int y, int width, int height) + TCL_UNUSED(int), + TCL_UNUSED(int), + TCL_UNUSED(int), + TCL_UNUSED(int)) /* Describes region of canvas that must be * redisplayed (not used). */ { @@ -885,10 +887,6 @@ DisplayPolygon( Tk_State state = itemPtr->state; Pixmap stipple = polyPtr->fillStipple; double linewidth = polyPtr->outline.width; - (void)x; - (void)y; - (void)width; - (void)height; if (((polyPtr->fillGC == NULL) && (polyPtr->outline.gc == NULL)) || (polyPtr->numPoints < 1) || @@ -1672,7 +1670,7 @@ ScalePolygon( static int GetPolygonIndex( Tcl_Interp *interp, /* Used for error reporting. */ - Tk_Canvas canvas, /* Canvas containing item. */ + TCL_UNUSED(Tk_Canvas), /* Canvas containing item. */ Tk_Item *itemPtr, /* Item for which the index is being * specified. */ Tcl_Obj *obj, /* Specification of a particular coord in @@ -1682,7 +1680,6 @@ GetPolygonIndex( TkSizeT length, idx; PolygonItem *polyPtr = (PolygonItem *) itemPtr; const char *string; - (void)canvas; TkSizeT count = 2*(polyPtr->numPoints - polyPtr->autoClosed); if (TCL_OK == TkGetIntForIndex(obj, (INT_MAX) - ((INT_MAX) % count), &idx)) { @@ -1836,7 +1833,7 @@ PolygonToPostscript( Tcl_Interp *interp, /* Leave Postscript or error message here. */ Tk_Canvas canvas, /* Information about overall canvas. */ Tk_Item *itemPtr, /* Item for which Postscript is wanted. */ - int prepass) /* 1 means this is a prepass to collect font + TCL_UNUSED(int)) /* 1 means this is a prepass to collect font * information; 0 means final Postscript is * being created. */ { @@ -1850,7 +1847,6 @@ PolygonToPostscript( double width; Tcl_Obj *psObj; Tcl_InterpState interpState; - (void)prepass; if (polyPtr->numPoints < 2 || polyPtr->coordPtr == NULL) { return TCL_OK; diff --git a/generic/tkUtil.c b/generic/tkUtil.c index 009adda..0870c29 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -129,7 +129,7 @@ TkStatePrintProc( TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ int offset, /* Offset into item. */ - TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with + TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ { @@ -231,7 +231,7 @@ TkOrientPrintProc( TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ int offset, /* Offset into item. */ - TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with + TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ { diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 7ffc054..1ed9408 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -1703,7 +1703,7 @@ TkpMenuThreadInit(void) void TkpMenuNotifyToplevelCreate( TCL_UNUSED(Tcl_Interp *), /* The interp the menu lives in. */ - TCL_UNUSED(const char *)) /* The name of the menu to reconfigure. */ + TCL_UNUSED(const char *)) /* The name of the menu to reconfigure. */ { /* * Nothing to do. @@ -1732,7 +1732,7 @@ TkpMenuNotifyToplevelCreate( void TkpInitializeMenuBindings( TCL_UNUSED(Tcl_Interp *), /* The interpreter to set. */ - TCL_UNUSED(Tk_BindingTable)) + TCL_UNUSED(Tk_BindingTable)) /* The table to add to. */ { /* @@ -1788,14 +1788,14 @@ TkpDrawMenuEntry( TCL_UNUSED(TkMenuEntry *), /* The entry to draw */ TCL_UNUSED(Drawable), /* What to draw into */ TCL_UNUSED(Tk_Font), /* Precalculated font for menu */ - TCL_UNUSED(const Tk_FontMetrics *), + TCL_UNUSED(const Tk_FontMetrics *), /* Precalculated metrics for menu */ - TCL_UNUSED(int), /* X-coordinate of topleft of entry */ - TCL_UNUSED(int), /* Y-coordinate of topleft of entry */ - TCL_UNUSED(int), /* Width of the entry rectangle */ - TCL_UNUSED(int), /* Height of the current rectangle */ - TCL_UNUSED(int), /* Boolean flag */ - TCL_UNUSED(int)) /* Whether or not to draw the cascade arrow + TCL_UNUSED(int), /* X-coordinate of topleft of entry */ + TCL_UNUSED(int), /* Y-coordinate of topleft of entry */ + TCL_UNUSED(int), /* Width of the entry rectangle */ + TCL_UNUSED(int), /* Height of the current rectangle */ + TCL_UNUSED(int), /* Boolean flag */ + TCL_UNUSED(int)) /* Whether or not to draw the cascade arrow * for cascade items. */ { } @@ -1868,7 +1868,7 @@ TkMacOSXUseMenuID( int TkMacOSXDispatchMenuEvent( TCL_UNUSED(int), /* The menu id of the menu we are invoking */ - TCL_UNUSED(int)) /* The one-based index of the item that was + TCL_UNUSED(int)) /* The one-based index of the item that was * selected. */ { return TCL_ERROR; diff --git a/macosx/tkMacOSXMenubutton.c b/macosx/tkMacOSXMenubutton.c index c079005..a404dba 100644 --- a/macosx/tkMacOSXMenubutton.c +++ b/macosx/tkMacOSXMenubutton.c @@ -546,7 +546,7 @@ DrawMenuButtonImageAndText( static void TkMacOSXDrawMenuButton( MacMenuButton *mbPtr, /* Mac menubutton. */ - TCL_UNUSED(GC), /* The GC we are drawing into - not used */ + TCL_UNUSED(GC), /* The GC we are drawing into - not used */ Pixmap pixmap) /* The pixmap we are drawing into - needed for the * bevel button */ { @@ -626,8 +626,8 @@ TkMacOSXDrawMenuButton( static void MenuButtonBackgroundDrawCB ( MacMenuButton *ptr, - TCL_UNUSED(SInt16), - TCL_UNUSED(Boolean)) + TCL_UNUSED(SInt16), + TCL_UNUSED(Boolean)) { TkMenuButton* butPtr = (TkMenuButton *) ptr; Tk_Window tkwin = butPtr->tkwin; @@ -659,11 +659,11 @@ MenuButtonBackgroundDrawCB ( static void MenuButtonContentDrawCB ( - TCL_UNUSED(ThemeButtonKind), - TCL_UNUSED(const HIThemeButtonDrawInfo *), + TCL_UNUSED(ThemeButtonKind), + TCL_UNUSED(const HIThemeButtonDrawInfo *), MacMenuButton *ptr, - TCL_UNUSED(SInt16), - TCL_UNUSED(Boolean)) + TCL_UNUSED(SInt16), + TCL_UNUSED(Boolean)) { TkMenuButton *butPtr = (TkMenuButton *) ptr; Tk_Window tkwin = butPtr->tkwin; diff --git a/macosx/tkMacOSXMenus.c b/macosx/tkMacOSXMenus.c index d6d3185..1029704 100644 --- a/macosx/tkMacOSXMenus.c +++ b/macosx/tkMacOSXMenus.c @@ -364,8 +364,8 @@ GetWidgetDemoPath( void TkMacOSXHandleMenuSelect( TCL_UNUSED(short), - TCL_UNUSED(unsigned short), - TCL_UNUSED(int)) + TCL_UNUSED(unsigned short), + TCL_UNUSED(int)) { Tcl_Panic("TkMacOSXHandleMenuSelect: Obsolete, no more Carbon!"); } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 19e6a25..2323c58 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -1911,9 +1911,9 @@ static int WmForgetCmd( TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel or Frame to work with */ - TCL_UNUSED(Tcl_Interp *), /* Current interpreter. */ - TCL_UNUSED(int), /* Number of arguments. */ - TCL_UNUSED(Tcl_Obj *const *)) /* Argument objects. */ + TCL_UNUSED(Tcl_Interp *), /* Current interpreter. */ + TCL_UNUSED(int), /* Number of arguments. */ + TCL_UNUSED(Tcl_Obj *const *)) /* Argument objects. */ { Tk_Window frameWin = (Tk_Window) winPtr; @@ -2762,8 +2762,8 @@ WmManageCmd( TCL_UNUSED(Tk_Window), /* Main window of the application. */ TkWindow *winPtr, /* Toplevel or Frame to work with */ Tcl_Interp *interp, /* Current interpreter. */ - TCL_UNUSED(int), /* Number of arguments. */ - TCL_UNUSED(Tcl_Obj *const *)) /* Argument objects. */ + TCL_UNUSED(int), /* Number of arguments. */ + TCL_UNUSED(Tcl_Obj *const *)) /* Argument objects. */ { Tk_Window frameWin = (Tk_Window) winPtr; WmInfo *wmPtr = winPtr->wmInfoPtr; @@ -5304,7 +5304,7 @@ TkMacOSXResizable( int TkMacOSXGrowToplevel( TCL_UNUSED(void *), - TCL_UNUSED(XPoint)) + TCL_UNUSED(XPoint)) { return false; } @@ -6529,9 +6529,9 @@ TkpGetMS(void) int XSetInputFocus( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(int), - TCL_UNUSED(Time)) + TCL_UNUSED(Window), + TCL_UNUSED(int), + TCL_UNUSED(Time)) { /* * Don't need to do a thing. Tk manages the focus for us. diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index a02e71b..11a0b35 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -225,7 +225,7 @@ TkpOpenDisplay( Display * XkbOpenDisplay( - TCL_UNUSED(char *), + TCL_UNUSED(char *), int *ev_rtrn, int *err_rtrn, int *major_rtrn, @@ -514,13 +514,13 @@ XGetGeometry( int XChangeProperty( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(Atom), - TCL_UNUSED(Atom), - TCL_UNUSED(int), - TCL_UNUSED(int), - TCL_UNUSED(_Xconst unsigned char *), - TCL_UNUSED(int)) + TCL_UNUSED(Window), + TCL_UNUSED(Atom), + TCL_UNUSED(Atom), + TCL_UNUSED(int), + TCL_UNUSED(int), + TCL_UNUSED(_Xconst unsigned char *), + TCL_UNUSED(int)) { Debugger(); return Success; @@ -529,8 +529,8 @@ XChangeProperty( int XSelectInput( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(long)) + TCL_UNUSED(Window), + TCL_UNUSED(long)) { Debugger(); return Success; @@ -539,7 +539,7 @@ XSelectInput( int XBell( TCL_UNUSED(Display *), - TCL_UNUSED(int)) + TCL_UNUSED(int)) { NSBeep(); return Success; @@ -549,8 +549,8 @@ XBell( void XSetWMNormalHints( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(XSizeHints *)) + TCL_UNUSED(Window), + TCL_UNUSED(XSizeHints *)) { /* * Do nothing. Shouldn't even be called. @@ -583,10 +583,10 @@ XGContextFromGC( Status XSendEvent( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(Bool), - TCL_UNUSED(long), - TCL_UNUSED(XEvent *)) + TCL_UNUSED(Window), + TCL_UNUSED(Bool), + TCL_UNUSED(long), + TCL_UNUSED(XEvent *)) { Debugger(); return 0; @@ -595,7 +595,7 @@ XSendEvent( int XClearWindow( TCL_UNUSED(Display *), - TCL_UNUSED(Window)) + TCL_UNUSED(Window)) { return Success; } @@ -628,14 +628,14 @@ XDrawPoints( int XWarpPointer( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(Window), - TCL_UNUSED(int), - TCL_UNUSED(int), - TCL_UNUSED(unsigned int), - TCL_UNUSED(unsigned int), - TCL_UNUSED(int), - TCL_UNUSED(int)) + TCL_UNUSED(Window), + TCL_UNUSED(Window), + TCL_UNUSED(int), + TCL_UNUSED(int), + TCL_UNUSED(unsigned int), + TCL_UNUSED(unsigned int), + TCL_UNUSED(int), + TCL_UNUSED(int)) { return Success; } @@ -643,7 +643,7 @@ XWarpPointer( int XQueryColor( TCL_UNUSED(Display *), - TCL_UNUSED(Colormap), + TCL_UNUSED(Colormap), XColor* def_in_out) { unsigned long p; @@ -665,13 +665,13 @@ XQueryColor( Bool XTranslateCoordinates( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(Window), - TCL_UNUSED(int), - TCL_UNUSED(int), - TCL_UNUSED(int *), - TCL_UNUSED(int *), - TCL_UNUSED(Window *)) + TCL_UNUSED(Window), + TCL_UNUSED(Window), + TCL_UNUSED(int), + TCL_UNUSED(int), + TCL_UNUSED(int *), + TCL_UNUSED(int *), + TCL_UNUSED(Window *)) { return 0; } @@ -679,9 +679,9 @@ XTranslateCoordinates( int XSetCommand( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(char **), - TCL_UNUSED(int)) + TCL_UNUSED(Window), + TCL_UNUSED(char **), + TCL_UNUSED(int)) { return Success; } @@ -689,8 +689,8 @@ XSetCommand( int XGetWindowAttributes( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(XWindowAttributes *)) + TCL_UNUSED(Window), + TCL_UNUSED(XWindowAttributes *)) { return Success; } @@ -698,9 +698,9 @@ XGetWindowAttributes( Status XGetWMColormapWindows( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(Window **), - TCL_UNUSED(int *)) + TCL_UNUSED(Window), + TCL_UNUSED(Window **), + TCL_UNUSED(int *)) { return Success; } @@ -708,8 +708,8 @@ XGetWMColormapWindows( int XIconifyWindow( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(int)) + TCL_UNUSED(Window), + TCL_UNUSED(int)) { return Success; } @@ -717,8 +717,8 @@ XIconifyWindow( XHostAddress * XListHosts( TCL_UNUSED(Display *), - TCL_UNUSED(int *), - TCL_UNUSED(Bool *)) + TCL_UNUSED(int *), + TCL_UNUSED(Bool *)) { return NULL; } @@ -726,10 +726,10 @@ XListHosts( int XLookupColor( TCL_UNUSED(Display *), - TCL_UNUSED(Colormap), - TCL_UNUSED(_Xconst char *), - TCL_UNUSED(XColor *), - TCL_UNUSED(XColor *)) + TCL_UNUSED(Colormap), + TCL_UNUSED(_Xconst char *), + TCL_UNUSED(XColor *), + TCL_UNUSED(XColor *)) { return Success; } @@ -737,7 +737,7 @@ XLookupColor( int XNextEvent( TCL_UNUSED(Display *), - TCL_UNUSED(XEvent *)) + TCL_UNUSED(XEvent *)) { return Success; } @@ -745,7 +745,7 @@ XNextEvent( int XPutBackEvent( TCL_UNUSED(Display *), - TCL_UNUSED(XEvent *)) + TCL_UNUSED(XEvent *)) { return Success; } @@ -753,7 +753,7 @@ XPutBackEvent( int XQueryColors( TCL_UNUSED(Display *), - TCL_UNUSED(Colormap), + TCL_UNUSED(Colormap), XColor* defs_in_out, int ncolors) { @@ -779,11 +779,11 @@ XQueryColors( int XQueryTree( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(Window *), - TCL_UNUSED(Window *), - TCL_UNUSED(Window **), - TCL_UNUSED(unsigned int *)) + TCL_UNUSED(Window), + TCL_UNUSED(Window *), + TCL_UNUSED(Window *), + TCL_UNUSED(Window **), + TCL_UNUSED(unsigned int *)) { return 0; } @@ -792,17 +792,17 @@ XQueryTree( int XGetWindowProperty( Display *display, - TCL_UNUSED(Window), - TCL_UNUSED(Atom), - TCL_UNUSED(long), - TCL_UNUSED(long), - TCL_UNUSED(Bool), - TCL_UNUSED(Atom), + TCL_UNUSED(Window), + TCL_UNUSED(Atom), + TCL_UNUSED(long), + TCL_UNUSED(long), + TCL_UNUSED(Bool), + TCL_UNUSED(Atom), Atom *actual_type_return, int *actual_format_return, unsigned long *nitems_return, unsigned long *bytes_after_return, - TCL_UNUSED(unsigned char **)) + TCL_UNUSED(unsigned char **)) { display->request++; *actual_type_return = None; @@ -814,9 +814,9 @@ XGetWindowProperty( int XWindowEvent( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(long), - TCL_UNUSED(XEvent *)) + TCL_UNUSED(Window), + TCL_UNUSED(long), + TCL_UNUSED(XEvent *)) { return Success; } @@ -824,8 +824,8 @@ XWindowEvent( int XWithdrawWindow( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(int)) + TCL_UNUSED(Window), + TCL_UNUSED(int)) { return Success; } @@ -833,11 +833,11 @@ XWithdrawWindow( int XmbLookupString( TCL_UNUSED(XIC), - TCL_UNUSED(XKeyPressedEvent *), - TCL_UNUSED(char *), - TCL_UNUSED(int), - TCL_UNUSED(KeySym *), - TCL_UNUSED(Status *)) + TCL_UNUSED(XKeyPressedEvent *), + TCL_UNUSED(char *), + TCL_UNUSED(int), + TCL_UNUSED(KeySym *), + TCL_UNUSED(Status *)) { return Success; } @@ -854,8 +854,8 @@ XRefreshKeyboardMapping( int XSetIconName( Display* display, - TCL_UNUSED(Window), - TCL_UNUSED(const char *)) + TCL_UNUSED(Window), + TCL_UNUSED(const char *)) { /* * This is a no-op, no icon name for Macs. @@ -867,7 +867,7 @@ XSetIconName( int XForceScreenSaver( Display* display, - TCL_UNUSED(int)) + TCL_UNUSED(int)) { /* * This function is just a no-op. It is defined to reset the screen saver. @@ -965,9 +965,9 @@ TkGetServerInfo( int XChangeWindowAttributes( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(unsigned long), - TCL_UNUSED(XSetWindowAttributes *)) + TCL_UNUSED(Window), + TCL_UNUSED(unsigned long), + TCL_UNUSED(XSetWindowAttributes *)) { return Success; } @@ -975,8 +975,8 @@ XChangeWindowAttributes( int XSetWindowBackground( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(unsigned long)) + TCL_UNUSED(Window), + TCL_UNUSED(unsigned long)) { return Success; } @@ -984,8 +984,8 @@ XSetWindowBackground( int XSetWindowBackgroundPixmap( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(Pixmap)) + TCL_UNUSED(Window), + TCL_UNUSED(Pixmap)) { return Success; } @@ -993,8 +993,8 @@ XSetWindowBackgroundPixmap( int XSetWindowBorder( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(unsigned long)) + TCL_UNUSED(Window), + TCL_UNUSED(unsigned long)) { return Success; } @@ -1002,8 +1002,8 @@ XSetWindowBorder( int XSetWindowBorderPixmap( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(Pixmap)) + TCL_UNUSED(Window), + TCL_UNUSED(Pixmap)) { return Success; } @@ -1011,8 +1011,8 @@ XSetWindowBorderPixmap( int XSetWindowBorderWidth( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(unsigned int)) + TCL_UNUSED(Window), + TCL_UNUSED(unsigned int)) { return Success; } @@ -1020,8 +1020,8 @@ XSetWindowBorderWidth( int XSetWindowColormap( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(Colormap)) + TCL_UNUSED(Window), + TCL_UNUSED(Colormap)) { Debugger(); return Success; @@ -1030,8 +1030,8 @@ XSetWindowColormap( Status XStringListToTextProperty( TCL_UNUSED(char **), - TCL_UNUSED(int), - TCL_UNUSED(XTextProperty *)) + TCL_UNUSED(int), + TCL_UNUSED(XTextProperty *)) { Debugger(); return Success; @@ -1040,8 +1040,8 @@ XStringListToTextProperty( void XSetWMClientMachine( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(XTextProperty *)) + TCL_UNUSED(Window), + TCL_UNUSED(XTextProperty *)) { Debugger(); } @@ -1056,8 +1056,8 @@ XCreateIC(TCL_UNUSED(XIM), ...) int XDeleteProperty( TCL_UNUSED(Display *), - TCL_UNUSED(Window), - TCL_UNUSED(Atom)) + TCL_UNUSED(Window), + TCL_UNUSED(Atom)) { return Success; } @@ -1065,8 +1065,8 @@ XDeleteProperty( int XGetInputFocus( Display *display, - TCL_UNUSED(Window *), - TCL_UNUSED(int *)) + TCL_UNUSED(Window *), + TCL_UNUSED(int *)) { display->request++; return Success; @@ -1082,7 +1082,7 @@ XVisualIDFromVisual( XAfterFunction XSynchronize( Display *display, - TCL_UNUSED(Bool)) + TCL_UNUSED(Bool)) { display->request++; return NULL; @@ -1098,7 +1098,7 @@ XUngrabServer( int XFreeCursor( TCL_UNUSED(Display *), - TCL_UNUSED(Cursor)) + TCL_UNUSED(Cursor)) { return Success; } diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index 324bbe0..72649f6 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -1263,7 +1263,7 @@ static Ttk_StateTable ButtonAdornmentTable[] = { static inline HIThemeButtonDrawInfo computeButtonDrawInfo( ThemeButtonParams *params, Ttk_State state, - TCL_UNUSED(Tk_Window)) + TCL_UNUSED(Tk_Window)) { /* @@ -1299,11 +1299,11 @@ static inline HIThemeButtonDrawInfo computeButtonDrawInfo( static void ButtonElementMinSize( void *clientData, - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), int *minWidth, int *minHeight, - TCL_UNUSED(Ttk_Padding *)) + TCL_UNUSED(Ttk_Padding *)) { ThemeButtonParams *params = (ThemeButtonParams *)clientData; @@ -1377,7 +1377,7 @@ static void ButtonElementSize( static void ButtonElementDraw( void *clientData, - TCL_UNUSED(void *), + TCL_UNUSED(void *), Tk_Window tkwin, Drawable d, Ttk_Box b, @@ -1530,9 +1530,9 @@ static Ttk_StateTable TabPositionTable[] = { static void TabElementSize( TCL_UNUSED(void *), - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), - TCL_UNUSED(int *), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), + TCL_UNUSED(int *), int *minHeight, Ttk_Padding *paddingPtr) { @@ -1543,7 +1543,7 @@ static void TabElementSize( static void TabElementDraw( TCL_UNUSED(void *), - TCL_UNUSED(void *), + TCL_UNUSED(void *), Tk_Window tkwin, Drawable d, Ttk_Box b, @@ -1584,10 +1584,10 @@ static Ttk_ElementSpec TabElementSpec = { static void PaneElementSize( TCL_UNUSED(void *), - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), - TCL_UNUSED(int *), - TCL_UNUSED(int *), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), + TCL_UNUSED(int *), + TCL_UNUSED(int *), Ttk_Padding *paddingPtr) { *paddingPtr = Ttk_MakePadding(9, 5, 9, 9); @@ -1595,7 +1595,7 @@ static void PaneElementSize( static void PaneElementDraw( TCL_UNUSED(void *), - TCL_UNUSED(void *), + TCL_UNUSED(void *), Tk_Window tkwin, Drawable d, Ttk_Box b, @@ -1645,10 +1645,10 @@ static Ttk_ElementSpec PaneElementSpec = { static void GroupElementSize( TCL_UNUSED(void *), - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), - TCL_UNUSED(int *), - TCL_UNUSED(int *), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), + TCL_UNUSED(int *), + TCL_UNUSED(int *), Ttk_Padding *paddingPtr) { *paddingPtr = Ttk_UniformPadding(4); @@ -1656,7 +1656,7 @@ static void GroupElementSize( static void GroupElementDraw( TCL_UNUSED(void *), - TCL_UNUSED(void *), + TCL_UNUSED(void *), Tk_Window tkwin, Drawable d, Ttk_Box b, @@ -1710,10 +1710,10 @@ static Ttk_ElementOptionSpec EntryElementOptions[] = { static void EntryElementSize( TCL_UNUSED(void *), - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), - TCL_UNUSED(int *), - TCL_UNUSED(int *), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), + TCL_UNUSED(int *), + TCL_UNUSED(int *), Ttk_Padding *paddingPtr) { *paddingPtr = Ttk_MakePadding(7, 5, 7, 6); @@ -1833,8 +1833,8 @@ static Ttk_Padding ComboboxPadding = {4, 2, 20, 2}; static void ComboboxElementSize( TCL_UNUSED(void *), - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), int *minWidth, int *minHeight, Ttk_Padding *paddingPtr) @@ -1846,7 +1846,7 @@ static void ComboboxElementSize( static void ComboboxElementDraw( TCL_UNUSED(void *), - TCL_UNUSED(void *), + TCL_UNUSED(void *), Tk_Window tkwin, Drawable d, Ttk_Box b, @@ -1911,11 +1911,11 @@ static Ttk_Padding SpinbuttonMargins = {0, 0, 2, 0}; static void SpinButtonUpElementSize( TCL_UNUSED(void *), - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), int *minWidth, int *minHeight, - TCL_UNUSED(Ttk_Padding *)) + TCL_UNUSED(Ttk_Padding *)) { SInt32 s; @@ -1927,7 +1927,7 @@ static void SpinButtonUpElementSize( static void SpinButtonUpElementDraw( TCL_UNUSED(void *), - TCL_UNUSED(void *), + TCL_UNUSED(void *), Tk_Window tkwin, Drawable d, Ttk_Box b, @@ -1968,11 +1968,11 @@ static Ttk_ElementSpec SpinButtonUpElementSpec = { }; static void SpinButtonDownElementSize( TCL_UNUSED(void *), - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), int *minWidth, int *minHeight, - TCL_UNUSED(Ttk_Padding *)) + TCL_UNUSED(Ttk_Padding *)) { SInt32 s; @@ -1984,7 +1984,7 @@ static void SpinButtonDownElementSize( static void SpinButtonDownElementDraw( TCL_UNUSED(void *), - TCL_UNUSED(void *), + TCL_UNUSED(void *), Tk_Window tkwin, Drawable d, Ttk_Box b, @@ -2069,11 +2069,11 @@ static Ttk_ElementOptionSpec TrackElementOptions[] = { }; static void TrackElementSize( void *clientData, - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), int *minWidth, int *minHeight, - TCL_UNUSED(Ttk_Padding *)) + TCL_UNUSED(Ttk_Padding *)) { TrackElementData *data = (TrackElementData *)clientData; SInt32 size = 24; /* reasonable default ... */ @@ -2161,11 +2161,11 @@ static Ttk_ElementSpec TrackElementSpec = { static void SliderElementSize( TCL_UNUSED(void *), - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), int *minWidth, int *minHeight, - TCL_UNUSED(Ttk_Padding *)) + TCL_UNUSED(Ttk_Padding *)) { *minWidth = *minHeight = 24; } @@ -2209,11 +2209,11 @@ static Ttk_ElementOptionSpec PbarElementOptions[] = { }; static void PbarElementSize( TCL_UNUSED(void *), - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), int *minWidth, int *minHeight, - TCL_UNUSED(Ttk_Padding *)) + TCL_UNUSED(Ttk_Padding *)) { SInt32 size = 24; /* @@@ Check HIG for correct default */ @@ -2300,7 +2300,7 @@ static Ttk_ElementOptionSpec ScrollbarElementOptions[] = { static void TroughElementSize( TCL_UNUSED(void *), void *elementRecord, - TCL_UNUSED(Tk_Window), + TCL_UNUSED(Tk_Window), int *minWidth, int *minHeight, Ttk_Padding *paddingPtr) @@ -2344,7 +2344,7 @@ static void TroughElementDraw( Tk_Window tkwin, Drawable d, Ttk_Box b, - TCL_UNUSED(Ttk_State)) + TCL_UNUSED(Ttk_State)) { ScrollbarElement *scrollbar = elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; @@ -2383,10 +2383,10 @@ static Ttk_ElementSpec TroughElementSpec = { static void ThumbElementSize( TCL_UNUSED(void *), void *elementRecord, - TCL_UNUSED(Tk_Window), + TCL_UNUSED(Tk_Window), int *minWidth, int *minHeight, - TCL_UNUSED(Ttk_Padding *)) + TCL_UNUSED(Ttk_Padding *)) { ScrollbarElement *scrollbar = elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; @@ -2518,11 +2518,11 @@ static Ttk_ElementSpec ThumbElementSpec = { }; static void ArrowElementSize( TCL_UNUSED(void *), - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), int *minWidth, int *minHeight, - TCL_UNUSED(Ttk_Padding *)) + TCL_UNUSED(Ttk_Padding *)) { if ([NSApp macMinorVersion] < 8) { *minHeight = *minWidth = 14; @@ -2549,18 +2549,18 @@ static Ttk_ElementSpec ArrowElementSpec = { static void SeparatorElementSize( TCL_UNUSED(void *), - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), int *minWidth, int *minHeight, - TCL_UNUSED(Ttk_Padding *)) + TCL_UNUSED(Ttk_Padding *)) { *minWidth = *minHeight = 1; } static void SeparatorElementDraw( TCL_UNUSED(void *), - TCL_UNUSED(void *), + TCL_UNUSED(void *), Tk_Window tkwin, Drawable d, Ttk_Box b, @@ -2601,11 +2601,11 @@ static const ThemeGrowDirection sizegripGrowDirection static void SizegripElementSize( TCL_UNUSED(void *), - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), int *minWidth, int *minHeight, - TCL_UNUSED(Ttk_Padding *)) + TCL_UNUSED(Ttk_Padding *)) { HIThemeGrowBoxDrawInfo info = { .version = 0, @@ -2623,8 +2623,8 @@ static void SizegripElementSize( static void SizegripElementDraw( TCL_UNUSED(void *), - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), Drawable d, Ttk_Box b, unsigned int state) @@ -2700,7 +2700,7 @@ static Ttk_ElementSpec SizegripElementSpec = { static void FillElementDraw( TCL_UNUSED(void *), - TCL_UNUSED(void *), + TCL_UNUSED(void *), Tk_Window tkwin, Drawable d, Ttk_Box b, @@ -2737,7 +2737,7 @@ static void BackgroundElementDraw( void *elementRecord, Tk_Window tkwin, Drawable d, - TCL_UNUSED(Ttk_Box), + TCL_UNUSED(Ttk_Box), unsigned int state) { FillElementDraw(clientData, elementRecord, tkwin, d, Ttk_WinBox(tkwin), @@ -2775,11 +2775,11 @@ static Ttk_ElementSpec BackgroundElementSpec = { static void ToolbarBackgroundElementDraw( TCL_UNUSED(void *), - TCL_UNUSED(void *), + TCL_UNUSED(void *), Tk_Window tkwin, Drawable d, - TCL_UNUSED(Ttk_Box), - TCL_UNUSED(Ttk_State)) + TCL_UNUSED(Ttk_Box), + TCL_UNUSED(Ttk_State)) { ThemeBrush brush = kThemeBrushToolbarBackground; CGRect bounds = BoxToRect(d, Ttk_WinBox(tkwin)); @@ -2822,7 +2822,7 @@ static void FieldElementDraw( Tk_Window tkwin, Drawable d, Ttk_Box b, - TCL_UNUSED(Ttk_State)) + TCL_UNUSED(Ttk_State)) { FieldElement *e = elementRecord; Tk_3DBorder backgroundPtr = @@ -2871,7 +2871,7 @@ static void TreeAreaElementSize ( TCL_UNUSED(void *), TCL_UNUSED(Tk_Window), TCL_UNUSED(int *), - TCL_UNUSED(int *), + TCL_UNUSED(int *), Ttk_Padding *paddingPtr) { @@ -2910,7 +2910,7 @@ static void TreeHeaderElementSize( static void TreeHeaderElementDraw( void *clientData, - TCL_UNUSED(void *), + TCL_UNUSED(void *), Tk_Window tkwin, Drawable d, Ttk_Box b, @@ -2967,11 +2967,11 @@ static Ttk_StateTable DisclosureValueTable[] = { }; static void DisclosureElementSize( TCL_UNUSED(void *), - TCL_UNUSED(void *), - TCL_UNUSED(Tk_Window), + TCL_UNUSED(void *), + TCL_UNUSED(Tk_Window), int *minWidth, int *minHeight, - TCL_UNUSED(Ttk_Padding *)) + TCL_UNUSED(Ttk_Padding *)) { SInt32 s; @@ -2983,7 +2983,7 @@ static void DisclosureElementSize( static void DisclosureElementDraw( TCL_UNUSED(void *), - TCL_UNUSED(void *), + TCL_UNUSED(void *), Tk_Window tkwin, Drawable d, Ttk_Box b, diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index 0cc9261..06d6075 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -36,7 +36,8 @@ static const char encodingList[][10] = { #define FONTMAP_SHIFT 10 #define FONTMAP_BITSPERPAGE (1 << FONTMAP_SHIFT) -#define FONTMAP_PAGES (0x30000 / FONTMAP_BITSPERPAGE) +#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. */ @@ -192,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, @@ -202,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); @@ -237,11 +238,11 @@ 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); -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); @@ -266,11 +267,10 @@ static int UtfToUcs2beProc(ClientData clientData, const char*src, static void FontPkgCleanup( - ClientData dummy) + TCL_UNUSED(void *)) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - (void)dummy; if (tsdPtr->controlFamily.encoding != NULL) { FontFamily *familyPtr = &tsdPtr->controlFamily; @@ -306,14 +306,13 @@ FontPkgCleanup( void TkpFontPkgInit( - TkMainInfo *mainPtr) /* The application being created. */ + TCL_UNUSED(TkMainInfo *)) /* The application being created. */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); SubFont dummy; int i; Tcl_Encoding ucs2; - (void)mainPtr; if (tsdPtr->controlFamily.encoding == NULL) { @@ -363,11 +362,11 @@ TkpFontPkgInit( static int ControlUtfProc( - ClientData dummy, /* 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 @@ -396,9 +395,6 @@ ControlUtfProc( 0, 0, 0, 0, 0, 0, 0, 'a', 'b', 't', 'n', 'v', 'f', 'r' }; - (void)dummy; - (void)flags; - (void)statePtr; result = TCL_OK; @@ -464,11 +460,11 @@ ControlUtfProc( static int Ucs2beToUtfProc( - ClientData dummy, /* 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 @@ -493,8 +489,6 @@ 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; @@ -562,12 +556,12 @@ Ucs2beToUtfProc( static int UtfToUcs2beProc( - ClientData dummy, /* 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 @@ -591,8 +585,6 @@ UtfToUcs2beProc( const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd; int result, numChars; int ch; - (void)dummy; - (void)statePtr; srcStart = src; srcEnd = src + srcLen; @@ -1211,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. */ @@ -1233,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); } @@ -1405,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 @@ -1414,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); @@ -1830,7 +1819,7 @@ 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; @@ -1838,7 +1827,6 @@ AllocFontFamily( Tcl_Encoding encoding; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - (void)base; GetFontAttributes(display, fontStructPtr, &fa); encoding = Tcl_GetEncoding(NULL, GetEncodingAlias(fa.xa.charset)); @@ -1988,7 +1976,7 @@ FindSubFontForChar( SubFont *subFontPtr; Tcl_DString ds; - if (ch < 0 || ch > 0x30000) { + if (ch < 0 || ch >= FONTMAP_NUMCHARS) { ch = 0xFFFD; } @@ -2142,7 +2130,7 @@ FontMapLookup( { int row, bitOffset; - if (ch < 0 || ch >= 0x30000) { + if (ch < 0 || ch >= FONTMAP_NUMCHARS) { return 0; } row = ch >> FONTMAP_SHIFT; @@ -2185,7 +2173,7 @@ FontMapInsert( { int row, bitOffset; - if (ch >= 0 && ch < 0x30000) { + if (ch >= 0 && ch < FONTMAP_NUMCHARS) { row = ch >> FONTMAP_SHIFT; if (subFontPtr->fontMap[row] == NULL) { FontMapLoadPage(subFontPtr, row); diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 4436089..80d2fcf 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -29,7 +29,8 @@ #define FONTMAP_SHIFT 10 #define FONTMAP_BITSPERPAGE (1 << FONTMAP_SHIFT) -#define FONTMAP_PAGES (0x30000 / FONTMAP_BITSPERPAGE) +#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. */ @@ -653,15 +654,13 @@ TkpGetFontFamilies( static int CALLBACK WinFontFamilyEnumProc( ENUMLOGFONTW *lfPtr, /* Logical-font data. */ - NEWTEXTMETRIC *tmPtr, /* Physical-font data (not used). */ - int fontType, /* Type of font (not used). */ + TCL_UNUSED(NEWTEXTMETRIC *), /* Physical-font data (not used). */ + TCL_UNUSED(int), /* Type of font (not used). */ LPARAM lParam) /* Result object to hold result. */ { WCHAR *faceName = lfPtr->elfLogFont.lfFaceName; Tcl_Obj *resultObj = (Tcl_Obj *) lParam; Tcl_DString faceString; - (void)tmPtr; - (void)fontType; Tcl_DStringInit(&faceString); Tcl_WCharToUtfDString(faceName, wcslen(faceName), &faceString); @@ -1017,7 +1016,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. */ @@ -1039,7 +1038,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); } @@ -1065,7 +1063,7 @@ Tk_DrawChars( Display *display, /* Display on which to draw. */ Drawable drawable, /* Window or pixmap in which to draw. */ GC gc, /* Graphics context for drawing characters. */ - Tk_Font tkfont, /* Font in which characters will be drawn; + TCL_UNUSED(Tk_Font), /* Font in which characters will be drawn; * must be the same as font used in GC. */ const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. All Tk meta-characters @@ -1081,7 +1079,6 @@ Tk_DrawChars( HDC dc; WinFont *fontPtr; TkWinDCState state; - (void)tkfont; fontPtr = (WinFont *) gc->font; display->request++; @@ -1213,7 +1210,7 @@ TkDrawAngledChars( Display *display, /* Display on which to draw. */ Drawable drawable, /* Window or pixmap in which to draw. */ GC gc, /* Graphics context for drawing characters. */ - Tk_Font tkfont, /* Font in which characters will be drawn; + TCL_UNUSED(Tk_Font), /* Font in which characters will be drawn; * must be the same as font used in GC. */ const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. All Tk meta-characters @@ -1230,7 +1227,6 @@ TkDrawAngledChars( HDC dc; WinFont *fontPtr; TkWinDCState state; - (void)tkfont; fontPtr = (WinFont *) gc->font; display->request++; @@ -1389,7 +1385,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 @@ -1398,8 +1394,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); @@ -1738,7 +1732,7 @@ AllocFontFamily( HDC hdc, /* HDC in which font can be selected. */ HFONT hFont, /* 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. */ { Tk_Uid faceName; @@ -1748,7 +1742,6 @@ AllocFontFamily( WCHAR buf[LF_FACESIZE]; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - (void)base; hFont = (HFONT)SelectObject(hdc, hFont); GetTextFaceW(hdc, LF_FACESIZE, buf); @@ -1929,7 +1922,7 @@ FindSubFontForChar( SubFont *subFontPtr; Tcl_DString ds; - if ((ch < BASE_CHARS) || (ch >= 0x30000)) { + if ((ch < BASE_CHARS) || (ch >= FONTMAP_NUMCHARS)) { return &fontPtr->subFontArray[0]; } @@ -2037,8 +2030,8 @@ FindSubFontForChar( static int CALLBACK WinFontCanUseProc( ENUMLOGFONTW *lfPtr, /* Logical-font data. */ - NEWTEXTMETRIC *tmPtr, /* Physical-font data (not used). */ - int fontType, /* Type of font (not used). */ + TCL_UNUSED(NEWTEXTMETRIC *), /* Physical-font data (not used). */ + TCL_UNUSED(int), /* Type of font (not used). */ LPARAM lParam) /* Result object to hold result. */ { int ch; @@ -2049,8 +2042,6 @@ WinFontCanUseProc( SubFont *subFontPtr; Tcl_DString faceString; Tcl_DString *nameTriedPtr; - (void)tmPtr; - (void)fontType; canUsePtr = (CanUse *) lParam; ch = canUsePtr->ch; @@ -2104,7 +2095,7 @@ FontMapLookup( { int row, bitOffset; - if (ch < 0 || ch >= 0x30000) { + if (ch < 0 || ch >= FONTMAP_NUMCHARS) { return 0; } @@ -2148,7 +2139,7 @@ FontMapInsert( { int row, bitOffset; - if (ch >= 0 && ch < 0x30000) { + if (ch >= 0 && ch < FONTMAP_NUMCHARS) { row = ch >> FONTMAP_SHIFT; if (subFontPtr->fontMap[row] == NULL) { FontMapLoadPage(subFontPtr, row); @@ -2560,16 +2551,11 @@ FamilyOrAliasExists( static int CALLBACK WinFontExistProc( - ENUMLOGFONTW *lfPtr, /* Logical-font data. */ - NEWTEXTMETRIC *tmPtr, /* Physical-font data (not used). */ - int fontType, /* Type of font (not used). */ - LPARAM lParam) /* EnumFontData to hold result. */ + TCL_UNUSED(ENUMLOGFONTW *), /* Logical-font data. */ + TCL_UNUSED(NEWTEXTMETRIC *), /* Physical-font data (not used). */ + TCL_UNUSED(int), /* Type of font (not used). */ + TCL_UNUSED(LPARAM)) /* EnumFontData to hold result. */ { - (void)lfPtr; - (void)tmPtr; - (void)fontType; - (void)lParam; - return 0; } |