Skip to content

Commit

Permalink
Merge 8.7. Fix indenting
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Jul 12, 2024
2 parents 47a7d35 + 405cd17 commit ed381a3
Show file tree
Hide file tree
Showing 24 changed files with 591 additions and 584 deletions.
2 changes: 1 addition & 1 deletion doc/SetOptions.3
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ free, and restore saved copies of the type and creating a structure
pointing to those procedures:
.CS
typedef struct Tk_ObjCustomOption {
char *name;
const char *\fname\fR;
Tk_CustomOptionSetProc *\fIsetProc\fR;
Tk_CustomOptionGetProc *\fIgetProc\fR;
Tk_CustomOptionRestoreProc *\fIrestoreProc\fR;
Expand Down
10 changes: 5 additions & 5 deletions generic/tkBusy.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ HoldBusy(
TkpHideBusyWindow(busyPtr);
}
if (result == TCL_OK) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_PathName(busyPtr->tkBusy), TCL_INDEX_NONE));
Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_PathName(busyPtr->tkBusy), TCL_INDEX_NONE));
}
return result;
}
Expand Down Expand Up @@ -806,7 +806,7 @@ Tk_BusyObjCmd(
int index, result = TCL_OK;
static const char *const optionStrings[] = {
"busywindow", "cget", "configure", "current", "forget", "hold",
"status", NULL
"status", NULL
};
enum options {
BUSY_BUSYWINDOW, BUSY_CGET, BUSY_CONFIGURE, BUSY_CURRENT, BUSY_FORGET,
Expand Down Expand Up @@ -843,10 +843,10 @@ Tk_BusyObjCmd(
busyPtr = GetBusy(interp, busyTablePtr, objv[2]);
if (busyPtr == NULL) {
Tcl_ResetResult(interp);
return TCL_OK;
return TCL_OK;
}
Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_PathName(busyPtr->tkBusy), TCL_INDEX_NONE));
return TCL_OK;
Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_PathName(busyPtr->tkBusy), TCL_INDEX_NONE));
return TCL_OK;

case BUSY_CGET:
if (objc != 4) {
Expand Down
6 changes: 3 additions & 3 deletions generic/tkCanvArc.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ ComputeArcParametersFromHeight(
*/

if (arcPtr->height == 0)
return;
return;

/*
* Calculate the chord length, return early if it is too small.
Expand All @@ -629,8 +629,8 @@ ComputeArcParametersFromHeight(
arcPtr->startPoint[0] - arcPtr->endPoint[0]);

if (chordLen < DBL_EPSILON) {
arcPtr->start = arcPtr->extent = arcPtr->height = 0;
return;
arcPtr->start = arcPtr->extent = arcPtr->height = 0;
return;
}

chordDir[0] = (arcPtr->endPoint[0] - arcPtr->startPoint[0]) / chordLen;
Expand Down
2 changes: 1 addition & 1 deletion generic/tkCanvImg.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ ImageToPostscript(
* Image item without actual image specified.
*/

return TCL_OK;
return TCL_OK;
}
Tk_SizeOfImage(image, &width, &height);

Expand Down
8 changes: 4 additions & 4 deletions generic/tkCanvLine.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ ConfigureLine(

tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
(const char **) objv, (char *) linePtr, flags|TK_CONFIG_OBJS)) {
(const char **)objv, (char *)linePtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}

