CARDINAL unsigned int
LONGCARD long long unsigned int
SHORTCARD short unsigned int
-BOOLEAN int
+BOOLEAN bool
REAL double
LONGREAL long double
SHORTREAL float
SetRecordFieldOffset, ChainOn, BuildEndRecord, BuildFieldRecord,
BuildEndFieldVarient, BuildArrayIndexType, BuildEndFunctionType,
BuildSetType, BuildEndVarient, BuildEndArrayType, InitFunctionTypeParameters,
- BuildProcTypeParameterDeclaration,
+ BuildProcTypeParameterDeclaration, DeclareKnownType,
ValueOutOfTypeRange, ExceedsTypeRange ;
FROM m2convert IMPORT BuildConvert ;
#include "ipa-ref.h"
#include "cgraph.h"
#include "stmt.h"
+#include <stdbool.h>
#if defined(init_cpp)
extern "C" {
+#endif
+
void init_FrontEndInit (void);
void init_PerCompilationInit (const char *filename);
+
+#if defined(init_cpp)
}
-#else /* !init_cpp. */
-void init_FrontEndInit (void);
-void init_PerCompilationInit (const char *filename);
#endif /* !init_cpp. */
#endif /*! init_h. */
#undef DEBUGGING
static location_t pending_location;
-static int pending_statement = FALSE;
+static int pending_statement = false;
/* assert_global_names asserts that the global_binding_level->names
can be chained. */
return *t;
}
-/* is_building_stmt_list returns TRUE if we are building a
- statement list. TRUE is returned if we are in a binding level and
+/* is_building_stmt_list returns true if we are building a
+ statement list. true is returned if we are in a binding level and
a statement list is under construction. */
int
b = newLevel ();
b->fndecl = fndecl;
b->context = fndecl;
- b->is_global = FALSE;
+ b->is_global = false;
b->list = head_binding_level;
b->next = NULL;
}
{
block = make_node (BLOCK);
DECL_INITIAL (fndecl) = block;
- TREE_USED (block) = TRUE;
+ TREE_USED (block) = true;
BLOCK_SUBBLOCKS (block) = NULL_TREE;
}
BLOCK_SUPERCONTEXT (block) = context;
BLOCK_VARS (block)
= chainon (BLOCK_VARS (block), current_binding_level->names);
- TREE_USED (fndecl) = TRUE;
+ TREE_USED (fndecl) = true;
if (bind_expr == NULL_TREE)
{
return t;
}
-/* toplevel return TRUE if we are in the global scope. */
+/* toplevel return true if we are in the global scope. */
-int
+bool
m2block_toplevel (void)
{
if (current_binding_level == NULL)
- return TRUE;
+ return true;
if (current_binding_level->fndecl == NULL)
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
/* GetErrorNode returns the gcc error_mark_node. */
tree note = build_stmt (pending_location, ASM_EXPR, string, NULL_TREE,
NULL_TREE, NULL_TREE, NULL_TREE);
- ASM_INPUT_P (note) = FALSE;
- ASM_VOLATILE_P (note) = FALSE;
+ ASM_INPUT_P (note) = false;
+ ASM_VOLATILE_P (note) = false;
#else
tree note = build_empty_stmt (pending_location);
#endif
- pending_statement = FALSE;
+ pending_statement = false;
do_add_stmt (note);
}
}
if (pending_statement && (pending_location != location))
flush_pending_note ();
- pending_statement = FALSE;
+ pending_statement = false;
return do_add_stmt (t);
}
if (pending_statement && (pending_location != location))
flush_pending_note ();
- pending_statement = TRUE;
+ pending_statement = true;
pending_location = location;
}
void
m2block_removeStmtNote (void)
{
- pending_statement = FALSE;
+ pending_statement = false;
}
/* init - initialize the data structures in this module. */
{
global_binding_level = newLevel ();
global_binding_level->context = build_translation_unit_decl (NULL);
- global_binding_level->is_global = TRUE;
+ global_binding_level->is_global = true;
current_binding_level = NULL;
}
#endif /* !m2block_c. */
#endif /* !m2block_h. */
+#include <stdbool.h>
+
EXTERN tree m2block_getLabel (location_t location, char *name);
EXTERN void m2block_pushFunctionScope (tree fndecl);
EXTERN tree m2block_popFunctionScope (void);
EXTERN tree m2block_DumpGlobalConstants (void);
EXTERN tree m2block_RememberInitModuleFunction (tree t);
EXTERN tree m2block_global_constant (tree t);
-EXTERN int m2block_toplevel (void);
+EXTERN bool m2block_toplevel (void);
EXTERN tree m2block_GetErrorNode (void);
EXTERN void m2block_addStmtNote (location_t location);
/* BuiltinExists - returns TRUE if the builtin function, name, exists
for this target architecture. */
-int
+bool
m2builtins_BuiltinExists (char *name)
{
struct builtin_function_entry *fe;
#endif /* !__GNUG__. */
#endif /* !m2builtins_c. */
+#include <stdbool.h>
+
EXTERN tree m2builtins_GetBuiltinConst (char *name);
EXTERN unsigned int m2builtins_GetBuiltinConstType (char *name);
EXTERN unsigned int m2builtins_GetBuiltinTypeInfoType (const char *ident);
tree src, tree n);
EXTERN tree m2builtins_BuiltInAlloca (location_t location, tree n);
EXTERN tree m2builtins_BuiltInIsfinite (location_t location, tree e);
-EXTERN int m2builtins_BuiltinExists (char *name);
+EXTERN bool m2builtins_BuiltinExists (char *name);
EXTERN tree m2builtins_BuildBuiltinTree (location_t location, char *name);
EXTERN tree m2builtins_BuiltInHugeVal (location_t location);
EXTERN tree m2builtins_BuiltInHugeValShort (location_t location);
if (value_type == type)
/* We let the caller deal with this. */
- return FALSE;
+ return false;
if ((TREE_CODE (value) == INTEGER_CST) && (type == generic_type))
{
*result = const_to_ISO_type (location, value, generic_type);
- return TRUE;
+ return true;
}
if (same_size_types (location, type, value_type))
tree a = build1 (ADDR_EXPR, pt, value);
tree t = build1 (INDIRECT_REF, type, a);
*result = build1 (NOP_EXPR, type, t);
- return TRUE;
+ return true;
}
else if (type == generic_type)
{
tree a = build1 (ADDR_EXPR, pt, value);
tree t = build1 (INDIRECT_REF, type, a);
*result = build1 (NOP_EXPR, type, t);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
/* convert_char_to_array - convert a single char, value, into an
/* Store the initial char. */
m2type_BuildArrayConstructorElement (c, value, i);
- i = m2expr_BuildAdd (location, i, m2decl_BuildIntegerConstant (1), FALSE);
+ i = m2expr_BuildAdd (location, i, m2decl_BuildIntegerConstant (1), false);
/* Now pad out the remaining elements with nul chars. */
while (m2expr_CompareTrees (i, n) < 0)
m2type_BuildArrayConstructorElement (
c, m2type_BuildCharConstant (location, &nul[0]), i);
i = m2expr_BuildAdd (location, i, m2decl_BuildIntegerConstant (1),
- FALSE);
+ false);
}
return m2type_BuildEndArrayConstructor (c);
}
tree
m2convert_BuildConvert (location_t location, tree type, tree value,
- int checkOverflow)
+ bool checkOverflow)
{
type = m2tree_skip_type_decl (type);
tree t;
&& (m2tree_IsOrdinal (type)))
value = doOrdinal (value);
else if (TREE_CODE (value) == FUNCTION_DECL && TREE_TYPE (value) != type)
- value = m2expr_BuildAddr (0, value, FALSE);
+ value = m2expr_BuildAddr (0, value, false);
if (converting_ISO_generic (location, type, value, m2type_GetByteType (), &t)
|| converting_ISO_generic (location, type, value,
while (m2expr_CompareTrees (i, n) < 0)
{
max_uint = m2expr_BuildMult (location, max_uint,
- m2decl_BuildIntegerConstant (256), FALSE);
+ m2decl_BuildIntegerConstant (256), false);
i = m2expr_BuildAdd (location, i, m2decl_BuildIntegerConstant (1),
- FALSE);
+ false);
}
max_uint = m2expr_BuildDivFloor (location, max_uint,
- m2decl_BuildIntegerConstant (2), FALSE);
+ m2decl_BuildIntegerConstant (2), false);
if (m2expr_CompareTrees (expr, m2decl_BuildIntegerConstant (0)) < 0)
- expr = m2expr_BuildAdd (location, expr, max_uint, FALSE);
+ expr = m2expr_BuildAdd (location, expr, max_uint, false);
i = m2decl_BuildIntegerConstant (0);
c = m2type_BuildStartArrayConstructor (iso_type);
while (m2expr_CompareTrees (i, n) < 0)
{
byte = m2expr_BuildModTrunc (location, expr,
- m2decl_BuildIntegerConstant (256), FALSE);
+ m2decl_BuildIntegerConstant (256), false);
if (BYTES_BIG_ENDIAN)
m2type_BuildArrayConstructorElement (
c, m2convert_ToLoc (location, byte),
- m2expr_BuildSub (location, m2expr_BuildSub (location, n, i, FALSE),
- m2decl_BuildIntegerConstant (1), FALSE));
+ m2expr_BuildSub (location, m2expr_BuildSub (location, n, i, false),
+ m2decl_BuildIntegerConstant (1), false));
else
m2type_BuildArrayConstructorElement (
c, m2convert_ToLoc (location, byte), i);
i = m2expr_BuildAdd (location, i, m2decl_BuildIntegerConstant (1),
- FALSE);
+ false);
expr = m2expr_BuildDivFloor (location, expr,
- m2decl_BuildIntegerConstant (256), FALSE);
+ m2decl_BuildIntegerConstant (256), false);
}
return m2type_BuildEndArrayConstructor (c);
return expr;
if (TREE_CODE (expr) == FUNCTION_DECL)
- expr = m2expr_BuildAddr (location, expr, FALSE);
+ expr = m2expr_BuildAddr (location, expr, false);
type = m2tree_skip_type_decl (type);
if (type == m2type_GetByteType () || type == m2type_GetISOLocType ()
tree
m2convert_ToWord (location_t location, tree expr)
{
- return m2convert_BuildConvert (location, m2type_GetWordType (), expr, FALSE);
+ return m2convert_BuildConvert (location, m2type_GetWordType (), expr, false);
}
/* ToCardinal - convert an expression, expr, to a CARDINAL. */
m2convert_ToCardinal (location_t location, tree expr)
{
return m2convert_BuildConvert (location, m2type_GetCardinalType (), expr,
- FALSE);
+ false);
}
/* convertToPtr - if the type of tree, t, is not a ptr_type_node then
return type;
else
return m2convert_BuildConvert (location, m2type_GetPointerType (), type,
- FALSE);
+ false);
}
/* ToInteger - convert an expression, expr, to an INTEGER. */
m2convert_ToInteger (location_t location, tree expr)
{
return m2convert_BuildConvert (location, m2type_GetIntegerType (), expr,
- FALSE);
+ false);
}
/* ToBitset - convert an expression, expr, to a BITSET type. */
m2convert_ToBitset (location_t location, tree expr)
{
return m2convert_BuildConvert (location, m2type_GetBitsetType (), expr,
- FALSE);
+ false);
}
/* ToLoc - convert an expression, expr, to a LOC. */
m2convert_ToLoc (location_t location, tree expr)
{
return m2convert_BuildConvert (location, m2type_GetISOByteType (), expr,
- FALSE);
+ false);
}
/* GenericToType - converts, expr, into, type, providing that expr is
#endif /* m2convert_c. */
EXTERN tree m2convert_BuildConvert (location_t location, tree type, tree value,
- int checkOverflow);
+ bool checkOverflow);
EXTERN tree m2convert_ConvertToPtr (location_t location_t, tree p);
EXTERN tree m2convert_ConvertString (tree type, tree expr);
EXTERN tree m2convert_ConvertConstantAndCheck (location_t location, tree type,
tree
m2decl_DeclareKnownVariable (location_t location, const char *name, tree type,
- int exported, int imported, int istemporary,
- int isglobal, tree scope, tree initial)
+ bool exported, bool imported, bool istemporary,
+ bool isglobal, tree scope, tree initial)
{
tree id;
tree decl;
tree
m2decl_BuildParameterDeclaration (location_t location, char *name, tree type,
- int isreference)
+ bool isreference)
{
tree parm_decl;
tree
m2decl_BuildEndFunctionDeclaration (location_t location_begin,
location_t location_end, const char *name,
- tree returntype, int isexternal,
- int isnested, int ispublic, int isnoreturn)
+ tree returntype, bool isexternal,
+ bool isnested, bool ispublic, bool isnoreturn)
{
tree fntype;
tree fndecl;
void
m2decl_DetermineSizeOfConstant (location_t location,
const char *str, unsigned int base,
- int *needsLong, int *needsUnsigned)
+ bool *needsLong, bool *needsUnsigned)
{
unsigned int ulow;
int high;
unsigned HOST_WIDE_INT low;
HOST_WIDE_INT high;
HOST_WIDE_INT ival[3];
- int overflow = m2expr_interpret_integer (str, base, &low, &high);
- int needLong, needUnsigned;
+ bool overflow = m2expr_interpret_integer (str, base, &low, &high);
+ bool needLong, needUnsigned;
ival[0] = low;
ival[1] = high;
unsigned int base);
EXTERN void m2decl_DetermineSizeOfConstant (location_t location,
const char *str, unsigned int base,
- int *needsLong,
- int *needsUnsigned);
+ bool *needsLong,
+ bool *needsUnsigned);
EXTERN void m2decl_RememberVariables (tree l);
EXTERN tree m2decl_BuildEndFunctionDeclaration (
location_t location_begin, location_t location_end, const char *name,
- tree returntype, int isexternal, int isnested, int ispublic,
- int isnoreturn);
+ tree returntype, bool isexternal, bool isnested, bool ispublic,
+ bool isnoreturn);
EXTERN void m2decl_BuildStartFunctionDeclaration (int uses_varargs);
EXTERN tree m2decl_BuildParameterDeclaration (location_t location, char *name,
- tree type, int isreference);
+ tree type, bool isreference);
EXTERN tree m2decl_DeclareKnownConstant (location_t location, tree type,
tree value);
EXTERN tree m2decl_DeclareKnownVariable (location_t location, const char *name,
- tree type, int exported, int imported,
- int istemporary, int isglobal,
+ tree type, bool exported, bool imported,
+ bool istemporary, bool isglobal,
tree scope, tree initial);
EXTERN tree m2decl_BuildStringConstantType (int length, const char *string,
{
if (m2type_IsAddress (TREE_TYPE (op)))
return m2convert_BuildConvert (location, m2type_GetCardinalAddressType (),
- op, FALSE);
+ op, false);
return op;
}
-/* BuildTruthAndIf return TRUE if a && b. Retain order left to right. */
+/* BuildTruthAndIf return true if a && b. Retain order left to right. */
static tree
m2expr_BuildTruthAndIf (location_t location, tree a, tree b)
{
- return m2expr_build_binary_op (location, TRUTH_ANDIF_EXPR, a, b, FALSE);
+ return m2expr_build_binary_op (location, TRUTH_ANDIF_EXPR, a, b, false);
}
-/* BuildTruthOrIf return TRUE if a || b. Retain order left to right. */
+/* BuildTruthOrIf return true if a || b. Retain order left to right. */
static tree
m2expr_BuildTruthOrIf (location_t location, tree a, tree b)
{
- return m2expr_build_binary_op (location, TRUTH_ORIF_EXPR, a, b, FALSE);
+ return m2expr_build_binary_op (location, TRUTH_ORIF_EXPR, a, b, false);
}
/* BuildTruthNotIf inverts the boolean value of expr and returns the result. */
static tree
m2expr_BuildTruthNot (location_t location, tree expr)
{
- return m2expr_build_unary_op (location, TRUTH_NOT_EXPR, expr, FALSE);
+ return m2expr_build_unary_op (location, TRUTH_NOT_EXPR, expr, false);
}
/* BuildPostInc builds a post increment tree, the second operand is
static tree
m2expr_BuildPostInc (location_t location, tree op)
{
- return m2expr_BuildAdd (location, op, build_int_cst (TREE_TYPE (op), 1), FALSE);
+ return m2expr_BuildAdd (location, op, build_int_cst (TREE_TYPE (op), 1), false);
}
/* BuildPostDec builds a post decrement tree, the second operand is
static tree
m2expr_BuildPostDec (location_t location, tree op)
{
- return m2expr_BuildSub (location, op, build_int_cst (TREE_TYPE (op), 1), FALSE);
+ return m2expr_BuildSub (location, op, build_int_cst (TREE_TYPE (op), 1), false);
}
/* BuildAddCheck builds an addition tree. */
op1 = CheckAddressToCardinal (location, op1);
op2 = CheckAddressToCardinal (location, op2);
- t = m2expr_build_binary_op_check (location, PLUS_EXPR, op1, op2, FALSE,
+ t = m2expr_build_binary_op_check (location, PLUS_EXPR, op1, op2, false,
lowest, min, max);
return m2expr_FoldAndStrip (t);
}
/* BuildAdd builds an addition tree. */
tree
-m2expr_BuildAdd (location_t location, tree op1, tree op2, int needconvert)
+m2expr_BuildAdd (location_t location, tree op1, tree op2, bool needconvert)
{
tree t;
op1 = CheckAddressToCardinal (location, op1);
op2 = CheckAddressToCardinal (location, op2);
- t = m2expr_build_binary_op_check (location, MINUS_EXPR, op1, op2, FALSE,
+ t = m2expr_build_binary_op_check (location, MINUS_EXPR, op1, op2, false,
lowest, min, max);
return m2expr_FoldAndStrip (t);
}
/* BuildSub builds a subtraction tree. */
tree
-m2expr_BuildSub (location_t location, tree op1, tree op2, int needconvert)
+m2expr_BuildSub (location_t location, tree op1, tree op2, bool needconvert)
{
tree t;
/* BuildDivTrunc builds a trunc division tree. */
tree
-m2expr_BuildDivTrunc (location_t location, tree op1, tree op2, int needconvert)
+m2expr_BuildDivTrunc (location_t location, tree op1, tree op2, bool needconvert)
{
tree t;
op1 = CheckAddressToCardinal (location, op1);
op2 = CheckAddressToCardinal (location, op2);
- t = m2expr_build_binary_op_check (location, TRUNC_DIV_EXPR, op1, op2, FALSE,
+ t = m2expr_build_binary_op_check (location, TRUNC_DIV_EXPR, op1, op2, false,
lowest, min, max);
return m2expr_FoldAndStrip (t);
}
op1 = CheckAddressToCardinal (location, op1);
op2 = CheckAddressToCardinal (location, op2);
- t = m2expr_build_binary_op_check (location, TRUNC_MOD_EXPR, op1, op2, FALSE,
+ t = m2expr_build_binary_op_check (location, TRUNC_MOD_EXPR, op1, op2, false,
lowest, min, max);
return m2expr_FoldAndStrip (t);
}
/* BuildModTrunc builds a trunc modulus tree. */
tree
-m2expr_BuildModTrunc (location_t location, tree op1, tree op2, int needconvert)
+m2expr_BuildModTrunc (location_t location, tree op1, tree op2, bool needconvert)
{
tree t;
op1 = CheckAddressToCardinal (location, op1);
op2 = CheckAddressToCardinal (location, op2);
- t = m2expr_build_binary_op_check (location, CEIL_MOD_EXPR, op1, op2, FALSE,
+ t = m2expr_build_binary_op_check (location, CEIL_MOD_EXPR, op1, op2, false,
lowest, min, max);
return m2expr_FoldAndStrip (t);
}
op1 = CheckAddressToCardinal (location, op1);
op2 = CheckAddressToCardinal (location, op2);
- t = m2expr_build_binary_op_check (location, FLOOR_MOD_EXPR, op1, op2, FALSE,
+ t = m2expr_build_binary_op_check (location, FLOOR_MOD_EXPR, op1, op2, false,
lowest, min, max);
return m2expr_FoldAndStrip (t);
}
/* BuildDivCeil builds a ceil division tree. */
tree
-m2expr_BuildDivCeil (location_t location, tree op1, tree op2, int needconvert)
+m2expr_BuildDivCeil (location_t location, tree op1, tree op2, bool needconvert)
{
tree t;
op1 = CheckAddressToCardinal (location, op1);
op2 = CheckAddressToCardinal (location, op2);
- t = m2expr_build_binary_op_check (location, CEIL_DIV_EXPR, op1, op2, FALSE,
+ t = m2expr_build_binary_op_check (location, CEIL_DIV_EXPR, op1, op2, false,
lowest, min, max);
return m2expr_FoldAndStrip (t);
}
/* BuildModCeil builds a ceil modulus tree. */
tree
-m2expr_BuildModCeil (location_t location, tree op1, tree op2, int needconvert)
+m2expr_BuildModCeil (location_t location, tree op1, tree op2, bool needconvert)
{
tree t;
/* BuildDivFloor builds a floor division tree. */
tree
-m2expr_BuildDivFloor (location_t location, tree op1, tree op2, int needconvert)
+m2expr_BuildDivFloor (location_t location, tree op1, tree op2, bool needconvert)
{
tree t;
op1 = CheckAddressToCardinal (location, op1);
op2 = CheckAddressToCardinal (location, op2);
- t = m2expr_build_binary_op_check (location, FLOOR_DIV_EXPR, op1, op2, FALSE,
+ t = m2expr_build_binary_op_check (location, FLOOR_DIV_EXPR, op1, op2, false,
lowest, min, max);
return m2expr_FoldAndStrip (t);
}
REAL and COMPLEX types and NEVER for integer based types). */
tree
-m2expr_BuildRDiv (location_t location, tree op1, tree op2, int needconvert)
+m2expr_BuildRDiv (location_t location, tree op1, tree op2, bool needconvert)
{
tree t;
/* BuildModFloor builds a modulus tree. */
tree
-m2expr_BuildModFloor (location_t location, tree op1, tree op2, int needconvert)
+m2expr_BuildModFloor (location_t location, tree op1, tree op2, bool needconvert)
{
tree t;
/* BuildLSL builds and returns tree (op1 << op2). */
tree
-m2expr_BuildLSL (location_t location, tree op1, tree op2, int needconvert)
+m2expr_BuildLSL (location_t location, tree op1, tree op2, bool needconvert)
{
tree t;
/* BuildLSR builds and returns tree (op1 >> op2). */
tree
-m2expr_BuildLSR (location_t location, tree op1, tree op2, int needconvert)
+m2expr_BuildLSR (location_t location, tree op1, tree op2, bool needconvert)
{
tree t;
void
m2expr_BuildLogicalShift (location_t location, tree op1, tree op2, tree op3,
- tree nBits ATTRIBUTE_UNUSED, int needconvert)
+ tree nBits ATTRIBUTE_UNUSED, bool needconvert)
{
tree res;
res = m2expr_BuildLSL (location, op2, m2convert_ToWord (location, op3),
needconvert);
res = m2convert_BuildConvert (
- location, m2tree_skip_type_decl (TREE_TYPE (op1)), res, FALSE);
+ location, m2tree_skip_type_decl (TREE_TYPE (op1)), res, false);
m2statement_BuildAssignmentTree (location, op1, res);
}
else
op3 = m2convert_ToWord (location, op3);
res = m2expr_BuildLSL (location, op2, op3, needconvert);
res = m2convert_BuildConvert (
- location, m2tree_skip_type_decl (TREE_TYPE (op1)), res, FALSE);
+ location, m2tree_skip_type_decl (TREE_TYPE (op1)), res, false);
m2statement_BuildAssignmentTree (location, op1, res);
m2statement_BuildGoto (location, labelEndName);
m2statement_DeclareLabel (location, labelElseName);
m2expr_BuildNegate (location, op3, needconvert),
needconvert);
res = m2convert_BuildConvert (
- location, m2tree_skip_type_decl (TREE_TYPE (op1)), res, FALSE);
+ location, m2tree_skip_type_decl (TREE_TYPE (op1)), res, false);
m2statement_BuildAssignmentTree (location, op1, res);
m2statement_DeclareLabel (location, labelEndName);
}
/* BuildLRL builds and returns tree (op1 rotate left by op2 bits). */
tree
-m2expr_BuildLRL (location_t location, tree op1, tree op2, int needconvert)
+m2expr_BuildLRL (location_t location, tree op1, tree op2, bool needconvert)
{
tree t;
/* BuildLRR builds and returns tree (op1 rotate right by op2 bits). */
tree
-m2expr_BuildLRR (location_t location, tree op1, tree op2, int needconvert)
+m2expr_BuildLRR (location_t location, tree op1, tree op2, bool needconvert)
{
tree t;
It assumes nBits is <= TSIZE (WORD). */
tree
-m2expr_BuildMask (location_t location, tree nBits, int needconvert)
+m2expr_BuildMask (location_t location, tree nBits, bool needconvert)
{
tree mask = m2expr_BuildLSL (location, m2expr_GetIntegerOne (location),
nBits, needconvert);
tree
m2expr_BuildLRotate (location_t location, tree op1, tree nBits,
- int needconvert)
+ bool needconvert)
{
tree t;
tree
m2expr_BuildRRotate (location_t location, tree op1, tree nBits,
- int needconvert)
+ bool needconvert)
{
tree t;
tree
m2expr_BuildLRLn (location_t location, tree op1, tree op2, tree nBits,
- int needconvert)
+ bool needconvert)
{
tree op2min;
tree
m2expr_BuildLRRn (location_t location, tree op1, tree op2, tree nBits,
- int needconvert)
+ bool needconvert)
{
tree op2min;
void
m2expr_BuildLogicalRotate (location_t location, tree op1, tree op2, tree op3,
- tree nBits, int needconvert)
+ tree nBits, bool needconvert)
{
tree res;
void
m2expr_BuildBinarySetDo (location_t location, tree settype, tree op1, tree op2,
tree op3, void (*binop) (location_t, tree, tree, tree,
- tree, int),
- int is_op1lvalue, int is_op2lvalue, int is_op3lvalue,
+ tree, bool),
+ bool is_op1lvalue, bool is_op2lvalue, bool is_op3lvalue,
tree nBits, tree unbounded, tree varproc,
tree leftproc, tree rightproc)
{
tree size = m2expr_GetSizeOf (location, settype);
- int is_const = FALSE;
- int is_left = FALSE;
+ int is_const = false;
+ int is_left = false;
m2assert_AssertLocation (location);
m2treelib_get_rvalue (location, op1, settype, is_op1lvalue),
m2treelib_get_rvalue (location, op2, settype, is_op2lvalue),
m2treelib_get_rvalue (location, op3, settype, is_op3lvalue),
- nBits, FALSE);
+ nBits, false);
else
{
tree result;
m2expr_BuildDivTrunc (
location, size,
m2expr_GetSizeOf (location, m2type_GetBitsetType ()),
- FALSE)),
- m2expr_GetCardinalOne (location), FALSE);
+ false)),
+ m2expr_GetCardinalOne (location), false);
/* If op3 is constant then make op3 positive and remember which
direction we are shifting. */
op3 = m2tree_skip_const_decl (op3);
if (TREE_CODE (op3) == INTEGER_CST)
{
- is_const = TRUE;
+ is_const = true;
if (tree_int_cst_sgn (op3) < 0)
- op3 = m2expr_BuildNegate (location, op3, FALSE);
+ op3 = m2expr_BuildNegate (location, op3, false);
else
- is_left = TRUE;
+ is_left = true;
op3 = m2convert_BuildConvert (location, m2type_GetM2CardinalType (),
- op3, FALSE);
+ op3, false);
}
/* These parameters must match the prototypes of the procedures:
m2treelib_get_rvalue (location, op3,
m2tree_skip_type_decl (TREE_TYPE (op3)),
is_op3lvalue),
- FALSE));
+ false));
/* Parameter 3 nBits. */
m2statement_BuildParam (
location,
m2convert_BuildConvert (location, m2type_GetM2CardinalType (),
- m2expr_FoldAndStrip (nBits), FALSE));
+ m2expr_FoldAndStrip (nBits), false));
/* Parameter 2 destination set. */
m2statement_BuildParam (
pedwarn (input_location, OPT_Woverflow, "overflow in constant expression");
}
-/* TreeOverflow return TRUE if the contant expression, t, has caused
+/* TreeOverflow return true if the contant expression, t, has caused
an overflow. No error message or warning is emitted and no
modification is made to, t. */
|| (TREE_CODE (t) == COMPLEX_CST
&& TREE_CODE (TREE_REALPART (t)) == INTEGER_CST))
&& TREE_OVERFLOW (t))
- return TRUE;
+ return true;
else if ((TREE_CODE (t) == REAL_CST
|| (TREE_CODE (t) == COMPLEX_CST
&& TREE_CODE (TREE_REALPART (t)) == REAL_CST))
&& TREE_OVERFLOW (t))
- return TRUE;
+ return true;
else
- return FALSE;
+ return false;
}
/* RemoveOverflow if tree, t, is a constant expression it removes any
if (m2expr_CompareTrees (min, m2expr_GetIntegerZero (location)) >= 0)
/* min is greater than or equal to zero therefore value will always
be >= 0. */
- return m2expr_GetIntegerZero (location);
+ return m2type_GetBooleanFalse ();
else if (m2expr_CompareTrees (max, m2expr_GetIntegerZero (location)) == -1)
/* max is less than zero therefore value will always be < 0. */
- return m2expr_GetIntegerOne (location);
+ return m2type_GetBooleanTrue ();
/* We now know 0 lies in the range min..max so we can safely cast
zero to type. */
return m2expr_BuildLessThan (
{
if (m2expr_CompareTrees (min, m2expr_GetIntegerZero (location)) == 1)
/* min is greater than zero therefore value will always be > 0. */
- return m2expr_GetIntegerOne (location);
+ return m2type_GetBooleanTrue ();
else if (m2expr_CompareTrees (max, m2expr_GetIntegerZero (location)) <= 0)
/* max is less than or equal to zero therefore value will always be
<= 0. */
- return m2expr_GetIntegerZero (location);
+ return m2type_GetBooleanFalse ();
/* We now know 0 lies in the range min..max so we can safely cast
zero to type. */
return m2expr_BuildGreaterThan (
{
if (m2expr_CompareTrees (min, m2expr_GetIntegerZero (location)) == 1)
/* min is greater than zero therefore value will always be > 0. */
- return m2expr_GetIntegerZero (location);
+ return m2type_GetBooleanFalse ();
else if (m2expr_CompareTrees (max, m2expr_GetIntegerZero (location)) < 0)
/* max is less than or equal to zero therefore value will always be <
0. */
- return m2expr_GetIntegerZero (location);
+ return m2type_GetBooleanFalse ();
/* We now know 0 lies in the range min..max so we can safely cast
zero to type. */
return m2expr_BuildEqualTo (
{
if (m2expr_CompareTrees (min, m2expr_GetIntegerZero (location)) == 1)
/* min is greater than zero therefore value will always be true. */
- return m2expr_GetIntegerOne (location);
+ return m2type_GetBooleanTrue ();
else if (m2expr_CompareTrees (max, m2expr_GetIntegerZero (location)) < 0)
/* max is less than or equal to zero therefore value will always be
true. */
- return m2expr_GetIntegerOne (location);
+ return m2type_GetBooleanTrue ();
/* We now know 0 lies in the range min..max so we can safely cast
zero to type. */
return m2expr_BuildNotEqualTo (
{
if (m2expr_CompareTrees (min, m2expr_GetIntegerZero (location)) >= 0)
/* min is greater than or equal to zero therefore value will always be >= 0. */
- return m2expr_GetIntegerOne (location);
+ return m2type_GetBooleanTrue ();
else if (m2expr_CompareTrees (max, m2expr_GetIntegerZero (location)) < 0)
/* max is less than zero therefore value will always be < 0. */
- return m2expr_GetIntegerZero (location);
+ return m2type_GetBooleanFalse ();
/* We now know 0 lies in the range min..max so we can safely cast
zero to type. */
return m2expr_BuildGreaterThan (
{
if (m2expr_CompareTrees (min, m2expr_GetIntegerZero (location)) > 0)
/* min is greater than zero therefore value will always be > 0. */
- return m2expr_GetIntegerZero (location);
+ return m2type_GetBooleanFalse ();
else if (m2expr_CompareTrees (max, m2expr_GetIntegerZero (location)) <= 0)
/* max is less than or equal to zero therefore value will always be <= 0. */
- return m2expr_GetIntegerOne (location);
+ return m2type_GetBooleanTrue ();
/* We now know 0 lies in the range min..max so we can safely cast
zero to type. */
return m2expr_BuildLessThanOrEqual (
tree c8 = m2expr_BuildGreaterThanZero (location, max, type, min,
max); /* max > 0. */
tree c9 = m2expr_BuildGreaterThanZero (
- location, m2expr_BuildAdd (location, min, max, FALSE), type, min,
+ location, m2expr_BuildAdd (location, min, max, false), type, min,
max); /* min + max > 0. */
tree c10 = m2expr_BuildGreaterThan (
- location, i, m2expr_BuildNegate (location, min, FALSE)); /* i > -min. */
+ location, i, m2expr_BuildNegate (location, min, false)); /* i > -min. */
tree c11 = m2expr_BuildLessThanZero (
- location, m2expr_BuildAdd (location, min, max, FALSE), type, min,
+ location, m2expr_BuildAdd (location, min, max, false), type, min,
max); /* min + max < 0. */
tree c12 = m2expr_BuildLessThan (
- location, i, m2expr_BuildNegate (location, max, FALSE)); /* i < -max. */
+ location, i, m2expr_BuildNegate (location, max, false)); /* i < -max. */
tree b1 = m2expr_BuildTruthOrIf (location, c1, c2);
tree b2 = m2expr_BuildTruthOrIf (location, c8, c5);
{
tree j_gt_zero = m2expr_BuildGreaterThanZero (location, j, lowest, min, max);
tree i_gt_max_sub_j = m2expr_BuildGreaterThan (
- location, i, m2expr_BuildSub (location, max, j, FALSE));
+ location, i, m2expr_BuildSub (location, max, j, false));
tree j_lt_zero = m2expr_BuildLessThanZero (location, j, lowest, min, max);
tree i_lt_min_sub_j = m2expr_BuildLessThan (location, i,
- m2expr_BuildSub (location, min, j, FALSE));
+ m2expr_BuildSub (location, min, j, false));
tree lhs_or = m2expr_FoldAndStrip (m2expr_BuildTruthAndIf (location, j_gt_zero, i_gt_max_sub_j));
tree rhs_or = m2expr_FoldAndStrip (m2expr_BuildTruthAndIf (location, j_lt_zero, i_lt_min_sub_j));
tree condition
{
tree c1 = m2expr_BuildGreaterThanZero (location, j, lowest, min, max);
tree c2 = m2expr_BuildLessThan (location, i,
- m2expr_BuildAdd (location, min, j, FALSE));
+ m2expr_BuildAdd (location, min, j, false));
tree c3 = m2expr_BuildLessThanZero (location, j, lowest, min, max);
tree c4 = m2expr_BuildGreaterThan (location, i,
- m2expr_BuildAdd (location, max, j, FALSE));
+ m2expr_BuildAdd (location, max, j, false));
tree c5 = m2expr_FoldAndStrip (m2expr_BuildTruthAndIf (location, c1, c2));
tree c6 = m2expr_FoldAndStrip (m2expr_BuildTruthAndIf (location, c3, c4));
tree condition
return t;
}
-/* Build4TruthAndIf - return TRUE if a && b && c && d. Retain order left to
+/* Build4TruthAndIf - return true if a && b && c && d. Retain order left to
* right. */
static tree
return m2expr_FoldAndStrip (m2expr_BuildTruthAndIf (location, t2, d));
}
-/* Build3TruthAndIf - return TRUE if a && b && c. Retain order left to right.
+/* Build3TruthAndIf - return true if a && b && c. Retain order left to right.
*/
static tree
return m2expr_FoldAndStrip (m2expr_BuildTruthAndIf (location, t, op3));
}
-/* Build3TruthOrIf - return TRUE if a || b || c. Retain order left to right.
+/* Build3TruthOrIf - return true if a || b || c. Retain order left to right.
*/
static tree
return m2expr_FoldAndStrip (m2expr_BuildTruthOrIf (location, t, op3));
}
-/* Build4TruthOrIf - return TRUE if op1 || op2 || op3 || op4. Retain order
+/* Build4TruthOrIf - return true if op1 || op2 || op3 || op4. Retain order
left to right. */
static tree
return m2expr_FoldAndStrip (m2expr_BuildTruthOrIf (location, t2, op4));
}
-/* Build4LogicalOr - return TRUE if op1 || op2 || op3 || op4. */
+/* Build4LogicalOr - return true if op1 || op2 || op3 || op4. */
static tree
m2expr_Build4LogicalOr (location_t location, tree op1, tree op2, tree op3,
tree op4)
{
tree t1 = m2expr_FoldAndStrip (
- m2expr_BuildLogicalOr (location, op1, op2, FALSE));
+ m2expr_BuildLogicalOr (location, op1, op2, false));
tree t2
- = m2expr_FoldAndStrip (m2expr_BuildLogicalOr (location, t1, op3, FALSE));
+ = m2expr_FoldAndStrip (m2expr_BuildLogicalOr (location, t1, op3, false));
return m2expr_FoldAndStrip (
- m2expr_BuildLogicalOr (location, t2, op4, FALSE));
+ m2expr_BuildLogicalOr (location, t2, op4, false));
}
/* checkWholeMultOverflow - check to see whether i * j will overflow
tree c3 = m2expr_BuildGreaterThanZero (location, rhs, lowest, min, max);
tree c4 = m2expr_BuildGreaterThan (
- location, lhs, m2expr_BuildDivTrunc (location, max, rhs, FALSE));
+ location, lhs, m2expr_BuildDivTrunc (location, max, rhs, false));
tree c5 = m2expr_BuildLessThanZero (location, rhs, lowest, min, max);
tree c6 = m2expr_BuildLessThan (
- location, rhs, m2expr_BuildDivTrunc (location, min, lhs, FALSE));
+ location, rhs, m2expr_BuildDivTrunc (location, min, lhs, false));
tree c7 = m2expr_BuildLessThan (
- location, lhs, m2expr_BuildDivTrunc (location, min, rhs, FALSE));
+ location, lhs, m2expr_BuildDivTrunc (location, min, rhs, false));
tree c8 = m2expr_BuildLessThan (
- location, lhs, m2expr_BuildDivTrunc (location, max, rhs, FALSE));
+ location, lhs, m2expr_BuildDivTrunc (location, max, rhs, false));
tree c9 = m2expr_Build3TruthAndIf (location, c1, c3, c4);
tree c10 = m2expr_Build3TruthAndIf (location, c1, c5, c6);
static tree
divMinUnderflow (location_t location, tree value, tree lowest, tree min, tree max)
{
- tree min2 = m2expr_BuildMult (location, min, min, FALSE);
+ tree min2 = m2expr_BuildMult (location, min, min, false);
tree rhs = m2expr_BuildGreaterThanOrEqual (location, value, min2);
tree lhs = testWholeMultOverflow (location, min, min, lowest, min, max);
return m2expr_BuildTruthAndIf (location, lhs, rhs);
tree b5 = m2expr_BuildTruthAndIf (location, b5a, b4b);
tree c1 = m2expr_BuildEqualToZero (location, j, lowest, min, max);
tree c2 = m2expr_BuildLessThanZero (location, max, lowest, min, max);
- tree i_lt_j_mult_min = m2expr_BuildLessThan (location, i, m2expr_BuildMult (location, j, min, FALSE));
+ tree i_lt_j_mult_min = m2expr_BuildLessThan (location, i, m2expr_BuildMult (location, j, min, false));
tree j_mult_min_overflow = testWholeMultOverflow (location, j, min, lowest, min, max);
tree b6 = m2expr_BuildTruthOrIf (location, j_mult_min_overflow, i_lt_j_mult_min);
tree c3 = m2expr_BuildTruthAndIf (location, b4, b6);
- tree s1 = m2expr_BuildDivTrunc (location, i, min, FALSE);
- tree s2 = m2expr_BuildDivTrunc (location, i, max, FALSE);
- tree s3 = m2expr_BuildDivTrunc (location, i, j, FALSE);
+ tree s1 = m2expr_BuildDivTrunc (location, i, min, false);
+ tree s2 = m2expr_BuildDivTrunc (location, i, max, false);
+ tree s3 = m2expr_BuildDivTrunc (location, i, j, false);
tree j_gt_s1 = m2expr_BuildGreaterThan (location, j, s1);
tree i_div_min_overflow = divMinUnderflow (location, i, lowest, min, max);
(*
divCeilOverflowCases - precondition: i, j are in range values.
- postcondition: TRUE is returned if i divceil will
+ postcondition: true is returned if i divceil will
result in an overflow/underflow.
*)
(*
divCeilOverflowPosPos - precondition: i, j are legal and are both >= 0.
- postcondition: TRUE is returned if i divceil will
+ postcondition: true is returned if i divceil will
result in an overflow/underflow.
*)
(*
divCeilOverflowNegNeg - precondition: i, j are in range values and both < 0.
- postcondition: TRUE is returned if i divceil will
+ postcondition: true is returned if i divceil will
result in an overflow/underflow.
*)
(*
divCeilOverflowNegPos - precondition: i, j are in range values. i < 0, j >= 0.
- postcondition: TRUE is returned if i divceil will
+ postcondition: true is returned if i divceil will
result in an overflow/underflow.
*)
(*
divCeilOverflowPosNeg - precondition: i, j are in range values. i >= 0, j < 0.
- postcondition: TRUE is returned if i divceil will
+ postcondition: true is returned if i divceil will
result in an overflow/underflow.
*)
divCeilOverflowPosPos (location_t location, tree i, tree j, tree lowest,
tree min, tree max)
{
- tree i_mod_j = m2expr_BuildModTrunc (location, i, j, FALSE);
+ tree i_mod_j = m2expr_BuildModTrunc (location, i, j, false);
tree i_mod_j_eq_zero = m2expr_BuildEqualToZero (location, i_mod_j, lowest, min, max);
tree i_mod_j_ne_zero = m2expr_BuildNotEqualToZero (location, i_mod_j, lowest, min, max);
- tree j_min = m2expr_BuildMult (location, j, min, FALSE);
- tree j_min_1 = m2expr_BuildAdd (location, j_min, m2expr_GetIntegerOne (location), FALSE);
+ tree j_min = m2expr_BuildMult (location, j, min, false);
+ tree j_min_1 = m2expr_BuildAdd (location, j_min, m2expr_GetIntegerOne (location), false);
tree i_lt_j_min = m2expr_BuildLessThan (location, i, j_min);
tree i_lt_j_min_1 = m2expr_BuildLessThan (location, i, j_min_1);
tree a = m2expr_BuildTruthAndIf (location, i_mod_j_eq_zero, i_lt_j_min);
divCeilOverflowPosNeg (location_t location, tree i, tree j, tree lowest, tree min, tree max)
{
tree abs_j = m2expr_BuildAbs (location, j);
- tree i_mod_abs_j = m2expr_BuildModFloor (location, i, abs_j, FALSE);
+ tree i_mod_abs_j = m2expr_BuildModFloor (location, i, abs_j, false);
tree i_mod_abs_j_eq_0 = m2expr_BuildEqualToZero (location, i_mod_abs_j, lowest, min, max);
tree i_mod_abs_j_ne_0 = m2expr_BuildNotEqualToZero (location, i_mod_abs_j, lowest, min, max);
- tree j_mult_min = m2expr_BuildMult (location, j, min, FALSE);
+ tree j_mult_min = m2expr_BuildMult (location, j, min, false);
tree j_mult_min_1 = m2expr_BuildPostDec (location, j_mult_min);
tree i_gt_j_mult_min = m2expr_BuildGreaterThan (location, i, j_mult_min);
tree i_gt_j_mult_min_1 = m2expr_BuildGreaterThan (location, i, j_mult_min_1);
divCeilOverflowNegPos (location_t location, tree i, tree j, tree lowest, tree min, tree max)
{
tree abs_i = m2expr_BuildAbs (location, i);
- tree abs_i_mod_j = m2expr_BuildModFloor (location, abs_i, j, FALSE);
+ tree abs_i_mod_j = m2expr_BuildModFloor (location, abs_i, j, false);
tree abs_i_mod_j_eq_0 = m2expr_BuildEqualToZero (location, abs_i_mod_j, lowest, min, max);
tree abs_i_mod_j_ne_0 = m2expr_BuildNotEqualToZero (location, abs_i_mod_j, lowest, min, max);
- tree j_mult_min = m2expr_BuildMult (location, j, min, FALSE);
+ tree j_mult_min = m2expr_BuildMult (location, j, min, false);
tree j_mult_min_1 = m2expr_BuildPostDec (location, j_mult_min);
tree i_lt_j_mult_min = m2expr_BuildLessThan (location, i, j_mult_min);
tree i_lt_j_mult_min_1 = m2expr_BuildLessThan (location, i, j_mult_min_1);
tree max_lte_0 = m2expr_BuildLessThanOrEqualZero (location, max, lowest, min, max);
tree abs_i = m2expr_BuildAbs (location, i);
tree abs_j = m2expr_BuildAbs (location, j);
- tree abs_i_mod_abs_j = m2expr_BuildModFloor (location, abs_i, abs_j, FALSE);
+ tree abs_i_mod_abs_j = m2expr_BuildModFloor (location, abs_i, abs_j, false);
tree abs_i_mod_abs_j_eq_0 = m2expr_BuildEqualToZero (location, abs_i_mod_abs_j,
lowest, min, max);
tree abs_i_mod_abs_j_ne_0 = m2expr_BuildNotEqualToZero (location, abs_i_mod_abs_j,
lowest, min, max);
- tree j_mult_min = m2expr_BuildMult (location, j, min, FALSE);
+ tree j_mult_min = m2expr_BuildMult (location, j, min, false);
tree j_mult_min_1 = m2expr_BuildPostDec (location, j_mult_min);
tree i_ge_j_mult_min = m2expr_BuildGreaterThanOrEqual (location, i, j_mult_min);
tree i_ge_j_mult_min_1 = m2expr_BuildGreaterThanOrEqual (location, i, j_mult_min_1);
- tree abs_i_mod_max = m2expr_BuildModFloor (location, abs_i, max, FALSE);
- tree abs_i_div_max = m2expr_BuildDivFloor (location, abs_i, max, FALSE);
+ tree abs_i_mod_max = m2expr_BuildModFloor (location, abs_i, max, false);
+ tree abs_i_div_max = m2expr_BuildDivFloor (location, abs_i, max, false);
tree abs_j_1 = m2expr_BuildPostInc (location, abs_j);
tree abs_i_mod_max_eq_0 = m2expr_BuildEqualToZero (location, abs_i_mod_max, lowest, min, max);
tree abs_i_mod_max_ne_0 = m2expr_BuildNotEqualToZero (location, abs_i_mod_max, lowest, min, max);
tree c2 = m2expr_BuildLessThanZero (location, j, lowest, min, max);
tree c3 = m2expr_BuildNotEqualToZero (location, i, lowest, min, max);
tree c4 = m2expr_BuildLessThanOrEqual (location, j, i);
- tree c6 = m2expr_BuildDivTrunc (location, i, j, FALSE);
- tree c7 = m2expr_BuildSub (location, i, m2expr_BuildMult (location, c6, j, FALSE), FALSE);
+ tree c6 = m2expr_BuildDivTrunc (location, i, j, false);
+ tree c7 = m2expr_BuildSub (location, i, m2expr_BuildMult (location, c6, j, false), false);
tree c5 = m2expr_BuildLessThan (location, c7, min);
tree c8 = m2expr_Build3TruthAndIf (location, c3, c4, c5);
tree condition = m2expr_Build3TruthOrIf (location, c1, c2, c8);
tree min, tree max)
{
tree c1 = m2expr_BuildEqualToZero (location, j, lowest, min, max);
- tree c2 = m2expr_BuildSub (location, i, j, FALSE);
- tree c3 = m2expr_BuildDivCeil (location, i, j, FALSE);
- tree t = m2expr_BuildMult (location, c2, c3, FALSE);
+ tree c2 = m2expr_BuildSub (location, i, j, false);
+ tree c3 = m2expr_BuildDivCeil (location, i, j, false);
+ tree t = m2expr_BuildMult (location, c2, c3, false);
tree c4 = m2expr_BuildGreaterThanOrEqual (location, t, min);
tree c5 = m2expr_BuildLessThanOrEqual (location, t, max);
tree c6 = m2expr_BuildTruthAndIf (location, c4, c5);
tree min, tree max)
{
tree c1 = m2expr_BuildEqualToZero (location, j, lowest, min, max);
- tree c2 = m2expr_BuildSub (location, i, j, FALSE);
- tree c3 = m2expr_BuildDivFloor (location, i, j, FALSE);
- tree t = m2expr_BuildMult (location, c2, c3, FALSE);
+ tree c2 = m2expr_BuildSub (location, i, j, false);
+ tree c3 = m2expr_BuildDivFloor (location, i, j, false);
+ tree t = m2expr_BuildMult (location, c2, c3, false);
tree c4 = m2expr_BuildGreaterThanOrEqual (location, t, min);
tree c5 = m2expr_BuildLessThanOrEqual (location, t, max);
tree c6 = m2expr_BuildTruthAndIf (location, c4, c5);
this code has been hand translated into GCC trees. */
(*
- divFloorOverflow2 - returns TRUE if an overflow will occur
+ divFloorOverflow2 - returns true if an overflow will occur
if i divfloor j is performed.
*)
(*
divFloorOverflowCases - precondition: i, j are in range values.
- postcondition: TRUE is returned if i divfloor will
+ postcondition: true is returned if i divfloor will
result in an overflow/underflow.
*)
(*
divFloorOverflowPosPos - precondition: lhs, rhs are legal and are both >= 0.
- postcondition: TRUE is returned if lhs divfloor rhs will
+ postcondition: true is returned if lhs divfloor rhs will
result in an overflow/underflow.
*)
(*
divFloorOverflowNegNeg - precondition: i, j are in range values and both < 0.
- postcondition: TRUE is returned if i divfloor will
+ postcondition: true is returned if i divfloor will
result in an overflow/underflow.
*)
(*
divFloorOverflowNegPos - precondition: i, j are in range values. i < 0, j >= 0.
- postcondition: TRUE is returned if i divfloor will
+ postcondition: true is returned if i divfloor will
result in an overflow/underflow.
*)
(*
divFloorOverflowPosNeg - precondition: i, j are in range values. i >= 0, j < 0.
- postcondition: TRUE is returned if i divfloor will
+ postcondition: true is returned if i divfloor will
result in an overflow/underflow.
*)
/* divFloorOverflowPosPos, precondition: i, j are legal and are both >= 0.
- Postcondition: TRUE is returned if i divfloor will result in an overflow/underflow.
+ Postcondition: true is returned if i divfloor will result in an overflow/underflow.
A handbuilt expression of trees implementing:
static tree
divFloorOverflowPosPos (location_t location, tree i, tree j, tree min)
{
- tree j_mult_min = m2expr_BuildMult (location, j, min, FALSE);
+ tree j_mult_min = m2expr_BuildMult (location, j, min, false);
tree i_lt_j_mult_min = m2expr_BuildLessThan (location, i, j_mult_min);
return i_lt_j_mult_min;
}
/* divFloorOverflowNegNeg precondition: i, j are in range values and both < 0.
- Postcondition: TRUE is returned if i divfloor j will result in an
+ Postcondition: true is returned if i divfloor j will result in an
overflow/underflow.
A handbuilt expression of trees implementing:
tree max_lte_0 = m2expr_BuildLessThanOrEqualZero (location, max, lowest, min, max);
tree abs_i = m2expr_BuildAbs (location, i);
tree abs_j = m2expr_BuildAbs (location, j);
- tree j_mult_min = m2expr_BuildMult (location, j, min, FALSE);
+ tree j_mult_min = m2expr_BuildMult (location, j, min, false);
tree i_ge_j_mult_min = m2expr_BuildGreaterThanOrEqual (location, i, j_mult_min);
- tree abs_i_div_max = m2expr_BuildDivFloor (location, abs_i, max, FALSE);
+ tree abs_i_div_max = m2expr_BuildDivFloor (location, abs_i, max, false);
tree abs_i_div_max_gt_abs_j = m2expr_BuildGreaterThan (location, abs_i_div_max, abs_j);
return m2expr_Build3TruthOrIf (location, max_lte_0, i_ge_j_mult_min, abs_i_div_max_gt_abs_j);
/* divFloorOverflowPosNeg precondition: i, j are in range values and i >=0, j < 0.
- Postcondition: TRUE is returned if i divfloor j will result in an
+ Postcondition: true is returned if i divfloor j will result in an
overflow/underflow.
A handbuilt expression of trees implementing:
static tree
divFloorOverflowPosNeg (location_t location, tree i, tree j, tree min)
{
- tree j_mult_min = m2expr_BuildMult (location, j, min, FALSE);
- tree j_mult_min_sub_j = m2expr_BuildSub (location, j_mult_min, j, FALSE);
+ tree j_mult_min = m2expr_BuildMult (location, j, min, false);
+ tree j_mult_min_sub_j = m2expr_BuildSub (location, j_mult_min, j, false);
tree i_ge_j_mult_min_sub_j = m2expr_BuildGreaterThanOrEqual (location, i, j_mult_min_sub_j);
return i_ge_j_mult_min_sub_j;
}
/* divFloorOverflowNegPos precondition: i, j are in range values and i < 0, j > 0.
- Postcondition: TRUE is returned if i divfloor j will result in an
+ Postcondition: true is returned if i divfloor j will result in an
overflow/underflow.
A handbuilt expression of trees implementing:
static tree
divFloorOverflowNegPos (location_t location, tree i, tree j, tree min)
{
- tree j_mult_min = m2expr_BuildMult (location, j, min, FALSE);
+ tree j_mult_min = m2expr_BuildMult (location, j, min, false);
tree i_lt_j_mult_min = m2expr_BuildLessThan (location, i, j_mult_min);
return i_lt_j_mult_min;
}
/* divFloorOverflowCases, precondition: i, j are in range values.
- Postcondition: TRUE is returned if i divfloor will result in an
+ Postcondition: true is returned if i divfloor will result in an
overflow/underflow.
A handbuilt expression of trees implementing:
tree
m2expr_build_binary_op_check (location_t location, enum tree_code code,
- tree op1, tree op2, int needconvert, tree lowest,
+ tree op1, tree op2, bool needconvert, tree lowest,
tree min, tree max)
{
tree type1, type2, result;
/* BuildNegate build a negate expression and returns the tree. */
tree
-m2expr_BuildNegate (location_t location, tree op1, int needconvert)
+m2expr_BuildNegate (location_t location, tree op1, bool needconvert)
{
m2assert_AssertLocation (location);
op1 = m2expr_FoldAndStrip (op1);
/* BuildSetNegate build a set negate expression and returns the tree. */
tree
-m2expr_BuildSetNegate (location_t location, tree op1, int needconvert)
+m2expr_BuildSetNegate (location_t location, tree op1, bool needconvert)
{
m2assert_AssertLocation (location);
return m2expr_build_binary_op (
location, BIT_XOR_EXPR,
m2convert_BuildConvert (location, m2type_GetWordType (),
- m2expr_FoldAndStrip (op1), FALSE),
+ m2expr_FoldAndStrip (op1), false),
set_full_complement, needconvert);
}
/* BuildMult build a multiplication tree. */
tree
-m2expr_BuildMult (location_t location, tree op1, tree op2, int needconvert)
+m2expr_BuildMult (location_t location, tree op1, tree op2, bool needconvert)
{
op1 = m2expr_FoldAndStrip (op1);
op2 = m2expr_FoldAndStrip (op2);
op1 = CheckAddressToCardinal (location, op1);
op2 = CheckAddressToCardinal (location, op2);
- t = m2expr_build_binary_op_check (location, MULT_EXPR, op1, op2, FALSE,
+ t = m2expr_build_binary_op_check (location, MULT_EXPR, op1, op2, false,
lowest, min, max);
return m2expr_FoldAndStrip (t);
}
&& (m2expr_CompareTrees (TYPE_MIN_VALUE (type), min) == 0))
return m2expr_BuildMult (location, m2expr_GetSizeOf (location, type),
m2decl_BuildIntegerConstant (BITS_PER_UNIT),
- FALSE);
+ false);
return NULL_TREE;
}
static tree
calcNbits (location_t location, tree min, tree max)
{
- int negative = FALSE;
+ int negative = false;
tree t = testLimits (location, m2type_GetIntegerType (), min, max);
m2assert_AssertLocation (location);
if (m2expr_CompareTrees (min, m2expr_GetIntegerZero (location)) < 0)
{
min = m2expr_BuildAdd (location, min,
- m2expr_GetIntegerOne (location), FALSE);
- min = fold (m2expr_BuildNegate (location, min, FALSE));
- negative = TRUE;
+ m2expr_GetIntegerOne (location), false);
+ min = fold (m2expr_BuildNegate (location, min, false));
+ negative = true;
}
if (m2expr_CompareTrees (max, m2expr_GetIntegerZero (location)) < 0)
{
- max = fold (m2expr_BuildNegate (location, max, FALSE));
- negative = TRUE;
+ max = fold (m2expr_BuildNegate (location, max, false));
+ negative = true;
}
t = noBitsRequired (getMax (min, max));
if (negative)
t = m2expr_BuildAdd (location, t, m2expr_GetIntegerOne (location),
- FALSE);
+ false);
}
return t;
}
case INTEGER_TYPE:
case ENUMERAL_TYPE:
max = m2convert_BuildConvert (location, m2type_GetIntegerType (),
- TYPE_MAX_VALUE (type), FALSE);
+ TYPE_MAX_VALUE (type), false);
min = m2convert_BuildConvert (location, m2type_GetIntegerType (),
- TYPE_MIN_VALUE (type), FALSE);
+ TYPE_MIN_VALUE (type), false);
return calcNbits (location, min, max);
case BOOLEAN_TYPE:
return m2expr_GetIntegerOne (location);
default:
return m2expr_BuildMult (location, m2expr_GetSizeOf (location, type),
m2decl_BuildIntegerConstant (BITS_PER_UNIT),
- FALSE);
+ false);
}
}
tree
m2expr_BuildSize (location_t location, tree op1,
- int needconvert ATTRIBUTE_UNUSED)
+ bool needconvert ATTRIBUTE_UNUSED)
{
m2assert_AssertLocation (location);
return m2expr_GetSizeOf (location, op1);
}
/* BuildAddr return an expression which calculates the address of op1
- and returns the tree. If use_generic is TRUE then create a generic
+ and returns the tree. If use_generic is true then create a generic
pointer type. */
tree
-m2expr_BuildAddr (location_t location, tree op1, int use_generic)
+m2expr_BuildAddr (location_t location, tree op1, bool use_generic)
{
tree type = m2tree_skip_type_decl (TREE_TYPE (op1));
tree ptrType = build_pointer_type (type);
tree
m2expr_BuildOffset1 (location_t location, tree field,
- int needconvert ATTRIBUTE_UNUSED)
+ bool needconvert ATTRIBUTE_UNUSED)
{
m2assert_AssertLocation (location);
return m2expr_BuildOffset (location, DECL_CONTEXT (field), field,
tree
m2expr_BuildOffset (location_t location, tree record, tree field,
- int needconvert ATTRIBUTE_UNUSED)
+ bool needconvert ATTRIBUTE_UNUSED)
{
m2assert_AssertLocation (location);
location, DECL_FIELD_OFFSET (field),
m2expr_BuildDivTrunc (location, DECL_FIELD_BIT_OFFSET (field),
m2decl_BuildIntegerConstant (BITS_PER_UNIT),
- FALSE),
- FALSE),
- FALSE);
+ false),
+ false),
+ false);
else
{
tree r1 = DECL_CONTEXT (field);
location, m2type_GetIntegerType (),
m2expr_BuildAdd (
location, m2expr_BuildOffset (location, r1, field, needconvert),
- m2expr_BuildOffset (location, record, r2, needconvert), FALSE),
- FALSE);
+ m2expr_BuildOffset (location, record, r2, needconvert), false),
+ false);
}
}
tree
m2expr_BuildLogicalOrAddress (location_t location, tree op1, tree op2,
- int needconvert)
+ bool needconvert)
{
m2assert_AssertLocation (location);
return m2expr_build_binary_op (location, BIT_IOR_EXPR, op1, op2,
tree
m2expr_BuildLogicalOr (location_t location, tree op1, tree op2,
- int needconvert)
+ bool needconvert)
{
m2assert_AssertLocation (location);
return m2expr_build_binary_op (
location, BIT_IOR_EXPR,
- m2convert_BuildConvert (location, m2type_GetWordType (), op1, FALSE),
- m2convert_BuildConvert (location, m2type_GetWordType (), op2, FALSE),
+ m2convert_BuildConvert (location, m2type_GetWordType (), op1, false),
+ m2convert_BuildConvert (location, m2type_GetWordType (), op2, false),
needconvert);
}
tree
m2expr_BuildLogicalAnd (location_t location, tree op1, tree op2,
- int needconvert)
+ bool needconvert)
{
m2assert_AssertLocation (location);
return m2expr_build_binary_op (
location, BIT_AND_EXPR,
- m2convert_BuildConvert (location, m2type_GetWordType (), op1, FALSE),
- m2convert_BuildConvert (location, m2type_GetWordType (), op2, FALSE),
+ m2convert_BuildConvert (location, m2type_GetWordType (), op1, false),
+ m2convert_BuildConvert (location, m2type_GetWordType (), op2, false),
needconvert);
}
tree
m2expr_BuildSymmetricDifference (location_t location, tree op1, tree op2,
- int needconvert)
+ bool needconvert)
{
m2assert_AssertLocation (location);
return m2expr_build_binary_op (
location, BIT_XOR_EXPR,
- m2convert_BuildConvert (location, m2type_GetWordType (), op1, FALSE),
- m2convert_BuildConvert (location, m2type_GetWordType (), op2, FALSE),
+ m2convert_BuildConvert (location, m2type_GetWordType (), op1, false),
+ m2convert_BuildConvert (location, m2type_GetWordType (), op2, false),
needconvert);
}
tree
m2expr_BuildLogicalDifference (location_t location, tree op1, tree op2,
- int needconvert)
+ bool needconvert)
{
m2assert_AssertLocation (location);
return m2expr_build_binary_op (
location, BIT_AND_EXPR,
- m2convert_BuildConvert (location, m2type_GetWordType (), op1, FALSE),
+ m2convert_BuildConvert (location, m2type_GetWordType (), op1, false),
m2expr_BuildSetNegate (location, op2, needconvert), needconvert);
}
tree type = TREE_TYPE (t);
if (TREE_CODE (base_type (type)) == BOOLEAN_TYPE)
- return m2convert_BuildConvert (location, unsigned_type_node, t, FALSE);
+ return m2convert_BuildConvert (location, unsigned_type_node, t, false);
else if (TREE_CODE (base_type (type)) == ENUMERAL_TYPE)
- return m2convert_BuildConvert (location, unsigned_type_node, t, FALSE);
+ return m2convert_BuildConvert (location, unsigned_type_node, t, false);
else
return t;
}
if (m2tree_skip_type_decl (TREE_TYPE (op)) == badType)
/* Cannot compare array contents in m2expr_build_binary_op. */
return m2expr_BuildIndirect (
- location, m2expr_BuildAddr (location, op, FALSE), goodType);
+ location, m2expr_BuildAddr (location, op, false), goodType);
return op;
}
m2assert_AssertLocation (location);
return m2expr_build_binary_op (
location, LT_EXPR, boolean_enum_to_unsigned (location, op1),
- boolean_enum_to_unsigned (location, op2), TRUE);
+ boolean_enum_to_unsigned (location, op2), true);
}
/* BuildGreaterThan return a tree which computes >. */
m2assert_AssertLocation (location);
return m2expr_build_binary_op (
location, GT_EXPR, boolean_enum_to_unsigned (location, op1),
- boolean_enum_to_unsigned (location, op2), TRUE);
+ boolean_enum_to_unsigned (location, op2), true);
}
/* BuildLessThanOrEqual return a tree which computes <. */
m2assert_AssertLocation (location);
return m2expr_build_binary_op (
location, LE_EXPR, boolean_enum_to_unsigned (location, op1),
- boolean_enum_to_unsigned (location, op2), TRUE);
+ boolean_enum_to_unsigned (location, op2), true);
}
/* BuildGreaterThanOrEqual return a tree which computes >=. */
m2assert_AssertLocation (location);
return m2expr_build_binary_op (
location, GE_EXPR, boolean_enum_to_unsigned (location, op1),
- boolean_enum_to_unsigned (location, op2), TRUE);
+ boolean_enum_to_unsigned (location, op2), true);
}
/* BuildEqualTo return a tree which computes =. */
m2assert_AssertLocation (location);
return m2expr_build_binary_op (location, EQ_EXPR,
convert_for_comparison (location, op1),
- convert_for_comparison (location, op2), TRUE);
+ convert_for_comparison (location, op2), true);
}
/* BuildEqualNotTo return a tree which computes #. */
m2assert_AssertLocation (location);
return m2expr_build_binary_op (location, NE_EXPR,
convert_for_comparison (location, op1),
- convert_for_comparison (location, op2), TRUE);
+ convert_for_comparison (location, op2), true);
}
/* BuildIsSuperset return a tree which computes: op1 & op2 == op2. */
{
m2assert_AssertLocation (location);
return m2expr_BuildEqualTo (
- location, op2, m2expr_BuildLogicalAnd (location, op1, op2, FALSE));
+ location, op2, m2expr_BuildLogicalAnd (location, op1, op2, false));
}
/* BuildIsNotSuperset return a tree which computes: op1 & op2 != op2. */
{
m2assert_AssertLocation (location);
return m2expr_BuildNotEqualTo (
- location, op2, m2expr_BuildLogicalAnd (location, op1, op2, FALSE));
+ location, op2, m2expr_BuildLogicalAnd (location, op1, op2, false));
}
/* BuildIsSubset return a tree which computes: op1 & op2 == op1. */
{
m2assert_AssertLocation (location);
return m2expr_BuildEqualTo (
- location, op1, m2expr_BuildLogicalAnd (location, op1, op2, FALSE));
+ location, op1, m2expr_BuildLogicalAnd (location, op1, op2, false));
}
/* BuildIsNotSubset return a tree which computes: op1 & op2 != op1. */
{
m2assert_AssertLocation (location);
return m2expr_BuildNotEqualTo (
- location, op1, m2expr_BuildLogicalAnd (location, op1, op2, FALSE));
+ location, op1, m2expr_BuildLogicalAnd (location, op1, op2, false));
}
/* BuildIfConstInVar generates: if constel in varset then goto label. */
/* Calculate the index from the first bit, ie bit 0 represents low value. */
tree index = m2expr_BuildSub (
location, m2convert_BuildConvert (location, m2type_GetIntegerType (),
- varel, FALSE),
- m2convert_BuildConvert (location, m2type_GetIntegerType (), low, FALSE),
- FALSE);
+ varel, false),
+ m2convert_BuildConvert (location, m2type_GetIntegerType (), low, false),
+ false);
m2assert_AssertLocation (location);
/* Which word do we need to fetch? */
tree word_index = m2expr_FoldAndStrip (m2expr_BuildDivTrunc (
location, index, m2decl_BuildIntegerConstant (SET_WORD_SIZE),
- FALSE));
+ false));
/* Calculate the bit in this word. */
tree offset_into_word = m2expr_FoldAndStrip (m2expr_BuildModTrunc (
location, index, m2decl_BuildIntegerConstant (SET_WORD_SIZE),
- FALSE));
+ false));
tree p2 = m2expr_FoldAndStrip (m2expr_BuildMult (
location, word_index,
- m2decl_BuildIntegerConstant (SET_WORD_SIZE / BITS_PER_UNIT), FALSE));
+ m2decl_BuildIntegerConstant (SET_WORD_SIZE / BITS_PER_UNIT), false));
/* Calculate the address of the word we are interested in. */
p1 = m2expr_BuildAddAddress (location,
/* Calculate the index from the first bit, ie bit 0 represents low value. */
tree index = m2expr_BuildSub (
location, m2convert_BuildConvert (location, m2type_GetIntegerType (),
- m2expr_FoldAndStrip (varel), FALSE),
+ m2expr_FoldAndStrip (varel), false),
m2convert_BuildConvert (location, m2type_GetIntegerType (),
- m2expr_FoldAndStrip (low), FALSE),
- FALSE);
+ m2expr_FoldAndStrip (low), false),
+ false);
index = m2expr_FoldAndStrip (index);
m2assert_AssertLocation (location);
/* Which word do we need to fetch? */
tree word_index = m2expr_FoldAndStrip (m2expr_BuildDivTrunc (
location, index, m2decl_BuildIntegerConstant (SET_WORD_SIZE),
- FALSE));
+ false));
/* Calculate the bit in this word. */
tree offset_into_word = m2expr_FoldAndStrip (m2expr_BuildModTrunc (
location, index, m2decl_BuildIntegerConstant (SET_WORD_SIZE),
- FALSE));
+ false));
tree p2 = m2expr_FoldAndStrip (m2expr_BuildMult (
location, word_index,
- m2decl_BuildIntegerConstant (SET_WORD_SIZE / BITS_PER_UNIT), FALSE));
+ m2decl_BuildIntegerConstant (SET_WORD_SIZE / BITS_PER_UNIT), false));
/* Calculate the address of the word we are interested in. */
p1 = m2expr_BuildAddAddress (location, p1, p2);
m2expr_build_binary_op (
location, TRUTH_ANDIF_EXPR,
m2expr_BuildGreaterThanOrEqual (location, var, low),
- m2expr_BuildLessThanOrEqual (location, var, high), FALSE),
+ m2expr_BuildLessThanOrEqual (location, var, high), false),
NULL, label);
}
location, m2expr_build_binary_op (
location, TRUTH_ORIF_EXPR,
m2expr_BuildLessThan (location, var, low),
- m2expr_BuildGreaterThan (location, var, high), FALSE),
+ m2expr_BuildGreaterThan (location, var, high), false),
NULL, label);
}
// ASSERT_CONDITION (low_indice == TYPE_MIN_VALUE (index_type));
low_indice
- = m2convert_BuildConvert (location, index_type, low_indice, FALSE);
+ = m2convert_BuildConvert (location, index_type, low_indice, false);
return build4_loc (location, ARRAY_REF, type, array, index, low_indice,
NULL_TREE);
}
m2assert_AssertLocation (location);
return build1 (INDIRECT_REF, t1,
- m2convert_BuildConvert (location, t2, target, FALSE));
+ m2convert_BuildConvert (location, t2, target, false));
}
-/* IsTrue - returns TRUE if, t, is known to be TRUE. */
+/* IsTrue - returns true if, t, is known to be true. */
int
m2expr_IsTrue (tree t)
return (m2expr_FoldAndStrip (t) == m2type_GetBooleanTrue ());
}
-/* IsFalse - returns FALSE if, t, is known to be FALSE. */
+/* IsFalse - returns false if, t, is known to be false. */
int
m2expr_IsFalse (tree t)
}
/* AreConstantsEqual - maps onto tree.cc (tree_int_cst_equal). It
- returns TRUE if the value of e1 is the same as e2. */
+ returns true if the value of e1 is the same as e2. */
int
m2expr_AreConstantsEqual (tree e1, tree e2)
return tree_int_cst_equal (e1, e2) != 0;
}
-/* AreRealOrComplexConstantsEqual - returns TRUE if constants, e1 and
+/* AreRealOrComplexConstantsEqual - returns true if constants, e1 and
e2 are equal according to IEEE rules. This does not perform bit
equivalence for example IEEE states that -0 == 0 and NaN != NaN. */
tree
m2expr_BuildDivM2 (location_t location, tree op1, tree op2,
- unsigned int needsconvert)
+ bool needsconvert)
{
op1 = m2expr_FoldAndStrip (op1);
op2 = m2expr_FoldAndStrip (op2);
m2expr_BuildLessThan (
location, op2,
m2convert_BuildConvert (location, TREE_TYPE (op2),
- m2expr_GetIntegerZero (location), FALSE)),
+ m2expr_GetIntegerZero (location), false)),
m2expr_BuildDivCeil (location, op1, op2, needsconvert),
m2expr_BuildDivFloor (location, op1, op2, needsconvert));
else
m2expr_BuildLessThan (
location, op2,
m2convert_BuildConvert (location, TREE_TYPE (op2),
- m2expr_GetIntegerZero (location), FALSE)),
+ m2expr_GetIntegerZero (location), false)),
m2expr_BuildDivCeilCheck (location, op1, op2, lowest, min, max),
m2expr_BuildDivFloorCheck (location, op1, op2, lowest, min, max));
else
{
tree cond = m2expr_BuildLessThan (location, op2,
m2convert_BuildConvert (location, TREE_TYPE (op2),
- m2expr_GetIntegerZero (location), FALSE));
+ m2expr_GetIntegerZero (location), false));
/* Return the result of the modulus. */
return fold_build3 (COND_EXPR, TREE_TYPE (op1), cond,
tree
m2expr_BuildModM2 (location_t location, tree op1, tree op2,
- unsigned int needsconvert)
+ bool needsconvert)
{
op1 = m2expr_FoldAndStrip (op1);
op2 = m2expr_FoldAndStrip (op2);
m2expr_BuildLessThan (
location, op2,
m2convert_BuildConvert (location, TREE_TYPE (op2),
- m2expr_GetIntegerZero (location), FALSE)),
+ m2expr_GetIntegerZero (location), false)),
m2expr_BuildModCeil (location, op1, op2, needsconvert),
m2expr_BuildModFloor (location, op1, op2, needsconvert));
else
scalor = TREE_TYPE (type);
if (scalor != TREE_TYPE (real))
- real = m2convert_BuildConvert (location, scalor, real, FALSE);
+ real = m2convert_BuildConvert (location, scalor, real, false);
if (scalor != TREE_TYPE (imag))
- imag = m2convert_BuildConvert (location, scalor, imag, FALSE);
+ imag = m2convert_BuildConvert (location, scalor, imag, false);
if ((TREE_CODE (real) == REAL_CST) && (TREE_CODE (imag) == REAL_CST))
return build_complex (type, real, imag);
void
m2expr_BuildBinaryForeachWordDo (location_t location, tree type, tree op1,
tree op2, tree op3,
- tree (*binop) (location_t, tree, tree, int),
- int is_op1lvalue, int is_op2lvalue,
- int is_op3lvalue, int is_op1const,
- int is_op2const, int is_op3const)
+ tree (*binop) (location_t, tree, tree, bool),
+ bool is_op1lvalue, bool is_op2lvalue,
+ bool is_op3lvalue, bool is_op1const,
+ bool is_op2const, bool is_op3const)
{
tree size = m2expr_GetSizeOf (location, type);
location, m2treelib_get_rvalue (location, op1, type, is_op1lvalue),
(*binop) (
location, m2treelib_get_rvalue (location, op2, type, is_op2lvalue),
- m2treelib_get_rvalue (location, op3, type, is_op3lvalue), FALSE));
+ m2treelib_get_rvalue (location, op3, type, is_op3lvalue), false));
else
{
/* Large set size > TSIZE(WORD). */
is_op2lvalue, op2, fieldNo),
m2treelib_get_set_value (location, p3, field3, is_op3const,
is_op3lvalue, op3, fieldNo),
- FALSE));
+ false));
fieldNo++;
field1 = m2treelib_get_field_no (type, op1, is_op1const, fieldNo);
field2 = m2treelib_get_field_no (type, op2, is_op2const, fieldNo);
/* Multiply by 2, 8 or 16. Catching this overflow here means we
don't need to worry about add_high overflowing. */
if (((*high) >> (INT_TYPE_SIZE - shift)) == 0)
- overflow = FALSE;
+ overflow = false;
else
- overflow = TRUE;
+ overflow = true;
res_high = *high << shift;
res_low = *low << shift;
add_high++;
test_high = res_high + add_high;
if (test_high < res_high)
- overflow = TRUE;
+ overflow = true;
*low = res_low + add_low;
*high = res_high + add_high;
unsigned HOST_WIDE_INT *low, HOST_WIDE_INT *high)
{
unsigned const char *p, *end;
- int overflow = FALSE;
+ int overflow = false;
int len;
*low = 0;
static int
append_m2_digit (unsigned int *low, int *high, unsigned int digit,
- unsigned int base, int *needsUnsigned)
+ unsigned int base, bool *needsUnsigned)
{
unsigned int shift;
- int overflow;
+ bool overflow;
int add_high, res_high, test_high;
unsigned int add_low, res_low, test_low;
unsigned int add_uhigh, res_uhigh, test_uhigh;
/* Multiply by 2, 8 or 16. Catching this overflow here means we
don't need to worry about add_high overflowing. */
if (((*high) >> (INT_TYPE_SIZE - shift)) == 0)
- overflow = FALSE;
+ overflow = false;
else
- overflow = TRUE;
+ overflow = true;
res_high = *high << shift;
res_low = *low << shift;
add_uhigh = add_high;
test_uhigh = res_uhigh + add_uhigh;
if (test_uhigh < res_uhigh)
- overflow = TRUE;
+ overflow = true;
else
- *needsUnsigned = TRUE;
+ *needsUnsigned = true;
}
*low = res_low + add_low;
int
m2expr_interpret_m2_integer (const char *str, unsigned int base,
unsigned int *low, int *high,
- int *needsLong, int *needsUnsigned)
+ bool *needsLong, bool *needsUnsigned)
{
const unsigned char *p, *end;
int len;
- *needsLong = FALSE;
- *needsUnsigned = FALSE;
+ *needsLong = false;
+ *needsUnsigned = false;
*low = 0;
*high = 0;
if (ISDIGIT (c) || (base == 16 && ISXDIGIT (c)))
c = hex_value (c);
else
- return FALSE; /* End of string and no overflow found. */
+ return false; /* End of string and no overflow found. */
/* Strict inequality for when max is set to zero. */
if (*low < max)
*low = (*low) * base + c;
else
{
- *needsLong = TRUE;
+ *needsLong = true;
if (append_m2_digit (low, high, c, base,
needsUnsigned))
- return TRUE; /* We have overflowed so bail out. */
+ return true; /* We have overflowed so bail out. */
max = 0; /* From now on we always use append_digit. */
}
}
}
- return FALSE;
+ return false;
}
/* GetSizeOfInBits return the number of bits used to contain, type. */
m2expr_BuildLSL (
location, m2expr_GetWordOne (location),
m2convert_BuildConvert (location, m2type_GetWordType (),
- m2decl_BuildIntegerConstant (i), FALSE),
- FALSE),
- FALSE);
+ m2decl_BuildIntegerConstant (i), false),
+ false),
+ false);
}
return value;
}
EXTERN void m2expr_BuildBinaryForeachWordDo (
location_t location, tree type, tree op1, tree op2, tree op3,
- tree (*binop) (location_t, tree, tree, int), int is_op1lvalue,
- int is_op2lvalue, int is_op3lvalue, int is_op1const, int is_op2const,
- int is_op3const);
+ tree (*binop) (location_t, tree, tree, bool), bool is_op1lvalue,
+ bool is_op2lvalue, bool is_op3lvalue, bool is_op1const, bool is_op2const,
+ bool is_op3const);
EXTERN tree m2expr_BuildCmplx (location_t location, tree type, tree real,
tree imag);
EXTERN tree m2expr_BuildIm (tree op1);
EXTERN tree m2expr_BuildGreaterThan (location_t location, tree op1, tree op2);
EXTERN tree m2expr_BuildLessThan (location_t location, tree op1, tree op2);
EXTERN tree m2expr_BuildLogicalDifference (location_t location, tree op1,
- tree op2, int needconvert);
+ tree op2, bool needconvert);
EXTERN tree m2expr_BuildSymmetricDifference (location_t location, tree op1,
- tree op2, int needconvert);
+ tree op2, bool needconvert);
EXTERN tree m2expr_BuildLogicalAnd (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildLogicalOr (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildLogicalOrAddress (location_t location, tree op1,
- tree op2, int needconvert);
+ tree op2, bool needconvert);
EXTERN tree m2expr_BuildOffset (location_t location, tree record, tree field,
- int needconvert ATTRIBUTE_UNUSED);
+ bool needconvert ATTRIBUTE_UNUSED);
EXTERN tree m2expr_BuildOffset1 (location_t location, tree field,
- int needconvert ATTRIBUTE_UNUSED);
-EXTERN tree m2expr_BuildAddr (location_t location, tree op1, int needconvert);
+ bool needconvert ATTRIBUTE_UNUSED);
+EXTERN tree m2expr_BuildAddr (location_t location, tree op1, bool needconvert);
EXTERN tree m2expr_BuildSize (location_t location, tree op1,
- int needconvert ATTRIBUTE_UNUSED);
+ bool needconvert ATTRIBUTE_UNUSED);
EXTERN tree m2expr_BuildTBitSize (location_t location, tree type);
EXTERN tree m2expr_BuildSetNegate (location_t location, tree op1,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildNegate (location_t location, tree op1,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildNegateCheck (location_t location, tree arg,
tree lowest, tree min, tree max);
EXTERN tree m2expr_BuildTrunc (tree op1);
HOST_WIDE_INT *high);
EXTERN int m2expr_interpret_m2_integer (const char *str, unsigned int base,
unsigned int *low, int *high,
- int *needsLong, int *needsUnsigned);
+ bool *needsLong, bool *needsUnsigned);
EXTERN tree m2expr_BuildAddCheck (location_t location, tree op1, tree op2,
tree lowest, tree min, tree max);
tree lowest, tree min, tree max);
EXTERN tree m2expr_BuildAdd (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildSub (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildDivTrunc (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildDivTruncCheck (location_t location, tree op1, tree op2,
tree lowest, tree min, tree max);
EXTERN tree m2expr_BuildModTrunc (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildDivCeil (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildModCeil (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildDivFloor (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildModFloor (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildDivM2 (location_t location, tree op1, tree op2,
- unsigned int needsconvert);
+ bool needsconvert);
EXTERN tree m2expr_BuildModM2 (location_t location, tree op1, tree op2,
- unsigned int needsconvert);
+ bool needsconvert);
EXTERN tree m2expr_BuildDivM2Check (location_t location, tree op1, tree op2,
tree lowest, tree min, tree max);
tree lowest, tree min, tree max);
EXTERN tree m2expr_BuildLSL (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildLSR (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN void m2expr_BuildLogicalShift (location_t location, tree op1, tree op2,
tree op3, tree nBits ATTRIBUTE_UNUSED,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildLRL (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildLRR (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildMult (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildRRotate (location_t location, tree op1, tree nBits,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildLRotate (location_t location, tree op1, tree nBits,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildMask (location_t location, tree nBits,
- int needconvert);
+ bool needconvert);
EXTERN tree m2expr_BuildLRLn (location_t location, tree op1, tree op2,
- tree nBits, int needconvert);
+ tree nBits, bool needconvert);
EXTERN tree m2expr_BuildLRRn (location_t location, tree op1, tree op2,
- tree nBits, int needconvert);
+ tree nBits, bool needconvert);
EXTERN void m2expr_BuildLogicalRotate (location_t location, tree op1, tree op2,
- tree op3, tree nBits, int needconvert);
+ tree op3, tree nBits, bool needconvert);
EXTERN void m2expr_BuildBinarySetDo (
location_t location, tree settype, tree op1, tree op2, tree op3,
- void (*binop) (location_t, tree, tree, tree, tree, int), int is_op1lvalue,
- int is_op2lvalue, int is_op3lvalue, tree nBits, tree unbounded,
+ void (*binop) (location_t, tree, tree, tree, tree, bool), bool is_op1lvalue,
+ bool is_op2lvalue, bool is_op3lvalue, tree nBits, tree unbounded,
tree varproc, tree leftproc, tree rightproc);
EXTERN tree m2expr_GetSizeOf (location_t location, tree type);
tree op1, tree op2, int convert);
EXTERN tree m2expr_build_binary_op_check (location_t location,
enum tree_code code, tree op1,
- tree op2, int needconvert,
+ tree op2, bool needconvert,
tree lowest, tree min, tree max);
EXTERN void m2expr_ConstantExpressionWarning (tree value);
EXTERN tree m2expr_BuildAddAddress (location_t location, tree op1, tree op2);
EXTERN tree m2expr_BuildRDiv (location_t location, tree op1, tree op2,
- int needconvert);
+ bool needconvert);
EXTERN void m2expr_init (location_t location);
void
m2statement_BuildStartFunctionCode (location_t location, tree fndecl,
- int isexported, int isinline)
+ bool isexported, bool isinline)
{
tree param_decl;
/* BuildEndFunctionCode - generates the function epilogue. */
void
-m2statement_BuildEndFunctionCode (location_t location, tree fndecl, int nested)
+m2statement_BuildEndFunctionCode (location_t location, tree fndecl, bool nested)
{
tree block = DECL_INITIAL (fndecl);
if (TREE_CODE (expr) == FUNCTION_DECL)
result = build2 (MODIFY_EXPR, TREE_TYPE (des), des,
- m2expr_BuildAddr (location, expr, FALSE));
+ m2expr_BuildAddr (location, expr, false));
else
{
gcc_assert (TREE_CODE (TREE_TYPE (des)) != TYPE_DECL);
else
result = build2 (
MODIFY_EXPR, TREE_TYPE (des), des,
- m2convert_BuildConvert (location, TREE_TYPE (des), expr, FALSE));
+ m2convert_BuildConvert (location, TREE_TYPE (des), expr, false));
}
TREE_SIDE_EFFECTS (result) = 1;
m2assert_AssertLocation (location);
if (TREE_CODE (param) == FUNCTION_DECL)
- param = m2expr_BuildAddr (location, param, FALSE);
+ param = m2expr_BuildAddr (location, param, false);
param_list = chainon (build_tree_list (NULL_TREE, param), param_list);
}
ASSERT_CONDITION (
last_function
== NULL_TREE); /* Previous function value has not been collected. */
- TREE_USED (procedure) = TRUE;
+ TREE_USED (procedure) = true;
for (i = 0; i < n; i++)
{
{
rettype = void_type_node;
call = build_call_array_loc (location, rettype, funcptr, n, argarray);
- TREE_USED (call) = TRUE;
- TREE_SIDE_EFFECTS (call) = TRUE;
+ TREE_USED (call) = true;
+ TREE_SIDE_EFFECTS (call) = true;
#if defined(DEBUG_PROCEDURE_CALLS)
fprintf (stderr, "built the modula-2 call, here is the tree\n");
{
last_function = build_call_array_loc (
location, m2tree_skip_type_decl (rettype), funcptr, n, argarray);
- TREE_USED (last_function) = TRUE;
- TREE_SIDE_EFFECTS (last_function) = TRUE;
+ TREE_USED (last_function) = true;
+ TREE_SIDE_EFFECTS (last_function) = true;
param_list
= NULL_TREE; /* Ready for the next time we call a procedure. */
return last_function;
int i;
m2assert_AssertLocation (location);
- TREE_USED (procedure) = TRUE;
- TREE_SIDE_EFFECTS (procedure) = TRUE;
+ TREE_USED (procedure) = true;
+ TREE_SIDE_EFFECTS (procedure) = true;
for (i = 0; i < n; i++)
{
{
rettype = void_type_node;
call = build_call_array_loc (location, rettype, procedure, n, argarray);
- TREE_USED (call) = TRUE;
- TREE_SIDE_EFFECTS (call) = TRUE;
+ TREE_USED (call) = true;
+ TREE_SIDE_EFFECTS (call) = true;
#if defined(DEBUG_PROCEDURE_CALLS)
fprintf (stderr, "built the modula-2 call, here is the tree\n");
{
last_function = build_call_array_loc (
location, m2tree_skip_type_decl (rettype), procedure, n, argarray);
- TREE_USED (last_function) = TRUE;
- TREE_SIDE_EFFECTS (last_function) = TRUE;
+ TREE_USED (last_function) = true;
+ TREE_SIDE_EFFECTS (last_function) = true;
param_list
= NULL_TREE; /* Ready for the next time we call a procedure. */
return last_function;
last_function
!= NULL_TREE); /* No value available, possible used before. */
- TREE_SIDE_EFFECTS (assign) = TRUE;
- TREE_USED (assign) = TRUE;
+ TREE_SIDE_EFFECTS (assign) = true;
+ TREE_USED (assign) = true;
last_function = NULL_TREE;
return assign;
}
/* BuildAsm - generates an inline assembler instruction. */
void
-m2statement_BuildAsm (location_t location, tree instr, int isVolatile,
- int isSimple, tree inputs, tree outputs, tree trash,
+m2statement_BuildAsm (location_t location, tree instr, bool isVolatile,
+ bool isSimple, tree inputs, tree outputs, tree trash,
tree labels)
{
tree string = resolve_asm_operand_names (instr, outputs, inputs, labels);
void
m2statement_BuildUnaryForeachWordDo (location_t location, tree type, tree op1,
tree op2,
- tree (*unop) (location_t, tree, int),
- int is_op1lvalue, int is_op2lvalue,
- int is_op1const, int is_op2const)
+ tree (*unop) (location_t, tree, bool),
+ bool is_op1lvalue, bool is_op2lvalue,
+ bool is_op1const, bool is_op2const)
{
tree size = m2expr_GetSizeOf (location, type);
location, m2treelib_get_rvalue (location, op1, type, is_op1lvalue),
(*unop) (location,
m2treelib_get_rvalue (location, op2, type, is_op2lvalue),
- FALSE));
+ false));
else
{
/* Large set size > TSIZE(WORD). */
location, m2treelib_get_set_field_des (location, op1, field1),
(*unop) (location,
m2treelib_get_set_field_rhs (location, op2, field2),
- FALSE));
+ false));
fieldNo++;
field1 = m2treelib_get_field_no (type, op1, is_op1const, fieldNo);
field2 = m2treelib_get_field_no (type, op2, is_op2const, fieldNo);
void
m2statement_BuildExcludeVarConst (location_t location, tree type, tree op1,
- tree op2, int is_lvalue, int fieldno)
+ tree op2, bool is_lvalue, int fieldno)
{
tree size = m2expr_GetSizeOf (location, type);
m2expr_BuildSetNegate (
location,
m2expr_BuildLSL (location, m2expr_GetWordOne (location), op2,
- FALSE),
- FALSE),
- FALSE));
+ false),
+ false),
+ false));
}
else
{
m2expr_BuildSetNegate (
location,
m2expr_BuildLSL (location, m2expr_GetWordOne (location), op2,
- FALSE),
- FALSE),
- FALSE));
+ false),
+ false),
+ false));
}
}
void
m2statement_BuildExcludeVarVar (location_t location, tree type, tree varset,
- tree varel, int is_lvalue, tree low)
+ tree varel, bool is_lvalue, tree low)
{
tree size = m2expr_GetSizeOf (location, type);
/* Calculate the index from the first bit, ie bit 0 represents low value. */
tree index
= m2expr_BuildSub (location, m2convert_ToInteger (location, varel),
- m2convert_ToInteger (location, low), FALSE);
+ m2convert_ToInteger (location, low), false);
if (m2expr_CompareTrees (
size, m2decl_BuildIntegerConstant (SET_WORD_SIZE / BITS_PER_UNIT))
m2expr_BuildSetNegate (
location,
m2expr_BuildLSL (location, m2expr_GetWordOne (location),
- m2convert_ToWord (location, index), FALSE),
- FALSE),
- FALSE));
+ m2convert_ToWord (location, index), false),
+ false),
+ false));
else
{
tree p1 = m2treelib_get_set_address (location, varset, is_lvalue);
/* Which word do we need to fetch? */
tree word_index = m2expr_BuildDivTrunc (
- location, index, m2decl_BuildIntegerConstant (SET_WORD_SIZE), FALSE);
+ location, index, m2decl_BuildIntegerConstant (SET_WORD_SIZE), false);
/* Calculate the bit in this word. */
tree offset_into_word = m2expr_BuildModTrunc (
- location, index, m2decl_BuildIntegerConstant (SET_WORD_SIZE), FALSE);
+ location, index, m2decl_BuildIntegerConstant (SET_WORD_SIZE), false);
tree v1;
m2expr_BuildMult (
location, word_index,
m2decl_BuildIntegerConstant (SET_WORD_SIZE / BITS_PER_UNIT),
- FALSE));
+ false));
v1 = m2expr_BuildLogicalAnd (
location,
location,
m2expr_BuildLSL (location, m2expr_GetWordOne (location),
m2convert_ToWord (location, offset_into_word),
- FALSE),
- FALSE),
- FALSE);
+ false),
+ false),
+ false);
/* Set bit offset_into_word within the word pointer at by p1. */
m2statement_BuildAssignmentTree (
void
m2statement_BuildIncludeVarConst (location_t location, tree type, tree op1,
- tree op2, int is_lvalue, int fieldno)
+ tree op2, bool is_lvalue, int fieldno)
{
tree size = m2expr_GetSizeOf (location, type);
m2expr_BuildLogicalOr (
location, m2treelib_get_rvalue (location, op1, type, is_lvalue),
m2expr_BuildLSL (location, m2expr_GetWordOne (location),
- m2convert_ToWord (location, op2), FALSE),
- FALSE));
+ m2convert_ToWord (location, op2), false),
+ false));
}
else
{
m2expr_BuildLogicalOr (
location, m2treelib_get_set_field_rhs (location, op1, field),
m2expr_BuildLSL (location, m2expr_GetWordOne (location),
- m2convert_ToWord (location, op2), FALSE),
- FALSE));
+ m2convert_ToWord (location, op2), false),
+ false));
}
}
void
m2statement_BuildIncludeVarVar (location_t location, tree type, tree varset,
- tree varel, int is_lvalue, tree low)
+ tree varel, bool is_lvalue, tree low)
{
tree size = m2expr_GetSizeOf (location, type);
/* Calculate the index from the first bit, ie bit 0 represents low value. */
tree index
= m2expr_BuildSub (location, m2convert_ToInteger (location, varel),
- m2convert_ToInteger (location, low), FALSE);
+ m2convert_ToInteger (location, low), false);
tree indexw = m2convert_ToWord (location, index);
if (m2expr_CompareTrees (
location,
m2treelib_get_rvalue (location, varset, type, is_lvalue),
m2expr_BuildLSL (location, m2expr_GetWordOne (location),
- indexw, FALSE),
- FALSE)));
+ indexw, false),
+ false)));
else
{
tree p1 = m2treelib_get_set_address (location, varset, is_lvalue);
/* Which word do we need to fetch? */
tree word_index = m2expr_BuildDivTrunc (
- location, index, m2decl_BuildIntegerConstant (SET_WORD_SIZE), FALSE);
+ location, index, m2decl_BuildIntegerConstant (SET_WORD_SIZE), false);
/* Calculate the bit in this word. */
tree offset_into_word = m2convert_BuildConvert (
location, m2type_GetWordType (),
m2expr_BuildModTrunc (location, index,
m2decl_BuildIntegerConstant (SET_WORD_SIZE),
- FALSE),
- FALSE);
+ false),
+ false);
tree v1;
/* Calculate the address of the word we are interested in. */
m2expr_BuildMult (
location, word_index,
m2decl_BuildIntegerConstant (SET_WORD_SIZE / BITS_PER_UNIT),
- FALSE));
+ false));
v1 = m2expr_BuildLogicalOr (
location,
m2expr_BuildIndirect (location, p1, m2type_GetBitsetType ()),
m2convert_ToBitset (location,
m2expr_BuildLSL (location,
m2expr_GetWordOne (location),
- offset_into_word, FALSE)),
- FALSE);
+ offset_into_word, false)),
+ false);
/* Set bit offset_into_word within the word pointer at by p1. */
m2statement_BuildAssignmentTree (
the initialization sequence for all modules. */
tree
-m2statement_BuildStart (location_t location, char *name, int inner_module)
+m2statement_BuildStart (location_t location, char *name, bool inner_module)
{
tree fntype;
tree fndecl;
/* BuildEnd - complete the initialization function for this module. */
void
-m2statement_BuildEnd (location_t location, tree fndecl, int nested)
+m2statement_BuildEnd (location_t location, tree fndecl, bool nested)
{
m2statement_BuildEndFunctionCode (location, fndecl, nested);
current_function_decl = NULL;
MODIFY_EXPR, TREE_TYPE (DECL_RESULT (fndecl)), DECL_RESULT (fndecl),
m2convert_BuildConvert (
location, m2tree_skip_type_decl (TREE_TYPE (DECL_RESULT (fndecl))),
- value, FALSE));
+ value, false));
ret_stmt = build_stmt (location, RETURN_EXPR, t);
add_stmt (location, ret_stmt);
}
/* DoJump - jump to the appropriate label depending whether result of
- the expression is TRUE or FALSE. */
+ the expression is true or false. */
void
m2statement_DoJump (location_t location, tree exp, char *falselabel,
int inner_module);
EXTERN void m2statement_BuildIncludeVarVar (location_t location, tree type,
tree varset, tree varel,
- int is_lvalue, tree low);
+ bool is_lvalue, tree low);
EXTERN void m2statement_BuildIncludeVarConst (location_t location, tree type,
tree op1, tree op2,
- int is_lvalue, int fieldno);
+ bool is_lvalue, int fieldno);
EXTERN void m2statement_BuildExcludeVarVar (location_t location, tree type,
tree varset, tree varel,
- int is_lvalue, tree low);
+ bool is_lvalue, tree low);
EXTERN void m2statement_BuildExcludeVarConst (location_t location, tree type,
tree op1, tree op2,
- int is_lvalue, int fieldno);
+ bool is_lvalue, int fieldno);
EXTERN void m2statement_BuildUnaryForeachWordDo (
location_t location, tree type, tree op1, tree op2,
- tree (*unop) (location_t, tree, int), int is_op1lvalue, int is_op2lvalue,
- int is_op1const, int is_op2const);
+ tree (*unop) (location_t, tree, bool), bool is_op1lvalue, bool is_op2lvalue,
+ bool is_op1const, bool is_op2const);
EXTERN void m2statement_BuildAsm (location_t location, tree instr,
- int isVolatile, int isSimple, tree inputs,
+ bool isVolatile, bool isSimple, tree inputs,
tree outputs, tree trash, tree labels);
EXTERN tree m2statement_BuildFunctValue (location_t location, tree value);
EXTERN tree m2statement_BuildIndirectProcedureCallTree (location_t location,
EXTERN void m2statement_BuildReturnValueCode (location_t location, tree fndecl,
tree value);
EXTERN void m2statement_BuildEndFunctionCode (location_t location, tree fndecl,
- int nested);
+ bool nested);
EXTERN void m2statement_BuildStartFunctionCode (location_t location,
- tree fndecl, int isexported,
- int isinline);
+ tree fndecl, bool isexported,
+ bool isinline);
EXTERN void m2statement_DoJump (location_t location, tree exp,
char *falselabel, char *truelabel);
EXTERN tree m2statement_BuildCall2 (location_t location, tree function,
/* SetFlagUnitAtATime - sets GCC flag_unit_at_a_time to b. */
void
-m2top_SetFlagUnitAtATime (int b)
+m2top_SetFlagUnitAtATime (bool b)
{
flag_unit_at_a_time = b;
}
EXTERN void m2top_StartGlobalContext (void);
EXTERN void m2top_EndGlobalContext (void);
-EXTERN void m2top_SetFlagUnitAtATime (int b);
+EXTERN void m2top_SetFlagUnitAtATime (bool b);
#undef EXTERN
#endif /* m2top_h. */
#define m2tree_c
#include "m2tree.h"
-int
+bool
m2tree_is_var (tree var)
{
return TREE_CODE (var) == VAR_DECL;
}
-int
+bool
m2tree_is_array (tree array)
{
return TREE_CODE (array) == ARRAY_TYPE;
}
-int
+bool
m2tree_is_type (tree type)
{
switch (TREE_CODE (type))
/* m2tree_IsOrdinal - return TRUE if code is an INTEGER, BOOLEAN or
ENUMERAL type. */
-int
+bool
m2tree_IsOrdinal (tree type)
{
enum tree_code code = TREE_CODE (type);
/* is_a_constant - returns TRUE if tree, t, is a constant. */
-int
+bool
m2tree_IsAConstant (tree t)
{
return (TREE_CODE (t) == INTEGER_CST) || (TREE_CODE (t) == REAL_CST)
#endif /* m2tree_c. */
#include "input.h"
+#include <stdbool.h>
-EXTERN int m2tree_is_var (tree var);
-EXTERN int m2tree_is_array (tree array);
-EXTERN int m2tree_is_type (tree type);
+EXTERN bool m2tree_is_var (tree var);
+EXTERN bool m2tree_is_array (tree array);
+EXTERN bool m2tree_is_type (tree type);
EXTERN tree m2tree_skip_type_decl (tree type);
EXTERN tree m2tree_skip_const_decl (tree exp);
-EXTERN int m2tree_IsTreeOverflow (tree value);
-EXTERN int m2tree_IsOrdinal (tree type);
-EXTERN int m2tree_IsAConstant (tree t);
+EXTERN bool m2tree_IsTreeOverflow (tree value);
+EXTERN bool m2tree_IsOrdinal (tree type);
+EXTERN bool m2tree_IsAConstant (tree t);
EXTERN void m2tree_debug_tree (tree t);
EXTERN tree m2tree_skip_reference_type (tree exp);
#include "m2type.h"
#include "m2options.h"
-#undef USE_BOOLEAN
-static int broken_set_debugging_info = TRUE;
+#define USE_BOOLEAN
+static int broken_set_debugging_info = true;
struct GTY (()) struct_constructor
tree max = TYPE_MAX_VALUE (index_type);
m2assert_AssertLocation (location);
- return m2expr_FoldAndStrip (m2expr_BuildSub (location, max, min, FALSE));
+ return m2expr_FoldAndStrip (m2expr_BuildSub (location, max, min, false));
}
/* gm2_finish_build_array_type complete building the partially
return m2type_BuildEndArrayType (arrayType, elementtype, indextype, fetype);
}
-/* ValueInTypeRange returns TRUE if the constant, value, lies within
+/* ValueInTypeRange returns true if the constant, value, lies within
the range of type. */
-int
+bool
m2type_ValueInTypeRange (tree type, tree value)
{
tree low_type = m2tree_skip_type_decl (type);
&& (tree_int_cst_compare (value, max_value) <= 0));
}
-/* ValueOutOfTypeRange returns TRUE if the constant, value, exceeds
+/* ValueOutOfTypeRange returns true if the constant, value, exceeds
the range of type. */
-int
+bool
m2type_ValueOutOfTypeRange (tree type, tree value)
{
return (!m2type_ValueInTypeRange (type, value));
}
-/* ExceedsTypeRange return TRUE if low or high exceed the range of
+/* ExceedsTypeRange return true if low or high exceed the range of
type. */
-int
+bool
m2type_ExceedsTypeRange (tree type, tree low, tree high)
{
return (m2type_ValueOutOfTypeRange (type, low)
|| m2type_ValueOutOfTypeRange (type, high));
}
-/* WithinTypeRange return TRUE if low and high are within the range
+/* WithinTypeRange return true if low and high are within the range
of type. */
-int
+bool
m2type_WithinTypeRange (tree type, tree low, tree high)
{
return (m2type_ValueInTypeRange (type, low)
return m2_packed_boolean_type_node;
}
-/* GetBooleanTrue return modula-2 TRUE. */
+/* GetBooleanTrue return modula-2 true. */
tree
m2type_GetBooleanTrue (void)
return m2type_BuildSetTypeFromSubrange (
location, NULL, bitnum_type_node, m2decl_BuildIntegerConstant (0),
- m2decl_BuildIntegerConstant (m2decl_GetBitsPerBitset () - 1), FALSE);
+ m2decl_BuildIntegerConstant (m2decl_GetBitsPerBitset () - 1), false);
}
/* BuildSetTypeFromSubrange constructs a set type from a
m2type_BuildSetTypeFromSubrange (location_t location,
char *name __attribute__ ((unused)),
tree subrangeType __attribute__ ((unused)),
- tree lowval, tree highval, int ispacked)
+ tree lowval, tree highval, bool ispacked)
{
m2assert_AssertLocation (location);
lowval = m2expr_FoldAndStrip (lowval);
if (ispacked)
{
tree noelements = m2expr_BuildAdd (
- location, m2expr_BuildSub (location, highval, lowval, FALSE),
- integer_one_node, FALSE);
+ location, m2expr_BuildSub (location, highval, lowval, false),
+ integer_one_node, false);
highval = m2expr_FoldAndStrip (m2expr_BuildSub (
location, m2expr_BuildLSL (location, m2expr_GetWordOne (location),
- noelements, FALSE),
- m2expr_GetIntegerOne (location), FALSE));
+ noelements, false),
+ m2expr_GetIntegerOne (location), false));
lowval = m2expr_GetIntegerZero (location);
return m2type_BuildSmallestTypeRange (location, lowval, highval);
}
return m2type_BuildSetTypeFromSubrange (
location, NULL, bitnum_type_node, m2decl_BuildIntegerConstant (0),
- m2decl_BuildIntegerConstant (precision - 1), FALSE);
+ m2decl_BuildIntegerConstant (precision - 1), false);
}
/* build_m2_specific_size_type build a specific data type matching
if (is_signed)
{
fixup_signed_type (c);
- TYPE_UNSIGNED (c) = FALSE;
+ TYPE_UNSIGNED (c) = false;
}
else
{
fixup_unsigned_type (c);
- TYPE_UNSIGNED (c) = TRUE;
+ TYPE_UNSIGNED (c) = true;
}
}
low = fold (low);
high = fold (high);
bits = fold (noBitsRequired (
- m2expr_BuildAdd (location, m2expr_BuildSub (location, high, low, FALSE),
- m2expr_GetIntegerOne (location), FALSE)));
+ m2expr_BuildAdd (location, m2expr_BuildSub (location, high, low, false),
+ m2expr_GetIntegerOne (location), false)));
return build_m2_specific_size_type (location, INTEGER_TYPE,
TREE_INT_CST_LOW (bits),
tree_int_cst_sgn (low) < 0);
tree
m2type_BuildProcTypeParameterDeclaration (location_t location, tree type,
- int isreference)
+ bool isreference)
{
m2assert_AssertLocation (location);
ASSERT_BOOL (isreference);
m2assert_AssertLocation (location);
decl = build_decl (location, VAR_DECL, id, arraytype);
- DECL_EXTERNAL (decl) = FALSE;
- TREE_PUBLIC (decl) = TRUE;
+ DECL_EXTERNAL (decl) = false;
+ TREE_PUBLIC (decl) = true;
DECL_CONTEXT (decl) = scope;
- TREE_USED (arraytype) = TRUE;
- TREE_USED (decl) = TRUE;
+ TREE_USED (arraytype) = true;
+ TREE_USED (decl) = true;
m2block_pushDecl (decl);
(m2expr_BuildSub (location,
m2decl_BuildIntegerConstant (
m2decl_GetBitsPerInt () / BITS_PER_UNIT),
- m2expr_GetIntegerOne (location), FALSE))),
+ m2expr_GetIntegerOne (location), false))),
loc);
return c;
}
build_m2_integer8_type_node (location_t location)
{
m2assert_AssertLocation (location);
- return build_m2_specific_size_type (location, INTEGER_TYPE, 8, TRUE);
+ return build_m2_specific_size_type (location, INTEGER_TYPE, 8, true);
}
static tree
build_m2_integer16_type_node (location_t location)
{
m2assert_AssertLocation (location);
- return build_m2_specific_size_type (location, INTEGER_TYPE, 16, TRUE);
+ return build_m2_specific_size_type (location, INTEGER_TYPE, 16, true);
}
static tree
build_m2_integer32_type_node (location_t location)
{
m2assert_AssertLocation (location);
- return build_m2_specific_size_type (location, INTEGER_TYPE, 32, TRUE);
+ return build_m2_specific_size_type (location, INTEGER_TYPE, 32, true);
}
static tree
build_m2_integer64_type_node (location_t location)
{
m2assert_AssertLocation (location);
- return build_m2_specific_size_type (location, INTEGER_TYPE, 64, TRUE);
+ return build_m2_specific_size_type (location, INTEGER_TYPE, 64, true);
}
static tree
build_m2_cardinal8_type_node (location_t location)
{
m2assert_AssertLocation (location);
- return build_m2_specific_size_type (location, INTEGER_TYPE, 8, FALSE);
+ return build_m2_specific_size_type (location, INTEGER_TYPE, 8, false);
}
static tree
build_m2_cardinal16_type_node (location_t location)
{
m2assert_AssertLocation (location);
- return build_m2_specific_size_type (location, INTEGER_TYPE, 16, FALSE);
+ return build_m2_specific_size_type (location, INTEGER_TYPE, 16, false);
}
static tree
build_m2_cardinal32_type_node (location_t location)
{
m2assert_AssertLocation (location);
- return build_m2_specific_size_type (location, INTEGER_TYPE, 32, FALSE);
+ return build_m2_specific_size_type (location, INTEGER_TYPE, 32, false);
}
static tree
build_m2_cardinal64_type_node (location_t location)
{
m2assert_AssertLocation (location);
- return build_m2_specific_size_type (location, INTEGER_TYPE, 64, FALSE);
+ return build_m2_specific_size_type (location, INTEGER_TYPE, 64, false);
}
static tree
{
m2assert_AssertLocation (location);
if (broken_set_debugging_info)
- return build_m2_specific_size_type (location, INTEGER_TYPE, 8, FALSE);
+ return build_m2_specific_size_type (location, INTEGER_TYPE, 8, false);
else
- return build_m2_specific_size_type (location, SET_TYPE, 8, FALSE);
+ return build_m2_specific_size_type (location, SET_TYPE, 8, false);
}
static tree
{
m2assert_AssertLocation (location);
if (broken_set_debugging_info)
- return build_m2_specific_size_type (location, INTEGER_TYPE, 16, FALSE);
+ return build_m2_specific_size_type (location, INTEGER_TYPE, 16, false);
else
- return build_m2_specific_size_type (location, SET_TYPE, 16, FALSE);
+ return build_m2_specific_size_type (location, SET_TYPE, 16, false);
}
static tree
{
m2assert_AssertLocation (location);
if (broken_set_debugging_info)
- return build_m2_specific_size_type (location, INTEGER_TYPE, 32, FALSE);
+ return build_m2_specific_size_type (location, INTEGER_TYPE, 32, false);
else
- return build_m2_specific_size_type (location, SET_TYPE, 32, FALSE);
+ return build_m2_specific_size_type (location, SET_TYPE, 32, false);
}
static tree
build_m2_real32_type_node (location_t location)
{
m2assert_AssertLocation (location);
- return build_m2_specific_size_type (location, REAL_TYPE, 32, TRUE);
+ return build_m2_specific_size_type (location, REAL_TYPE, 32, true);
}
static tree
build_m2_real64_type_node (location_t location)
{
m2assert_AssertLocation (location);
- return build_m2_specific_size_type (location, REAL_TYPE, 64, TRUE);
+ return build_m2_specific_size_type (location, REAL_TYPE, 64, true);
}
static tree
build_m2_real96_type_node (location_t location)
{
m2assert_AssertLocation (location);
- return build_m2_specific_size_type (location, REAL_TYPE, 96, TRUE);
+ return build_m2_specific_size_type (location, REAL_TYPE, 96, true);
}
static tree
build_m2_real128_type_node (location_t location)
{
m2assert_AssertLocation (location);
- return build_m2_specific_size_type (location, REAL_TYPE, 128, TRUE);
+ return build_m2_specific_size_type (location, REAL_TYPE, 128, true);
}
static tree
tree size = size_in_bytes (ptr_type_node);
int bits = TREE_INT_CST_LOW (size) * BITS_PER_UNIT;
- return build_m2_specific_size_type (location, INTEGER_TYPE, bits, FALSE);
+ return build_m2_specific_size_type (location, INTEGER_TYPE, bits, false);
+}
+
+static void
+build_m2_boolean (location_t location)
+{
+ tree tname = get_identifier ("BOOLEAN");
+ tree typedecl = build_decl (location, TYPE_DECL, tname, boolean_type_node);
+ DECL_ARTIFICIAL (typedecl) = 1;
+ TYPE_NAME (boolean_type_node) = typedecl;
}
/* InitBaseTypes create the Modula-2 base types. */
m2_cardinal_address_type_node
= build_m2_cardinal_address_type_node (location);
- m2_packed_boolean_type_node = build_nonstandard_integer_type (1, TRUE);
+ m2_packed_boolean_type_node = build_nonstandard_integer_type (1, true);
+ build_m2_boolean (location);
if (M2Options_GetPPOnly ())
return;
return do_max_real (type);
if (type == ptr_type_node)
return fold (m2expr_BuildSub (location, m2expr_GetPointerZero (location),
- m2expr_GetPointerOne (location), FALSE));
+ m2expr_GetPointerOne (location), false));
return TYPE_MAX_VALUE (m2tree_skip_type_decl (type));
}
/* BuildStartEnumeration create an enumerated type in gcc. */
tree
-m2type_BuildStartEnumeration (location_t location, char *name, int ispacked)
+m2type_BuildStartEnumeration (location_t location, char *name, bool ispacked)
{
tree id;
m2type_BuildConstPointerType (tree totype)
{
tree t = build_pointer_type (m2tree_skip_type_decl (totype));
- TYPE_READONLY (t) = TRUE;
+ TYPE_READONLY (t) = true;
return t;
}
tree
m2type_BuildSetType (location_t location, char *name, tree type, tree lowval,
- tree highval, int ispacked)
+ tree highval, bool ispacked)
{
tree range = build_range_type (m2tree_skip_type_decl (type),
m2expr_FoldAndStrip (lowval),
constructor
= build_constructor (c->constructor_type, c->constructor_elements);
- TREE_CONSTANT (constructor) = TRUE;
- TREE_STATIC (constructor) = TRUE;
+ TREE_CONSTANT (constructor) = true;
+ TREE_STATIC (constructor) = true;
pop_constructor (c);
{
if (i < len)
val = m2convert_BuildConvert (
- location, type, m2type_BuildCharConstant (location, &p[i]), FALSE);
+ location, type, m2type_BuildCharConstant (location, &p[i]), false);
else
val = m2type_BuildCharConstant (location, &nul[0]);
m2type_BuildArrayConstructorElement (c, val, n);
i += 1;
n = m2expr_BuildAdd (location, n, m2expr_GetIntegerOne (location),
- FALSE);
+ false);
}
return m2type_BuildEndArrayConstructor (c);
}
m2type_BuildCharConstantChar (location_t location, char ch)
{
tree id = build_int_cst (char_type_node, (int) ch);
- id = m2convert_BuildConvert (location, m2type_GetM2CharType (), id, FALSE);
+ id = m2convert_BuildConvert (location, m2type_GetM2CharType (), id, false);
return m2block_RememberConstant (id);
}
else
id = get_identifier (name);
- TYPE_PACKED (s) = FALSE; /* This maybe set TRUE later if necessary. */
+ TYPE_PACKED (s) = false; /* This maybe set true later if necessary. */
m2block_pushDecl (build_decl (location, TYPE_DECL, id, s));
return s;
tree
m2type_BuildEndVarient (location_t location, tree varientField,
- tree varientList, int isPacked)
+ tree varientList, bool isPacked)
{
tree varient = TREE_TYPE (varientField);
m2assert_AssertLocation (location);
tree
m2type_BuildEndRecord (location_t location, tree record, tree fieldlist,
- int isPacked)
+ bool isPacked)
{
tree x, d;
tree
m2type_BuildEndFieldVarient (location_t location, tree varientField,
- tree varientList, int isPacked)
+ tree varientList, bool isPacked)
{
tree record = TREE_TYPE (varientField);
{
tree type = NULL_TREE;
tree decl = NULL_TREE;
- int is_type = FALSE;
+ bool is_type = false;
int i;
if (DECL_P (node))
}
else if (TYPE_P (node))
{
- is_type = 1;
+ is_type = true;
type = node;
}
tree high = TYPE_MAX_VALUE (index);
tree low = TYPE_MIN_VALUE (index);
tree elements = m2expr_BuildAdd (
- location, m2expr_BuildSub (location, high, low, FALSE),
- m2expr_GetIntegerOne (location), FALSE);
+ location, m2expr_BuildSub (location, high, low, false),
+ m2expr_GetIntegerOne (location), false);
m2assert_AssertLocation (location);
return elements;
}
signed. */
tree
-m2type_gm2_type_for_size (unsigned int bits, int unsignedp)
+m2type_gm2_type_for_size (unsigned int bits, bool unsignedp)
{
if (bits == TYPE_PRECISION (integer_type_node))
return unsignedp ? unsigned_type_node : integer_type_node;
if (type1 == intQI_type_node)
return unsigned_intQI_type_node;
- return m2type_gm2_signed_or_unsigned_type (TRUE, type);
+ return m2type_gm2_signed_or_unsigned_type (true, type);
}
/* gm2_signed_type return a signed type the same as TYPE in other
if (type1 == unsigned_intQI_type_node)
return intQI_type_node;
- return m2type_gm2_signed_or_unsigned_type (FALSE, type);
+ return m2type_gm2_signed_or_unsigned_type (false, type);
}
/* check_type if the precision of baseType and type are the same
*result = baseu;
else
*result = bases;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/* gm2_signed_or_unsigned_type return a type the same as TYPE
return type;
}
-/* IsAddress returns TRUE if the type is an ADDRESS. */
+/* IsAddress returns true if the type is an ADDRESS. */
int
m2type_IsAddress (tree type)
#endif /* !__GNUG__. */
#endif /* !m2type_c. */
+#include <stdbool.h>
+
typedef void *m2type_Constructor;
-EXTERN int m2type_ValueInTypeRange (tree type, tree value);
-EXTERN int m2type_ExceedsTypeRange (tree type, tree low, tree high);
-EXTERN int m2type_ValueOutOfTypeRange (tree type, tree value);
-EXTERN int m2type_WithinTypeRange (tree type, tree low, tree high);
+EXTERN bool m2type_ValueInTypeRange (tree type, tree value);
+EXTERN bool m2type_ExceedsTypeRange (tree type, tree low, tree high);
+EXTERN bool m2type_ValueOutOfTypeRange (tree type, tree value);
+EXTERN bool m2type_WithinTypeRange (tree type, tree low, tree high);
EXTERN tree m2type_BuildStartArrayType (tree index_type, tree elt_type,
int type);
EXTERN void m2type_PutArrayType (tree array, tree type);
EXTERN tree m2type_SetDeclPacked (tree node);
EXTERN tree m2type_SetAlignment (tree node, tree align);
EXTERN tree m2type_BuildEndRecord (location_t location, tree record,
- tree fieldlist, int isPacked);
+ tree fieldlist, bool isPacked);
EXTERN tree m2type_AddStringToTreeList (tree list, tree string);
EXTERN tree m2type_ChainOnParamValue (tree list, tree name, tree str,
tree value);
tree type);
EXTERN tree m2type_BuildEndFieldVarient (location_t location,
tree varientField, tree varientList,
- int isPacked);
+ bool isPacked);
EXTERN tree m2type_BuildStartFieldVarient (location_t location, char *name);
EXTERN tree m2type_BuildEndVarient (location_t location, tree varientField,
- tree varientList, int isPacked);
+ tree varientList, bool isPacked);
EXTERN tree m2type_BuildStartVarient (location_t location, char *name);
EXTERN tree m2type_BuildStartUnion (location_t location, char *name);
EXTERN tree m2type_BuildStartRecord (location_t location, char *name);
tree high);
EXTERN tree m2type_BuildSetTypeFromSubrange (location_t location, char *name,
tree subrangeType, tree lowval,
- tree highval, int ispacked);
+ tree highval, bool ispacked);
EXTERN int m2type_GetBitsPerBitset (void);
EXTERN tree m2type_GetM2RType (void);
EXTERN tree m2type_GetM2ZType (void);
EXTERN tree m2type_GetMaxFrom (location_t location, tree type);
EXTERN void m2type_BuildTypeDeclaration (location_t location, tree type);
EXTERN tree m2type_BuildStartEnumeration (location_t location, char *name,
- int ispacked);
+ bool ispacked);
EXTERN tree m2type_BuildEndEnumeration (location_t location, tree enumtype,
tree enumvalues);
EXTERN tree m2type_BuildEnumerator (location_t location, char *name,
EXTERN tree m2type_BuildPointerType (tree totype);
EXTERN tree m2type_BuildConstPointerType (tree totype);
EXTERN tree m2type_BuildSetType (location_t location, char *name, tree type,
- tree lowval, tree highval, int ispacked);
+ tree lowval, tree highval, bool ispacked);
EXTERN void *m2type_BuildStartSetConstructor (tree type);
EXTERN void m2type_BuildSetConstructorElement (void *p, tree value);
EXTERN tree m2type_BuildEndSetConstructor (void *p);
EXTERN tree m2type_gm2_type_for_size (unsigned int bits, int unsignedp);
EXTERN tree m2type_BuildProcTypeParameterDeclaration (location_t location,
tree type,
- int isreference);
+ bool isreference);
EXTERN int m2type_IsAddress (tree type);
EXTERN tree m2type_GetCardinalAddressType (void);
{
case VOID_TYPE:
case BOOLEAN_TYPE:
- return fold_convert (type, expr);
+ return fold (convert_to_integer (type, expr));
case INTEGER_TYPE:
return fold (convert_to_integer (type, expr));
case POINTER_TYPE:
(* floating point intrinsic procedure functions *)
-PROCEDURE __BUILTIN__ isfinitef (x: SHORTREAL) : BOOLEAN ;
-PROCEDURE __BUILTIN__ isfinite (x: REAL) : BOOLEAN ;
-PROCEDURE __BUILTIN__ isfinitel (x: LONGREAL) : BOOLEAN ;
+PROCEDURE __BUILTIN__ isfinitef (x: SHORTREAL) : INTEGER ;
+PROCEDURE __BUILTIN__ isfinite (x: REAL) : INTEGER ;
+PROCEDURE __BUILTIN__ isfinitel (x: LONGREAL) : INTEGER ;
PROCEDURE __BUILTIN__ sinf (x: SHORTREAL) : SHORTREAL ;
PROCEDURE __BUILTIN__ sin (x: REAL) : REAL ;
RETURN cbuiltin.memcpy (dest, src, nbytes)
END memcpy ;
-PROCEDURE __ATTRIBUTE__ __BUILTIN__ ((__builtin_isfinite)) isfinitef (x: SHORTREAL) : BOOLEAN ;
+PROCEDURE __ATTRIBUTE__ __BUILTIN__ ((__builtin_isfinite)) isfinitef (x: SHORTREAL) : INTEGER ;
BEGIN
- RETURN wrapc.isfinitef (x)=1
+ RETURN wrapc.isfinitef
END isfinitef ;
-PROCEDURE __ATTRIBUTE__ __BUILTIN__ ((__builtin_isfinite)) isfinite (x: REAL) : BOOLEAN ;
+PROCEDURE __ATTRIBUTE__ __BUILTIN__ ((__builtin_isfinite)) isfinite (x: REAL) : INTEGER ;
BEGIN
- RETURN wrapc.isfinite (x)=1
+ RETURN wrapc.isfinite (x)
END isfinite ;
-PROCEDURE __ATTRIBUTE__ __BUILTIN__ ((__builtin_isfinite)) isfinitel (x: LONGREAL) : BOOLEAN ;
+PROCEDURE __ATTRIBUTE__ __BUILTIN__ ((__builtin_isfinite)) isfinitel (x: LONGREAL) : INTEGER ;
BEGIN
- RETURN wrapc.isfinitel (x)=1
+ RETURN wrapc.isfinitel (x)
END isfinitel ;
PROCEDURE __ATTRIBUTE__ __BUILTIN__ ((__builtin_sin)) sin (x: REAL) : REAL ;
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
The success of the operation is returned.
*/
-extern "C" unsigned int Args_GetArg (char *a, unsigned int _a_high, unsigned int n);
+extern "C" bool Args_GetArg (char *a, unsigned int _a_high, unsigned int n);
/*
Narg - returns the number of arguments available from
The success of the operation is returned.
*/
-extern "C" unsigned int Args_GetArg (char *a, unsigned int _a_high, unsigned int n)
+extern "C" bool Args_GetArg (char *a, unsigned int _a_high, unsigned int n)
{
int i;
unsigned int High;
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
The success of the operation is returned.
*/
-EXTERN unsigned int Args_GetArg (char *a, unsigned int _a_high, unsigned int n);
+EXTERN bool Args_GetArg (char *a, unsigned int _a_high, unsigned int n);
/*
Narg - returns the number of arguments available from
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
Assert - tests the boolean Condition, if it fails then HALT is called.
*/
-extern "C" void Assertion_Assert (unsigned int Condition);
+extern "C" void Assertion_Assert (bool Condition);
/*
Assert - tests the boolean Condition, if it fails then HALT is called.
*/
-extern "C" void Assertion_Assert (unsigned int Condition)
+extern "C" void Assertion_Assert (bool Condition)
{
if (! Condition)
{
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
is called.
*/
-EXTERN void Assertion_Assert (unsigned int Condition);
+EXTERN void Assertion_Assert (bool Condition);
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
The result of the operation is returned.
*/
-extern "C" unsigned int CmdArgs_GetArg (const char *CmdLine_, unsigned int _CmdLine_high, unsigned int n, char *Argi, unsigned int _Argi_high);
+extern "C" bool CmdArgs_GetArg (const char *CmdLine_, unsigned int _CmdLine_high, unsigned int n, char *Argi, unsigned int _Argi_high);
/*
Narg - returns the number of arguments available from
Arg is filled with the found argument.
*/
-static unsigned int GetNextArg (const char *CmdLine_, unsigned int _CmdLine_high, unsigned int *CmdIndex, char *Arg, unsigned int _Arg_high);
+static bool GetNextArg (const char *CmdLine_, unsigned int _CmdLine_high, unsigned int *CmdIndex, char *Arg, unsigned int _Arg_high);
/*
CopyUntilSpace - copies characters until a Space character is found.
*/
static void CopyChar (const char *From_, unsigned int _From_high, unsigned int *FromIndex, unsigned int FromHigh, char *To, unsigned int _To_high, unsigned int *ToIndex, unsigned int ToHigh);
-static unsigned int Escape (char ch);
-static unsigned int Space (char ch);
-static unsigned int DoubleQuote (char ch);
-static unsigned int SingleQuote (char ch);
+static bool Escape (char ch);
+static bool Space (char ch);
+static bool DoubleQuote (char ch);
+static bool SingleQuote (char ch);
/*
Arg is filled with the found argument.
*/
-static unsigned int GetNextArg (const char *CmdLine_, unsigned int _CmdLine_high, unsigned int *CmdIndex, char *Arg, unsigned int _Arg_high)
+static bool GetNextArg (const char *CmdLine_, unsigned int _CmdLine_high, unsigned int *CmdIndex, char *Arg, unsigned int _Arg_high)
{
unsigned int ArgIndex;
unsigned int HighA;
}
}
-static unsigned int Escape (char ch)
+static bool Escape (char ch)
{
return ch == esc;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
-static unsigned int Space (char ch)
+static bool Space (char ch)
{
return (ch == space) || (ch == tab);
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
-static unsigned int DoubleQuote (char ch)
+static bool DoubleQuote (char ch)
{
return ch == dquote;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
-static unsigned int SingleQuote (char ch)
+static bool SingleQuote (char ch)
{
return ch == squote;
/* static analysis guarentees a RETURN statement will be used before here. */
The result of the operation is returned.
*/
-extern "C" unsigned int CmdArgs_GetArg (const char *CmdLine_, unsigned int _CmdLine_high, unsigned int n, char *Argi, unsigned int _Argi_high)
+extern "C" bool CmdArgs_GetArg (const char *CmdLine_, unsigned int _CmdLine_high, unsigned int n, char *Argi, unsigned int _Argi_high)
{
unsigned int Index;
unsigned int i;
- unsigned int Another;
+ bool Another;
char CmdLine[_CmdLine_high+1];
/* make a local copy of each unbounded array. */
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
the success of the operation is returned.
*/
-EXTERN unsigned int CmdArgs_GetArg (const char *CmdLine_, unsigned int _CmdLine_high, unsigned int n, char *Argi, unsigned int _Argi_high);
+EXTERN bool CmdArgs_GetArg (const char *CmdLine_, unsigned int _CmdLine_high, unsigned int n, char *Argi, unsigned int _Argi_high);
/*
Narg - returns the number of arguments available from
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# include "GM2RTS.h"
# define MaxBuf 127
-# define PoisonOn FALSE
-# define DebugOn FALSE
-# define CheckOn FALSE
-# define TraceOn FALSE
+# define PoisonOn false
+# define DebugOn false
+# define CheckOn false
+# define TraceOn false
typedef struct DynamicStrings_Contents_r DynamicStrings_Contents;
typedef struct DynamicStrings_DebugInfo_r DynamicStrings_DebugInfo;
};
struct DynamicStrings_descriptor_r {
- unsigned int charStarUsed;
+ bool charStarUsed;
void *charStar;
unsigned int charStarSize;
- unsigned int charStarValid;
+ bool charStarValid;
DynamicStrings_desState state;
DynamicStrings_String garbage;
};
DynamicStrings_DebugInfo debug;
};
-static unsigned int Initialized;
+static bool Initialized;
static DynamicStrings_frame frameHead;
static DynamicStrings_String captured;
Equal - returns TRUE if String, a, and, b, are equal.
*/
-extern "C" unsigned int DynamicStrings_Equal (DynamicStrings_String a, DynamicStrings_String b);
+extern "C" bool DynamicStrings_Equal (DynamicStrings_String a, DynamicStrings_String b);
/*
EqualCharStar - returns TRUE if contents of String, s, is the same as the
string, a.
*/
-extern "C" unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, void * a);
+extern "C" bool DynamicStrings_EqualCharStar (DynamicStrings_String s, void * a);
/*
EqualArray - returns TRUE if contents of String, s, is the same as the
string, a.
*/
-extern "C" unsigned int DynamicStrings_EqualArray (DynamicStrings_String s, const char *a_, unsigned int _a_high);
+extern "C" bool DynamicStrings_EqualArray (DynamicStrings_String s, const char *a_, unsigned int _a_high);
/*
Mult - returns a new string which is n concatenations of String, s.
with an exit code of 1.
*/
-extern "C" void DynamicStrings_PopAllocation (unsigned int halt);
+extern "C" void DynamicStrings_PopAllocation (bool halt);
/*
PopAllocationExemption - test to see that all strings are deallocated, except
with an exit code of 1.
*/
-extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned int halt, DynamicStrings_String e);
+extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (bool halt, DynamicStrings_String e);
/*
writeStringDesc write out debugging information about string, s. */
IsOn - returns TRUE if, s, is on one of the debug lists.
*/
-static unsigned int IsOn (DynamicStrings_String list, DynamicStrings_String s);
+static bool IsOn (DynamicStrings_String list, DynamicStrings_String s);
/*
AddTo - adds string, s, to, list.
IsOnAllocated - returns TRUE if the string, s, has ever been allocated.
*/
-static unsigned int IsOnAllocated (DynamicStrings_String s);
+static bool IsOnAllocated (DynamicStrings_String s);
/*
IsOnDeallocated - returns TRUE if the string, s, has ever been deallocated.
*/
-static unsigned int IsOnDeallocated (DynamicStrings_String s);
+static bool IsOnDeallocated (DynamicStrings_String s);
/*
SubAllocated - removes string, s, from the list of allocated strings.
IsOnGarbage - returns TRUE if, s, is on string, e, garbage list.
*/
-static unsigned int IsOnGarbage (DynamicStrings_String e, DynamicStrings_String s);
+static bool IsOnGarbage (DynamicStrings_String e, DynamicStrings_String s);
/*
IsWhite - returns TRUE if, ch, is a space or a tab.
*/
-static unsigned int IsWhite (char ch);
+static bool IsWhite (char ch);
/*
DumpState -
{
if (CheckOn)
{
- s = DynamicStrings_PopAllocationExemption (TRUE, s);
+ s = DynamicStrings_PopAllocationExemption (true, s);
}
}
IsOn - returns TRUE if, s, is on one of the debug lists.
*/
-static unsigned int IsOn (DynamicStrings_String list, DynamicStrings_String s)
+static bool IsOn (DynamicStrings_String list, DynamicStrings_String s)
{
while ((list != s) && (list != NULL))
{
IsOnAllocated - returns TRUE if the string, s, has ever been allocated.
*/
-static unsigned int IsOnAllocated (DynamicStrings_String s)
+static bool IsOnAllocated (DynamicStrings_String s)
{
DynamicStrings_frame f;
do {
if (IsOn (f->alloc, s))
{
- return TRUE;
+ return true;
}
else
{
f = f->next;
}
} while (! (f == NULL));
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
IsOnDeallocated - returns TRUE if the string, s, has ever been deallocated.
*/
-static unsigned int IsOnDeallocated (DynamicStrings_String s)
+static bool IsOnDeallocated (DynamicStrings_String s)
{
DynamicStrings_frame f;
do {
if (IsOn (f->dealloc, s))
{
- return TRUE;
+ return true;
}
else
{
f = f->next;
}
} while (! (f == NULL));
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
{
Storage_DEALLOCATE (&s->head->charStar, s->head->charStarSize);
}
- s->head->charStarUsed = FALSE;
+ s->head->charStarUsed = false;
s->head->charStar = NULL;
s->head->charStarSize = 0;
- s->head->charStarValid = FALSE;
+ s->head->charStarValid = false;
}
}
}
if (s->head != NULL)
{
- s->head->charStarValid = FALSE;
+ s->head->charStarValid = false;
}
}
IsOnGarbage - returns TRUE if, s, is on string, e, garbage list.
*/
-static unsigned int IsOnGarbage (DynamicStrings_String e, DynamicStrings_String s)
+static bool IsOnGarbage (DynamicStrings_String e, DynamicStrings_String s)
{
if ((e != NULL) && (s != NULL))
{
{
if (e->head->garbage == s)
{
- return TRUE;
+ return true;
}
else
{
}
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
IsWhite - returns TRUE if, ch, is a space or a tab.
*/
-static unsigned int IsWhite (char ch)
+static bool IsWhite (char ch)
{
return (ch == ' ') || (ch == ASCII_tab);
/* static analysis guarentees a RETURN statement will be used before here. */
{
if (! Initialized)
{
- Initialized = TRUE;
+ Initialized = true;
frameHead = NULL;
DynamicStrings_PushAllocation ();
}
s->contents.next = NULL;
ConcatContents (&s->contents, (const char *) a, _a_high, StrLib_StrLen ((const char *) a, _a_high), 0);
Storage_ALLOCATE ((void **) &s->head, sizeof (DynamicStrings_descriptor));
- s->head->charStarUsed = FALSE;
+ s->head->charStarUsed = false;
s->head->charStar = NULL;
s->head->charStarSize = 0;
- s->head->charStarValid = FALSE;
+ s->head->charStarValid = false;
s->head->garbage = NULL;
s->head->state = DynamicStrings_inuse;
AddDebugInfo (s);
ConcatContentsAddress (&s->contents, a, static_cast<unsigned int> (libc_strlen (a)));
}
Storage_ALLOCATE ((void **) &s->head, sizeof (DynamicStrings_descriptor));
- s->head->charStarUsed = FALSE;
+ s->head->charStarUsed = false;
s->head->charStar = NULL;
s->head->charStarSize = 0;
- s->head->charStarValid = FALSE;
+ s->head->charStarValid = false;
s->head->garbage = NULL;
s->head->state = DynamicStrings_inuse;
AddDebugInfo (s);
Equal - returns TRUE if String, a, and, b, are equal.
*/
-extern "C" unsigned int DynamicStrings_Equal (DynamicStrings_String a, DynamicStrings_String b)
+extern "C" bool DynamicStrings_Equal (DynamicStrings_String a, DynamicStrings_String b)
{
unsigned int i;
{
if (a->contents.buf.array[i] != b->contents.buf.array[i])
{
- return FALSE;
+ return false;
}
i += 1;
}
a = a->contents.next;
b = b->contents.next;
}
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
string, a.
*/
-extern "C" unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, void * a)
+extern "C" bool DynamicStrings_EqualCharStar (DynamicStrings_String s, void * a)
{
DynamicStrings_String t;
if (DynamicStrings_Equal (t, s))
{
t = DynamicStrings_KillString (t);
- return TRUE;
+ return true;
}
else
{
t = DynamicStrings_KillString (t);
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
string, a.
*/
-extern "C" unsigned int DynamicStrings_EqualArray (DynamicStrings_String s, const char *a_, unsigned int _a_high)
+extern "C" bool DynamicStrings_EqualArray (DynamicStrings_String s, const char *a_, unsigned int _a_high)
{
DynamicStrings_String t;
char a[_a_high+1];
if (DynamicStrings_Equal (t, s))
{
t = DynamicStrings_KillString (t);
- return TRUE;
+ return true;
}
else
{
t = DynamicStrings_KillString (t);
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
DeallocateCharStar (s);
Storage_ALLOCATE (&s->head->charStar, l+1);
s->head->charStarSize = l+1;
- s->head->charStarUsed = TRUE;
+ s->head->charStarUsed = true;
}
p = static_cast<string__T2> (s->head->charStar);
a = s;
a = a->contents.next;
}
(*p) = ASCII_nul;
- s->head->charStarValid = TRUE;
+ s->head->charStarValid = true;
}
return s->head->charStar;
}
with an exit code of 1.
*/
-extern "C" void DynamicStrings_PopAllocation (unsigned int halt)
+extern "C" void DynamicStrings_PopAllocation (bool halt)
{
if (CheckOn)
{
with an exit code of 1.
*/
-extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned int halt, DynamicStrings_String e)
+extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (bool halt, DynamicStrings_String e)
{
DynamicStrings_String s;
DynamicStrings_frame f;
- unsigned int b;
+ bool b;
Init ();
if (CheckOn)
{
if (frameHead->alloc != NULL)
{
- b = FALSE;
+ b = false;
s = frameHead->alloc;
while (s != NULL)
{
{
writeString ((const char *) "the following strings have been lost", 36);
writeLn ();
- b = TRUE;
+ b = true;
}
DumpStringInfo (s, 0);
}
extern "C" void _M2_DynamicStrings_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
{
- Initialized = FALSE;
+ Initialized = false;
Init ();
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
Equal - returns TRUE if String, a, and, b, are equal.
*/
-EXTERN unsigned int DynamicStrings_Equal (DynamicStrings_String a, DynamicStrings_String b);
+EXTERN bool DynamicStrings_Equal (DynamicStrings_String a, DynamicStrings_String b);
/*
EqualCharStar - returns TRUE if contents of String, s, is
the same as the string, a.
*/
-EXTERN unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, void * a);
+EXTERN bool DynamicStrings_EqualCharStar (DynamicStrings_String s, void * a);
/*
EqualArray - returns TRUE if contents of String, s, is the
same as the string, a.
*/
-EXTERN unsigned int DynamicStrings_EqualArray (DynamicStrings_String s, const char *a_, unsigned int _a_high);
+EXTERN bool DynamicStrings_EqualArray (DynamicStrings_String s, const char *a_, unsigned int _a_high);
/*
Mult - returns a new string which is n concatenations of String, s.
with an exit code of 1.
*/
-EXTERN void DynamicStrings_PopAllocation (unsigned int halt);
+EXTERN void DynamicStrings_PopAllocation (bool halt);
/*
PopAllocationExemption - test to see that all strings are
The string, e, is returned unmodified,
*/
-EXTERN DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned int halt, DynamicStrings_String e);
+EXTERN DynamicStrings_String DynamicStrings_PopAllocationExemption (bool halt, DynamicStrings_String e);
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
the processes environment.
*/
-extern "C" unsigned int Environment_GetEnvironment (const char *Env_, unsigned int _Env_high, char *dest, unsigned int _dest_high);
+extern "C" bool Environment_GetEnvironment (const char *Env_, unsigned int _Env_high, char *dest, unsigned int _dest_high);
/*
PutEnvironment - change or add an environment variable definition EnvDef.
set or changed successfully.
*/
-extern "C" unsigned int Environment_PutEnvironment (const char *EnvDef_, unsigned int _EnvDef_high);
+extern "C" bool Environment_PutEnvironment (const char *EnvDef_, unsigned int _EnvDef_high);
/*
the processes environment.
*/
-extern "C" unsigned int Environment_GetEnvironment (const char *Env_, unsigned int _Env_high, char *dest, unsigned int _dest_high)
+extern "C" bool Environment_GetEnvironment (const char *Env_, unsigned int _Env_high, char *dest, unsigned int _dest_high)
{
typedef char *GetEnvironment__T1;
set or changed successfully.
*/
-extern "C" unsigned int Environment_PutEnvironment (const char *EnvDef_, unsigned int _EnvDef_high)
+extern "C" bool Environment_PutEnvironment (const char *EnvDef_, unsigned int _EnvDef_high)
{
char EnvDef[_EnvDef_high+1];
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
the processes environment.
*/
-EXTERN unsigned int Environment_GetEnvironment (const char *Env_, unsigned int _Env_high, char *dest, unsigned int _dest_high);
+EXTERN bool Environment_GetEnvironment (const char *Env_, unsigned int _Env_high, char *dest, unsigned int _dest_high);
/*
PutEnvironment - change or add an environment variable definition
set or changed successfully.
*/
-EXTERN unsigned int Environment_PutEnvironment (const char *EnvDef_, unsigned int _EnvDef_high);
+EXTERN bool Environment_PutEnvironment (const char *EnvDef_, unsigned int _EnvDef_high);
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
};
struct FIO_buf_r {
- unsigned int valid;
+ bool valid;
long int bufstart;
unsigned int position;
void *address;
FIO_NameInfo name;
FIO_FileStatus state;
FIO_FileUsage usage;
- unsigned int output;
+ bool output;
FIO_Buffer buffer;
long int abspos;
};
IsNoError - returns a TRUE if no error has occured on file, f.
*/
-extern "C" unsigned int FIO_IsNoError (FIO_File f);
+extern "C" bool FIO_IsNoError (FIO_File f);
/*
IsActive - returns TRUE if the file, f, is still active.
*/
-extern "C" unsigned int FIO_IsActive (FIO_File f);
-extern "C" unsigned int FIO_Exists (const char *fname_, unsigned int _fname_high);
+extern "C" bool FIO_IsActive (FIO_File f);
+extern "C" bool FIO_Exists (const char *fname_, unsigned int _fname_high);
extern "C" FIO_File FIO_OpenToRead (const char *fname_, unsigned int _fname_high);
extern "C" FIO_File FIO_OpenToWrite (const char *fname_, unsigned int _fname_high);
-extern "C" FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high, unsigned int towrite, unsigned int newfile);
+extern "C" FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high, bool towrite, bool newfile);
/*
Close - close a file which has been previously opened using:
exists - returns TRUE if a file named, fname exists for reading.
*/
-extern "C" unsigned int FIO_exists (void * fname, unsigned int flength);
+extern "C" bool FIO_exists (void * fname, unsigned int flength);
/*
openToRead - attempts to open a file, fname, for reading and
opened for writing or reading.
*/
-extern "C" FIO_File FIO_openForRandom (void * fname, unsigned int flength, unsigned int towrite, unsigned int newfile);
+extern "C" FIO_File FIO_openForRandom (void * fname, unsigned int flength, bool towrite, bool newfile);
/*
FlushBuffer - flush contents of file, f.
EOF - tests to see whether a file, f, has reached end of file.
*/
-extern "C" unsigned int FIO_EOF (FIO_File f);
+extern "C" bool FIO_EOF (FIO_File f);
/*
EOLN - tests to see whether a file, f, is upon a newline.
It does NOT consume the newline.
*/
-extern "C" unsigned int FIO_EOLN (FIO_File f);
+extern "C" bool FIO_EOLN (FIO_File f);
/*
WasEOLN - tests to see whether a file, f, has just seen a newline.
*/
-extern "C" unsigned int FIO_WasEOLN (FIO_File f);
+extern "C" bool FIO_WasEOLN (FIO_File f);
/*
ReadChar - returns a character read from file f.
InitializeFile - initialize a file descriptor
*/
-static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FIO_FileStatus fstate, FIO_FileUsage use, unsigned int towrite, unsigned int buflength);
+static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FIO_FileStatus fstate, FIO_FileUsage use, bool towrite, unsigned int buflength);
/*
ConnectToUnix - connects a FIO file to a UNIX file descriptor.
*/
-static void ConnectToUnix (FIO_File f, unsigned int towrite, unsigned int newfile);
+static void ConnectToUnix (FIO_File f, bool towrite, bool newfile);
/*
ReadFromBuffer - attempts to read, nBytes, from file, f.
opened for read/write.
*/
-static void CheckAccess (FIO_File f, FIO_FileUsage use, unsigned int towrite);
+static void CheckAccess (FIO_File f, FIO_FileUsage use, bool towrite);
/*
SetEndOfLine -
PreInitialize - preinitialize the file descriptor.
*/
-static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FIO_FileStatus state, FIO_FileUsage use, unsigned int towrite, int osfd, unsigned int bufsize);
+static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FIO_FileStatus state, FIO_FileUsage use, bool towrite, int osfd, unsigned int bufsize);
/*
Init - initialize the modules, global variables.
InitializeFile - initialize a file descriptor
*/
-static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FIO_FileStatus fstate, FIO_FileUsage use, unsigned int towrite, unsigned int buflength)
+static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FIO_FileStatus fstate, FIO_FileUsage use, bool towrite, unsigned int buflength)
{
FIO_PtrToChar p;
FIO_FileDescriptor fd;
}
else
{
- fd->buffer->valid = FALSE;
+ fd->buffer->valid = false;
fd->buffer->bufstart = 0;
fd->buffer->size = buflength;
fd->buffer->position = 0;
ConnectToUnix - connects a FIO file to a UNIX file descriptor.
*/
-static void ConnectToUnix (FIO_File f, unsigned int towrite, unsigned int newfile)
+static void ConnectToUnix (FIO_File f, bool towrite, bool newfile)
{
FIO_FileDescriptor fd;
/* now disable the buffer as we read directly into, a. */
if (fd->buffer != NULL)
{
- fd->buffer->valid = FALSE;
+ fd->buffer->valid = false;
}
}
else
/* indicate buffer is empty */
if (fd->buffer != NULL)
{
- fd->buffer->valid = FALSE;
+ fd->buffer->valid = false;
fd->buffer->left = 0;
fd->buffer->position = 0;
if (fd->buffer->address != NULL)
if (n >= 0)
{
/* avoid dangling else. */
- fd->buffer->valid = TRUE;
+ fd->buffer->valid = true;
fd->buffer->position = 0;
fd->buffer->left = n;
fd->buffer->filled = n;
}
else
{
- fd->buffer->valid = FALSE;
+ fd->buffer->valid = false;
fd->buffer->position = 0;
fd->buffer->left = 0;
fd->buffer->filled = 0;
opened for read/write.
*/
-static void CheckAccess (FIO_File f, FIO_FileUsage use, unsigned int towrite)
+static void CheckAccess (FIO_File f, FIO_FileUsage use, bool towrite)
{
FIO_FileDescriptor fd;
{
FIO_FileDescriptor fd;
- CheckAccess (f, FIO_openedforread, FALSE);
+ CheckAccess (f, FIO_openedforread, false);
if (f != Error)
{
fd = static_cast<FIO_FileDescriptor> (Indexing_GetIndice (FileInfo, f));
PreInitialize - preinitialize the file descriptor.
*/
-static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FIO_FileStatus state, FIO_FileUsage use, unsigned int towrite, int osfd, unsigned int bufsize)
+static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FIO_FileStatus state, FIO_FileUsage use, bool towrite, int osfd, unsigned int bufsize)
{
FIO_FileDescriptor fd;
FIO_FileDescriptor fe;
{
FileInfo = Indexing_InitIndex (0);
Error = 0;
- PreInitialize (Error, (const char *) "error", 5, FIO_toomanyfilesopen, FIO_unused, FALSE, -1, 0);
+ PreInitialize (Error, (const char *) "error", 5, FIO_toomanyfilesopen, FIO_unused, false, -1, 0);
FIO_StdIn = 1;
- PreInitialize (FIO_StdIn, (const char *) "<stdin>", 7, FIO_successful, FIO_openedforread, FALSE, 0, MaxBufferLength);
+ PreInitialize (FIO_StdIn, (const char *) "<stdin>", 7, FIO_successful, FIO_openedforread, false, 0, MaxBufferLength);
FIO_StdOut = 2;
- PreInitialize (FIO_StdOut, (const char *) "<stdout>", 8, FIO_successful, FIO_openedforwrite, TRUE, 1, MaxBufferLength);
+ PreInitialize (FIO_StdOut, (const char *) "<stdout>", 8, FIO_successful, FIO_openedforwrite, true, 1, MaxBufferLength);
FIO_StdErr = 3;
- PreInitialize (FIO_StdErr, (const char *) "<stderr>", 8, FIO_successful, FIO_openedforwrite, TRUE, 2, MaxBufferLength);
+ PreInitialize (FIO_StdErr, (const char *) "<stderr>", 8, FIO_successful, FIO_openedforwrite, true, 2, MaxBufferLength);
if (! (M2RTS_InstallTerminationProcedure ((PROC ) {(PROC_t) FIO_FlushOutErr})))
{
M2RTS_HALT (-1);
IsNoError - returns a TRUE if no error has occured on file, f.
*/
-extern "C" unsigned int FIO_IsNoError (FIO_File f)
+extern "C" bool FIO_IsNoError (FIO_File f)
{
FIO_FileDescriptor fd;
if (f == Error)
{
- return FALSE;
+ return false;
}
else
{
IsActive - returns TRUE if the file, f, is still active.
*/
-extern "C" unsigned int FIO_IsActive (FIO_File f)
+extern "C" bool FIO_IsActive (FIO_File f)
{
if (f == Error)
{
- return FALSE;
+ return false;
}
else
{
__builtin_unreachable ();
}
-extern "C" unsigned int FIO_Exists (const char *fname_, unsigned int _fname_high)
+extern "C" bool FIO_Exists (const char *fname_, unsigned int _fname_high)
{
char fname[_fname_high+1];
__builtin_unreachable ();
}
-extern "C" FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high, unsigned int towrite, unsigned int newfile)
+extern "C" FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high, bool towrite, bool newfile)
{
char fname[_fname_high+1];
exists - returns TRUE if a file named, fname exists for reading.
*/
-extern "C" unsigned int FIO_exists (void * fname, unsigned int flength)
+extern "C" bool FIO_exists (void * fname, unsigned int flength)
{
FIO_File f;
if (FIO_IsNoError (f))
{
FIO_Close (f);
- return TRUE;
+ return true;
}
else
{
FIO_Close (f);
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
else
{
- f = InitializeFile (f, fname, flength, FIO_successful, FIO_openedforread, FALSE, MaxBufferLength);
- ConnectToUnix (f, FALSE, FALSE);
+ f = InitializeFile (f, fname, flength, FIO_successful, FIO_openedforread, false, MaxBufferLength);
+ ConnectToUnix (f, false, false);
}
return f;
/* static analysis guarentees a RETURN statement will be used before here. */
}
else
{
- f = InitializeFile (f, fname, flength, FIO_successful, FIO_openedforwrite, TRUE, MaxBufferLength);
- ConnectToUnix (f, TRUE, TRUE);
+ f = InitializeFile (f, fname, flength, FIO_successful, FIO_openedforwrite, true, MaxBufferLength);
+ ConnectToUnix (f, true, true);
}
return f;
/* static analysis guarentees a RETURN statement will be used before here. */
opened for writing or reading.
*/
-extern "C" FIO_File FIO_openForRandom (void * fname, unsigned int flength, unsigned int towrite, unsigned int newfile)
+extern "C" FIO_File FIO_openForRandom (void * fname, unsigned int flength, bool towrite, bool newfile)
{
FIO_File f;
if (f != Error)
{
- CheckAccess (f, FIO_openedforread, FALSE);
+ CheckAccess (f, FIO_openedforread, false);
n = ReadFromBuffer (f, dest, nBytes);
if (n <= 0)
{
extern "C" void FIO_ReadAny (FIO_File f, unsigned char *a, unsigned int _a_high)
{
- CheckAccess (f, FIO_openedforread, FALSE);
+ CheckAccess (f, FIO_openedforread, false);
if ((BufferedRead (f, _a_high, a)) == ((int ) (_a_high)))
{
SetEndOfLine (f, static_cast<char> (a[_a_high]));
int total;
FIO_FileDescriptor fd;
- CheckAccess (f, FIO_openedforwrite, TRUE);
+ CheckAccess (f, FIO_openedforwrite, true);
FIO_FlushBuffer (f);
if (f != Error)
{
extern "C" void FIO_WriteAny (FIO_File f, unsigned char *a, unsigned int _a_high)
{
- CheckAccess (f, FIO_openedforwrite, TRUE);
+ CheckAccess (f, FIO_openedforwrite, true);
if ((BufferedWrite (f, _a_high, a)) == ((int ) (_a_high)))
{} /* empty. */
}
extern "C" void FIO_WriteChar (FIO_File f, char ch)
{
- CheckAccess (f, FIO_openedforwrite, TRUE);
+ CheckAccess (f, FIO_openedforwrite, true);
if ((BufferedWrite (f, sizeof (ch), &ch)) == ((int ) (sizeof (ch))))
{} /* empty. */
}
EOF - tests to see whether a file, f, has reached end of file.
*/
-extern "C" unsigned int FIO_EOF (FIO_File f)
+extern "C" bool FIO_EOF (FIO_File f)
{
FIO_FileDescriptor fd;
- CheckAccess (f, FIO_openedforread, FALSE);
+ CheckAccess (f, FIO_openedforread, false);
if (f != Error)
{
fd = static_cast<FIO_FileDescriptor> (Indexing_GetIndice (FileInfo, f));
return fd->state == FIO_endoffile;
}
}
- return TRUE;
+ return true;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
It does NOT consume the newline.
*/
-extern "C" unsigned int FIO_EOLN (FIO_File f)
+extern "C" bool FIO_EOLN (FIO_File f)
{
char ch;
FIO_FileDescriptor fd;
- CheckAccess (f, FIO_openedforread, FALSE);
+ CheckAccess (f, FIO_openedforread, false);
/*
we will read a character and then push it back onto the input stream,
having noted the file status, we also reset the status.
}
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
WasEOLN - tests to see whether a file, f, has just seen a newline.
*/
-extern "C" unsigned int FIO_WasEOLN (FIO_File f)
+extern "C" bool FIO_WasEOLN (FIO_File f)
{
FIO_FileDescriptor fd;
- CheckAccess (f, FIO_openedforread, FALSE);
+ CheckAccess (f, FIO_openedforread, false);
if (f == Error)
{
- return FALSE;
+ return false;
}
else
{
{
char ch;
- CheckAccess (f, FIO_openedforread, FALSE);
+ CheckAccess (f, FIO_openedforread, false);
if ((BufferedRead (f, sizeof (ch), &ch)) == ((int ) (sizeof (ch))))
{
SetEndOfLine (f, ch);
void * a;
void * b;
- CheckAccess (f, FIO_openedforread, FALSE);
+ CheckAccess (f, FIO_openedforread, false);
if (f != Error)
{
fd = static_cast<FIO_FileDescriptor> (Indexing_GetIndice (FileInfo, f));
unsigned int i;
char ch;
- CheckAccess (f, FIO_openedforread, FALSE);
+ CheckAccess (f, FIO_openedforread, false);
high = _a_high;
i = 0;
do {
{
/* always force the lseek, until we are confident that abspos is always correct,
basically it needs some hard testing before we should remove the OR TRUE. */
- if ((fd->abspos != pos) || TRUE)
+ if ((fd->abspos != pos) || true)
{
FIO_FlushBuffer (f);
if (fd->buffer != NULL)
}
if (fd->buffer != NULL)
{
- fd->buffer->valid = FALSE;
+ fd->buffer->valid = false;
fd->buffer->bufstart = fd->abspos;
}
}
}
if (fd->buffer != NULL)
{
- fd->buffer->valid = FALSE;
+ fd->buffer->valid = false;
fd->buffer->bufstart = offset;
}
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
IsNoError - returns a TRUE if no error has occured on file, f.
*/
-EXTERN unsigned int FIO_IsNoError (FIO_File f);
+EXTERN bool FIO_IsNoError (FIO_File f);
/*
IsActive - returns TRUE if the file, f, is still active.
*/
-EXTERN unsigned int FIO_IsActive (FIO_File f);
+EXTERN bool FIO_IsActive (FIO_File f);
/*
Exists - returns TRUE if a file named, fname exists for reading.
*/
-EXTERN unsigned int FIO_Exists (const char *fname_, unsigned int _fname_high);
+EXTERN bool FIO_Exists (const char *fname_, unsigned int _fname_high);
/*
OpenToRead - attempts to open a file, fname, for reading and
and modify an existing file.
*/
-EXTERN FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high, unsigned int towrite, unsigned int newfile);
+EXTERN FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high, bool towrite, bool newfile);
/*
Close - close a file which has been previously opened using:
*/
EXTERN void FIO_Close (FIO_File f);
-EXTERN unsigned int FIO_exists (void * fname, unsigned int flength);
+EXTERN bool FIO_exists (void * fname, unsigned int flength);
EXTERN FIO_File FIO_openToRead (void * fname, unsigned int flength);
EXTERN FIO_File FIO_openToWrite (void * fname, unsigned int flength);
-EXTERN FIO_File FIO_openForRandom (void * fname, unsigned int flength, unsigned int towrite, unsigned int newfile);
+EXTERN FIO_File FIO_openForRandom (void * fname, unsigned int flength, bool towrite, bool newfile);
/*
FlushBuffer - flush contents of the FIO file, f, to libc.
EOF - tests to see whether a file, f, has reached end of file.
*/
-EXTERN unsigned int FIO_EOF (FIO_File f);
+EXTERN bool FIO_EOF (FIO_File f);
/*
EOLN - tests to see whether a file, f, is about to read a newline.
and then immediately unreads the character.
*/
-EXTERN unsigned int FIO_EOLN (FIO_File f);
+EXTERN bool FIO_EOLN (FIO_File f);
/*
WasEOLN - tests to see whether a file, f, has just read a newline
character.
*/
-EXTERN unsigned int FIO_WasEOLN (FIO_File f);
+EXTERN bool FIO_WasEOLN (FIO_File f);
/*
ReadChar - returns a character read from file, f.
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
IsDigit - returns TRUE if ch lies in the range: 0..9
*/
-static unsigned int IsDigit (char ch);
+static bool IsDigit (char ch);
/*
Cast - casts a := b
isHex -
*/
-static unsigned int isHex (char ch);
+static bool isHex (char ch);
/*
toHex -
isOct -
*/
-static unsigned int isOct (char ch);
+static bool isOct (char ch);
/*
FormatString - returns a String containing, s, together with encapsulated
static void doDSdbExit (DynamicStrings_String s)
{
- s = DynamicStrings_PopAllocationExemption (TRUE, s);
+ s = DynamicStrings_PopAllocationExemption (true, s);
}
IsDigit - returns TRUE if ch lies in the range: 0..9
*/
-static unsigned int IsDigit (char ch)
+static bool IsDigit (char ch)
{
return (ch >= '0') && (ch <= '9');
/* static analysis guarentees a RETURN statement will be used before here. */
isHex -
*/
-static unsigned int isHex (char ch)
+static bool isHex (char ch)
{
return (((ch >= '0') && (ch <= '9')) || ((ch >= 'A') && (ch <= 'F'))) || ((ch >= 'a') && (ch <= 'f'));
/* static analysis guarentees a RETURN statement will be used before here. */
isOct -
*/
-static unsigned int isOct (char ch)
+static bool isOct (char ch)
{
return (ch >= '0') && (ch <= '8');
/* static analysis guarentees a RETURN statement will be used before here. */
static DynamicStrings_String PerformFormatString (DynamicStrings_String fmt, int *startpos, DynamicStrings_String in, const unsigned char *w_, unsigned int _w_high)
{
- unsigned int left;
+ bool left;
unsigned int u;
int c;
int width;
afterperc += 1;
if ((DynamicStrings_char (fmt, afterperc)) == '-')
{
- left = TRUE;
+ left = true;
afterperc += 1;
}
else
{
- left = FALSE;
+ left = false;
}
ch = DynamicStrings_char (fmt, afterperc);
if (ch == '0')
afterperc += 1;
Cast ((unsigned char *) &c, (sizeof (c)-1), (const unsigned char *) w, _w_high);
in = Copy (fmt, in, (*startpos), nextperc);
- in = DynamicStrings_ConCat (in, StringConvert_IntegerToString (c, static_cast<unsigned int> (width), leader, FALSE, 10, FALSE));
+ in = DynamicStrings_ConCat (in, StringConvert_IntegerToString (c, static_cast<unsigned int> (width), leader, false, 10, false));
(*startpos) = afterperc;
DSdbExit (static_cast<DynamicStrings_String> (NULL));
return in;
afterperc += 1;
Cast ((unsigned char *) &u, (sizeof (u)-1), (const unsigned char *) w, _w_high);
in = DynamicStrings_ConCat (in, DynamicStrings_Slice (fmt, (*startpos), nextperc));
- in = DynamicStrings_ConCat (in, StringConvert_CardinalToString (u, static_cast<unsigned int> (width), leader, 16, TRUE));
+ in = DynamicStrings_ConCat (in, StringConvert_CardinalToString (u, static_cast<unsigned int> (width), leader, 16, true));
(*startpos) = afterperc;
DSdbExit (static_cast<DynamicStrings_String> (NULL));
return in;
afterperc += 1;
Cast ((unsigned char *) &u, (sizeof (u)-1), (const unsigned char *) w, _w_high);
in = DynamicStrings_ConCat (in, DynamicStrings_Slice (fmt, (*startpos), nextperc));
- in = DynamicStrings_ConCat (in, StringConvert_CardinalToString (u, static_cast<unsigned int> (width), leader, 10, FALSE));
+ in = DynamicStrings_ConCat (in, StringConvert_CardinalToString (u, static_cast<unsigned int> (width), leader, 10, false));
(*startpos) = afterperc;
DSdbExit (static_cast<DynamicStrings_String> (NULL));
return in;
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
extern "C" void FpuIO_StrToLongReal (const char *a_, unsigned int _a_high, long double *x)
{
- unsigned int found;
+ bool found;
DynamicStrings_String s;
char a[_a_high+1];
extern "C" void FpuIO_StrToLongInt (const char *a_, unsigned int _a_high, long int *x)
{
DynamicStrings_String s;
- unsigned int found;
+ bool found;
char a[_a_high+1];
/* make a local copy of each unbounded array. */
{
DynamicStrings_String s;
- s = StringConvert_LongIntegerToString (x, n, ' ', FALSE, 10, TRUE);
+ s = StringConvert_LongIntegerToString (x, n, ' ', false, 10, true);
DynamicStrings_CopyOut ((char *) a, _a_high, s);
s = DynamicStrings_KillString (s);
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
typedef struct IO__T1_a IO__T1;
struct IO_BasicFds_r {
- unsigned int IsEof;
- unsigned int IsRaw;
+ bool IsEof;
+ bool IsRaw;
};
struct IO__T1_a { IO_BasicFds array[MaxDefaultFd+1]; };
*/
extern "C" void IO_Error (char ch);
-extern "C" void IO_UnBufferedMode (int fd, unsigned int input);
-extern "C" void IO_BufferedMode (int fd, unsigned int input);
+extern "C" void IO_UnBufferedMode (int fd, bool input);
+extern "C" void IO_BufferedMode (int fd, bool input);
/*
EchoOn - turns on echoing for file descriptor, fd. This
which is attached to a particular piece of hardware.
*/
-extern "C" void IO_EchoOn (int fd, unsigned int input);
+extern "C" void IO_EchoOn (int fd, bool input);
/*
EchoOff - turns off echoing for file descriptor, fd. This
which is attached to a particular piece of hardware.
*/
-extern "C" void IO_EchoOff (int fd, unsigned int input);
+extern "C" void IO_EchoOff (int fd, bool input);
/*
IsDefaultFd - returns TRUE if, fd, is 0, 1 or 2.
*/
-static unsigned int IsDefaultFd (int fd);
+static bool IsDefaultFd (int fd);
/*
doWrite - performs the write of a single character, ch,
setFlag - sets or unsets the appropriate flag in, t.
*/
-static void setFlag (termios_TERMIOS t, termios_Flag f, unsigned int b);
+static void setFlag (termios_TERMIOS t, termios_Flag f, bool b);
/*
doraw - sets all the flags associated with making this
IsDefaultFd - returns TRUE if, fd, is 0, 1 or 2.
*/
-static unsigned int IsDefaultFd (int fd)
+static bool IsDefaultFd (int fd)
{
return (fd <= MaxDefaultFd) && (fd >= 0);
/* static analysis guarentees a RETURN statement will be used before here. */
r = errno_geterrno ();
if ((r != errno_EAGAIN) && (r != errno_EINTR))
{
- fdState.array[fd].IsEof = TRUE;
+ fdState.array[fd].IsEof = true;
return ;
}
}
setFlag - sets or unsets the appropriate flag in, t.
*/
-static void setFlag (termios_TERMIOS t, termios_Flag f, unsigned int b)
+static void setFlag (termios_TERMIOS t, termios_Flag f, bool b)
{
if (termios_SetFlag (t, f, b))
{} /* empty. */
* termios_p->c_cflag &= ~(CSIZE | PARENB);
* termios_p->c_cflag |= CS8;
*/
- setFlag (term, termios_ignbrk, FALSE);
- setFlag (term, termios_ibrkint, FALSE);
- setFlag (term, termios_iparmrk, FALSE);
- setFlag (term, termios_istrip, FALSE);
- setFlag (term, termios_inlcr, FALSE);
- setFlag (term, termios_igncr, FALSE);
- setFlag (term, termios_icrnl, FALSE);
- setFlag (term, termios_ixon, FALSE);
- setFlag (term, termios_opost, FALSE);
- setFlag (term, termios_lecho, FALSE);
- setFlag (term, termios_lechonl, FALSE);
- setFlag (term, termios_licanon, FALSE);
- setFlag (term, termios_lisig, FALSE);
- setFlag (term, termios_liexten, FALSE);
- setFlag (term, termios_parenb, FALSE);
- setFlag (term, termios_cs8, TRUE);
+ setFlag (term, termios_ignbrk, false);
+ setFlag (term, termios_ibrkint, false);
+ setFlag (term, termios_iparmrk, false);
+ setFlag (term, termios_istrip, false);
+ setFlag (term, termios_inlcr, false);
+ setFlag (term, termios_igncr, false);
+ setFlag (term, termios_icrnl, false);
+ setFlag (term, termios_ixon, false);
+ setFlag (term, termios_opost, false);
+ setFlag (term, termios_lecho, false);
+ setFlag (term, termios_lechonl, false);
+ setFlag (term, termios_licanon, false);
+ setFlag (term, termios_lisig, false);
+ setFlag (term, termios_liexten, false);
+ setFlag (term, termios_parenb, false);
+ setFlag (term, termios_cs8, true);
}
* termios_p->c_cflag &= ~(CSIZE | PARENB);
* termios_p->c_cflag |= CS8;
*/
- setFlag (term, termios_ignbrk, TRUE);
- setFlag (term, termios_ibrkint, TRUE);
- setFlag (term, termios_iparmrk, TRUE);
- setFlag (term, termios_istrip, TRUE);
- setFlag (term, termios_inlcr, TRUE);
- setFlag (term, termios_igncr, TRUE);
- setFlag (term, termios_icrnl, TRUE);
- setFlag (term, termios_ixon, TRUE);
- setFlag (term, termios_opost, TRUE);
- setFlag (term, termios_lecho, TRUE);
- setFlag (term, termios_lechonl, TRUE);
- setFlag (term, termios_licanon, TRUE);
- setFlag (term, termios_lisig, TRUE);
- setFlag (term, termios_liexten, TRUE);
+ setFlag (term, termios_ignbrk, true);
+ setFlag (term, termios_ibrkint, true);
+ setFlag (term, termios_iparmrk, true);
+ setFlag (term, termios_istrip, true);
+ setFlag (term, termios_inlcr, true);
+ setFlag (term, termios_igncr, true);
+ setFlag (term, termios_icrnl, true);
+ setFlag (term, termios_ixon, true);
+ setFlag (term, termios_opost, true);
+ setFlag (term, termios_lecho, true);
+ setFlag (term, termios_lechonl, true);
+ setFlag (term, termios_licanon, true);
+ setFlag (term, termios_lisig, true);
+ setFlag (term, termios_liexten, true);
}
static void Init (void)
{
- fdState.array[0].IsEof = FALSE;
- fdState.array[0].IsRaw = FALSE;
- fdState.array[1].IsEof = FALSE;
- fdState.array[1].IsRaw = FALSE;
- fdState.array[2].IsEof = FALSE;
- fdState.array[2].IsRaw = FALSE;
+ fdState.array[0].IsEof = false;
+ fdState.array[0].IsRaw = false;
+ fdState.array[1].IsEof = false;
+ fdState.array[1].IsRaw = false;
+ fdState.array[2].IsEof = false;
+ fdState.array[2].IsRaw = false;
}
r = errno_geterrno ();
if (r != errno_EAGAIN)
{
- fdState.array[0].IsEof = TRUE;
+ fdState.array[0].IsEof = true;
(*ch) = ASCII_eof;
return ;
}
doWrite (2, FIO_StdErr, ch);
}
-extern "C" void IO_UnBufferedMode (int fd, unsigned int input)
+extern "C" void IO_UnBufferedMode (int fd, bool input)
{
termios_TERMIOS term;
int result;
if (IsDefaultFd (fd))
{
- fdState.array[fd].IsRaw = TRUE;
+ fdState.array[fd].IsRaw = true;
}
term = termios_InitTermios ();
if ((termios_tcgetattr (fd, term)) == 0)
term = termios_KillTermios (term);
}
-extern "C" void IO_BufferedMode (int fd, unsigned int input)
+extern "C" void IO_BufferedMode (int fd, bool input)
{
termios_TERMIOS term;
int r;
if (IsDefaultFd (fd))
{
- fdState.array[fd].IsRaw = FALSE;
+ fdState.array[fd].IsRaw = false;
}
term = termios_InitTermios ();
if ((termios_tcgetattr (fd, term)) == 0)
which is attached to a particular piece of hardware.
*/
-extern "C" void IO_EchoOn (int fd, unsigned int input)
+extern "C" void IO_EchoOn (int fd, bool input)
{
termios_TERMIOS term;
int result;
term = termios_InitTermios ();
if ((termios_tcgetattr (fd, term)) == 0)
{
- setFlag (term, termios_lecho, TRUE);
+ setFlag (term, termios_lecho, true);
if (input)
{
result = termios_tcsetattr (fd, termios_tcsflush (), term);
which is attached to a particular piece of hardware.
*/
-extern "C" void IO_EchoOff (int fd, unsigned int input)
+extern "C" void IO_EchoOff (int fd, bool input)
{
termios_TERMIOS term;
int result;
term = termios_InitTermios ();
if ((termios_tcgetattr (fd, term)) == 0)
{
- setFlag (term, termios_lecho, FALSE);
+ setFlag (term, termios_lecho, false);
if (input)
{
result = termios_tcsetattr (fd, termios_tcsflush (), term);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
UnBufferedMode - places file descriptor, fd, into an unbuffered mode.
*/
-EXTERN void IO_UnBufferedMode (int fd, unsigned int input);
+EXTERN void IO_UnBufferedMode (int fd, bool input);
/*
BufferedMode - places file descriptor, fd, into a buffered mode.
*/
-EXTERN void IO_BufferedMode (int fd, unsigned int input);
+EXTERN void IO_BufferedMode (int fd, bool input);
/*
EchoOn - turns on echoing for file descriptor, fd. This
which is attached to a particular piece of hardware.
*/
-EXTERN void IO_EchoOn (int fd, unsigned int input);
+EXTERN void IO_EchoOn (int fd, bool input);
/*
EchoOff - turns off echoing for file descriptor, fd. This
which is attached to a particular piece of hardware.
*/
-EXTERN void IO_EchoOff (int fd, unsigned int input);
+EXTERN void IO_EchoOff (int fd, bool input);
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
unsigned int Used;
unsigned int Low;
unsigned int High;
- unsigned int Debug;
+ bool Debug;
unsigned int Map;
};
of the dynamic array.
*/
-extern "C" unsigned int Indexing_InBounds (Indexing_Index i, unsigned int n);
+extern "C" bool Indexing_InBounds (Indexing_Index i, unsigned int n);
/*
HighIndice - returns the last legally accessible indice of this array.
IsIndiceInIndex - returns TRUE if, a, is in the index, i.
*/
-extern "C" unsigned int Indexing_IsIndiceInIndex (Indexing_Index i, void * a);
+extern "C" bool Indexing_IsIndiceInIndex (Indexing_Index i, void * a);
/*
RemoveIndiceFromIndex - removes, a, from Index, i.
i->ArraySize = MinSize;
Storage_ALLOCATE (&i->ArrayStart, MinSize);
i->ArrayStart = libc_memset (i->ArrayStart, 0, static_cast<size_t> (i->ArraySize));
- i->Debug = FALSE;
+ i->Debug = false;
i->Used = 0;
i->Map = (unsigned int) 0;
return i;
extern "C" Indexing_Index Indexing_DebugIndex (Indexing_Index i)
{
- i->Debug = TRUE;
+ i->Debug = true;
return i;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
of the dynamic array.
*/
-extern "C" unsigned int Indexing_InBounds (Indexing_Index i, unsigned int n)
+extern "C" bool Indexing_InBounds (Indexing_Index i, unsigned int n)
{
if (i == NULL)
{
IsIndiceInIndex - returns TRUE if, a, is in the index, i.
*/
-extern "C" unsigned int Indexing_IsIndiceInIndex (Indexing_Index i, void * a)
+extern "C" bool Indexing_IsIndiceInIndex (Indexing_Index i, void * a)
{
unsigned int j;
Indexing_PtrToByte b;
p = (Indexing_PtrToAddress) (b);
if ((*p) == a)
{
- return TRUE;
+ return true;
}
/* we must not INC(p, ..) as p2c gets confused */
b += sizeof (void *);
j += 1;
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
of the dynamic array.
*/
-EXTERN unsigned int Indexing_InBounds (Indexing_Index i, unsigned int n);
+EXTERN bool Indexing_InBounds (Indexing_Index i, unsigned int n);
/*
HighIndice - returns the last legally accessible indice of this array.
IsIndiceInIndex - returns TRUE if, a, is in the index, i.
*/
-EXTERN unsigned int Indexing_IsIndiceInIndex (Indexing_Index i, void * a);
+EXTERN bool Indexing_IsIndiceInIndex (Indexing_Index i, void * a);
/*
RemoveIndiceFromIndex - removes, a, from Index, i.
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
struct M2Dependent_DependencyList_r {
PROC proc;
- unsigned int forced;
- unsigned int forc;
- unsigned int appl;
+ bool forced;
+ bool forc;
+ bool appl;
M2Dependent_DependencyState state;
};
};
static M2Dependent__T3 Modules;
-static unsigned int Initialized;
-static unsigned int WarningTrace;
-static unsigned int ModuleTrace;
-static unsigned int HexTrace;
-static unsigned int DependencyTrace;
-static unsigned int PreTrace;
-static unsigned int PostTrace;
-static unsigned int ForceTrace;
+static bool Initialized;
+static bool WarningTrace;
+static bool ModuleTrace;
+static bool HexTrace;
+static bool DependencyTrace;
+static bool PreTrace;
+static bool PostTrace;
+static bool ForceTrace;
/*
ConstructModules - resolve dependencies and then call each
onChain - returns TRUE if mptr is on the Modules[state] list.
*/
-static unsigned int onChain (M2Dependent_DependencyState state, M2Dependent_ModuleChain mptr);
+static bool onChain (M2Dependent_DependencyState state, M2Dependent_ModuleChain mptr);
/*
max -
traceprintf - wrap printf with a boolean flag.
*/
-static void traceprintf (unsigned int flag, const char *str_, unsigned int _str_high);
+static void traceprintf (bool flag, const char *str_, unsigned int _str_high);
/*
traceprintf2 - wrap printf with a boolean flag.
*/
-static void traceprintf2 (unsigned int flag, const char *str_, unsigned int _str_high, void * arg);
+static void traceprintf2 (bool flag, const char *str_, unsigned int _str_high, void * arg);
/*
traceprintf3 - wrap printf with a boolean flag.
*/
-static void traceprintf3 (unsigned int flag, const char *str_, unsigned int _str_high, void * arg1, void * arg2);
+static void traceprintf3 (bool flag, const char *str_, unsigned int _str_high, void * arg1, void * arg2);
/*
moveTo - moves mptr to the new list determined by newstate.
DumpModuleData -
*/
-static void DumpModuleData (unsigned int flag);
+static void DumpModuleData (bool flag);
/*
combine - dest := src + dest. Places src at the front of list dest.
tracemodule -
*/
-static void tracemodule (unsigned int flag, void * modname, unsigned int modlen, void * libname, unsigned int liblen);
+static void tracemodule (bool flag, void * modname, unsigned int modlen, void * libname, unsigned int liblen);
/*
ForceModule -
equal - return TRUE if C string cstr is equal to str.
*/
-static unsigned int equal (void * cstr, const char *str_, unsigned int _str_high);
+static bool equal (void * cstr, const char *str_, unsigned int _str_high);
/*
SetupDebugFlags - By default assigns ModuleTrace, DependencyTrace,
onChain - returns TRUE if mptr is on the Modules[state] list.
*/
-static unsigned int onChain (M2Dependent_DependencyState state, M2Dependent_ModuleChain mptr)
+static bool onChain (M2Dependent_DependencyState state, M2Dependent_ModuleChain mptr)
{
M2Dependent_ModuleChain ptr;
do {
if (ptr == mptr)
{
- return TRUE;
+ return true;
}
ptr = ptr->next;
} while (! (ptr == Modules.array[state-M2Dependent_unregistered]));
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
traceprintf - wrap printf with a boolean flag.
*/
-static void traceprintf (unsigned int flag, const char *str_, unsigned int _str_high)
+static void traceprintf (bool flag, const char *str_, unsigned int _str_high)
{
char str[_str_high+1];
traceprintf2 - wrap printf with a boolean flag.
*/
-static void traceprintf2 (unsigned int flag, const char *str_, unsigned int _str_high, void * arg)
+static void traceprintf2 (bool flag, const char *str_, unsigned int _str_high, void * arg)
{
char ch;
char str[_str_high+1];
traceprintf3 - wrap printf with a boolean flag.
*/
-static void traceprintf3 (unsigned int flag, const char *str_, unsigned int _str_high, void * arg1, void * arg2)
+static void traceprintf3 (bool flag, const char *str_, unsigned int _str_high, void * arg1, void * arg2)
{
char ch;
char str[_str_high+1];
DumpModuleData -
*/
-static void DumpModuleData (unsigned int flag)
+static void DumpModuleData (bool flag)
{
M2Dependent_ModuleChain mptr;
tracemodule -
*/
-static void tracemodule (unsigned int flag, void * modname, unsigned int modlen, void * libname, unsigned int liblen)
+static void tracemodule (bool flag, void * modname, unsigned int modlen, void * libname, unsigned int liblen)
{
typedef struct tracemodule__T4_a tracemodule__T4;
mptr = LookupModuleN (M2Dependent_ordered, modname, modlen, libname, liblen);
if (mptr != NULL)
{
- mptr->dependency.forced = TRUE;
+ mptr->dependency.forced = true;
moveTo (M2Dependent_user, mptr);
}
}
equal - return TRUE if C string cstr is equal to str.
*/
-static unsigned int equal (void * cstr, const char *str_, unsigned int _str_high)
+static bool equal (void * cstr, const char *str_, unsigned int _str_high)
{
char str[_str_high+1];
SetupDebugFlags__T1 pc;
- ModuleTrace = FALSE;
- DependencyTrace = FALSE;
- PostTrace = FALSE;
- PreTrace = FALSE;
- ForceTrace = FALSE;
- HexTrace = FALSE;
- WarningTrace = FALSE;
+ ModuleTrace = false;
+ DependencyTrace = false;
+ PostTrace = false;
+ PreTrace = false;
+ ForceTrace = false;
+ HexTrace = false;
+ WarningTrace = false;
pc = static_cast<SetupDebugFlags__T1> (libc_getenv (const_cast<void*> (reinterpret_cast<const void*>("GCC_M2LINK_RTFLAG"))));
while ((pc != NULL) && ((*pc) != ASCII_nul))
{
if (equal (reinterpret_cast<void *> (pc), (const char *) "all", 3))
{
- ModuleTrace = TRUE;
- DependencyTrace = TRUE;
- PreTrace = TRUE;
- PostTrace = TRUE;
- ForceTrace = TRUE;
- HexTrace = TRUE;
- WarningTrace = TRUE;
+ ModuleTrace = true;
+ DependencyTrace = true;
+ PreTrace = true;
+ PostTrace = true;
+ ForceTrace = true;
+ HexTrace = true;
+ WarningTrace = true;
pc += 3;
}
else if (equal (reinterpret_cast<void *> (pc), (const char *) "module", 6))
{
/* avoid dangling else. */
- ModuleTrace = TRUE;
+ ModuleTrace = true;
pc += 6;
}
else if (equal (reinterpret_cast<void *> (pc), (const char *) "warning", 7))
{
/* avoid dangling else. */
- WarningTrace = TRUE;
+ WarningTrace = true;
pc += 7;
}
else if (equal (reinterpret_cast<void *> (pc), (const char *) "hex", 3))
{
/* avoid dangling else. */
- HexTrace = TRUE;
+ HexTrace = true;
pc += 3;
}
else if (equal (reinterpret_cast<void *> (pc), (const char *) "dep", 3))
{
/* avoid dangling else. */
- DependencyTrace = TRUE;
+ DependencyTrace = true;
pc += 3;
}
else if (equal (reinterpret_cast<void *> (pc), (const char *) "pre", 3))
{
/* avoid dangling else. */
- PreTrace = TRUE;
+ PreTrace = true;
pc += 3;
}
else if (equal (reinterpret_cast<void *> (pc), (const char *) "post", 4))
{
/* avoid dangling else. */
- PostTrace = TRUE;
+ PostTrace = true;
pc += 4;
}
else if (equal (reinterpret_cast<void *> (pc), (const char *) "force", 5))
{
/* avoid dangling else. */
- ForceTrace = TRUE;
+ ForceTrace = true;
pc += 5;
}
else
{
if (! Initialized)
{
- Initialized = TRUE;
+ Initialized = true;
Init ();
}
}
mptr = LookupModule (M2Dependent_unordered, applicationmodule, libname);
if (mptr != NULL)
{
- mptr->dependency.appl = TRUE;
+ mptr->dependency.appl = true;
}
traceprintf (PreTrace, (const char *) "Pre resolving dependents\\n", 26);
DumpModuleData (PreTrace);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
typedef enum {M2EXCEPTION_indexException, M2EXCEPTION_rangeException, M2EXCEPTION_caseSelectException, M2EXCEPTION_invalidLocation, M2EXCEPTION_functionException, M2EXCEPTION_wholeValueException, M2EXCEPTION_wholeDivException, M2EXCEPTION_realValueException, M2EXCEPTION_realDivException, M2EXCEPTION_complexValueException, M2EXCEPTION_complexDivException, M2EXCEPTION_protException, M2EXCEPTION_sysException, M2EXCEPTION_coException, M2EXCEPTION_exException} M2EXCEPTION_M2Exceptions;
extern "C" M2EXCEPTION_M2Exceptions M2EXCEPTION_M2Exception (void);
-extern "C" unsigned int M2EXCEPTION_IsM2Exception (void);
+extern "C" bool M2EXCEPTION_IsM2Exception (void);
extern "C" M2EXCEPTION_M2Exceptions M2EXCEPTION_M2Exception (void)
{
__builtin_unreachable ();
}
-extern "C" unsigned int M2EXCEPTION_IsM2Exception (void)
+extern "C" bool M2EXCEPTION_IsM2Exception (void)
{
RTExceptions_EHBlock e;
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
typedef enum {M2EXCEPTION_indexException, M2EXCEPTION_rangeException, M2EXCEPTION_caseSelectException, M2EXCEPTION_invalidLocation, M2EXCEPTION_functionException, M2EXCEPTION_wholeValueException, M2EXCEPTION_wholeDivException, M2EXCEPTION_realValueException, M2EXCEPTION_realDivException, M2EXCEPTION_complexValueException, M2EXCEPTION_complexDivException, M2EXCEPTION_protException, M2EXCEPTION_sysException, M2EXCEPTION_coException, M2EXCEPTION_exException} M2EXCEPTION_M2Exceptions;
EXTERN M2EXCEPTION_M2Exceptions M2EXCEPTION_M2Exception (void);
-EXTERN unsigned int M2EXCEPTION_IsM2Exception (void);
+EXTERN bool M2EXCEPTION_IsM2Exception (void);
# ifdef __cplusplus
}
# endif
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
typedef char *M2LINK_PtrToChar;
EXTERN M2LINK_PtrToChar M2LINK_ForcedModuleInitOrder;
-EXTERN unsigned int M2LINK_StaticInitialization;
+EXTERN bool M2LINK_StaticInitialization;
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
static M2RTS_ProcedureList InitialProc;
static M2RTS_ProcedureList TerminateProc;
static int ExitValue;
-static unsigned int isHalting;
-static unsigned int CallExit;
-static unsigned int Initialized;
+static bool isHalting;
+static bool CallExit;
+static bool Initialized;
/*
ConstructModules - resolve dependencies and then call each
procedure is installed.
*/
-extern "C" unsigned int M2RTS_InstallTerminationProcedure (PROC p);
+extern "C" bool M2RTS_InstallTerminationProcedure (PROC p);
/*
ExecuteInitialProcedures - executes the initial procedures installed by
main program module.
*/
-extern "C" unsigned int M2RTS_InstallInitialProcedure (PROC p);
+extern "C" bool M2RTS_InstallInitialProcedure (PROC p);
/*
ExecuteTerminationProcedures - calls each installed termination procedure
defined by proclist.
*/
-static unsigned int AppendProc (M2RTS_ProcedureList *proclist, PROC proc);
+static bool AppendProc (M2RTS_ProcedureList *proclist, PROC proc);
/*
ErrorString - writes a string to stderr.
defined by proclist.
*/
-static unsigned int AppendProc (M2RTS_ProcedureList *proclist, PROC proc)
+static bool AppendProc (M2RTS_ProcedureList *proclist, PROC proc)
{
M2RTS_ProcedureChain pdes;
(*proclist).head = pdes;
}
(*proclist).tail = pdes;
- return TRUE;
+ return true;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
InitProcList (&InitialProc);
InitProcList (&TerminateProc);
ExitValue = 0;
- isHalting = FALSE;
- CallExit = FALSE; /* default by calling abort */
+ isHalting = false;
+ CallExit = false; /* default by calling abort */
}
{
if (! Initialized)
{
- Initialized = TRUE;
+ Initialized = true;
Init ();
}
}
procedure is installed.
*/
-extern "C" unsigned int M2RTS_InstallTerminationProcedure (PROC p)
+extern "C" bool M2RTS_InstallTerminationProcedure (PROC p)
{
return AppendProc (&TerminateProc, p);
/* static analysis guarentees a RETURN statement will be used before here. */
main program module.
*/
-extern "C" unsigned int M2RTS_InstallInitialProcedure (PROC p)
+extern "C" bool M2RTS_InstallInitialProcedure (PROC p)
{
return AppendProc (&InitialProc, p);
/* static analysis guarentees a RETURN statement will be used before here. */
{
if (exitcode != -1)
{
- CallExit = TRUE;
+ CallExit = true;
ExitValue = exitcode;
}
if (isHalting)
}
else
{
- isHalting = TRUE;
+ isHalting = true;
M2RTS_ExecuteTerminationProcedures ();
}
if (CallExit)
extern "C" void M2RTS_ExitOnHalt (int e)
{
ExitValue = e;
- CallExit = TRUE;
+ CallExit = true;
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
procedure is installed.
*/
-EXTERN unsigned int M2RTS_InstallTerminationProcedure (PROC p);
+EXTERN bool M2RTS_InstallTerminationProcedure (PROC p);
/*
ExecuteInitialProcedures - executes the initial procedures installed
program module.
*/
-EXTERN unsigned int M2RTS_InstallInitialProcedure (PROC p);
+EXTERN bool M2RTS_InstallInitialProcedure (PROC p);
/*
ExecuteTerminationProcedures - calls each installed termination procedure
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
extern "C" void NumberIO_StrToCard (const char *a_, unsigned int _a_high, unsigned int *x)
{
unsigned int i;
- unsigned int ok;
+ bool ok;
unsigned int higha;
char a[_a_high+1];
StrLib_StrRemoveWhitePrefix ((const char *) a, _a_high, (char *) a, _a_high);
higha = StrLib_StrLen ((const char *) a, _a_high);
i = 0;
- ok = TRUE;
+ ok = true;
while (ok)
{
if (i < higha)
}
else
{
- ok = FALSE;
+ ok = false;
}
}
else
{
- ok = FALSE;
+ ok = false;
}
}
(*x) = 0;
if (i < higha)
{
- ok = TRUE;
+ ok = true;
do {
(*x) = (10*(*x))+( ((unsigned int) (a[i]))- ((unsigned int) ('0')));
if (i < higha)
i += 1;
if ((a[i] < '0') || (a[i] > '9'))
{
- ok = FALSE;
+ ok = false;
}
}
else
{
- ok = FALSE;
+ ok = false;
}
} while (! (! ok));
}
unsigned int c;
unsigned int Higha;
IntToStr__T9 buf;
- unsigned int Negative;
+ bool Negative;
if (x < 0)
{
/* avoid dangling else. */
- Negative = TRUE;
+ Negative = true;
c = ((unsigned int ) (abs (x+1)))+1;
if (n > 0)
{
else
{
c = x;
- Negative = FALSE;
+ Negative = false;
}
i = 0;
do {
extern "C" void NumberIO_StrToInt (const char *a_, unsigned int _a_high, int *x)
{
unsigned int i;
- unsigned int ok;
- unsigned int Negative;
+ bool ok;
+ bool Negative;
unsigned int higha;
char a[_a_high+1];
StrLib_StrRemoveWhitePrefix ((const char *) a, _a_high, (char *) a, _a_high);
higha = StrLib_StrLen ((const char *) a, _a_high);
i = 0;
- Negative = FALSE;
- ok = TRUE;
+ Negative = false;
+ ok = true;
while (ok)
{
if (i < higha)
else
{
/* avoid dangling else. */
- ok = FALSE;
+ ok = false;
}
}
else
{
- ok = FALSE;
+ ok = false;
}
}
(*x) = 0;
if (i < higha)
{
- ok = TRUE;
+ ok = true;
do {
if (Negative)
{
i += 1;
if ((a[i] < '0') || (a[i] > '9'))
{
- ok = FALSE;
+ ok = false;
}
}
else
{
- ok = FALSE;
+ ok = false;
}
} while (! (! ok));
}
extern "C" void NumberIO_StrToBinInt (const char *a_, unsigned int _a_high, int *x)
{
unsigned int i;
- unsigned int ok;
+ bool ok;
unsigned int higha;
char a[_a_high+1];
StrLib_StrRemoveWhitePrefix ((const char *) a, _a_high, (char *) a, _a_high);
higha = StrLib_StrLen ((const char *) a, _a_high);
i = 0;
- ok = TRUE;
+ ok = true;
while (ok)
{
if (i < higha)
}
else
{
- ok = FALSE;
+ ok = false;
}
}
else
{
- ok = FALSE;
+ ok = false;
}
}
(*x) = 0;
if (i < higha)
{
- ok = TRUE;
+ ok = true;
do {
(*x) = (2*(*x))+((int ) ( ((unsigned int) (a[i]))- ((unsigned int) ('0'))));
if (i < higha)
i += 1;
if ((a[i] < '0') || (a[i] > '1'))
{
- ok = FALSE;
+ ok = false;
}
}
else
{
- ok = FALSE;
+ ok = false;
}
} while (! (! ok));
}
extern "C" void NumberIO_StrToHexInt (const char *a_, unsigned int _a_high, int *x)
{
unsigned int i;
- unsigned int ok;
+ bool ok;
unsigned int higha;
char a[_a_high+1];
StrLib_StrRemoveWhitePrefix ((const char *) a, _a_high, (char *) a, _a_high);
higha = StrLib_StrLen ((const char *) a, _a_high);
i = 0;
- ok = TRUE;
+ ok = true;
while (ok)
{
if (i < higha)
{
if (((a[i] >= '0') && (a[i] <= '9')) || ((a[i] >= 'A') && (a[i] <= 'F')))
{
- ok = FALSE;
+ ok = false;
}
else
{
}
else
{
- ok = FALSE;
+ ok = false;
}
}
(*x) = 0;
if (i < higha)
{
- ok = TRUE;
+ ok = true;
do {
if ((a[i] >= '0') && (a[i] <= '9'))
{
i += 1;
if (((a[i] < '0') || (a[i] > '9')) && ((a[i] < 'A') || (a[i] > 'F')))
{
- ok = FALSE;
+ ok = false;
}
}
else
{
- ok = FALSE;
+ ok = false;
}
} while (! (! ok));
}
extern "C" void NumberIO_StrToOctInt (const char *a_, unsigned int _a_high, int *x)
{
unsigned int i;
- unsigned int ok;
+ bool ok;
unsigned int higha;
char a[_a_high+1];
StrLib_StrRemoveWhitePrefix ((const char *) a, _a_high, (char *) a, _a_high);
higha = StrLib_StrLen ((const char *) a, _a_high);
i = 0;
- ok = TRUE;
+ ok = true;
while (ok)
{
if (i < higha)
}
else
{
- ok = FALSE;
+ ok = false;
}
}
else
{
- ok = FALSE;
+ ok = false;
}
}
(*x) = 0;
if (i < higha)
{
- ok = TRUE;
+ ok = true;
do {
(*x) = (8*(*x))+((int ) ( ((unsigned int) (a[i]))- ((unsigned int) ('0'))));
if (i < higha)
i += 1;
if ((a[i] < '0') || (a[i] > '7'))
{
- ok = FALSE;
+ ok = false;
}
}
else
{
- ok = FALSE;
+ ok = false;
}
} while (! (! ok));
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
static unsigned int Column;
static unsigned int StackPtr;
static unsigned int LineNo;
-static unsigned int Debugging;
+static bool Debugging;
/*
Open - opens a file for reading.
SetDebug - sets the debug flag on or off.
*/
-extern "C" void PushBackInput_SetDebug (unsigned int d);
+extern "C" void PushBackInput_SetDebug (bool d);
/*
GetColumnPosition - returns the column position of the current character.
SetDebug - sets the debug flag on or off.
*/
-extern "C" void PushBackInput_SetDebug (unsigned int d)
+extern "C" void PushBackInput_SetDebug (bool d)
{
Debugging = d;
}
extern "C" void _M2_PushBackInput_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
{
- PushBackInput_SetDebug (FALSE);
+ PushBackInput_SetDebug (false);
Init ();
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
SetDebug - sets the debug flag on or off.
*/
-EXTERN void PushBackInput_SetDebug (unsigned int d);
+EXTERN void PushBackInput_SetDebug (bool d);
/*
GetColumnPosition - returns the column position of the current character.
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
RTExceptions_Handler stack;
};
-static unsigned int inException;
+static bool inException;
static RTExceptions_Handler freeHandler;
static RTExceptions_EHBlock freeEHB;
static RTExceptions_EHBlock currentEHB;
in the exception state.
*/
-extern "C" unsigned int RTExceptions_IsInExceptionState (void);
+extern "C" bool RTExceptions_IsInExceptionState (void);
/*
SetExceptionState - returns the current exception state and
to.
*/
-extern "C" unsigned int RTExceptions_SetExceptionState (unsigned int to);
+extern "C" bool RTExceptions_SetExceptionState (bool to);
/*
SwitchExceptionState - assigns, from, with the current exception
to, to.
*/
-extern "C" void RTExceptions_SwitchExceptionState (unsigned int *from, unsigned int to);
+extern "C" void RTExceptions_SwitchExceptionState (bool *from, bool to);
/*
GetBaseExceptionBlock - returns the initial language exception block
static void Init (void)
{
- inException = FALSE;
+ inException = false;
freeHandler = NULL;
freeEHB = NULL;
currentEHB = RTExceptions_InitExceptionBlock ();
in the exception state.
*/
-extern "C" unsigned int RTExceptions_IsInExceptionState (void)
+extern "C" bool RTExceptions_IsInExceptionState (void)
{
return inException;
/* static analysis guarentees a RETURN statement will be used before here. */
to.
*/
-extern "C" unsigned int RTExceptions_SetExceptionState (unsigned int to)
+extern "C" bool RTExceptions_SetExceptionState (bool to)
{
- unsigned int old;
+ bool old;
old = inException;
inException = to;
to, to.
*/
-extern "C" void RTExceptions_SwitchExceptionState (unsigned int *from, unsigned int to)
+extern "C" void RTExceptions_SwitchExceptionState (bool *from, bool to)
{
(*from) = inException;
inException = to;
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
in the exception state.
*/
-EXTERN unsigned int RTExceptions_IsInExceptionState (void);
+EXTERN bool RTExceptions_IsInExceptionState (void);
/*
SetExceptionState - returns the current exception state and
to.
*/
-EXTERN unsigned int RTExceptions_SetExceptionState (unsigned int to);
+EXTERN bool RTExceptions_SetExceptionState (bool to);
/*
SwitchExceptionState - assigns, from, with the current exception
to, to.
*/
-EXTERN void RTExceptions_SwitchExceptionState (unsigned int *from, unsigned int to);
+EXTERN void RTExceptions_SwitchExceptionState (bool *from, bool to);
/*
GetBaseExceptionBlock - returns the initial language exception block
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
EXTERN unsigned int RTentity_GetKey (RTentity_Group g, void * a);
EXTERN void RTentity_PutKey (RTentity_Group g, void * a, unsigned int key);
EXTERN void RTentity_DelKey (RTentity_Group g, void * a);
-EXTERN unsigned int RTentity_IsIn (RTentity_Group g, void * a);
+EXTERN bool RTentity_IsIn (RTentity_Group g, void * a);
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# define Microseconds 1000000
# define DebugTime 0
-# define Debugging FALSE
+# define Debugging false
typedef struct RTint__T1_r RTint__T1;
typedef RTint__T1 *RTint_Vector;
int File;
Selective_Timeval rel;
Selective_Timeval abs_;
- unsigned int queued;
+ bool queued;
};
struct RTint__T2_a { RTint_Vector array[(7)-(COROUTINES_UnassignedPriority)+1]; };
static RTint_Vector Exists;
static RTint__T2 Pending;
static int lock;
-static unsigned int initialized;
+static bool initialized;
/*
InitInputVector - returns an interrupt vector which is associated
It only listens for interrupts > pri.
*/
-extern "C" void RTint_Listen (unsigned int untilInterrupt, RTint_DispatchVector call, unsigned int pri);
+extern "C" void RTint_Listen (bool untilInterrupt, RTint_DispatchVector call, unsigned int pri);
/*
Init -
IsGreaterEqual - returns TRUE if, a>=b
*/
-static unsigned int IsGreaterEqual (Selective_Timeval a, Selective_Timeval b);
+static bool IsGreaterEqual (Selective_Timeval a, Selective_Timeval b);
/*
SubTime - assigns, s and m, to a - b.
activatePending - activates the first interrupt pending and clears it.
*/
-static unsigned int activatePending (unsigned int untilInterrupt, RTint_DispatchVector call, unsigned int pri, int maxFd, Selective_SetOfFd *inSet, Selective_SetOfFd *outSet, Selective_Timeval *timeval, Selective_Timeval b4, Selective_Timeval after);
+static bool activatePending (bool untilInterrupt, RTint_DispatchVector call, unsigned int pri, int maxFd, Selective_SetOfFd *inSet, Selective_SetOfFd *outSet, Selective_Timeval *timeval, Selective_Timeval b4, Selective_Timeval after);
/*
init -
IsGreaterEqual - returns TRUE if, a>=b
*/
-static unsigned int IsGreaterEqual (Selective_Timeval a, Selective_Timeval b)
+static bool IsGreaterEqual (Selective_Timeval a, Selective_Timeval b)
{
unsigned int as;
unsigned int am;
activatePending - activates the first interrupt pending and clears it.
*/
-static unsigned int activatePending (unsigned int untilInterrupt, RTint_DispatchVector call, unsigned int pri, int maxFd, Selective_SetOfFd *inSet, Selective_SetOfFd *outSet, Selective_Timeval *timeval, Selective_Timeval b4, Selective_Timeval after)
+static bool activatePending (bool untilInterrupt, RTint_DispatchVector call, unsigned int pri, int maxFd, Selective_SetOfFd *inSet, Selective_SetOfFd *outSet, Selective_Timeval *timeval, Selective_Timeval b4, Selective_Timeval after)
{
int result;
unsigned int p;
Selective_FdClr (vec->File, (*inSet)); /* so we dont activate this again from our select. */
RTco_signal (lock); /* so we dont activate this again from our select. */
(*call.proc) (vec->no, vec->priority, vec->arg);
- return TRUE;
+ return true;
}
break;
Selective_FdClr (vec->File, (*outSet)); /* so we dont activate this again from our select. */
RTco_signal (lock); /* so we dont activate this again from our select. */
(*call.proc) (vec->no, vec->priority, vec->arg);
- return TRUE;
+ return true;
}
break;
libc_printf ((const char *) "call (%d, %d, 0x%x)\\n", 21, vec->no, vec->priority, vec->arg);
}
(*call.proc) (vec->no, vec->priority, vec->arg);
- return TRUE;
+ return true;
}
else if (Debugging)
{
p -= 1;
}
RTco_signal (lock);
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
{
Pending.array[p-(COROUTINES_UnassignedPriority)] = NULL;
}
- initialized = TRUE;
+ initialized = true;
RTco_signal (lock);
}
vptr->no = VecNo;
vptr->rel = Selective_InitTime (secs+DebugTime, micro);
vptr->abs_ = Selective_InitTime (0, 0);
- vptr->queued = FALSE;
+ vptr->queued = false;
Exists = vptr;
}
RTco_signal (lock);
Pending.array[vptr->priority-(COROUTINES_UnassignedPriority)] = vptr;
if ((vptr->type == RTint_time) && ! vptr->queued)
{
- vptr->queued = TRUE;
+ vptr->queued = true;
result = Selective_GetTimeOfDay (vptr->abs_);
Assertion_Assert (result == 0);
Selective_GetTime (vptr->abs_, &sec, µ);
}
if (vptr->type == RTint_time)
{
- vptr->queued = FALSE;
+ vptr->queued = false;
}
}
RTco_signal (lock);
It only listens for interrupts > pri.
*/
-extern "C" void RTint_Listen (unsigned int untilInterrupt, RTint_DispatchVector call, unsigned int pri)
+extern "C" void RTint_Listen (bool untilInterrupt, RTint_DispatchVector call, unsigned int pri)
{
- unsigned int found;
+ bool found;
int result;
Selective_Timeval after;
Selective_Timeval b4;
outSet = NULL;
timeval = Selective_InitTime (static_cast<unsigned int> (INT_MAX), 0);
p = static_cast<unsigned int> (7);
- found = FALSE;
+ found = false;
while (p > pri)
{
vec = Pending.array[p-(COROUTINES_UnassignedPriority)];
libc_printf ((const char *) "shortest delay is %u.%06u\\n", 27, sec, micro);
}
Selective_SetTime (timeval, sec, micro);
- found = TRUE;
+ found = true;
}
break;
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
It only listens for interrupts > pri.
*/
-EXTERN void RTint_Listen (unsigned int untilInterrupt, RTint_DispatchVector call, unsigned int pri);
+EXTERN void RTint_Listen (bool untilInterrupt, RTint_DispatchVector call, unsigned int pri);
/*
Init - allows the user to force the initialize order.
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
new string, otherwise s is set to NIL.
*/
-extern "C" unsigned int SArgs_GetArg (DynamicStrings_String *s, unsigned int n);
+extern "C" bool SArgs_GetArg (DynamicStrings_String *s, unsigned int n);
/*
Narg - returns the number of arguments available from
new string, otherwise s is set to NIL.
*/
-extern "C" unsigned int SArgs_GetArg (DynamicStrings_String *s, unsigned int n)
+extern "C" bool SArgs_GetArg (DynamicStrings_String *s, unsigned int n)
{
int i;
SArgs_PtrToPtrToChar ppc;
/* ppc := ADDRESS (VAL (PtrToPtrToChar, ArgV) + (i * CARDINAL (TSIZE(PtrToChar)))) ; */
ppc = static_cast<SArgs_PtrToPtrToChar> ((void *) (((SArgs_PtrToChar) (UnixArgs_GetArgV ()))+(n*sizeof (SArgs_PtrToChar))));
(*s) = DynamicStrings_InitStringCharStar (reinterpret_cast<void *> ((*ppc)));
- return TRUE;
+ return true;
}
else
{
(*s) = static_cast<DynamicStrings_String> (NULL);
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
new string, otherwise s is set to NIL.
*/
-EXTERN unsigned int SArgs_GetArg (DynamicStrings_String *s, unsigned int n);
+EXTERN bool SArgs_GetArg (DynamicStrings_String *s, unsigned int n);
/*
Narg - returns the number of arguments available from
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
Exists - returns TRUE if a file named, fname exists for reading.
*/
-extern "C" unsigned int SFIO_Exists (DynamicStrings_String fname);
+extern "C" bool SFIO_Exists (DynamicStrings_String fname);
/*
OpenToRead - attempts to open a file, fname, for reading and
and modify an existing file.
*/
-extern "C" FIO_File SFIO_OpenForRandom (DynamicStrings_String fname, unsigned int towrite, unsigned int newfile);
+extern "C" FIO_File SFIO_OpenForRandom (DynamicStrings_String fname, bool towrite, bool newfile);
/*
WriteS - writes a string, s, to, file. It returns the String, s.
Exists - returns TRUE if a file named, fname exists for reading.
*/
-extern "C" unsigned int SFIO_Exists (DynamicStrings_String fname)
+extern "C" bool SFIO_Exists (DynamicStrings_String fname)
{
return FIO_exists (DynamicStrings_string (fname), DynamicStrings_Length (fname));
/* static analysis guarentees a RETURN statement will be used before here. */
and modify an existing file.
*/
-extern "C" FIO_File SFIO_OpenForRandom (DynamicStrings_String fname, unsigned int towrite, unsigned int newfile)
+extern "C" FIO_File SFIO_OpenForRandom (DynamicStrings_String fname, bool towrite, bool newfile)
{
return FIO_openForRandom (DynamicStrings_string (fname), DynamicStrings_Length (fname), towrite, newfile);
/* static analysis guarentees a RETURN statement will be used before here. */
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
Exists - returns TRUE if a file named, fname exists for reading.
*/
-EXTERN unsigned int SFIO_Exists (DynamicStrings_String fname);
+EXTERN bool SFIO_Exists (DynamicStrings_String fname);
/*
OpenToRead - attempts to open a file, fname, for reading and
and modify an existing file.
*/
-EXTERN FIO_File SFIO_OpenForRandom (DynamicStrings_String fname, unsigned int towrite, unsigned int newfile);
+EXTERN FIO_File SFIO_OpenForRandom (DynamicStrings_String fname, bool towrite, bool newfile);
/*
WriteS - writes a string, s, to, file. It returns the String, s.
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
EXTERN void Selective_FdZero (Selective_SetOfFd s);
EXTERN void Selective_FdSet (int fd, Selective_SetOfFd s);
EXTERN void Selective_FdClr (int fd, Selective_SetOfFd s);
-EXTERN unsigned int Selective_FdIsSet (int fd, Selective_SetOfFd s);
+EXTERN bool Selective_FdIsSet (int fd, Selective_SetOfFd s);
EXTERN int Selective_MaxFdsPlusOne (int a, int b);
EXTERN void Selective_WriteCharRaw (int fd, char ch);
EXTERN char Selective_ReadCharRaw (int fd);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
extern "C" void Storage_ALLOCATE (void * *a, unsigned int Size);
extern "C" void Storage_DEALLOCATE (void * *a, unsigned int Size);
extern "C" void Storage_REALLOCATE (void * *a, unsigned int Size);
-extern "C" unsigned int Storage_Available (unsigned int Size);
+extern "C" bool Storage_Available (unsigned int Size);
extern "C" void Storage_ALLOCATE (void * *a, unsigned int Size)
{
SysStorage_REALLOCATE (a, Size);
}
-extern "C" unsigned int Storage_Available (unsigned int Size)
+extern "C" bool Storage_Available (unsigned int Size)
{
return SysStorage_Available (Size);
/* static analysis guarentees a RETURN statement will be used before here. */
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
Available - returns TRUE if, Size, bytes can be allocated.
*/
-EXTERN unsigned int Storage_Available (unsigned int Size);
+EXTERN bool Storage_Available (unsigned int Size);
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# include "GStdIO.h"
# include "Glibc.h"
-static unsigned int IsATTY;
+static bool IsATTY;
/*
WriteLn - writes a carriage return and a newline
AlphaNum- returns true if character, ch, is an alphanumeric character.
*/
-static unsigned int AlphaNum (char ch);
+static bool AlphaNum (char ch);
/*
AlphaNum- returns true if character, ch, is an alphanumeric character.
*/
-static unsigned int AlphaNum (char ch)
+static bool AlphaNum (char ch)
{
return (((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z'))) || ((ch >= '0') && (ch <= '9'));
/* static analysis guarentees a RETURN statement will be used before here. */
extern "C" void _M2_StrIO_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
{
/* IsATTY := isatty() */
- IsATTY = FALSE;
+ IsATTY = false;
}
extern "C" void _M2_StrIO_fini (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
string, b.
*/
-extern "C" unsigned int StrLib_StrLess (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
-extern "C" unsigned int StrLib_StrEqual (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+extern "C" bool StrLib_StrLess (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+extern "C" bool StrLib_StrEqual (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
extern "C" unsigned int StrLib_StrLen (const char *a_, unsigned int _a_high);
/*
IsSubString - returns true if b is a subcomponent of a.
*/
-extern "C" unsigned int StrLib_IsSubString (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+extern "C" bool StrLib_IsSubString (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
/*
StrRemoveWhitePrefix - copies string, into string, b, excluding any white
IsWhite - returns TRUE if, ch, is a space or a tab.
*/
-static unsigned int IsWhite (char ch);
+static bool IsWhite (char ch);
/*
IsWhite - returns TRUE if, ch, is a space or a tab.
*/
-static unsigned int IsWhite (char ch)
+static bool IsWhite (char ch)
{
return (ch == ' ') || (ch == ASCII_tab);
/* static analysis guarentees a RETURN statement will be used before here. */
string, b.
*/
-extern "C" unsigned int StrLib_StrLess (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high)
+extern "C" bool StrLib_StrLess (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high)
{
unsigned int Higha;
unsigned int Highb;
{
if (a[i] < b[i])
{
- return TRUE;
+ return true;
}
else if (a[i] > b[i])
{
/* avoid dangling else. */
- return FALSE;
+ return false;
}
/* must be equal, move on to next character */
i += 1;
__builtin_unreachable ();
}
-extern "C" unsigned int StrLib_StrEqual (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high)
+extern "C" bool StrLib_StrEqual (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high)
{
unsigned int i;
unsigned int higha;
{
if (a[i] != b[i])
{
- return FALSE;
+ return false;
}
i += 1;
}
IsSubString - returns true if b is a subcomponent of a.
*/
-extern "C" unsigned int StrLib_IsSubString (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high)
+extern "C" bool StrLib_IsSubString (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high)
{
unsigned int i;
unsigned int j;
}
if (j == LengthB)
{
- return TRUE;
+ return true;
}
else
{
}
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
string, b.
*/
-EXTERN unsigned int StrLib_StrLess (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+EXTERN bool StrLib_StrLess (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
/*
StrEqual - performs a = b on two strings.
*/
-EXTERN unsigned int StrLib_StrEqual (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+EXTERN bool StrLib_StrEqual (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
/*
StrLen - returns the length of string, a.
IsSubString - returns true if b is a subcomponent of a.
*/
-EXTERN unsigned int StrLib_IsSubString (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+EXTERN bool StrLib_IsSubString (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
/*
StrRemoveWhitePrefix - copies string, into string, b, excluding any white
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
are used.
*/
-extern "C" DynamicStrings_String StringConvert_IntegerToString (int i, unsigned int width, char padding, unsigned int sign, unsigned int base, unsigned int lower);
+extern "C" DynamicStrings_String StringConvert_IntegerToString (int i, unsigned int width, char padding, bool sign, unsigned int base, bool lower);
/*
CardinalToString - converts CARDINAL, c, into a String. The field with can be specified
are used.
*/
-extern "C" DynamicStrings_String StringConvert_CardinalToString (unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower);
+extern "C" DynamicStrings_String StringConvert_CardinalToString (unsigned int c, unsigned int width, char padding, unsigned int base, bool lower);
/*
StringToInteger - converts a string, s, of, base, into an INTEGER.
The parameter found is set TRUE if a number was found.
*/
-extern "C" int StringConvert_StringToInteger (DynamicStrings_String s, unsigned int base, unsigned int *found);
+extern "C" int StringConvert_StringToInteger (DynamicStrings_String s, unsigned int base, bool *found);
/*
StringToCardinal - converts a string, s, of, base, into a CARDINAL.
The parameter found is set TRUE if a number was found.
*/
-extern "C" unsigned int StringConvert_StringToCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found);
+extern "C" unsigned int StringConvert_StringToCardinal (DynamicStrings_String s, unsigned int base, bool *found);
/*
LongIntegerToString - converts LONGINT, i, into a String. The field with
abcdef are used, and if FALSE then ABCDEF are used.
*/
-extern "C" DynamicStrings_String StringConvert_LongIntegerToString (long int i, unsigned int width, char padding, unsigned int sign, unsigned int base, unsigned int lower);
+extern "C" DynamicStrings_String StringConvert_LongIntegerToString (long int i, unsigned int width, char padding, bool sign, unsigned int base, bool lower);
/*
StringToLongInteger - converts a string, s, of, base, into an LONGINT.
The parameter found is set TRUE if a number was found.
*/
-extern "C" long int StringConvert_StringToLongInteger (DynamicStrings_String s, unsigned int base, unsigned int *found);
+extern "C" long int StringConvert_StringToLongInteger (DynamicStrings_String s, unsigned int base, bool *found);
/*
LongCardinalToString - converts LONGCARD, c, into a String. The field
abcdef are used, and if FALSE then ABCDEF are used.
*/
-extern "C" DynamicStrings_String StringConvert_LongCardinalToString (long unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower);
+extern "C" DynamicStrings_String StringConvert_LongCardinalToString (long unsigned int c, unsigned int width, char padding, unsigned int base, bool lower);
/*
StringToLongCardinal - converts a string, s, of, base, into a LONGCARD.
The parameter found is set TRUE if a number was found.
*/
-extern "C" long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found);
+extern "C" long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_String s, unsigned int base, bool *found);
/*
ShortCardinalToString - converts SHORTCARD, c, into a String. The field
abcdef are used, and if FALSE then ABCDEF are used.
*/
-extern "C" DynamicStrings_String StringConvert_ShortCardinalToString (short unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower);
+extern "C" DynamicStrings_String StringConvert_ShortCardinalToString (short unsigned int c, unsigned int width, char padding, unsigned int base, bool lower);
/*
StringToShortCardinal - converts a string, s, of, base, into a SHORTCARD.
The parameter found is set TRUE if a number was found.
*/
-extern "C" short unsigned int StringConvert_StringToShortCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found);
+extern "C" short unsigned int StringConvert_StringToShortCardinal (DynamicStrings_String s, unsigned int base, bool *found);
/*
stoi - decimal string to INTEGER
itos - integer to decimal string.
*/
-extern "C" DynamicStrings_String StringConvert_itos (int i, unsigned int width, char padding, unsigned int sign);
+extern "C" DynamicStrings_String StringConvert_itos (int i, unsigned int width, char padding, bool sign);
/*
ctos - cardinal to decimal string.
StringToLongreal - returns a LONGREAL and sets found to TRUE if a legal number is seen.
*/
-extern "C" long double StringConvert_StringToLongreal (DynamicStrings_String s, unsigned int *found);
+extern "C" long double StringConvert_StringToLongreal (DynamicStrings_String s, bool *found);
/*
LongrealToString - converts a LONGREAL number, Real, which has,
Assert - implement a simple assert.
*/
-static void Assert (unsigned int b, const char *file_, unsigned int _file_high, unsigned int line, const char *func_, unsigned int _func_high);
+static void Assert (bool b, const char *file_, unsigned int _file_high, unsigned int line, const char *func_, unsigned int _func_high);
/*
Max -
IsDigit - returns TRUE if, ch, lies between '0'..'9'.
*/
-static unsigned int IsDigit (char ch);
+static bool IsDigit (char ch);
/*
IsDecimalDigitValid - returns the TRUE if, ch, is a base legal decimal digit.
If legal then the value is appended numerically onto, c.
*/
-static unsigned int IsDecimalDigitValid (char ch, unsigned int base, unsigned int *c);
+static bool IsDecimalDigitValid (char ch, unsigned int base, unsigned int *c);
/*
IsHexidecimalDigitValid - returns the TRUE if, ch, is a base legal hexidecimal digit.
If legal then the value is appended numerically onto, c.
*/
-static unsigned int IsHexidecimalDigitValid (char ch, unsigned int base, unsigned int *c);
+static bool IsHexidecimalDigitValid (char ch, unsigned int base, unsigned int *c);
/*
IsDecimalDigitValidLong - returns the TRUE if, ch, is a base legal decimal digit.
If legal then the value is appended numerically onto, c.
*/
-static unsigned int IsDecimalDigitValidLong (char ch, unsigned int base, long unsigned int *c);
+static bool IsDecimalDigitValidLong (char ch, unsigned int base, long unsigned int *c);
/*
IsHexidecimalDigitValidLong - returns the TRUE if, ch, is a base legal hexidecimal digit.
If legal then the value is appended numerically onto, c.
*/
-static unsigned int IsHexidecimalDigitValidLong (char ch, unsigned int base, long unsigned int *c);
+static bool IsHexidecimalDigitValidLong (char ch, unsigned int base, long unsigned int *c);
/*
IsDecimalDigitValidShort - returns the TRUE if, ch, is a base legal decimal digit.
If legal then the value is appended numerically onto, c.
*/
-static unsigned int IsDecimalDigitValidShort (char ch, unsigned int base, short unsigned int *c);
+static bool IsDecimalDigitValidShort (char ch, unsigned int base, short unsigned int *c);
/*
IsHexidecimalDigitValidShort - returns the TRUE if, ch, is a base legal hexidecimal digit.
If legal then the value is appended numerically onto, c.
*/
-static unsigned int IsHexidecimalDigitValidShort (char ch, unsigned int base, short unsigned int *c);
+static bool IsHexidecimalDigitValidShort (char ch, unsigned int base, short unsigned int *c);
/*
ToThePower10 - returns a LONGREAL containing the value of v * 10^power.
Assert - implement a simple assert.
*/
-static void Assert (unsigned int b, const char *file_, unsigned int _file_high, unsigned int line, const char *func_, unsigned int _func_high)
+static void Assert (bool b, const char *file_, unsigned int _file_high, unsigned int line, const char *func_, unsigned int _func_high)
{
char file[_file_high+1];
char func[_func_high+1];
IsDigit - returns TRUE if, ch, lies between '0'..'9'.
*/
-static unsigned int IsDigit (char ch)
+static bool IsDigit (char ch)
{
return (ch >= '0') && (ch <= '9');
/* static analysis guarentees a RETURN statement will be used before here. */
If legal then the value is appended numerically onto, c.
*/
-static unsigned int IsDecimalDigitValid (char ch, unsigned int base, unsigned int *c)
+static bool IsDecimalDigitValid (char ch, unsigned int base, unsigned int *c)
{
if ((IsDigit (ch)) && (( ((unsigned int) (ch))- ((unsigned int) ('0'))) < base))
{
(*c) = ((*c)*base)+( ((unsigned int) (ch))- ((unsigned int) ('0')));
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
If legal then the value is appended numerically onto, c.
*/
-static unsigned int IsHexidecimalDigitValid (char ch, unsigned int base, unsigned int *c)
+static bool IsHexidecimalDigitValid (char ch, unsigned int base, unsigned int *c)
{
if (((ch >= 'a') && (ch <= 'f')) && ((( ((unsigned int) (ch))- ((unsigned int) ('a')))+10) < base))
{
(*c) = ((*c)*base)+(( ((unsigned int) (ch))- ((unsigned int) ('a')))+10);
- return TRUE;
+ return true;
}
else if (((ch >= 'A') && (ch <= 'F')) && ((( ((unsigned int) (ch))- ((unsigned int) ('F')))+10) < base))
{
/* avoid dangling else. */
(*c) = ((*c)*base)+(( ((unsigned int) (ch))- ((unsigned int) ('A')))+10);
- return TRUE;
+ return true;
}
else
{
/* avoid dangling else. */
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
If legal then the value is appended numerically onto, c.
*/
-static unsigned int IsDecimalDigitValidLong (char ch, unsigned int base, long unsigned int *c)
+static bool IsDecimalDigitValidLong (char ch, unsigned int base, long unsigned int *c)
{
if ((IsDigit (ch)) && (( ((unsigned int) (ch))- ((unsigned int) ('0'))) < base))
{
(*c) = (*c)*((long unsigned int ) (base+( ((unsigned int) (ch))- ((unsigned int) ('0')))));
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
If legal then the value is appended numerically onto, c.
*/
-static unsigned int IsHexidecimalDigitValidLong (char ch, unsigned int base, long unsigned int *c)
+static bool IsHexidecimalDigitValidLong (char ch, unsigned int base, long unsigned int *c)
{
if (((ch >= 'a') && (ch <= 'f')) && ((( ((unsigned int) (ch))- ((unsigned int) ('a')))+10) < base))
{
(*c) = (*c)*((long unsigned int ) (base+(( ((unsigned int) (ch))- ((unsigned int) ('a')))+10)));
- return TRUE;
+ return true;
}
else if (((ch >= 'A') && (ch <= 'F')) && ((( ((unsigned int) (ch))- ((unsigned int) ('F')))+10) < base))
{
/* avoid dangling else. */
(*c) = (*c)*((long unsigned int ) (base+(( ((unsigned int) (ch))- ((unsigned int) ('A')))+10)));
- return TRUE;
+ return true;
}
else
{
/* avoid dangling else. */
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
If legal then the value is appended numerically onto, c.
*/
-static unsigned int IsDecimalDigitValidShort (char ch, unsigned int base, short unsigned int *c)
+static bool IsDecimalDigitValidShort (char ch, unsigned int base, short unsigned int *c)
{
if ((IsDigit (ch)) && (( ((unsigned int) (ch))- ((unsigned int) ('0'))) < base))
{
(*c) = (*c)*((short unsigned int ) (base+( ((unsigned int) (ch))- ((unsigned int) ('0')))));
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
If legal then the value is appended numerically onto, c.
*/
-static unsigned int IsHexidecimalDigitValidShort (char ch, unsigned int base, short unsigned int *c)
+static bool IsHexidecimalDigitValidShort (char ch, unsigned int base, short unsigned int *c)
{
if (((ch >= 'a') && (ch <= 'f')) && ((( ((unsigned int) (ch))- ((unsigned int) ('a')))+10) < base))
{
(*c) = (*c)*((short unsigned int ) (base+(( ((unsigned int) (ch))- ((unsigned int) ('a')))+10)));
- return TRUE;
+ return true;
}
else if (((ch >= 'A') && (ch <= 'F')) && ((( ((unsigned int) (ch))- ((unsigned int) ('F')))+10) < base))
{
/* avoid dangling else. */
(*c) = (*c)*((short unsigned int ) (base+(( ((unsigned int) (ch))- ((unsigned int) ('A')))+10)));
- return TRUE;
+ return true;
}
else
{
/* avoid dangling else. */
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
are used.
*/
-extern "C" DynamicStrings_String StringConvert_IntegerToString (int i, unsigned int width, char padding, unsigned int sign, unsigned int base, unsigned int lower)
+extern "C" DynamicStrings_String StringConvert_IntegerToString (int i, unsigned int width, char padding, bool sign, unsigned int base, bool lower)
{
DynamicStrings_String s;
unsigned int c;
c = ((unsigned int ) (abs (i+1)))+1;
if (width > 0)
{
- return DynamicStrings_ConCat (StringConvert_IntegerToString (-((int ) (c / base)), width-1, padding, sign, base, lower), DynamicStrings_Mark (StringConvert_IntegerToString (static_cast<int> (c % base), 0, ' ', FALSE, base, lower)));
+ return DynamicStrings_ConCat (StringConvert_IntegerToString (-((int ) (c / base)), width-1, padding, sign, base, lower), DynamicStrings_Mark (StringConvert_IntegerToString (static_cast<int> (c % base), 0, ' ', false, base, lower)));
}
else
{
- return DynamicStrings_ConCat (StringConvert_IntegerToString (-((int ) (c / base)), 0, padding, sign, base, lower), DynamicStrings_Mark (StringConvert_IntegerToString (static_cast<int> (c % base), 0, ' ', FALSE, base, lower)));
+ return DynamicStrings_ConCat (StringConvert_IntegerToString (-((int ) (c / base)), 0, padding, sign, base, lower), DynamicStrings_Mark (StringConvert_IntegerToString (static_cast<int> (c % base), 0, ' ', false, base, lower)));
}
}
else
}
if (i > (((int ) (base))-1))
{
- s = DynamicStrings_ConCat (DynamicStrings_ConCat (s, DynamicStrings_Mark (StringConvert_IntegerToString (static_cast<int> (((unsigned int ) (i)) / base), 0, ' ', FALSE, base, lower))), DynamicStrings_Mark (StringConvert_IntegerToString (static_cast<int> (((unsigned int ) (i)) % base), 0, ' ', FALSE, base, lower)));
+ s = DynamicStrings_ConCat (DynamicStrings_ConCat (s, DynamicStrings_Mark (StringConvert_IntegerToString (static_cast<int> (((unsigned int ) (i)) / base), 0, ' ', false, base, lower))), DynamicStrings_Mark (StringConvert_IntegerToString (static_cast<int> (((unsigned int ) (i)) % base), 0, ' ', false, base, lower)));
}
else
{
are used.
*/
-extern "C" DynamicStrings_String StringConvert_CardinalToString (unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower)
+extern "C" DynamicStrings_String StringConvert_CardinalToString (unsigned int c, unsigned int width, char padding, unsigned int base, bool lower)
{
DynamicStrings_String s;
The parameter found is set TRUE if a number was found.
*/
-extern "C" int StringConvert_StringToInteger (DynamicStrings_String s, unsigned int base, unsigned int *found)
+extern "C" int StringConvert_StringToInteger (DynamicStrings_String s, unsigned int base, bool *found)
{
unsigned int n;
unsigned int l;
unsigned int c;
- unsigned int negative;
+ bool negative;
s = DynamicStrings_RemoveWhitePrefix (s); /* returns a new string, s */
l = DynamicStrings_Length (s); /* returns a new string, s */
c = 0;
n = 0;
- negative = FALSE;
+ negative = false;
if (n < l)
{
/* parse leading + and - */
}
while ((n < l) && ((IsDecimalDigitValid (DynamicStrings_char (s, static_cast<int> (n)), base, &c)) || (IsHexidecimalDigitValid (DynamicStrings_char (s, static_cast<int> (n)), base, &c))))
{
- (*found) = TRUE;
+ (*found) = true;
n += 1;
}
}
The parameter found is set TRUE if a number was found.
*/
-extern "C" unsigned int StringConvert_StringToCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found)
+extern "C" unsigned int StringConvert_StringToCardinal (DynamicStrings_String s, unsigned int base, bool *found)
{
unsigned int n;
unsigned int l;
}
while ((n < l) && ((IsDecimalDigitValid (DynamicStrings_char (s, static_cast<int> (n)), base, &c)) || (IsHexidecimalDigitValid (DynamicStrings_char (s, static_cast<int> (n)), base, &c))))
{
- (*found) = TRUE;
+ (*found) = true;
n += 1;
}
}
abcdef are used, and if FALSE then ABCDEF are used.
*/
-extern "C" DynamicStrings_String StringConvert_LongIntegerToString (long int i, unsigned int width, char padding, unsigned int sign, unsigned int base, unsigned int lower)
+extern "C" DynamicStrings_String StringConvert_LongIntegerToString (long int i, unsigned int width, char padding, bool sign, unsigned int base, bool lower)
{
DynamicStrings_String s;
long unsigned int c;
c = ((long unsigned int ) (labs (i+1)))+1;
if (width > 0)
{
- return DynamicStrings_ConCat (StringConvert_LongIntegerToString (-((long int ) (c / ((long unsigned int ) (base)))), width-1, padding, sign, base, lower), DynamicStrings_Mark (StringConvert_LongIntegerToString (static_cast<long int> (c % ((long unsigned int ) (base))), 0, ' ', FALSE, base, lower)));
+ return DynamicStrings_ConCat (StringConvert_LongIntegerToString (-((long int ) (c / ((long unsigned int ) (base)))), width-1, padding, sign, base, lower), DynamicStrings_Mark (StringConvert_LongIntegerToString (static_cast<long int> (c % ((long unsigned int ) (base))), 0, ' ', false, base, lower)));
}
else
{
- return DynamicStrings_ConCat (StringConvert_LongIntegerToString (-((long int ) (c / ((long unsigned int ) (base)))), 0, padding, sign, base, lower), DynamicStrings_Mark (StringConvert_LongIntegerToString (static_cast<long int> (c % ((long unsigned int ) (base))), 0, ' ', FALSE, base, lower)));
+ return DynamicStrings_ConCat (StringConvert_LongIntegerToString (-((long int ) (c / ((long unsigned int ) (base)))), 0, padding, sign, base, lower), DynamicStrings_Mark (StringConvert_LongIntegerToString (static_cast<long int> (c % ((long unsigned int ) (base))), 0, ' ', false, base, lower)));
}
}
else
}
if (i > ((long int ) (base-1)))
{
- s = DynamicStrings_ConCat (DynamicStrings_ConCat (s, DynamicStrings_Mark (StringConvert_LongIntegerToString (i / ((long int ) (base)), 0, ' ', FALSE, base, lower))), DynamicStrings_Mark (StringConvert_LongIntegerToString (i % ((long int ) (base)), 0, ' ', FALSE, base, lower)));
+ s = DynamicStrings_ConCat (DynamicStrings_ConCat (s, DynamicStrings_Mark (StringConvert_LongIntegerToString (i / ((long int ) (base)), 0, ' ', false, base, lower))), DynamicStrings_Mark (StringConvert_LongIntegerToString (i % ((long int ) (base)), 0, ' ', false, base, lower)));
}
else
{
The parameter found is set TRUE if a number was found.
*/
-extern "C" long int StringConvert_StringToLongInteger (DynamicStrings_String s, unsigned int base, unsigned int *found)
+extern "C" long int StringConvert_StringToLongInteger (DynamicStrings_String s, unsigned int base, bool *found)
{
unsigned int n;
unsigned int l;
long unsigned int c;
- unsigned int negative;
+ bool negative;
s = DynamicStrings_RemoveWhitePrefix (s); /* returns a new string, s */
l = DynamicStrings_Length (s); /* returns a new string, s */
c = 0;
n = 0;
- negative = FALSE;
+ negative = false;
if (n < l)
{
/* parse leading + and - */
}
while ((n < l) && ((IsDecimalDigitValidLong (DynamicStrings_char (s, static_cast<int> (n)), base, &c)) || (IsHexidecimalDigitValidLong (DynamicStrings_char (s, static_cast<int> (n)), base, &c))))
{
- (*found) = TRUE;
+ (*found) = true;
n += 1;
}
}
abcdef are used, and if FALSE then ABCDEF are used.
*/
-extern "C" DynamicStrings_String StringConvert_LongCardinalToString (long unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower)
+extern "C" DynamicStrings_String StringConvert_LongCardinalToString (long unsigned int c, unsigned int width, char padding, unsigned int base, bool lower)
{
DynamicStrings_String s;
The parameter found is set TRUE if a number was found.
*/
-extern "C" long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found)
+extern "C" long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_String s, unsigned int base, bool *found)
{
unsigned int n;
unsigned int l;
}
while ((n < l) && ((IsDecimalDigitValidLong (DynamicStrings_char (s, static_cast<int> (n)), base, &c)) || (IsHexidecimalDigitValidLong (DynamicStrings_char (s, static_cast<int> (n)), base, &c))))
{
- (*found) = TRUE;
+ (*found) = true;
n += 1;
}
}
abcdef are used, and if FALSE then ABCDEF are used.
*/
-extern "C" DynamicStrings_String StringConvert_ShortCardinalToString (short unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower)
+extern "C" DynamicStrings_String StringConvert_ShortCardinalToString (short unsigned int c, unsigned int width, char padding, unsigned int base, bool lower)
{
DynamicStrings_String s;
The parameter found is set TRUE if a number was found.
*/
-extern "C" short unsigned int StringConvert_StringToShortCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found)
+extern "C" short unsigned int StringConvert_StringToShortCardinal (DynamicStrings_String s, unsigned int base, bool *found)
{
unsigned int n;
unsigned int l;
}
while ((n < l) && ((IsDecimalDigitValidShort (DynamicStrings_char (s, static_cast<int> (n)), base, &c)) || (IsHexidecimalDigitValidShort (DynamicStrings_char (s, static_cast<int> (n)), base, &c))))
{
- (*found) = TRUE;
+ (*found) = true;
n += 1;
}
}
extern "C" int StringConvert_stoi (DynamicStrings_String s)
{
- unsigned int found;
+ bool found;
return StringConvert_StringToInteger (s, 10, &found);
/* static analysis guarentees a RETURN statement will be used before here. */
itos - integer to decimal string.
*/
-extern "C" DynamicStrings_String StringConvert_itos (int i, unsigned int width, char padding, unsigned int sign)
+extern "C" DynamicStrings_String StringConvert_itos (int i, unsigned int width, char padding, bool sign)
{
- return StringConvert_IntegerToString (i, width, padding, sign, 10, FALSE);
+ return StringConvert_IntegerToString (i, width, padding, sign, 10, false);
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
extern "C" DynamicStrings_String StringConvert_ctos (unsigned int c, unsigned int width, char padding)
{
- return StringConvert_CardinalToString (c, width, padding, 10, FALSE);
+ return StringConvert_CardinalToString (c, width, padding, 10, false);
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
extern "C" unsigned int StringConvert_stoc (DynamicStrings_String s)
{
- unsigned int found;
+ bool found;
return StringConvert_StringToCardinal (s, 10, &found);
/* static analysis guarentees a RETURN statement will be used before here. */
extern "C" int StringConvert_hstoi (DynamicStrings_String s)
{
- unsigned int found;
+ bool found;
return StringConvert_StringToInteger (s, 16, &found);
/* static analysis guarentees a RETURN statement will be used before here. */
extern "C" int StringConvert_ostoi (DynamicStrings_String s)
{
- unsigned int found;
+ bool found;
return StringConvert_StringToInteger (s, 8, &found);
/* static analysis guarentees a RETURN statement will be used before here. */
extern "C" int StringConvert_bstoi (DynamicStrings_String s)
{
- unsigned int found;
+ bool found;
return StringConvert_StringToInteger (s, 2, &found);
/* static analysis guarentees a RETURN statement will be used before here. */
extern "C" unsigned int StringConvert_hstoc (DynamicStrings_String s)
{
- unsigned int found;
+ bool found;
return StringConvert_StringToCardinal (s, 16, &found);
/* static analysis guarentees a RETURN statement will be used before here. */
extern "C" unsigned int StringConvert_ostoc (DynamicStrings_String s)
{
- unsigned int found;
+ bool found;
return StringConvert_StringToCardinal (s, 8, &found);
/* static analysis guarentees a RETURN statement will be used before here. */
extern "C" unsigned int StringConvert_bstoc (DynamicStrings_String s)
{
- unsigned int found;
+ bool found;
return StringConvert_StringToCardinal (s, 2, &found);
/* static analysis guarentees a RETURN statement will be used before here. */
StringToLongreal - returns a LONGREAL and sets found to TRUE if a legal number is seen.
*/
-extern "C" long double StringConvert_StringToLongreal (DynamicStrings_String s, unsigned int *found)
+extern "C" long double StringConvert_StringToLongreal (DynamicStrings_String s, bool *found)
{
- unsigned int error;
+ bool error;
long double value;
s = DynamicStrings_RemoveWhitePrefix (s); /* new string is created */
extern "C" DynamicStrings_String StringConvert_LongrealToString (long double x, unsigned int TotalWidth, unsigned int FractionWidth)
{
- unsigned int maxprecision;
+ bool maxprecision;
DynamicStrings_String s;
void * r;
int point;
- unsigned int sign;
+ bool sign;
int l;
if (TotalWidth == 0)
{
- maxprecision = TRUE;
+ maxprecision = true;
r = ldtoa_ldtoa (x, ldtoa_decimaldigits, 100, &point, &sign);
}
else
{
s = DynamicStrings_Slice (DynamicStrings_Mark (StringConvert_ToDecimalPlaces (s, FractionWidth)), 0, static_cast<int> (TotalWidth-1));
s = DynamicStrings_ConCat (DynamicStrings_InitStringChar ('-'), DynamicStrings_Mark (s));
- sign = FALSE;
+ sign = false;
}
else
{
{
s = StringConvert_ToDecimalPlaces (s, FractionWidth);
s = DynamicStrings_ConCat (DynamicStrings_InitStringChar ('-'), DynamicStrings_Mark (s));
- sign = FALSE;
+ sign = false;
}
else
{
extern "C" double StringConvert_stor (DynamicStrings_String s)
{
- unsigned int found;
+ bool found;
return (double ) (StringConvert_StringToLongreal (s, &found));
/* static analysis guarentees a RETURN statement will be used before here. */
extern "C" long double StringConvert_stolr (DynamicStrings_String s)
{
- unsigned int found;
+ bool found;
return StringConvert_StringToLongreal (s, &found);
/* static analysis guarentees a RETURN statement will be used before here. */
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
abcdef are used, and if FALSE then ABCDEF are used.
*/
-EXTERN DynamicStrings_String StringConvert_IntegerToString (int i, unsigned int width, char padding, unsigned int sign, unsigned int base, unsigned int lower);
+EXTERN DynamicStrings_String StringConvert_IntegerToString (int i, unsigned int width, char padding, bool sign, unsigned int base, bool lower);
/*
CardinalToString - converts CARDINAL, c, into a String. The field
abcdef are used, and if FALSE then ABCDEF are used.
*/
-EXTERN DynamicStrings_String StringConvert_CardinalToString (unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower);
+EXTERN DynamicStrings_String StringConvert_CardinalToString (unsigned int c, unsigned int width, char padding, unsigned int base, bool lower);
/*
StringToInteger - converts a string, s, of, base, into an INTEGER.
The parameter found is set TRUE if a number was found.
*/
-EXTERN int StringConvert_StringToInteger (DynamicStrings_String s, unsigned int base, unsigned int *found);
+EXTERN int StringConvert_StringToInteger (DynamicStrings_String s, unsigned int base, bool *found);
/*
StringToCardinal - converts a string, s, of, base, into a CARDINAL.
The parameter found is set TRUE if a number was found.
*/
-EXTERN unsigned int StringConvert_StringToCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found);
+EXTERN unsigned int StringConvert_StringToCardinal (DynamicStrings_String s, unsigned int base, bool *found);
/*
LongIntegerToString - converts LONGINT, i, into a String. The field with
abcdef are used, and if FALSE then ABCDEF are used.
*/
-EXTERN DynamicStrings_String StringConvert_LongIntegerToString (long int i, unsigned int width, char padding, unsigned int sign, unsigned int base, unsigned int lower);
+EXTERN DynamicStrings_String StringConvert_LongIntegerToString (long int i, unsigned int width, char padding, bool sign, unsigned int base, bool lower);
/*
StringToLongInteger - converts a string, s, of, base, into an LONGINT.
The parameter found is set TRUE if a number was found.
*/
-EXTERN long int StringConvert_StringToLongInteger (DynamicStrings_String s, unsigned int base, unsigned int *found);
+EXTERN long int StringConvert_StringToLongInteger (DynamicStrings_String s, unsigned int base, bool *found);
/*
LongCardinalToString - converts LONGCARD, c, into a String. The field
abcdef are used, and if FALSE then ABCDEF are used.
*/
-EXTERN DynamicStrings_String StringConvert_LongCardinalToString (long unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower);
+EXTERN DynamicStrings_String StringConvert_LongCardinalToString (long unsigned int c, unsigned int width, char padding, unsigned int base, bool lower);
/*
StringToLongCardinal - converts a string, s, of, base, into a LONGCARD.
The parameter found is set TRUE if a number was found.
*/
-EXTERN long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found);
+EXTERN long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_String s, unsigned int base, bool *found);
/*
ShortCardinalToString - converts SHORTCARD, c, into a String. The field
abcdef are used, and if FALSE then ABCDEF are used.
*/
-EXTERN DynamicStrings_String StringConvert_ShortCardinalToString (short unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower);
+EXTERN DynamicStrings_String StringConvert_ShortCardinalToString (short unsigned int c, unsigned int width, char padding, unsigned int base, bool lower);
/*
StringToShortCardinal - converts a string, s, of, base, into a SHORTCARD.
The parameter found is set TRUE if a number was found.
*/
-EXTERN short unsigned int StringConvert_StringToShortCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found);
+EXTERN short unsigned int StringConvert_StringToShortCardinal (DynamicStrings_String s, unsigned int base, bool *found);
/*
stoi - decimal string to INTEGER
itos - integer to decimal string.
*/
-EXTERN DynamicStrings_String StringConvert_itos (int i, unsigned int width, char padding, unsigned int sign);
+EXTERN DynamicStrings_String StringConvert_itos (int i, unsigned int width, char padding, bool sign);
/*
ctos - cardinal to decimal string.
if a legal number is seen.
*/
-EXTERN long double StringConvert_StringToLongreal (DynamicStrings_String s, unsigned int *found);
+EXTERN long double StringConvert_StringToLongreal (DynamicStrings_String s, bool *found);
/*
LongrealToString - converts a LONGREAL number, Real, which has,
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# include "GDebug.h"
# include "GSYSTEM.h"
-# define enableDeallocation TRUE
-# define enableZero FALSE
-# define enableTrace FALSE
+# define enableDeallocation true
+# define enableZero false
+# define enableTrace false
static unsigned int callno;
-static unsigned int zero;
-static unsigned int trace;
+static bool zero;
+static bool trace;
extern "C" void SysStorage_ALLOCATE (void * *a, unsigned int size);
extern "C" void SysStorage_DEALLOCATE (void * *a, unsigned int size);
is resized accordingly.
*/
-extern "C" unsigned int SysStorage_Available (unsigned int size);
+extern "C" bool SysStorage_Available (unsigned int size);
/*
Init - initializes the heap. This does nothing on a GNU/Linux system.
is resized accordingly.
*/
-extern "C" unsigned int SysStorage_Available (unsigned int size)
+extern "C" bool SysStorage_Available (unsigned int size)
{
void * a;
{
libc_printf ((const char *) " no\\n", 7, size);
}
- return FALSE;
+ return false;
}
else
{
libc_printf ((const char *) " yes\\n", 8, size);
}
libc_free (a);
- return TRUE;
+ return true;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
else
{
- trace = FALSE;
+ trace = false;
}
if (enableZero)
{
}
else
{
- zero = FALSE;
+ zero = false;
}
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
Available - returns TRUE if, size, bytes can be allocated.
*/
-EXTERN unsigned int SysStorage_Available (unsigned int size);
+EXTERN bool SysStorage_Available (unsigned int size);
/*
Init - initializes the heap.
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
isItemInList - returns true if a ADDRESS, c, was found in alist, l.
*/
-extern "C" unsigned int alists_isItemInList (alists_alist l, void * c);
+extern "C" bool alists_isItemInList (alists_alist l, void * c);
/*
foreachItemInListDo - calls procedure, P, foreach item in alist, l.
{
alists_alist p;
unsigned int i;
- unsigned int found;
+ bool found;
if (l != NULL)
{
- found = FALSE;
+ found = false;
p = NULL;
do {
i = 1;
}
if ((i <= l->noOfelements) && (l->elements.array[i-1] == c))
{
- found = TRUE;
+ found = true;
}
else
{
isItemInList - returns true if a ADDRESS, c, was found in alist, l.
*/
-extern "C" unsigned int alists_isItemInList (alists_alist l, void * c)
+extern "C" bool alists_isItemInList (alists_alist l, void * c)
{
unsigned int i;
{
if (l->elements.array[i-1] == c)
{
- return TRUE;
+ return true;
}
else
{
}
l = l->next;
} while (! (l == NULL));
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
isItemInList - returns true if a ADDRESS, c, was found in alist, l.
*/
-EXTERN unsigned int alists_isItemInList (alists_alist l, void * c);
+EXTERN bool alists_isItemInList (alists_alist l, void * c);
/*
foreachItemInListDo - calls procedure, P, foreach item in alist, l.
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# define indentation 3
# define indentationC 2
-# define debugScopes FALSE
-# define debugDecl FALSE
-# define caseException TRUE
-# define returnException TRUE
-# define forceCompoundStatement TRUE
-# define enableDefForCStrings FALSE
-# define enableMemsetOnAllocation TRUE
-# define forceQualified TRUE
+# define debugScopes false
+# define debugDecl false
+# define caseException true
+# define returnException true
+# define forceCompoundStatement true
+# define enableDefForCStrings false
+# define enableMemsetOnAllocation true
+# define forceQualified true
typedef struct decl_nodeRec_r decl_nodeRec;
typedef struct decl_intrinsicT_r decl_intrinsicT;
typedef void (*Indexing_IndexProcedure_t) (void *);
struct Indexing_IndexProcedure_p { Indexing_IndexProcedure_t proc; };
-typedef unsigned int (*decl_isNodeF_t) (decl_node);
+typedef bool (*decl_isNodeF_t) (decl_node);
struct decl_isNodeF_p { decl_isNodeF_t proc; };
typedef void (*M2RTS_ArgCVEnvP_t) (int, void *, void *);
struct M2RTS_ArgCVEnvP_p { M2RTS_ArgCVEnvP_t proc; };
-typedef unsigned int (*symbolKey_isSymbol_t) (void *);
+typedef bool (*symbolKey_isSymbol_t) (void *);
struct symbolKey_isSymbol_p { symbolKey_isSymbol_t proc; };
struct libc_tm_r {
mcError_error parent;
mcError_error child;
mcError_error next;
- unsigned int fatal;
+ bool fatal;
DynamicStrings_String s;
unsigned int token;
};
struct decl_identlistT_r {
wlists_wlist names;
- unsigned int cnamed;
+ bool cnamed;
};
struct decl_commentT_r {
nameKey_Name name;
decl_node type;
decl_node scope;
- unsigned int isHidden;
- unsigned int isInternal;
+ bool isHidden;
+ bool isInternal;
};
struct decl_recordT_r {
decl_node subr;
decl_node type;
decl_node scope;
- unsigned int isUnbounded;
+ bool isUnbounded;
};
struct decl_stringT_r {
nameKey_Name name;
unsigned int length;
- unsigned int isCharCompatible;
+ bool isCharCompatible;
DynamicStrings_String cstring;
unsigned int clength;
DynamicStrings_String cchar;
decl_node namelist;
decl_node type;
decl_node scope;
- unsigned int isUnbounded;
- unsigned int isForC;
- unsigned int isUsed;
+ bool isUnbounded;
+ bool isForC;
+ bool isUsed;
};
struct decl_paramT_r {
decl_node namelist;
decl_node type;
decl_node scope;
- unsigned int isUnbounded;
- unsigned int isForC;
- unsigned int isUsed;
+ bool isUnbounded;
+ bool isForC;
+ bool isUsed;
};
struct decl_varargsT_r {
nameKey_Name name;
decl_node parent;
decl_node varient;
- unsigned int simple;
+ bool simple;
Indexing_Index listOfSons;
decl_node scope;
};
struct decl_proctypeT_r {
Indexing_Index parameters;
- unsigned int returnopt;
- unsigned int vararg;
+ bool returnopt;
+ bool vararg;
decl_node optarg_;
decl_node scope;
decl_node returnType;
struct decl_cnameT_r {
nameKey_Name name;
- unsigned int init;
+ bool init;
};
struct Indexing__T5_r {
unsigned int Used;
unsigned int Low;
unsigned int High;
- unsigned int Debug;
+ bool Debug;
unsigned int Map;
};
mcComment_commentType type;
DynamicStrings_String content;
nameKey_Name procName;
- unsigned int used;
+ bool used;
};
struct wlists__T10_a { unsigned int array[maxNoOfElements-1+1]; };
unsigned int noArgs;
decl_node type;
decl_commentPair intrinsicComment;
- unsigned int postUnreachable;
+ bool postUnreachable;
};
struct decl_funccallT_r {
decl_node type;
decl_node decl;
decl_node scope;
- unsigned int isInitialised;
- unsigned int isParameter;
- unsigned int isVarParameter;
- unsigned int isUsed;
+ bool isInitialised;
+ bool isParameter;
+ bool isVarParameter;
+ bool isUsed;
decl_cnameT cname;
};
struct decl_recordfieldT_r {
nameKey_Name name;
decl_node type;
- unsigned int tag;
+ bool tag;
decl_node parent;
decl_node varient;
decl_node scope;
decl_scopeT decls;
decl_node scope;
Indexing_Index parameters;
- unsigned int isForC;
- unsigned int built;
- unsigned int checking;
- unsigned int returnopt;
- unsigned int vararg;
- unsigned int noreturnused;
- unsigned int noreturn;
+ bool isForC;
+ bool built;
+ bool checking;
+ bool returnopt;
+ bool vararg;
+ bool noreturnused;
+ bool noreturn;
unsigned int paramcount;
decl_node optarg_;
decl_node returnType;
decl_scopeT decls;
decl_node beginStatements;
decl_node finallyStatements;
- unsigned int enumsComplete;
- unsigned int constsComplete;
- unsigned int visited;
+ bool enumsComplete;
+ bool constsComplete;
+ bool visited;
decl_commentPair com;
};
struct decl_defT_r {
nameKey_Name name;
nameKey_Name source;
- unsigned int hasHidden;
- unsigned int forC;
+ bool hasHidden;
+ bool forC;
Indexing_Index exported;
Indexing_Index importedModules;
decl_fixupInfo constFixup;
decl_fixupInfo enumFixup;
decl_scopeT decls;
- unsigned int enumsComplete;
- unsigned int constsComplete;
- unsigned int visited;
+ bool enumsComplete;
+ bool constsComplete;
+ bool visited;
decl_commentPair com;
};
decl_node finallyStatements;
decl_node definitionModule;
decl_scopeT decls;
- unsigned int enumsComplete;
- unsigned int constsComplete;
- unsigned int visited;
+ bool enumsComplete;
+ bool constsComplete;
+ bool visited;
decl_commentPair com;
};
struct mcPretty__T12_r {
mcPretty_writeProc write_;
mcPretty_writeLnProc writeln;
- unsigned int needsSpace;
- unsigned int needsIndent;
+ bool needsSpace;
+ bool needsIndent;
unsigned int seekPos;
unsigned int curLine;
unsigned int curPos;
typedef enum {DynamicStrings_inuse, DynamicStrings_marked, DynamicStrings_onlist, DynamicStrings_poisoned} DynamicStrings_desState;
struct DynamicStrings_descriptor_r {
- unsigned int charStarUsed;
+ bool charStarUsed;
void *charStar;
unsigned int charStarSize;
- unsigned int charStarValid;
+ bool charStarValid;
DynamicStrings_desState state;
DynamicStrings_String garbage;
};
static alists_alist todoQ;
static alists_alist partialQ;
static alists_alist doneQ;
-static unsigned int mustVisitScope;
-static unsigned int simplified;
+static bool mustVisitScope;
+static bool simplified;
static unsigned int tempCount;
static decl_node globalNode;
extern "C" void SYSTEM_ShiftVal (unsigned int *s, unsigned int _s_high, unsigned int *d, unsigned int _d_high, unsigned int SetSizeInBits, int ShiftCount);
extern "C" void M2RTS_DeconstructModules (void * applicationmodule, void * libname, int argc, void * argv, void * envp);
extern "C" void M2RTS_RegisterModule (void * name, void * libname, M2RTS_ArgCVEnvP init, M2RTS_ArgCVEnvP fini, PROC dependencies);
extern "C" void M2RTS_RequestDependant (void * modulename, void * libname, void * dependantmodule, void * dependantlibname);
-extern "C" unsigned int M2RTS_InstallTerminationProcedure (PROC p);
+extern "C" bool M2RTS_InstallTerminationProcedure (PROC p);
extern "C" void M2RTS_ExecuteInitialProcedures (void);
-extern "C" unsigned int M2RTS_InstallInitialProcedure (PROC p);
+extern "C" bool M2RTS_InstallInitialProcedure (PROC p);
extern "C" void M2RTS_ExecuteTerminationProcedures (void);
extern "C" void M2RTS_Terminate (void) __attribute__ ((noreturn));
extern "C" void M2RTS_HALT (int exitcode) __attribute__ ((noreturn));
isDef - return TRUE if node, n, is a definition module.
*/
-extern "C" unsigned int decl_isDef (decl_node n);
+extern "C" bool decl_isDef (decl_node n);
/*
isImp - return TRUE if node, n, is an implementation module.
*/
-extern "C" unsigned int decl_isImp (decl_node n);
+extern "C" bool decl_isImp (decl_node n);
/*
isImpOrModule - returns TRUE if, n, is a program module or implementation module.
*/
-extern "C" unsigned int decl_isImpOrModule (decl_node n);
+extern "C" bool decl_isImpOrModule (decl_node n);
/*
isVisited - returns TRUE if the node was visited.
*/
-extern "C" unsigned int decl_isVisited (decl_node n);
+extern "C" bool decl_isVisited (decl_node n);
/*
unsetVisited - unset the visited flag on a def/imp/module node.
getEnumsComplete - gets the field from the def or imp or module, n.
*/
-extern "C" unsigned int decl_getEnumsComplete (decl_node n);
+extern "C" bool decl_getEnumsComplete (decl_node n);
/*
resetEnumPos - resets the index into the saved list of enums inside
isModule - return TRUE if node, n, is a program module.
*/
-extern "C" unsigned int decl_isModule (decl_node n);
+extern "C" bool decl_isModule (decl_node n);
/*
isMainModule - return TRUE if node, n, is the main module specified
implementation or program module.
*/
-extern "C" unsigned int decl_isMainModule (decl_node n);
+extern "C" bool decl_isMainModule (decl_node n);
/*
setMainModule - sets node, n, as the main module to be compiled.
isConst - returns TRUE if node, n, is a const.
*/
-extern "C" unsigned int decl_isConst (decl_node n);
+extern "C" bool decl_isConst (decl_node n);
/*
isType - returns TRUE if node, n, is a type.
*/
-extern "C" unsigned int decl_isType (decl_node n);
+extern "C" bool decl_isType (decl_node n);
/*
putType - places, exp, as the type alias to des.
isTypeHidden - returns TRUE if type, n, is hidden.
*/
-extern "C" unsigned int decl_isTypeHidden (decl_node n);
+extern "C" bool decl_isTypeHidden (decl_node n);
/*
hasHidden - returns TRUE if module, n, has a hidden type.
*/
-extern "C" unsigned int decl_hasHidden (decl_node n);
+extern "C" bool decl_hasHidden (decl_node n);
/*
isVar - returns TRUE if node, n, is a type.
*/
-extern "C" unsigned int decl_isVar (decl_node n);
+extern "C" bool decl_isVar (decl_node n);
/*
isTemporary - returns TRUE if node, n, is a variable and temporary.
*/
-extern "C" unsigned int decl_isTemporary (decl_node n);
+extern "C" bool decl_isTemporary (decl_node n);
/*
isExported - returns TRUE if symbol, n, is exported from
the definition module.
*/
-extern "C" unsigned int decl_isExported (decl_node n);
+extern "C" bool decl_isExported (decl_node n);
/*
getDeclScope - returns the node representing the
isLiteral - returns TRUE if, n, is a literal.
*/
-extern "C" unsigned int decl_isLiteral (decl_node n);
+extern "C" bool decl_isLiteral (decl_node n);
/*
isConstSet - returns TRUE if, n, is a constant set.
*/
-extern "C" unsigned int decl_isConstSet (decl_node n);
+extern "C" bool decl_isConstSet (decl_node n);
/*
isEnumerationField - returns TRUE if, n, is an enumeration field.
*/
-extern "C" unsigned int decl_isEnumerationField (decl_node n);
+extern "C" bool decl_isEnumerationField (decl_node n);
/*
isEnumeration - returns TRUE if node, n, is an enumeration type.
*/
-extern "C" unsigned int decl_isEnumeration (decl_node n);
+extern "C" bool decl_isEnumeration (decl_node n);
/*
isUnbounded - returns TRUE if, n, is an unbounded array.
*/
-extern "C" unsigned int decl_isUnbounded (decl_node n);
+extern "C" bool decl_isUnbounded (decl_node n);
/*
isParameter - returns TRUE if, n, is a parameter.
*/
-extern "C" unsigned int decl_isParameter (decl_node n);
+extern "C" bool decl_isParameter (decl_node n);
/*
isVarParam - returns TRUE if, n, is a var parameter.
*/
-extern "C" unsigned int decl_isVarParam (decl_node n);
+extern "C" bool decl_isVarParam (decl_node n);
/*
isParam - returns TRUE if, n, is a non var parameter.
*/
-extern "C" unsigned int decl_isParam (decl_node n);
+extern "C" bool decl_isParam (decl_node n);
/*
isNonVarParam - is an alias to isParam.
*/
-extern "C" unsigned int decl_isNonVarParam (decl_node n);
+extern "C" bool decl_isNonVarParam (decl_node n);
/*
addOptParameter - returns an optarg which has been created and added to
isOptarg - returns TRUE if, n, is an optarg.
*/
-extern "C" unsigned int decl_isOptarg (decl_node n);
+extern "C" bool decl_isOptarg (decl_node n);
/*
isRecord - returns TRUE if, n, is a record.
*/
-extern "C" unsigned int decl_isRecord (decl_node n);
+extern "C" bool decl_isRecord (decl_node n);
/*
isRecordField - returns TRUE if, n, is a record field.
*/
-extern "C" unsigned int decl_isRecordField (decl_node n);
+extern "C" bool decl_isRecordField (decl_node n);
/*
isVarientField - returns TRUE if, n, is a varient field.
*/
-extern "C" unsigned int decl_isVarientField (decl_node n);
+extern "C" bool decl_isVarientField (decl_node n);
/*
isArray - returns TRUE if, n, is an array.
*/
-extern "C" unsigned int decl_isArray (decl_node n);
+extern "C" bool decl_isArray (decl_node n);
/*
isProcType - returns TRUE if, n, is a procedure type.
*/
-extern "C" unsigned int decl_isProcType (decl_node n);
+extern "C" bool decl_isProcType (decl_node n);
/*
isPointer - returns TRUE if, n, is a pointer.
*/
-extern "C" unsigned int decl_isPointer (decl_node n);
+extern "C" bool decl_isPointer (decl_node n);
/*
isProcedure - returns TRUE if, n, is a procedure.
*/
-extern "C" unsigned int decl_isProcedure (decl_node n);
+extern "C" bool decl_isProcedure (decl_node n);
/*
isVarient - returns TRUE if, n, is a varient record.
*/
-extern "C" unsigned int decl_isVarient (decl_node n);
+extern "C" bool decl_isVarient (decl_node n);
/*
isSet - returns TRUE if, n, is a set type.
*/
-extern "C" unsigned int decl_isSet (decl_node n);
+extern "C" bool decl_isSet (decl_node n);
/*
isSubrange - returns TRUE if, n, is a subrange type.
*/
-extern "C" unsigned int decl_isSubrange (decl_node n);
+extern "C" bool decl_isSubrange (decl_node n);
/*
isZtype - returns TRUE if, n, is the Z type.
*/
-extern "C" unsigned int decl_isZtype (decl_node n);
+extern "C" bool decl_isZtype (decl_node n);
/*
isRtype - returns TRUE if, n, is the R type.
*/
-extern "C" unsigned int decl_isRtype (decl_node n);
+extern "C" bool decl_isRtype (decl_node n);
/*
makeConst - create, initialise and return a const node.
module, m, scope.
*/
-extern "C" void decl_addImportedModule (decl_node m, decl_node i, unsigned int scoped);
+extern "C" void decl_addImportedModule (decl_node m, decl_node i, bool scoped);
/*
setSource - sets the source filename for module, n, to s.
makeVarParameter - returns a var parameter node with, name: type.
*/
-extern "C" decl_node decl_makeVarParameter (decl_node l, decl_node type, decl_node proc, unsigned int isused);
+extern "C" decl_node decl_makeVarParameter (decl_node l, decl_node type, decl_node proc, bool isused);
/*
makeNonVarParameter - returns a non var parameter node with, name: type.
*/
-extern "C" decl_node decl_makeNonVarParameter (decl_node l, decl_node type, decl_node proc, unsigned int isused);
+extern "C" decl_node decl_makeNonVarParameter (decl_node l, decl_node type, decl_node proc, bool isused);
/*
paramEnter - reset the parameter count.
ident, i, is unique.
*/
-extern "C" unsigned int decl_putIdent (decl_node n, nameKey_Name i);
+extern "C" bool decl_putIdent (decl_node n, nameKey_Name i);
/*
addVarParameters - adds the identlist, i, of, type, to be VAR parameters
in procedure, n.
*/
-extern "C" void decl_addVarParameters (decl_node n, decl_node i, decl_node type, unsigned int isused);
+extern "C" void decl_addVarParameters (decl_node n, decl_node i, decl_node type, bool isused);
/*
addNonVarParameters - adds the identlist, i, of, type, to be parameters
in procedure, n.
*/
-extern "C" void decl_addNonVarParameters (decl_node n, decl_node i, decl_node type, unsigned int isused);
+extern "C" void decl_addNonVarParameters (decl_node n, decl_node i, decl_node type, bool isused);
/*
makeVarargs - returns a varargs node.
isVarargs - returns TRUE if, n, is a varargs node.
*/
-extern "C" unsigned int decl_isVarargs (decl_node n);
+extern "C" bool decl_isVarargs (decl_node n);
/*
addParameter - adds a parameter, param, to procedure or proctype, proc.
isPointerRef - returns TRUE if, n, is a pointerref node.
*/
-extern "C" unsigned int decl_isPointerRef (decl_node n);
+extern "C" bool decl_isPointerRef (decl_node n);
/*
makeDeRef - dereferences the pointer defined by, n.
isSetValue - returns TRUE if, n, is a setvalue node.
*/
-extern "C" unsigned int decl_isSetValue (decl_node n);
+extern "C" bool decl_isSetValue (decl_node n);
/*
putSetValue - assigns the type, t, to the set value, n. The
isExpList - returns TRUE if, n, is an explist node.
*/
-extern "C" unsigned int decl_isExpList (decl_node n);
+extern "C" bool decl_isExpList (decl_node n);
/*
putExpList - places, expression, e, within the explist, n.
isStatementSequence - returns TRUE if node, n, is a statement sequence.
*/
-extern "C" unsigned int decl_isStatementSequence (decl_node n);
+extern "C" bool decl_isStatementSequence (decl_node n);
/*
addStatement - adds node, n, as a statement to statememt sequence, s.
isReturn - returns TRUE if node, n, is a return.
*/
-extern "C" unsigned int decl_isReturn (decl_node n);
+extern "C" bool decl_isReturn (decl_node n);
/*
putReturn - assigns node, e, as the expression on the return node.
isWhile - returns TRUE if node, n, is a while.
*/
-extern "C" unsigned int decl_isWhile (decl_node n);
+extern "C" bool decl_isWhile (decl_node n);
/*
addWhileDoComment - adds body and after comments to while node, w.
isExit - returns TRUE if node, n, is an exit.
*/
-extern "C" unsigned int decl_isExit (decl_node n);
+extern "C" bool decl_isExit (decl_node n);
/*
makeLoop - creates and returns a loop node.
isLoop - returns TRUE if, n, is a loop node.
*/
-extern "C" unsigned int decl_isLoop (decl_node n);
+extern "C" bool decl_isLoop (decl_node n);
/*
putLoop - places statement sequence, s, into loop, l.
isIf - returns TRUE if, n, is an if node.
*/
-extern "C" unsigned int decl_isIf (decl_node n);
+extern "C" bool decl_isIf (decl_node n);
/*
makeElsif - creates and returns an elsif node.
isElsif - returns TRUE if node, n, is an elsif node.
*/
-extern "C" unsigned int decl_isElsif (decl_node n);
+extern "C" bool decl_isElsif (decl_node n);
/*
putElse - the else is grafted onto the if/elsif node, i,
isFor - returns TRUE if node, n, is a for node.
*/
-extern "C" unsigned int decl_isFor (decl_node n);
+extern "C" bool decl_isFor (decl_node n);
/*
putFor - assigns the fields of the for node with
isRepeat - returns TRUE if node, n, is a repeat node.
*/
-extern "C" unsigned int decl_isRepeat (decl_node n);
+extern "C" bool decl_isRepeat (decl_node n);
/*
putRepeat - places statements, s, and expression, e, into
isCase - returns TRUE if node, n, is a case statement.
*/
-extern "C" unsigned int decl_isCase (decl_node n);
+extern "C" bool decl_isCase (decl_node n);
/*
putCaseExpression - places expression, e, into case statement, n.
isCaseLabelList - returns TRUE if, n, is a caselabellist.
*/
-extern "C" unsigned int decl_isCaseLabelList (decl_node n);
+extern "C" bool decl_isCaseLabelList (decl_node n);
/*
makeCaseList - creates and returns a case statement node.
isCaseList - returns TRUE if, n, is a case list.
*/
-extern "C" unsigned int decl_isCaseList (decl_node n);
+extern "C" bool decl_isCaseList (decl_node n);
/*
putCaseRange - places the case range lo..hi into caselist, n.
isRange - returns TRUE if node, n, is a range.
*/
-extern "C" unsigned int decl_isRange (decl_node n);
+extern "C" bool decl_isRange (decl_node n);
/*
setNoReturn - sets noreturn field inside procedure.
*/
-extern "C" void decl_setNoReturn (decl_node n, unsigned int value);
+extern "C" void decl_setNoReturn (decl_node n, bool value);
/*
dupExpr - duplicate the expression nodes, it does not duplicate
extern "C" nameKey_Name nameKey_makekey (void * a);
extern "C" void nameKey_getKey (nameKey_Name key, char *a, unsigned int _a_high);
extern "C" unsigned int nameKey_lengthKey (nameKey_Name key);
-extern "C" unsigned int nameKey_isKey (const char *a_, unsigned int _a_high);
+extern "C" bool nameKey_isKey (const char *a_, unsigned int _a_high);
extern "C" void nameKey_writeKey (nameKey_Name key);
-extern "C" unsigned int nameKey_isSameExcludingCase (nameKey_Name key1, nameKey_Name key2);
+extern "C" bool nameKey_isSameExcludingCase (nameKey_Name key1, nameKey_Name key2);
extern "C" void * nameKey_keyToCharStar (nameKey_Name key);
extern "C" symbolKey_symbolTree symbolKey_initTree (void);
extern "C" void symbolKey_killTree (symbolKey_symbolTree *t);
isEmptyTree - returns true if symbolTree, t, is empty.
*/
-extern "C" unsigned int symbolKey_isEmptyTree (symbolKey_symbolTree t);
+extern "C" bool symbolKey_isEmptyTree (symbolKey_symbolTree t);
/*
doesTreeContainAny - returns true if symbolTree, t, contains any
left, hence we need two procedures.
*/
-extern "C" unsigned int symbolKey_doesTreeContainAny (symbolKey_symbolTree t, symbolKey_isSymbol p);
+extern "C" bool symbolKey_doesTreeContainAny (symbolKey_symbolTree t, symbolKey_isSymbol p);
/*
foreachNodeDo - for each node in symbolTree, t, a procedure, p,
spaces on this line.
*/
-extern "C" mcComment_commentDesc mcComment_initComment (unsigned int onlySpaces);
+extern "C" mcComment_commentDesc mcComment_initComment (bool onlySpaces);
/*
addText - cs is a C string (null terminated) which contains comment text.
isProcedureComment - returns TRUE if, cd, is a procedure comment.
*/
-extern "C" unsigned int mcComment_isProcedureComment (mcComment_commentDesc cd);
+extern "C" bool mcComment_isProcedureComment (mcComment_commentDesc cd);
/*
isBodyComment - returns TRUE if, cd, is a body comment.
*/
-extern "C" unsigned int mcComment_isBodyComment (mcComment_commentDesc cd);
+extern "C" bool mcComment_isBodyComment (mcComment_commentDesc cd);
/*
isAfterComment - returns TRUE if, cd, is an after comment.
*/
-extern "C" unsigned int mcComment_isAfterComment (mcComment_commentDesc cd);
-extern "C" void mcDebug_assert (unsigned int q);
+extern "C" bool mcComment_isAfterComment (mcComment_commentDesc cd);
+extern "C" void mcDebug_assert (bool q);
extern "C" void mcDebug_writeDebug (const char *a_, unsigned int _a_high);
extern "C" void Storage_ALLOCATE (void * *a, unsigned int Size);
extern "C" void Storage_DEALLOCATE (void * *a, unsigned int Size);
extern "C" void Storage_REALLOCATE (void * *a, unsigned int Size);
-extern "C" unsigned int Storage_Available (unsigned int Size);
-extern "C" unsigned int SFIO_Exists (DynamicStrings_String fname);
+extern "C" bool Storage_Available (unsigned int Size);
+extern "C" bool SFIO_Exists (DynamicStrings_String fname);
extern "C" FIO_File SFIO_OpenToRead (DynamicStrings_String fname);
extern "C" FIO_File SFIO_OpenToWrite (DynamicStrings_String fname);
-extern "C" FIO_File SFIO_OpenForRandom (DynamicStrings_String fname, unsigned int towrite, unsigned int newfile);
+extern "C" FIO_File SFIO_OpenForRandom (DynamicStrings_String fname, bool towrite, bool newfile);
extern "C" DynamicStrings_String SFIO_WriteS (FIO_File file, DynamicStrings_String s);
extern "C" DynamicStrings_String SFIO_ReadS (FIO_File file);
-extern "C" unsigned int FIO_IsNoError (FIO_File f);
-extern "C" unsigned int FIO_IsActive (FIO_File f);
-extern "C" unsigned int FIO_Exists (const char *fname_, unsigned int _fname_high);
+extern "C" bool FIO_IsNoError (FIO_File f);
+extern "C" bool FIO_IsActive (FIO_File f);
+extern "C" bool FIO_Exists (const char *fname_, unsigned int _fname_high);
extern "C" FIO_File FIO_OpenToRead (const char *fname_, unsigned int _fname_high);
extern "C" FIO_File FIO_OpenToWrite (const char *fname_, unsigned int _fname_high);
-extern "C" FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high, unsigned int towrite, unsigned int newfile);
+extern "C" FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high, bool towrite, bool newfile);
extern "C" void FIO_Close (FIO_File f);
-extern "C" unsigned int FIO_exists (void * fname, unsigned int flength);
+extern "C" bool FIO_exists (void * fname, unsigned int flength);
extern "C" FIO_File FIO_openToRead (void * fname, unsigned int flength);
extern "C" FIO_File FIO_openToWrite (void * fname, unsigned int flength);
-extern "C" FIO_File FIO_openForRandom (void * fname, unsigned int flength, unsigned int towrite, unsigned int newfile);
+extern "C" FIO_File FIO_openForRandom (void * fname, unsigned int flength, bool towrite, bool newfile);
extern "C" void FIO_FlushBuffer (FIO_File f);
extern "C" unsigned int FIO_ReadNBytes (FIO_File f, unsigned int nBytes, void * dest);
extern "C" void FIO_ReadAny (FIO_File f, unsigned char *a, unsigned int _a_high);
extern "C" unsigned int FIO_WriteNBytes (FIO_File f, unsigned int nBytes, void * src);
extern "C" void FIO_WriteAny (FIO_File f, unsigned char *a, unsigned int _a_high);
extern "C" void FIO_WriteChar (FIO_File f, char ch);
-extern "C" unsigned int FIO_EOF (FIO_File f);
-extern "C" unsigned int FIO_EOLN (FIO_File f);
-extern "C" unsigned int FIO_WasEOLN (FIO_File f);
+extern "C" bool FIO_EOF (FIO_File f);
+extern "C" bool FIO_EOLN (FIO_File f);
+extern "C" bool FIO_WasEOLN (FIO_File f);
extern "C" char FIO_ReadChar (FIO_File f);
extern "C" void FIO_UnReadChar (FIO_File f, char ch);
extern "C" void FIO_WriteLine (FIO_File f);
Equal - returns TRUE if String, a, and, b, are equal.
*/
-extern "C" unsigned int DynamicStrings_Equal (DynamicStrings_String a, DynamicStrings_String b);
+extern "C" bool DynamicStrings_Equal (DynamicStrings_String a, DynamicStrings_String b);
/*
EqualCharStar - returns TRUE if contents of String, s, is the same as the
string, a.
*/
-extern "C" unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, void * a);
+extern "C" bool DynamicStrings_EqualCharStar (DynamicStrings_String s, void * a);
/*
EqualArray - returns TRUE if contents of String, s, is the same as the
string, a.
*/
-extern "C" unsigned int DynamicStrings_EqualArray (DynamicStrings_String s, const char *a_, unsigned int _a_high);
+extern "C" bool DynamicStrings_EqualArray (DynamicStrings_String s, const char *a_, unsigned int _a_high);
/*
Mult - returns a new string which is n concatenations of String, s.
with an exit code of 1.
*/
-extern "C" void DynamicStrings_PopAllocation (unsigned int halt);
+extern "C" void DynamicStrings_PopAllocation (bool halt);
/*
PopAllocationExemption - test to see that all strings are deallocated, except
with an exit code of 1.
*/
-extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned int halt, DynamicStrings_String e);
-extern "C" DynamicStrings_String StringConvert_IntegerToString (int i, unsigned int width, char padding, unsigned int sign, unsigned int base, unsigned int lower);
-extern "C" DynamicStrings_String StringConvert_CardinalToString (unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower);
-extern "C" int StringConvert_StringToInteger (DynamicStrings_String s, unsigned int base, unsigned int *found);
-extern "C" unsigned int StringConvert_StringToCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found);
-extern "C" DynamicStrings_String StringConvert_LongIntegerToString (long int i, unsigned int width, char padding, unsigned int sign, unsigned int base, unsigned int lower);
-extern "C" long int StringConvert_StringToLongInteger (DynamicStrings_String s, unsigned int base, unsigned int *found);
-extern "C" DynamicStrings_String StringConvert_LongCardinalToString (long unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower);
-extern "C" long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found);
-extern "C" DynamicStrings_String StringConvert_ShortCardinalToString (short unsigned int c, unsigned int width, char padding, unsigned int base, unsigned int lower);
-extern "C" short unsigned int StringConvert_StringToShortCardinal (DynamicStrings_String s, unsigned int base, unsigned int *found);
+extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (bool halt, DynamicStrings_String e);
+extern "C" DynamicStrings_String StringConvert_IntegerToString (int i, unsigned int width, char padding, bool sign, unsigned int base, bool lower);
+extern "C" DynamicStrings_String StringConvert_CardinalToString (unsigned int c, unsigned int width, char padding, unsigned int base, bool lower);
+extern "C" int StringConvert_StringToInteger (DynamicStrings_String s, unsigned int base, bool *found);
+extern "C" unsigned int StringConvert_StringToCardinal (DynamicStrings_String s, unsigned int base, bool *found);
+extern "C" DynamicStrings_String StringConvert_LongIntegerToString (long int i, unsigned int width, char padding, bool sign, unsigned int base, bool lower);
+extern "C" long int StringConvert_StringToLongInteger (DynamicStrings_String s, unsigned int base, bool *found);
+extern "C" DynamicStrings_String StringConvert_LongCardinalToString (long unsigned int c, unsigned int width, char padding, unsigned int base, bool lower);
+extern "C" long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_String s, unsigned int base, bool *found);
+extern "C" DynamicStrings_String StringConvert_ShortCardinalToString (short unsigned int c, unsigned int width, char padding, unsigned int base, bool lower);
+extern "C" short unsigned int StringConvert_StringToShortCardinal (DynamicStrings_String s, unsigned int base, bool *found);
extern "C" int StringConvert_stoi (DynamicStrings_String s);
-extern "C" DynamicStrings_String StringConvert_itos (int i, unsigned int width, char padding, unsigned int sign);
+extern "C" DynamicStrings_String StringConvert_itos (int i, unsigned int width, char padding, bool sign);
extern "C" DynamicStrings_String StringConvert_ctos (unsigned int c, unsigned int width, char padding);
extern "C" unsigned int StringConvert_stoc (DynamicStrings_String s);
extern "C" int StringConvert_hstoi (DynamicStrings_String s);
extern "C" unsigned int StringConvert_hstoc (DynamicStrings_String s);
extern "C" unsigned int StringConvert_ostoc (DynamicStrings_String s);
extern "C" unsigned int StringConvert_bstoc (DynamicStrings_String s);
-extern "C" long double StringConvert_StringToLongreal (DynamicStrings_String s, unsigned int *found);
+extern "C" long double StringConvert_StringToLongreal (DynamicStrings_String s, bool *found);
extern "C" DynamicStrings_String StringConvert_LongrealToString (long double x, unsigned int TotalWidth, unsigned int FractionWidth);
extern "C" double StringConvert_stor (DynamicStrings_String s);
extern "C" long double StringConvert_stolr (DynamicStrings_String s);
extern "C" DynamicStrings_String StringConvert_ToSigFig (DynamicStrings_String s, unsigned int n);
extern "C" DynamicStrings_String StringConvert_ToDecimalPlaces (DynamicStrings_String s, unsigned int n);
extern "C" DynamicStrings_String mcOptions_handleOptions (void);
-extern "C" unsigned int mcOptions_getQuiet (void);
-extern "C" unsigned int mcOptions_getVerbose (void);
-extern "C" unsigned int mcOptions_getInternalDebugging (void);
+extern "C" bool mcOptions_getQuiet (void);
+extern "C" bool mcOptions_getVerbose (void);
+extern "C" bool mcOptions_getInternalDebugging (void);
extern "C" DynamicStrings_String mcOptions_getCppCommandLine (void);
extern "C" DynamicStrings_String mcOptions_getOutputFile (void);
-extern "C" unsigned int mcOptions_getExtendedOpaque (void);
-extern "C" void mcOptions_setDebugTopological (unsigned int value);
-extern "C" unsigned int mcOptions_getDebugTopological (void);
+extern "C" bool mcOptions_getExtendedOpaque (void);
+extern "C" void mcOptions_setDebugTopological (bool value);
+extern "C" bool mcOptions_getDebugTopological (void);
extern "C" DynamicStrings_String mcOptions_getHPrefix (void);
-extern "C" unsigned int mcOptions_getIgnoreFQ (void);
-extern "C" unsigned int mcOptions_getGccConfigSystem (void);
-extern "C" unsigned int mcOptions_getScaffoldDynamic (void);
-extern "C" unsigned int mcOptions_getScaffoldMain (void);
+extern "C" bool mcOptions_getIgnoreFQ (void);
+extern "C" bool mcOptions_getGccConfigSystem (void);
+extern "C" bool mcOptions_getScaffoldDynamic (void);
+extern "C" bool mcOptions_getScaffoldMain (void);
extern "C" void mcOptions_writeGPLheader (FIO_File f);
-extern "C" void mcOptions_setSuppressNoReturn (unsigned int value);
-extern "C" unsigned int mcOptions_getSuppressNoReturn (void);
+extern "C" void mcOptions_setSuppressNoReturn (bool value);
+extern "C" bool mcOptions_getSuppressNoReturn (void);
+extern "C" bool mcOptions_useBool (void);
extern "C" DynamicStrings_String FormatStrings_Sprintf0 (DynamicStrings_String fmt);
extern "C" DynamicStrings_String FormatStrings_Sprintf1 (DynamicStrings_String fmt, const unsigned char *w_, unsigned int _w_high);
extern "C" DynamicStrings_String FormatStrings_Sprintf2 (DynamicStrings_String fmt, const unsigned char *w1_, unsigned int _w1_high, const unsigned char *w2_, unsigned int _w2_high);
extern "C" mcComment_commentDesc mcLexBuf_getProcedureComment (void);
extern "C" mcComment_commentDesc mcLexBuf_getBodyComment (void);
extern "C" mcComment_commentDesc mcLexBuf_getAfterComment (void);
-extern "C" unsigned int mcLexBuf_openSource (DynamicStrings_String s);
+extern "C" bool mcLexBuf_openSource (DynamicStrings_String s);
extern "C" void mcLexBuf_closeSource (void);
extern "C" void mcLexBuf_reInitialize (void);
extern "C" void mcLexBuf_resetForNewPass (void);
extern "C" void mcLexBuf_pushFile (void * filename);
extern "C" void mcLexBuf_popFile (void * filename);
extern "C" void StrLib_StrConCat (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high, char *c, unsigned int _c_high);
-extern "C" unsigned int StrLib_StrLess (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
-extern "C" unsigned int StrLib_StrEqual (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+extern "C" bool StrLib_StrLess (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+extern "C" bool StrLib_StrEqual (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
extern "C" unsigned int StrLib_StrLen (const char *a_, unsigned int _a_high);
extern "C" void StrLib_StrCopy (const char *src_, unsigned int _src_high, char *dest, unsigned int _dest_high);
-extern "C" unsigned int StrLib_IsSubString (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
+extern "C" bool StrLib_IsSubString (const char *a_, unsigned int _a_high, const char *b_, unsigned int _b_high);
extern "C" void StrLib_StrRemoveWhitePrefix (const char *a_, unsigned int _a_high, char *b, unsigned int _b_high);
/*
of the dynamic array.
*/
-extern "C" unsigned int Indexing_InBounds (Indexing_Index i, unsigned int n);
+extern "C" bool Indexing_InBounds (Indexing_Index i, unsigned int n);
/*
HighIndice - returns the last legally accessible indice of this array.
IsIndiceInIndex - returns TRUE if, a, is in the index, i.
*/
-extern "C" unsigned int Indexing_IsIndiceInIndex (Indexing_Index i, void * a);
+extern "C" bool Indexing_IsIndiceInIndex (Indexing_Index i, void * a);
/*
RemoveIndiceFromIndex - removes, a, from Index, i.
isItemInList - returns true if a ADDRESS, c, was found in alist, l.
*/
-extern "C" unsigned int alists_isItemInList (alists_alist l, void * c);
+extern "C" bool alists_isItemInList (alists_alist l, void * c);
/*
foreachItemInListDo - calls procedure, P, foreach item in alist, l.
isItemInList - returns true if a WORD, c, was found in wlist, l.
*/
-extern "C" unsigned int wlists_isItemInList (wlists_wlist l, unsigned int c);
+extern "C" bool wlists_isItemInList (wlists_wlist l, unsigned int c);
/*
foreachItemInListDo - calls procedure, P, foreach item in wlist, l.
extern "C" void keyc_genConfigSystem (mcPretty_pretty p);
extern "C" void keyc_enterScope (decl_node n);
extern "C" void keyc_leaveScope (decl_node n);
-extern "C" DynamicStrings_String keyc_cname (nameKey_Name n, unsigned int scopes);
-extern "C" nameKey_Name keyc_cnamen (nameKey_Name n, unsigned int scopes);
+extern "C" DynamicStrings_String keyc_cname (nameKey_Name n, bool scopes);
+extern "C" nameKey_Name keyc_cnamen (nameKey_Name n, bool scopes);
extern "C" void keyc_cp (void);
extern "C" FIO_File mcStream_openFrag (unsigned int id);
extern "C" void mcStream_setDest (FIO_File f);
extern "C" void NumberIO_StrToOctInt (const char *a_, unsigned int _a_high, int *x);
extern "C" void Debug_Halt (const char *Message_, unsigned int _Message_high, unsigned int LineNo, const char *Module_, unsigned int _Module_high);
extern "C" void Debug_DebugString (const char *a_, unsigned int _a_high);
-extern "C" void Assertion_Assert (unsigned int Condition);
+extern "C" void Assertion_Assert (bool Condition);
extern "C" void StdIO_Read (char *ch);
extern "C" void StdIO_Write (char ch);
extern "C" void StdIO_PushOutput (StdIO_ProcWrite p);
isLocal - returns TRUE if symbol, n, is locally declared in a procedure.
*/
-static unsigned int isLocal (decl_node n);
+static bool isLocal (decl_node n);
/*
importEnumFields - if, n, is an enumeration type import the all fields into module, m.
isComplex - returns TRUE if, n, is the complex type.
*/
-static unsigned int isComplex (decl_node n);
+static bool isComplex (decl_node n);
/*
isLongComplex - returns TRUE if, n, is the longcomplex type.
*/
-static unsigned int isLongComplex (decl_node n);
+static bool isLongComplex (decl_node n);
/*
isShortComplex - returns TRUE if, n, is the shortcomplex type.
*/
-static unsigned int isShortComplex (decl_node n);
+static bool isShortComplex (decl_node n);
/*
isAProcType - returns TRUE if, n, is a proctype or proc node.
*/
-static unsigned int isAProcType (decl_node n);
+static bool isAProcType (decl_node n);
/*
initFixupInfo - initialize the fixupInfo record.
isDefForC - returns TRUE if the definition module was defined FOR "C".
*/
-static unsigned int isDefForC (decl_node n);
+static bool isDefForC (decl_node n);
/*
initDecls - initialize the decls, scopeT.
putVarBool - assigns the four booleans associated with a variable.
*/
-static void putVarBool (decl_node v, unsigned int init, unsigned int param, unsigned int isvar, unsigned int isused);
+static void putVarBool (decl_node v, bool init, bool param, bool isvar, bool isused);
/*
checkPtr - in C++ we need to create a typedef for a pointer
isVarDecl - returns TRUE if, n, is a vardecl node.
*/
-static unsigned int isVarDecl (decl_node n);
+static bool isVarDecl (decl_node n);
/*
makeVariablesFromParameters - creates variables which are really parameters.
*/
-static void makeVariablesFromParameters (decl_node proc, decl_node id, decl_node type, unsigned int isvar, unsigned int isused);
+static void makeVariablesFromParameters (decl_node proc, decl_node id, decl_node type, bool isvar, bool isused);
/*
addProcedureToScope - add a procedure name n and node d to the
setwatch - assign the globalNode to n.
*/
-static unsigned int setwatch (decl_node n);
+static bool setwatch (decl_node n);
/*
runwatch - set the globalNode to an identlist.
*/
-static unsigned int runwatch (void);
+static bool runwatch (void);
/*
isIdentList - returns TRUE if, n, is an identlist.
*/
-static unsigned int isIdentList (decl_node n);
+static bool isIdentList (decl_node n);
/*
identListLen - returns the length of identlist.
checkParameters - placeholder for future parameter checking.
*/
-static void checkParameters (decl_node p, decl_node i, decl_node type, unsigned int isvar, unsigned int isused);
+static void checkParameters (decl_node p, decl_node i, decl_node type, bool isvar, bool isused);
/*
checkMakeVariables - create shadow local variables for parameters providing that
a module or an implementation module.
*/
-static void checkMakeVariables (decl_node n, decl_node i, decl_node type, unsigned int isvar, unsigned int isused);
+static void checkMakeVariables (decl_node n, decl_node i, decl_node type, bool isvar, bool isused);
/*
makeVarientField - create a varient field within varient, v,
isConstExp - return TRUE if the node kind is a constexp.
*/
-static unsigned int isConstExp (decl_node c);
+static bool isConstExp (decl_node c);
/*
addEnumToModule - adds enumeration type, e, into the list of enums
getConstExpComplete - gets the field from the def or imp or module, n.
*/
-static unsigned int getConstExpComplete (decl_node n);
+static bool getConstExpComplete (decl_node n);
/*
addConstToModule - adds const exp, e, into the list of constant
isAnyType - return TRUE if node n is any type kind.
*/
-static unsigned int isAnyType (decl_node n);
+static bool isAnyType (decl_node n);
/*
makeVal - creates a VAL (type, expression) node.
isFuncCall - returns TRUE if, n, is a function/procedure call.
*/
-static unsigned int isFuncCall (decl_node n);
+static bool isFuncCall (decl_node n);
/*
putTypeInternal - marks type, des, as being an internally generated type.
isTypeInternal - returns TRUE if type, n, is internal.
*/
-static unsigned int isTypeInternal (decl_node n);
+static bool isTypeInternal (decl_node n);
/*
lookupBase - return node named n from the base symbol scope.
isUnary - returns TRUE if, n, is an unary node.
*/
-static unsigned int isUnary (decl_node n);
+static bool isUnary (decl_node n);
/*
isBinary - returns TRUE if, n, is an binary node.
*/
-static unsigned int isBinary (decl_node n);
+static bool isBinary (decl_node n);
/*
makeUnary - create a unary expression node with, e, as the argument
isLeafString - returns TRUE if n is a leaf node which is a string constant.
*/
-static unsigned int isLeafString (decl_node n);
+static bool isLeafString (decl_node n);
/*
getLiteralStringContents - return the contents of a literal node as a string.
isComponentRef -
*/
-static unsigned int isComponentRef (decl_node n);
+static bool isComponentRef (decl_node n);
/*
isArrayRef - returns TRUE if the node was an arrayref.
*/
-static unsigned int isArrayRef (decl_node n);
+static bool isArrayRef (decl_node n);
/*
isDeref - returns TRUE if, n, is a deref node.
*/
-static unsigned int isDeref (decl_node n);
+static bool isDeref (decl_node n);
/*
makeBase - create a base type or constant.
isOrdinal - returns TRUE if, n, is an ordinal type.
*/
-static unsigned int isOrdinal (decl_node n);
+static bool isOrdinal (decl_node n);
/*
mixTypes -
isQualifiedForced - should the node be written with a module prefix?
*/
-static unsigned int isQualifiedForced (decl_node n);
+static bool isQualifiedForced (decl_node n);
/*
getFQstring -
getFQDstring -
*/
-static DynamicStrings_String getFQDstring (decl_node n, unsigned int scopes);
+static DynamicStrings_String getFQDstring (decl_node n, bool scopes);
/*
getString - returns the name as a string.
needsParen - returns TRUE if expression, n, needs to be enclosed in ().
*/
-static unsigned int needsParen (decl_node n);
+static bool needsParen (decl_node n);
/*
doUnary -
*/
-static void doUnary (mcPretty_pretty p, const char *op_, unsigned int _op_high, decl_node expr, decl_node type, unsigned int l, unsigned int r);
+static void doUnary (mcPretty_pretty p, const char *op_, unsigned int _op_high, decl_node expr, decl_node type, bool l, bool r);
/*
doSetSub - perform l & (~ r)
doPolyBinary -
*/
-static void doPolyBinary (mcPretty_pretty p, decl_nodeT op, decl_node left, decl_node right, unsigned int l, unsigned int r);
+static void doPolyBinary (mcPretty_pretty p, decl_nodeT op, decl_node left, decl_node right, bool l, bool r);
/*
doBinary -
*/
-static void doBinary (mcPretty_pretty p, const char *op_, unsigned int _op_high, decl_node left, decl_node right, unsigned int l, unsigned int r, unsigned int unpackProc);
+static void doBinary (mcPretty_pretty p, const char *op_, unsigned int _op_high, decl_node left, decl_node right, bool l, bool r, bool unpackProc);
/*
doPostUnary -
doPreBinary -
*/
-static void doPreBinary (mcPretty_pretty p, const char *op_, unsigned int _op_high, decl_node left, decl_node right, unsigned int l, unsigned int r);
+static void doPreBinary (mcPretty_pretty p, const char *op_, unsigned int _op_high, decl_node left, decl_node right, bool l, bool r);
/*
doConstExpr -
isZero - returns TRUE if node, n, is zero.
*/
-static unsigned int isZero (decl_node n);
+static bool isZero (decl_node n);
/*
doArrayRef -
doExprCup -
*/
-static void doExprCup (mcPretty_pretty p, decl_node n, unsigned int unpackProc);
+static void doExprCup (mcPretty_pretty p, decl_node n, bool unpackProc);
/*
doExprM2 -
isString - returns TRUE if node, n, is a string.
*/
-static unsigned int isString (decl_node n);
+static bool isString (decl_node n);
/*
doString -
outCstring -
*/
-static void outCstring (mcPretty_pretty p, decl_node s, unsigned int aString);
+static void outCstring (mcPretty_pretty p, decl_node s, bool aString);
/*
doStringC -
isPunct -
*/
-static unsigned int isPunct (char ch);
+static bool isPunct (char ch);
/*
isWhite -
*/
-static unsigned int isWhite (char ch);
+static bool isWhite (char ch);
/*
outText -
doCname -
*/
-static nameKey_Name doCname (nameKey_Name n, decl_cnameT *c, unsigned int scopes);
+static nameKey_Name doCname (nameKey_Name n, decl_cnameT *c, bool scopes);
/*
getDName -
*/
-static nameKey_Name getDName (decl_node n, unsigned int scopes);
+static nameKey_Name getDName (decl_node n, bool scopes);
/*
doDNameC -
*/
-static void doDNameC (mcPretty_pretty p, decl_node n, unsigned int scopes);
+static void doDNameC (mcPretty_pretty p, decl_node n, bool scopes);
/*
doFQDNameC -
*/
-static void doFQDNameC (mcPretty_pretty p, decl_node n, unsigned int scopes);
+static void doFQDNameC (mcPretty_pretty p, decl_node n, bool scopes);
/*
doFQNameC -
doUsed -
*/
-static void doUsed (mcPretty_pretty p, unsigned int used);
+static void doUsed (mcPretty_pretty p, bool used);
/*
doHighC -
*/
-static void doHighC (mcPretty_pretty p, decl_node a, nameKey_Name n, unsigned int isused);
+static void doHighC (mcPretty_pretty p, decl_node a, nameKey_Name n, bool isused);
/*
doParamConstCast -
isBase -
*/
-static unsigned int isBase (decl_node n);
+static bool isBase (decl_node n);
+
+/*
+ doBoolC -
+*/
+
+static void doBoolC (mcPretty_pretty p);
/*
doBaseC -
isSystem -
*/
-static unsigned int isSystem (decl_node n);
+static bool isSystem (decl_node n);
/*
doSystemC -
isBitset -
*/
-static unsigned int isBitset (decl_node n);
+static bool isBitset (decl_node n);
/*
isNegative - returns TRUE if expression, n, is negative.
*/
-static unsigned int isNegative (decl_node n);
+static bool isNegative (decl_node n);
/*
doSubrangeC -
isExternal - returns TRUE if symbol, n, was declared in another module.
*/
-static unsigned int isExternal (decl_node n);
+static bool isExternal (decl_node n);
/*
doVarC -
doProcedureHeadingC -
*/
-static void doProcedureHeadingC (decl_node n, unsigned int prototype);
+static void doProcedureHeadingC (decl_node n, bool prototype);
/*
checkDeclareUnboundedParamCopyC -
*/
-static unsigned int checkDeclareUnboundedParamCopyC (mcPretty_pretty p, decl_node n);
+static bool checkDeclareUnboundedParamCopyC (mcPretty_pretty p, decl_node n);
/*
checkUnboundedParamCopyC -
isStatementSequenceEmpty -
*/
-static unsigned int isStatementSequenceEmpty (decl_node s);
+static bool isStatementSequenceEmpty (decl_node s);
/*
isSingleStatement - returns TRUE if the statement sequence, s, has
only one statement.
*/
-static unsigned int isSingleStatement (decl_node s);
+static bool isSingleStatement (decl_node s);
/*
doCommentC -
isZtypeEquivalent -
*/
-static unsigned int isZtypeEquivalent (decl_node type);
+static bool isZtypeEquivalent (decl_node type);
/*
isEquivalentType - returns TRUE if type1 and type2 are equivalent.
*/
-static unsigned int isEquivalentType (decl_node type1, decl_node type2);
+static bool isEquivalentType (decl_node type1, decl_node type2);
/*
doExprCastC - build a cast if necessary.
requiresUnpackProc - returns TRUE if either the expr is a procedure or the proctypes differ.
*/
-static unsigned int requiresUnpackProc (decl_node s);
+static bool requiresUnpackProc (decl_node s);
/*
doAssignmentC -
containsStatement -
*/
-static unsigned int containsStatement (decl_node s);
+static bool containsStatement (decl_node s);
/*
doCompoundStmt -
noIfElse -
*/
-static unsigned int noIfElse (decl_node n);
+static bool noIfElse (decl_node n);
/*
noIfElseChained - returns TRUE if, n, is an IF statement which
in a return value of TRUE.
*/
-static unsigned int noIfElseChained (decl_node n);
+static bool noIfElseChained (decl_node n);
/*
hasIfElse -
*/
-static unsigned int hasIfElse (decl_node n);
+static bool hasIfElse (decl_node n);
/*
isIfElse -
*/
-static unsigned int isIfElse (decl_node n);
+static bool isIfElse (decl_node n);
/*
hasIfAndNoElse - returns TRUE if statement, n, is a single statement
which is an IF and it has no else statement.
*/
-static unsigned int hasIfAndNoElse (decl_node n);
+static bool hasIfAndNoElse (decl_node n);
/*
doIfC - issue an if statement and also place in an after comment if one exists.
typePair -
*/
-static unsigned int typePair (decl_node a, decl_node b, decl_node x, decl_node y);
+static bool typePair (decl_node a, decl_node b, decl_node x, decl_node y);
/*
needsCast - return TRUE if the actual type parameter needs to be cast to
the formal type.
*/
-static unsigned int needsCast (decl_node at, decl_node ft);
+static bool needsCast (decl_node at, decl_node ft);
/*
checkSystemCast - checks to see if we are passing to/from
which was declared inside a definition module for "C".
*/
-static unsigned int isForC (decl_node n);
+static bool isForC (decl_node n);
/*
isDefForCNode - return TRUE if node n was declared inside a definition module for "C".
*/
-static unsigned int isDefForCNode (decl_node n);
+static bool isDefForCNode (decl_node n);
/*
doFuncParamC -
doFuncArgsC -
*/
-static void doFuncArgsC (mcPretty_pretty p, decl_node s, Indexing_Index l, unsigned int needParen);
+static void doFuncArgsC (mcPretty_pretty p, decl_node s, Indexing_Index l, bool needParen);
/*
doProcTypeArgsC -
*/
-static void doProcTypeArgsC (mcPretty_pretty p, decl_node s, Indexing_Index args, unsigned int needParen);
+static void doProcTypeArgsC (mcPretty_pretty p, decl_node s, Indexing_Index args, bool needParen);
/*
doAdrArgC -
The intrinsic functions are represented as unary and binary nodes.
*/
-static unsigned int isIntrinsic (decl_node n);
+static bool isIntrinsic (decl_node n);
/*
doHalt -
isIntrinsicFunction - returns true if, n, is an instrinsic function.
*/
-static unsigned int isIntrinsicFunction (decl_node n);
+static bool isIntrinsicFunction (decl_node n);
/*
doSizeC -
doCaseStatementC -
*/
-static void doCaseStatementC (mcPretty_pretty p, decl_node n, unsigned int needBreak);
+static void doCaseStatementC (mcPretty_pretty p, decl_node n, bool needBreak);
/*
doExceptionC -
doCaseLabels -
*/
-static void doCaseLabels (mcPretty_pretty p, decl_node n, unsigned int needBreak);
+static void doCaseLabels (mcPretty_pretty p, decl_node n, bool needBreak);
/*
doCaseLabelListC -
*/
-static void doCaseLabelListC (mcPretty_pretty p, decl_node n, unsigned int haveElse);
+static void doCaseLabelListC (mcPretty_pretty p, decl_node n, bool haveElse);
/*
doCaseIfLabels -
single values and not ranges.
*/
-static unsigned int canUseSwitchCaseLabels (decl_node n);
+static bool canUseSwitchCaseLabels (decl_node n);
/*
canUseSwitch - returns TRUE if the case statement can be implement
selectors are single values rather than ranges.
*/
-static unsigned int canUseSwitch (decl_node n);
+static bool canUseSwitch (decl_node n);
/*
doCaseC -
isHalt -
*/
-static unsigned int isHalt (decl_node n);
+static bool isHalt (decl_node n);
/*
isReturnOrHalt -
*/
-static unsigned int isReturnOrHalt (decl_node n);
+static bool isReturnOrHalt (decl_node n);
/*
isLastStatementReturn -
*/
-static unsigned int isLastStatementReturn (decl_node n);
+static bool isLastStatementReturn (decl_node n);
/*
isLastStatementSequence -
*/
-static unsigned int isLastStatementSequence (decl_node n, decl_isNodeF q);
+static bool isLastStatementSequence (decl_node n, decl_isNodeF q);
/*
isLastStatementIf -
*/
-static unsigned int isLastStatementIf (decl_node n, decl_isNodeF q);
+static bool isLastStatementIf (decl_node n, decl_isNodeF q);
/*
isLastStatementElsif -
*/
-static unsigned int isLastStatementElsif (decl_node n, decl_isNodeF q);
+static bool isLastStatementElsif (decl_node n, decl_isNodeF q);
/*
isLastStatementCase -
*/
-static unsigned int isLastStatementCase (decl_node n, decl_isNodeF q);
+static bool isLastStatementCase (decl_node n, decl_isNodeF q);
/*
isLastStatement - returns TRUE if the last statement in, n, is, q.
*/
-static unsigned int isLastStatement (decl_node n, decl_isNodeF q);
+static bool isLastStatement (decl_node n, decl_isNodeF q);
/*
doProcedureC -
tryComplete - returns TRUE if node, n, can be and was completed.
*/
-static unsigned int tryComplete (decl_node n, decl_nodeProcedure c, decl_nodeProcedure t, decl_nodeProcedure v);
+static bool tryComplete (decl_node n, decl_nodeProcedure c, decl_nodeProcedure t, decl_nodeProcedure v);
/*
tryCompleteFromPartial -
*/
-static unsigned int tryCompleteFromPartial (decl_node n, decl_nodeProcedure t);
+static bool tryCompleteFromPartial (decl_node n, decl_nodeProcedure t);
/*
visitIntrinsicFunction -
tryPartial -
*/
-static unsigned int tryPartial (decl_node n, decl_nodeProcedure pt);
+static bool tryPartial (decl_node n, decl_nodeProcedure pt);
/*
outputPartialRecordArrayProcType -
isAssignment -
*/
-static unsigned int isAssignment (decl_node n);
+static bool isAssignment (decl_node n);
/*
isComment - returns TRUE if node, n, is a comment.
*/
-static unsigned int isComment (decl_node n);
+static bool isComment (decl_node n);
/*
initPair - initialise the commentPair, c.
isLocal - returns TRUE if symbol, n, is locally declared in a procedure.
*/
-static unsigned int isLocal (decl_node n)
+static bool isLocal (decl_node n)
{
decl_node s;
{
return decl_isProcedure (s);
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
isComplex - returns TRUE if, n, is the complex type.
*/
-static unsigned int isComplex (decl_node n)
+static bool isComplex (decl_node n)
{
return n == complexN;
/* static analysis guarentees a RETURN statement will be used before here. */
isLongComplex - returns TRUE if, n, is the longcomplex type.
*/
-static unsigned int isLongComplex (decl_node n)
+static bool isLongComplex (decl_node n)
{
return n == longcomplexN;
/* static analysis guarentees a RETURN statement will be used before here. */
isShortComplex - returns TRUE if, n, is the shortcomplex type.
*/
-static unsigned int isShortComplex (decl_node n)
+static bool isShortComplex (decl_node n)
{
return n == shortcomplexN;
/* static analysis guarentees a RETURN statement will be used before here. */
isAProcType - returns TRUE if, n, is a proctype or proc node.
*/
-static unsigned int isAProcType (decl_node n)
+static bool isAProcType (decl_node n)
{
mcDebug_assert (n != NULL);
return (decl_isProcType (n)) || (n == procN);
d = newNode (decl_def);
d->defF.name = n;
d->defF.source = nameKey_NulName;
- d->defF.hasHidden = FALSE;
- d->defF.forC = FALSE;
+ d->defF.hasHidden = false;
+ d->defF.forC = false;
d->defF.exported = Indexing_InitIndex (1);
d->defF.importedModules = Indexing_InitIndex (1);
d->defF.constFixup = initFixupInfo ();
d->defF.enumFixup = initFixupInfo ();
initDecls (&d->defF.decls);
- d->defF.enumsComplete = FALSE;
- d->defF.constsComplete = FALSE;
- d->defF.visited = FALSE;
+ d->defF.enumsComplete = false;
+ d->defF.constsComplete = false;
+ d->defF.visited = false;
initPair (&d->defF.com);
return d;
/* static analysis guarentees a RETURN statement will be used before here. */
d->impF.beginStatements = NULL;
d->impF.finallyStatements = NULL;
d->impF.definitionModule = NULL;
- d->impF.enumsComplete = FALSE;
- d->impF.constsComplete = FALSE;
- d->impF.visited = FALSE;
+ d->impF.enumsComplete = false;
+ d->impF.constsComplete = false;
+ d->impF.visited = false;
initPair (&d->impF.com);
return d;
/* static analysis guarentees a RETURN statement will be used before here. */
initDecls (&d->moduleF.decls);
d->moduleF.beginStatements = NULL;
d->moduleF.finallyStatements = NULL;
- d->moduleF.enumsComplete = FALSE;
- d->moduleF.constsComplete = FALSE;
- d->moduleF.visited = FALSE;
+ d->moduleF.enumsComplete = false;
+ d->moduleF.constsComplete = false;
+ d->moduleF.visited = false;
initPair (&d->moduleF.com);
return d;
/* static analysis guarentees a RETURN statement will be used before here. */
isDefForC - returns TRUE if the definition module was defined FOR "C".
*/
-static unsigned int isDefForC (decl_node n)
+static bool isDefForC (decl_node n)
{
return (decl_isDef (n)) && n->defF.forC;
/* static analysis guarentees a RETURN statement will be used before here. */
mcDebug_assert (((decl_isDef (n)) || (decl_isImp (n))) || (decl_isModule (n)));
if (decl_isDef (n))
{
- n->defF.enumsComplete = TRUE;
+ n->defF.enumsComplete = true;
}
else if (decl_isImp (n))
{
/* avoid dangling else. */
- n->impF.enumsComplete = TRUE;
+ n->impF.enumsComplete = true;
}
else if (decl_isModule (n))
{
/* avoid dangling else. */
- n->moduleF.enumsComplete = TRUE;
+ n->moduleF.enumsComplete = true;
}
}
putVarBool - assigns the four booleans associated with a variable.
*/
-static void putVarBool (decl_node v, unsigned int init, unsigned int param, unsigned int isvar, unsigned int isused)
+static void putVarBool (decl_node v, bool init, bool param, bool isvar, bool isused)
{
mcDebug_assert (decl_isVar (v));
v->varF.isInitialised = init;
isVarDecl - returns TRUE if, n, is a vardecl node.
*/
-static unsigned int isVarDecl (decl_node n)
+static bool isVarDecl (decl_node n)
{
return n->kind == decl_vardecl;
/* static analysis guarentees a RETURN statement will be used before here. */
makeVariablesFromParameters - creates variables which are really parameters.
*/
-static void makeVariablesFromParameters (decl_node proc, decl_node id, decl_node type, unsigned int isvar, unsigned int isused)
+static void makeVariablesFromParameters (decl_node proc, decl_node id, decl_node type, bool isvar, bool isused)
{
decl_node v;
unsigned int i;
m = static_cast<nameKey_Name> (wlists_getItemFromList (id->identlistF.names, i));
v = decl_makeVar (m);
decl_putVar (v, type, NULL);
- putVarBool (v, TRUE, TRUE, isvar, isused);
+ putVarBool (v, true, true, isvar, isused);
if (debugScopes)
{
libc_printf ((const char *) "adding parameter variable into top scope\\n", 42);
static void putProcTypeOptReturn (decl_node proc)
{
mcDebug_assert (decl_isProcType (proc));
- proc->proctypeF.returnopt = TRUE;
+ proc->proctypeF.returnopt = true;
}
setwatch - assign the globalNode to n.
*/
-static unsigned int setwatch (decl_node n)
+static bool setwatch (decl_node n)
{
globalNode = n;
- return TRUE;
+ return true;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
runwatch - set the globalNode to an identlist.
*/
-static unsigned int runwatch (void)
+static bool runwatch (void)
{
return globalNode->kind == decl_identlist;
/* static analysis guarentees a RETURN statement will be used before here. */
isIdentList - returns TRUE if, n, is an identlist.
*/
-static unsigned int isIdentList (decl_node n)
+static bool isIdentList (decl_node n)
{
return n->kind == decl_identlist;
/* static analysis guarentees a RETURN statement will be used before here. */
checkParameters - placeholder for future parameter checking.
*/
-static void checkParameters (decl_node p, decl_node i, decl_node type, unsigned int isvar, unsigned int isused)
+static void checkParameters (decl_node p, decl_node i, decl_node type, bool isvar, bool isused)
{
/* do check. */
disposeNode (&i);
a module or an implementation module.
*/
-static void checkMakeVariables (decl_node n, decl_node i, decl_node type, unsigned int isvar, unsigned int isused)
+static void checkMakeVariables (decl_node n, decl_node i, decl_node type, bool isvar, bool isused)
{
if (((decl_isImp (currentModule)) || (decl_isModule (currentModule))) && ! n->procedureF.built)
{
n->varientfieldF.name = nameKey_NulName;
n->varientfieldF.parent = p;
n->varientfieldF.varient = v;
- n->varientfieldF.simple = FALSE;
+ n->varientfieldF.simple = false;
n->varientfieldF.listOfSons = Indexing_InitIndex (1);
n->varientfieldF.scope = decl_getDeclScope ();
return n;
n->recordfieldF.name = tag;
n->recordfieldF.parent = r;
n->recordfieldF.varient = v;
- n->recordfieldF.tag = FALSE;
+ n->recordfieldF.tag = false;
n->recordfieldF.scope = NULL;
initCname (&n->recordfieldF.cname);
/*
isConstExp - return TRUE if the node kind is a constexp.
*/
-static unsigned int isConstExp (decl_node c)
+static bool isConstExp (decl_node c)
{
mcDebug_assert (c != NULL);
return c->kind == decl_constexp;
getConstExpComplete - gets the field from the def or imp or module, n.
*/
-static unsigned int getConstExpComplete (decl_node n)
+static bool getConstExpComplete (decl_node n)
{
switch (n->kind)
{
isAnyType - return TRUE if node n is any type kind.
*/
-static unsigned int isAnyType (decl_node n)
+static bool isAnyType (decl_node n)
{
mcDebug_assert (n != NULL);
switch (n->kind)
case decl_boolean:
case decl_proc:
case decl_type:
- return TRUE;
+ return true;
break;
default:
- return FALSE;
+ return false;
break;
}
/* static analysis guarentees a RETURN statement will be used before here. */
isFuncCall - returns TRUE if, n, is a function/procedure call.
*/
-static unsigned int isFuncCall (decl_node n)
+static bool isFuncCall (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_funccall;
{
mcDebug_assert (des != NULL);
mcDebug_assert (decl_isType (des));
- des->typeF.isInternal = TRUE;
+ des->typeF.isInternal = true;
}
isTypeInternal - returns TRUE if type, n, is internal.
*/
-static unsigned int isTypeInternal (decl_node n)
+static bool isTypeInternal (decl_node n)
{
mcDebug_assert (n != NULL);
mcDebug_assert (decl_isType (n));
isUnary - returns TRUE if, n, is an unary node.
*/
-static unsigned int isUnary (decl_node n)
+static bool isUnary (decl_node n)
{
mcDebug_assert (n != NULL);
switch (n->kind)
case decl_tsize:
case decl_min:
case decl_max:
- return TRUE;
+ return true;
break;
default:
- return FALSE;
+ return false;
break;
}
/* static analysis guarentees a RETURN statement will be used before here. */
isBinary - returns TRUE if, n, is an binary node.
*/
-static unsigned int isBinary (decl_node n)
+static bool isBinary (decl_node n)
{
mcDebug_assert (n != NULL);
switch (n->kind)
case decl_mult:
case decl_divide:
case decl_in:
- return TRUE;
+ return true;
break;
default:
- return FALSE;
+ return false;
break;
}
/* static analysis guarentees a RETURN statement will be used before here. */
isLeafString - returns TRUE if n is a leaf node which is a string constant.
*/
-static unsigned int isLeafString (decl_node n)
+static bool isLeafString (decl_node n)
{
return ((isString (n)) || ((decl_isLiteral (n)) && ((decl_getType (n)) == charN))) || ((decl_isConst (n)) && ((getExprType (n)) == charN));
/* static analysis guarentees a RETURN statement will be used before here. */
isComponentRef -
*/
-static unsigned int isComponentRef (decl_node n)
+static bool isComponentRef (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_componentref;
isArrayRef - returns TRUE if the node was an arrayref.
*/
-static unsigned int isArrayRef (decl_node n)
+static bool isArrayRef (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_arrayref;
isDeref - returns TRUE if, n, is a deref node.
*/
-static unsigned int isDeref (decl_node n)
+static bool isDeref (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_deref;
isOrdinal - returns TRUE if, n, is an ordinal type.
*/
-static unsigned int isOrdinal (decl_node n)
+static bool isOrdinal (decl_node n)
{
switch (n->kind)
{
case decl_longcard:
case decl_shortcard:
case decl_bitset:
- return TRUE;
+ return true;
break;
default:
- return FALSE;
+ return false;
break;
}
/* static analysis guarentees a RETURN statement will be used before here. */
isQualifiedForced - should the node be written with a module prefix?
*/
-static unsigned int isQualifiedForced (decl_node n)
+static bool isQualifiedForced (decl_node n)
{
return forceQualified && (((((decl_isType (n)) || (decl_isRecord (n))) || (decl_isArray (n))) || (decl_isEnumeration (n))) || (decl_isEnumerationField (n)));
/* static analysis guarentees a RETURN statement will be used before here. */
getFQDstring -
*/
-static DynamicStrings_String getFQDstring (decl_node n, unsigned int scopes)
+static DynamicStrings_String getFQDstring (decl_node n, bool scopes)
{
DynamicStrings_String i;
DynamicStrings_String s;
needsParen - returns TRUE if expression, n, needs to be enclosed in ().
*/
-static unsigned int needsParen (decl_node n)
+static bool needsParen (decl_node n)
{
mcDebug_assert (n != NULL);
switch (n->kind)
case decl_nil:
case decl_true:
case decl_false:
- return FALSE;
+ return false;
break;
case decl_constexp:
case decl_chr:
case decl_cap:
case decl_high:
- return FALSE;
+ return false;
break;
case decl_deref:
- return FALSE;
+ return false;
break;
case decl_equal:
case decl_greater:
case decl_greequal:
case decl_lessequal:
- return TRUE;
+ return true;
break;
case decl_componentref:
- return FALSE;
+ return false;
break;
case decl_pointerref:
- return FALSE;
+ return false;
break;
case decl_cast:
- return TRUE;
+ return true;
break;
case decl_val:
- return TRUE;
+ return true;
break;
case decl_abs:
- return FALSE;
+ return false;
break;
case decl_plus:
case decl_mult:
case decl_divide:
case decl_in:
- return TRUE;
+ return true;
break;
case decl_literal:
case decl_const:
case decl_enumerationfield:
case decl_string:
- return FALSE;
+ return false;
break;
case decl_max:
- return TRUE;
+ return true;
break;
case decl_min:
- return TRUE;
+ return true;
break;
case decl_var:
- return FALSE;
+ return false;
break;
case decl_arrayref:
- return FALSE;
+ return false;
break;
case decl_and:
case decl_or:
- return TRUE;
+ return true;
break;
case decl_funccall:
- return TRUE;
+ return true;
break;
case decl_recordfield:
- return FALSE;
+ return false;
break;
case decl_loc:
case decl_bitset:
case decl_boolean:
case decl_proc:
- return FALSE;
+ return false;
break;
case decl_setvalue:
- return FALSE;
+ return false;
break;
case decl_address:
- return TRUE;
+ return true;
break;
case decl_procedure:
- return FALSE;
+ return false;
break;
case decl_length:
case decl_cmplx:
case decl_re:
case decl_im:
- return TRUE;
+ return true;
break;
CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1);
__builtin_unreachable ();
}
- return TRUE;
+ return true;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
doUnary -
*/
-static void doUnary (mcPretty_pretty p, const char *op_, unsigned int _op_high, decl_node expr, decl_node type, unsigned int l, unsigned int r)
+static void doUnary (mcPretty_pretty p, const char *op_, unsigned int _op_high, decl_node expr, decl_node type, bool l, bool r)
{
char op[_op_high+1];
doPolyBinary -
*/
-static void doPolyBinary (mcPretty_pretty p, decl_nodeT op, decl_node left, decl_node right, unsigned int l, unsigned int r)
+static void doPolyBinary (mcPretty_pretty p, decl_nodeT op, decl_node left, decl_node right, bool l, bool r)
{
decl_node lt;
decl_node rt;
switch (op)
{
case decl_plus:
- doBinary (p, (const char *) "|", 1, left, right, l, r, FALSE);
+ doBinary (p, (const char *) "|", 1, left, right, l, r, false);
break;
case decl_sub:
break;
case decl_mult:
- doBinary (p, (const char *) "&", 1, left, right, l, r, FALSE);
+ doBinary (p, (const char *) "&", 1, left, right, l, r, false);
break;
case decl_divide:
- doBinary (p, (const char *) "^", 1, left, right, l, r, FALSE);
+ doBinary (p, (const char *) "^", 1, left, right, l, r, false);
break;
switch (op)
{
case decl_plus:
- doBinary (p, (const char *) "+", 1, left, right, l, r, FALSE);
+ doBinary (p, (const char *) "+", 1, left, right, l, r, false);
break;
case decl_sub:
- doBinary (p, (const char *) "-", 1, left, right, l, r, FALSE);
+ doBinary (p, (const char *) "-", 1, left, right, l, r, false);
break;
case decl_mult:
- doBinary (p, (const char *) "*", 1, left, right, l, r, FALSE);
+ doBinary (p, (const char *) "*", 1, left, right, l, r, false);
break;
case decl_divide:
- doBinary (p, (const char *) "/", 1, left, right, l, r, FALSE);
+ doBinary (p, (const char *) "/", 1, left, right, l, r, false);
break;
doBinary -
*/
-static void doBinary (mcPretty_pretty p, const char *op_, unsigned int _op_high, decl_node left, decl_node right, unsigned int l, unsigned int r, unsigned int unpackProc)
+static void doBinary (mcPretty_pretty p, const char *op_, unsigned int _op_high, decl_node left, decl_node right, bool l, bool r, bool unpackProc)
{
char op[_op_high+1];
doPreBinary -
*/
-static void doPreBinary (mcPretty_pretty p, const char *op_, unsigned int _op_high, decl_node left, decl_node right, unsigned int l, unsigned int r)
+static void doPreBinary (mcPretty_pretty p, const char *op_, unsigned int _op_high, decl_node left, decl_node right, bool l, bool r)
{
char op[_op_high+1];
static void doEnumerationField (mcPretty_pretty p, decl_node n)
{
- doFQDNameC (p, n, FALSE);
+ doFQDNameC (p, n, false);
}
isZero - returns TRUE if node, n, is zero.
*/
-static unsigned int isZero (decl_node n)
+static bool isZero (decl_node n)
{
if (isConstExp (n))
{
static void doProcedure (mcPretty_pretty p, decl_node n)
{
mcDebug_assert (decl_isProcedure (n));
- doFQDNameC (p, n, TRUE);
+ doFQDNameC (p, n, true);
}
static void doRecordfield (mcPretty_pretty p, decl_node n)
{
- doDNameC (p, n, FALSE);
+ doDNameC (p, n, false);
}
static void outTrue (mcPretty_pretty p)
{
keyc_useTrue ();
- outText (p, (const char *) "TRUE", 4);
+ if ((mcOptions_useBool ()) && (lang == decl_ansiCP))
+ {
+ outText (p, (const char *) "true", 4);
+ }
+ else
+ {
+ outText (p, (const char *) "TRUE", 4);
+ }
}
static void outFalse (mcPretty_pretty p)
{
keyc_useFalse ();
- outText (p, (const char *) "FALSE", 5);
+ if ((mcOptions_useBool ()) && (lang == decl_ansiCP))
+ {
+ outText (p, (const char *) "false", 5);
+ }
+ else
+ {
+ outText (p, (const char *) "FALSE", 5);
+ }
}
break;
case decl_constexp:
- doUnary (p, (const char *) "", 0, n->unaryF.arg, n->unaryF.resultType, FALSE, FALSE);
+ doUnary (p, (const char *) "", 0, n->unaryF.arg, n->unaryF.resultType, false, false);
break;
case decl_neg:
- doUnary (p, (const char *) "-", 1, n->unaryF.arg, n->unaryF.resultType, FALSE, FALSE);
+ doUnary (p, (const char *) "-", 1, n->unaryF.arg, n->unaryF.resultType, false, false);
break;
case decl_not:
- doUnary (p, (const char *) "!", 1, n->unaryF.arg, n->unaryF.resultType, FALSE, TRUE);
+ doUnary (p, (const char *) "!", 1, n->unaryF.arg, n->unaryF.resultType, false, true);
break;
case decl_val:
break;
case decl_equal:
- doBinary (p, (const char *) "==", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, TRUE);
+ doBinary (p, (const char *) "==", 2, n->binaryF.left, n->binaryF.right, true, true, true);
break;
case decl_notequal:
- doBinary (p, (const char *) "!=", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, TRUE);
+ doBinary (p, (const char *) "!=", 2, n->binaryF.left, n->binaryF.right, true, true, true);
break;
case decl_less:
- doBinary (p, (const char *) "<", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) "<", 1, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_greater:
- doBinary (p, (const char *) ">", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) ">", 1, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_greequal:
- doBinary (p, (const char *) ">=", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) ">=", 2, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_lessequal:
- doBinary (p, (const char *) "<=", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) "<=", 2, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_componentref:
break;
case decl_plus:
- doPolyBinary (p, decl_plus, n->binaryF.left, n->binaryF.right, FALSE, FALSE);
+ doPolyBinary (p, decl_plus, n->binaryF.left, n->binaryF.right, false, false);
break;
case decl_sub:
- doPolyBinary (p, decl_sub, n->binaryF.left, n->binaryF.right, FALSE, FALSE);
+ doPolyBinary (p, decl_sub, n->binaryF.left, n->binaryF.right, false, false);
break;
case decl_div:
- doBinary (p, (const char *) "/", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) "/", 1, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_mod:
- doBinary (p, (const char *) "%", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) "%", 1, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_mult:
- doPolyBinary (p, decl_mult, n->binaryF.left, n->binaryF.right, FALSE, FALSE);
+ doPolyBinary (p, decl_mult, n->binaryF.left, n->binaryF.right, false, false);
break;
case decl_divide:
- doPolyBinary (p, decl_divide, n->binaryF.left, n->binaryF.right, FALSE, FALSE);
+ doPolyBinary (p, decl_divide, n->binaryF.left, n->binaryF.right, false, false);
break;
case decl_in:
break;
case decl_and:
- doBinary (p, (const char *) "&&", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) "&&", 2, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_or:
- doBinary (p, (const char *) "||", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) "||", 2, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_literal:
doExprCup -
*/
-static void doExprCup (mcPretty_pretty p, decl_node n, unsigned int unpackProc)
+static void doExprCup (mcPretty_pretty p, decl_node n, bool unpackProc)
{
decl_node t;
break;
case decl_constexp:
- doUnary (p, (const char *) "", 0, n->unaryF.arg, n->unaryF.resultType, FALSE, FALSE);
+ doUnary (p, (const char *) "", 0, n->unaryF.arg, n->unaryF.resultType, false, false);
break;
case decl_neg:
- doUnary (p, (const char *) "-", 1, n->unaryF.arg, n->unaryF.resultType, FALSE, FALSE);
+ doUnary (p, (const char *) "-", 1, n->unaryF.arg, n->unaryF.resultType, false, false);
break;
case decl_not:
- doUnary (p, (const char *) "NOT", 3, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE);
+ doUnary (p, (const char *) "NOT", 3, n->unaryF.arg, n->unaryF.resultType, true, true);
break;
case decl_adr:
- doUnary (p, (const char *) "ADR", 3, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE);
+ doUnary (p, (const char *) "ADR", 3, n->unaryF.arg, n->unaryF.resultType, true, true);
break;
case decl_size:
- doUnary (p, (const char *) "SIZE", 4, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE);
+ doUnary (p, (const char *) "SIZE", 4, n->unaryF.arg, n->unaryF.resultType, true, true);
break;
case decl_tsize:
- doUnary (p, (const char *) "TSIZE", 5, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE);
+ doUnary (p, (const char *) "TSIZE", 5, n->unaryF.arg, n->unaryF.resultType, true, true);
break;
case decl_float:
- doUnary (p, (const char *) "FLOAT", 5, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE);
+ doUnary (p, (const char *) "FLOAT", 5, n->unaryF.arg, n->unaryF.resultType, true, true);
break;
case decl_trunc:
- doUnary (p, (const char *) "TRUNC", 5, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE);
+ doUnary (p, (const char *) "TRUNC", 5, n->unaryF.arg, n->unaryF.resultType, true, true);
break;
case decl_ord:
- doUnary (p, (const char *) "ORD", 3, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE);
+ doUnary (p, (const char *) "ORD", 3, n->unaryF.arg, n->unaryF.resultType, true, true);
break;
case decl_chr:
- doUnary (p, (const char *) "CHR", 3, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE);
+ doUnary (p, (const char *) "CHR", 3, n->unaryF.arg, n->unaryF.resultType, true, true);
break;
case decl_cap:
- doUnary (p, (const char *) "CAP", 3, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE);
+ doUnary (p, (const char *) "CAP", 3, n->unaryF.arg, n->unaryF.resultType, true, true);
break;
case decl_high:
- doUnary (p, (const char *) "HIGH", 4, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE);
+ doUnary (p, (const char *) "HIGH", 4, n->unaryF.arg, n->unaryF.resultType, true, true);
break;
case decl_re:
- doUnary (p, (const char *) "RE", 2, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE);
+ doUnary (p, (const char *) "RE", 2, n->unaryF.arg, n->unaryF.resultType, true, true);
break;
case decl_im:
- doUnary (p, (const char *) "IM", 2, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE);
+ doUnary (p, (const char *) "IM", 2, n->unaryF.arg, n->unaryF.resultType, true, true);
break;
case decl_deref:
break;
case decl_equal:
- doBinary (p, (const char *) "=", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) "=", 1, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_notequal:
- doBinary (p, (const char *) "#", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) "#", 1, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_less:
- doBinary (p, (const char *) "<", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) "<", 1, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_greater:
- doBinary (p, (const char *) ">", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) ">", 1, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_greequal:
- doBinary (p, (const char *) ">=", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) ">=", 2, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_lessequal:
- doBinary (p, (const char *) "<=", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) "<=", 2, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_componentref:
- doBinary (p, (const char *) ".", 1, n->componentrefF.rec, n->componentrefF.field, FALSE, FALSE, FALSE);
+ doBinary (p, (const char *) ".", 1, n->componentrefF.rec, n->componentrefF.field, false, false, false);
break;
case decl_pointerref:
- doBinary (p, (const char *) "^.", 2, n->pointerrefF.ptr, n->pointerrefF.field, FALSE, FALSE, FALSE);
+ doBinary (p, (const char *) "^.", 2, n->pointerrefF.ptr, n->pointerrefF.field, false, false, false);
break;
case decl_cast:
- doPreBinary (p, (const char *) "CAST", 4, n->binaryF.left, n->binaryF.right, TRUE, TRUE);
+ doPreBinary (p, (const char *) "CAST", 4, n->binaryF.left, n->binaryF.right, true, true);
break;
case decl_val:
- doPreBinary (p, (const char *) "VAL", 3, n->binaryF.left, n->binaryF.right, TRUE, TRUE);
+ doPreBinary (p, (const char *) "VAL", 3, n->binaryF.left, n->binaryF.right, true, true);
break;
case decl_cmplx:
- doPreBinary (p, (const char *) "CMPLX", 5, n->binaryF.left, n->binaryF.right, TRUE, TRUE);
+ doPreBinary (p, (const char *) "CMPLX", 5, n->binaryF.left, n->binaryF.right, true, true);
break;
case decl_plus:
- doBinary (p, (const char *) "+", 1, n->binaryF.left, n->binaryF.right, FALSE, FALSE, FALSE);
+ doBinary (p, (const char *) "+", 1, n->binaryF.left, n->binaryF.right, false, false, false);
break;
case decl_sub:
- doBinary (p, (const char *) "-", 1, n->binaryF.left, n->binaryF.right, FALSE, FALSE, FALSE);
+ doBinary (p, (const char *) "-", 1, n->binaryF.left, n->binaryF.right, false, false, false);
break;
case decl_div:
- doBinary (p, (const char *) "DIV", 3, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) "DIV", 3, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_mod:
- doBinary (p, (const char *) "MOD", 3, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE);
+ doBinary (p, (const char *) "MOD", 3, n->binaryF.left, n->binaryF.right, true, true, false);
break;
case decl_mult:
- doBinary (p, (const char *) "*", 1, n->binaryF.left, n->binaryF.right, FALSE, FALSE, FALSE);
+ doBinary (p, (const char *) "*", 1, n->binaryF.left, n->binaryF.right, false, false, false);
break;
case decl_divide:
- doBinary (p, (const char *) "/", 1, n->binaryF.left, n->binaryF.right, FALSE, FALSE, FALSE);
+ doBinary (p, (const char *) "/", 1, n->binaryF.left, n->binaryF.right, false, false, false);
break;
case decl_literal:
break;
case decl_max:
- doUnary (p, (const char *) "MAX", 3, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE);
+ doUnary (p, (const char *) "MAX", 3, n->unaryF.arg, n->unaryF.resultType, true, true);
break;
case decl_min:
- doUnary (p, (const char *) "MIN", 3, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE);
+ doUnary (p, (const char *) "MIN", 3, n->unaryF.arg, n->unaryF.resultType, true, true);
break;
case decl_var:
if (n->varF.isVarParameter)
{
outText (p, (const char *) "(*", 2);
- doFQDNameC (p, n, TRUE);
+ doFQDNameC (p, n, true);
outText (p, (const char *) ")", 1);
}
else
{
- doFQDNameC (p, n, TRUE);
+ doFQDNameC (p, n, true);
}
}
isString - returns TRUE if node, n, is a string.
*/
-static unsigned int isString (decl_node n)
+static bool isString (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_string;
outCstring -
*/
-static void outCstring (mcPretty_pretty p, decl_node s, unsigned int aString)
+static void outCstring (mcPretty_pretty p, decl_node s, bool aString)
{
if (aString)
{
isPunct -
*/
-static unsigned int isPunct (char ch)
+static bool isPunct (char ch)
{
return (((((((((ch == '.') || (ch == '(')) || (ch == ')')) || (ch == '^')) || (ch == ':')) || (ch == ';')) || (ch == '{')) || (ch == '}')) || (ch == ',')) || (ch == '*');
/* static analysis guarentees a RETURN statement will be used before here. */
isWhite -
*/
-static unsigned int isWhite (char ch)
+static bool isWhite (char ch)
{
return ((ch == ' ') || (ch == ASCII_tab)) || (ch == ASCII_lf);
/* static analysis guarentees a RETURN statement will be used before here. */
{
DynamicStrings_String s;
- s = StringConvert_CardinalToString (c, 0, ' ', 10, FALSE);
+ s = StringConvert_CardinalToString (c, 0, ' ', 10, false);
outTextS (p, s);
s = DynamicStrings_KillString (s);
}
while (i <= h)
{
s = static_cast<decl_node> (Indexing_GetIndice (n->enumerationF.listOfSons, i));
- doFQDNameC (p, s, FALSE);
+ doFQDNameC (p, s, false);
if (i < h)
{
outText (p, (const char *) ",", 1);
static void initCname (decl_cnameT *c)
{
- (*c).init = FALSE;
+ (*c).init = false;
}
doCname -
*/
-static nameKey_Name doCname (nameKey_Name n, decl_cnameT *c, unsigned int scopes)
+static nameKey_Name doCname (nameKey_Name n, decl_cnameT *c, bool scopes)
{
DynamicStrings_String s;
}
else
{
- (*c).init = TRUE;
+ (*c).init = true;
s = keyc_cname (n, scopes);
if (s == NULL)
{
getDName -
*/
-static nameKey_Name getDName (decl_node n, unsigned int scopes)
+static nameKey_Name getDName (decl_node n, bool scopes)
{
nameKey_Name m;
doDNameC -
*/
-static void doDNameC (mcPretty_pretty p, decl_node n, unsigned int scopes)
+static void doDNameC (mcPretty_pretty p, decl_node n, bool scopes)
{
if ((n != NULL) && ((decl_getSymName (n)) != nameKey_NulName))
{
doFQDNameC -
*/
-static void doFQDNameC (mcPretty_pretty p, decl_node n, unsigned int scopes)
+static void doFQDNameC (mcPretty_pretty p, decl_node n, bool scopes)
{
DynamicStrings_String s;
doUsed -
*/
-static void doUsed (mcPretty_pretty p, unsigned int used)
+static void doUsed (mcPretty_pretty p, bool used)
{
if (! used)
{
doHighC -
*/
-static void doHighC (mcPretty_pretty p, decl_node a, nameKey_Name n, unsigned int isused)
+static void doHighC (mcPretty_pretty p, decl_node a, nameKey_Name n, bool isused)
{
if ((decl_isArray (a)) && (decl_isUnbounded (a)))
{
v = getParameterVariable (n, i);
if (v == NULL)
{
- doNamesC (p, keyc_cnamen (i, TRUE));
+ doNamesC (p, keyc_cnamen (i, true));
}
else
{
- doFQDNameC (p, v, TRUE);
+ doFQDNameC (p, v, true);
}
if ((decl_isArray (ptype)) && (decl_isUnbounded (ptype)))
{
v = getParameterVariable (n, i);
if (v == NULL)
{
- doNamesC (p, keyc_cnamen (i, TRUE));
+ doNamesC (p, keyc_cnamen (i, true));
}
else
{
- doFQDNameC (p, v, TRUE);
+ doFQDNameC (p, v, true);
}
doUsed (p, n->varparamF.isUsed);
doHighC (p, ptype, i, n->varparamF.isUsed);
isBase -
*/
-static unsigned int isBase (decl_node n)
+static bool isBase (decl_node n)
{
switch (n->kind)
{
case decl_bitset:
case decl_boolean:
case decl_proc:
- return TRUE;
+ return true;
break;
default:
- return FALSE;
+ return false;
break;
}
/* static analysis guarentees a RETURN statement will be used before here. */
}
+/*
+ doBoolC -
+*/
+
+static void doBoolC (mcPretty_pretty p)
+{
+ if (mcOptions_useBool ())
+ {
+ outText (p, (const char *) "bool", 4);
+ }
+ else
+ {
+ outText (p, (const char *) "unsigned int", 12);
+ }
+}
+
+
/*
doBaseC -
*/
break;
case decl_boolean:
- outText (p, (const char *) "unsigned int", 12);
+ doBoolC (p);
break;
case decl_proc:
isSystem -
*/
-static unsigned int isSystem (decl_node n)
+static bool isSystem (decl_node n)
{
switch (n->kind)
{
case decl_address:
- return TRUE;
+ return true;
break;
case decl_loc:
- return TRUE;
+ return true;
break;
case decl_byte:
- return TRUE;
+ return true;
break;
case decl_word:
- return TRUE;
+ return true;
break;
case decl_csizet:
- return TRUE;
+ return true;
break;
case decl_cssizet:
- return TRUE;
+ return true;
break;
default:
- return FALSE;
+ return false;
break;
}
/* static analysis guarentees a RETURN statement will be used before here. */
m = NULL;
mcPretty_setNeedSpace (p);
doTypeC (p, f->recordfieldF.type, &m);
- doDNameC (p, f, FALSE);
+ doDNameC (p, f, false);
}
isBitset -
*/
-static unsigned int isBitset (decl_node n)
+static bool isBitset (decl_node n)
{
return n == bitsetN;
/* static analysis guarentees a RETURN statement will be used before here. */
isNegative - returns TRUE if expression, n, is negative.
*/
-static unsigned int isNegative (decl_node n)
+static bool isNegative (decl_node n)
{
/* --fixme-- needs to be completed. */
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
isExternal - returns TRUE if symbol, n, was declared in another module.
*/
-static unsigned int isExternal (decl_node n)
+static bool isExternal (decl_node n)
{
decl_node s;
s = NULL;
doTypeC (doP, decl_getType (n), &s);
mcPretty_setNeedSpace (doP);
- doFQDNameC (doP, n, FALSE);
+ doFQDNameC (doP, n, false);
mcPretty_print (doP, (const char *) ";\\n", 3);
}
doProcedureHeadingC -
*/
-static void doProcedureHeadingC (decl_node n, unsigned int prototype)
+static void doProcedureHeadingC (decl_node n, bool prototype)
{
unsigned int i;
unsigned int h;
q = NULL;
doTypeC (doP, n->procedureF.returnType, &q);
mcPretty_setNeedSpace (doP);
- doFQDNameC (doP, n, FALSE);
+ doFQDNameC (doP, n, false);
mcPretty_setNeedSpace (doP);
outText (doP, (const char *) "(", 1);
i = Indexing_LowIndice (n->procedureF.parameters);
checkDeclareUnboundedParamCopyC -
*/
-static unsigned int checkDeclareUnboundedParamCopyC (mcPretty_pretty p, decl_node n)
+static bool checkDeclareUnboundedParamCopyC (mcPretty_pretty p, decl_node n)
{
decl_node t;
unsigned int i;
unsigned int c;
wlists_wlist l;
- unsigned int seen;
+ bool seen;
- seen = FALSE;
+ seen = false;
t = decl_getType (n);
l = n->paramF.namelist->identlistF.names;
if (((decl_isArray (t)) && (decl_isUnbounded (t))) && (l != NULL))
outText (p, (const char *) "[_", 2);
doNamesC (p, wlists_getItemFromList (l, i));
outText (p, (const char *) "_high+1];\\n", 11);
- seen = TRUE;
+ seen = true;
i += 1;
}
}
unsigned int i;
unsigned int h;
decl_node q;
- unsigned int seen;
+ bool seen;
mcDebug_assert (decl_isProcedure (n));
i = Indexing_LowIndice (n->procedureF.parameters);
h = Indexing_HighIndice (n->procedureF.parameters);
- seen = FALSE;
+ seen = false;
while (i <= h)
{
q = static_cast<decl_node> (Indexing_GetIndice (n->procedureF.parameters, i));
if (! (decl_isExported (n)))
{
keyc_enterScope (n);
- doProcedureHeadingC (n, TRUE);
+ doProcedureHeadingC (n, true);
mcPretty_print (doP, (const char *) ";\\n", 3);
keyc_leaveScope (n);
}
s = tempName ();
(*p) = makeIntermediateType (s, (*p));
s = DynamicStrings_KillString (s);
- simplified = FALSE;
+ simplified = false;
}
simplifyNode (l, (*p));
}
static void simplifyTypes (decl_scopeT s)
{
do {
- simplified = TRUE;
+ simplified = true;
Indexing_ForeachIndiceInIndexDo (s.types, (Indexing_IndexProcedure) {(Indexing_IndexProcedure_t) doSimplify});
Indexing_ForeachIndiceInIndexDo (s.variables, (Indexing_IndexProcedure) {(Indexing_IndexProcedure_t) doSimplify});
} while (! (simplified));
isStatementSequenceEmpty -
*/
-static unsigned int isStatementSequenceEmpty (decl_node s)
+static bool isStatementSequenceEmpty (decl_node s)
{
mcDebug_assert (decl_isStatementSequence (s));
return (Indexing_HighIndice (s->stmtF.statements)) == 0;
only one statement.
*/
-static unsigned int isSingleStatement (decl_node s)
+static bool isSingleStatement (decl_node s)
{
unsigned int h;
h = Indexing_HighIndice (s->stmtF.statements);
if ((h == 0) || (h > 1))
{
- return FALSE;
+ return false;
}
s = static_cast<decl_node> (Indexing_GetIndice (s->stmtF.statements, 1));
return (! (decl_isStatementSequence (s))) || (isSingleStatement (s));
isZtypeEquivalent -
*/
-static unsigned int isZtypeEquivalent (decl_node type)
+static bool isZtypeEquivalent (decl_node type)
{
switch (type->kind)
{
case decl_longint:
case decl_shortint:
case decl_ztype:
- return TRUE;
+ return true;
break;
default:
- return FALSE;
+ return false;
break;
}
/* static analysis guarentees a RETURN statement will be used before here. */
isEquivalentType - returns TRUE if type1 and type2 are equivalent.
*/
-static unsigned int isEquivalentType (decl_node type1, decl_node type2)
+static bool isEquivalentType (decl_node type1, decl_node type2)
{
type1 = decl_skipType (type1);
type2 = decl_skipType (type2);
requiresUnpackProc - returns TRUE if either the expr is a procedure or the proctypes differ.
*/
-static unsigned int requiresUnpackProc (decl_node s)
+static bool requiresUnpackProc (decl_node s)
{
mcDebug_assert (isAssignment (s));
return (decl_isProcedure (s->assignmentF.expr)) || ((decl_skipType (decl_getType (s->assignmentF.des))) != (decl_skipType (decl_getType (s->assignmentF.expr))));
containsStatement -
*/
-static unsigned int containsStatement (decl_node s)
+static bool containsStatement (decl_node s)
{
return ((s != NULL) && (decl_isStatementSequence (s))) && (! (isStatementSequenceEmpty (s)));
/* static analysis guarentees a RETURN statement will be used before here. */
noIfElse -
*/
-static unsigned int noIfElse (decl_node n)
+static bool noIfElse (decl_node n)
{
return (((n != NULL) && (decl_isIf (n))) && (n->ifF.else_ == NULL)) && (n->ifF.elsif == NULL);
/* static analysis guarentees a RETURN statement will be used before here. */
in a return value of TRUE.
*/
-static unsigned int noIfElseChained (decl_node n)
+static bool noIfElseChained (decl_node n)
{
decl_node e;
{
/* avoid dangling else. */
/* neither else or elsif. */
- return TRUE;
+ return true;
}
else
{
{
/* avoid dangling else. */
/* neither else or elsif. */
- return TRUE;
+ return true;
}
else
{
}
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
hasIfElse -
*/
-static unsigned int hasIfElse (decl_node n)
+static bool hasIfElse (decl_node n)
{
if (n != NULL)
{
/* avoid gcc warning by using compound statement even if not strictly necessary. */
if (isStatementSequenceEmpty (n))
{
- return FALSE;
+ return false;
}
else if (isSingleStatement (n))
{
}
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
isIfElse -
*/
-static unsigned int isIfElse (decl_node n)
+static bool isIfElse (decl_node n)
{
return ((n != NULL) && (decl_isIf (n))) && ((n->ifF.else_ != NULL) || (n->ifF.elsif != NULL));
/* static analysis guarentees a RETURN statement will be used before here. */
which is an IF and it has no else statement.
*/
-static unsigned int hasIfAndNoElse (decl_node n)
+static bool hasIfAndNoElse (decl_node n)
{
if (n != NULL)
{
{
if (isStatementSequenceEmpty (n))
{
- return FALSE;
+ return false;
}
else if (isSingleStatement (n))
{
return noIfElseChained (n);
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
else if (isString (actual))
{
/* avoid dangling else. */
- outCstring (p, actual, TRUE);
+ outCstring (p, actual, true);
}
else if (decl_isConst (actual))
{
/* avoid dangling else. */
actual = resolveString (actual);
mcDebug_assert (isString (actual));
- outCstring (p, actual, TRUE);
+ outCstring (p, actual, true);
}
else if (isFuncCall (actual))
{
typePair -
*/
-static unsigned int typePair (decl_node a, decl_node b, decl_node x, decl_node y)
+static bool typePair (decl_node a, decl_node b, decl_node x, decl_node y)
{
return ((a == x) && (b == y)) || ((a == y) && (b == x));
/* static analysis guarentees a RETURN statement will be used before here. */
the formal type.
*/
-static unsigned int needsCast (decl_node at, decl_node ft)
+static bool needsCast (decl_node at, decl_node ft)
{
at = decl_skipType (at);
ft = decl_skipType (ft);
if (((((((((((((at == nilN) || (at->kind == decl_nil)) || (at == ft)) || (typePair (at, ft, cardinalN, wordN))) || (typePair (at, ft, cardinalN, ztypeN))) || (typePair (at, ft, integerN, ztypeN))) || (typePair (at, ft, longcardN, ztypeN))) || (typePair (at, ft, shortcardN, ztypeN))) || (typePair (at, ft, longintN, ztypeN))) || (typePair (at, ft, shortintN, ztypeN))) || (typePair (at, ft, realN, rtypeN))) || (typePair (at, ft, longrealN, rtypeN))) || (typePair (at, ft, shortrealN, rtypeN)))
{
- return FALSE;
+ return false;
}
else
{
- return TRUE;
+ return true;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
which was declared inside a definition module for "C".
*/
-static unsigned int isForC (decl_node n)
+static bool isForC (decl_node n)
{
if (decl_isVarParam (n))
{
/* avoid dangling else. */
return n->procedureF.isForC;
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
isDefForCNode - return TRUE if node n was declared inside a definition module for "C".
*/
-static unsigned int isDefForCNode (decl_node n)
+static bool isDefForCNode (decl_node n)
{
nameKey_Name name;
doFuncArgsC -
*/
-static void doFuncArgsC (mcPretty_pretty p, decl_node s, Indexing_Index l, unsigned int needParen)
+static void doFuncArgsC (mcPretty_pretty p, decl_node s, Indexing_Index l, bool needParen)
{
decl_node actual;
decl_node formal;
doProcTypeArgsC -
*/
-static void doProcTypeArgsC (mcPretty_pretty p, decl_node s, Indexing_Index args, unsigned int needParen)
+static void doProcTypeArgsC (mcPretty_pretty p, decl_node s, Indexing_Index args, bool needParen)
{
decl_node a;
decl_node b;
The intrinsic functions are represented as unary and binary nodes.
*/
-static unsigned int isIntrinsic (decl_node n)
+static bool isIntrinsic (decl_node n)
{
switch (n->kind)
{
case decl_new:
case decl_dispose:
case decl_halt:
- return TRUE;
+ return true;
break;
default:
- return FALSE;
+ return false;
break;
}
/* static analysis guarentees a RETURN statement will be used before here. */
isIntrinsicFunction - returns true if, n, is an instrinsic function.
*/
-static unsigned int isIntrinsicFunction (decl_node n)
+static bool isIntrinsicFunction (decl_node n)
{
switch (n->kind)
{
case decl_re:
case decl_im:
case decl_cmplx:
- return TRUE;
+ return true;
break;
default:
- return FALSE;
+ return false;
break;
}
/* static analysis guarentees a RETURN statement will be used before here. */
mcDebug_assert (isFuncCall (n));
if (decl_isProcedure (n->funccallF.function))
{
- doFQDNameC (p, n->funccallF.function, TRUE);
+ doFQDNameC (p, n->funccallF.function, true);
mcPretty_setNeedSpace (p);
- doFuncArgsC (p, n, n->funccallF.function->procedureF.parameters, TRUE);
+ doFuncArgsC (p, n, n->funccallF.function->procedureF.parameters, true);
}
else
{
mcPretty_setNeedSpace (p);
if (t == procN)
{
- doProcTypeArgsC (p, n, NULL, TRUE);
+ doProcTypeArgsC (p, n, NULL, true);
}
else
{
mcDebug_assert (decl_isProcType (t));
- doProcTypeArgsC (p, n, t->proctypeF.parameters, TRUE);
+ doProcTypeArgsC (p, n, t->proctypeF.parameters, true);
}
}
}
doCaseStatementC -
*/
-static void doCaseStatementC (mcPretty_pretty p, decl_node n, unsigned int needBreak)
+static void doCaseStatementC (mcPretty_pretty p, decl_node n, bool needBreak)
{
p = mcPretty_pushPretty (p);
mcPretty_setindent (p, (mcPretty_getindent (p))+indentationC);
doCaseLabels -
*/
-static void doCaseLabels (mcPretty_pretty p, decl_node n, unsigned int needBreak)
+static void doCaseLabels (mcPretty_pretty p, decl_node n, bool needBreak)
{
mcDebug_assert (decl_isCaseLabelList (n));
doRangeListC (p, n->caselabellistF.caseList);
doCaseLabelListC -
*/
-static void doCaseLabelListC (mcPretty_pretty p, decl_node n, unsigned int haveElse)
+static void doCaseLabelListC (mcPretty_pretty p, decl_node n, bool haveElse)
{
unsigned int i;
unsigned int h;
else
{
outText (p, (const char *) "\\ndefault:\\n", 12);
- doCaseStatementC (p, n->caseF.else_, TRUE);
+ doCaseStatementC (p, n->caseF.else_, true);
}
}
if (n->caseF.else_ == NULL)
{
/* avoid dangling else. */
- if (TRUE)
+ if (true)
{
outText (p, (const char *) "\\n", 2);
outText (p, (const char *) "else {\\n", 8);
{
outText (p, (const char *) "\\n", 2);
outText (p, (const char *) "else {\\n", 8);
- doCaseStatementC (p, n->caseF.else_, FALSE);
+ doCaseStatementC (p, n->caseF.else_, false);
outText (p, (const char *) "}\\n", 3);
}
}
single values and not ranges.
*/
-static unsigned int canUseSwitchCaseLabels (decl_node n)
+static bool canUseSwitchCaseLabels (decl_node n)
{
unsigned int i;
unsigned int h;
r = static_cast<decl_node> (Indexing_GetIndice (l->caselistF.rangePairs, i));
if ((r->rangeF.hi != NULL) && (r->rangeF.lo != r->rangeF.hi))
{
- return FALSE;
+ return false;
}
i += 1;
}
- return TRUE;
+ return true;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
selectors are single values rather than ranges.
*/
-static unsigned int canUseSwitch (decl_node n)
+static bool canUseSwitch (decl_node n)
{
unsigned int i;
unsigned int h;
c = static_cast<decl_node> (Indexing_GetIndice (n->caseF.caseLabelList, i));
if (! (canUseSwitchCaseLabels (c)))
{
- return FALSE;
+ return false;
}
i += 1;
}
- return TRUE;
+ return true;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
isHalt -
*/
-static unsigned int isHalt (decl_node n)
+static bool isHalt (decl_node n)
{
return n->kind == decl_halt;
/* static analysis guarentees a RETURN statement will be used before here. */
isReturnOrHalt -
*/
-static unsigned int isReturnOrHalt (decl_node n)
+static bool isReturnOrHalt (decl_node n)
{
return (isHalt (n)) || (decl_isReturn (n));
/* static analysis guarentees a RETURN statement will be used before here. */
isLastStatementReturn -
*/
-static unsigned int isLastStatementReturn (decl_node n)
+static bool isLastStatementReturn (decl_node n)
{
return isLastStatement (n, (decl_isNodeF) {(decl_isNodeF_t) isReturnOrHalt});
/* static analysis guarentees a RETURN statement will be used before here. */
isLastStatementSequence -
*/
-static unsigned int isLastStatementSequence (decl_node n, decl_isNodeF q)
+static bool isLastStatementSequence (decl_node n, decl_isNodeF q)
{
unsigned int h;
{
return isLastStatement (reinterpret_cast<decl_node> (Indexing_GetIndice (n->stmtF.statements, h)), q);
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
isLastStatementIf -
*/
-static unsigned int isLastStatementIf (decl_node n, decl_isNodeF q)
+static bool isLastStatementIf (decl_node n, decl_isNodeF q)
{
- unsigned int ret;
+ bool ret;
mcDebug_assert (decl_isIf (n));
- ret = TRUE;
+ ret = true;
if ((n->ifF.elsif != NULL) && ret)
{
ret = isLastStatement (n->ifF.elsif, q);
isLastStatementElsif -
*/
-static unsigned int isLastStatementElsif (decl_node n, decl_isNodeF q)
+static bool isLastStatementElsif (decl_node n, decl_isNodeF q)
{
- unsigned int ret;
+ bool ret;
mcDebug_assert (decl_isElsif (n));
- ret = TRUE;
+ ret = true;
if ((n->elsifF.elsif != NULL) && ret)
{
ret = isLastStatement (n->elsifF.elsif, q);
isLastStatementCase -
*/
-static unsigned int isLastStatementCase (decl_node n, decl_isNodeF q)
+static bool isLastStatementCase (decl_node n, decl_isNodeF q)
{
- unsigned int ret;
+ bool ret;
unsigned int i;
unsigned int h;
decl_node c;
- ret = TRUE;
+ ret = true;
mcDebug_assert (decl_isCase (n));
i = 1;
h = Indexing_HighIndice (n->caseF.caseLabelList);
isLastStatement - returns TRUE if the last statement in, n, is, q.
*/
-static unsigned int isLastStatement (decl_node n, decl_isNodeF q)
+static bool isLastStatement (decl_node n, decl_isNodeF q)
{
- unsigned int ret;
+ bool ret;
if (n == NULL)
{
- return FALSE;
+ return false;
}
else if (decl_isStatementSequence (n))
{
else if ((*q.proc) (n))
{
/* avoid dangling else. */
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
outText (doP, (const char *) "\\n", 2);
includeParameters (n);
keyc_enterScope (n);
- doProcedureHeadingC (n, FALSE);
+ doProcedureHeadingC (n, false);
outText (doP, (const char *) "\\n", 2);
doP = outKc (doP, (const char *) "{\\n", 3);
s = mcPretty_getcurline (doP);
tryComplete - returns TRUE if node, n, can be and was completed.
*/
-static unsigned int tryComplete (decl_node n, decl_nodeProcedure c, decl_nodeProcedure t, decl_nodeProcedure v)
+static bool tryComplete (decl_node n, decl_nodeProcedure c, decl_nodeProcedure t, decl_nodeProcedure v)
{
if (decl_isEnumeration (n))
{
/* can always emit enumerated types. */
output (n, c, t, v);
- return TRUE;
+ return true;
}
else if (((decl_isType (n)) && (decl_isTypeHidden (n))) && ((decl_getType (n)) == NULL))
{
/* avoid dangling else. */
/* can always emit hidden types. */
outputHidden (n);
- return TRUE;
+ return true;
}
else if ((allDependants (n)) == decl_completed)
{
/* avoid dangling else. */
output (n, c, t, v);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
tryCompleteFromPartial -
*/
-static unsigned int tryCompleteFromPartial (decl_node n, decl_nodeProcedure t)
+static bool tryCompleteFromPartial (decl_node n, decl_nodeProcedure t)
{
if ((((decl_isType (n)) && ((decl_getType (n)) != NULL)) && (decl_isPointer (decl_getType (n)))) && ((allDependants (decl_getType (n))) == decl_completed))
{
/* alists.includeItemIntoList (partialQ, getType (n)) ; */
outputHiddenComplete (n);
- return TRUE;
+ return true;
}
else if ((allDependants (n)) == decl_completed)
{
/* avoid dangling else. */
(*t.proc) (n);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
tryPartial -
*/
-static unsigned int tryPartial (decl_node n, decl_nodeProcedure pt)
+static bool tryPartial (decl_node n, decl_nodeProcedure pt)
{
decl_node q;
{
(*pt.proc) (n);
addTodo (q);
- return TRUE;
+ return true;
}
else if (decl_isArray (q))
{
/* avoid dangling else. */
(*pt.proc) (n);
addTodo (q);
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
if (decl_isExported (n))
{
keyc_enterScope (n);
- doProcedureHeadingC (n, TRUE);
+ doProcedureHeadingC (n, true);
mcPretty_print (doP, (const char *) ";\\n", 3);
keyc_leaveScope (n);
}
isAssignment -
*/
-static unsigned int isAssignment (decl_node n)
+static bool isAssignment (decl_node n)
{
return n->kind == decl_assignment;
/* static analysis guarentees a RETURN statement will be used before here. */
isComment - returns TRUE if node, n, is a comment.
*/
-static unsigned int isComment (decl_node n)
+static bool isComment (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_comment;
makeM2rts ();
outputState = decl_punct;
tempCount = 0;
- mustVisitScope = FALSE;
+ mustVisitScope = false;
}
isDef - return TRUE if node, n, is a definition module.
*/
-extern "C" unsigned int decl_isDef (decl_node n)
+extern "C" bool decl_isDef (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_def;
isImp - return TRUE if node, n, is an implementation module.
*/
-extern "C" unsigned int decl_isImp (decl_node n)
+extern "C" bool decl_isImp (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_imp;
isImpOrModule - returns TRUE if, n, is a program module or implementation module.
*/
-extern "C" unsigned int decl_isImpOrModule (decl_node n)
+extern "C" bool decl_isImpOrModule (decl_node n)
{
return (decl_isImp (n)) || (decl_isModule (n));
/* static analysis guarentees a RETURN statement will be used before here. */
isVisited - returns TRUE if the node was visited.
*/
-extern "C" unsigned int decl_isVisited (decl_node n)
+extern "C" bool decl_isVisited (decl_node n)
{
switch (n->kind)
{
switch (n->kind)
{
case decl_def:
- n->defF.visited = FALSE;
+ n->defF.visited = false;
break;
case decl_imp:
- n->impF.visited = FALSE;
+ n->impF.visited = false;
break;
case decl_module:
- n->moduleF.visited = FALSE;
+ n->moduleF.visited = false;
break;
switch (n->kind)
{
case decl_def:
- n->defF.visited = TRUE;
+ n->defF.visited = true;
break;
case decl_imp:
- n->impF.visited = TRUE;
+ n->impF.visited = true;
break;
case decl_module:
- n->moduleF.visited = TRUE;
+ n->moduleF.visited = true;
break;
switch (n->kind)
{
case decl_def:
- n->defF.enumsComplete = TRUE;
+ n->defF.enumsComplete = true;
break;
case decl_imp:
- n->impF.enumsComplete = TRUE;
+ n->impF.enumsComplete = true;
break;
case decl_module:
- n->moduleF.enumsComplete = TRUE;
+ n->moduleF.enumsComplete = true;
break;
getEnumsComplete - gets the field from the def or imp or module, n.
*/
-extern "C" unsigned int decl_getEnumsComplete (decl_node n)
+extern "C" bool decl_getEnumsComplete (decl_node n)
{
switch (n->kind)
{
isModule - return TRUE if node, n, is a program module.
*/
-extern "C" unsigned int decl_isModule (decl_node n)
+extern "C" bool decl_isModule (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_module;
implementation or program module.
*/
-extern "C" unsigned int decl_isMainModule (decl_node n)
+extern "C" bool decl_isMainModule (decl_node n)
{
mcDebug_assert (n != NULL);
return n == mainModule;
extern "C" void decl_putDefForC (decl_node n)
{
mcDebug_assert (decl_isDef (n));
- n->defF.forC = TRUE;
+ n->defF.forC = true;
}
isConst - returns TRUE if node, n, is a const.
*/
-extern "C" unsigned int decl_isConst (decl_node n)
+extern "C" bool decl_isConst (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_const;
isType - returns TRUE if node, n, is a type.
*/
-extern "C" unsigned int decl_isType (decl_node n)
+extern "C" bool decl_isType (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_type;
mcDebug_assert (des != NULL);
mcDebug_assert (decl_isType (des));
- des->typeF.isHidden = TRUE;
+ des->typeF.isHidden = true;
s = decl_getScope (des);
mcDebug_assert (decl_isDef (s));
- s->defF.hasHidden = TRUE;
+ s->defF.hasHidden = true;
}
isTypeHidden - returns TRUE if type, n, is hidden.
*/
-extern "C" unsigned int decl_isTypeHidden (decl_node n)
+extern "C" bool decl_isTypeHidden (decl_node n)
{
mcDebug_assert (n != NULL);
mcDebug_assert (decl_isType (n));
hasHidden - returns TRUE if module, n, has a hidden type.
*/
-extern "C" unsigned int decl_hasHidden (decl_node n)
+extern "C" bool decl_hasHidden (decl_node n)
{
mcDebug_assert (decl_isDef (n));
return n->defF.hasHidden;
isVar - returns TRUE if node, n, is a type.
*/
-extern "C" unsigned int decl_isVar (decl_node n)
+extern "C" bool decl_isVar (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_var;
isTemporary - returns TRUE if node, n, is a variable and temporary.
*/
-extern "C" unsigned int decl_isTemporary (decl_node n)
+extern "C" bool decl_isTemporary (decl_node n)
{
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
the definition module.
*/
-extern "C" unsigned int decl_isExported (decl_node n)
+extern "C" bool decl_isExported (decl_node n)
{
decl_node s;
default:
- return FALSE;
+ return false;
break;
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
isLiteral - returns TRUE if, n, is a literal.
*/
-extern "C" unsigned int decl_isLiteral (decl_node n)
+extern "C" bool decl_isLiteral (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_literal;
isConstSet - returns TRUE if, n, is a constant set.
*/
-extern "C" unsigned int decl_isConstSet (decl_node n)
+extern "C" bool decl_isConstSet (decl_node n)
{
mcDebug_assert (n != NULL);
if ((decl_isLiteral (n)) || (decl_isConst (n)))
{
return decl_isSet (decl_skipType (decl_getType (n)));
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
isEnumerationField - returns TRUE if, n, is an enumeration field.
*/
-extern "C" unsigned int decl_isEnumerationField (decl_node n)
+extern "C" bool decl_isEnumerationField (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_enumerationfield;
isEnumeration - returns TRUE if node, n, is an enumeration type.
*/
-extern "C" unsigned int decl_isEnumeration (decl_node n)
+extern "C" bool decl_isEnumeration (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_enumeration;
isUnbounded - returns TRUE if, n, is an unbounded array.
*/
-extern "C" unsigned int decl_isUnbounded (decl_node n)
+extern "C" bool decl_isUnbounded (decl_node n)
{
mcDebug_assert (n != NULL);
return (n->kind == decl_array) && n->arrayF.isUnbounded;
isParameter - returns TRUE if, n, is a parameter.
*/
-extern "C" unsigned int decl_isParameter (decl_node n)
+extern "C" bool decl_isParameter (decl_node n)
{
mcDebug_assert (n != NULL);
return (n->kind == decl_param) || (n->kind == decl_varparam);
isVarParam - returns TRUE if, n, is a var parameter.
*/
-extern "C" unsigned int decl_isVarParam (decl_node n)
+extern "C" bool decl_isVarParam (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_varparam;
isParam - returns TRUE if, n, is a non var parameter.
*/
-extern "C" unsigned int decl_isParam (decl_node n)
+extern "C" bool decl_isParam (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_param;
isNonVarParam - is an alias to isParam.
*/
-extern "C" unsigned int decl_isNonVarParam (decl_node n)
+extern "C" bool decl_isNonVarParam (decl_node n)
{
return decl_isParam (n);
/* static analysis guarentees a RETURN statement will be used before here. */
mcDebug_assert (decl_isProcedure (proc));
l = decl_makeIdentList ();
mcDebug_assert (decl_putIdent (l, id));
- checkMakeVariables (proc, l, type, FALSE, TRUE);
+ checkMakeVariables (proc, l, type, false, true);
if (! proc->procedureF.checking)
{
p = makeOptParameter (l, type, init);
isOptarg - returns TRUE if, n, is an optarg.
*/
-extern "C" unsigned int decl_isOptarg (decl_node n)
+extern "C" bool decl_isOptarg (decl_node n)
{
return n->kind == decl_optarg;
/* static analysis guarentees a RETURN statement will be used before here. */
isRecord - returns TRUE if, n, is a record.
*/
-extern "C" unsigned int decl_isRecord (decl_node n)
+extern "C" bool decl_isRecord (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_record;
isRecordField - returns TRUE if, n, is a record field.
*/
-extern "C" unsigned int decl_isRecordField (decl_node n)
+extern "C" bool decl_isRecordField (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_recordfield;
isVarientField - returns TRUE if, n, is a varient field.
*/
-extern "C" unsigned int decl_isVarientField (decl_node n)
+extern "C" bool decl_isVarientField (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_varientfield;
isArray - returns TRUE if, n, is an array.
*/
-extern "C" unsigned int decl_isArray (decl_node n)
+extern "C" bool decl_isArray (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_array;
isProcType - returns TRUE if, n, is a procedure type.
*/
-extern "C" unsigned int decl_isProcType (decl_node n)
+extern "C" bool decl_isProcType (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_proctype;
isPointer - returns TRUE if, n, is a pointer.
*/
-extern "C" unsigned int decl_isPointer (decl_node n)
+extern "C" bool decl_isPointer (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_pointer;
isProcedure - returns TRUE if, n, is a procedure.
*/
-extern "C" unsigned int decl_isProcedure (decl_node n)
+extern "C" bool decl_isProcedure (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_procedure;
isVarient - returns TRUE if, n, is a varient record.
*/
-extern "C" unsigned int decl_isVarient (decl_node n)
+extern "C" bool decl_isVarient (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_varient;
isSet - returns TRUE if, n, is a set type.
*/
-extern "C" unsigned int decl_isSet (decl_node n)
+extern "C" bool decl_isSet (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_set;
isSubrange - returns TRUE if, n, is a subrange type.
*/
-extern "C" unsigned int decl_isSubrange (decl_node n)
+extern "C" bool decl_isSubrange (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_subrange;
isZtype - returns TRUE if, n, is the Z type.
*/
-extern "C" unsigned int decl_isZtype (decl_node n)
+extern "C" bool decl_isZtype (decl_node n)
{
return n == ztypeN;
/* static analysis guarentees a RETURN statement will be used before here. */
isRtype - returns TRUE if, n, is the R type.
*/
-extern "C" unsigned int decl_isRtype (decl_node n)
+extern "C" bool decl_isRtype (decl_node n)
{
return n == rtypeN;
/* static analysis guarentees a RETURN statement will be used before here. */
d->typeF.name = n;
d->typeF.type = NULL;
d->typeF.scope = decl_getDeclScope ();
- d->typeF.isHidden = FALSE;
- d->typeF.isInternal = FALSE;
+ d->typeF.isHidden = false;
+ d->typeF.isInternal = false;
return addToScope (d);
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
d = decl_lookupSym (n);
if (d != NULL)
{
- d->typeF.isHidden = FALSE;
+ d->typeF.isHidden = false;
return addToScope (d);
}
else
d->typeF.name = n;
d->typeF.type = NULL;
d->typeF.scope = decl_getDeclScope ();
- d->typeF.isHidden = FALSE;
+ d->typeF.isHidden = false;
return addToScope (d);
}
/* static analysis guarentees a RETURN statement will be used before here. */
d->varF.type = NULL;
d->varF.decl = NULL;
d->varF.scope = decl_getDeclScope ();
- d->varF.isInitialised = FALSE;
- d->varF.isParameter = FALSE;
- d->varF.isVarParameter = FALSE;
+ d->varF.isInitialised = false;
+ d->varF.isParameter = false;
+ d->varF.isVarParameter = false;
initCname (&d->varF.cname);
return addToScope (d);
/* static analysis guarentees a RETURN statement will be used before here. */
n->arrayF.subr = subr;
n->arrayF.type = type;
n->arrayF.scope = decl_getDeclScope ();
- n->arrayF.isUnbounded = FALSE;
+ n->arrayF.isUnbounded = false;
return n;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
extern "C" void decl_putUnbounded (decl_node n)
{
mcDebug_assert (n->kind == decl_array);
- n->arrayF.isUnbounded = TRUE;
+ n->arrayF.isUnbounded = true;
}
/* avoid dangling else. */
f = putFieldRecord (r, tag, type, v);
mcDebug_assert (decl_isRecordField (f));
- f->recordfieldF.tag = TRUE;
+ f->recordfieldF.tag = true;
putVarientTag (v, f);
}
}
module, m, scope.
*/
-extern "C" void decl_addImportedModule (decl_node m, decl_node i, unsigned int scoped)
+extern "C" void decl_addImportedModule (decl_node m, decl_node i, bool scoped)
{
mcDebug_assert ((decl_isDef (i)) || (decl_isModule (i)));
if (decl_isDef (m))
d->procedureF.scope = decl_getDeclScope ();
d->procedureF.parameters = Indexing_InitIndex (1);
d->procedureF.isForC = isDefForCNode (decl_getDeclScope ());
- d->procedureF.built = FALSE;
- d->procedureF.returnopt = FALSE;
+ d->procedureF.built = false;
+ d->procedureF.returnopt = false;
d->procedureF.optarg_ = NULL;
- d->procedureF.noreturnused = FALSE;
- d->procedureF.noreturn = FALSE;
- d->procedureF.vararg = FALSE;
- d->procedureF.checking = FALSE;
+ d->procedureF.noreturnused = false;
+ d->procedureF.noreturn = false;
+ d->procedureF.vararg = false;
+ d->procedureF.checking = false;
d->procedureF.paramcount = 0;
d->procedureF.returnType = NULL;
d->procedureF.beginStatements = NULL;
d = newNode (decl_proctype);
d->proctypeF.scope = decl_getDeclScope ();
d->proctypeF.parameters = Indexing_InitIndex (1);
- d->proctypeF.returnopt = FALSE;
+ d->proctypeF.returnopt = false;
d->proctypeF.optarg_ = NULL;
- d->proctypeF.vararg = FALSE;
+ d->proctypeF.vararg = false;
d->proctypeF.returnType = NULL;
return d;
/* static analysis guarentees a RETURN statement will be used before here. */
mcDebug_assert ((decl_isProcedure (proc)) || (decl_isProcType (proc)));
if (decl_isProcedure (proc))
{
- proc->procedureF.returnopt = TRUE;
+ proc->procedureF.returnopt = true;
}
else
{
- proc->proctypeF.returnopt = TRUE;
+ proc->proctypeF.returnopt = true;
}
}
makeVarParameter - returns a var parameter node with, name: type.
*/
-extern "C" decl_node decl_makeVarParameter (decl_node l, decl_node type, decl_node proc, unsigned int isused)
+extern "C" decl_node decl_makeVarParameter (decl_node l, decl_node type, decl_node proc, bool isused)
{
decl_node d;
d->varparamF.namelist = l;
d->varparamF.type = type;
d->varparamF.scope = proc;
- d->varparamF.isUnbounded = FALSE;
+ d->varparamF.isUnbounded = false;
d->varparamF.isForC = isDefForCNode (proc);
d->varparamF.isUsed = isused;
return d;
makeNonVarParameter - returns a non var parameter node with, name: type.
*/
-extern "C" decl_node decl_makeNonVarParameter (decl_node l, decl_node type, decl_node proc, unsigned int isused)
+extern "C" decl_node decl_makeNonVarParameter (decl_node l, decl_node type, decl_node proc, bool isused)
{
decl_node d;
d->paramF.namelist = l;
d->paramF.type = type;
d->paramF.scope = proc;
- d->paramF.isUnbounded = FALSE;
+ d->paramF.isUnbounded = false;
d->paramF.isForC = isDefForCNode (proc);
d->paramF.isUsed = isused;
return d;
extern "C" void decl_paramLeave (decl_node n)
{
mcDebug_assert (decl_isProcedure (n));
- n->procedureF.checking = TRUE;
+ n->procedureF.checking = true;
if ((decl_isImp (currentModule)) || (decl_isModule (currentModule)))
{
- n->procedureF.built = TRUE;
+ n->procedureF.built = true;
}
}
n = newNode (decl_identlist);
n->identlistF.names = wlists_initList ();
- n->identlistF.cnamed = FALSE;
+ n->identlistF.cnamed = false;
return n;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
ident, i, is unique.
*/
-extern "C" unsigned int decl_putIdent (decl_node n, nameKey_Name i)
+extern "C" bool decl_putIdent (decl_node n, nameKey_Name i)
{
mcDebug_assert (isIdentList (n));
if (wlists_isItemInList (n->identlistF.names, i))
{
- return FALSE;
+ return false;
}
else
{
wlists_putItemIntoList (n->identlistF.names, i);
- return TRUE;
+ return true;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
in procedure, n.
*/
-extern "C" void decl_addVarParameters (decl_node n, decl_node i, decl_node type, unsigned int isused)
+extern "C" void decl_addVarParameters (decl_node n, decl_node i, decl_node type, bool isused)
{
decl_node p;
mcDebug_assert (isIdentList (i));
mcDebug_assert (decl_isProcedure (n));
- checkMakeVariables (n, i, type, TRUE, isused);
+ checkMakeVariables (n, i, type, true, isused);
if (n->procedureF.checking)
{
- checkParameters (n, i, type, TRUE, isused); /* will destroy, i. */
+ checkParameters (n, i, type, true, isused); /* will destroy, i. */
}
else
{
in procedure, n.
*/
-extern "C" void decl_addNonVarParameters (decl_node n, decl_node i, decl_node type, unsigned int isused)
+extern "C" void decl_addNonVarParameters (decl_node n, decl_node i, decl_node type, bool isused)
{
decl_node p;
mcDebug_assert (isIdentList (i));
mcDebug_assert (decl_isProcedure (n));
- checkMakeVariables (n, i, type, FALSE, isused);
+ checkMakeVariables (n, i, type, false, isused);
if (n->procedureF.checking)
{
- checkParameters (n, i, type, FALSE, isused); /* will destroy, i. */
+ checkParameters (n, i, type, false, isused); /* will destroy, i. */
}
else
{
isVarargs - returns TRUE if, n, is a varargs node.
*/
-extern "C" unsigned int decl_isVarargs (decl_node n)
+extern "C" bool decl_isVarargs (decl_node n)
{
return n->kind == decl_varargs;
/* static analysis guarentees a RETURN statement will be used before here. */
Indexing_IncludeIndiceIntoIndex (proc->procedureF.parameters, reinterpret_cast<void *> (param));
if (decl_isVarargs (param))
{
- proc->procedureF.vararg = TRUE;
+ proc->procedureF.vararg = true;
}
if (decl_isOptarg (param))
{
Indexing_IncludeIndiceIntoIndex (proc->proctypeF.parameters, reinterpret_cast<void *> (param));
if (decl_isVarargs (param))
{
- proc->proctypeF.vararg = TRUE;
+ proc->proctypeF.vararg = true;
}
if (decl_isOptarg (param))
{
isPointerRef - returns TRUE if, n, is a pointerref node.
*/
-extern "C" unsigned int decl_isPointerRef (decl_node n)
+extern "C" bool decl_isPointerRef (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_pointerref;
isSetValue - returns TRUE if, n, is a setvalue node.
*/
-extern "C" unsigned int decl_isSetValue (decl_node n)
+extern "C" bool decl_isSetValue (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_setvalue;
isExpList - returns TRUE if, n, is an explist node.
*/
-extern "C" unsigned int decl_isExpList (decl_node n)
+extern "C" bool decl_isExpList (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_explist;
switch (n->kind)
{
case decl_def:
- n->defF.constsComplete = TRUE;
+ n->defF.constsComplete = true;
break;
case decl_imp:
- n->impF.constsComplete = TRUE;
+ n->impF.constsComplete = true;
break;
case decl_module:
- n->moduleF.constsComplete = TRUE;
+ n->moduleF.constsComplete = true;
break;
mcDebug_assert ((n == NULL) || (decl_isExpList (n)));
if (((c == haltN) && ((decl_getMainModule ()) != (decl_lookupDef (nameKey_makeKey ((const char *) "M2RTS", 5))))) && ((decl_getMainModule ()) != (decl_lookupImp (nameKey_makeKey ((const char *) "M2RTS", 5)))))
{
- decl_addImportedModule (decl_getMainModule (), decl_lookupDef (nameKey_makeKey ((const char *) "M2RTS", 5)), FALSE);
+ decl_addImportedModule (decl_getMainModule (), decl_lookupDef (nameKey_makeKey ((const char *) "M2RTS", 5)), false);
}
f = checkIntrinsic (c, n);
checkCHeaders (c);
isStatementSequence - returns TRUE if node, n, is a statement sequence.
*/
-extern "C" unsigned int decl_isStatementSequence (decl_node n)
+extern "C" bool decl_isStatementSequence (decl_node n)
{
return n->kind == decl_stmtseq;
/* static analysis guarentees a RETURN statement will be used before here. */
Indexing_PutIndice (s->stmtF.statements, (Indexing_HighIndice (s->stmtF.statements))+1, reinterpret_cast<void *> (n));
if ((isIntrinsic (n)) && n->intrinsicF.postUnreachable)
{
- n->intrinsicF.postUnreachable = FALSE;
+ n->intrinsicF.postUnreachable = false;
decl_addStatement (s, makeIntrinsicProc (decl_unreachable, 0, NULL));
}
}
isReturn - returns TRUE if node, n, is a return.
*/
-extern "C" unsigned int decl_isReturn (decl_node n)
+extern "C" bool decl_isReturn (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_return;
isWhile - returns TRUE if node, n, is a while.
*/
-extern "C" unsigned int decl_isWhile (decl_node n)
+extern "C" bool decl_isWhile (decl_node n)
{
return n->kind == decl_while;
/* static analysis guarentees a RETURN statement will be used before here. */
isExit - returns TRUE if node, n, is an exit.
*/
-extern "C" unsigned int decl_isExit (decl_node n)
+extern "C" bool decl_isExit (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_exit;
isLoop - returns TRUE if, n, is a loop node.
*/
-extern "C" unsigned int decl_isLoop (decl_node n)
+extern "C" bool decl_isLoop (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_loop;
/* make a local copy of each unbounded array. */
memcpy (a, a_, _a_high+1);
- c = mcComment_initComment (TRUE);
+ c = mcComment_initComment (true);
s = DynamicStrings_InitString ((const char *) a, _a_high);
mcComment_addText (c, DynamicStrings_string (s));
s = DynamicStrings_KillString (s);
isIf - returns TRUE if, n, is an if node.
*/
-extern "C" unsigned int decl_isIf (decl_node n)
+extern "C" bool decl_isIf (decl_node n)
{
return n->kind == decl_if;
/* static analysis guarentees a RETURN statement will be used before here. */
isElsif - returns TRUE if node, n, is an elsif node.
*/
-extern "C" unsigned int decl_isElsif (decl_node n)
+extern "C" bool decl_isElsif (decl_node n)
{
return n->kind == decl_elsif;
/* static analysis guarentees a RETURN statement will be used before here. */
isFor - returns TRUE if node, n, is a for node.
*/
-extern "C" unsigned int decl_isFor (decl_node n)
+extern "C" bool decl_isFor (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_for;
isRepeat - returns TRUE if node, n, is a repeat node.
*/
-extern "C" unsigned int decl_isRepeat (decl_node n)
+extern "C" bool decl_isRepeat (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_repeat;
isCase - returns TRUE if node, n, is a case statement.
*/
-extern "C" unsigned int decl_isCase (decl_node n)
+extern "C" bool decl_isCase (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_case;
isCaseLabelList - returns TRUE if, n, is a caselabellist.
*/
-extern "C" unsigned int decl_isCaseLabelList (decl_node n)
+extern "C" bool decl_isCaseLabelList (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_caselabellist;
isCaseList - returns TRUE if, n, is a case list.
*/
-extern "C" unsigned int decl_isCaseList (decl_node n)
+extern "C" bool decl_isCaseList (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_caselist;
isRange - returns TRUE if node, n, is a range.
*/
-extern "C" unsigned int decl_isRange (decl_node n)
+extern "C" bool decl_isRange (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_range;
setNoReturn - sets noreturn field inside procedure.
*/
-extern "C" void decl_setNoReturn (decl_node n, unsigned int value)
+extern "C" void decl_setNoReturn (decl_node n, bool value)
{
mcDebug_assert (n != NULL);
mcDebug_assert (decl_isProcedure (n));
mcMetaError_metaError1 ((const char *) "{%1DMad} definition module and implementation module have different <* noreturn *> attributes", 93, (const unsigned char *) &n, (sizeof (n)-1));
}
n->procedureF.noreturn = value;
- n->procedureF.noreturnused = TRUE;
+ n->procedureF.noreturnused = true;
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
typedef struct decl_isNodeF_p decl_isNodeF;
-typedef unsigned int (*decl_isNodeF_t) (decl_node);
+typedef bool (*decl_isNodeF_t) (decl_node);
struct decl_isNodeF_p { decl_isNodeF_t proc; };
isDef - return TRUE if node, n, is a definition module.
*/
-EXTERN unsigned int decl_isDef (decl_node n);
+EXTERN bool decl_isDef (decl_node n);
/*
isImp - return TRUE if node, n, is an implementation module.
*/
-EXTERN unsigned int decl_isImp (decl_node n);
+EXTERN bool decl_isImp (decl_node n);
/*
isImpOrModule - returns TRUE if, n, is a program module or implementation module.
*/
-EXTERN unsigned int decl_isImpOrModule (decl_node n);
+EXTERN bool decl_isImpOrModule (decl_node n);
/*
isVisited - returns TRUE if the node was visited.
*/
-EXTERN unsigned int decl_isVisited (decl_node n);
+EXTERN bool decl_isVisited (decl_node n);
/*
unsetVisited - unset the visited flag on a def/imp/module node.
getEnumsComplete - gets the field from the def or imp or module, n.
*/
-EXTERN unsigned int decl_getEnumsComplete (decl_node n);
+EXTERN bool decl_getEnumsComplete (decl_node n);
/*
resetEnumPos - resets the index into the saved list of enums inside
isModule - return TRUE if node, n, is a program module.
*/
-EXTERN unsigned int decl_isModule (decl_node n);
+EXTERN bool decl_isModule (decl_node n);
/*
isMainModule - return TRUE if node, n, is the main module specified
implementation or program module.
*/
-EXTERN unsigned int decl_isMainModule (decl_node n);
+EXTERN bool decl_isMainModule (decl_node n);
/*
setMainModule - sets node, n, as the main module to be compiled.
isConst - returns TRUE if node, n, is a const.
*/
-EXTERN unsigned int decl_isConst (decl_node n);
+EXTERN bool decl_isConst (decl_node n);
/*
isType - returns TRUE if node, n, is a type.
*/
-EXTERN unsigned int decl_isType (decl_node n);
+EXTERN bool decl_isType (decl_node n);
/*
putType - places, exp, as the type alias to des.
isTypeHidden - returns TRUE if type, n, is hidden.
*/
-EXTERN unsigned int decl_isTypeHidden (decl_node n);
+EXTERN bool decl_isTypeHidden (decl_node n);
/*
hasHidden - returns TRUE if module, n, has a hidden type.
*/
-EXTERN unsigned int decl_hasHidden (decl_node n);
+EXTERN bool decl_hasHidden (decl_node n);
/*
isVar - returns TRUE if node, n, is a type.
*/
-EXTERN unsigned int decl_isVar (decl_node n);
+EXTERN bool decl_isVar (decl_node n);
/*
isTemporary - returns TRUE if node, n, is a variable and temporary.
*/
-EXTERN unsigned int decl_isTemporary (decl_node n);
+EXTERN bool decl_isTemporary (decl_node n);
/*
isExported - returns TRUE if symbol, n, is exported from
the definition module.
*/
-EXTERN unsigned int decl_isExported (decl_node n);
+EXTERN bool decl_isExported (decl_node n);
/*
getDeclScope - returns the node representing the
isLiteral - returns TRUE if, n, is a literal.
*/
-EXTERN unsigned int decl_isLiteral (decl_node n);
+EXTERN bool decl_isLiteral (decl_node n);
/*
isConstSet - returns TRUE if, n, is a constant set.
*/
-EXTERN unsigned int decl_isConstSet (decl_node n);
+EXTERN bool decl_isConstSet (decl_node n);
/*
isEnumerationField - returns TRUE if, n, is an enumeration field.
*/
-EXTERN unsigned int decl_isEnumerationField (decl_node n);
+EXTERN bool decl_isEnumerationField (decl_node n);
/*
isEnumeration - returns TRUE if node, n, is an enumeration type.
*/
-EXTERN unsigned int decl_isEnumeration (decl_node n);
+EXTERN bool decl_isEnumeration (decl_node n);
/*
isUnbounded - returns TRUE if, n, is an unbounded array.
*/
-EXTERN unsigned int decl_isUnbounded (decl_node n);
+EXTERN bool decl_isUnbounded (decl_node n);
/*
isParameter - returns TRUE if, n, is a parameter.
*/
-EXTERN unsigned int decl_isParameter (decl_node n);
+EXTERN bool decl_isParameter (decl_node n);
/*
isVarParam - returns TRUE if, n, is a var parameter.
*/
-EXTERN unsigned int decl_isVarParam (decl_node n);
+EXTERN bool decl_isVarParam (decl_node n);
/*
isParam - returns TRUE if, n, is a non var parameter.
*/
-EXTERN unsigned int decl_isParam (decl_node n);
+EXTERN bool decl_isParam (decl_node n);
/*
isNonVarParam - is an alias to isParam.
*/
-EXTERN unsigned int decl_isNonVarParam (decl_node n);
+EXTERN bool decl_isNonVarParam (decl_node n);
/*
addOptParameter - returns an optarg which has been created and added to
isOptarg - returns TRUE if, n, is an optarg.
*/
-EXTERN unsigned int decl_isOptarg (decl_node n);
+EXTERN bool decl_isOptarg (decl_node n);
/*
isRecord - returns TRUE if, n, is a record.
*/
-EXTERN unsigned int decl_isRecord (decl_node n);
+EXTERN bool decl_isRecord (decl_node n);
/*
isRecordField - returns TRUE if, n, is a record field.
*/
-EXTERN unsigned int decl_isRecordField (decl_node n);
+EXTERN bool decl_isRecordField (decl_node n);
/*
isVarientField - returns TRUE if, n, is a varient field.
*/
-EXTERN unsigned int decl_isVarientField (decl_node n);
+EXTERN bool decl_isVarientField (decl_node n);
/*
isArray - returns TRUE if, n, is an array.
*/
-EXTERN unsigned int decl_isArray (decl_node n);
+EXTERN bool decl_isArray (decl_node n);
/*
isProcType - returns TRUE if, n, is a procedure type.
*/
-EXTERN unsigned int decl_isProcType (decl_node n);
+EXTERN bool decl_isProcType (decl_node n);
/*
isPointer - returns TRUE if, n, is a pointer.
*/
-EXTERN unsigned int decl_isPointer (decl_node n);
+EXTERN bool decl_isPointer (decl_node n);
/*
isProcedure - returns TRUE if, n, is a procedure.
*/
-EXTERN unsigned int decl_isProcedure (decl_node n);
+EXTERN bool decl_isProcedure (decl_node n);
/*
isVarient - returns TRUE if, n, is a varient record.
*/
-EXTERN unsigned int decl_isVarient (decl_node n);
+EXTERN bool decl_isVarient (decl_node n);
/*
isSet - returns TRUE if, n, is a set type.
*/
-EXTERN unsigned int decl_isSet (decl_node n);
+EXTERN bool decl_isSet (decl_node n);
/*
isSubrange - returns TRUE if, n, is a subrange type.
*/
-EXTERN unsigned int decl_isSubrange (decl_node n);
+EXTERN bool decl_isSubrange (decl_node n);
/*
isZtype - returns TRUE if, n, is the Z type.
*/
-EXTERN unsigned int decl_isZtype (decl_node n);
+EXTERN bool decl_isZtype (decl_node n);
/*
isRtype - returns TRUE if, n, is the R type.
*/
-EXTERN unsigned int decl_isRtype (decl_node n);
+EXTERN bool decl_isRtype (decl_node n);
/*
makeConst - create, initialise and return a const node.
module, m, scope.
*/
-EXTERN void decl_addImportedModule (decl_node m, decl_node i, unsigned int scoped);
+EXTERN void decl_addImportedModule (decl_node m, decl_node i, bool scoped);
/*
setSource - sets the source filename for module, n, to s.
Where the parameters are declared as l: type.
*/
-EXTERN decl_node decl_makeVarParameter (decl_node l, decl_node type, decl_node proc, unsigned int isused);
+EXTERN decl_node decl_makeVarParameter (decl_node l, decl_node type, decl_node proc, bool isused);
/*
makeNonVarParameter - returns a non var parameter node with namelist and type.
Where the parameters are declared as l: type.
*/
-EXTERN decl_node decl_makeNonVarParameter (decl_node l, decl_node type, decl_node proc, unsigned int isused);
+EXTERN decl_node decl_makeNonVarParameter (decl_node l, decl_node type, decl_node proc, bool isused);
/*
paramEnter - reset the parameter count.
putIdent - places ident, i, into identlist, n.
*/
-EXTERN unsigned int decl_putIdent (decl_node n, nameKey_Name i);
+EXTERN bool decl_putIdent (decl_node n, nameKey_Name i);
/*
addVarParameters - adds the identlist, i, of, type, to be VAR parameters
in procedure, n.
*/
-EXTERN void decl_addVarParameters (decl_node n, decl_node i, decl_node type, unsigned int isused);
+EXTERN void decl_addVarParameters (decl_node n, decl_node i, decl_node type, bool isused);
/*
addNonVarParameters - adds the identlist, i, of, type, to be parameters
in procedure, n.
*/
-EXTERN void decl_addNonVarParameters (decl_node n, decl_node i, decl_node type, unsigned int isused);
+EXTERN void decl_addNonVarParameters (decl_node n, decl_node i, decl_node type, bool isused);
/*
makeVarargs - returns a varargs node.
isVarargs - returns TRUE if, n, is a varargs node.
*/
-EXTERN unsigned int decl_isVarargs (decl_node n);
+EXTERN bool decl_isVarargs (decl_node n);
/*
addParameter - adds a parameter, param, to procedure or proctype, proc.
isPointerRef - returns TRUE if, n, is a pointerref node.
*/
-EXTERN unsigned int decl_isPointerRef (decl_node n);
+EXTERN bool decl_isPointerRef (decl_node n);
/*
makeDeRef - dereferences the pointer defined by, n.
isSetValue - returns TRUE if, n, is a setvalue node.
*/
-EXTERN unsigned int decl_isSetValue (decl_node n);
+EXTERN bool decl_isSetValue (decl_node n);
/*
putSetValue - assigns the type, t, to the set value, n. The
isExpList - returns TRUE if, n, is an explist node.
*/
-EXTERN unsigned int decl_isExpList (decl_node n);
+EXTERN bool decl_isExpList (decl_node n);
/*
putExpList - places, expression, e, within the explist, n.
isStatementSequence - returns TRUE if node, n, is a statement sequence.
*/
-EXTERN unsigned int decl_isStatementSequence (decl_node n);
+EXTERN bool decl_isStatementSequence (decl_node n);
/*
addStatement - adds node, n, as a statement to statememt sequence, s.
isReturn - returns TRUE if node, n, is a return.
*/
-EXTERN unsigned int decl_isReturn (decl_node n);
+EXTERN bool decl_isReturn (decl_node n);
/*
putReturn - assigns node, e, as the expression on the return node.
isWhile - returns TRUE if node, n, is a while.
*/
-EXTERN unsigned int decl_isWhile (decl_node n);
+EXTERN bool decl_isWhile (decl_node n);
/*
addWhileDoComment - adds body and after comments to while node, w.
isExit - returns TRUE if node, n, is an exit.
*/
-EXTERN unsigned int decl_isExit (decl_node n);
+EXTERN bool decl_isExit (decl_node n);
/*
makeLoop - creates and returns a loop node.
isLoop - returns TRUE if, n, is a loop node.
*/
-EXTERN unsigned int decl_isLoop (decl_node n);
+EXTERN bool decl_isLoop (decl_node n);
/*
putLoop - places statement sequence, s, into loop, l.
isIf - returns TRUE if, n, is an if node.
*/
-EXTERN unsigned int decl_isIf (decl_node n);
+EXTERN bool decl_isIf (decl_node n);
/*
makeElsif - creates and returns an elsif node.
isElsif - returns TRUE if node, n, is an elsif node.
*/
-EXTERN unsigned int decl_isElsif (decl_node n);
+EXTERN bool decl_isElsif (decl_node n);
/*
putElse - the else is grafted onto the if/elsif node, i,
isFor - returns TRUE if node, n, is a for node.
*/
-EXTERN unsigned int decl_isFor (decl_node n);
+EXTERN bool decl_isFor (decl_node n);
/*
putFor - assigns the fields of the for node with
isRepeat - returns TRUE if node, n, is a repeat node.
*/
-EXTERN unsigned int decl_isRepeat (decl_node n);
+EXTERN bool decl_isRepeat (decl_node n);
/*
putRepeat - places statements, s, and expression, e, into
isCase - returns TRUE if node, n, is a case statement.
*/
-EXTERN unsigned int decl_isCase (decl_node n);
+EXTERN bool decl_isCase (decl_node n);
/*
putCaseExpression - places expression, e, into case statement, n.
isCaseLabelList - returns TRUE if, n, is a caselabellist.
*/
-EXTERN unsigned int decl_isCaseLabelList (decl_node n);
+EXTERN bool decl_isCaseLabelList (decl_node n);
/*
makeCaseList - creates and returns a case statement node.
isCaseList - returns TRUE if, n, is a case list.
*/
-EXTERN unsigned int decl_isCaseList (decl_node n);
+EXTERN bool decl_isCaseList (decl_node n);
/*
putCaseRange - places the case range lo..hi into caselist, n.
isRange - returns TRUE if node, n, is a range.
*/
-EXTERN unsigned int decl_isRange (decl_node n);
+EXTERN bool decl_isRange (decl_node n);
/*
setNoReturn - sets noreturn field inside procedure.
*/
-EXTERN void decl_setNoReturn (decl_node n, unsigned int value);
+EXTERN void decl_setNoReturn (decl_node n, bool value);
/*
dupExpr - duplicate the expression nodes, it does not duplicate
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
error to TRUE if the number is too large.
*/
-EXTERN double dtoa_strtod (void * s, unsigned int *error);
+EXTERN double dtoa_strtod (void * s, bool *error);
/*
dtoa - converts a REAL, d, into a string. The address of the
sign does the string have a sign?
*/
-EXTERN void * dtoa_dtoa (double d, dtoa_Mode mode, int ndigits, int *decpt, unsigned int *sign);
+EXTERN void * dtoa_dtoa (double d, dtoa_Mode mode, int ndigits, int *decpt, bool *sign);
# ifdef __cplusplus
}
# endif
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
static keyc_scope freeList;
static symbolKey_symbolTree keywords;
static symbolKey_symbolTree macros;
-static unsigned int initializedCP;
-static unsigned int initializedGCC;
-static unsigned int seenIntMin;
-static unsigned int seenUIntMin;
-static unsigned int seenLongMin;
-static unsigned int seenULongMin;
-static unsigned int seenCharMin;
-static unsigned int seenUCharMin;
-static unsigned int seenIntMax;
-static unsigned int seenUIntMax;
-static unsigned int seenLongMax;
-static unsigned int seenULongMax;
-static unsigned int seenCharMax;
-static unsigned int seenUCharMax;
-static unsigned int seenLabs;
-static unsigned int seenAbs;
-static unsigned int seenFabs;
-static unsigned int seenFabsl;
-static unsigned int seenSize_t;
-static unsigned int seenSSize_t;
-static unsigned int seenUnistd;
-static unsigned int seenSysTypes;
-static unsigned int seenThrow;
-static unsigned int seenFree;
-static unsigned int seenMalloc;
-static unsigned int seenStorage;
-static unsigned int seenProc;
-static unsigned int seenTrue;
-static unsigned int seenFalse;
-static unsigned int seenNull;
-static unsigned int seenMemcpy;
-static unsigned int seenException;
-static unsigned int seenComplex;
-static unsigned int seenM2RTS;
-static unsigned int seenStrlen;
-static unsigned int seenCtype;
+static bool initializedCP;
+static bool initializedGCC;
+static bool seenIntMin;
+static bool seenUIntMin;
+static bool seenLongMin;
+static bool seenULongMin;
+static bool seenCharMin;
+static bool seenUCharMin;
+static bool seenIntMax;
+static bool seenUIntMax;
+static bool seenLongMax;
+static bool seenULongMax;
+static bool seenCharMax;
+static bool seenUCharMax;
+static bool seenLabs;
+static bool seenAbs;
+static bool seenFabs;
+static bool seenFabsl;
+static bool seenSize_t;
+static bool seenSSize_t;
+static bool seenUnistd;
+static bool seenSysTypes;
+static bool seenThrow;
+static bool seenFree;
+static bool seenMalloc;
+static bool seenStorage;
+static bool seenProc;
+static bool seenTrue;
+static bool seenFalse;
+static bool seenNull;
+static bool seenMemcpy;
+static bool seenException;
+static bool seenComplex;
+static bool seenM2RTS;
+static bool seenStrlen;
+static bool seenCtype;
/*
useUnistd - need to use unistd.h call using open/close/read/write require this header.
is ignored).
*/
-extern "C" DynamicStrings_String keyc_cname (nameKey_Name n, unsigned int scopes);
+extern "C" DynamicStrings_String keyc_cname (nameKey_Name n, bool scopes);
/*
cnamen - attempts to declare a symbol with name, n, in the
is ignored).
*/
-extern "C" nameKey_Name keyc_cnamen (nameKey_Name n, unsigned int scopes);
+extern "C" nameKey_Name keyc_cnamen (nameKey_Name n, bool scopes);
/*
cp - include C++ keywords and standard declarations to avoid.
static void fixNullPointerConst (mcPretty_pretty p);
+/*
+ genBool -
+*/
+
+static void genBool (mcPretty_pretty p);
+
/*
new -
*/
to its end.
*/
-static unsigned int mangle1 (nameKey_Name n, DynamicStrings_String *m, unsigned int scopes);
+static bool mangle1 (nameKey_Name n, DynamicStrings_String *m, bool scopes);
/*
mangle2 - returns TRUE if name is unique if we prepend _
to, n.
*/
-static unsigned int mangle2 (nameKey_Name n, DynamicStrings_String *m, unsigned int scopes);
+static bool mangle2 (nameKey_Name n, DynamicStrings_String *m, bool scopes);
/*
mangleN - keep adding '_' to the end of n until it
no longer clashes.
*/
-static unsigned int mangleN (nameKey_Name n, DynamicStrings_String *m, unsigned int scopes);
+static bool mangleN (nameKey_Name n, DynamicStrings_String *m, bool scopes);
/*
clash - returns TRUE if there is a clash with name, n,
in the current scope or C keywords or C macros.
*/
-static unsigned int clash (nameKey_Name n, unsigned int scopes);
+static bool clash (nameKey_Name n, bool scopes);
/*
initCP - add the extra keywords and standard definitions used by C++.
{
if (! initializedGCC)
{
- initializedGCC = TRUE;
+ initializedGCC = true;
mcPretty_print (p, (const char *) "#include \"config.h\"\\n", 21);
mcPretty_print (p, (const char *) "#include \"system.h\"\\n", 21);
}
}
+/*
+ genBool -
+*/
+
+static void genBool (mcPretty_pretty p)
+{
+ if (mcOptions_useBool ())
+ {
+ mcPretty_print (p, (const char *) "#include <stdbool.h>\\n", 22);
+ }
+}
+
+
/*
new -
*/
to its end.
*/
-static unsigned int mangle1 (nameKey_Name n, DynamicStrings_String *m, unsigned int scopes)
+static bool mangle1 (nameKey_Name n, DynamicStrings_String *m, bool scopes)
{
(*m) = DynamicStrings_KillString ((*m));
(*m) = DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (n));
to, n.
*/
-static unsigned int mangle2 (nameKey_Name n, DynamicStrings_String *m, unsigned int scopes)
+static bool mangle2 (nameKey_Name n, DynamicStrings_String *m, bool scopes)
{
(*m) = DynamicStrings_KillString ((*m));
(*m) = DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (n));
no longer clashes.
*/
-static unsigned int mangleN (nameKey_Name n, DynamicStrings_String *m, unsigned int scopes)
+static bool mangleN (nameKey_Name n, DynamicStrings_String *m, bool scopes)
{
(*m) = DynamicStrings_KillString ((*m));
(*m) = DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (n));
(*m) = DynamicStrings_ConCatChar ((*m), '_');
if (! (clash (nameKey_makekey (DynamicStrings_string ((*m))), scopes)))
{
- return TRUE;
+ return true;
}
}
ReturnException ("../../gcc-read-write/gcc/m2/mc/keyc.def", 20, 1);
in the current scope or C keywords or C macros.
*/
-static unsigned int clash (nameKey_Name n, unsigned int scopes)
+static bool clash (nameKey_Name n, bool scopes)
{
if (((symbolKey_getSymKey (macros, n)) != NULL) || ((symbolKey_getSymKey (keywords, n)) != NULL))
{
- return TRUE;
+ return true;
}
return scopes && ((symbolKey_getSymKey (stack->symbols, n)) != NULL);
/* static analysis guarentees a RETURN statement will be used before here. */
static void init (void)
{
- seenUnistd = FALSE;
- seenThrow = FALSE;
- seenFree = FALSE;
- seenMalloc = FALSE;
- seenStorage = FALSE;
- seenProc = FALSE;
- seenTrue = FALSE;
- seenFalse = FALSE;
- seenNull = FALSE;
- seenMemcpy = FALSE;
- seenIntMin = FALSE;
- seenUIntMin = FALSE;
- seenLongMin = FALSE;
- seenULongMin = FALSE;
- seenCharMin = FALSE;
- seenUCharMin = FALSE;
- seenIntMax = FALSE;
- seenUIntMax = FALSE;
- seenLongMax = FALSE;
- seenULongMax = FALSE;
- seenCharMax = FALSE;
- seenUCharMax = FALSE;
- seenLabs = FALSE;
- seenAbs = FALSE;
- seenFabs = FALSE;
- seenFabsl = FALSE;
- seenException = FALSE;
- seenComplex = FALSE;
- seenM2RTS = FALSE;
- seenStrlen = FALSE;
- seenCtype = FALSE;
- seenSize_t = FALSE;
- seenSSize_t = FALSE;
- seenSysTypes = FALSE;
- initializedCP = FALSE;
- initializedGCC = FALSE;
+ seenUnistd = false;
+ seenThrow = false;
+ seenFree = false;
+ seenMalloc = false;
+ seenStorage = false;
+ seenProc = false;
+ seenTrue = false;
+ seenFalse = false;
+ seenNull = false;
+ seenMemcpy = false;
+ seenIntMin = false;
+ seenUIntMin = false;
+ seenLongMin = false;
+ seenULongMin = false;
+ seenCharMin = false;
+ seenUCharMin = false;
+ seenIntMax = false;
+ seenUIntMax = false;
+ seenLongMax = false;
+ seenULongMax = false;
+ seenCharMax = false;
+ seenUCharMax = false;
+ seenLabs = false;
+ seenAbs = false;
+ seenFabs = false;
+ seenFabsl = false;
+ seenException = false;
+ seenComplex = false;
+ seenM2RTS = false;
+ seenStrlen = false;
+ seenCtype = false;
+ seenSize_t = false;
+ seenSSize_t = false;
+ seenSysTypes = false;
+ initializedCP = false;
+ initializedGCC = false;
stack = NULL;
freeList = NULL;
initKeywords ();
extern "C" void keyc_useUnistd (void)
{
- seenUnistd = TRUE;
+ seenUnistd = true;
}
extern "C" void keyc_useThrow (void)
{
- seenThrow = TRUE;
+ seenThrow = true;
}
extern "C" void keyc_useStorage (void)
{
- seenStorage = TRUE;
+ seenStorage = true;
}
extern "C" void keyc_useFree (void)
{
- seenFree = TRUE;
+ seenFree = true;
}
extern "C" void keyc_useMalloc (void)
{
- seenMalloc = TRUE;
+ seenMalloc = true;
}
extern "C" void keyc_useProc (void)
{
- seenProc = TRUE;
+ seenProc = true;
}
extern "C" void keyc_useTrue (void)
{
- seenTrue = TRUE;
+ seenTrue = true;
}
extern "C" void keyc_useFalse (void)
{
- seenFalse = TRUE;
+ seenFalse = true;
}
extern "C" void keyc_useNull (void)
{
- seenNull = TRUE;
+ seenNull = true;
}
extern "C" void keyc_useMemcpy (void)
{
- seenMemcpy = TRUE;
+ seenMemcpy = true;
}
extern "C" void keyc_useIntMin (void)
{
- seenIntMin = TRUE;
+ seenIntMin = true;
}
extern "C" void keyc_useUIntMin (void)
{
- seenUIntMin = TRUE;
+ seenUIntMin = true;
}
extern "C" void keyc_useLongMin (void)
{
- seenLongMin = TRUE;
+ seenLongMin = true;
}
extern "C" void keyc_useULongMin (void)
{
- seenULongMin = TRUE;
+ seenULongMin = true;
}
extern "C" void keyc_useCharMin (void)
{
- seenCharMin = TRUE;
+ seenCharMin = true;
}
extern "C" void keyc_useUCharMin (void)
{
- seenUCharMin = TRUE;
+ seenUCharMin = true;
}
extern "C" void keyc_useIntMax (void)
{
- seenIntMax = TRUE;
+ seenIntMax = true;
}
extern "C" void keyc_useUIntMax (void)
{
- seenUIntMax = TRUE;
+ seenUIntMax = true;
}
extern "C" void keyc_useLongMax (void)
{
- seenLongMax = TRUE;
+ seenLongMax = true;
}
extern "C" void keyc_useULongMax (void)
{
- seenULongMax = TRUE;
+ seenULongMax = true;
}
extern "C" void keyc_useCharMax (void)
{
- seenCharMax = TRUE;
+ seenCharMax = true;
}
extern "C" void keyc_useUCharMax (void)
{
- seenUCharMax = TRUE;
+ seenUCharMax = true;
}
extern "C" void keyc_useSize_t (void)
{
- seenSize_t = TRUE;
+ seenSize_t = true;
}
extern "C" void keyc_useSSize_t (void)
{
- seenSSize_t = TRUE;
- seenSysTypes = TRUE;
+ seenSSize_t = true;
+ seenSysTypes = true;
}
extern "C" void keyc_useLabs (void)
{
- seenLabs = TRUE;
+ seenLabs = true;
}
extern "C" void keyc_useAbs (void)
{
- seenAbs = TRUE;
+ seenAbs = true;
}
extern "C" void keyc_useFabs (void)
{
- seenFabs = TRUE;
+ seenFabs = true;
}
extern "C" void keyc_useFabsl (void)
{
- seenFabsl = TRUE;
+ seenFabsl = true;
}
extern "C" void keyc_useException (void)
{
- seenException = TRUE;
+ seenException = true;
}
extern "C" void keyc_useComplex (void)
{
- seenComplex = TRUE;
+ seenComplex = true;
}
extern "C" void keyc_useM2RTS (void)
{
- seenM2RTS = TRUE;
+ seenM2RTS = true;
}
extern "C" void keyc_useStrlen (void)
{
- seenStrlen = TRUE;
+ seenStrlen = true;
}
extern "C" void keyc_useCtype (void)
{
- seenCtype = TRUE;
+ seenCtype = true;
}
extern "C" void keyc_genDefs (mcPretty_pretty p)
{
+ genBool (p);
checkFreeMalloc (p);
checkProc (p);
checkTrue (p);
is ignored).
*/
-extern "C" DynamicStrings_String keyc_cname (nameKey_Name n, unsigned int scopes)
+extern "C" DynamicStrings_String keyc_cname (nameKey_Name n, bool scopes)
{
DynamicStrings_String m;
is ignored).
*/
-extern "C" nameKey_Name keyc_cnamen (nameKey_Name n, unsigned int scopes)
+extern "C" nameKey_Name keyc_cnamen (nameKey_Name n, bool scopes)
{
DynamicStrings_String m;
{
if (! initializedCP)
{
- initializedCP = TRUE;
+ initializedCP = true;
initCP ();
}
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
is ignored).
*/
-EXTERN DynamicStrings_String keyc_cname (nameKey_Name n, unsigned int scopes);
+EXTERN DynamicStrings_String keyc_cname (nameKey_Name n, bool scopes);
/*
cnamen - attempts to declare a symbol with name, n, in the
is ignored).
*/
-EXTERN nameKey_Name keyc_cnamen (nameKey_Name n, unsigned int scopes);
+EXTERN nameKey_Name keyc_cnamen (nameKey_Name n, bool scopes);
/*
cp - include C++ keywords and standard declarations to avoid.
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
error to TRUE if the number is too large or badly formed.
*/
-EXTERN long double ldtoa_strtold (void * s, unsigned int *error);
+EXTERN long double ldtoa_strtold (void * s, bool *error);
/*
ldtoa - converts a LONGREAL, d, into a string. The address of the
sign does the string have a sign?
*/
-EXTERN void * ldtoa_ldtoa (long double d, ldtoa_Mode mode, int ndigits, int *decpt, unsigned int *sign);
+EXTERN void * ldtoa_ldtoa (long double d, ldtoa_Mode mode, int ndigits, int *decpt, bool *sign);
# ifdef __cplusplus
}
# endif
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
isItemInList - returns true if a ADDRESS, c, was found in list, l.
*/
-extern "C" unsigned int lists_isItemInList (lists_list l, void * c);
+extern "C" bool lists_isItemInList (lists_list l, void * c);
/*
foreachItemInListDo - calls procedure, P, foreach item in list, l.
{
lists_list p;
unsigned int i;
- unsigned int found;
+ bool found;
if (l != NULL)
{
- found = FALSE;
+ found = false;
p = NULL;
do {
i = 1;
}
if ((i <= l->noOfelements) && (l->elements.array[i-1] == c))
{
- found = TRUE;
+ found = true;
}
else
{
isItemInList - returns true if a ADDRESS, c, was found in list, l.
*/
-extern "C" unsigned int lists_isItemInList (lists_list l, void * c)
+extern "C" bool lists_isItemInList (lists_list l, void * c)
{
unsigned int i;
{
if (l->elements.array[i-1] == c)
{
- return TRUE;
+ return true;
}
else
{
}
l = l->next;
} while (! (l == NULL));
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
isItemInList - returns true if a ADDRESS, c, was found in list, l.
*/
-EXTERN unsigned int lists_isItemInList (lists_list l, void * c);
+EXTERN bool lists_isItemInList (lists_list l, void * c);
/*
foreachItemInListDo - calls procedure, P, foreach item in list, l.
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
mcComment_commentType type;
DynamicStrings_String content;
nameKey_Name procName;
- unsigned int used;
+ bool used;
};
spaces on this line.
*/
-extern "C" mcComment_commentDesc mcComment_initComment (unsigned int onlySpaces);
+extern "C" mcComment_commentDesc mcComment_initComment (bool onlySpaces);
/*
addText - cs is a C string (null terminated) which contains comment text.
isProcedureComment - returns TRUE if, cd, is a procedure comment.
*/
-extern "C" unsigned int mcComment_isProcedureComment (mcComment_commentDesc cd);
+extern "C" bool mcComment_isProcedureComment (mcComment_commentDesc cd);
/*
isBodyComment - returns TRUE if, cd, is a body comment.
*/
-extern "C" unsigned int mcComment_isBodyComment (mcComment_commentDesc cd);
+extern "C" bool mcComment_isBodyComment (mcComment_commentDesc cd);
/*
isAfterComment - returns TRUE if, cd, is an after comment.
*/
-extern "C" unsigned int mcComment_isAfterComment (mcComment_commentDesc cd);
+extern "C" bool mcComment_isAfterComment (mcComment_commentDesc cd);
/*
Min - returns the lower of, a, and, b.
in the comment.
*/
-static unsigned int seenProcedure (mcComment_commentDesc cd, nameKey_Name procName);
+static bool seenProcedure (mcComment_commentDesc cd, nameKey_Name procName);
/*
dumpComment -
in the comment.
*/
-static unsigned int seenProcedure (mcComment_commentDesc cd, nameKey_Name procName)
+static bool seenProcedure (mcComment_commentDesc cd, nameKey_Name procName)
{
DynamicStrings_String s;
void * a;
unsigned int i;
unsigned int h;
- unsigned int res;
+ bool res;
a = nameKey_keyToCharStar (procName);
s = RemoveNewlines (cd->content);
spaces on this line.
*/
-extern "C" mcComment_commentDesc mcComment_initComment (unsigned int onlySpaces)
+extern "C" mcComment_commentDesc mcComment_initComment (bool onlySpaces)
{
mcComment_commentDesc cd;
}
cd->content = DynamicStrings_InitString ((const char *) "", 0);
cd->procName = nameKey_NulName;
- cd->used = FALSE;
+ cd->used = false;
return cd;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
{
if ((cd->type == mcComment_procedureHeading) && ! cd->used)
{
- cd->used = TRUE;
+ cd->used = true;
return cd->content;
}
return static_cast<DynamicStrings_String> (NULL);
{
if ((cd->type == mcComment_afterStatement) && ! cd->used)
{
- cd->used = TRUE;
+ cd->used = true;
return cd->content;
}
return static_cast<DynamicStrings_String> (NULL);
{
if ((cd->type == mcComment_inBody) && ! cd->used)
{
- cd->used = TRUE;
+ cd->used = true;
return cd->content;
}
return static_cast<DynamicStrings_String> (NULL);
isProcedureComment - returns TRUE if, cd, is a procedure comment.
*/
-extern "C" unsigned int mcComment_isProcedureComment (mcComment_commentDesc cd)
+extern "C" bool mcComment_isProcedureComment (mcComment_commentDesc cd)
{
return (cd != NULL) && (cd->type == mcComment_procedureHeading);
/* static analysis guarentees a RETURN statement will be used before here. */
isBodyComment - returns TRUE if, cd, is a body comment.
*/
-extern "C" unsigned int mcComment_isBodyComment (mcComment_commentDesc cd)
+extern "C" bool mcComment_isBodyComment (mcComment_commentDesc cd)
{
return (cd != NULL) && (cd->type == mcComment_inBody);
/* static analysis guarentees a RETURN statement will be used before here. */
isAfterComment - returns TRUE if, cd, is an after comment.
*/
-extern "C" unsigned int mcComment_isAfterComment (mcComment_commentDesc cd)
+extern "C" bool mcComment_isAfterComment (mcComment_commentDesc cd)
{
return (cd != NULL) && (cd->type == mcComment_afterStatement);
/* static analysis guarentees a RETURN statement will be used before here. */
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
If onlySpaces is FALSE then an after statement comment is created.
*/
-EXTERN mcComment_commentDesc mcComment_initComment (unsigned int onlySpaces);
+EXTERN mcComment_commentDesc mcComment_initComment (bool onlySpaces);
/*
addText - cs is a C string (null terminated) which contains comment text.
isProcedureComment - returns TRUE if, cd, is a procedure comment.
*/
-EXTERN unsigned int mcComment_isProcedureComment (mcComment_commentDesc cd);
+EXTERN bool mcComment_isProcedureComment (mcComment_commentDesc cd);
/*
isBodyComment - returns TRUE if, cd, is a body comment.
*/
-EXTERN unsigned int mcComment_isBodyComment (mcComment_commentDesc cd);
+EXTERN bool mcComment_isBodyComment (mcComment_commentDesc cd);
/*
isAfterComment - returns TRUE if, cd, is an after comment.
*/
-EXTERN unsigned int mcComment_isAfterComment (mcComment_commentDesc cd);
+EXTERN bool mcComment_isAfterComment (mcComment_commentDesc cd);
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# include "GDynamicStrings.h"
# include "GmcOptions.h"
-# define Debugging FALSE
+# define Debugging false
typedef struct mcComp_parserFunction_p mcComp_parserFunction;
typedef struct mcComp_openFunction_p mcComp_openFunction;
-typedef unsigned int (*mcComp_parserFunction_t) (void);
+typedef bool (*mcComp_parserFunction_t) (void);
struct mcComp_parserFunction_p { mcComp_parserFunction_t proc; };
-typedef unsigned int (*mcComp_openFunction_t) (decl_node, unsigned int);
+typedef bool (*mcComp_openFunction_t) (decl_node, bool);
struct mcComp_openFunction_p { mcComp_openFunction_t proc; };
static unsigned int currentPass;
doOpen -
*/
-static unsigned int doOpen (decl_node n, DynamicStrings_String symName, DynamicStrings_String fileName, unsigned int exitOnFailure);
+static bool doOpen (decl_node n, DynamicStrings_String symName, DynamicStrings_String fileName, bool exitOnFailure);
/*
openDef - try and open the definition module source file.
exitOnFailure.
*/
-static unsigned int openDef (decl_node n, unsigned int exitOnFailure);
+static bool openDef (decl_node n, bool exitOnFailure);
/*
openMod - try and open the implementation/program module source file.
exitOnFailure.
*/
-static unsigned int openMod (decl_node n, unsigned int exitOnFailure);
+static bool openMod (decl_node n, bool exitOnFailure);
/*
pass -
doPass -
*/
-static void doPass (unsigned int parseDefs, unsigned int parseMain, unsigned int no, symbolKey_performOperation p, const char *desc_, unsigned int _desc_high);
+static void doPass (bool parseDefs, bool parseMain, unsigned int no, symbolKey_performOperation p, const char *desc_, unsigned int _desc_high);
/*
setToPassNo -
decl_node n;
n = initParser (s);
- doPass (TRUE, TRUE, 1, (symbolKey_performOperation) {(symbolKey_performOperation_t) p1}, (const char *) "lexical analysis, modules, root decls and C preprocessor", 56);
- doPass (TRUE, TRUE, 2, (symbolKey_performOperation) {(symbolKey_performOperation_t) p2}, (const char *) "[all modules] type equivalence and enumeration types", 52);
- doPass (TRUE, TRUE, 3, (symbolKey_performOperation) {(symbolKey_performOperation_t) p3}, (const char *) "[all modules] import lists, types, variables and procedure declarations", 71);
- doPass (TRUE, TRUE, 4, (symbolKey_performOperation) {(symbolKey_performOperation_t) p4}, (const char *) "[all modules] constant expressions", 34);
+ doPass (true, true, 1, (symbolKey_performOperation) {(symbolKey_performOperation_t) p1}, (const char *) "lexical analysis, modules, root decls and C preprocessor", 56);
+ doPass (true, true, 2, (symbolKey_performOperation) {(symbolKey_performOperation_t) p2}, (const char *) "[all modules] type equivalence and enumeration types", 52);
+ doPass (true, true, 3, (symbolKey_performOperation) {(symbolKey_performOperation_t) p3}, (const char *) "[all modules] import lists, types, variables and procedure declarations", 71);
+ doPass (true, true, 4, (symbolKey_performOperation) {(symbolKey_performOperation_t) p4}, (const char *) "[all modules] constant expressions", 34);
if (! (decl_isDef (n)))
{
/* avoid gcc warning by using compound statement even if not strictly necessary. */
if (decl_isImp (n))
{
mcQuiet_qprintf0 ((const char *) "Parse implementation module\\n", 29);
- doPass (FALSE, TRUE, 5, (symbolKey_performOperation) {(symbolKey_performOperation_t) p5}, (const char *) "[implementation module] build code tree for all procedures and module initializations", 85);
+ doPass (false, true, 5, (symbolKey_performOperation) {(symbolKey_performOperation_t) p5}, (const char *) "[implementation module] build code tree for all procedures and module initializations", 85);
}
else
{
mcQuiet_qprintf0 ((const char *) "Parse program module\\n", 22);
- doPass (FALSE, TRUE, 5, (symbolKey_performOperation) {(symbolKey_performOperation_t) p5}, (const char *) "[program module] build code tree for all procedures and module initializations", 78);
+ doPass (false, true, 5, (symbolKey_performOperation) {(symbolKey_performOperation_t) p5}, (const char *) "[program module] build code tree for all procedures and module initializations", 78);
}
}
mcQuiet_qprintf0 ((const char *) "walk tree converting it to C/C++\\n", 34);
doOpen -
*/
-static unsigned int doOpen (decl_node n, DynamicStrings_String symName, DynamicStrings_String fileName, unsigned int exitOnFailure)
+static bool doOpen (decl_node n, DynamicStrings_String symName, DynamicStrings_String fileName, bool exitOnFailure)
{
DynamicStrings_String postProcessed;
decl_setCurrentModule (n);
if (mcLexBuf_openSource (postProcessed))
{
- return TRUE;
+ return true;
}
mcPrintf_fprintf1 (FIO_StdErr, (const char *) "failed to open %s\\n", 19, (const unsigned char *) &fileName, (sizeof (fileName)-1));
if (exitOnFailure)
{
libc_exit (1);
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
exitOnFailure.
*/
-static unsigned int openDef (decl_node n, unsigned int exitOnFailure)
+static bool openDef (decl_node n, bool exitOnFailure)
{
nameKey_Name sourceName;
DynamicStrings_String symName;
exitOnFailure.
*/
-static unsigned int openMod (decl_node n, unsigned int exitOnFailure)
+static bool openMod (decl_node n, bool exitOnFailure)
{
nameKey_Name sourceName;
DynamicStrings_String symName;
if (((*isnode.proc) (n)) && (! (decl_isVisited (n))))
{
decl_setVisited (n);
- if ((*open.proc) (n, TRUE))
+ if ((*open.proc) (n, true))
{
if (! ((*f.proc) ()))
{
doPass -
*/
-static void doPass (unsigned int parseDefs, unsigned int parseMain, unsigned int no, symbolKey_performOperation p, const char *desc_, unsigned int _desc_high)
+static void doPass (bool parseDefs, bool parseMain, unsigned int no, symbolKey_performOperation p, const char *desc_, unsigned int _desc_high)
{
DynamicStrings_String descs;
char desc[_desc_high+1];
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
and the execution is terminated.
*/
-extern "C" void mcDebug_assert (unsigned int q);
+extern "C" void mcDebug_assert (bool q);
/*
writeDebug - only writes a string if internal debugging is on.
and the execution is terminated.
*/
-extern "C" void mcDebug_assert (unsigned int q)
+extern "C" void mcDebug_assert (bool q)
{
if (! q)
{
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
and the execution is terminated.
*/
-EXTERN void mcDebug_assert (unsigned int q);
+EXTERN void mcDebug_assert (bool q);
/*
writeDebug - only writes a string if the debugging mode is on.
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# include "GmcLexBuf.h"
# include "GmcPrintf.h"
-# define Debugging TRUE
-# define DebugTrace FALSE
-# define Xcode TRUE
+# define Debugging true
+# define DebugTrace false
+# define Xcode true
typedef struct mcError__T2_r mcError__T2;
typedef mcError__T2 *mcError_error;
mcError_error parent;
mcError_error child;
mcError_error next;
- unsigned int fatal;
+ bool fatal;
DynamicStrings_String s;
unsigned int token;
};
static mcError_error head;
-static unsigned int inInternal;
+static bool inInternal;
/*
internalError - displays an internal error message together with the compiler source
*/
static void cast (unsigned char *a, unsigned int _a_high, const unsigned char *b_, unsigned int _b_high);
-static unsigned int translateNameToCharStar (char *a, unsigned int _a_high, unsigned int n);
+static bool translateNameToCharStar (char *a, unsigned int _a_high, unsigned int n);
/*
outString - writes the contents of String to stdout.
flushAll - flushes all errors in list, e.
*/
-static unsigned int flushAll (mcError_error e, unsigned int FatalStatus);
+static bool flushAll (mcError_error e, bool FatalStatus);
/*
}
}
-static unsigned int translateNameToCharStar (char *a, unsigned int _a_high, unsigned int n)
+static bool translateNameToCharStar (char *a, unsigned int _a_high, unsigned int n)
{
unsigned int argno;
unsigned int i;
if ((a[i+1] == 'a') && (argno == n))
{
a[i+1] = 's';
- return TRUE;
+ return true;
}
argno += 1;
if (argno > n)
{
/* all done */
- return FALSE;
+ return false;
}
}
i += 1;
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
DynamicStrings_String leader;
outString__T1 p;
outString__T1 q;
- unsigned int space;
- unsigned int newline;
+ bool space;
+ bool newline;
col += 1;
if (Xcode)
leader = FormatStrings_Sprintf3 (DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "%s:%d:%d:", 9)), (const unsigned char *) &file, (sizeof (file)-1), (const unsigned char *) &line, (sizeof (line)-1), (const unsigned char *) &col, (sizeof (col)-1));
}
p = static_cast<outString__T1> (DynamicStrings_string (s));
- newline = TRUE;
- space = FALSE;
+ newline = true;
+ space = false;
while ((p != NULL) && ((*p) != ASCII_nul))
{
if (newline)
static void init (void)
{
head = NULL;
- inInternal = FALSE;
+ inInternal = false;
}
flushAll - flushes all errors in list, e.
*/
-static unsigned int flushAll (mcError_error e, unsigned int FatalStatus)
+static bool flushAll (mcError_error e, bool FatalStatus)
{
mcError_error f;
- unsigned int written;
+ bool written;
- written = FALSE;
+ written = false;
if (e != NULL)
{
do {
if ((e->child != NULL) && (flushAll (e->child, FatalStatus)))
{} /* empty. */
e->s = static_cast<DynamicStrings_String> (NULL);
- written = TRUE;
+ written = true;
}
f = e;
e = e->next;
M2RTS_ExitOnHalt (1);
if (! inInternal)
{
- inInternal = TRUE;
+ inInternal = true;
mcError_flushErrors ();
outString (mcLexBuf_findFileNameFromToken (mcLexBuf_getTokenNo (), 0), mcLexBuf_tokenToLineNo (mcLexBuf_getTokenNo (), 0), mcLexBuf_tokenToColumnNo (mcLexBuf_getTokenNo (), 0), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "*** fatal error ***", 19)));
}
e->next = NULL;
e->parent = NULL;
e->child = NULL;
- e->fatal = TRUE;
+ e->fatal = true;
if ((head == NULL) || (head->token > atTokenNo))
{
e->next = head;
mcError_error e;
e = mcError_newError (atTokenNo);
- e->fatal = FALSE;
+ e->fatal = false;
return e;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
mcPrintf_printf0 ((const char *) "\\nFlushing all errors\\n", 23);
mcPrintf_printf0 ((const char *) "===================\\n", 21);
}
- if (flushAll (head, TRUE))
+ if (flushAll (head, true))
{
M2RTS_ExitOnHalt (1);
M2RTS_HALT (-1);
extern "C" void mcError_flushWarnings (void)
{
- if (flushAll (head, FALSE))
+ if (flushAll (head, false))
{} /* empty. */
}
{
mcError_writeFormat0 ((const char *) a, _a_high);
}
- if (! (flushAll (head, TRUE)))
+ if (! (flushAll (head, true)))
{
mcError_writeFormat0 ((const char *) "unidentified error", 18);
- if (flushAll (head, TRUE))
+ if (flushAll (head, true))
{} /* empty. */
}
M2RTS_ExitOnHalt (1);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
void * mcLexBuf_currentstring;
mcReserved_toktype mcLexBuf_currenttoken;
# define MaxBucketSize 100
-# define Debugging FALSE
+# define Debugging false
typedef struct mcLexBuf_tokenDesc_r mcLexBuf_tokenDesc;
typedef struct mcLexBuf_listDesc_r mcLexBuf_listDesc;
static mcComment_commentDesc bodyComment;
static mcComment_commentDesc afterComment;
static mcLexBuf_sourceList currentSource;
-static unsigned int useBufferedTokens;
-static unsigned int currentUsed;
+static bool useBufferedTokens;
+static bool currentUsed;
static mcLexBuf_listDesc listOfTokens;
static unsigned int nextTokNo;
The success of the operation is returned.
*/
-extern "C" unsigned int mcLexBuf_openSource (DynamicStrings_String s);
+extern "C" bool mcLexBuf_openSource (DynamicStrings_String s);
/*
closeSource - closes the current open file.
isLastTokenEof - returns TRUE if the last token was an eoftok
*/
-static unsigned int isLastTokenEof (void);
+static bool isLastTokenEof (void);
/*
unsigned int nextline;
unsigned int curline;
mcLexBuf_tokenBucket b;
- unsigned int finished;
+ bool finished;
oldTokNo = nextTokNo;
cno = mcLexBuf_getTokenNo ();
curline = mcLexBuf_tokenToLineNo (cno, 0);
nextline = curline;
peep = 0;
- finished = FALSE;
+ finished = false;
do {
t = cno+peep;
b = peeptokenBucket (&t);
if ((b == NULL) || (mcLexBuf_currenttoken == mcReserved_eoftok))
{
- finished = TRUE;
+ finished = true;
}
else
{
{
case mcReserved_eoftok:
case mcReserved_endtok:
- finished = TRUE;
+ finished = true;
break;
case mcReserved_commenttok:
}
else
{
- finished = TRUE;
+ finished = true;
}
}
peep += 1;
currentSource = NULL;
listOfTokens.head = NULL;
listOfTokens.tail = NULL;
- useBufferedTokens = FALSE;
+ useBufferedTokens = false;
procedureComment = static_cast<mcComment_commentDesc> (NULL);
bodyComment = static_cast<mcComment_commentDesc> (NULL);
afterComment = static_cast<mcComment_commentDesc> (NULL);
isLastTokenEof - returns TRUE if the last token was an eoftok
*/
-static unsigned int isLastTokenEof (void)
+static bool isLastTokenEof (void)
{
unsigned int t;
mcLexBuf_tokenBucket b;
b = listOfTokens.head;
if (b == listOfTokens.tail)
{
- return FALSE;
+ return false;
}
while (b->next != listOfTokens.tail)
{
mcDebug_assert (b->len > 0); /* len should always be >0 */
return b->buf.array[b->len-1].token == mcReserved_eoftok; /* len should always be >0 */
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
The success of the operation is returned.
*/
-extern "C" unsigned int mcLexBuf_openSource (DynamicStrings_String s)
+extern "C" bool mcLexBuf_openSource (DynamicStrings_String s)
{
if (useBufferedTokens)
{
mcLexBuf_getToken ();
- return TRUE;
+ return true;
}
else
{
mcLexBuf_setFile (DynamicStrings_string (s));
syncOpenWithBuffer ();
mcLexBuf_getToken ();
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
}
/* static analysis guarentees a RETURN statement will be used before here. */
t = t->next;
Storage_DEALLOCATE ((void **) &s, sizeof (mcLexBuf__T2));
} while (! (t == NULL));
- currentUsed = FALSE;
+ currentUsed = false;
killList ();
}
init ();
extern "C" void mcLexBuf_resetForNewPass (void)
{
nextTokNo = 0;
- useBufferedTokens = TRUE;
+ useBufferedTokens = true;
}
if (! ((t == mcReserved_eoftok) && (isLastTokenEof ())))
{
addTokToList (t, nameKey_NulName, 0, static_cast<mcComment_commentDesc> (NULL), mcflex_getLineNo (), mcflex_getColumnNo (), currentSource);
- currentUsed = TRUE;
+ currentUsed = true;
}
}
stop ();
}
addTokToList (t, nameKey_makekey (s), 0, static_cast<mcComment_commentDesc> (NULL), mcflex_getLineNo (), mcflex_getColumnNo (), currentSource);
- currentUsed = TRUE;
+ currentUsed = true;
}
s = FormatStrings_Sprintf1 (DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "%d", 2)), (const unsigned char *) &i, (sizeof (i)-1));
addTokToList (t, nameKey_makekey (DynamicStrings_string (s)), i, static_cast<mcComment_commentDesc> (NULL), l, c, currentSource);
s = DynamicStrings_KillString (s);
- currentUsed = TRUE;
+ currentUsed = true;
}
extern "C" void mcLexBuf_addTokComment (mcReserved_toktype t, mcComment_commentDesc com)
{
addTokToList (t, nameKey_NulName, 0, com, mcflex_getLineNo (), mcflex_getColumnNo (), currentSource);
- currentUsed = TRUE;
+ currentUsed = true;
}
extern "C" void mcLexBuf_setFile (void * filename)
{
killList ();
- currentUsed = FALSE;
+ currentUsed = false;
currentSource = newList ();
addTo (newElement (filename));
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
The success of the operation is returned.
*/
-EXTERN unsigned int mcLexBuf_openSource (DynamicStrings_String s);
+EXTERN bool mcLexBuf_openSource (DynamicStrings_String s);
/*
closeSource - closes the current open file.
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
isWhite - returns TRUE if, ch, is a space.
*/
-static unsigned int isWhite (char ch);
+static bool isWhite (char ch);
/*
then := [ ':' ebnf ] =:
*/
-static void then (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, DynamicStrings_String o, unsigned int positive);
+static void then (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, DynamicStrings_String o, bool positive);
/*
doNumber -
*/
-static DynamicStrings_String doNumber (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, unsigned int *quotes);
+static DynamicStrings_String doNumber (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, bool *quotes);
/*
doCount -
*/
-static DynamicStrings_String doCount (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, unsigned int *quotes);
+static DynamicStrings_String doCount (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, bool *quotes);
/*
doCount -
doCount -
*/
-static DynamicStrings_String doName (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, unsigned int *quotes);
+static DynamicStrings_String doName (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, bool *quotes);
/*
doCount -
doDesc -
*/
-static DynamicStrings_String doDesc (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, unsigned int *quotes);
+static DynamicStrings_String doDesc (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, bool *quotes);
/*
addQuoted - if, o, is not empty then add it to, r.
*/
-static DynamicStrings_String addQuoted (DynamicStrings_String r, DynamicStrings_String o, unsigned int quotes);
+static DynamicStrings_String addQuoted (DynamicStrings_String r, DynamicStrings_String o, bool quotes);
/*
op := {'a'|'q'|'t'|'d'|'k'|'n'|'s'|'D'|'I'|'U'|'E'|'W'} then =:
*/
-static void op (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, unsigned int bol, unsigned int positive);
+static void op (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, unsigned int bol, bool positive);
/*
percenttoken := '%' (
} =:
*/
-static void percenttoken (mcError_error *e, mcMetaError_errorType t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, unsigned int positive);
+static void percenttoken (mcError_error *e, mcMetaError_errorType t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, bool positive);
/*
percent := '%' anych % copy anych %
isWhite - returns TRUE if, ch, is a space.
*/
-static unsigned int isWhite (char ch)
+static bool isWhite (char ch)
{
return ch == ' ';
/* static analysis guarentees a RETURN statement will be used before here. */
then := [ ':' ebnf ] =:
*/
-static void then (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, DynamicStrings_String o, unsigned int positive)
+static void then (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, DynamicStrings_String o, bool positive)
{
if ((DynamicStrings_char (s, (*i))) == ':')
{
doNumber -
*/
-static DynamicStrings_String doNumber (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, unsigned int *quotes)
+static DynamicStrings_String doNumber (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, bool *quotes)
{
unsigned int c;
}
else
{
- (*quotes) = FALSE;
+ (*quotes) = false;
varargs_next (sym, bol);
varargs_arg (sym, (unsigned char *) &c, (sizeof (c)-1));
return DynamicStrings_ConCat (o, StringConvert_ctos (c, 0, ' '));
doCount -
*/
-static DynamicStrings_String doCount (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, unsigned int *quotes)
+static DynamicStrings_String doCount (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, bool *quotes)
{
unsigned int c;
}
else
{
- (*quotes) = FALSE;
+ (*quotes) = false;
varargs_next (sym, bol);
varargs_arg (sym, (unsigned char *) &c, (sizeof (c)-1));
o = DynamicStrings_ConCat (o, StringConvert_ctos (c, 0, ' '));
doCount -
*/
-static DynamicStrings_String doName (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, unsigned int *quotes)
+static DynamicStrings_String doName (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, bool *quotes)
{
decl_node n;
{
if (decl_isZtype (n))
{
- (*quotes) = FALSE;
+ (*quotes) = false;
return DynamicStrings_ConCat (o, DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "the ZType", 9)));
}
else if (decl_isRtype (n))
{
/* avoid dangling else. */
- (*quotes) = FALSE;
+ (*quotes) = false;
return DynamicStrings_ConCat (o, DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "the RType", 9)));
}
else if ((decl_getSymName (n)) != nameKey_NulName)
doDesc -
*/
-static DynamicStrings_String doDesc (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, unsigned int *quotes)
+static DynamicStrings_String doDesc (unsigned int bol, varargs_vararg sym, DynamicStrings_String o, bool *quotes)
{
decl_node n;
o = symDesc (n, o);
if ((DynamicStrings_Length (o)) > 0)
{
- (*quotes) = FALSE;
+ (*quotes) = false;
}
}
return o;
addQuoted - if, o, is not empty then add it to, r.
*/
-static DynamicStrings_String addQuoted (DynamicStrings_String r, DynamicStrings_String o, unsigned int quotes)
+static DynamicStrings_String addQuoted (DynamicStrings_String r, DynamicStrings_String o, bool quotes)
{
if ((DynamicStrings_Length (o)) > 0)
{
op := {'a'|'q'|'t'|'d'|'k'|'n'|'s'|'D'|'I'|'U'|'E'|'W'} then =:
*/
-static void op (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, unsigned int bol, unsigned int positive)
+static void op (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, unsigned int bol, bool positive)
{
DynamicStrings_String o;
varargs_vararg c;
- unsigned int quotes;
+ bool quotes;
c = varargs_copy (sym);
o = DynamicStrings_InitString ((const char *) "", 0);
- quotes = TRUE;
+ quotes = true;
while (((*i) < l) && ((DynamicStrings_char (s, (*i))) != '}'))
{
switch (DynamicStrings_char (s, (*i)))
} =:
*/
-static void percenttoken (mcError_error *e, mcMetaError_errorType t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, unsigned int positive)
+static void percenttoken (mcError_error *e, mcMetaError_errorType t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, bool positive)
{
if ((DynamicStrings_char (s, (*i))) == '%')
{
static void lbra (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l)
{
- unsigned int positive;
+ bool positive;
if ((DynamicStrings_char (s, (*i))) == '{')
{
- positive = TRUE;
+ positive = true;
(*i) += 1;
if ((DynamicStrings_char (s, (*i))) == '!')
{
- positive = FALSE;
+ positive = false;
(*i) += 1;
}
if ((DynamicStrings_char (s, (*i))) != '%')
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# include "GFIO.h"
# include "GSFIO.h"
-static unsigned int langC;
-static unsigned int langCPP;
-static unsigned int langM2;
-static unsigned int gplHeader;
-static unsigned int glplHeader;
-static unsigned int summary;
-static unsigned int contributed;
-static unsigned int scaffoldMain;
-static unsigned int scaffoldDynamic;
-static unsigned int caseRuntime;
-static unsigned int arrayRuntime;
-static unsigned int returnRuntime;
-static unsigned int suppressNoReturn;
-static unsigned int gccConfigSystem;
-static unsigned int ignoreFQ;
-static unsigned int debugTopological;
-static unsigned int extendedOpaque;
-static unsigned int internalDebugging;
-static unsigned int verbose;
-static unsigned int quiet;
+static bool langC;
+static bool langCPP;
+static bool langM2;
+static bool gplHeader;
+static bool glplHeader;
+static bool summary;
+static bool contributed;
+static bool scaffoldMain;
+static bool scaffoldDynamic;
+static bool caseRuntime;
+static bool arrayRuntime;
+static bool returnRuntime;
+static bool suppressNoReturn;
+static bool useBoolType;
+static bool gccConfigSystem;
+static bool ignoreFQ;
+static bool debugTopological;
+static bool extendedOpaque;
+static bool internalDebugging;
+static bool verbose;
+static bool quiet;
static DynamicStrings_String projectContents;
static DynamicStrings_String summaryContents;
static DynamicStrings_String contributedContents;
getQuiet - return the value of quiet.
*/
-extern "C" unsigned int mcOptions_getQuiet (void);
+extern "C" bool mcOptions_getQuiet (void);
/*
getVerbose - return the value of verbose.
*/
-extern "C" unsigned int mcOptions_getVerbose (void);
+extern "C" bool mcOptions_getVerbose (void);
/*
getInternalDebugging - return the value of internalDebugging.
*/
-extern "C" unsigned int mcOptions_getInternalDebugging (void);
+extern "C" bool mcOptions_getInternalDebugging (void);
/*
getCppCommandLine - returns the Cpp command line and all arguments.
getExtendedOpaque - return the extendedOpaque value.
*/
-extern "C" unsigned int mcOptions_getExtendedOpaque (void);
+extern "C" bool mcOptions_getExtendedOpaque (void);
/*
setDebugTopological - sets the flag debugTopological to value.
*/
-extern "C" void mcOptions_setDebugTopological (unsigned int value);
+extern "C" void mcOptions_setDebugTopological (bool value);
/*
getDebugTopological - returns the flag value of the command
line option --debug-top.
*/
-extern "C" unsigned int mcOptions_getDebugTopological (void);
+extern "C" bool mcOptions_getDebugTopological (void);
/*
getHPrefix - saves the H file prefix.
getIgnoreFQ - returns the ignorefq flag.
*/
-extern "C" unsigned int mcOptions_getIgnoreFQ (void);
+extern "C" bool mcOptions_getIgnoreFQ (void);
/*
getGccConfigSystem - return the value of the gccConfigSystem flag.
*/
-extern "C" unsigned int mcOptions_getGccConfigSystem (void);
+extern "C" bool mcOptions_getGccConfigSystem (void);
/*
getScaffoldDynamic - return true if the --scaffold-dynamic option was present.
*/
-extern "C" unsigned int mcOptions_getScaffoldDynamic (void);
+extern "C" bool mcOptions_getScaffoldDynamic (void);
/*
getScaffoldMain - return true if the --scaffold-main option was present.
*/
-extern "C" unsigned int mcOptions_getScaffoldMain (void);
+extern "C" bool mcOptions_getScaffoldMain (void);
/*
writeGPLheader - writes out the GPL or the LGPL as a comment.
setSuppressNoReturn - set suppressNoReturn to value.
*/
-extern "C" void mcOptions_setSuppressNoReturn (unsigned int value);
+extern "C" void mcOptions_setSuppressNoReturn (bool value);
/*
getSuppressNoReturn - return the suppressNoReturn value.
*/
-extern "C" unsigned int mcOptions_getSuppressNoReturn (void);
+extern "C" bool mcOptions_getSuppressNoReturn (void);
+
+/*
+ useBool - should mc use the bool type instead of int.
+*/
+
+extern "C" bool mcOptions_useBool (void);
/*
getYear - return the year.
displayVersion - displays the version of the compiler.
*/
-static void displayVersion (unsigned int mustExit);
+static void displayVersion (bool mustExit);
/*
displayHelp - display the mc help summary.
setQuiet - sets the quiet flag to, value.
*/
-static void setQuiet (unsigned int value);
+static void setQuiet (bool value);
/*
setVerbose - sets the verbose flag to, value.
*/
-static void setVerbose (unsigned int value);
+static void setVerbose (bool value);
/*
setExtendedOpaque - set extendedOpaque to value.
*/
-static void setExtendedOpaque (unsigned int value);
+static void setExtendedOpaque (bool value);
/*
setSearchPath - set the search path for the module sources.
setInternalDebugging - turn on/off internal debugging.
*/
-static void setInternalDebugging (unsigned int value);
+static void setInternalDebugging (bool value);
/*
setHPrefix - saves the H file prefix.
setIgnoreFQ - sets the ignorefq flag.
*/
-static void setIgnoreFQ (unsigned int value);
+static void setIgnoreFQ (bool value);
/*
optionIs - returns TRUE if the first len (right) characters
match left.
*/
-static unsigned int optionIs (const char *left_, unsigned int _left_high, DynamicStrings_String right);
+static bool optionIs (const char *left_, unsigned int _left_high, DynamicStrings_String right);
/*
setLang - set the appropriate output language.
displayVersion - displays the version of the compiler.
*/
-static void displayVersion (unsigned int mustExit)
+static void displayVersion (bool mustExit)
{
unsigned int year;
setQuiet - sets the quiet flag to, value.
*/
-static void setQuiet (unsigned int value)
+static void setQuiet (bool value)
{
quiet = value;
}
setVerbose - sets the verbose flag to, value.
*/
-static void setVerbose (unsigned int value)
+static void setVerbose (bool value)
{
verbose = value;
}
setExtendedOpaque - set extendedOpaque to value.
*/
-static void setExtendedOpaque (unsigned int value)
+static void setExtendedOpaque (bool value)
{
extendedOpaque = value;
}
setInternalDebugging - turn on/off internal debugging.
*/
-static void setInternalDebugging (unsigned int value)
+static void setInternalDebugging (bool value)
{
internalDebugging = value;
}
setIgnoreFQ - sets the ignorefq flag.
*/
-static void setIgnoreFQ (unsigned int value)
+static void setIgnoreFQ (bool value)
{
ignoreFQ = value;
}
match left.
*/
-static unsigned int optionIs (const char *left_, unsigned int _left_high, DynamicStrings_String right)
+static bool optionIs (const char *left_, unsigned int _left_high, DynamicStrings_String right)
{
DynamicStrings_String s;
char left[_left_high+1];
else
{
/* avoid dangling else. */
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
if (optionIs ((const char *) "c++", 3, arg))
{
decl_setLangCP ();
- langCPP = TRUE;
+ langCPP = true;
}
else if (optionIs ((const char *) "c", 1, arg))
{
/* avoid dangling else. */
decl_setLangC ();
- langC = TRUE;
+ langC = true;
}
else if (optionIs ((const char *) "m2", 2, arg))
{
/* avoid dangling else. */
decl_setLangM2 ();
- langM2 = TRUE;
+ langM2 = true;
}
else
{
{
if ((optionIs ((const char *) "--quiet", 7, arg)) || (optionIs ((const char *) "-q", 2, arg)))
{
- setQuiet (TRUE);
+ setQuiet (true);
}
else if ((optionIs ((const char *) "--verbose", 9, arg)) || (optionIs ((const char *) "-v", 2, arg)))
{
/* avoid dangling else. */
- setVerbose (TRUE);
+ setVerbose (true);
}
else if (optionIs ((const char *) "--version", 9, arg))
{
/* avoid dangling else. */
- displayVersion (TRUE);
+ displayVersion (true);
}
else if (optionIs ((const char *) "--olang=", 8, arg))
{
else if (optionIs ((const char *) "--extended-opaque", 17, arg))
{
/* avoid dangling else. */
- setExtendedOpaque (TRUE);
+ setExtendedOpaque (true);
}
else if (optionIs ((const char *) "--debug-top", 11, arg))
{
/* avoid dangling else. */
- mcOptions_setDebugTopological (TRUE);
+ mcOptions_setDebugTopological (true);
}
else if (optionIs ((const char *) "--h-file-prefix=", 16, arg))
{
else if (optionIs ((const char *) "--ignore-fq", 11, arg))
{
/* avoid dangling else. */
- setIgnoreFQ (TRUE);
+ setIgnoreFQ (true);
}
else if (optionIs ((const char *) "--gpl-header", 12, arg))
{
/* avoid dangling else. */
- gplHeader = TRUE;
+ gplHeader = true;
}
else if (optionIs ((const char *) "--glpl-header", 13, arg))
{
/* avoid dangling else. */
- glplHeader = TRUE;
+ glplHeader = true;
}
else if (optionIs ((const char *) "--summary=\"", 11, arg))
{
/* avoid dangling else. */
- summary = TRUE;
+ summary = true;
summaryContents = DynamicStrings_Slice (arg, 11, -1);
}
else if (optionIs ((const char *) "--contributed=\"", 15, arg))
{
/* avoid dangling else. */
- contributed = TRUE;
+ contributed = true;
contributedContents = DynamicStrings_Slice (arg, 13, -1);
}
else if (optionIs ((const char *) "--project=\"", 11, arg))
else if (optionIs ((const char *) "--gcc-config-system", 19, arg))
{
/* avoid dangling else. */
- gccConfigSystem = TRUE;
+ gccConfigSystem = true;
}
else if (optionIs ((const char *) "--scaffold-main", 15, arg))
{
/* avoid dangling else. */
- scaffoldMain = TRUE;
+ scaffoldMain = true;
}
else if (optionIs ((const char *) "--scaffold-dynamic", 18, arg))
{
/* avoid dangling else. */
- scaffoldDynamic = TRUE;
+ scaffoldDynamic = true;
}
else if (optionIs ((const char *) "--suppress-noreturn", 19, arg))
{
/* avoid dangling else. */
- suppressNoReturn = TRUE;
+ suppressNoReturn = true;
}
}
if (! summary)
{
summaryContents = DynamicStrings_ConCatChar (DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "automatically created by mc from ", 33), arg), '.');
- summary = FALSE;
+ summary = false;
}
return arg;
}
getQuiet - return the value of quiet.
*/
-extern "C" unsigned int mcOptions_getQuiet (void)
+extern "C" bool mcOptions_getQuiet (void)
{
return quiet;
/* static analysis guarentees a RETURN statement will be used before here. */
getVerbose - return the value of verbose.
*/
-extern "C" unsigned int mcOptions_getVerbose (void)
+extern "C" bool mcOptions_getVerbose (void)
{
return verbose;
/* static analysis guarentees a RETURN statement will be used before here. */
getInternalDebugging - return the value of internalDebugging.
*/
-extern "C" unsigned int mcOptions_getInternalDebugging (void)
+extern "C" bool mcOptions_getInternalDebugging (void)
{
return internalDebugging;
/* static analysis guarentees a RETURN statement will be used before here. */
getExtendedOpaque - return the extendedOpaque value.
*/
-extern "C" unsigned int mcOptions_getExtendedOpaque (void)
+extern "C" bool mcOptions_getExtendedOpaque (void)
{
return extendedOpaque;
/* static analysis guarentees a RETURN statement will be used before here. */
setDebugTopological - sets the flag debugTopological to value.
*/
-extern "C" void mcOptions_setDebugTopological (unsigned int value)
+extern "C" void mcOptions_setDebugTopological (bool value)
{
debugTopological = value;
}
line option --debug-top.
*/
-extern "C" unsigned int mcOptions_getDebugTopological (void)
+extern "C" bool mcOptions_getDebugTopological (void)
{
return debugTopological;
/* static analysis guarentees a RETURN statement will be used before here. */
getIgnoreFQ - returns the ignorefq flag.
*/
-extern "C" unsigned int mcOptions_getIgnoreFQ (void)
+extern "C" bool mcOptions_getIgnoreFQ (void)
{
return ignoreFQ;
/* static analysis guarentees a RETURN statement will be used before here. */
getGccConfigSystem - return the value of the gccConfigSystem flag.
*/
-extern "C" unsigned int mcOptions_getGccConfigSystem (void)
+extern "C" bool mcOptions_getGccConfigSystem (void)
{
return gccConfigSystem;
/* static analysis guarentees a RETURN statement will be used before here. */
getScaffoldDynamic - return true if the --scaffold-dynamic option was present.
*/
-extern "C" unsigned int mcOptions_getScaffoldDynamic (void)
+extern "C" bool mcOptions_getScaffoldDynamic (void)
{
return scaffoldDynamic;
/* static analysis guarentees a RETURN statement will be used before here. */
getScaffoldMain - return true if the --scaffold-main option was present.
*/
-extern "C" unsigned int mcOptions_getScaffoldMain (void)
+extern "C" bool mcOptions_getScaffoldMain (void)
{
return scaffoldMain;
/* static analysis guarentees a RETURN statement will be used before here. */
setSuppressNoReturn - set suppressNoReturn to value.
*/
-extern "C" void mcOptions_setSuppressNoReturn (unsigned int value)
+extern "C" void mcOptions_setSuppressNoReturn (bool value)
{
suppressNoReturn = value;
}
getSuppressNoReturn - return the suppressNoReturn value.
*/
-extern "C" unsigned int mcOptions_getSuppressNoReturn (void)
+extern "C" bool mcOptions_getSuppressNoReturn (void)
{
return suppressNoReturn;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
+
+/*
+ useBool - should mc use the bool type instead of int.
+*/
+
+extern "C" bool mcOptions_useBool (void)
+{
+ return useBoolType;
+ /* static analysis guarentees a RETURN statement will be used before here. */
+ __builtin_unreachable ();
+}
+
extern "C" void _M2_mcOptions_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
{
- langC = TRUE;
- langCPP = FALSE;
- langM2 = FALSE;
- gplHeader = FALSE;
- glplHeader = FALSE;
- summary = FALSE;
- contributed = FALSE;
- caseRuntime = FALSE;
- arrayRuntime = FALSE;
- returnRuntime = FALSE;
- internalDebugging = FALSE;
- quiet = FALSE;
- verbose = FALSE;
- extendedOpaque = FALSE;
- debugTopological = FALSE;
- ignoreFQ = FALSE;
- gccConfigSystem = FALSE;
- scaffoldMain = FALSE;
- scaffoldDynamic = FALSE;
- suppressNoReturn = FALSE;
+ langC = true;
+ langCPP = false;
+ langM2 = false;
+ gplHeader = false;
+ glplHeader = false;
+ summary = false;
+ contributed = false;
+ caseRuntime = false;
+ arrayRuntime = false;
+ returnRuntime = false;
+ internalDebugging = false;
+ quiet = false;
+ verbose = false;
+ extendedOpaque = false;
+ debugTopological = false;
+ ignoreFQ = false;
+ gccConfigSystem = false;
+ scaffoldMain = false;
+ scaffoldDynamic = false;
+ suppressNoReturn = false;
+ useBoolType = true;
hPrefix = DynamicStrings_InitString ((const char *) "", 0);
cppArgs = DynamicStrings_InitString ((const char *) "", 0);
cppProgram = DynamicStrings_InitString ((const char *) "", 0);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
getQuiet - return the value of quiet.
*/
-EXTERN unsigned int mcOptions_getQuiet (void);
+EXTERN bool mcOptions_getQuiet (void);
/*
getVerbose - return the value of verbose.
*/
-EXTERN unsigned int mcOptions_getVerbose (void);
+EXTERN bool mcOptions_getVerbose (void);
/*
getInternalDebugging - return the value of internalDebugging.
*/
-EXTERN unsigned int mcOptions_getInternalDebugging (void);
+EXTERN bool mcOptions_getInternalDebugging (void);
EXTERN DynamicStrings_String mcOptions_getCppCommandLine (void);
/*
getExtendedOpaque - return the extendedOpaque value.
*/
-EXTERN unsigned int mcOptions_getExtendedOpaque (void);
+EXTERN bool mcOptions_getExtendedOpaque (void);
/*
setDebugTopological - sets the flag debugTopological to value.
*/
-EXTERN void mcOptions_setDebugTopological (unsigned int value);
+EXTERN void mcOptions_setDebugTopological (bool value);
/*
getDebugTopological - returns the flag value of the command
line option --debug-top.
*/
-EXTERN unsigned int mcOptions_getDebugTopological (void);
+EXTERN bool mcOptions_getDebugTopological (void);
/*
getHPrefix - saves the H file prefix.
getIgnoreFQ - returns the ignorefq flag.
*/
-EXTERN unsigned int mcOptions_getIgnoreFQ (void);
+EXTERN bool mcOptions_getIgnoreFQ (void);
/*
getGccConfigSystem - return the value of the gccConfigSystem flag.
*/
-EXTERN unsigned int mcOptions_getGccConfigSystem (void);
+EXTERN bool mcOptions_getGccConfigSystem (void);
/*
getScaffoldDynamic - return true if the --scaffold-dynamic option was present.
*/
-EXTERN unsigned int mcOptions_getScaffoldDynamic (void);
+EXTERN bool mcOptions_getScaffoldDynamic (void);
/*
getScaffoldMain - return true if the --scaffold-main option was present.
*/
-EXTERN unsigned int mcOptions_getScaffoldMain (void);
+EXTERN bool mcOptions_getScaffoldMain (void);
/*
writeGPLheader - writes out the GPL or the GLPL as a comment.
setSuppressNoReturn - set suppressNoReturn to value.
*/
-EXTERN void mcOptions_setSuppressNoReturn (unsigned int value);
+EXTERN void mcOptions_setSuppressNoReturn (bool value);
/*
getSuppressNoReturn - return the suppressNoReturn value.
*/
-EXTERN unsigned int mcOptions_getSuppressNoReturn (void);
+EXTERN bool mcOptions_getSuppressNoReturn (void);
+
+/*
+ useBool - should mc use the bool type instead of int.
+*/
+
+EXTERN bool mcOptions_useBool (void);
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
struct mcPretty__T1_r {
mcPretty_writeProc write_;
mcPretty_writeLnProc writeln;
- unsigned int needsSpace;
- unsigned int needsIndent;
+ bool needsSpace;
+ bool needsIndent;
unsigned int seekPos;
unsigned int curLine;
unsigned int curPos;
if (p->needsSpace)
{
(*p->write_.proc) (' ');
- p->needsSpace = FALSE;
+ p->needsSpace = false;
p->curPos += 1;
p->seekPos += 1;
}
p->curPos += 1;
p->seekPos += 1;
}
- p->needsIndent = FALSE;
+ p->needsIndent = false;
}
}
Storage_ALLOCATE ((void **) &p, sizeof (mcPretty__T1));
p->write_ = w;
p->writeln = l;
- p->needsSpace = FALSE;
- p->needsIndent = FALSE;
+ p->needsSpace = false;
+ p->needsIndent = false;
p->curPos = 0;
p->curLine = 0;
p->seekPos = 0;
/*
setneedSpace - sets needSpace flag to TRUE.
*/
- s->needsSpace = TRUE;
+ s->needsSpace = true;
}
extern "C" void mcPretty_noSpace (mcPretty_pretty s)
{
- s->needsSpace = FALSE;
+ s->needsSpace = false;
}
{
if ((((i+2) <= l) && ((DynamicStrings_char (s, static_cast<int> (i))) == '\\')) && ((DynamicStrings_char (s, static_cast<int> (i+1))) == 'n'))
{
- p->needsIndent = TRUE;
- p->needsSpace = FALSE;
+ p->needsIndent = true;
+ p->needsSpace = false;
p->curPos = 0;
(*p->writeln.proc) ();
p->seekPos += 1;
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
isDigit - returns TRUE if, ch, is a character 0..9
*/
-static unsigned int isDigit (char ch);
+static bool isDigit (char ch);
/*
cast - casts a := b
into a String and %a is replaced by %s.
*/
-static unsigned int TranslateNameToCharStar (char *a, unsigned int _a_high, unsigned int n);
+static bool TranslateNameToCharStar (char *a, unsigned int _a_high, unsigned int n);
/*
isDigit - returns TRUE if, ch, is a character 0..9
*/
-static unsigned int isDigit (char ch)
+static bool isDigit (char ch)
{
return (ch >= '0') && (ch <= '9');
/* static analysis guarentees a RETURN statement will be used before here. */
into a String and %a is replaced by %s.
*/
-static unsigned int TranslateNameToCharStar (char *a, unsigned int _a_high, unsigned int n)
+static bool TranslateNameToCharStar (char *a, unsigned int _a_high, unsigned int n)
{
unsigned int argno;
unsigned int i;
if ((a[i+1] == 'a') && (argno == n))
{
a[i+1] = 's';
- return TRUE;
+ return true;
}
argno += 1;
if (argno > n)
{
/* all done */
- return FALSE;
+ return false;
}
}
i += 1;
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
The string, FileName, is not altered.
*/
-extern "C" unsigned int mcSearch_findSourceFile (DynamicStrings_String FileName, DynamicStrings_String *fullPath);
+extern "C" bool mcSearch_findSourceFile (DynamicStrings_String FileName, DynamicStrings_String *fullPath);
/*
findSourceDefFile - attempts to find the definition module for
then FALSE is returned and fullPath is set to NIL.
*/
-extern "C" unsigned int mcSearch_findSourceDefFile (DynamicStrings_String stem, DynamicStrings_String *fullPath);
+extern "C" bool mcSearch_findSourceDefFile (DynamicStrings_String stem, DynamicStrings_String *fullPath);
/*
findSourceModFile - attempts to find the implementation module for
then FALSE is returned and fullPath is set to NIL.
*/
-extern "C" unsigned int mcSearch_findSourceModFile (DynamicStrings_String stem, DynamicStrings_String *fullPath);
+extern "C" bool mcSearch_findSourceModFile (DynamicStrings_String stem, DynamicStrings_String *fullPath);
/*
setDefExtension - sets the default extension for definition modules to, ext.
static void doDSdbExit (DynamicStrings_String s)
{
- s = DynamicStrings_PopAllocationExemption (TRUE, s);
+ s = DynamicStrings_PopAllocationExemption (true, s);
}
The string, FileName, is not altered.
*/
-extern "C" unsigned int mcSearch_findSourceFile (DynamicStrings_String FileName, DynamicStrings_String *fullPath)
+extern "C" bool mcSearch_findSourceFile (DynamicStrings_String FileName, DynamicStrings_String *fullPath)
{
DynamicStrings_String completeSearchPath;
int start;
{
(*fullPath) = newpath;
completeSearchPath = DynamicStrings_KillString (completeSearchPath);
- return TRUE;
+ return true;
}
newpath = DynamicStrings_KillString (newpath);
if (end != 0)
(*fullPath) = static_cast<DynamicStrings_String> (NULL);
newpath = DynamicStrings_KillString (newpath);
completeSearchPath = DynamicStrings_KillString (completeSearchPath);
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
then FALSE is returned and fullPath is set to NIL.
*/
-extern "C" unsigned int mcSearch_findSourceDefFile (DynamicStrings_String stem, DynamicStrings_String *fullPath)
+extern "C" bool mcSearch_findSourceDefFile (DynamicStrings_String stem, DynamicStrings_String *fullPath)
{
DynamicStrings_String f;
f = mcFileName_calculateFileName (stem, Def);
if (mcSearch_findSourceFile (f, fullPath))
{
- return TRUE;
+ return true;
}
f = DynamicStrings_KillString (f);
}
then FALSE is returned and fullPath is set to NIL.
*/
-extern "C" unsigned int mcSearch_findSourceModFile (DynamicStrings_String stem, DynamicStrings_String *fullPath)
+extern "C" bool mcSearch_findSourceModFile (DynamicStrings_String stem, DynamicStrings_String *fullPath)
{
DynamicStrings_String f;
f = mcFileName_calculateFileName (stem, Mod);
if (mcSearch_findSourceFile (f, fullPath))
{
- return TRUE;
+ return true;
}
f = DynamicStrings_KillString (f);
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
FindSourceFile sets FullPath to a new string if successful.
*/
-EXTERN unsigned int mcSearch_findSourceFile (DynamicStrings_String FileName, DynamicStrings_String *fullPath);
+EXTERN bool mcSearch_findSourceFile (DynamicStrings_String FileName, DynamicStrings_String *fullPath);
/*
findSourceDefFile - attempts to find the definition module for
then FALSE is returned and FullPath is set to NIL.
*/
-EXTERN unsigned int mcSearch_findSourceDefFile (DynamicStrings_String stem, DynamicStrings_String *fullPath);
+EXTERN bool mcSearch_findSourceDefFile (DynamicStrings_String stem, DynamicStrings_String *fullPath);
/*
findSourceModFile - attempts to find the implementation module for
then FALSE is returned and FullPath is set to NIL.
*/
-EXTERN unsigned int mcSearch_findSourceModFile (DynamicStrings_String stem, DynamicStrings_String *fullPath);
+EXTERN bool mcSearch_findSourceModFile (DynamicStrings_String stem, DynamicStrings_String *fullPath);
/*
setDefExtension - sets the default extension for definition modules to, ext.
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
static alists_alist listOfFiles;
static Indexing_Index frag;
static FIO_File destFile;
-static unsigned int seenDest;
+static bool seenDest;
/*
openFrag - create and open fragment, id, and return the file.
extern "C" void mcStream_setDest (FIO_File f)
{
- seenDest = TRUE;
+ seenDest = true;
destFile = f;
}
extern "C" void _M2_mcStream_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
{
listOfFiles = alists_initList ();
- seenDest = FALSE;
+ seenDest = false;
frag = Indexing_InitIndex (1);
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
*/
EXTERN void mcflex_closeSource (void);
-EXTERN unsigned int mcflex_openSource (void * s);
+EXTERN bool mcflex_openSource (void * s);
/*
getToken - returns the ADDRESS of the next token.
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# include "GmcLexBuf.h"
# include "Gdecl.h"
-# define Pass1 TRUE
-# define Debugging FALSE
+# define Pass1 true
+# define Debugging false
typedef unsigned int mcp1_stop0;
typedef unsigned int mcp1_SetOfStop0;
typedef unsigned int mcp1_SetOfStop2;
-static unsigned int WasNoError;
+static bool WasNoError;
static nameKey_Name curident;
static decl_node curproc;
static decl_node curmodule;
in future passes.
*/
-extern "C" unsigned int mcp1_CompilationUnit (void);
+extern "C" bool mcp1_CompilationUnit (void);
static void ErrorString (DynamicStrings_String s);
static void ErrorArray (const char *a_, unsigned int _a_high);
CheckAndInsert -
*/
-static unsigned int CheckAndInsert (mcReserved_toktype t, mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2);
+static bool CheckAndInsert (mcReserved_toktype t, mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2);
/*
InStopSet
*/
-static unsigned int InStopSet (mcReserved_toktype t, mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2);
+static bool InStopSet (mcReserved_toktype t, mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2);
/*
PeepToken - peep token checks to see whether the stopset is satisfied by currenttoken
current module import list.
*/
-static void registerImport (nameKey_Name ident, unsigned int scoped);
+static void registerImport (nameKey_Name ident, bool scoped);
/*
FileUnit := DefinitionModule |
static void ErrorString (DynamicStrings_String s)
{
mcError_errorStringAt (s, mcLexBuf_getTokenNo ());
- WasNoError = FALSE;
+ WasNoError = false;
}
static void ErrorArray (const char *a_, unsigned int _a_high)
CheckAndInsert -
*/
-static unsigned int CheckAndInsert (mcReserved_toktype t, mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2)
+static bool CheckAndInsert (mcReserved_toktype t, mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2)
{
if (((( ((unsigned int) (t)) < 32) && ((((1 << (t-mcReserved_eoftok)) & (stopset0)) != 0))) || ((( ((unsigned int) (t)) >= 32) && ( ((unsigned int) (t)) < 64)) && ((((1 << (t-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (t)) >= 64) && ((((1 << (t-mcReserved_recordtok)) & (stopset2)) != 0))))
{
WarnMissingToken (t);
mcLexBuf_insertTokenAndRewind (t);
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
InStopSet
*/
-static unsigned int InStopSet (mcReserved_toktype t, mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2)
+static bool InStopSet (mcReserved_toktype t, mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2)
{
if (((( ((unsigned int) (t)) < 32) && ((((1 << (t-mcReserved_eoftok)) & (stopset0)) != 0))) || ((( ((unsigned int) (t)) >= 32) && ( ((unsigned int) (t)) < 64)) && ((((1 << (t-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (t)) >= 64) && ((((1 << (t-mcReserved_recordtok)) & (stopset2)) != 0))))
{
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
current module import list.
*/
-static void registerImport (nameKey_Name ident, unsigned int scoped)
+static void registerImport (nameKey_Name ident, bool scoped)
{
decl_node n;
{
Expect (mcReserved_fromtok, stopset0, stopset1, stopset2|(mcp1_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok))));
Ident (stopset0, stopset1|(mcp1_SetOfStop1) ((1 << (mcReserved_importtok-mcReserved_arraytok))), stopset2);
- registerImport (curident, FALSE);
+ registerImport (curident, false);
Expect (mcReserved_importtok, stopset0, stopset1, stopset2|(mcp1_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok))));
IdentList (stopset0|(mcp1_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2);
Expect (mcReserved_semicolontok, stopset0, stopset1, stopset2);
static void ImportModuleList (mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2)
{
Ident (stopset0|(mcp1_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2);
- registerImport (curident, TRUE);
+ registerImport (curident, true);
while (mcLexBuf_currenttoken == mcReserved_commatok)
{
Expect (mcReserved_commatok, stopset0, stopset1, stopset2|(mcp1_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok))));
Ident (stopset0|(mcp1_SetOfStop0) ((1 << (mcReserved_commatok-mcReserved_eoftok))), stopset1, stopset2);
- registerImport (curident, TRUE);
+ registerImport (curident, true);
}
/* while */
}
static void DefinitionModule (mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2)
{
- unsigned int c;
+ bool c;
- c = FALSE;
+ c = false;
Expect (mcReserved_definitiontok, stopset0, stopset1|(mcp1_SetOfStop1) ((1 << (mcReserved_moduletok-mcReserved_arraytok))), stopset2);
Expect (mcReserved_moduletok, stopset0, stopset1|(mcp1_SetOfStop1) ((1 << (mcReserved_fortok-mcReserved_arraytok))), stopset2|(mcp1_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok))));
if (mcLexBuf_currenttoken == mcReserved_fortok)
{
Expect (mcReserved_fortok, stopset0, stopset1, stopset2|(mcp1_SetOfStop2) ((1 << (mcReserved_stringtok-mcReserved_recordtok))));
string (stopset0, stopset1, stopset2|(mcp1_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok))));
- c = TRUE;
+ c = true;
}
Ident (stopset0|(mcp1_SetOfStop0) ((1 << (mcReserved_semicolontok-mcReserved_eoftok))), stopset1, stopset2);
Expect (mcReserved_semicolontok, stopset0, stopset1|(mcp1_SetOfStop1) ((1 << (mcReserved_importtok-mcReserved_arraytok)) | (1 << (mcReserved_fromtok-mcReserved_arraytok)) | (1 << (mcReserved_exporttok-mcReserved_arraytok)) | (1 << (mcReserved_endtok-mcReserved_arraytok)) | (1 << (mcReserved_proceduretok-mcReserved_arraytok)) | (1 << (mcReserved_consttok-mcReserved_arraytok))), stopset2|(mcp1_SetOfStop2) ((1 << (mcReserved_vartok-mcReserved_recordtok)) | (1 << (mcReserved_typetok-mcReserved_recordtok))));
in future passes.
*/
-extern "C" unsigned int mcp1_CompilationUnit (void)
+extern "C" bool mcp1_CompilationUnit (void)
{
- WasNoError = TRUE;
+ WasNoError = true;
FileUnit ((mcp1_SetOfStop0) ((1 << (mcReserved_eoftok-mcReserved_eoftok))), (mcp1_SetOfStop1) 0, (mcp1_SetOfStop2) 0);
return WasNoError;
/* static analysis guarentees a RETURN statement will be used before here. */
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
in future passes.
*/
-EXTERN unsigned int mcp1_CompilationUnit (void);
+EXTERN bool mcp1_CompilationUnit (void);
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# include "GmcLexBuf.h"
# include "Gdecl.h"
-# define Pass1 FALSE
-# define Debugging FALSE
+# define Pass1 false
+# define Debugging false
typedef unsigned int mcp2_stop0;
typedef unsigned int mcp2_SetOfStop0;
typedef unsigned int mcp2_SetOfStop2;
-static unsigned int WasNoError;
+static bool WasNoError;
static nameKey_Name curident;
static decl_node typeDes;
static decl_node typeExp;
in future passes.
*/
-extern "C" unsigned int mcp2_CompilationUnit (void);
+extern "C" bool mcp2_CompilationUnit (void);
static void ErrorString (DynamicStrings_String s);
static void ErrorArray (const char *a_, unsigned int _a_high);
CheckAndInsert -
*/
-static unsigned int CheckAndInsert (mcReserved_toktype t, mcp2_SetOfStop0 stopset0, mcp2_SetOfStop1 stopset1, mcp2_SetOfStop2 stopset2);
+static bool CheckAndInsert (mcReserved_toktype t, mcp2_SetOfStop0 stopset0, mcp2_SetOfStop1 stopset1, mcp2_SetOfStop2 stopset2);
/*
InStopSet
*/
-static unsigned int InStopSet (mcReserved_toktype t, mcp2_SetOfStop0 stopset0, mcp2_SetOfStop1 stopset1, mcp2_SetOfStop2 stopset2);
+static bool InStopSet (mcReserved_toktype t, mcp2_SetOfStop0 stopset0, mcp2_SetOfStop1 stopset1, mcp2_SetOfStop2 stopset2);
/*
PeepToken - peep token checks to see whether the stopset is satisfied by currenttoken
current module import list.
*/
-static void registerImport (nameKey_Name ident, unsigned int scoped);
+static void registerImport (nameKey_Name ident, bool scoped);
/*
FileUnit := DefinitionModule |
static void ErrorString (DynamicStrings_String s)
{
mcError_errorStringAt (s, mcLexBuf_getTokenNo ());
- WasNoError = FALSE;
+ WasNoError = false;
}
static void ErrorArray (const char *a_, unsigned int _a_high)
CheckAndInsert -
*/
-static unsigned int CheckAndInsert (mcReserved_toktype t, mcp2_SetOfStop0 stopset0, mcp2_SetOfStop1 stopset1, mcp2_SetOfStop2 stopset2)
+static bool CheckAndInsert (mcReserved_toktype t, mcp2_SetOfStop0 stopset0, mcp2_SetOfStop1 stopset1, mcp2_SetOfStop2 stopset2)
{
if (((( ((unsigned int) (t)) < 32) && ((((1 << (t-mcReserved_eoftok)) & (stopset0)) != 0))) || ((( ((unsigned int) (t)) >= 32) && ( ((unsigned int) (t)) < 64)) && ((((1 << (t-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (t)) >= 64) && ((((1 << (t-mcReserved_recordtok)) & (stopset2)) != 0))))
{
WarnMissingToken (t);
mcLexBuf_insertTokenAndRewind (t);
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
InStopSet
*/
-static unsigned int InStopSet (mcReserved_toktype t, mcp2_SetOfStop0 stopset0, mcp2_SetOfStop1 stopset1, mcp2_SetOfStop2 stopset2)
+static bool InStopSet (mcReserved_toktype t, mcp2_SetOfStop0 stopset0, mcp2_SetOfStop1 stopset1, mcp2_SetOfStop2 stopset2)
{
if (((( ((unsigned int) (t)) < 32) && ((((1 << (t-mcReserved_eoftok)) & (stopset0)) != 0))) || ((( ((unsigned int) (t)) >= 32) && ( ((unsigned int) (t)) < 64)) && ((((1 << (t-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (t)) >= 64) && ((((1 << (t-mcReserved_recordtok)) & (stopset2)) != 0))))
{
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
current module import list.
*/
-static void registerImport (nameKey_Name ident, unsigned int scoped)
+static void registerImport (nameKey_Name ident, bool scoped)
{
decl_node n;
in future passes.
*/
-extern "C" unsigned int mcp2_CompilationUnit (void)
+extern "C" bool mcp2_CompilationUnit (void)
{
- WasNoError = TRUE;
+ WasNoError = true;
FileUnit ((mcp2_SetOfStop0) ((1 << (mcReserved_eoftok-mcReserved_eoftok))), (mcp2_SetOfStop1) 0, (mcp2_SetOfStop2) 0);
return WasNoError;
/* static analysis guarentees a RETURN statement will be used before here. */
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
in future passes.
*/
-EXTERN unsigned int mcp2_CompilationUnit (void);
+EXTERN bool mcp2_CompilationUnit (void);
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# include "GmcLexBuf.h"
# include "Gdecl.h"
-# define Pass1 FALSE
-# define Debugging FALSE
+# define Pass1 false
+# define Debugging false
typedef unsigned int mcp3_stop0;
typedef unsigned int mcp3_SetOfStop0;
typedef unsigned int mcp3_SetOfStop2;
-static unsigned int WasNoError;
-static unsigned int curisused;
+static bool WasNoError;
+static bool curisused;
static nameKey_Name curstring;
static nameKey_Name curident;
static decl_node curproc;
in future passes.
*/
-extern "C" unsigned int mcp3_CompilationUnit (void);
+extern "C" bool mcp3_CompilationUnit (void);
/*
push -
checkDuplicate -
*/
-static void checkDuplicate (unsigned int b);
+static void checkDuplicate (bool b);
/*
checkDuplicate -
CheckAndInsert -
*/
-static unsigned int CheckAndInsert (mcReserved_toktype t, mcp3_SetOfStop0 stopset0, mcp3_SetOfStop1 stopset1, mcp3_SetOfStop2 stopset2);
+static bool CheckAndInsert (mcReserved_toktype t, mcp3_SetOfStop0 stopset0, mcp3_SetOfStop1 stopset1, mcp3_SetOfStop2 stopset2);
/*
InStopSet
*/
-static unsigned int InStopSet (mcReserved_toktype t, mcp3_SetOfStop0 stopset0, mcp3_SetOfStop1 stopset1, mcp3_SetOfStop2 stopset2);
+static bool InStopSet (mcReserved_toktype t, mcp3_SetOfStop0 stopset0, mcp3_SetOfStop1 stopset1, mcp3_SetOfStop2 stopset2);
/*
PeepToken - peep token checks to see whether the stopset is satisfied by currenttoken
checkDuplicate -
*/
-static void checkDuplicate (unsigned int b)
+static void checkDuplicate (bool b)
{
}
static void ErrorString (DynamicStrings_String s)
{
mcError_errorStringAt (s, mcLexBuf_getTokenNo ());
- WasNoError = FALSE;
+ WasNoError = false;
}
CheckAndInsert -
*/
-static unsigned int CheckAndInsert (mcReserved_toktype t, mcp3_SetOfStop0 stopset0, mcp3_SetOfStop1 stopset1, mcp3_SetOfStop2 stopset2)
+static bool CheckAndInsert (mcReserved_toktype t, mcp3_SetOfStop0 stopset0, mcp3_SetOfStop1 stopset1, mcp3_SetOfStop2 stopset2)
{
if (((( ((unsigned int) (t)) < 32) && ((((1 << (t-mcReserved_eoftok)) & (stopset0)) != 0))) || ((( ((unsigned int) (t)) >= 32) && ( ((unsigned int) (t)) < 64)) && ((((1 << (t-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (t)) >= 64) && ((((1 << (t-mcReserved_recordtok)) & (stopset2)) != 0))))
{
WarnMissingToken (t);
mcLexBuf_insertTokenAndRewind (t);
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
InStopSet
*/
-static unsigned int InStopSet (mcReserved_toktype t, mcp3_SetOfStop0 stopset0, mcp3_SetOfStop1 stopset1, mcp3_SetOfStop2 stopset2)
+static bool InStopSet (mcReserved_toktype t, mcp3_SetOfStop0 stopset0, mcp3_SetOfStop1 stopset1, mcp3_SetOfStop2 stopset2)
{
if (((( ((unsigned int) (t)) < 32) && ((((1 << (t-mcReserved_eoftok)) & (stopset0)) != 0))) || ((( ((unsigned int) (t)) >= 32) && ( ((unsigned int) (t)) < 64)) && ((((1 << (t-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (t)) >= 64) && ((((1 << (t-mcReserved_recordtok)) & (stopset2)) != 0))))
{
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
/* avoid dangling else. */
Expect (mcReserved_vartok, stopset0, stopset1|(mcp3_SetOfStop1) ((1 << (mcReserved_arraytok-mcReserved_arraytok))), stopset2|(mcp3_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok))));
FormalType (stopset0, stopset1, stopset2);
- n = push (decl_makeVarParameter (static_cast<decl_node> (NULL), pop (), curproc, TRUE));
+ n = push (decl_makeVarParameter (static_cast<decl_node> (NULL), pop (), curproc, true));
}
else if ((mcLexBuf_currenttoken == mcReserved_arraytok) || (mcLexBuf_currenttoken == mcReserved_identtok))
{
/* avoid dangling else. */
FormalType (stopset0, stopset1, stopset2);
- n = push (decl_makeNonVarParameter (static_cast<decl_node> (NULL), pop (), curproc, TRUE));
+ n = push (decl_makeNonVarParameter (static_cast<decl_node> (NULL), pop (), curproc, true));
}
else
{
}
else
{
- decl_setNoReturn (curproc, FALSE);
+ decl_setNoReturn (curproc, false);
}
}
/* end of optional [ | ] expression */
{
Expect (mcReserved_ldirectivetok, stopset0, stopset1, stopset2|(mcp3_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok))));
Ident (stopset0|(mcp3_SetOfStop0) ((1 << (mcReserved_rdirectivetok-mcReserved_eoftok))), stopset1, stopset2);
- decl_setNoReturn (curproc, TRUE);
+ decl_setNoReturn (curproc, true);
checkReturnAttribute ();
Expect (mcReserved_rdirectivetok, stopset0, stopset1, stopset2);
}
{
Expect (mcReserved_ldirectivetok, stopset0, stopset1, stopset2|(mcp3_SetOfStop2) ((1 << (mcReserved_identtok-mcReserved_recordtok))));
Ident (stopset0|(mcp3_SetOfStop0) ((1 << (mcReserved_rdirectivetok-mcReserved_eoftok))), stopset1, stopset2);
- curisused = FALSE;
+ curisused = false;
checkParameterAttribute ();
Expect (mcReserved_rdirectivetok, stopset0, stopset1, stopset2);
}
FormalType (stopset0|(mcp3_SetOfStop0) ((1 << (mcReserved_ldirectivetok-mcReserved_eoftok))), stopset1, stopset2);
t = pop ();
l = pop ();
- curisused = TRUE;
+ curisused = true;
if (mcLexBuf_currenttoken == mcReserved_ldirectivetok)
{
AttributeUnused (stopset0, stopset1, stopset2);
FormalType (stopset0|(mcp3_SetOfStop0) ((1 << (mcReserved_ldirectivetok-mcReserved_eoftok))), stopset1, stopset2);
t = pop ();
l = pop ();
- curisused = TRUE;
+ curisused = true;
if (mcLexBuf_currenttoken == mcReserved_ldirectivetok)
{
AttributeUnused (stopset0, stopset1, stopset2);
in future passes.
*/
-extern "C" unsigned int mcp3_CompilationUnit (void)
+extern "C" bool mcp3_CompilationUnit (void)
{
stk = mcStack_init ();
- WasNoError = TRUE;
+ WasNoError = true;
FileUnit ((mcp3_SetOfStop0) ((1 << (mcReserved_eoftok-mcReserved_eoftok))), (mcp3_SetOfStop1) 0, (mcp3_SetOfStop2) 0);
mcStack_kill (&stk);
return WasNoError;
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
in future passes.
*/
-EXTERN unsigned int mcp3_CompilationUnit (void);
+EXTERN bool mcp3_CompilationUnit (void);
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# include "GmcLexBuf.h"
# include "Gdecl.h"
-# define Pass1 FALSE
-# define Debugging FALSE
+# define Pass1 false
+# define Debugging false
typedef unsigned int mcp4_stop0;
typedef unsigned int mcp4_SetOfStop0;
typedef unsigned int mcp4_SetOfStop2;
-static unsigned int WasNoError;
+static bool WasNoError;
static nameKey_Name curstring;
static nameKey_Name curident;
static decl_node curproc;
in future passes.
*/
-extern "C" unsigned int mcp4_CompilationUnit (void);
+extern "C" bool mcp4_CompilationUnit (void);
/*
push -
checkDuplicate -
*/
-static void checkDuplicate (unsigned int b);
+static void checkDuplicate (bool b);
/*
checkDuplicate -
CheckAndInsert -
*/
-static unsigned int CheckAndInsert (mcReserved_toktype t, mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2);
+static bool CheckAndInsert (mcReserved_toktype t, mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2);
/*
InStopSet
*/
-static unsigned int InStopSet (mcReserved_toktype t, mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2);
+static bool InStopSet (mcReserved_toktype t, mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2);
/*
PeepToken - peep token checks to see whether the stopset is satisfied by currenttoken
checkDuplicate -
*/
-static void checkDuplicate (unsigned int b)
+static void checkDuplicate (bool b)
{
}
static void ErrorString (DynamicStrings_String s)
{
mcError_errorStringAt (s, mcLexBuf_getTokenNo ());
- WasNoError = FALSE;
+ WasNoError = false;
}
CheckAndInsert -
*/
-static unsigned int CheckAndInsert (mcReserved_toktype t, mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2)
+static bool CheckAndInsert (mcReserved_toktype t, mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2)
{
if (((( ((unsigned int) (t)) < 32) && ((((1 << (t-mcReserved_eoftok)) & (stopset0)) != 0))) || ((( ((unsigned int) (t)) >= 32) && ( ((unsigned int) (t)) < 64)) && ((((1 << (t-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (t)) >= 64) && ((((1 << (t-mcReserved_recordtok)) & (stopset2)) != 0))))
{
WarnMissingToken (t);
mcLexBuf_insertTokenAndRewind (t);
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
InStopSet
*/
-static unsigned int InStopSet (mcReserved_toktype t, mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2)
+static bool InStopSet (mcReserved_toktype t, mcp4_SetOfStop0 stopset0, mcp4_SetOfStop1 stopset1, mcp4_SetOfStop2 stopset2)
{
if (((( ((unsigned int) (t)) < 32) && ((((1 << (t-mcReserved_eoftok)) & (stopset0)) != 0))) || ((( ((unsigned int) (t)) >= 32) && ( ((unsigned int) (t)) < 64)) && ((((1 << (t-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (t)) >= 64) && ((((1 << (t-mcReserved_recordtok)) & (stopset2)) != 0))))
{
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
in future passes.
*/
-extern "C" unsigned int mcp4_CompilationUnit (void)
+extern "C" bool mcp4_CompilationUnit (void)
{
stk = mcStack_init ();
- WasNoError = TRUE;
+ WasNoError = true;
FileUnit ((mcp4_SetOfStop0) ((1 << (mcReserved_eoftok-mcReserved_eoftok))), (mcp4_SetOfStop1) 0, (mcp4_SetOfStop2) 0);
mcStack_kill (&stk);
return WasNoError;
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
in future passes.
*/
-EXTERN unsigned int mcp4_CompilationUnit (void);
+EXTERN bool mcp4_CompilationUnit (void);
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# include "GmcLexBuf.h"
# include "Gdecl.h"
-# define Pass1 FALSE
-# define Debugging FALSE
+# define Pass1 false
+# define Debugging false
typedef unsigned int mcp5_stop0;
typedef unsigned int mcp5_SetOfStop0;
typedef unsigned int mcp5_SetOfStop2;
-static unsigned int WasNoError;
+static bool WasNoError;
static nameKey_Name curstring;
static nameKey_Name curident;
static decl_node curproc;
in future passes.
*/
-extern "C" unsigned int mcp5_CompilationUnit (void);
+extern "C" bool mcp5_CompilationUnit (void);
/*
followNode -
checkDuplicate -
*/
-static void checkDuplicate (unsigned int b);
+static void checkDuplicate (bool b);
/*
isQualident - returns TRUE if, n, is a qualident.
*/
-static unsigned int isQualident (decl_node n);
+static bool isQualident (decl_node n);
/*
startWith -
CheckAndInsert -
*/
-static unsigned int CheckAndInsert (mcReserved_toktype t, mcp5_SetOfStop0 stopset0, mcp5_SetOfStop1 stopset1, mcp5_SetOfStop2 stopset2);
+static bool CheckAndInsert (mcReserved_toktype t, mcp5_SetOfStop0 stopset0, mcp5_SetOfStop1 stopset1, mcp5_SetOfStop2 stopset2);
/*
InStopSet
*/
-static unsigned int InStopSet (mcReserved_toktype t, mcp5_SetOfStop0 stopset0, mcp5_SetOfStop1 stopset1, mcp5_SetOfStop2 stopset2);
+static bool InStopSet (mcReserved_toktype t, mcp5_SetOfStop0 stopset0, mcp5_SetOfStop1 stopset1, mcp5_SetOfStop2 stopset2);
/*
PeepToken - peep token checks to see whether the stopset is satisfied by currenttoken
checkDuplicate -
*/
-static void checkDuplicate (unsigned int b)
+static void checkDuplicate (bool b)
{
}
isQualident - returns TRUE if, n, is a qualident.
*/
-static unsigned int isQualident (decl_node n)
+static bool isQualident (decl_node n)
{
decl_node type;
if (decl_isDef (n))
{
- return TRUE;
+ return true;
}
else
{
type = decl_skipType (decl_getType (n));
return (type != NULL) && (decl_isRecord (type));
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
static void ErrorString (DynamicStrings_String s)
{
mcError_errorStringAt (s, mcLexBuf_getTokenNo ());
- WasNoError = FALSE;
+ WasNoError = false;
}
CheckAndInsert -
*/
-static unsigned int CheckAndInsert (mcReserved_toktype t, mcp5_SetOfStop0 stopset0, mcp5_SetOfStop1 stopset1, mcp5_SetOfStop2 stopset2)
+static bool CheckAndInsert (mcReserved_toktype t, mcp5_SetOfStop0 stopset0, mcp5_SetOfStop1 stopset1, mcp5_SetOfStop2 stopset2)
{
if (((( ((unsigned int) (t)) < 32) && ((((1 << (t-mcReserved_eoftok)) & (stopset0)) != 0))) || ((( ((unsigned int) (t)) >= 32) && ( ((unsigned int) (t)) < 64)) && ((((1 << (t-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (t)) >= 64) && ((((1 << (t-mcReserved_recordtok)) & (stopset2)) != 0))))
{
WarnMissingToken (t);
mcLexBuf_insertTokenAndRewind (t);
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
InStopSet
*/
-static unsigned int InStopSet (mcReserved_toktype t, mcp5_SetOfStop0 stopset0, mcp5_SetOfStop1 stopset1, mcp5_SetOfStop2 stopset2)
+static bool InStopSet (mcReserved_toktype t, mcp5_SetOfStop0 stopset0, mcp5_SetOfStop1 stopset1, mcp5_SetOfStop2 stopset2)
{
if (((( ((unsigned int) (t)) < 32) && ((((1 << (t-mcReserved_eoftok)) & (stopset0)) != 0))) || ((( ((unsigned int) (t)) >= 32) && ( ((unsigned int) (t)) < 64)) && ((((1 << (t-mcReserved_arraytok)) & (stopset1)) != 0)))) || (( ((unsigned int) (t)) >= 64) && ((((1 << (t-mcReserved_recordtok)) & (stopset2)) != 0))))
{
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
in future passes.
*/
-extern "C" unsigned int mcp5_CompilationUnit (void)
+extern "C" bool mcp5_CompilationUnit (void)
{
stk = mcStack_init ();
withStk = mcStack_init ();
stmtStk = mcStack_init ();
loopStk = mcStack_init ();
loopNo = 0;
- WasNoError = TRUE;
+ WasNoError = true;
FileUnit ((mcp5_SetOfStop0) ((1 << (mcReserved_eoftok-mcReserved_eoftok))), (mcp5_SetOfStop1) 0, (mcp5_SetOfStop2) 0);
mcStack_kill (&stk);
mcStack_kill (&withStk);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
in future passes.
*/
-EXTERN unsigned int mcp5_CompilationUnit (void);
+EXTERN bool mcp5_CompilationUnit (void);
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
converting, a, into a String, for speed.
*/
-extern "C" unsigned int nameKey_isKey (const char *a_, unsigned int _a_high);
+extern "C" bool nameKey_isKey (const char *a_, unsigned int _a_high);
/*
keyToCharStar - returns the C char * string equivalent for, key.
This function deliberately inlines CAP for speed.
*/
-extern "C" unsigned int nameKey_isSameExcludingCase (nameKey_Name key1, nameKey_Name key2);
+extern "C" bool nameKey_isSameExcludingCase (nameKey_Name key1, nameKey_Name key2);
/*
keyToCharStar - returns the C char * string equivalent for, key.
converting, a, into a String, for speed.
*/
-extern "C" unsigned int nameKey_isKey (const char *a_, unsigned int _a_high)
+extern "C" bool nameKey_isKey (const char *a_, unsigned int _a_high)
{
nameKey_nameNode child;
nameKey_ptrToChar p;
/* avoid gcc warning by using compound statement even if not strictly necessary. */
if ((*p) == ASCII_nul)
{
- return TRUE;
+ return true;
}
else
{
}
} while (! (child == NULL));
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
This function deliberately inlines CAP for speed.
*/
-extern "C" unsigned int nameKey_isSameExcludingCase (nameKey_Name key1, nameKey_Name key2)
+extern "C" bool nameKey_isSameExcludingCase (nameKey_Name key1, nameKey_Name key2)
{
nameKey_ptrToChar pi;
nameKey_ptrToChar pj;
if (key1 == key2)
{
- return TRUE;
+ return true;
}
else
{
else
{
/* difference found */
- return FALSE;
+ return false;
}
}
return c1 == c2;
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
isKey - returns TRUE if string, a, is currently a key.
*/
-EXTERN unsigned int nameKey_isKey (const char *a_, unsigned int _a_high);
+EXTERN bool nameKey_isKey (const char *a_, unsigned int _a_high);
/*
writeKey - Display the symbol represented by Key.
the same. It is case insensitive.
*/
-EXTERN unsigned int nameKey_isSameExcludingCase (nameKey_Name key1, nameKey_Name key2);
+EXTERN bool nameKey_isSameExcludingCase (nameKey_Name key1, nameKey_Name key2);
/*
keyToCharStar - returns the C char * string equivalent for, key.
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
typedef symbolKey__T1 *symbolKey_symbolTree;
-typedef unsigned int (*symbolKey_isSymbol_t) (void *);
+typedef bool (*symbolKey_isSymbol_t) (void *);
struct symbolKey_isSymbol_p { symbolKey_isSymbol_t proc; };
typedef void (*symbolKey_performOperation_t) (void *);
isEmptyTree - returns true if symbolTree, t, is empty.
*/
-extern "C" unsigned int symbolKey_isEmptyTree (symbolKey_symbolTree t);
+extern "C" bool symbolKey_isEmptyTree (symbolKey_symbolTree t);
/*
doesTreeContainAny - returns true if symbolTree, t, contains any
left, hence we need two procedures.
*/
-extern "C" unsigned int symbolKey_doesTreeContainAny (symbolKey_symbolTree t, symbolKey_isSymbol p);
+extern "C" bool symbolKey_doesTreeContainAny (symbolKey_symbolTree t, symbolKey_isSymbol p);
/*
foreachNodeDo - for each node in symbolTree, t, a procedure, p,
therefore we must skip over it.
*/
-static unsigned int searchForAny (symbolKey_symbolTree t, symbolKey_isSymbol p);
+static bool searchForAny (symbolKey_symbolTree t, symbolKey_isSymbol p);
/*
searchAndDo - searches all the nodes in symbolTree, t, and
therefore we must skip over it.
*/
-static unsigned int searchForAny (symbolKey_symbolTree t, symbolKey_isSymbol p)
+static bool searchForAny (symbolKey_symbolTree t, symbolKey_isSymbol p)
{
if (t == NULL)
{
- return FALSE;
+ return false;
}
else
{
isEmptyTree - returns true if symbolTree, t, is empty.
*/
-extern "C" unsigned int symbolKey_isEmptyTree (symbolKey_symbolTree t)
+extern "C" bool symbolKey_isEmptyTree (symbolKey_symbolTree t)
{
return t->left == NULL;
/* static analysis guarentees a RETURN statement will be used before here. */
left, hence we need two procedures.
*/
-extern "C" unsigned int symbolKey_doesTreeContainAny (symbolKey_symbolTree t, symbolKey_isSymbol p)
+extern "C" bool symbolKey_doesTreeContainAny (symbolKey_symbolTree t, symbolKey_isSymbol p)
{
return searchForAny (t->left, p);
/* static analysis guarentees a RETURN statement will be used before here. */
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
typedef struct symbolKey_performOperation_p symbolKey_performOperation;
-typedef unsigned int (*symbolKey_isSymbol_t) (void *);
+typedef bool (*symbolKey_isSymbol_t) (void *);
struct symbolKey_isSymbol_p { symbolKey_isSymbol_t proc; };
typedef void (*symbolKey_performOperation_t) (void *);
isEmptyTree - returns true if symbolTree, t, is empty.
*/
-EXTERN unsigned int symbolKey_isEmptyTree (symbolKey_symbolTree t);
+EXTERN bool symbolKey_isEmptyTree (symbolKey_symbolTree t);
/*
doesTreeContainAny - returns true if symbolTree, t, contains any
p, is called with a symbol as its parameter.
*/
-EXTERN unsigned int symbolKey_doesTreeContainAny (symbolKey_symbolTree t, symbolKey_isSymbol p);
+EXTERN bool symbolKey_doesTreeContainAny (symbolKey_symbolTree t, symbolKey_isSymbol p);
/*
foreachNodeDo - for each node in symbolTree, t, a procedure, p,
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
if, t, supports, f.
*/
-EXTERN unsigned int termios_GetFlag (termios_TERMIOS t, termios_Flag f, unsigned int *b);
+EXTERN bool termios_GetFlag (termios_TERMIOS t, termios_Flag f, bool *b);
/*
SetFlag - sets a flag value in, t, to, b, and returns TRUE if
this flag value is supported.
*/
-EXTERN unsigned int termios_SetFlag (termios_TERMIOS t, termios_Flag f, unsigned int b);
+EXTERN bool termios_SetFlag (termios_TERMIOS t, termios_Flag f, bool b);
/*
GetChar - sets a CHAR, ch, value from, t, and returns TRUE if
this value is supported.
*/
-EXTERN unsigned int termios_GetChar (termios_TERMIOS t, termios_ControlChar c, char *ch);
+EXTERN bool termios_GetChar (termios_TERMIOS t, termios_ControlChar c, char *ch);
/*
SetChar - sets a CHAR value in, t, and returns TRUE if, c,
is supported.
*/
-EXTERN unsigned int termios_SetChar (termios_TERMIOS t, termios_ControlChar c, char ch);
+EXTERN bool termios_SetChar (termios_TERMIOS t, termios_ControlChar c, char ch);
# ifdef __cplusplus
}
# endif
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
isItemInList - returns true if a WORD, c, was found in wlist, l.
*/
-extern "C" unsigned int wlists_isItemInList (wlists_wlist l, unsigned int c);
+extern "C" bool wlists_isItemInList (wlists_wlist l, unsigned int c);
/*
foreachItemInListDo - calls procedure, P, foreach item in wlist, l.
{
wlists_wlist p;
unsigned int i;
- unsigned int found;
+ bool found;
if (l != NULL)
{
- found = FALSE;
+ found = false;
p = NULL;
do {
i = 1;
}
if ((i <= l->noOfElements) && (l->elements.array[i-1] == c))
{
- found = TRUE;
+ found = true;
}
else
{
isItemInList - returns true if a WORD, c, was found in wlist, l.
*/
-extern "C" unsigned int wlists_isItemInList (wlists_wlist l, unsigned int c)
+extern "C" bool wlists_isItemInList (wlists_wlist l, unsigned int c)
{
unsigned int i;
{
if (l->elements.array[i-1] == c)
{
- return TRUE;
+ return true;
}
else
{
}
l = l->next;
} while (! (l == NULL));
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
isItemInList - returns true if a WORD, c, was found in wlist, l.
*/
-EXTERN unsigned int wlists_isItemInList (wlists_wlist l, unsigned int c);
+EXTERN bool wlists_isItemInList (wlists_wlist l, unsigned int c);
/*
foreachItemInListDo - calls procedure, P, foreach item in wlist, l.
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
FROM mcOptions IMPORT getOutputFile, getDebugTopological, getHPrefix, getIgnoreFQ,
getExtendedOpaque, writeGPLheader, getGccConfigSystem,
- getScaffoldDynamic, getScaffoldMain, getSuppressNoReturn ;
+ getScaffoldDynamic, getScaffoldMain, getSuppressNoReturn,
+ useBool ;
FROM FormatStrings IMPORT Sprintf0, Sprintf1, Sprintf2, Sprintf3 ;
FROM libc IMPORT printf, memset ;
PROCEDURE outTrue (p: pretty) ;
BEGIN
keyc.useTrue ;
- outText (p, 'TRUE')
+ IF useBool () AND (lang = ansiCP)
+ THEN
+ outText (p, 'true')
+ ELSE
+ outText (p, 'TRUE')
+ END
END outTrue ;
PROCEDURE outFalse (p: pretty) ;
BEGIN
keyc.useFalse ;
- outText (p, 'FALSE')
+ IF useBool () AND (lang = ansiCP)
+ THEN
+ outText (p, 'false')
+ ELSE
+ outText (p, 'FALSE')
+ END
END outFalse ;
END isBase ;
+(*
+ doBoolC -
+*)
+
+PROCEDURE doBoolC (p: pretty) ;
+BEGIN
+ IF useBool ()
+ THEN
+ outText (p, 'bool')
+ ELSE
+ outText (p, 'unsigned int')
+ END
+END doBoolC ;
+
+
(*
doBaseC -
*)
longreal : outText (p, 'long double') |
shortreal : outText (p, 'float') |
bitset : outText (p, 'unsigned int') |
- boolean : outText (p, 'unsigned int') |
+ boolean : doBoolC (p) |
proc : outText (p, 'PROC')
END ;
Mark, string, InitStringCharStar ;
FROM symbolKey IMPORT symbolTree, getSymKey, putSymKey, initTree, killTree ;
FROM nameKey IMPORT makeKey, makekey, keyToCharStar ;
-FROM mcOptions IMPORT getHPrefix, getGccConfigSystem ;
+FROM mcOptions IMPORT getHPrefix, getGccConfigSystem, useBool ;
TYPE
END fixNullPointerConst ;
+(*
+ genBool -
+*)
+
+PROCEDURE genBool (p: pretty) ;
+BEGIN
+ IF useBool ()
+ THEN
+ print (p, '#include <stdbool.h>\n') ;
+ END
+END genBool ;
+
+
(*
genDefs - generate definitions or includes for all
macros and prototypes used.
PROCEDURE genDefs (p: pretty) ;
BEGIN
+ genBool (p) ;
checkFreeMalloc (p) ;
checkProc (p) ;
checkTrue (p) ;
PROCEDURE getSuppressNoReturn () : BOOLEAN ;
+(*
+ useBool - should mc use the bool type instead of int.
+*)
+
+PROCEDURE useBool () : BOOLEAN ;
+
+
END mcOptions.
arrayRuntime,
returnRuntime,
suppressNoReturn,
+ useBoolType,
gccConfigSystem,
ignoreFQ,
debugTopological,
END getScaffoldMain ;
+(*
+ useBool - should mc use the bool type instead of int.
+*)
+
+PROCEDURE useBool () : BOOLEAN ;
+BEGIN
+ RETURN useBoolType
+END useBool ;
+
+
(*
optionIs - returns TRUE if the first len (right) characters
match left.
scaffoldMain := FALSE ;
scaffoldDynamic := FALSE ;
suppressNoReturn := FALSE ;
+ useBoolType := TRUE ;
hPrefix := InitString ('') ;
cppArgs := InitString ('') ;
cppProgram := InitString ('') ;
BEGIN
r := 0 ;
a := 1.0 / 0.0 ;
- IF NOT isfinite (a)
+ IF isfinite (a) = 0
THEN
printf ("detected infinite number\n")
ELSE
r := 1
END ;
a := 1.0 / 1.0 ;
- IF isfinite (a)
+ IF isfinite (a) = 1
THEN
printf ("detected finite number\n")
ELSE
printf ("all tests passed\n")
END ;
exit (r)
-
END limittests.