Skip to content

Commit 874323e

Browse files
Turn MCtracestackptr into an object handle
1 parent 1cad27f commit 874323e

File tree

8 files changed

+13
-11
lines changed

8 files changed

+13
-11
lines changed

engine/src/debug.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
4545
////////////////////////////////////////////////////////////////////////////////
4646

4747
MCExecContext *MCECptr;
48-
MCStack *MCtracestackptr;
48+
MCStackHandle MCtracestackptr;
4949
Window MCtracewindow;
5050
Boolean MCtrace;
5151
Boolean MCtraceabort;
@@ -177,7 +177,7 @@ void MCB_message(MCExecContext &ctxt, MCNameRef mess, MCParameter *p)
177177
MCU_resetprops(True);
178178

179179
MCtrace = False;
180-
if (MCtracestackptr != NULL)
180+
if (MCtracestackptr)
181181
MCtracewindow = MCtracestackptr->getw();
182182
else
183183
MCtracewindow = ctxt.GetObject()->getw();
@@ -214,7 +214,7 @@ void MCB_message(MCExecContext &ctxt, MCNameRef mess, MCParameter *p)
214214
exitall = True;
215215
}
216216
else
217-
if (MCtracestackptr != NULL)
217+
if (MCtracestackptr)
218218
MCtrace = True;
219219
}
220220
MCcheckstack = oldcheck;

engine/src/debug.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
1717
#ifndef __MC_DEBUG_H__
1818
#define __MC_DEBUG_H__
1919

20+
#include "stack.h"
21+
2022
//
2123
// script debugger functions
2224
//
@@ -44,7 +46,7 @@ struct Watchvar
4446
#define MAX_CONTEXTS 100
4547

4648
extern MCExecContext *MCECptr;
47-
extern MCStack *MCtracestackptr;
49+
extern MCStackHandle MCtracestackptr;
4850
extern Window MCtracewindow;
4951
extern Boolean MCtrace;
5052
extern Boolean MCtraceabort;

engine/src/desktop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void MCPlatformHandleApplicationShutdownRequest(bool& r_terminate)
8989
MCdefaultstackptr->getcard()->message(MCM_shut_down);
9090
MCquit = True;
9191
MCexitall = True;
92-
MCtracestackptr = NULL;
92+
MCtracestackptr = nil;
9393
MCtraceabort = True;
9494
MCtracereturn = True;
9595
r_terminate = true;

engine/src/eventqueue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ static void MCEventQueueDispatchEvent(MCEvent *p_event)
278278
MCdefaultstackptr->getcard()->message(MCM_shut_down);
279279
MCquit = True;
280280
MCexitall = True;
281-
MCtracestackptr = NULL;
281+
MCtracestackptr = nil;
282282
MCtraceabort = True;
283283
MCtracereturn = True;
284284
break;

engine/src/exec-debugging.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void MCDebuggingSetTraceReturn(MCExecContext& ctxtm, bool p_value)
134134

135135
void MCDebuggingGetTraceStack(MCExecContext& ctxt, MCStringRef& r_value)
136136
{
137-
if (MCtracestackptr == nil)
137+
if (!MCtracestackptr)
138138
{
139139
r_value = (MCStringRef)MCValueRetain(kMCEmptyString);
140140
return;

engine/src/exec-engine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ void MCEngineExecQuit(MCExecContext& ctxt, integer_t p_retcode)
929929
MCquit = True;
930930
MCquitisexplicit = True;
931931
MCexitall = True;
932-
MCtracestackptr = NULL;
932+
MCtracestackptr = nil;
933933
MCtraceabort = True;
934934
MCtracereturn = True;
935935
}

engine/src/mode_development.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void MCRevRelicense::exec_ctxt(MCExecContext& ctxt)
252252
MCretcode = 0;
253253
MCquit = True;
254254
MCexitall = True;
255-
MCtracestackptr = NULL;
255+
MCtracestackptr = nil;
256256
MCtraceabort = True;
257257
MCtracereturn = True;
258258

engine/src/object.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ Exec_stat MCObject::exechandler(MCHandler *hptr, MCParameter *params)
932932

933933
lockforexecution();
934934
MCExecContext ctxt(this, hlist, hptr);
935-
if (MCtracestackptr != NULL && MCtracereturn)
935+
if (MCtracestackptr && MCtracereturn)
936936
{
937937
Boolean oldtrace = MCtrace;
938938
if (MCtracestackptr == getstack())
@@ -989,7 +989,7 @@ Exec_stat MCObject::execparenthandler(MCHandler *hptr, MCParameter *params, MCPa
989989

990990
MCExecContext ctxt(this, t_parentscript_object -> hlist, hptr);
991991
ctxt.SetParentScript(parentscript);
992-
if (MCtracestackptr != NULL && MCtracereturn)
992+
if (MCtracestackptr && MCtracereturn)
993993
{
994994
Boolean oldtrace = MCtrace;
995995
if (MCtracestackptr == getstack())

0 commit comments

Comments
 (0)