summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixMenu.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-05 07:56:33 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-05 07:56:33 (GMT)
commit121af720bc29f65b64fcdcf520cb2d00368eb258 (patch)
treed777f374f5dd01aa118ee2e7b34a64e8cd0d6d78 /unix/tkUnixMenu.c
parent91500fc2feafa36fe71ce1453075b73386d16e34 (diff)
downloadtk-121af720bc29f65b64fcdcf520cb2d00368eb258.zip
tk-121af720bc29f65b64fcdcf520cb2d00368eb258.tar.gz
tk-121af720bc29f65b64fcdcf520cb2d00368eb258.tar.bz2
Fix many warnings related to the -Wshadow gcc compiler flag
Diffstat (limited to 'unix/tkUnixMenu.c')
-rw-r--r--unix/tkUnixMenu.c75
1 files changed, 36 insertions, 39 deletions
diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c
index fc8b4f2..4ef5af2 100644
--- a/unix/tkUnixMenu.c
+++ b/unix/tkUnixMenu.c
@@ -145,7 +145,7 @@ TkpNewMenu(
void
TkpDestroyMenu(
- TkMenu *menuPtr)
+ TCL_UNUSED(TkMenu *))
{
/*
* Nothing to do.
@@ -171,7 +171,7 @@ TkpDestroyMenu(
void
TkpDestroyMenuEntry(
- TkMenuEntry *mEntryPtr)
+ TCL_UNUSED(TkMenuEntry *))
{
/*
* Nothing to do.
@@ -199,7 +199,7 @@ TkpDestroyMenuEntry(
int
TkpConfigureMenuEntry(
- register TkMenuEntry *mePtr)/* Information about menu entry; may or may
+ TkMenuEntry *mePtr)/* Information about menu entry; may or may
* not already have values for some fields. */
{
/*
@@ -239,7 +239,7 @@ TkpConfigureMenuEntry(
int
TkpMenuNewEntry(
- TkMenuEntry *mePtr)
+ TCL_UNUSED(TkMenuEntry *))
{
return TCL_OK;
}
@@ -292,9 +292,9 @@ TkpSetWindowMenuBar(
void
TkpSetMainMenubar(
- Tcl_Interp *interp,
- Tk_Window tkwin,
- const char *menuName)
+ TCL_UNUSED(Tcl_Interp *),
+ TCL_UNUSED(Tk_Window),
+ TCL_UNUSED(const char *))
{
/*
* Nothing to do.
@@ -323,8 +323,8 @@ static void
GetMenuIndicatorGeometry(
TkMenu *menuPtr, /* The menu we are drawing. */
TkMenuEntry *mePtr, /* The entry we are interested in. */
- Tk_Font tkfont, /* The precalculated font */
- const Tk_FontMetrics *fmPtr,/* The precalculated metrics */
+ TCL_UNUSED(Tk_Font), /* The precalculated font */
+ TCL_UNUSED(const Tk_FontMetrics *),/* The precalculated metrics */
int *widthPtr, /* The resulting width */
int *heightPtr) /* The resulting height */
{
@@ -445,7 +445,6 @@ DrawMenuEntryBackground(
} else {
relief = TK_RELIEF_RAISED;
}
-
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin,
menuPtr->activeBorderWidthPtr, &activeBorderWidth);
Tk_Fill3DRectangle(menuPtr->tkwin, d, bgBorder, x, y, width, height,
@@ -524,7 +523,7 @@ DrawMenuEntryAccelerator(
if (menuPtr->menuType == MENUBAR) {
left += 5;
}
- Tk_DrawChars(menuPtr->display, d, gc, tkfont, accel,
+ Tk_DrawChars(menuPtr->display, d, gc, tkfont, accel,
mePtr->accelLength, left,
(y + (height + fmPtr->ascent - fmPtr->descent) / 2));
}
@@ -554,11 +553,11 @@ DrawMenuEntryIndicator(
Tk_3DBorder border, /* The background color */
XColor *indicatorColor, /* The color to draw indicators with */
XColor *disableColor, /* The color use use when disabled */
- Tk_Font tkfont, /* The font to draw with */
- const Tk_FontMetrics *fmPtr,/* The font metrics of the font */
+ TCL_UNUSED(Tk_Font), /* The font to draw with */
+ TCL_UNUSED(const Tk_FontMetrics *),/* The font metrics of the font */
int x, /* The left of the entry rect */
int y, /* The top of the entry rect */
- int width, /* Width of menu entry */
+ TCL_UNUSED(int), /* Width of menu entry */
int height) /* Height of menu entry */
{
/*
@@ -623,11 +622,11 @@ DrawMenuEntryIndicator(
static void
DrawMenuSeparator(
TkMenu *menuPtr, /* The menu we are drawing */
- TkMenuEntry *mePtr, /* The entry we are drawing */
+ TCL_UNUSED(TkMenuEntry *), /* The entry we are drawing */
Drawable d, /* The drawable we are using */
- GC gc, /* The gc to draw into */
- Tk_Font tkfont, /* The font to draw with */
- const Tk_FontMetrics *fmPtr,/* The font metrics from the font */
+ TCL_UNUSED(GC), /* The gc to draw into */
+ TCL_UNUSED(Tk_Font), /* The font to draw with */
+ TCL_UNUSED(const Tk_FontMetrics *),/* The font metrics from the font */
int x, int y,
int width, int height)
{
@@ -790,7 +789,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,
@@ -818,7 +817,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),
@@ -852,7 +851,7 @@ DrawMenuUnderline(
Tk_Font tkfont, /* The precalculated font */
const Tk_FontMetrics *fmPtr,/* The precalculated font metrics */
int x, int y,
- int width, int height)
+ TCL_UNUSED(int), int height)
{
if ((mePtr->underline >= 0) && (mePtr->labelPtr != NULL)) {
int len;
@@ -931,7 +930,7 @@ TkpPostMenu(
int
TkpPostTearoffMenu(
- Tcl_Interp *interp, /* The interpreter of the menu */
+ TCL_UNUSED(Tcl_Interp *), /* 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 */
@@ -1021,9 +1020,9 @@ TkpPostTearoffMenu(
static void
GetMenuSeparatorGeometry(
- TkMenu *menuPtr, /* The menu we are measuring */
- TkMenuEntry *mePtr, /* The entry we are measuring */
- Tk_Font tkfont, /* The precalculated font */
+ TCL_UNUSED(TkMenu *), /* The menu we are measuring */
+ TCL_UNUSED(TkMenuEntry *), /* The entry we are measuring */
+ TCL_UNUSED(Tk_Font), /* The precalculated font */
const Tk_FontMetrics *fmPtr,/* The precalcualted font metrics */
int *widthPtr, /* The resulting width */
int *heightPtr) /* The resulting height */
@@ -1051,7 +1050,7 @@ GetMenuSeparatorGeometry(
static void
GetTearoffEntryGeometry(
TkMenu *menuPtr, /* The menu we are drawing */
- TkMenuEntry *mePtr, /* The entry we are measuring */
+ TCL_UNUSED(TkMenuEntry *), /* The entry we are measuring */
Tk_Font tkfont, /* The precalculated font */
const Tk_FontMetrics *fmPtr,/* The precalculated font metrics */
int *widthPtr, /* The resulting width */
@@ -1092,15 +1091,13 @@ TkpComputeMenubarGeometry(
Tk_FontMetrics menuMetrics, entryMetrics, *fmPtr;
int width, height, i, j, x, y, currentRowHeight, maxWidth;
int maxWindowWidth, lastRowBreak, lastEntry;
- int borderWidth, activeBorderWidth, helpMenuIndex = -1;
+ int activeBorderWidth, helpMenuIndex = -1;
TkMenuEntry *mePtr;
if (menuPtr->tkwin == NULL) {
return;
}
- Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr,
- &borderWidth);
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr,
&activeBorderWidth);
maxWidth = 0;
@@ -1122,7 +1119,7 @@ TkpComputeMenubarGeometry(
/*
* On the Mac especially, getting font metrics can be quite slow, so
* we want to do it intelligently. We are going to precalculate them
- * and pass them down to all of the measureing and drawing routines.
+ * and pass them down to all of the measuring and drawing routines.
* We will measure the font metrics of the menu once, and if an entry
* has a font set, we will measure it as we come to it, and then we
* decide which set to give the geometry routines.
@@ -1269,11 +1266,11 @@ TkpComputeMenubarGeometry(
static void
DrawTearoffEntry(
TkMenu *menuPtr, /* The menu we are drawing */
- TkMenuEntry *mePtr, /* The entry we are drawing */
+ TCL_UNUSED(TkMenuEntry *), /* The entry we are drawing */
Drawable d, /* The drawable we are drawing into */
- GC gc, /* The gc we are drawing with */
- Tk_Font tkfont, /* The font we are drawing with */
- const Tk_FontMetrics *fmPtr,/* The metrics we are drawing with */
+ TCL_UNUSED(GC), /* The gc we are drawing with */
+ TCL_UNUSED(Tk_Font), /* The font we are drawing with */
+ TCL_UNUSED(const Tk_FontMetrics *),/* The metrics we are drawing with */
int x, int y,
int width, int height)
{
@@ -1324,8 +1321,8 @@ DrawTearoffEntry(
void
TkpInitializeMenuBindings(
- Tcl_Interp *interp, /* The interpreter to set. */
- Tk_BindingTable bindingTable)
+ TCL_UNUSED(Tcl_Interp *), /* The interpreter to set. */
+ TCL_UNUSED(Tk_BindingTable))
/* The table to add to. */
{
/*
@@ -1376,7 +1373,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));
@@ -1852,8 +1849,8 @@ TkpComputeStandardMenuGeometry(
void
TkpMenuNotifyToplevelCreate(
- Tcl_Interp *interp, /* The interp the menu lives in. */
- const char *menuName) /* The name of the menu to reconfigure. */
+ TCL_UNUSED(Tcl_Interp *), /* The interp the menu lives in. */
+ TCL_UNUSED(const char *)) /* The name of the menu to reconfigure. */
{
/*
* Nothing to do.