Skip to content

Commit c64cde2

Browse files
Turn MCerrorptr into an object handle
1 parent 8c89c64 commit c64cde2

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

engine/src/card.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ Exec_stat MCCard::handle(Handler_type htype, MCNameRef mess, MCParameter *params
12891289
}
12901290
}
12911291

1292-
if (stat == ES_ERROR && MCerrorptr == NULL)
1292+
if (stat == ES_ERROR && !MCerrorptr)
12931293
MCerrorptr = this;
12941294

12951295
return stat;

engine/src/exec-engine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,7 @@ void MCEngineEvalTargetAsObject(MCExecContext& ctxt, MCObjectPtr& r_object)
19401940

19411941
void MCEngineEvalErrorObjectAsObject(MCExecContext& ctxt, MCObjectPtr& r_object)
19421942
{
1943-
if (MCerrorptr != nil)
1943+
if (MCerrorptr)
19441944
{
19451945
r_object . object = MCerrorptr;
19461946
r_object . part_id = 0;

engine/src/exec-keywords.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ void MCKeywordsExecCommandOrFunction(MCExecContext& ctxt, bool resolved, MCHandl
190190
case ES_ERROR:
191191
case ES_PASS:
192192
MCeerror->add(is_function ? EE_FUNCTION_BADFUNCTION : EE_STATEMENT_BADCOMMAND, line, pos, handler -> getname());
193-
if (MCerrorptr == NULL)
193+
if (!MCerrorptr)
194194
MCerrorptr = p;
195195
stat = ES_ERROR;
196196
break;

engine/src/globals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ MCStackHandle MCclickstackptr;
271271
MCStackHandle MCfocusedstackptr;
272272
MCCardHandle MCdynamiccard;
273273
Boolean MCdynamicpath;
274-
MCObject *MCerrorptr;
275274
MCObject *MCerrorlockptr;
275+
MCObjectHandle MCerrorptr;
276276
MCObjectPtr MCtargetptr;
277277
MCGroup *MCsavegroupptr;
278278
MCGroup *MCdefaultmenubar;

engine/src/globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ extern MCObjectPtr MCtargetptr;
191191
extern MCObjectHandle MCmenuobjectptr;
192192
extern MCCardHandle MCdynamiccard;
193193
extern Boolean MCdynamicpath;
194-
extern MCObject *MCerrorptr;
195194
extern MCObject *MCerrorlockptr;
196195
extern MCGroup *MCsavegroupptr;
197196
extern MCGroup *MCdefaultmenubar;
198197
extern MCGroup *MCmenubar;
199198
extern MCAudioClip *MCacptr;
200199
extern MCPlayer *MCplayers;
200+
extern MCObjectHandle MCerrorptr;
201201

202202
extern MCStack *MCtemplatestack;
203203
extern MCAudioClip *MCtemplateaudio;

engine/src/mcerror.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void MCError::clear()
125125
MCStringCreateMutable(0, buffer);
126126
thrown = False;
127127
if (this == MCeerror)
128-
MCerrorptr = NULL;
128+
MCerrorptr = nil;
129129
}
130130

131131
void MCError::geterrorloc(uint2 &line, uint2 &pos)

engine/src/object.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ MCObject::~MCObject()
298298
MCB_clearbreaks(this);
299299

300300
if (MCerrorptr == this)
301-
MCerrorptr = NULL;
301+
MCerrorptr = nil;
302302
if (state & CS_SELECTED)
303303
MCselected->remove(this);
304304
IO_freeobject(this);
@@ -1165,7 +1165,7 @@ Exec_stat MCObject::handle(Handler_type htype, MCNameRef mess, MCParameter *para
11651165
}
11661166
}
11671167

1168-
if (stat == ES_ERROR && MCerrorptr == NULL)
1168+
if (stat == ES_ERROR && !MCerrorptr)
11691169
MCerrorptr = this;
11701170

11711171
return stat;
@@ -2283,13 +2283,13 @@ void MCObject::senderror()
22832283
/* UNCHECKED */ MCperror->copyasstringref(&t_perror);
22842284
MCperror->clear();
22852285
}
2286-
if (MCerrorptr == NULL)
2286+
if (!MCerrorptr)
22872287
MCerrorptr = this;
22882288
MCAutoStringRef t_eerror;
22892289
/* UNCHECKED */ MCeerror->copyasstringref(&t_eerror);
22902290
MCscreen->delaymessage(MCerrorlockptr == NULL ? MCerrorptr : MCerrorlockptr, MCM_error_dialog, *t_eerror, *t_perror);
22912291
MCeerror->clear();
2292-
MCerrorptr = NULL;
2292+
MCerrorptr = nil;
22932293
}
22942294

22952295
void MCObject::sendmessage(Handler_type htype, MCNameRef m, Boolean h)

engine/src/stack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,7 @@ Exec_stat MCStack::handle(Handler_type htype, MCNameRef message, MCParameter *pa
15541554
stat = ES_PASS;
15551555
}
15561556

1557-
if (stat == ES_ERROR && MCerrorptr == NULL)
1557+
if (stat == ES_ERROR && !MCerrorptr)
15581558
MCerrorptr = this;
15591559

15601560
return stat;

engine/src/widget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ void MCWidget::SendError(void)
981981
{
982982
MCExecContext ctxt(this, nil, nil);
983983
MCExtensionCatchError(ctxt);
984-
if (MCerrorptr == NULL)
984+
if (!MCerrorptr)
985985
MCerrorptr = this;
986986
senderror();
987987
}

0 commit comments

Comments
 (0)