Skip to content

Commit 40256dc

Browse files
committed
[[ Cleanup ]] engine: Add some disambiguating parentheses and braces.
1 parent fceeca1 commit 40256dc

File tree

6 files changed

+21
-13
lines changed

6 files changed

+21
-13
lines changed

engine/src/cpalette.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,12 @@ void MCColors::draw(MCDC *dc, const MCRectangle &dirty, bool p_isolated, bool p_
278278
draw3d(dc, trect, ETCH_SUNKEN, borderwidth);
279279
}
280280
if (flags & F_SHOW_BORDER)
281+
{
281282
if (flags & F_3D)
282283
draw3d(dc, rect, ETCH_SUNKEN, borderwidth);
283284
else
284285
drawborder(dc, rect, borderwidth);
286+
}
285287
}
286288

287289
///////////////////////////////////////////////////////////////////////////////

engine/src/debug.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ void MCB_trace(MCExecContext &ctxt, uint2 line, uint2 pos)
285285
{
286286
MCParentScriptUse *t_parentscript;
287287
t_parentscript = ctxt . GetParentScript();
288-
if (t_parentscript == NULL && MCbreakpoints[i].object == ctxt.GetObject() ||
289-
t_parentscript != NULL && MCbreakpoints[i].object == t_parentscript -> GetParent() -> GetObject())
288+
if ((t_parentscript == NULL && MCbreakpoints[i].object == ctxt.GetObject()) ||
289+
(t_parentscript != NULL && MCbreakpoints[i].object == t_parentscript -> GetParent() -> GetObject()))
290290
MCB_prepmessage(ctxt, MCM_trace_break, line, pos, 0, MCbreakpoints[i].info);
291291
}
292292
}

engine/src/dispatch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ IO_stat MCDispatch::readstartupstack(IO_handle stream, MCStack*& r_stack)
598598
#endif
599599