Expand Down Expand Up @@ -704,10 +704,10 @@ ComputeLineBbox(
width = 1.0;
}
if (linePtr->arrow != ARROWS_NONE) {
if (linePtr->arrow != ARROWS_LAST) {
if (linePtr->arrow != ARROWS_LAST && linePtr->firstArrowPtr) {
TkIncludePoint((Tk_Item *) linePtr, linePtr->firstArrowPtr);
}
if (linePtr->arrow != ARROWS_FIRST) {
if (linePtr->arrow != ARROWS_FIRST && linePtr->lastArrowPtr) {
TkIncludePoint((Tk_Item *) linePtr, linePtr->lastArrowPtr);
}
}
Expand Down Expand Up @@ -1018,7 +1018,7 @@ LineInsert(
newCoordPtr[i+objc] = linePtr->coordPtr[i];
}
if (linePtr->coordPtr) {
ckfree(linePtr->coordPtr);
ckfree(linePtr->coordPtr);
}
linePtr->coordPtr = newCoordPtr;
length += objc ;
Expand Down
2 changes: 1 addition & 1 deletion generic/tkCanvPs.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ PostscriptBitmap(
* syntactically correct.
*/

Tcl_AppendToObj(psObj, "<>", TCL_INDEX_NONE);
Tcl_AppendToObj(psObj, "<>", TCL_INDEX_NONE);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion generic/tkCanvWind.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ WinItemToPostscript(
Tk_Window tkwin = winItemPtr->tkwin;

if (prepass || winItemPtr->tkwin == NULL) {
return TCL_OK;
return TCL_OK;
}

width = Tk_Width(tkwin);
Expand Down
2 changes: 1 addition & 1 deletion generic/tkConsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Tk_InitConsoleChannels(
*/

if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) {
return;
return;
}

consoleInitPtr = (int *)Tcl_GetThreadData(&consoleInitKey, (int) sizeof(int));
Expand Down
10 changes: 5 additions & 5 deletions generic/tkText.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ typedef struct TkTextTag {
int lMargin2; /* Left margin for second and later display lines
* of each text line, in pixels. INT_MIN means option not specified. */
Tk_3DBorder lMarginColor; /* Used for drawing background in left margins.
* This is used for both lmargin1 and lmargin2.
* This is used for both lmargin1 and lmargin2.
* NULL means no value specified here. */
char *offsetString; /* -offset option string (malloc-ed). NULL
* means option not specified. */
Expand All @@ -383,7 +383,7 @@ typedef struct TkTextTag {
int overstrike; /* > 0 means draw horizontal line through
* middle of text. -1 means not specified. */
XColor *overstrikeColor; /* Color for the overstrike. NULL means same
* color as foreground. */
* color as foreground. */
char *rMarginString; /* -rmargin option string (malloc-ed). NULL
* means option not specified. */
int rMargin; /* Right margin for text, in pixels. INT_MIN means option not specified. */
Expand Down Expand Up @@ -417,7 +417,7 @@ typedef struct TkTextTag {
int underline; /* > 0 means draw underline underneath
* text. -1 means not specified. */
XColor *underlineColor; /* Color for the underline. NULL means same
* color as foreground. */
* color as foreground. */
TkWrapMode wrapMode; /* How to handle wrap-around for this tag.
* Must be TEXT_WRAPMODE_CHAR, TEXT_WRAPMODE_WORD,
* TEXT_WRAPMODE_NONE, or TEXT_WRAPMODE_NULL to
Expand Down Expand Up @@ -601,7 +601,7 @@ typedef struct TkSharedText {
struct TkText *peers;

Tcl_Size undoMarkId; /* Counts undo marks temporarily used during
undo and redo operations. */
undo and redo operations. */
} TkSharedText;

/*
Expand Down Expand Up @@ -808,7 +808,7 @@ typedef struct TkText {
int autoSeparators; /* Non-zero means the separators will be
* inserted automatically. */
Tcl_Obj *afterSyncCmd; /* Command to be executed when lines are up to
* date */
* date */
} TkText;

/*
Expand Down
52 changes: 26 additions & 26 deletions generic/tkTextBTree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2019,32 +2019,32 @@ TkBTreeLinesTo(
}
}
if (textPtr != NULL) {
/*
* The index to return must be relative to textPtr, not to the entire
* tree. Take care to never return a negative index when linePtr
* denotes a line before -startline, or an index larger than the
* number of lines in textPtr when linePtr is a line past -endline.
*/

int indexStart, indexEnd;

if (textPtr->start != NULL) {
indexStart = TkBTreeLinesTo(NULL, textPtr->start);
} else {
indexStart = 0;
}
if (textPtr->end != NULL) {
indexEnd = TkBTreeLinesTo(NULL, textPtr->end);
} else {
indexEnd = TkBTreeNumLines(textPtr->sharedTextPtr->tree, NULL);
}
if (index < indexStart) {
index = 0;
} else if (index > indexEnd) {
index = TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr);
} else {
index -= indexStart;
}
/*
* The index to return must be relative to textPtr, not to the entire
* tree. Take care to never return a negative index when linePtr
* denotes a line before -startline, or an index larger than the
* number of lines in textPtr when linePtr is a line past -endline.
*/

int indexStart, indexEnd;

if (textPtr->start != NULL) {
indexStart = TkBTreeLinesTo(NULL, textPtr->start);
} else {
indexStart = 0;
}
if (textPtr->end != NULL) {
indexEnd = TkBTreeLinesTo(NULL, textPtr->end);
} else {
indexEnd = TkBTreeNumLines(textPtr->sharedTextPtr->tree, NULL);
}
if (index < indexStart) {
index = 0;
} else if (index > indexEnd) {
index = TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr);
} else {
index -= indexStart;
}
}
return index;
}
Expand Down
Loading

0 comments on commit ed381a3

Please sign in to comment.