Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 8e83022

Browse files
committed
[[ Cleanup ]] engine: Add several sets of disambiguating parentheses/braces
1 parent 7a63f9f commit 8e83022

File tree

7 files changed

+19
-9
lines changed

7 files changed

+19
-9
lines changed

engine/src/answer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,12 @@ Parse_stat MCAnswer::parse(MCScriptPoint &sp)
152152
t_error = PE_ANSWER_BADTITLE;
153153

154154
if (t_error == PE_UNDEFINED && sp . skip_token(SP_FACTOR, TT_PREP, PT_AS) == PS_NORMAL)
155+
{
155156
if (sp . skip_token(SP_ASK, TT_UNDEFINED, AT_SHEET) == PS_NORMAL)
156157
sheet = True;
157158
else
158159
t_error = PE_ANSWER_BADRESPONSE;
160+
}
159161

160162
if (t_error != PE_UNDEFINED)
161163
{

engine/src/ask.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,12 @@ Parse_stat MCAsk::parse(MCScriptPoint &sp)
8787
initpoint(sp);
8888

8989
if (sp . next(t_type) == PS_NORMAL)
90+
{
9091
if (sp . lookup(SP_ASK, t_literal) == PS_NORMAL)
9192
mode = (Ask_type)t_literal -> which;
9293
else
9394
sp . backup();
95+
}
9496

9597
// MW-2008-07-23: [[ Bug 6821 ]] ask files "foo" crashes.
9698
// This is because the mode check is not strict enough. If the given ask
@@ -124,10 +126,12 @@ Parse_stat MCAsk::parse(MCScriptPoint &sp)
124126
t_error = PE_ANSWER_BADTITLE;
125127

126128
if (t_error == PE_UNDEFINED && sp . skip_token(SP_FACTOR, TT_PREP, PT_AS) == PS_NORMAL)
129+
{
127130
if (sp . skip_token(SP_ASK, TT_UNDEFINED, AT_SHEET) == PS_NORMAL)
128131
sheet = True;
129132
else
130133
t_error = PE_ANSWER_BADRESPONSE;
134+
}
131135

132136
if (t_error != PE_UNDEFINED)
133137
{

engine/src/exec-interface-object.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3088,6 +3088,7 @@ void MCObject::SetVisibility(MCExecContext& ctxt, uint32_t part, bool setting, b
30883088
if (dirty)
30893089
{
30903090
if (opened && getstack() == MCmousestackptr)
3091+
{
30913092
if (!(flags & F_VISIBLE))
30923093
{
30933094
MCObject *mfocused = MCmousestackptr->getcard()->getmfocused();
@@ -3111,6 +3112,7 @@ void MCObject::SetVisibility(MCExecContext& ctxt, uint32_t part, bool setting, b
31113112
}
31123113
else if (MCU_point_in_rect(rect, MCmousex, MCmousey))
31133114
needmfocus = true;
3115+
}
31143116

31153117
if (state & CS_KFOCUSED)
31163118
getcard(part)->kunfocus();

engine/src/exec-interface.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,10 +1822,10 @@ void MCInterfaceExecClickCmd(MCExecContext& ctxt, uint2 p_button, MCPoint p_loca
18221822
MCbuttonstate = oldbstate;
18231823
MCControl *mfocused = MCdefaultstackptr->getcard()->getmfocused();
18241824
if (mfocused != NULL
1825-
&& (mfocused->gettype() == CT_GRAPHIC
1826-
&& mfocused->getstate(CS_CREATE_POINTS)
1827-
|| (mfocused->gettype() == CT_IMAGE && mfocused->getstate(CS_DRAW)
1828-
&& MCdefaultstackptr->gettool(mfocused) == T_POLYGON)))
1825+
&& ((mfocused->gettype() == CT_GRAPHIC
1826+
&& mfocused->getstate(CS_CREATE_POINTS))
1827+
|| (mfocused->gettype() == CT_IMAGE && mfocused->getstate(CS_DRAW)
1828+
&& MCdefaultstackptr->gettool(mfocused) == T_POLYGON)))
18291829
mfocused->doubleup(1); // cancel polygon create
18301830
if (t_old_mousestack == NULL || t_old_mousestack->getmode() != 0)
18311831
{

engine/src/exec-interface2.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ void MCInterfaceSetCursor(MCExecContext& ctxt, uinteger_t& r_id, bool p_is_defau
14281428
if (!p_is_default && r_id == PI_BUSY)
14291429
{
14301430
r_id = PI_BUSY1 + MCbusycount;
1431-
MCbusycount = MCbusycount + 1 & 0x7;
1431+
MCbusycount = (MCbusycount + 1) & 0x7;
14321432
}
14331433
r_cursor = MCcursors[r_id];
14341434
}
@@ -3731,7 +3731,9 @@ void MCInterfaceDoRelayer(MCExecContext& ctxt, int p_relation, MCObjectPtr p_sou
37313731
// that that exists and is still a child of new owner.
37323732
if (t_source_handle -> Exists() &&
37333733
t_new_owner_handle -> Exists() &&
3734-
(t_new_target == nil || t_new_target_handle -> Exists() && t_new_target -> getparent() == t_new_owner))
3734+
(t_new_target == nil ||
3735+
(t_new_target_handle -> Exists() &&
3736+
t_new_target -> getparent() == t_new_owner)))
37353737
{
37363738
p_source . object -> getparent() -> relayercontrol_remove(static_cast<MCControl *>(p_source . object));
37373739
t_new_owner -> relayercontrol_insert(static_cast<MCControl *>(p_source . object), t_new_target);

engine/src/exec-multimedia.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,8 @@ void MCMultimediaExecLoadVideoClip(MCExecContext& ctxt, MCStack *p_target, int p
570570
tptr->setflag(dontrefresh, F_DONT_REFRESH);
571571
if (p_looping)
572572
tptr->setflag(True, F_LOOPING);
573-
if (p_prepare && !tptr->prepare(p_options == nil ? kMCEmptyString : p_options)
574-
|| !p_prepare && !tptr->playstart(p_options == nil ? kMCEmptyString : p_options))
573+
if ((p_prepare && !tptr->prepare(p_options == nil ? kMCEmptyString : p_options)) ||
574+
(!p_prepare && !tptr->playstart(p_options == nil ? kMCEmptyString : p_options)))
575575
{
576576
if (tptr->isdisposable())
577577
delete tptr;

engine/src/fieldhtml.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,7 @@ static void import_html_append_unicode_char(import_html_t& ctxt, uint32_t p_code
14461446

14471447
// If the text is currently native (and there is some) or if the styling has changed
14481448
// then flush.
1449-
if (!ctxt . is_unicode && ctxt . byte_count > 0 ||
1449+
if ((!ctxt . is_unicode && ctxt . byte_count > 0) ||
14501450
!import_html_equal_style(ctxt . last_used_style, ctxt . styles[ctxt . style_index] . style))
14511451
import_html_flush_chars(ctxt);
14521452

0 commit comments

Comments
 (0)