600600
if (IO_read_uint1(&type, stream) != IO_NORMAL
601-
|| type != OT_STACK && type != OT_ENCRYPT_STACK
601+
|| (type != OT_STACK && type != OT_ENCRYPT_STACK)
602602
|| t_stack->load(stream, version, type) != IO_NORMAL)
603603
{
604604
delete t_stack;
@@ -709,7 +709,7 @@ IO_stat MCDispatch::doreadfile(MCStringRef p_openpath, MCStringRef p_name, IO_ha
709709
MCresult -> clear();
710710

711711
if (IO_read_uint1(&type, stream) != IO_NORMAL
712-
|| type != OT_STACK && type != OT_ENCRYPT_STACK
712+
|| (type != OT_STACK && type != OT_ENCRYPT_STACK)
713713
|| sptr->load(stream, version, type) != IO_NORMAL)
714714
{
715715
if (MCresult -> isclear())

engine/src/dllst.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ void MCDLlist::splitat(MCDLlist *node)
8080
MCDLlist *MCDLlist::remove(MCDLlist *&list)
8181
{
8282
if (list == this)
83+
{
8384
if (list->nptr == this)
8485
list = NULL;
8586
else
8687
list = nptr;
88+
}
8789
nptr->pptr = pptr;
8890
pptr->nptr = nptr;
8991
pptr = nptr = this;

engine/src/field.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,8 @@ void MCField::kfocus()
574574
if (flags & F_LIST_BEHAVIOR)
575575
{
576576
if (!(flags & F_TOGGLE_HILITE))
577-
if (!focusedparagraph->isselection()
578-
&& !focusedparagraph->IsEmpty()
577+
if ((!focusedparagraph->isselection()
578+
&& !focusedparagraph->IsEmpty())
579579
|| focusedparagraph->next() != focusedparagraph)
580580
{
581581
focusedparagraph->sethilite(True);
@@ -844,7 +844,7 @@ Boolean MCField::mfocus(int2 x, int2 y)
844844
{
845845
Tool tool = getstack()->gettool(this);
846846
if (!(flags & F_VISIBLE || MCshowinvisibles)
847-
|| flags & F_DISABLED && tool == T_BROWSE || state & CS_NO_FILE)
847+
|| (flags & F_DISABLED && tool == T_BROWSE) || state & CS_NO_FILE)
848848
return False;
849849
if (sbfocus(x, y, hscrollbar, vscrollbar))
850850
{
@@ -1040,7 +1040,7 @@ Boolean MCField::mdown(uint2 which)
10401040
}
10411041
}
10421042
if (flags & F_TRAVERSAL_ON ||
1043-
(flags & F_LOCK_TEXT || MCmodifierstate & MS_CONTROL) && flags & F_LIST_BEHAVIOR)
1043+
((flags & F_LOCK_TEXT || MCmodifierstate & MS_CONTROL) && flags & F_LIST_BEHAVIOR))
10441044
{
10451045
if (flags & F_TRAVERSAL_ON && !(state & CS_KFOCUSED)
10461046
&& !(flags & F_NO_AUTO_HILITE))
@@ -1170,8 +1170,8 @@ Boolean MCField::mup(uint2 which, bool p_release)
11701170
{
11711171
if (flags & F_LIST_BEHAVIOR
11721172
&& (my - rect.y > (int4)(textheight + topmargin - texty)
1173-
|| paragraphs == paragraphs->next()
1174-
&& paragraphs->IsEmpty()))
1173+
|| (paragraphs == paragraphs->next()
1174+
&& paragraphs->IsEmpty())))
11751175
message_with_valueref_args(MCM_mouse_release, MCSTR("1"));
11761176
else
11771177
{
@@ -1325,6 +1325,7 @@ void MCField::timer(MCNameRef mptr, MCParameter *params)
13251325
else if (MCNameIsEqualTo(mptr, MCM_internal2, kMCCompareCaseless))
13261326
{
13271327
if (opened)
1328+
{
13281329
if (state & CS_SELECTING)
13291330
{
13301331
// MW-2012-01-25: [[ FieldMetrics ]] Co-ordinates are now card-based.
@@ -1333,12 +1334,15 @@ void MCField::timer(MCNameRef mptr, MCParameter *params)
13331334
MCscreen->addtimer(this, MCM_internal2, MCsyncrate);
13341335
}
13351336
else
1337+
{
13361338
if (state & CS_DRAG_TEXT)
13371339
{
13381340
if (!MCU_point_in_rect(getfrect(), mx, my))
13391341
dragtext();
13401342
MCscreen->addtimer(this, MCM_internal2, MCsyncrate);
13411343
}
1344+
}
1345+
}
13421346
}
13431347
else
13441348
MCControl::timer(mptr, params);
@@ -2612,7 +2616,7 @@ Exec_stat MCField::vscroll(int4 offset, Boolean doredraw)
26122616
drect.y -= DEFAULT_BORDER;
26132617
drect.height += flags & F_HSCROLLBAR ? DEFAULT_BORDER : DEFAULT_BORDER * 2;
26142618
if (state & CS_KFOCUSED && !(extraflags & EF_NO_FOCUS_BORDER)
2615-
&& (IsMacEmulatedLF() || IsMacLFAM() && !MCaqua))
2619+
&& (IsMacEmulatedLF() || (IsMacLFAM() && !MCaqua)))
26162620
drect = MCU_reduce_rect(drect, 1);
26172621
}
26182622
//to-do change for drawing xp text fields

engine/src/fieldf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ void MCField::positioncursor(Boolean force, Boolean goal, MCRectangle &drect, in
771771
// MW-2006-02-26: Even if the screen is locked we still want to set the cursor
772772
// position, otherwise the repositioning gets deferred too much.
773773
if (!(state & (CS_KFOCUSED | CS_DRAG_TEXT))
774-
|| !(flags & F_LIST_BEHAVIOR) && flags & F_LOCK_TEXT)
774+
|| (!(flags & F_LIST_BEHAVIOR) && flags & F_LOCK_TEXT))
775775
return;
776776

777777
// OK-2008-07-22 : Crash fix.
@@ -1402,7 +1402,7 @@ void MCField::startselection(int2 x, int2 y, Boolean words)
14021402
else
14031403
{
14041404
if (flags & F_LIST_BEHAVIOR)
1405-
if (MCmodifierstate & MS_CONTROL && flags & F_NONCONTIGUOUS_HILITES
1405+
if ((MCmodifierstate & MS_CONTROL && flags & F_NONCONTIGUOUS_HILITES)
14061406
|| flags & F_TOGGLE_HILITE)
14071407
contiguous = False;
14081408
else

0 commit comments

Comments
 (0)