Skip to content

Commit 038f2c9

Browse files
committed
engine: Fix Boolean stored in single bit
The `Boolean` type used in the engine is actually a tristate, which permits a `Mixed` value (value 2). This patch replaces all instances of `Boolean` that are explicitly stored in a single bit with `bool`.
1 parent 34523f8 commit 038f2c9

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

engine/src/chunk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class MCChunk : public MCExpression
7171
MCObject *destobj;
7272
Dest_type desttype;
7373
Functions function;
74-
Boolean marked : 1;
74+
bool marked : 1;
7575

7676
// MW-2014-05-28: [[ Bug 11928 ]] This is set to true after 'destvar' has been evaluated
7777
// as a chunk. This stops stale chunk information being used in MCChunk::del.

engine/src/cmds.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class MCDo : public MCStatement
9393
MCChunk *widget;
9494
protected:
9595
bool browser : 1;
96-
Boolean debug : 1;
96+
bool debug : 1;
9797
bool caller : 1;
9898
public:
9999
MCDo()
@@ -500,11 +500,11 @@ class MCCreate : public MCStatement
500500
MCExpression *file;
501501
MCExpression *kind;
502502
MCChunk *container;
503-
Boolean directory: 1;
504-
Boolean visible: 1;
505-
Boolean alias: 1;
503+
bool directory: 1;
504+
bool visible: 1;
505+
bool alias: 1;
506506
// MW-2014-09-30: [[ ScriptOnlyStack ]] For 'create script only stack ...' form.
507-
Boolean script_only_stack : 1;
507+
bool script_only_stack : 1;
508508
public:
509509
MCCreate()
510510
{
@@ -1517,16 +1517,16 @@ class MCOpen : public MCStatement
15171517
MCStringRef destination;
15181518
Open_argument arg : 4;
15191519
Open_mode mode : 4;
1520-
Boolean dialog : 1;
1521-
Boolean datagram : 1;
1522-
Boolean sheet : 1;
1523-
Boolean secure : 1;
1524-
Boolean secureverify : 1;
1525-
Boolean textmode : 1;
1520+
bool dialog : 1;
1521+
bool datagram : 1;
1522+
bool sheet : 1;
1523+
bool secure : 1;
1524+
bool secureverify : 1;
1525+
bool textmode : 1;
15261526

15271527
// MW-2010-05-09: Indicates that the process should be opened with elevated
15281528
// (admin) permissions
1529-
Boolean elevated : 1;
1529+
bool elevated : 1;
15301530

15311531
// MM-2014-06-13: [[ Bug 12567 ]] Added new "open socket <socket> with verification for <host>" variant.
15321532
MCExpression *verifyhostname;
@@ -1768,7 +1768,7 @@ class MCSetOp : public MCStatement
17681768
MCVarref *destvar;
17691769
MCExpression *source;
17701770
protected:
1771-
Boolean intersect : 1;
1771+
bool intersect : 1;
17721772
bool overlap : 1;
17731773
// MERG-2013-08-26: [[ RecursiveArrayOp ]] Support nested arrays in union and intersect
17741774
bool recursive : 1;
@@ -2197,7 +2197,7 @@ class MCSecure : public MCStatement
21972197

21982198
private:
21992199
MCExpression *m_sock_name;
2200-
Boolean secureverify : 1;
2200+
bool secureverify : 1;
22012201

22022202
// MM-2014-06-13: [[ Bug 12567 ]] Added new host name variant for use with verification.
22032203
MCExpression *m_verify_host_name;

engine/src/variable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,11 @@ class MCVarref : public MCExpression
338338
};
339339
unsigned index : 16;
340340
unsigned dimensions : 8;
341-
Boolean isparam : 1;
341+
bool isparam : 1;
342342

343343
// MW-2008-10-28: [[ ParentScripts ]] This boolean flag is True if this
344344
// varref refers to a script local.
345-
Boolean isscriptlocal : 1;
345+
bool isscriptlocal : 1;
346346

347347
// MW-2012-03-15: [[ Bug ]] This boolean flag is true if this varref is
348348
// a plain var and doesn't require synching.

0 commit comments

Comments
 (0)