summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-05 08:26:44 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-05 08:26:44 (GMT)
commit348370937c430973633246eaf91de8cee1bde7d0 (patch)
tree88b248e20c7f61e46bbda82c21dab1fcd66cff4e
parentce0c892ca83196190690241027b28e43514254d3 (diff)
parent121af720bc29f65b64fcdcf520cb2d00368eb258 (diff)
downloadtk-348370937c430973633246eaf91de8cee1bde7d0.zip
tk-348370937c430973633246eaf91de8cee1bde7d0.tar.gz
tk-348370937c430973633246eaf91de8cee1bde7d0.tar.bz2
Merge 8.6
-rw-r--r--generic/tkCanvArc.c39
-rw-r--r--generic/tkCanvLine.c53
-rw-r--r--generic/tkCanvPoly.c6
-rw-r--r--generic/tkCanvText.c13
-rw-r--r--generic/tkCanvas.c8
-rw-r--r--generic/tkGrid.c20
-rw-r--r--generic/tkImage.c2
-rw-r--r--generic/tkImgPPM.c28
-rw-r--r--generic/tkImgPhoto.c14
-rw-r--r--generic/tkPanedWindow.c1
-rw-r--r--generic/tkScrollbar.c4
-rw-r--r--generic/tkTest.c52
-rw-r--r--generic/tkText.c8
-rw-r--r--generic/tkTextBTree.c6
-rw-r--r--generic/tkTextWind.c2
-rw-r--r--generic/ttk/ttkNotebook.c4
-rw-r--r--tests/safe.test2
-rw-r--r--unix/tkUnixButton.c6
-rw-r--r--unix/tkUnixMenu.c70
-rw-r--r--unix/tkUnixMenubu.c8
-rw-r--r--unix/tkUnixSelect.c6
21 files changed, 130 insertions, 222 deletions
diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c
index c711f1d..257dcfc 100644
--- a/generic/tkCanvArc.c
+++ b/generic/tkCanvArc.c
@@ -707,12 +707,11 @@ ComputeArcParametersFromHeight(
static void
DeleteArc(
- Tk_Canvas canvas, /* Info about overall canvas. */
+ TCL_UNUSED(Tk_Canvas), /* Info about overall canvas. */
Tk_Item *itemPtr, /* Item that is being deleted. */
Display *display) /* Display containing window for canvas. */
{
- ArcItem *arcPtr = (ArcItem *) itemPtr;
- (void)canvas;
+ ArcItem *arcPtr = (ArcItem *)itemPtr;
Tk_DeleteOutline(display, &(arcPtr->outline));
if (arcPtr->numOutlinePoints != 0) {
@@ -794,13 +793,13 @@ ComputeArcBbox(
*/
if (arcPtr->bbox[1] > arcPtr->bbox[3]) {
- double tmp = arcPtr->bbox[3];
+ tmp = arcPtr->bbox[3];
arcPtr->bbox[3] = arcPtr->bbox[1];
arcPtr->bbox[1] = tmp;
}
if (arcPtr->bbox[0] > arcPtr->bbox[2]) {
- double tmp = arcPtr->bbox[2];
+ tmp = arcPtr->bbox[2];
arcPtr->bbox[2] = arcPtr->bbox[0];
arcPtr->bbox[0] = tmp;
@@ -900,8 +899,10 @@ DisplayArc(
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, /* Describes region of canvas that must be */
- int width, int height) /* redisplayed (not used). */
+ TCL_UNUSED(int), /* Describes region of canvas that must be */
+ TCL_UNUSED(int), /* redisplayed (not used). */
+ TCL_UNUSED(int),
+ TCL_UNUSED(int))
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
short x1, y1, x2, y2;
@@ -909,10 +910,6 @@ DisplayArc(
double lineWidth;
Tk_State state = itemPtr->state;
Pixmap stipple;
- (void)x;
- (void)y;
- (void)width;
- (void)height;
if (state == TK_STATE_NULL) {
state = Canvas(canvas)->canvas_state;
@@ -1648,7 +1645,7 @@ ComputeArcOutline(
* curved arc segment, which are marked with X's in the figure below:
*
*
- * * * *
+ * * * *
* * *
* * * * *
* * * * *
@@ -2001,7 +1998,7 @@ ArcToPostscript(
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. */
{
@@ -2014,7 +2011,6 @@ ArcToPostscript(
Tk_State state = itemPtr->state;
Tcl_Obj *psObj;
Tcl_InterpState interpState;
- (void)prepass;
y1 = Tk_CanvasPsY(canvas, arcPtr->bbox[1]);
y2 = Tk_CanvasPsY(canvas, arcPtr->bbox[3]);
@@ -2197,9 +2193,9 @@ ArcToPostscript(
static int
StyleParseProc(
- ClientData dummy, /* some flags.*/
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Used for reporting errors. */
- Tk_Window tkwin, /* Window containing canvas widget. */
+ TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */
const char *value, /* Value of option. */
char *widgRec, /* Pointer to record for item. */
TkSizeT offset) /* Offset into item. */
@@ -2207,8 +2203,6 @@ StyleParseProc(
int c;
size_t length;
Style *stylePtr = (Style *) (widgRec + offset);
- (void)dummy;
- (void)tkwin;
if (value == NULL || *value == 0) {
*stylePtr = PIESLICE_STYLE;
@@ -2262,18 +2256,15 @@ StyleParseProc(
static const char *
StylePrintProc(
- ClientData dummy, /* Ignored. */
- Tk_Window tkwin, /* Ignored. */
+ TCL_UNUSED(void *), /* Ignored. */
+ TCL_UNUSED(Tk_Window), /* Ignored. */
char *widgRec, /* Pointer to record for item. */
TkSizeT offset, /* Offset into item. */
- Tcl_FreeProc **freeProcPtr) /* 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. */
{
Style *stylePtr = (Style *) (widgRec + offset);
- (void)dummy;
- (void)tkwin;
- (void)freeProcPtr;
if (*stylePtr == ARC_STYLE) {
return "arc";
diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c
index 88ddc97..28764d8 100644
--- a/generic/tkCanvLine.c
+++ b/generic/tkCanvLine.c
@@ -605,12 +605,11 @@ ConfigureLine(
static void
DeleteLine(
- 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. */
{
LineItem *linePtr = (LineItem *) itemPtr;
- (void)canvas;
Tk_DeleteOutline(display, &linePtr->outline);
if (linePtr->coordPtr != NULL) {
@@ -710,7 +709,7 @@ ComputeLineBbox(
tsoffset = &linePtr->outline.tsoffset;
if (tsoffset->flags & TK_OFFSET_INDEX) {
- double *coordPtr = linePtr->coordPtr
+ coordPtr = linePtr->coordPtr
+ (tsoffset->flags & ~TK_OFFSET_INDEX);
if (tsoffset->flags <= 0) {
@@ -834,20 +833,17 @@ DisplayLine(
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)
- /* Describes region of canvas that must be
- * redisplayed (not used). */
+ TCL_UNUSED(int), /* Describes region of canvas that must be */
+ TCL_UNUSED(int), /* redisplayed (not used). */
+ TCL_UNUSED(int),
+ TCL_UNUSED(int))
{
- LineItem *linePtr = (LineItem *) itemPtr;
+ LineItem *linePtr = (LineItem *)itemPtr;
XPoint staticPoints[MAX_STATIC_POINTS*3];
XPoint *pointPtr;
double linewidth;
int numPoints;
Tk_State state = itemPtr->state;
- (void)x;
- (void)y;
- (void)width;
- (void)height;
if (!linePtr->numPoints || (linePtr->outline.gc == NULL)) {
return;
@@ -1701,8 +1697,6 @@ ScaleLine(
linePtr->firstArrowPtr = NULL;
}
if (linePtr->lastArrowPtr != NULL) {
- int i;
-
i = 2*(linePtr->numPoints-1);
linePtr->coordPtr[i] = linePtr->lastArrowPtr[0];
linePtr->coordPtr[i+1] = linePtr->lastArrowPtr[1];
@@ -1931,9 +1925,9 @@ RotateLine(
static int
ParseArrowShape(
- ClientData dummy, /* Not used. */
+ TCL_UNUSED(void *), /* Not used. */
Tcl_Interp *interp, /* Used for error reporting. */
- Tk_Window tkwin, /* Not used. */
+ TCL_UNUSED(Tk_Window), /* Not used. */
const char *value, /* Textual specification of arrow shape. */
char *recordPtr, /* Pointer to item record in which to store
* arrow information. */
@@ -1944,8 +1938,6 @@ ParseArrowShape(
double a, b, c;
int argc;
const char **argv = NULL;
- (void)dummy;
- (void)tkwin;
if ((size_t)offset != offsetof(LineItem, arrowShapeA)) {
Tcl_Panic("ParseArrowShape received bogus offset");
@@ -2001,19 +1993,16 @@ ParseArrowShape(
static const char *
PrintArrowShape(
- ClientData dummy, /* Not used. */
- Tk_Window tkwin, /* Window associated with linePtr's widget. */
+ TCL_UNUSED(void *), /* Not used. */
+ TCL_UNUSED(Tk_Window), /* Window associated with linePtr's widget. */
char *recordPtr, /* Pointer to item record containing current
* shape information. */
- TkSizeT offset, /* Offset of arrow information in record. */
+ TCL_UNUSED(TkSizeT), /* Offset of arrow information in record. */
Tcl_FreeProc **freeProcPtr) /* Store address of function to call to free
* string here. */
{
LineItem *linePtr = (LineItem *) recordPtr;
char *buffer = (char *)ckalloc(120);
- (void)dummy;
- (void)tkwin;
- (void)offset;
sprintf(buffer, "%.5g %.5g %.5g", linePtr->arrowShapeA,
linePtr->arrowShapeB, linePtr->arrowShapeC);
@@ -2041,9 +2030,9 @@ PrintArrowShape(
static int
ArrowParseProc(
- ClientData dummy, /* some flags.*/
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Used for reporting errors. */
- Tk_Window tkwin, /* Window containing canvas widget. */
+ TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */
const char *value, /* Value of option. */
char *widgRec, /* Pointer to record for item. */
TkSizeT offset) /* Offset into item. */
@@ -2051,8 +2040,6 @@ ArrowParseProc(
int c;
size_t length;
Arrows *arrowPtr = (Arrows *) (widgRec + offset);
- (void)dummy;
- (void)tkwin;
if (value == NULL || *value == 0) {
*arrowPtr = ARROWS_NONE;
@@ -2110,18 +2097,15 @@ ArrowParseProc(
static const char *
ArrowPrintProc(
- ClientData dummy, /* Ignored. */
- Tk_Window tkwin, /* Window containing canvas widget. */
+ TCL_UNUSED(void *), /* Ignored. */
+ TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */
char *widgRec, /* Pointer to record for item. */
TkSizeT offset, /* Offset into item. */
- Tcl_FreeProc **freeProcPtr) /* 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. */
{
Arrows *arrowPtr = (Arrows *) (widgRec + offset);
- (void)dummy;
- (void)tkwin;
- (void)freeProcPtr;
switch (*arrowPtr) {
case ARROWS_FIRST:
@@ -2316,7 +2300,7 @@ LineToPostscript(
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. */
{
@@ -2328,7 +2312,6 @@ LineToPostscript(
Tk_State state = itemPtr->state;
Tcl_Obj *psObj;
Tcl_InterpState interpState;
- (void)prepass;
if (state == TK_STATE_NULL) {
state = Canvas(canvas)->canvas_state;
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c
index 88f63e8..a827fdb 100644
--- a/generic/tkCanvPoly.c
+++ b/generic/tkCanvPoly.c
@@ -876,12 +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. */
- TCL_UNUSED(int),
- TCL_UNUSED(int),
+ TCL_UNUSED(int), /* Describes region of canvas that must be */
+ TCL_UNUSED(int), /* redisplayed (not used). */
TCL_UNUSED(int),
TCL_UNUSED(int))
- /* Describes region of canvas that must be
- * redisplayed (not used). */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
Tk_State state = itemPtr->state;
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c
index 304e009..e597434 100644
--- a/generic/tkCanvText.c
+++ b/generic/tkCanvText.c
@@ -1375,7 +1375,7 @@ TranslateText(
static int
GetTextIndex(
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 character in
@@ -1388,7 +1388,6 @@ GetTextIndex(
int c;
Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
const char *string;
- (void)canvas;
if (TCL_OK == TkGetIntForIndex(obj, textPtr->numChars - 1, 1, &idx)) {
if (idx == TCL_INDEX_NONE) {
@@ -1426,7 +1425,7 @@ GetTextIndex(
*indexPtr = textInfoPtr->selectLast;
} else if (c == '@') {
int x, y;
- double tmp, c = textPtr->cosine, s = textPtr->sine;
+ double tmp, cs = textPtr->cosine, s = textPtr->sine;
char *end;
const char *p;
@@ -1445,7 +1444,7 @@ GetTextIndex(
x -= (int) textPtr->drawOrigin[0];
y -= (int) textPtr->drawOrigin[1];
*indexPtr = Tk_PointToChar(textPtr->textLayout,
- (int) (x*c - y*s), (int) (y*c + x*s));
+ (int) (x*cs - y*s), (int) (y*cs + x*s));
} else {
/*
* Some of the paths here leave messages in the interp's result, so we
@@ -1478,14 +1477,13 @@ GetTextIndex(
static void
SetTextCursor(
- Tk_Canvas canvas, /* Record describing canvas widget. */
+ TCL_UNUSED(Tk_Canvas), /* Record describing canvas widget. */
Tk_Item *itemPtr, /* Text item in which cursor position is to be
* set. */
TkSizeT index) /* Character index of character just before
* which cursor is to be positioned. */
{
TextItem *textPtr = (TextItem *) itemPtr;
- (void)canvas;
if (index == TCL_INDEX_NONE) {
textPtr->insertPos = 0;
@@ -1518,7 +1516,7 @@ SetTextCursor(
static TkSizeT
GetSelText(
- Tk_Canvas canvas, /* Canvas containing selection. */
+ TCL_UNUSED(Tk_Canvas), /* Canvas containing selection. */
Tk_Item *itemPtr, /* Text item containing selection. */
TkSizeT offset, /* Byte offset within selection of first
* character to be returned. */
@@ -1532,7 +1530,6 @@ GetSelText(
char *text;
const char *selStart, *selEnd;
Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
- (void)canvas;
if (((int)textInfoPtr->selectFirst < 0) ||
(textInfoPtr->selectFirst + 1 > textInfoPtr->selectLast + 1)) {
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index c3e8a7f..0550fbe 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -876,7 +876,7 @@ CanvasWidgetCmd(
Tcl_Preserve(canvasPtr);
result = TCL_OK;
- switch ((enum options) index) {
+ switch ((enum options)index) {
case CANV_ADDTAG:
if (objc < 4) {
Tcl_WrongNumArgs(interp, 2, objv, "tag searchCommand ?arg ...?");
@@ -1247,7 +1247,6 @@ CanvasWidgetCmd(
case CANV_CREATE: {
Tk_ItemType *typePtr;
Tk_ItemType *matchPtr = NULL;
- Tk_Item *itemPtr;
int isNew = 0;
Tcl_HashEntry *entryPtr;
const char *arg;
@@ -1663,7 +1662,6 @@ CanvasWidgetCmd(
}
break;
case CANV_LOWER: {
- Tk_Item *itemPtr;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "tagOrId ?belowThis?");
@@ -3763,7 +3761,7 @@ TagSearchScan(
*/
searchPtr->rewritebufferAllocated = 100;
- searchPtr->rewritebuffer =(char *) ckalloc(searchPtr->rewritebufferAllocated);
+ searchPtr->rewritebuffer = (char *)ckalloc(searchPtr->rewritebufferAllocated);
}
TagSearchExprInit(&searchPtr->expr);
@@ -4596,7 +4594,7 @@ DoItem(
Tk_Uid *newTagPtr;
itemPtr->tagSpace += 5;
- newTagPtr = (Tk_Uid*)ckalloc(itemPtr->tagSpace * sizeof(Tk_Uid));
+ newTagPtr = (Tk_Uid *)ckalloc(itemPtr->tagSpace * sizeof(Tk_Uid));
memcpy((void *) newTagPtr, itemPtr->tagPtr,
itemPtr->numTags * sizeof(Tk_Uid));
if (itemPtr->tagPtr != itemPtr->staticTagSpace) {
diff --git a/generic/tkGrid.c b/generic/tkGrid.c
index f5100ba..dc4db82 100644
--- a/generic/tkGrid.c
+++ b/generic/tkGrid.c
@@ -1249,7 +1249,7 @@ GridRowColumnConfigureCommand(
if (slotPtr != NULL) {
if (slotType == ROW) {
- int last = containerPtr->containerDataPtr->rowMax - 1;
+ last = containerPtr->containerDataPtr->rowMax - 1;
while ((last >= 0) && (slotPtr[last].weight == 0)
&& (slotPtr[last].pad == 0) && (slotPtr[last].minSize == 0)
@@ -1258,7 +1258,7 @@ GridRowColumnConfigureCommand(
}
containerPtr->containerDataPtr->rowMax = last+1;
} else {
- int last = containerPtr->containerDataPtr->columnMax - 1;
+ last = containerPtr->containerDataPtr->columnMax - 1;
while ((last >= 0) && (slotPtr[last].weight == 0)
&& (slotPtr[last].pad == 0) && (slotPtr[last].minSize == 0)
@@ -1832,7 +1832,6 @@ ArrangeGrid(
for (contentPtr = containerPtr->contentPtr; contentPtr != NULL && !abort;
contentPtr = contentPtr->nextPtr) {
int x, y; /* Top left coordinate */
- int width, height; /* Slot or content size */
int col = contentPtr->column;
int row = contentPtr->row;
@@ -1943,7 +1942,7 @@ ResolveConstraints(
int uniformGroups; /* Number of currently used uniform groups. */
int uniformGroupsAlloced; /* Size of allocated space for uniform
* groups. */
- int weight, minSize;
+ int minSize;
int prevGrow, accWeight, grow;
/*
@@ -2072,6 +2071,7 @@ ResolveConstraints(
for (slot = 0; slot < gridCount; slot++) {
if (layoutPtr[slot].uniform != NULL) {
+ int weight;
for (start = 0; start < uniformGroups; start++) {
if (uniformGroupPtr[start].group == layoutPtr[slot].uniform) {
break;
@@ -2124,7 +2124,7 @@ ResolveConstraints(
for (start = 0; start < uniformGroups; start++) {
if (uniformGroupPtr[start].group ==
layoutPtr[slot].uniform) {
- weight = layoutPtr[slot].weight;
+ int weight = layoutPtr[slot].weight;
weight = weight > 0 ? weight : 1;
layoutPtr[slot].minSize =
uniformGroupPtr[start].minSize * weight;
@@ -3005,7 +3005,7 @@ ConfigureContent(
* If the stored container does not exist, just ignore it.
*/
- struct Gridder *contentPtr = GetGrid(content);
+ contentPtr = GetGrid(content);
if (contentPtr->in != NULL) {
if (TkGetWindowFromObj(interp, content, contentPtr->in, &parent)
== TCL_OK) {
@@ -3145,7 +3145,7 @@ ConfigureContent(
for (defaultColumnSpan = 1; j + defaultColumnSpan < numWindows;
defaultColumnSpan++) {
- const char *string = Tcl_GetString(objv[j + defaultColumnSpan]);
+ string = Tcl_GetString(objv[j + defaultColumnSpan]);
if (*string != REL_HORIZ) {
break;
@@ -3447,9 +3447,9 @@ ConfigureContent(
int lastRow, lastColumn; /* Implied end of table. */
string = Tcl_GetString(objv[j]);
- firstChar = string[0];
+ firstChar = string[0];
- if (firstChar == '.') {
+ if (firstChar == '.') {
lastWindow = string;
numSkip = 0;
}
@@ -3472,7 +3472,7 @@ ConfigureContent(
*/
for (width = 1; width + j < numWindows; width++) {
- const char *string = Tcl_GetString(objv[j+width]);
+ string = Tcl_GetString(objv[j+width]);
if (*string != REL_VERT) {
break;
diff --git a/generic/tkImage.c b/generic/tkImage.c
index 23d7ecf..97d0702 100644
--- a/generic/tkImage.c
+++ b/generic/tkImage.c
@@ -361,8 +361,6 @@ Tk_ImageObjCmd(
objc -= firstOption;
args = (Tcl_Obj **) objv;
if (oldimage) {
- int i;
-
args = (Tcl_Obj **)ckalloc((objc+1) * sizeof(Tcl_Obj *));
for (i = 0; i < objc; i++) {
args[i] = (Tcl_Obj *) Tcl_GetString(objv[i]);
diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c
index 91d809b..4a771ed 100644
--- a/generic/tkImgPPM.c
+++ b/generic/tkImgPPM.c
@@ -94,18 +94,15 @@ static int ReadPPMStringHeader(Tcl_Obj *dataObj, int *widthPtr,
static int
FileMatchPPM(
Tcl_Channel chan, /* The image file, open for reading. */
- const char *fileName, /* The name of the image file. */
- Tcl_Obj *format, /* User-specified format string, or NULL. */
+ TCL_UNUSED(const char *), /* The name of the image file. */
+ TCL_UNUSED(Tcl_Obj *), /* User-specified format string, or NULL. */
int *widthPtr, int *heightPtr,
/* The dimensions of the image are returned
* here if the file is a valid raw PPM
* file. */
- Tcl_Interp *interp) /* unused */
+ TCL_UNUSED(Tcl_Interp *)) /* unused */
{
int dummy;
- (void)fileName;
- (void)format;
- (void)interp;
return ReadPPMFileHeader(chan, widthPtr, heightPtr, &dummy);
}
@@ -134,7 +131,7 @@ FileReadPPM(
Tcl_Interp *interp, /* Interpreter to use for reporting errors. */
Tcl_Channel chan, /* The image file, open for reading. */
const char *fileName, /* The name of the image file. */
- Tcl_Obj *format, /* User-specified format string, or NULL. */
+ TCL_UNUSED(Tcl_Obj *), /* User-specified format string, or NULL. */
Tk_PhotoHandle imageHandle, /* The photo image to write into. */
int destX, int destY, /* Coordinates of top-left pixel in photo
* image to be written to. */
@@ -148,7 +145,6 @@ FileReadPPM(
size_t nBytes, count;
unsigned char *pixelPtr;
Tk_PhotoImageBlock block;
- (void)format;
type = ReadPPMFileHeader(chan, &fileWidth, &fileHeight, &maxIntensity);
if (type == 0) {
@@ -286,7 +282,7 @@ static int
FileWritePPM(
Tcl_Interp *interp,
const char *fileName,
- Tcl_Obj *format,
+ TCL_UNUSED(Tcl_Obj *),
Tk_PhotoImageBlock *blockPtr)
{
Tcl_Channel chan;
@@ -294,7 +290,6 @@ FileWritePPM(
size_t nBytes;
unsigned char *pixelPtr, *pixLinePtr;
char header[16 + TCL_INTEGER_SPACE * 2];
- (void)format;
chan = Tcl_OpenFileChannel(interp, fileName, "w", 0666);
if (chan == NULL) {
@@ -375,14 +370,13 @@ FileWritePPM(
static int
StringWritePPM(
Tcl_Interp *interp,
- Tcl_Obj *format,
+ TCL_UNUSED(Tcl_Obj *),
Tk_PhotoImageBlock *blockPtr)
{
int w, h, size, greenOffset, blueOffset;
unsigned char *pixLinePtr, *byteArray;
char header[16 + TCL_INTEGER_SPACE * 2];
Tcl_Obj *byteArrayObj;
- (void)format;
sprintf(header, "P6\n%d %d\n255\n", blockPtr->width, blockPtr->height);
@@ -452,16 +446,14 @@ StringWritePPM(
static int
StringMatchPPM(
Tcl_Obj *dataObj, /* The image data. */
- Tcl_Obj *format, /* User-specified format string, or NULL. */
+ TCL_UNUSED(Tcl_Obj *), /* User-specified format string, or NULL. */
int *widthPtr, int *heightPtr,
/* The dimensions of the image are returned
* here if the file is a valid raw PPM
* file. */
- Tcl_Interp *interp) /* unused */
+ TCL_UNUSED(Tcl_Interp *)) /* unused */
{
int dummy;
- (void)format;
- (void)interp;
return ReadPPMStringHeader(dataObj, widthPtr, heightPtr,
&dummy, NULL, NULL);
@@ -489,7 +481,7 @@ static int
StringReadPPM(
Tcl_Interp *interp, /* Interpreter to use for reporting errors. */
Tcl_Obj *dataObj, /* The image data. */
- Tcl_Obj *format, /* User-specified format string, or NULL. */
+ TCL_UNUSED(Tcl_Obj *), /* User-specified format string, or NULL. */
Tk_PhotoHandle imageHandle, /* The photo image to write into. */
int destX, int destY, /* Coordinates of top-left pixel in photo
* image to be written to. */
@@ -502,7 +494,6 @@ StringReadPPM(
int nLines, nBytes, h, type, count, dataSize, bytesPerChannel = 1;
unsigned char *pixelPtr, *dataBuffer;
Tk_PhotoImageBlock block;
- (void)format;
type = ReadPPMStringHeader(dataObj, &fileWidth, &fileHeight,
&maxIntensity, &dataBuffer, &dataSize);
@@ -611,7 +602,6 @@ StringReadPPM(
*p = (((int) *dataBuffer) * 255)/maxIntensity;
}
} else {
- unsigned char *p;
unsigned int value;
for (p = pixelPtr,count=nBytes; count > 1; count-=2, p += 2) {
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index db810d8..51083e6 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -221,12 +221,11 @@ static const char * GetExtension(const char *path);
static void
PhotoFormatThreadExitProc(
- ClientData dummy) /* not used */
+ TCL_UNUSED(void *)) /* not used */
{
Tk_PhotoImageFormat *freePtr;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- (void)dummy;
#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9
while (tsdPtr->oldFormatList != NULL) {
@@ -343,14 +342,13 @@ ImgPhotoCreate(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[], /* Argument objects for options (doesn't
* include image name or type). */
- const Tk_ImageType *typePtr,/* Pointer to our type record (not used). */
+ TCL_UNUSED(const Tk_ImageType *),/* Pointer to our type record (not used). */
Tk_ImageModel model, /* Token for image, to be used by us in later
* callbacks. */
ClientData *clientDataPtr) /* Store manager's token for image here; it
* will be returned in later callbacks. */
{
PhotoModel *modelPtr;
- (void)typePtr;
/*
* Allocate and initialize the photo image model record.
@@ -3877,7 +3875,7 @@ ImgGetPhoto(
blueOffset = blockPtr->offset[2] - blockPtr->offset[0];
if (((optPtr->options & OPT_BACKGROUND) && alphaOffset) ||
((optPtr->options & OPT_GRAYSCALE) && (greenOffset||blueOffset))) {
- int newPixelSize,x,y;
+ int newPixelSize;
unsigned char *srcPtr, *destPtr;
char *data;
@@ -4065,15 +4063,13 @@ static int
ImgPhotoPostscript(
ClientData clientData, /* Handle for the photo image. */
Tcl_Interp *interp, /* Interpreter. */
- Tk_Window tkwin, /* (unused) */
+ TCL_UNUSED(Tk_Window), /* (unused) */
Tk_PostscriptInfo psInfo, /* Postscript info. */
int x, int y, /* First pixel to output. */
int width, int height, /* Width and height of area. */
- int prepass) /* (unused) */
+ TCL_UNUSED(int)) /* (unused) */
{
Tk_PhotoImageBlock block;
- (void)tkwin;
- (void)prepass;
Tk_PhotoGetImage(clientData, &block);
block.pixelPtr += y * block.pitch + x * block.pixelSize;
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index 2039256..c15236d 100644
--- a/generic/tkPanedWindow.c
+++ b/generic/tkPanedWindow.c
@@ -604,7 +604,6 @@ PanedWindowWidgetObjCmd(
break;
case PW_FORGET: {
- int i;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 2, objv, "widget ?widget ...?");
diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c
index 0d31a80..86ec25a 100644
--- a/generic/tkScrollbar.c
+++ b/generic/tkScrollbar.c
@@ -310,7 +310,7 @@ ScrollbarWidgetObjCmd(
break;
}
case COMMAND_DELTA: {
- int xDelta, yDelta, pixels, length;
+ int xDelta, yDelta, pixels;
double fraction;
if (objc != 4) {
@@ -339,7 +339,7 @@ ScrollbarWidgetObjCmd(
break;
}
case COMMAND_FRACTION: {
- int x, y, pos, length;
+ int x, y, pos;
double fraction;
if (objc != 4) {
diff --git a/generic/tkTest.c b/generic/tkTest.c
index db10124..125a9c2 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -334,13 +334,11 @@ Tktest_Init(
static int
TestbitmapObjCmd(
- ClientData clientData, /* Main window for application. */
+ TCL_UNUSED(void *), /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- (void)clientData;
-
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "bitmap");
return TCL_ERROR;
@@ -369,13 +367,11 @@ TestbitmapObjCmd(
static int
TestborderObjCmd(
- ClientData clientData, /* Main window for application. */
+ TCL_UNUSED(ClientData), /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- (void)clientData;
-
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "border");
return TCL_ERROR;
@@ -404,13 +400,11 @@ TestborderObjCmd(
static int
TestcolorObjCmd(
- ClientData clientData, /* Main window for application. */
+ TCL_UNUSED(void *), /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- (void)clientData;
-
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "color");
return TCL_ERROR;
@@ -439,13 +433,11 @@ TestcolorObjCmd(
static int
TestcursorObjCmd(
- ClientData clientData, /* Main window for application. */
+ TCL_UNUSED(void *), /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- (void)clientData;
-
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "cursor");
return TCL_ERROR;
@@ -475,16 +467,12 @@ TestcursorObjCmd(
static int
TestdeleteappsObjCmd(
- ClientData clientData, /* Main window for application. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument strings. */
+ TCL_UNUSED(void *), /* Main window for application. */
+ TCL_UNUSED(Tcl_Interp *), /* Current interpreter. */
+ TCL_UNUSED(int), /* Number of arguments. */
+ TCL_UNUSED(Tcl_Obj *const *)) /* Argument strings. */
{
NewApp *nextPtr;
- (void)clientData;
- (void)interp;
- (void)objc;
- (void)objv;
while (newAppPtr != NULL) {
nextPtr = newAppPtr->nextPtr;
@@ -651,7 +639,6 @@ TestobjconfigObjCmd(
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0}
};
Tk_OptionTable optionTable;
- Tk_Window tkwin;
optionTable = Tk_CreateOptionTable(interp, typesSpecs);
tables[index] = optionTable;
@@ -707,7 +694,6 @@ TestobjconfigObjCmd(
case CHAIN1: {
ExtensionWidgetRecord *recordPtr;
- Tk_Window tkwin;
Tk_OptionTable optionTable;
tkwin = Tk_CreateWindowFromPath(interp, (Tk_Window)clientData,
@@ -760,7 +746,6 @@ TestobjconfigObjCmd(
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0,
(ClientData) baseSpecs, 0}
};
- Tk_Window tkwin;
Tk_OptionTable optionTable;
tkwin = Tk_CreateWindowFromPath(interp, (Tk_Window)clientData,
@@ -929,7 +914,6 @@ TestobjconfigObjCmd(
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0}
};
Tk_OptionTable optionTable;
- Tk_Window tkwin;
optionTable = Tk_CreateOptionTable(interp, internalSpecs);
tables[index] = optionTable;
@@ -1084,7 +1068,7 @@ TestobjconfigObjCmd(
offsetof(ContentRecord, windowPtr), TCL_INDEX_NONE, TK_CONFIG_NULL_OK, NULL, 0},
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0}
};
- Tk_Window tkwin = Tk_CreateWindowFromPath(interp,
+ tkwin = Tk_CreateWindowFromPath(interp,
(Tk_Window)clientData, Tcl_GetString(objv[2]), NULL);
if (tkwin == NULL) {
@@ -1394,7 +1378,7 @@ ImageCreate(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[], /* Argument strings for options (doesn't
* include image name or type). */
- const Tk_ImageType *typePtr, /* Pointer to our type record (not used). */
+ TCL_UNUSED(const Tk_ImageType *), /* Pointer to our type record (not used). */
Tk_ImageModel model, /* Token for image, to be used by us in later
* callbacks. */
ClientData *clientDataPtr) /* Store manager's token for image here; it
@@ -1820,14 +1804,13 @@ TestmenubarObjCmd(
#if defined(_WIN32)
static int
TestmetricsObjCmd(
- ClientData dummy, /* Main window for application. */
+ TCL_UNUSED(void *), /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument strings. */
{
char buf[TCL_INTEGER_SPACE];
int val;
- (void)dummy;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
@@ -2057,9 +2040,9 @@ TestwrapperObjCmd(
static int
CustomOptionSet(
- ClientData dummy,
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
- Tk_Window tkwin,
+ TCL_UNUSED(Tk_Window),
Tcl_Obj **value,
char *recordPtr,
TkSizeT internalOffset,
@@ -2068,8 +2051,6 @@ CustomOptionSet(
{
int objEmpty;
char *newStr, *string, *internalPtr;
- (void)dummy;
- (void)tkwin;
objEmpty = 0;
@@ -2120,14 +2101,11 @@ CustomOptionSet(
static Tcl_Obj *
CustomOptionGet(
- ClientData dummy,
- Tk_Window tkwin,
+ TCL_UNUSED(void *),
+ TCL_UNUSED(Tk_Window),
char *recordPtr,
TkSizeT internalOffset)
{
- (void)dummy;
- (void)tkwin;
-
return (Tcl_NewStringObj(*(char **)(recordPtr + internalOffset), -1));
}
diff --git a/generic/tkText.c b/generic/tkText.c
index 990ffb3..ce4f976 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -701,7 +701,7 @@ TextWidgetObjCmd(
{
TkText *textPtr = (TkText *)clientData;
int result = TCL_OK;
- int index;
+ int idx;
static const char *const optionStrings[] = {
"bbox", "cget", "compare", "configure", "count", "debug", "delete",
@@ -724,12 +724,12 @@ TextWidgetObjCmd(
}
if (Tcl_GetIndexFromObjStruct(interp, objv[1], optionStrings,
- sizeof(char *), "option", 0, &index) != TCL_OK) {
+ sizeof(char *), "option", 0, &idx) != TCL_OK) {
return TCL_ERROR;
}
textPtr->refCount++;
- switch ((enum options) index) {
+ switch ((enum options) idx) {
case TEXT_BBOX: {
int x, y, width, height;
const TkTextIndex *indexPtr;
@@ -3173,7 +3173,7 @@ DeleteIndexRange(
line2 = TkBTreeLinesTo(textPtr, index2.linePtr);
if (line2 == TkBTreeNumLines(sharedTextPtr->tree, textPtr)) {
TkTextTag **arrayPtr;
- int arraySize, i;
+ int arraySize;
TkTextIndex oldIndex2;
oldIndex2 = index2;
diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c
index a6a5e35..8feb2a2 100644
--- a/generic/tkTextBTree.c
+++ b/generic/tkTextBTree.c
@@ -4169,7 +4169,7 @@ Rebalance(
Node *otherPtr;
Node *halfwayNodePtr = NULL; /* Initialization needed only */
TkTextLine *halfwayLinePtr = NULL; /* to prevent cc warnings. */
- int totalChildren, firstChildren, i;
+ int totalChildren, firstChildren;
/*
* Too few children for this node. If this is the root then, it's
@@ -4230,8 +4230,6 @@ Rebalance(
otherPtr->children.linePtr = NULL;
}
if (nodePtr->level == 0) {
- TkTextLine *linePtr;
-
for (linePtr = nodePtr->children.linePtr, i = 1;
linePtr->nextPtr != NULL;
linePtr = linePtr->nextPtr, i++) {
@@ -4246,8 +4244,6 @@ Rebalance(
i++;
}
} else {
- Node *childPtr;
-
for (childPtr = nodePtr->children.nodePtr, i = 1;
childPtr->nextPtr != NULL;
childPtr = childPtr->nextPtr, i++) {
diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c
index 8622b3e..89f7f2a 100644
--- a/generic/tkTextWind.c
+++ b/generic/tkTextWind.c
@@ -160,7 +160,6 @@ TkTextWindowCmd(
switch ((enum windOptions) optionIndex) {
case WIND_CGET: {
TkTextIndex index;
- TkTextSegment *ewPtr;
Tcl_Obj *objPtr;
TkTextEmbWindowClient *client;
@@ -201,7 +200,6 @@ TkTextWindowCmd(
}
case WIND_CONFIGURE: {
TkTextIndex index;
- TkTextSegment *ewPtr;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 3, objv, "index ?-option value ...?");
diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c
index 216f236..26eab6b 100644
--- a/generic/ttk/ttkNotebook.c
+++ b/generic/ttk/ttkNotebook.c
@@ -290,7 +290,7 @@ static void ActivateTab(Notebook *nb, TkSizeT index)
static Ttk_State TabState(Notebook *nb, TkSizeT index)
{
Ttk_State state = nb->core.state;
- Tab *tab = (Tab *)Ttk_ContentData(nb->notebook.mgr, index);
+ Tab *itab = (Tab *)Ttk_ContentData(nb->notebook.mgr, index);
TkSizeT i = 0;
if (index == nb->notebook.currentIndex) {
@@ -322,7 +322,7 @@ static Ttk_State TabState(Notebook *nb, TkSizeT index)
}
break;
}
- if (tab->state == TAB_STATE_DISABLED) {
+ if (itab->state == TAB_STATE_DISABLED) {
state |= TTK_STATE_DISABLED;
}
diff --git a/tests/safe.test b/tests/safe.test
index 3a3b029..31cb1b7 100644
--- a/tests/safe.test
+++ b/tests/safe.test
@@ -37,7 +37,7 @@ set hidden_cmds [list bell cd clipboard encoding exec exit \
fconfigure glob grab load menu open pwd selection \
socket source toplevel unload wm]
if {[package vsatisfies [package provide Tcl] 8.6.7-]} {
- lappend hidden_cmds tcl:encoding:dirs
+ lappend hidden_cmds tcl:encoding:dirs
}
if {[package vsatisfies [package provide Tcl] 8.7-]} {
lappend hidden_cmds file tcl:encoding:system tcl:file:tempdir
diff --git a/unix/tkUnixButton.c b/unix/tkUnixButton.c
index 8d13db7..8d293f6 100644
--- a/unix/tkUnixButton.c
+++ b/unix/tkUnixButton.c
@@ -326,10 +326,8 @@ TkpDrawCheckIndicator(
TkButton *
TkpCreateButton(
- Tk_Window tkwin)
+ TCL_UNUSED(Tk_Window))
{
- (void)tkwin;
-
return (TkButton *)ckalloc(sizeof(UnixButton));
}
@@ -807,8 +805,6 @@ TkpDisplayButton(
butPtr->borderWidth, relief);
}
if (butPtr->highlightWidth > 0) {
- GC gc;
-
if (butPtr->flags & GOT_FOCUS) {
gc = Tk_GCForColor(butPtr->highlightColorPtr, pixmap);
} else {
diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c
index 7824470..e4899f2 100644
--- a/unix/tkUnixMenu.c
+++ b/unix/tkUnixMenu.c
@@ -144,7 +144,7 @@ TkpNewMenu(
void
TkpDestroyMenu(
- TkMenu *menuPtr)
+ TCL_UNUSED(TkMenu *))
{
(void)menuPtr;
@@ -172,7 +172,7 @@ TkpDestroyMenu(
void
TkpDestroyMenuEntry(
- TkMenuEntry *mEntryPtr)
+ TCL_UNUSED(TkMenuEntry *))
{
(void)mEntryPtr;
@@ -242,7 +242,7 @@ TkpConfigureMenuEntry(
int
TkpMenuNewEntry(
- TkMenuEntry *mePtr)
+ TCL_UNUSED(TkMenuEntry *))
{
(void)mePtr;
@@ -297,9 +297,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 *))
{
(void)interp;
(void)tkwin;
@@ -332,8 +332,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 */
{
@@ -534,7 +534,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));
}
@@ -564,11 +564,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 */
{
(void)tkfont;
@@ -637,11 +637,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)
{
@@ -870,7 +870,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)
{
(void)width;
@@ -951,14 +951,13 @@ TkpPostMenu(
int
TkpPostTearoffMenu(
- Tcl_Interp *dummy, /* 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 */
{
int vRootX, vRootY, vRootWidth, vRootHeight;
int result;
- (void)dummy;
if (index >= (int)menuPtr->numEntries) {
index = menuPtr->numEntries - 1;
@@ -1042,9 +1041,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 */
@@ -1076,7 +1075,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 */
@@ -1119,15 +1118,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;
@@ -1149,7 +1146,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.
@@ -1296,11 +1293,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)
{
@@ -1355,8 +1352,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. */
{
(void)interp;
@@ -1886,12 +1883,9 @@ TkpComputeStandardMenuGeometry(
void
TkpMenuNotifyToplevelCreate(
- Tcl_Interp *dummy, /* 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. */
{
- (void)dummy;
- (void)menuName;
-
/*
* Nothing to do.
*/
diff --git a/unix/tkUnixMenubu.c b/unix/tkUnixMenubu.c
index 407dc30..062d18e 100644
--- a/unix/tkUnixMenubu.c
+++ b/unix/tkUnixMenubu.c
@@ -25,17 +25,15 @@
* Returns a newly allocated TkMenuButton structure.
*
* Side effects:
- * Registers an event handler for the widget.
+ * None
*
*----------------------------------------------------------------------
*/
TkMenuButton *
TkpCreateMenuButton(
- Tk_Window tkwin)
+ TCL_UNUSED(Tk_Window))
{
- (void)tkwin;
-
return (TkMenuButton *)ckalloc(sizeof(TkMenuButton));
}
@@ -282,8 +280,6 @@ TkpDisplayMenuButton(
mbPtr->borderWidth, mbPtr->relief);
}
if (mbPtr->highlightWidth != 0) {
- GC gc;
-
if (mbPtr->flags & GOT_FOCUS) {
gc = Tk_GCForColor(mbPtr->highlightColorPtr, pixmap);
} else {
diff --git a/unix/tkUnixSelect.c b/unix/tkUnixSelect.c
index 58c3abc..858c246 100644
--- a/unix/tkUnixSelect.c
+++ b/unix/tkUnixSelect.c
@@ -545,7 +545,6 @@ TkSelEventProc(
Atom type;
int format, result;
unsigned long numItems, bytesAfter;
- Tcl_DString ds;
for (retrPtr = pendingRetrievals; ; retrPtr = retrPtr->nextPtr) {
if (retrPtr == NULL) {
@@ -591,6 +590,7 @@ TkSelEventProc(
if ((type == XA_STRING) || (type == dispPtr->textAtom)
|| (type == dispPtr->compoundTextAtom)) {
Tcl_Encoding encoding;
+ Tcl_DString ds;
if (format != 8) {
Tcl_SetObjResult(retrPtr->interp, Tcl_ObjPrintf(
@@ -1522,10 +1522,10 @@ static void
SelCvtFromX8(
char *propPtr, /* Property value from X. */
int numValues, /* Number of 8-bit values in property. */
- Atom type, /* Type of property Should not be XA_STRING
+ TCL_UNUSED(Atom), /* Type of property Should not be XA_STRING
* (if so, don't bother calling this function
* at all). */
- Tk_Window tkwin, /* Window to use for atom conversion. */
+ TCL_UNUSED(Tk_Window), /* Window to use for atom conversion. */
Tcl_DString *dsPtr) /* Where to store the converted string. */
{
(void)type;