diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-01 15:03:16 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-01 15:03:16 (GMT) |
commit | 4825038074a1722f54708e7e47cdf60b7d407de8 (patch) | |
tree | 0159e737b81072e1d3acfabd22c53a26c60d928a /generic | |
parent | e7f64ee4127a66beb4beb34aa162ad871b2c569b (diff) | |
parent | fecbf2b8553ba43518eba229753b0efc12aabd28 (diff) | |
download | tk-4825038074a1722f54708e7e47cdf60b7d407de8.zip tk-4825038074a1722f54708e7e47cdf60b7d407de8.tar.gz tk-4825038074a1722f54708e7e47cdf60b7d407de8.tar.bz2 |
Merge 8.6
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkFont.c | 16 | ||||
-rw-r--r-- | generic/tkMenu.c | 4 | ||||
-rw-r--r-- | generic/tkPlace.c | 22 | ||||
-rw-r--r-- | generic/tkUtil.c | 2 |
4 files changed, 21 insertions, 23 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c index 7155cc1..79c8d54 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -741,7 +741,7 @@ Tk_FontObjCmd( } case FONT_METRICS: { Tk_Font tkfont; - int skip, index, i; + int skip, i; const TkFontMetrics *fmPtr; static const char *const switches[] = { "-ascent", "-descent", "-linespace", "-fixed", NULL @@ -1968,7 +1968,7 @@ Tk_ComputeTextLayout( int *heightPtr) /* Filled with height of string. */ { TkFont *fontPtr = (TkFont *) tkfont; - const char *start, *end, *special; + const char *start, *endp, *special; int n, y, bytesThisChunk, maxChunks, curLine, layoutHeight; int baseline, height, curX, newX, maxWidth, *lineLengths; TextLayout *layoutPtr; @@ -2016,12 +2016,12 @@ Tk_ComputeTextLayout( curX = 0; - end = Tcl_UtfAtIndex(string, numChars); + endp = Tcl_UtfAtIndex(string, numChars); special = string; flags &= TK_IGNORE_TABS | TK_IGNORE_NEWLINES; flags |= TK_WHOLE_WORDS | TK_AT_LEAST_ONE; - for (start = string; start < end; ) { + for (start = string; start < endp; ) { if (start >= special) { /* * Find the next special character in the string. @@ -2032,7 +2032,7 @@ Tk_ComputeTextLayout( * whitespace set. */ - for (special = start; special < end; special++) { + for (special = start; special < endp; special++) { if (!(flags & TK_IGNORE_NEWLINES)) { if ((*special == '\n') || (*special == '\r')) { break; @@ -2066,7 +2066,7 @@ Tk_ComputeTextLayout( } } - if ((start == special) && (special < end)) { + if ((start == special) && (special < endp)) { /* * Handle the special character. * @@ -2083,7 +2083,7 @@ Tk_ComputeTextLayout( start++; curX = newX; flags &= ~TK_AT_LEAST_ONE; - if ((start < end) && + if ((start < endp) && ((wrapLength <= 0) || (newX <= wrapLength))) { /* * More chars can still fit on this line. @@ -2105,7 +2105,7 @@ Tk_ComputeTextLayout( * Consume all extra spaces at end of line. */ - while ((start < end) && isspace(UCHAR(*start))) { /* INTL: ISO space */ + while ((start < endp) && isspace(UCHAR(*start))) { /* INTL: ISO space */ if (!(flags & TK_IGNORE_NEWLINES)) { if ((*start == '\n') || (*start == '\r')) { break; diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 0a297a6..a67be21 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -1630,7 +1630,6 @@ ConfigureMenu( } } else if ((menuListPtr->numEntries > 0) && (menuListPtr->entries[0]->type == TEAROFF_ENTRY)) { - int i; Tcl_EventuallyFree(menuListPtr->entries[0], (Tcl_FreeProc *) DestroyMenuEntry); @@ -1825,7 +1824,6 @@ PostProcessEntry( if ((mePtr->type == CHECK_BUTTON_ENTRY) || (mePtr->type == RADIO_BUTTON_ENTRY)) { Tcl_Obj *valuePtr; - const char *name; if (mePtr->namePtr == NULL) { if (mePtr->labelPtr == NULL) { @@ -2735,7 +2733,7 @@ CloneMenu( && (menuPtr->numEntries == menuRefPtr->menuPtr->numEntries)) { TkMenu *newMenuPtr = menuRefPtr->menuPtr; Tcl_Obj *newObjv[3]; - int i, numElements; + int numElements; /* * Now put this newly created menu into the parent menu's instance diff --git a/generic/tkPlace.c b/generic/tkPlace.c index d965169..8d6b87e 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -677,10 +677,10 @@ ConfigureContent( goto scheduleLayout; } else if (mask & IN_MASK) { /* -in changed */ - Tk_Window tkwin; + Tk_Window win; Tk_Window ancestor; - tkwin = contentPtr->inTkwin; + win = contentPtr->inTkwin; /* * Make sure that the new container is either the logical parent of the @@ -688,19 +688,19 @@ ConfigureContent( * aren't the same. */ - for (ancestor = tkwin; ; ancestor = Tk_Parent(ancestor)) { + for (ancestor = win; ; ancestor = Tk_Parent(ancestor)) { if (ancestor == Tk_Parent(contentPtr->tkwin)) { break; } if (Tk_TopWinHierarchy(ancestor)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't place \"%s\" relative to \"%s\"", - Tk_PathName(contentPtr->tkwin), Tk_PathName(tkwin))); + Tk_PathName(contentPtr->tkwin), Tk_PathName(win))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL); goto error; } } - if (contentPtr->tkwin == tkwin) { + if (contentPtr->tkwin == win) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't place \"%s\" relative to itself", Tk_PathName(contentPtr->tkwin))); @@ -712,22 +712,22 @@ ConfigureContent( * Check for management loops. */ - for (container = (TkWindow *)tkwin; container != NULL; + for (container = (TkWindow *)win; container != NULL; container = (TkWindow *)TkGetContainer(container)) { if (container == (TkWindow *)contentPtr->tkwin) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't put \"%s\" inside \"%s\": would cause management loop", - Tk_PathName(contentPtr->tkwin), Tk_PathName(tkwin))); + Tk_PathName(contentPtr->tkwin), Tk_PathName(win))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", NULL); goto error; } } - if (tkwin != Tk_Parent(contentPtr->tkwin)) { - ((TkWindow *)contentPtr->tkwin)->maintainerPtr = (TkWindow *)tkwin; + if (win != Tk_Parent(contentPtr->tkwin)) { + ((TkWindow *)contentPtr->tkwin)->maintainerPtr = (TkWindow *)win; } if ((contentPtr->containerPtr != NULL) - && (contentPtr->containerPtr->tkwin == tkwin)) { + && (contentPtr->containerPtr->tkwin == win)) { /* * Re-using same old container. Nothing to do. */ @@ -740,7 +740,7 @@ ConfigureContent( Tk_UnmaintainGeometry(contentPtr->tkwin, contentPtr->containerPtr->tkwin); } UnlinkContent(contentPtr); - containerWin = tkwin; + containerWin = win; } /* diff --git a/generic/tkUtil.c b/generic/tkUtil.c index 6ff1ee0..0541830 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -1130,7 +1130,7 @@ TkMakeEnsemble( dictObj = Tcl_NewObj(); for (i = 0; map[i].name != NULL ; ++i) { - Tcl_Obj *nameObj, *fqdnObj; + Tcl_Obj *fqdnObj; nameObj = Tcl_NewStringObj(map[i].name, -1); fqdnObj = Tcl_NewStringObj(Tcl_DStringValue(&ds), |