Skip to content

Commit

Permalink
Don't use "boolean" as variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Mar 27, 2024
1 parent 21c7efa commit 4240bad
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 38 deletions.
6 changes: 3 additions & 3 deletions generic/tkTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ TestobjconfigObjCmd(

typedef struct {
TrivialCommandHeader header;
int boolean;
int boolValue;
int integer;
double doubleValue;
char *string;
Expand All @@ -845,7 +845,7 @@ TestobjconfigObjCmd(
};
static const Tk_OptionSpec internalSpecs[] = {
{TK_OPTION_BOOLEAN, "-boolean", "boolean", "Boolean", "1",
TCL_INDEX_NONE, offsetof(InternalRecord, boolean), TK_CONFIG_NULL_OK, 0, 0x1},
TCL_INDEX_NONE, offsetof(InternalRecord, boolValue), TK_CONFIG_NULL_OK, 0, 0x1},
{TK_OPTION_INT, "-integer", "integer", "Integer", "148962237",
TCL_INDEX_NONE, offsetof(InternalRecord, integer), 0, 0, 0x2},
{TK_OPTION_DOUBLE, "-double", "double", "Double", "3.14159",
Expand Down Expand Up @@ -909,7 +909,7 @@ TestobjconfigObjCmd(
recordPtr->header.interp = interp;
recordPtr->header.optionTable = optionTable;
recordPtr->header.tkwin = tkwin;
recordPtr->boolean = 0;
recordPtr->boolValue = 0;
recordPtr->integer = 0;
recordPtr->doubleValue = 0.0;
recordPtr->string = NULL;
Expand Down
44 changes: 22 additions & 22 deletions macosx/tkMacOSXWm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ WmSetAttribute(
Tcl_Obj *value) /* New value */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
int boolean;
int boolValue;
NSString *identifier;

switch (attribute) {
Expand Down Expand Up @@ -1700,10 +1700,10 @@ WmSetAttribute(
break;
}
case WMATT_FULLSCREEN:
if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
if (Tcl_GetBooleanFromObj(interp, value, &boolValue) != TCL_OK) {
return TCL_ERROR;
}
if (boolean != (([macWindow styleMask] & NSFullScreenWindowMask) != 0)) {
if (boolValue != (([macWindow styleMask] & NSFullScreenWindowMask) != 0)) {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
[macWindow toggleFullScreen:macWindow];
#else
Expand All @@ -1712,28 +1712,28 @@ WmSetAttribute(
}
break;
case WMATT_MODIFIED:
if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
if (Tcl_GetBooleanFromObj(interp, value, &boolValue) != TCL_OK) {
return TCL_ERROR;
}
if (boolean != [macWindow isDocumentEdited]) {
[macWindow setDocumentEdited:(BOOL)boolean];
if (boolValue != [macWindow isDocumentEdited]) {
[macWindow setDocumentEdited:(BOOL)boolValue];
}
break;
case WMATT_NOTIFY:
if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
if (Tcl_GetBooleanFromObj(interp, value, &boolValue) != TCL_OK) {
return TCL_ERROR;
}
if (boolean == !tkMacOSXWmAttrNotifyVal) {
if (boolValue == !tkMacOSXWmAttrNotifyVal) {
static NSInteger request = -1;

if (request >= 0) {
[NSApp cancelUserAttentionRequest:request];
request = -1;
}
if (boolean) {
if (boolValue) {
request = [NSApp requestUserAttention:NSCriticalRequest];
}
tkMacOSXWmAttrNotifyVal = boolean;
tkMacOSXWmAttrNotifyVal = boolValue;
}
break;
case WMATT_STYLEMASK: {
Expand Down Expand Up @@ -1862,13 +1862,13 @@ WmSetAttribute(
break;
}
case WMATT_TOPMOST:
if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
if (Tcl_GetBooleanFromObj(interp, value, &boolValue) != TCL_OK) {
return TCL_ERROR;
}
if (boolean != ((wmPtr->flags & WM_TOPMOST) != 0)) {
if (boolValue != ((wmPtr->flags & WM_TOPMOST) != 0)) {
int oldFlags = wmPtr->flags;

if (boolean) {
if (boolValue) {
wmPtr->flags |= WM_TOPMOST;
} else {
wmPtr->flags &= ~WM_TOPMOST;
Expand All @@ -1878,14 +1878,14 @@ WmSetAttribute(
}
break;
case WMATT_TRANSPARENT:
if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
if (Tcl_GetBooleanFromObj(interp, value, &boolValue) != TCL_OK) {
return TCL_ERROR;
}
if (boolean != ((wmPtr->flags & WM_TRANSPARENT) != 0)) {
if (boolValue != ((wmPtr->flags & WM_TRANSPARENT) != 0)) {
UInt64 oldAttributes = wmPtr->attributes;
int oldFlags = wmPtr->flags;

if (boolean) {
if (boolValue) {
wmPtr->flags |= WM_TRANSPARENT;
wmPtr->attributes |= kWindowNoShadowAttribute;
} else {
Expand All @@ -1894,8 +1894,8 @@ WmSetAttribute(
}
ApplyWindowAttributeFlagChanges(winPtr, macWindow, oldAttributes,
oldFlags, 1, 0);
[macWindow setBackgroundColor:boolean ? [NSColor clearColor] : nil];
[macWindow setOpaque:!boolean];
[macWindow setBackgroundColor:boolValue ? [NSColor clearColor] : nil];
[macWindow setOpaque:!boolValue];
TkMacOSXInvalidateWindow((MacDrawable *)winPtr->window,
TK_PARENT_WINDOW);
}
Expand Down Expand Up @@ -3624,7 +3624,7 @@ WmOverrideredirectCmd(
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
int flag;
Bool boolValue;
XSetWindowAttributes atts;
TKWindow *win = (TKWindow *)TkMacOSXGetNSWindowForDrawable(winPtr->window);

Expand All @@ -3639,13 +3639,13 @@ WmOverrideredirectCmd(
return TCL_OK;
}

if (Tcl_GetBooleanFromObj(interp, objv[3], &flag) != TCL_OK) {
if (Tcl_GetBooleanFromObj(interp, objv[3], &boolValue) != TCL_OK) {
return TCL_ERROR;
}
atts.override_redirect = flag ? True : False;
atts.override_redirect = boolValue;
Tk_ChangeWindowAttributes((Tk_Window)winPtr, CWOverrideRedirect, &atts);
if ([NSApp macOSVersion] >= 101300) {
if (flag) {
if (boolValue) {
win.styleMask |= NSWindowStyleMaskDocModalWindow;
} else {
win.styleMask &= ~NSWindowStyleMaskDocModalWindow;
Expand Down
8 changes: 4 additions & 4 deletions unix/tkUnixWm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2929,7 +2929,7 @@ WmOverrideredirectCmd(
Tcl_Size objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
int boolean, curValue;
Bool boolValue, curValue;
XSetWindowAttributes atts;

if ((objc != 3) && (objc != 4)) {
Expand All @@ -2941,16 +2941,16 @@ WmOverrideredirectCmd(
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(curValue != 0));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[3], &boolean) != TCL_OK) {
if (Tcl_GetBooleanFromObj(interp, objv[3], &boolValue) != TCL_OK) {
return TCL_ERROR;
}
if (curValue != boolean) {
if (curValue != boolValue) {
/*
* Only do this if we are really changing value, because it causes
* some funky stuff to occur
*/

atts.override_redirect = (boolean) ? True : False;
atts.override_redirect = boolValue;
Tk_ChangeWindowAttributes((Tk_Window) winPtr, CWOverrideRedirect,
&atts);
if (winPtr->wmInfoPtr->wrapperPtr != NULL) {
Expand Down
18 changes: 9 additions & 9 deletions win/tkWinWm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2914,7 +2914,7 @@ WmAttributesCmd(
WmInfo *wmPtr = winPtr->wmInfoPtr;
LONG style, exStyle, styleBit, *stylePtr = NULL;
const char *string;
int boolean;
Bool boolValue;
Tcl_Size i, length;
int config_fullscreen = 0, updatewrapper = 0;
int fullscreen_attr_changed = 0, fullscreen_attr = 0;
Expand Down Expand Up @@ -3090,7 +3090,7 @@ WmAttributesCmd(
}
} else {
if ((i < objc-1)
&& Tcl_GetBooleanFromObj(interp, objv[i+1], &boolean)
&& Tcl_GetBooleanFromObj(interp, objv[i+1], &boolValue)
!= TCL_OK) {
return TCL_ERROR;
}
Expand All @@ -3100,13 +3100,13 @@ WmAttributesCmd(
(wmPtr->flags & WM_FULLSCREEN) != 0));
} else {
fullscreen_attr_changed = 1;
fullscreen_attr = boolean;
fullscreen_attr = boolValue;
}
config_fullscreen = 0;
} else if (objc == 4) {
Tcl_SetObjResult(interp,
Tcl_NewWideIntObj((*stylePtr & styleBit) != 0));
} else if (boolean) {
} else if (boolValue) {
*stylePtr |= styleBit;
} else {
*stylePtr &= ~styleBit;
Expand Down Expand Up @@ -4733,7 +4733,7 @@ WmOverrideredirectCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
int boolean, curValue;
Bool boolValue, curValue;
XSetWindowAttributes atts;

if ((objc != 3) && (objc != 4)) {
Expand All @@ -4755,19 +4755,19 @@ WmOverrideredirectCmd(
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(curValue != 0));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[3], &boolean) != TCL_OK) {
if (Tcl_GetBooleanFromObj(interp, objv[3], &boolValue) != TCL_OK) {
return TCL_ERROR;
}
if (curValue != boolean) {
if (curValue != boolValue) {
if (winPtr->flags & TK_EMBEDDED) {
SendMessageW(wmPtr->wrapper, TK_OVERRIDEREDIRECT, boolean, 0);
SendMessageW(wmPtr->wrapper, TK_OVERRIDEREDIRECT, boolValue, 0);
} else {
/*
* Only do this if we are really changing value, because it causes
* some funky stuff to occur.
*/

atts.override_redirect = (boolean) ? True : False;
atts.override_redirect = boolValue;
Tk_ChangeWindowAttributes((Tk_Window) winPtr, CWOverrideRedirect,
&atts);
if (!(wmPtr->flags & (WM_NEVER_MAPPED))
Expand Down

0 comments on commit 4240bad

Please sign in to comment.