summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
authorculler <culler>2019-01-03 14:13:09 (GMT)
committerculler <culler>2019-01-03 14:13:09 (GMT)
commitb6eb3654e101439f170418eb6eab11065e196a06 (patch)
tree13ffe6d9e29b6c6112207cd0bd31960e8494a05e /generic/tkTextDisp.c
parent0eeed8ea89fe5aaab65b470f3ab9915d8ae9ce8f (diff)
downloadtk-b6eb3654e101439f170418eb6eab11065e196a06.zip
tk-b6eb3654e101439f170418eb6eab11065e196a06.tar.gz
tk-b6eb3654e101439f170418eb6eab11065e196a06.tar.bz2
Be careful about Bool types.
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 38c63a2..7f9d13f 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -3143,8 +3143,11 @@ AsyncUpdateLineMetrics(
static void
GenerateWidgetViewSyncEvent(
TkText *textPtr, /* Information about text widget. */
- Bool InSync) /* true if in sync, false otherwise */
+ Bool NewSyncState) /* true if becoming in sync, false otherwise */
{
+ NewSyncState = (NewSyncState != 0); /* ensure 0 or 1 value */
+ Bool OldSyncState = ((textPtr->dInfoPtr->flags & OUT_OF_SYNC) == 0);
+
/*
* OSX 10.14 needs to be told to display the window when the Text Widget
* is in sync. (That is, to run DisplayText inside of the drawRect
@@ -3157,14 +3160,14 @@ GenerateWidgetViewSyncEvent(
FORCE_DISPLAY(textPtr->tkwin);
}
- if (InSync == !!(textPtr->dInfoPtr->flags & OUT_OF_SYNC)) {
- if (InSync) {
+ if (NewSyncState != OldSyncState) {
+ if (NewSyncState) {
textPtr->dInfoPtr->flags &= ~OUT_OF_SYNC;
} else {
textPtr->dInfoPtr->flags |= OUT_OF_SYNC;
}
TkSendVirtualEvent(textPtr->tkwin, "WidgetViewSync",
- Tcl_NewBooleanObj(InSync));
+ Tcl_NewBooleanObj(NewSyncState));
}
}
@@ -6334,7 +6337,7 @@ TkTextPendingsync(
{
TextDInfo *dInfoPtr = textPtr->dInfoPtr;
- return dInfoPtr->flags & OUT_OF_SYNC;
+ return ((dInfoPtr->flags & OUT_OF_SYNC) != 0);
}
/*