public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6614] [PR modula2/109089] implementation of boolean should be C++/C bool
@ 2023-03-12 13:27 Gaius Mulley
0 siblings, 0 replies; only message in thread
From: Gaius Mulley @ 2023-03-12 13:27 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:431c06691dcbb84c7d999d91202537442e6a60f0
commit r13-6614-g431c06691dcbb84c7d999d91202537442e6a60f0
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date: Sun Mar 12 13:27:23 2023 +0000
[PR modula2/109089] implementation of boolean should be C++/C bool
[PR modula2/109089]. This patch implements BOOLEAN using bool
(boolean_type_node) thoughout cc1gm2. The patch also includes a
patched version of the bootstrap tool mc.
gcc/ChangeLog:
* doc/gm2.texi (Elementary data types): Equivalence BOOLEAN with
bool.
gcc/m2/ChangeLog:
PR modula2/109089
* gm2-compiler/M2GCCDeclare.mod (DeclareKnownType): Import.
* gm2-gcc/gcc-consolidation.h (stdbool.h): Include.
* gm2-gcc/init.h (defined): Change block start.
* gm2-gcc/m2block.cc: Change FALSE to false, change TRUE to true.
* gm2-gcc/m2block.h: Change int to bool.
* gm2-gcc/m2builtins.cc: Ditto.
* gm2-gcc/m2builtins.h: Ditto.
* gm2-gcc/m2convert.cc: Change FALSE to false, TRUE to true and
int to bool.
* gm2-gcc/m2convert.h: Change int to bool.
* gm2-gcc/m2decl.cc: Change int to bool.
* gm2-gcc/m2decl.h: Change int to bool.
* gm2-gcc/m2expr.cc: Change FALSE to false, TRUE to true and
int to bool.
* gm2-gcc/m2expr.h: Change int to bool.
* gm2-gcc/m2statement.cc: Change FALSE to false, TRUE to true and
int to bool.
* gm2-gcc/m2statement.h: Change int to bool.
* gm2-gcc/m2top.cc: Change int to bool.
* gm2-gcc/m2top.h: Change int to bool.
* gm2-gcc/m2tree.cc: Change int to bool.
* gm2-gcc/m2tree.h: Change int to bool.
* gm2-gcc/m2type.cc: Change int to bool.
* gm2-gcc/m2type.h: Change int to bool.
* gm2-lang.cc (convert_loc): Call convert_to_integer for BOOLEAN_TYPE.
* gm2-libs/Builtins.def (isfinitef): Change return value from
BOOLEAN to INTEGER.
(isfinite): Ditto.
(isfinitel): Ditto.
* gm2-libs/Builtins.mod (isfinitef): Change return value from
BOOLEAN to INTEGER.
(isfinite): Ditto.
(isfinitel): Ditto.
* mc-boot/GASCII.cc: Rebuild.
* mc-boot/GASCII.h: Rebuild.
* mc-boot/GArgs.cc: Rebuild.
* mc-boot/GArgs.h: Rebuild.
* mc-boot/GAssertion.cc: Rebuild.
* mc-boot/GAssertion.h: Rebuild.
* mc-boot/GBreak.cc: Rebuild.
* mc-boot/GBreak.h: Rebuild.
* mc-boot/GCOROUTINES.h: Rebuild.
* mc-boot/GCmdArgs.cc: Rebuild.
* mc-boot/GCmdArgs.h: Rebuild.
* mc-boot/GDebug.cc: Rebuild.
* mc-boot/GDebug.h: Rebuild.
* mc-boot/GDynamicStrings.cc: Rebuild.
* mc-boot/GDynamicStrings.h: Rebuild.
* mc-boot/GEnvironment.cc: Rebuild.
* mc-boot/GEnvironment.h: Rebuild.
* mc-boot/GFIO.cc: Rebuild.
* mc-boot/GFIO.h: Rebuild.
* mc-boot/GFormatStrings.cc: Rebuild.
* mc-boot/GFormatStrings.h: Rebuild.
* mc-boot/GFpuIO.cc: Rebuild.
* mc-boot/GFpuIO.h: Rebuild.
* mc-boot/GIO.cc: Rebuild.
* mc-boot/GIO.h: Rebuild.
* mc-boot/GIndexing.cc: Rebuild.
* mc-boot/GIndexing.h: Rebuild.
* mc-boot/GM2Dependent.cc: Rebuild.
* mc-boot/GM2Dependent.h: Rebuild.
* mc-boot/GM2EXCEPTION.cc: Rebuild.
* mc-boot/GM2EXCEPTION.h: Rebuild.
* mc-boot/GM2LINK.h: Rebuild.
* mc-boot/GM2RTS.cc: Rebuild.
* mc-boot/GM2RTS.h: Rebuild.
* mc-boot/GMemUtils.cc: Rebuild.
* mc-boot/GMemUtils.h: Rebuild.
* mc-boot/GNumberIO.cc: Rebuild.
* mc-boot/GNumberIO.h: Rebuild.
* mc-boot/GPushBackInput.cc: Rebuild.
* mc-boot/GPushBackInput.h: Rebuild.
* mc-boot/GRTExceptions.cc: Rebuild.
* mc-boot/GRTExceptions.h: Rebuild.
* mc-boot/GRTco.h: Rebuild.
* mc-boot/GRTentity.h: Rebuild.
* mc-boot/GRTint.cc: Rebuild.
* mc-boot/GRTint.h: Rebuild.
* mc-boot/GSArgs.cc: Rebuild.
* mc-boot/GSArgs.h: Rebuild.
* mc-boot/GSFIO.cc: Rebuild.
* mc-boot/GSFIO.h: Rebuild.
* mc-boot/GSYSTEM.h: Rebuild.
* mc-boot/GSelective.h: Rebuild.
* mc-boot/GStdIO.cc: Rebuild.
* mc-boot/GStdIO.h: Rebuild.
* mc-boot/GStorage.cc: Rebuild.
* mc-boot/GStorage.h: Rebuild.
* mc-boot/GStrCase.cc: Rebuild.
* mc-boot/GStrCase.h: Rebuild.
* mc-boot/GStrIO.cc: Rebuild.
* mc-boot/GStrIO.h: Rebuild.
* mc-boot/GStrLib.cc: Rebuild.
* mc-boot/GStrLib.h: Rebuild.
* mc-boot/GStringConvert.cc: Rebuild.
* mc-boot/GStringConvert.h: Rebuild.
* mc-boot/GSysExceptions.h: Rebuild.
* mc-boot/GSysStorage.cc: Rebuild.
* mc-boot/GSysStorage.h: Rebuild.
* mc-boot/GTimeString.cc: Rebuild.
* mc-boot/GTimeString.h: Rebuild.
* mc-boot/GUnixArgs.h: Rebuild.
* mc-boot/Galists.cc: Rebuild.
* mc-boot/Galists.h: Rebuild.
* mc-boot/Gdecl.cc: Rebuild.
* mc-boot/Gdecl.h: Rebuild.
* mc-boot/Gdtoa.h: Rebuild.
* mc-boot/Gerrno.h: Rebuild.
* mc-boot/Gkeyc.cc: Rebuild.
* mc-boot/Gkeyc.h: Rebuild.
* mc-boot/Gldtoa.h: Rebuild.
* mc-boot/Glibc.h: Rebuild.
* mc-boot/Glibm.h: Rebuild.
* mc-boot/Glists.cc: Rebuild.
* mc-boot/Glists.h: Rebuild.
* mc-boot/GmcComment.cc: Rebuild.
* mc-boot/GmcComment.h: Rebuild.
* mc-boot/GmcComp.cc: Rebuild.
* mc-boot/GmcComp.h: Rebuild.
* mc-boot/GmcDebug.cc: Rebuild.
* mc-boot/GmcDebug.h: Rebuild.
* mc-boot/GmcError.cc: Rebuild.
* mc-boot/GmcError.h: Rebuild.
* mc-boot/GmcFileName.cc: Rebuild.
* mc-boot/GmcFileName.h: Rebuild.
* mc-boot/GmcLexBuf.cc: Rebuild.
* mc-boot/GmcLexBuf.h: Rebuild.
* mc-boot/GmcMetaError.cc: Rebuild.
* mc-boot/GmcMetaError.h: Rebuild.
* mc-boot/GmcOptions.cc: Rebuild.
* mc-boot/GmcOptions.h: Rebuild.
* mc-boot/GmcPreprocess.cc: Rebuild.
* mc-boot/GmcPreprocess.h: Rebuild.
* mc-boot/GmcPretty.cc: Rebuild.
* mc-boot/GmcPretty.h: Rebuild.
* mc-boot/GmcPrintf.cc: Rebuild.
* mc-boot/GmcPrintf.h: Rebuild.
* mc-boot/GmcQuiet.cc: Rebuild.
* mc-boot/GmcQuiet.h: Rebuild.
* mc-boot/GmcReserved.cc: Rebuild.
* mc-boot/GmcReserved.h: Rebuild.
* mc-boot/GmcSearch.cc: Rebuild.
* mc-boot/GmcSearch.h: Rebuild.
* mc-boot/GmcStack.cc: Rebuild.
* mc-boot/GmcStack.h: Rebuild.
* mc-boot/GmcStream.cc: Rebuild.
* mc-boot/GmcStream.h: Rebuild.
* mc-boot/Gmcflex.h: Rebuild.
* mc-boot/Gmcp1.cc: Rebuild.
* mc-boot/Gmcp1.h: Rebuild.
* mc-boot/Gmcp2.cc: Rebuild.
* mc-boot/Gmcp2.h: Rebuild.
* mc-boot/Gmcp3.cc: Rebuild.
* mc-boot/Gmcp3.h: Rebuild.
* mc-boot/Gmcp4.cc: Rebuild.
* mc-boot/Gmcp4.h: Rebuild.
* mc-boot/Gmcp5.cc: Rebuild.
* mc-boot/Gmcp5.h: Rebuild.
* mc-boot/GnameKey.cc: Rebuild.
* mc-boot/GnameKey.h: Rebuild.
* mc-boot/GsymbolKey.cc: Rebuild.
* mc-boot/GsymbolKey.h: Rebuild.
* mc-boot/Gtermios.h: Rebuild.
* mc-boot/Gtop.cc: Rebuild.
* mc-boot/Gvarargs.cc: Rebuild.
* mc-boot/Gvarargs.h: Rebuild.
* mc-boot/Gwlists.cc: Rebuild.
* mc-boot/Gwlists.h: Rebuild.
* mc-boot/Gwrapc.h: Rebuild.
* mc/decl.mod (doBoolC): New procedure.
(doBaseC): Call doBoolC.
* mc/keyc.mod: Import useBool.
(genBool): New procedure.
(genDefs): Call genBool.
* mc/mcOptions.def (useBool): New procedure.
* mc/mcOptions.mod (useBool): New procedure.
(useBoolType): New variable.
(optionIs): Assign useBoolType to TRUE.
gcc/testsuite/ChangeLog:
PR modula2/109089
* gm2/pimlib/run/pass/limittests.mod: Rewritten to reflect
the external definitions of isfinite.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diff:
---
gcc/doc/gm2.texi | 2 +-
gcc/m2/gm2-compiler/M2GCCDeclare.mod | 2 +-
gcc/m2/gm2-gcc/gcc-consolidation.h | 1 +
gcc/m2/gm2-gcc/init.h | 7 +-
gcc/m2/gm2-gcc/m2block.cc | 36 +-
gcc/m2/gm2-gcc/m2block.h | 4 +-
gcc/m2/gm2-gcc/m2builtins.cc | 2 +-
gcc/m2/gm2-gcc/m2builtins.h | 4 +-
gcc/m2/gm2-gcc/m2convert.cc | 50 +-
gcc/m2/gm2-gcc/m2convert.h | 2 +-
gcc/m2/gm2-gcc/m2decl.cc | 16 +-
gcc/m2/gm2-gcc/m2decl.h | 14 +-
gcc/m2/gm2-gcc/m2expr.cc | 480 ++++----
gcc/m2/gm2-gcc/m2expr.h | 82 +-
gcc/m2/gm2-gcc/m2statement.cc | 124 +-
gcc/m2/gm2-gcc/m2statement.h | 20 +-
gcc/m2/gm2-gcc/m2top.cc | 2 +-
gcc/m2/gm2-gcc/m2top.h | 2 +-
gcc/m2/gm2-gcc/m2tree.cc | 10 +-
gcc/m2/gm2-gcc/m2tree.h | 13 +-
gcc/m2/gm2-gcc/m2type.cc | 154 +--
gcc/m2/gm2-gcc/m2type.h | 24 +-
gcc/m2/gm2-lang.cc | 2 +-
gcc/m2/gm2-libs/Builtins.def | 6 +-
gcc/m2/gm2-libs/Builtins.mod | 12 +-
gcc/m2/mc-boot/GASCII.cc | 1 +
gcc/m2/mc-boot/GASCII.h | 1 +
gcc/m2/mc-boot/GArgs.cc | 5 +-
gcc/m2/mc-boot/GArgs.h | 3 +-
gcc/m2/mc-boot/GAssertion.cc | 5 +-
gcc/m2/mc-boot/GAssertion.h | 3 +-
gcc/m2/mc-boot/GBreak.cc | 1 +
gcc/m2/mc-boot/GBreak.h | 1 +
gcc/m2/mc-boot/GCOROUTINES.h | 1 +
gcc/m2/mc-boot/GCmdArgs.cc | 27 +-
gcc/m2/mc-boot/GCmdArgs.h | 3 +-
gcc/m2/mc-boot/GDebug.cc | 1 +
gcc/m2/mc-boot/GDebug.h | 1 +
gcc/m2/mc-boot/GDynamicStrings.cc | 111 +-
gcc/m2/mc-boot/GDynamicStrings.h | 11 +-
gcc/m2/mc-boot/GEnvironment.cc | 9 +-
gcc/m2/mc-boot/GEnvironment.h | 5 +-
gcc/m2/mc-boot/GFIO.cc | 127 +-
gcc/m2/mc-boot/GFIO.h | 19 +-
gcc/m2/mc-boot/GFormatStrings.cc | 27 +-
gcc/m2/mc-boot/GFormatStrings.h | 1 +
gcc/m2/mc-boot/GFpuIO.cc | 7 +-
gcc/m2/mc-boot/GFpuIO.h | 1 +
gcc/m2/mc-boot/GIO.cc | 113 +-
gcc/m2/mc-boot/GIO.h | 9 +-
gcc/m2/mc-boot/GIndexing.cc | 19 +-
gcc/m2/mc-boot/GIndexing.h | 5 +-
gcc/m2/mc-boot/GM2Dependent.cc | 103 +-
gcc/m2/mc-boot/GM2Dependent.h | 1 +
gcc/m2/mc-boot/GM2EXCEPTION.cc | 5 +-
gcc/m2/mc-boot/GM2EXCEPTION.h | 3 +-
gcc/m2/mc-boot/GM2LINK.h | 3 +-
gcc/m2/mc-boot/GM2RTS.cc | 33 +-
gcc/m2/mc-boot/GM2RTS.h | 5 +-
gcc/m2/mc-boot/GMemUtils.cc | 1 +
gcc/m2/mc-boot/GMemUtils.h | 1 +
gcc/m2/mc-boot/GNumberIO.cc | 81 +-
gcc/m2/mc-boot/GNumberIO.h | 1 +
gcc/m2/mc-boot/GPushBackInput.cc | 9 +-
gcc/m2/mc-boot/GPushBackInput.h | 3 +-
gcc/m2/mc-boot/GRTExceptions.cc | 19 +-
gcc/m2/mc-boot/GRTExceptions.h | 7 +-
gcc/m2/mc-boot/GRTco.h | 1 +
gcc/m2/mc-boot/GRTentity.h | 3 +-
gcc/m2/mc-boot/GRTint.cc | 41 +-
gcc/m2/mc-boot/GRTint.h | 3 +-
gcc/m2/mc-boot/GSArgs.cc | 9 +-
gcc/m2/mc-boot/GSArgs.h | 3 +-
gcc/m2/mc-boot/GSFIO.cc | 9 +-
gcc/m2/mc-boot/GSFIO.h | 5 +-
gcc/m2/mc-boot/GSYSTEM.h | 1 +
gcc/m2/mc-boot/GSelective.h | 3 +-
gcc/m2/mc-boot/GStdIO.cc | 1 +
gcc/m2/mc-boot/GStdIO.h | 1 +
gcc/m2/mc-boot/GStorage.cc | 5 +-
gcc/m2/mc-boot/GStorage.h | 3 +-
gcc/m2/mc-boot/GStrCase.cc | 1 +
gcc/m2/mc-boot/GStrCase.h | 1 +
gcc/m2/mc-boot/GStrIO.cc | 9 +-
gcc/m2/mc-boot/GStrIO.h | 1 +
gcc/m2/mc-boot/GStrLib.cc | 27 +-
gcc/m2/mc-boot/GStrLib.h | 7 +-
gcc/m2/mc-boot/GStringConvert.cc | 177 +--
gcc/m2/mc-boot/GStringConvert.h | 25 +-
gcc/m2/mc-boot/GSysExceptions.h | 1 +
gcc/m2/mc-boot/GSysStorage.cc | 23 +-
gcc/m2/mc-boot/GSysStorage.h | 3 +-
gcc/m2/mc-boot/GTimeString.cc | 1 +
gcc/m2/mc-boot/GTimeString.h | 1 +
gcc/m2/mc-boot/GUnixArgs.h | 1 +
gcc/m2/mc-boot/Galists.cc | 15 +-
gcc/m2/mc-boot/Galists.h | 3 +-
gcc/m2/mc-boot/Gdecl.cc | 1393 +++++++++++-----------
gcc/m2/mc-boot/Gdecl.h | 123 +-
gcc/m2/mc-boot/Gdtoa.h | 5 +-
gcc/m2/mc-boot/Gerrno.h | 1 +
gcc/m2/mc-boot/Gkeyc.cc | 265 ++--
gcc/m2/mc-boot/Gkeyc.h | 5 +-
gcc/m2/mc-boot/Gldtoa.h | 5 +-
gcc/m2/mc-boot/Glibc.h | 1 +
gcc/m2/mc-boot/Glibm.h | 1 +
gcc/m2/mc-boot/Glists.cc | 15 +-
gcc/m2/mc-boot/Glists.h | 3 +-
| 33 +-
| 9 +-
gcc/m2/mc-boot/GmcComp.cc | 41 +-
gcc/m2/mc-boot/GmcComp.h | 1 +
gcc/m2/mc-boot/GmcDebug.cc | 5 +-
gcc/m2/mc-boot/GmcDebug.h | 3 +-
gcc/m2/mc-boot/GmcError.cc | 55 +-
gcc/m2/mc-boot/GmcError.h | 1 +
gcc/m2/mc-boot/GmcFileName.cc | 1 +
gcc/m2/mc-boot/GmcFileName.h | 1 +
gcc/m2/mc-boot/GmcLexBuf.cc | 51 +-
gcc/m2/mc-boot/GmcLexBuf.h | 3 +-
gcc/m2/mc-boot/GmcMetaError.cc | 57 +-
gcc/m2/mc-boot/GmcMetaError.h | 1 +
gcc/m2/mc-boot/GmcOptions.cc | 215 ++--
gcc/m2/mc-boot/GmcOptions.h | 31 +-
gcc/m2/mc-boot/GmcPreprocess.cc | 1 +
gcc/m2/mc-boot/GmcPreprocess.h | 1 +
gcc/m2/mc-boot/GmcPretty.cc | 21 +-
gcc/m2/mc-boot/GmcPretty.h | 1 +
gcc/m2/mc-boot/GmcPrintf.cc | 15 +-
gcc/m2/mc-boot/GmcPrintf.h | 1 +
gcc/m2/mc-boot/GmcQuiet.cc | 1 +
gcc/m2/mc-boot/GmcQuiet.h | 1 +
gcc/m2/mc-boot/GmcReserved.cc | 1 +
gcc/m2/mc-boot/GmcReserved.h | 1 +
gcc/m2/mc-boot/GmcSearch.cc | 23 +-
gcc/m2/mc-boot/GmcSearch.h | 7 +-
gcc/m2/mc-boot/GmcStack.cc | 1 +
gcc/m2/mc-boot/GmcStack.h | 1 +
gcc/m2/mc-boot/GmcStream.cc | 7 +-
gcc/m2/mc-boot/GmcStream.h | 1 +
gcc/m2/mc-boot/Gmcflex.h | 3 +-
gcc/m2/mc-boot/Gmcp1.cc | 47 +-
gcc/m2/mc-boot/Gmcp1.h | 3 +-
gcc/m2/mc-boot/Gmcp2.cc | 35 +-
gcc/m2/mc-boot/Gmcp2.h | 3 +-
gcc/m2/mc-boot/Gmcp3.cc | 51 +-
gcc/m2/mc-boot/Gmcp3.h | 3 +-
gcc/m2/mc-boot/Gmcp4.cc | 35 +-
gcc/m2/mc-boot/Gmcp4.h | 3 +-
gcc/m2/mc-boot/Gmcp5.cc | 43 +-
gcc/m2/mc-boot/Gmcp5.h | 3 +-
gcc/m2/mc-boot/GnameKey.cc | 17 +-
gcc/m2/mc-boot/GnameKey.h | 5 +-
gcc/m2/mc-boot/GsymbolKey.cc | 17 +-
gcc/m2/mc-boot/GsymbolKey.h | 7 +-
gcc/m2/mc-boot/Gtermios.h | 9 +-
gcc/m2/mc-boot/Gtop.cc | 1 +
gcc/m2/mc-boot/Gvarargs.cc | 1 +
gcc/m2/mc-boot/Gvarargs.h | 1 +
gcc/m2/mc-boot/Gwlists.cc | 15 +-
gcc/m2/mc-boot/Gwlists.h | 3 +-
gcc/m2/mc-boot/Gwrapc.h | 1 +
gcc/m2/mc/decl.mod | 34 +-
gcc/m2/mc/keyc.mod | 16 +-
gcc/m2/mc/mcOptions.def | 7 +
gcc/m2/mc/mcOptions.mod | 12 +
gcc/testsuite/gm2/pimlib/run/pass/limittests.mod | 5 +-
167 files changed, 2667 insertions(+), 2369 deletions(-)
diff --git a/gcc/doc/gm2.texi b/gcc/doc/gm2.texi
index 07729f84e7b..c08bb89ac68 100644
--- a/gcc/doc/gm2.texi
+++ b/gcc/doc/gm2.texi
@@ -814,7 +814,7 @@ SHORTINT short int
CARDINAL unsigned int
LONGCARD long long unsigned int
SHORTCARD short unsigned int
-BOOLEAN int
+BOOLEAN bool
REAL double
LONGREAL long double
SHORTREAL float
diff --git a/gcc/m2/gm2-compiler/M2GCCDeclare.mod b/gcc/m2/gm2-compiler/M2GCCDeclare.mod
index ef1859f46e7..f6fb2396789 100644
--- a/gcc/m2/gm2-compiler/M2GCCDeclare.mod
+++ b/gcc/m2/gm2-compiler/M2GCCDeclare.mod
@@ -179,7 +179,7 @@ FROM m2type IMPORT MarkFunctionReferenced, BuildStartRecord, BuildStartVarient,
SetRecordFieldOffset, ChainOn, BuildEndRecord, BuildFieldRecord,
BuildEndFieldVarient, BuildArrayIndexType, BuildEndFunctionType,
BuildSetType, BuildEndVarient, BuildEndArrayType, InitFunctionTypeParameters,
- BuildProcTypeParameterDeclaration,
+ BuildProcTypeParameterDeclaration, DeclareKnownType,
ValueOutOfTypeRange, ExceedsTypeRange ;
FROM m2convert IMPORT BuildConvert ;
diff --git a/gcc/m2/gm2-gcc/gcc-consolidation.h b/gcc/m2/gm2-gcc/gcc-consolidation.h
index 33ef4c1ed85..6abb1825883 100644
--- a/gcc/m2/gm2-gcc/gcc-consolidation.h
+++ b/gcc/m2/gm2-gcc/gcc-consolidation.h
@@ -90,3 +90,4 @@ along with GNU Modula-2; see the file COPYING3. If not see
#include "ipa-ref.h"
#include "cgraph.h"
#include "stmt.h"
+#include <stdbool.h>
diff --git a/gcc/m2/gm2-gcc/init.h b/gcc/m2/gm2-gcc/init.h
index 6580cbde77e..bb8c7a1f83e 100644
--- a/gcc/m2/gm2-gcc/init.h
+++ b/gcc/m2/gm2-gcc/init.h
@@ -24,12 +24,13 @@ along with GNU Modula-2; see the file COPYING3. If not see
#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. */
diff --git a/gcc/m2/gm2-gcc/m2block.cc b/gcc/m2/gm2-gcc/m2block.cc
index 69e03453182..d2d8946fa5d 100644
--- a/gcc/m2/gm2-gcc/m2block.cc
+++ b/gcc/m2/gm2-gcc/m2block.cc
@@ -112,7 +112,7 @@ typedef struct stmt_tree_s *stmt_tree_t;
#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. */
@@ -215,8 +215,8 @@ m2block_cur_stmt_list (void)
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
@@ -280,7 +280,7 @@ findLevel (tree fndecl)
b = newLevel ();
b->fndecl = fndecl;
b->context = fndecl;
- b->is_global = FALSE;
+ b->is_global = false;
b->list = head_binding_level;
b->next = NULL;
}
@@ -414,14 +414,14 @@ m2block_finishFunctionDecl (location_t location, tree fndecl)
{
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)
{
@@ -647,16 +647,16 @@ m2block_RememberInitModuleFunction (tree t)
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. */
@@ -711,12 +711,12 @@ flush_pending_note (void)
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);
}
}
@@ -732,7 +732,7 @@ m2block_add_stmt (location_t location, tree t)
if (pending_statement && (pending_location != location))
flush_pending_note ();
- pending_statement = FALSE;
+ pending_statement = false;
return do_add_stmt (t);
}
@@ -746,14 +746,14 @@ m2block_addStmtNote (location_t location)
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. */
@@ -763,7 +763,7 @@ m2block_init (void)
{
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;
}
diff --git a/gcc/m2/gm2-gcc/m2block.h b/gcc/m2/gm2-gcc/m2block.h
index 9d6922bd9e2..f5fbb387ba9 100644
--- a/gcc/m2/gm2-gcc/m2block.h
+++ b/gcc/m2/gm2-gcc/m2block.h
@@ -35,6 +35,8 @@ along with GNU Modula-2; see the file COPYING3. If not see
#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);
@@ -55,7 +57,7 @@ EXTERN tree m2block_RememberConstant (tree t);
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);
diff --git a/gcc/m2/gm2-gcc/m2builtins.cc b/gcc/m2/gm2-gcc/m2builtins.cc
index 2df6e546159..b9ac7fc5da4 100644
--- a/gcc/m2/gm2-gcc/m2builtins.cc
+++ b/gcc/m2/gm2-gcc/m2builtins.cc
@@ -801,7 +801,7 @@ m2builtins_BuiltInIsfinite (location_t location, tree expression)
/* BuiltinExists - returns TRUE if the builtin function, name, exists
for this target architecture. */
-int
+bool
m2builtins_BuiltinExists (char *name)
{
struct builtin_function_entry *fe;
diff --git a/gcc/m2/gm2-gcc/m2builtins.h b/gcc/m2/gm2-gcc/m2builtins.h
index 5de9753a8d5..487a41af3a2 100644
--- a/gcc/m2/gm2-gcc/m2builtins.h
+++ b/gcc/m2/gm2-gcc/m2builtins.h
@@ -36,6 +36,8 @@ along with GNU Modula-2; see the file COPYING3. If not see
#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);
@@ -45,7 +47,7 @@ EXTERN tree m2builtins_BuiltInMemCopy (location_t location, tree dest,
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);
diff --git a/gcc/m2/gm2-gcc/m2convert.cc b/gcc/m2/gm2-gcc/m2convert.cc
index fa09be38a61..f806669dc39 100644
--- a/gcc/m2/gm2-gcc/m2convert.cc
+++ b/gcc/m2/gm2-gcc/m2convert.cc
@@ -352,12 +352,12 @@ converting_ISO_generic (location_t location, tree type, tree value,
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))
@@ -368,7 +368,7 @@ converting_ISO_generic (location_t location, tree type, tree value,
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)
{
@@ -376,10 +376,10 @@ converting_ISO_generic (location_t location, tree type, tree value,
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
@@ -400,7 +400,7 @@ convert_char_to_array (location_t location, tree type, tree value)
/* 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)
@@ -408,7 +408,7 @@ convert_char_to_array (location_t location, tree type, tree value)
m2type_BuildArrayConstructorElement (
c, m2type_BuildCharConstant (location, &nul[0]), i);
i = m2expr_BuildAdd (location, i, m2decl_BuildIntegerConstant (1),
- FALSE);
+ false);
}
return m2type_BuildEndArrayConstructor (c);
}
@@ -431,7 +431,7 @@ convert_string_to_array (location_t location, tree type, tree value)
tree
m2convert_BuildConvert (location_t location, tree type, tree value,
- int checkOverflow)
+ bool checkOverflow)
{
type = m2tree_skip_type_decl (type);
tree t;
@@ -444,7 +444,7 @@ m2convert_BuildConvert (location_t location, tree type, tree value,
&& (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,
@@ -516,35 +516,35 @@ const_to_ISO_aggregate_type (location_t location, tree expr, tree iso_type)
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);
@@ -568,7 +568,7 @@ m2convert_ConvertConstantAndCheck (location_t location, tree type, tree expr)
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 ()
@@ -586,7 +586,7 @@ m2convert_ConvertConstantAndCheck (location_t location, tree type, tree expr)
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. */
@@ -595,7 +595,7 @@ tree
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
@@ -608,7 +608,7 @@ m2convert_convertToPtr (location_t location, tree type)
return type;
else
return m2convert_BuildConvert (location, m2type_GetPointerType (), type,
- FALSE);
+ false);
}
/* ToInteger - convert an expression, expr, to an INTEGER. */
@@ -617,7 +617,7 @@ tree
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. */
@@ -626,7 +626,7 @@ tree
m2convert_ToBitset (location_t location, tree expr)
{
return m2convert_BuildConvert (location, m2type_GetBitsetType (), expr,
- FALSE);
+ false);
}
/* ToLoc - convert an expression, expr, to a LOC. */
@@ -635,7 +635,7 @@ tree
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
diff --git a/gcc/m2/gm2-gcc/m2convert.h b/gcc/m2/gm2-gcc/m2convert.h
index fc3a5b9f8e5..1d9dc75fcb2 100644
--- a/gcc/m2/gm2-gcc/m2convert.h
+++ b/gcc/m2/gm2-gcc/m2convert.h
@@ -36,7 +36,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#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,
diff --git a/gcc/m2/gm2-gcc/m2decl.cc b/gcc/m2/gm2-gcc/m2decl.cc
index eb3d98d0783..8f814dbc5a5 100644
--- a/gcc/m2/gm2-gcc/m2decl.cc
+++ b/gcc/m2/gm2-gcc/m2decl.cc
@@ -77,8 +77,8 @@ m2decl_DeclareM2linkForcedModuleInitOrder (location_t location,
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;
@@ -165,7 +165,7 @@ m2decl_DeclareKnownConstant (location_t location, tree type, tree value)
tree
m2decl_BuildParameterDeclaration (location_t location, char *name, tree type,
- int isreference)
+ bool isreference)
{
tree parm_decl;
@@ -210,8 +210,8 @@ m2decl_BuildStartFunctionDeclaration (int uses_varargs)
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;
@@ -290,7 +290,7 @@ m2decl_DeclareModuleCtor (tree decl)
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;
@@ -311,8 +311,8 @@ m2decl_BuildConstLiteralNumber (location_t location, const char *str, unsigned i
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;
diff --git a/gcc/m2/gm2-gcc/m2decl.h b/gcc/m2/gm2-gcc/m2decl.h
index 19dbb7be4e1..465f7d13f02 100644
--- a/gcc/m2/gm2-gcc/m2decl.h
+++ b/gcc/m2/gm2-gcc/m2decl.h
@@ -52,22 +52,22 @@ EXTERN tree m2decl_BuildConstLiteralNumber (location_t location,
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,
diff --git a/gcc/m2/gm2-gcc/m2expr.cc b/gcc/m2/gm2-gcc/m2expr.cc
index f0a45c0123d..95e5d489a15 100644
--- a/gcc/m2/gm2-gcc/m2expr.cc
+++ b/gcc/m2/gm2-gcc/m2expr.cc
@@ -96,24 +96,24 @@ CheckAddressToCardinal (location_t location, tree op)
{
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. */
@@ -121,7 +121,7 @@ m2expr_BuildTruthOrIf (location_t location, tree a, tree b)
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
@@ -130,7 +130,7 @@ m2expr_BuildTruthNot (location_t location, tree expr)
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
@@ -139,7 +139,7 @@ m2expr_BuildPostInc (location_t location, tree op)
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. */
@@ -158,7 +158,7 @@ m2expr_BuildAddCheck (location_t location, tree op1, tree op2, tree lowest,
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);
}
@@ -166,7 +166,7 @@ m2expr_BuildAddCheck (location_t location, tree op1, tree op2, tree lowest,
/* 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;
@@ -198,7 +198,7 @@ m2expr_BuildSubCheck (location_t location, tree op1, tree op2, tree lowest,
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);
}
@@ -206,7 +206,7 @@ m2expr_BuildSubCheck (location_t location, tree op1, tree op2, tree lowest,
/* 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;
@@ -225,7 +225,7 @@ m2expr_BuildSub (location_t location, tree op1, tree op2, int needconvert)
/* 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;
@@ -257,7 +257,7 @@ m2expr_BuildDivTruncCheck (location_t location, tree op1, tree op2, tree lowest,
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);
}
@@ -278,7 +278,7 @@ m2expr_BuildModTruncCheck (location_t location, tree op1, tree op2, tree lowest,
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);
}
@@ -286,7 +286,7 @@ m2expr_BuildModTruncCheck (location_t location, tree op1, tree op2, tree lowest,
/* 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;
@@ -318,7 +318,7 @@ m2expr_BuildModCeilCheck (location_t location, tree op1, tree op2, tree lowest,
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);
}
@@ -339,7 +339,7 @@ m2expr_BuildModFloorCheck (location_t location, tree op1, tree op2, tree lowest,
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);
}
@@ -347,7 +347,7 @@ m2expr_BuildModFloorCheck (location_t location, tree op1, tree op2, tree lowest,
/* 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;
@@ -379,7 +379,7 @@ m2expr_BuildDivCeilCheck (location_t location, tree op1, tree op2, tree lowest,
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);
}
@@ -387,7 +387,7 @@ m2expr_BuildDivCeilCheck (location_t location, tree op1, tree op2, tree lowest,
/* 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;
@@ -406,7 +406,7 @@ m2expr_BuildModCeil (location_t location, tree op1, tree op2, int needconvert)
/* 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;
@@ -438,7 +438,7 @@ m2expr_BuildDivFloorCheck (location_t location, tree op1, tree op2, tree lowest,
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);
}
@@ -447,7 +447,7 @@ m2expr_BuildDivFloorCheck (location_t location, tree op1, tree op2, tree lowest,
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;
@@ -463,7 +463,7 @@ m2expr_BuildRDiv (location_t location, tree op1, tree op2, int needconvert)
/* 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;
@@ -482,7 +482,7 @@ m2expr_BuildModFloor (location_t location, tree op1, tree op2, int needconvert)
/* 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;
@@ -498,7 +498,7 @@ m2expr_BuildLSL (location_t location, tree op1, tree op2, int needconvert)
/* 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;
@@ -537,7 +537,7 @@ createUniqueLabel (void)
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;
@@ -557,7 +557,7 @@ m2expr_BuildLogicalShift (location_t location, tree op1, tree op2, tree op3,
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
@@ -573,7 +573,7 @@ m2expr_BuildLogicalShift (location_t location, tree op1, tree op2, tree op3,
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);
@@ -581,7 +581,7 @@ m2expr_BuildLogicalShift (location_t location, tree op1, tree op2, tree op3,
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);
}
@@ -590,7 +590,7 @@ m2expr_BuildLogicalShift (location_t location, tree op1, tree op2, tree op3,
/* 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;
@@ -606,7 +606,7 @@ m2expr_BuildLRL (location_t location, tree op1, tree op2, int needconvert)
/* 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;
@@ -623,7 +623,7 @@ m2expr_BuildLRR (location_t location, tree op1, tree op2, int needconvert)
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);
@@ -637,7 +637,7 @@ m2expr_BuildMask (location_t location, tree nBits, int needconvert)
tree
m2expr_BuildLRotate (location_t location, tree op1, tree nBits,
- int needconvert)
+ bool needconvert)
{
tree t;
@@ -652,7 +652,7 @@ m2expr_BuildLRotate (location_t location, tree op1, tree nBits,
tree
m2expr_BuildRRotate (location_t location, tree op1, tree nBits,
- int needconvert)
+ bool needconvert)
{
tree t;
@@ -667,7 +667,7 @@ m2expr_BuildRRotate (location_t location, tree op1, tree nBits,
tree
m2expr_BuildLRLn (location_t location, tree op1, tree op2, tree nBits,
- int needconvert)
+ bool needconvert)
{
tree op2min;
@@ -709,7 +709,7 @@ m2expr_BuildLRLn (location_t location, tree op1, tree op2, tree nBits,
tree
m2expr_BuildLRRn (location_t location, tree op1, tree op2, tree nBits,
- int needconvert)
+ bool needconvert)
{
tree op2min;
@@ -750,7 +750,7 @@ m2expr_BuildLRRn (location_t location, tree op1, tree op2, tree nBits,
void
m2expr_BuildLogicalRotate (location_t location, tree op1, tree op2, tree op3,
- tree nBits, int needconvert)
+ tree nBits, bool needconvert)
{
tree res;
@@ -817,14 +817,14 @@ buildUnboundedArrayOf (tree unbounded, tree contentsPtr, tree high)
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);
@@ -840,7 +840,7 @@ m2expr_BuildBinarySetDo (location_t location, tree settype, tree op1, tree op2,
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;
@@ -851,8 +851,8 @@ m2expr_BuildBinarySetDo (location_t location, tree settype, tree op1, tree op2,
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. */
@@ -860,13 +860,13 @@ m2expr_BuildBinarySetDo (location_t location, tree settype, tree op1, tree op2,
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:
@@ -883,13 +883,13 @@ m2expr_BuildBinarySetDo (location_t location, tree settype, tree op1, tree op2,
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 (
@@ -934,7 +934,7 @@ m2expr_ConstantExpressionWarning (tree value)
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. */
@@ -945,14 +945,14 @@ m2expr_TreeOverflow (tree 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
@@ -1101,10 +1101,10 @@ m2expr_BuildLessThanZero (location_t location, tree value, tree type, tree min,
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 (
@@ -1122,11 +1122,11 @@ m2expr_BuildGreaterThanZero (location_t location, tree value, tree type,
{
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 (
@@ -1144,11 +1144,11 @@ m2expr_BuildEqualToZero (location_t location, tree value, tree type, tree min,
{
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 (
@@ -1166,11 +1166,11 @@ m2expr_BuildNotEqualToZero (location_t location, tree value, tree type,
{
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 (
@@ -1189,10 +1189,10 @@ m2expr_BuildGreaterThanOrEqualZero (location_t location, tree value, tree type,
{
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 (
@@ -1211,10 +1211,10 @@ m2expr_BuildLessThanOrEqualZero (location_t location, tree value, tree type,
{
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 (
@@ -1289,15 +1289,15 @@ checkWholeNegateOverflow (location_t location,
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);
@@ -1337,10 +1337,10 @@ checkWholeAddOverflow (location_t location, tree i, tree j, tree lowest,
{
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
@@ -1368,10 +1368,10 @@ checkWholeSubOverflow (location_t location, tree i, tree j, tree lowest,
{
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
@@ -1382,7 +1382,7 @@ checkWholeSubOverflow (location_t location, tree i, tree j, tree lowest,
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
@@ -1393,7 +1393,7 @@ m2expr_Build4TruthAndIf (location_t location, tree a, tree b, tree c, tree d)
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
@@ -1403,7 +1403,7 @@ m2expr_Build3TruthAndIf (location_t location, tree op1, tree op2, tree op3)
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
@@ -1413,7 +1413,7 @@ m2expr_Build3TruthOrIf (location_t location, tree op1, tree op2, tree op3)
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
@@ -1425,18 +1425,18 @@ m2expr_Build4TruthOrIf (location_t location, tree op1, tree op2, tree op3,
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
@@ -1468,15 +1468,15 @@ testWholeMultOverflow (location_t location, tree lhs, tree rhs,
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);
@@ -1503,7 +1503,7 @@ checkWholeMultOverflow (location_t location, tree i, tree j, tree lowest,
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);
@@ -1575,13 +1575,13 @@ checkWholeDivTruncOverflow (location_t location, tree i, tree j, tree lowest,
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);
@@ -1626,7 +1626,7 @@ END divceilexpr ;
(*
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.
*)
@@ -1641,7 +1641,7 @@ END divCeilOverflowCases ;
(*
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.
*)
@@ -1654,7 +1654,7 @@ END divCeilOverflowPosPos ;
(*
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.
*)
@@ -1672,7 +1672,7 @@ END divCeilOverflowNegNeg ;
(*
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.
*)
@@ -1688,7 +1688,7 @@ END divCeilOverflowNegPos ;
(*
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.
*)
@@ -1722,11 +1722,11 @@ static tree
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);
@@ -1760,10 +1760,10 @@ static tree
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);
@@ -1799,10 +1799,10 @@ static tree
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);
@@ -1859,17 +1859,17 @@ divCeilOverflowNegNeg (location_t location, tree i, tree j, tree lowest,
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);
@@ -2026,8 +2026,8 @@ checkWholeModTruncOverflow (location_t location, tree i, tree j, tree lowest,
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);
@@ -2076,9 +2076,9 @@ checkWholeModCeilOverflow (location_t location,
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);
@@ -2129,9 +2129,9 @@ checkWholeModFloorOverflow (location_t location,
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);
@@ -2149,7 +2149,7 @@ checkWholeModFloorOverflow (location_t location,
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.
*)
@@ -2169,7 +2169,7 @@ END divFloorOverflow ;
(*
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.
*)
@@ -2184,7 +2184,7 @@ END divFloorOverflowCases ;
(*
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.
*)
@@ -2196,7 +2196,7 @@ END divFloorOverflowPosPos ;
(*
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.
*)
@@ -2212,7 +2212,7 @@ END divFloorOverflowNegNeg ;
(*
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.
*)
@@ -2227,7 +2227,7 @@ END divFloorOverflowNegPos ;
(*
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.
*)
@@ -2242,7 +2242,7 @@ END divFloorOverflowPosNeg ;
/* 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:
@@ -2254,14 +2254,14 @@ END divFloorOverflowPosNeg ;
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:
@@ -2291,9 +2291,9 @@ divFloorOverflowNegNeg (location_t location, tree i, tree j, tree lowest,
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);
@@ -2301,7 +2301,7 @@ divFloorOverflowNegNeg (location_t location, tree i, tree j, tree lowest,
/* 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:
@@ -2317,15 +2317,15 @@ divFloorOverflowNegNeg (location_t location, tree i, tree j, tree lowest,
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:
@@ -2338,14 +2338,14 @@ divFloorOverflowPosNeg (location_t location, tree i, tree j, tree min)
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:
@@ -2533,7 +2533,7 @@ m2expr_checkRealOverflow (location_t location, enum tree_code code,
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;
@@ -2654,7 +2654,7 @@ m2expr_BuildNegateCheck (location_t location, tree arg, tree lowest, tree min,
/* 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);
@@ -2666,21 +2666,21 @@ m2expr_BuildNegate (location_t location, tree op1, int needconvert)
/* 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);
@@ -2709,7 +2709,7 @@ m2expr_BuildMultCheck (location_t location, tree op1, tree op2, tree lowest,
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);
}
@@ -2726,7 +2726,7 @@ testLimits (location_t location, tree type, tree min, tree max)
&& (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;
}
@@ -2760,7 +2760,7 @@ getMax (tree a, tree b)
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);
@@ -2773,19 +2773,19 @@ calcNbits (location_t location, tree min, tree max)
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;
}
@@ -2808,16 +2808,16 @@ m2expr_BuildTBitSize (location_t location, tree type)
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);
}
}
@@ -2825,18 +2825,18 @@ m2expr_BuildTBitSize (location_t location, tree type)
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);
@@ -2862,7 +2862,7 @@ m2expr_BuildAddr (location_t location, tree op1, int use_generic)
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,
@@ -2911,7 +2911,7 @@ expression is returned. */
tree
m2expr_BuildOffset (location_t location, tree record, tree field,
- int needconvert ATTRIBUTE_UNUSED)
+ bool needconvert ATTRIBUTE_UNUSED)
{
m2assert_AssertLocation (location);
@@ -2922,9 +2922,9 @@ m2expr_BuildOffset (location_t location, tree record, tree field,
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);
@@ -2933,8 +2933,8 @@ m2expr_BuildOffset (location_t location, tree record, tree 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);
}
}
@@ -2942,7 +2942,7 @@ m2expr_BuildOffset (location_t location, tree record, tree field,
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,
@@ -2953,13 +2953,13 @@ m2expr_BuildLogicalOrAddress (location_t location, tree op1, tree 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);
}
@@ -2967,13 +2967,13 @@ m2expr_BuildLogicalOr (location_t location, tree op1, tree op2,
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);
}
@@ -2982,13 +2982,13 @@ m2expr_BuildLogicalAnd (location_t location, tree op1, tree op2,
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);
}
@@ -2997,12 +2997,12 @@ return the tree. (op1 and (not op2)). */
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);
}
@@ -3030,9 +3030,9 @@ boolean_enum_to_unsigned (location_t location, tree t)
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;
}
@@ -3049,7 +3049,7 @@ check_for_comparison (location_t location, tree op, tree badType,
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;
}
@@ -3082,7 +3082,7 @@ m2expr_BuildLessThan (location_t location, tree op1, tree op2)
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 >. */
@@ -3093,7 +3093,7 @@ m2expr_BuildGreaterThan (location_t location, tree op1, tree op2)
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 <. */
@@ -3104,7 +3104,7 @@ m2expr_BuildLessThanOrEqual (location_t location, tree op1, tree op2)
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 >=. */
@@ -3115,7 +3115,7 @@ m2expr_BuildGreaterThanOrEqual (location_t location, tree op1, tree op2)
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 =. */
@@ -3126,7 +3126,7 @@ m2expr_BuildEqualTo (location_t location, tree op1, tree op2)
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 #. */
@@ -3137,7 +3137,7 @@ m2expr_BuildNotEqualTo (location_t location, tree op1, tree op2)
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. */
@@ -3147,7 +3147,7 @@ m2expr_BuildIsSuperset (location_t location, tree op1, tree 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. */
@@ -3157,7 +3157,7 @@ m2expr_BuildIsNotSuperset (location_t location, tree op1, tree 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. */
@@ -3167,7 +3167,7 @@ m2expr_BuildIsSubset (location_t location, tree op1, tree op2)
{
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. */
@@ -3177,7 +3177,7 @@ m2expr_BuildIsNotSubset (location_t location, tree op1, tree op2)
{
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. */
@@ -3262,9 +3262,9 @@ m2expr_BuildIfVarInVar (location_t location, tree type, tree varset,
/* 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);
@@ -3282,14 +3282,14 @@ m2expr_BuildIfVarInVar (location_t location, tree type, tree varset,
/* 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,
@@ -3314,10 +3314,10 @@ m2expr_BuildIfNotVarInVar (location_t location, tree type, tree varset,
/* 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);
@@ -3338,14 +3338,14 @@ m2expr_BuildIfNotVarInVar (location_t location, tree type, tree varset,
/* 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);
@@ -3415,7 +3415,7 @@ m2expr_BuildIfInRangeGoto (location_t location, tree var, tree low, tree high,
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);
}
@@ -3436,7 +3436,7 @@ m2expr_BuildIfNotInRangeGoto (location_t location, tree var, tree low,
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);
}
@@ -3453,7 +3453,7 @@ m2expr_BuildArray (location_t location, tree type, tree array, tree index,
// 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);
}
@@ -3499,10 +3499,10 @@ m2expr_BuildIndirect (location_t location ATTRIBUTE_UNUSED, tree target,
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)
@@ -3510,7 +3510,7 @@ 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)
@@ -3519,7 +3519,7 @@ 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)
@@ -3527,7 +3527,7 @@ 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. */
@@ -3621,7 +3621,7 @@ m2expr_BuildCap (location_t location, tree t)
tree
m2expr_BuildDivM2 (location_t location, tree op1, tree op2,
- unsigned int needsconvert)
+ bool needsconvert)
{
op1 = m2expr_FoldAndStrip (op1);
op2 = m2expr_FoldAndStrip (op2);
@@ -3633,7 +3633,7 @@ m2expr_BuildDivM2 (location_t location, tree op1, tree 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
@@ -3659,7 +3659,7 @@ m2expr_BuildDivM2Check (location_t location, tree op1, tree op2,
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
@@ -3673,7 +3673,7 @@ m2expr_BuildISOModM2Check (location_t location,
{
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,
@@ -3707,7 +3707,7 @@ m2expr_BuildModM2Check (location_t location, tree op1, tree op2,
tree
m2expr_BuildModM2 (location_t location, tree op1, tree op2,
- unsigned int needsconvert)
+ bool needsconvert)
{
op1 = m2expr_FoldAndStrip (op1);
op2 = m2expr_FoldAndStrip (op2);
@@ -3719,7 +3719,7 @@ m2expr_BuildModM2 (location_t location, tree op1, tree 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
@@ -3773,9 +3773,9 @@ m2expr_BuildCmplx (location_t location, tree type, tree real, tree imag)
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);
@@ -3790,10 +3790,10 @@ m2expr_BuildCmplx (location_t location, tree type, tree real, tree 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);
@@ -3813,7 +3813,7 @@ m2expr_BuildBinaryForeachWordDo (location_t location, tree type, tree op1,
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). */
@@ -3842,7 +3842,7 @@ m2expr_BuildBinaryForeachWordDo (location_t location, tree type, tree op1,
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);
@@ -3887,9 +3887,9 @@ append_digit (unsigned HOST_WIDE_INT *low, HOST_WIDE_INT *high,
/* 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;
@@ -3913,7 +3913,7 @@ append_digit (unsigned HOST_WIDE_INT *low, HOST_WIDE_INT *high,
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;
@@ -3929,7 +3929,7 @@ m2expr_interpret_integer (const char *str, unsigned int base,
unsigned HOST_WIDE_INT *low, HOST_WIDE_INT *high)
{
unsigned const char *p, *end;
- int overflow = FALSE;
+ int overflow = false;
int len;
*low = 0;
@@ -3978,10 +3978,10 @@ m2expr_interpret_integer (const char *str, unsigned int base,
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;
@@ -4010,9 +4010,9 @@ append_m2_digit (unsigned int *low, int *high, unsigned int digit,
/* 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;
@@ -4041,9 +4041,9 @@ append_m2_digit (unsigned int *low, int *high, unsigned int digit,
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;
@@ -4062,12 +4062,12 @@ append_m2_digit (unsigned int *low, int *high, unsigned int digit,
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;
@@ -4095,22 +4095,22 @@ m2expr_interpret_m2_integer (const char *str, unsigned int base,
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. */
@@ -4266,9 +4266,9 @@ build_set_full_complement (location_t location)
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;
}
diff --git a/gcc/m2/gm2-gcc/m2expr.h b/gcc/m2/gm2-gcc/m2expr.h
index 405472a71c4..b65ec8870c8 100644
--- a/gcc/m2/gm2-gcc/m2expr.h
+++ b/gcc/m2/gm2-gcc/m2expr.h
@@ -37,9 +37,9 @@ along with GNU Modula-2; see the file COPYING3. If not see
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);
@@ -93,27 +93,27 @@ EXTERN tree m2expr_BuildLessThanOrEqual (location_t location, 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);
@@ -129,7 +129,7 @@ EXTERN int m2expr_interpret_integer (const char *str, unsigned int base,
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);
@@ -139,30 +139,30 @@ EXTERN tree m2expr_BuildMultCheck (location_t location, tree op1, tree op2,
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);
@@ -170,40 +170,40 @@ EXTERN tree m2expr_BuildModM2Check (location_t location, tree op1, tree op2,
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);
@@ -231,12 +231,12 @@ EXTERN tree m2expr_build_binary_op (location_t location, enum tree_code code,
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);
diff --git a/gcc/m2/gm2-gcc/m2statement.cc b/gcc/m2/gm2-gcc/m2statement.cc
index c3307db23be..fa799c849f9 100644
--- a/gcc/m2/gm2-gcc/m2statement.cc
+++ b/gcc/m2/gm2-gcc/m2statement.cc
@@ -46,7 +46,7 @@ static GTY (()) tree last_function = NULL_TREE;
void
m2statement_BuildStartFunctionCode (location_t location, tree fndecl,
- int isexported, int isinline)
+ bool isexported, bool isinline)
{
tree param_decl;
@@ -87,7 +87,7 @@ m2statement_BuildStartFunctionCode (location_t location, tree fndecl,
/* 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);
@@ -162,7 +162,7 @@ m2statement_BuildAssignmentTree (location_t location, tree des, tree expr)
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);
@@ -171,7 +171,7 @@ m2statement_BuildAssignmentTree (location_t location, tree des, tree expr)
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;
@@ -219,7 +219,7 @@ m2statement_BuildParam (location_t location, tree param)
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);
}
@@ -258,7 +258,7 @@ m2statement_BuildProcedureCallTree (location_t location, tree procedure,
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++)
{
@@ -270,8 +270,8 @@ m2statement_BuildProcedureCallTree (location_t location, tree procedure,
{
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");
@@ -288,8 +288,8 @@ m2statement_BuildProcedureCallTree (location_t location, tree procedure,
{
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;
@@ -310,8 +310,8 @@ m2statement_BuildIndirectProcedureCallTree (location_t location,
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++)
{
@@ -323,8 +323,8 @@ m2statement_BuildIndirectProcedureCallTree (location_t location,
{
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");
@@ -341,8 +341,8 @@ m2statement_BuildIndirectProcedureCallTree (location_t location,
{
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;
@@ -363,8 +363,8 @@ m2statement_BuildFunctValue (location_t location, tree value)
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;
}
@@ -483,8 +483,8 @@ m2statement_BuildCleanUp (tree param)
/* 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);
@@ -508,9 +508,9 @@ m2statement_BuildAsm (location_t location, tree instr, int isVolatile,
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);
@@ -527,7 +527,7 @@ m2statement_BuildUnaryForeachWordDo (location_t location, tree type, tree op1,
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). */
@@ -544,7 +544,7 @@ m2statement_BuildUnaryForeachWordDo (location_t location, tree type, tree op1,
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);
@@ -558,7 +558,7 @@ m2statement_BuildUnaryForeachWordDo (location_t location, tree type, tree op1,
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);
@@ -576,9 +576,9 @@ m2statement_BuildExcludeVarConst (location_t location, tree type, tree op1,
m2expr_BuildSetNegate (
location,
m2expr_BuildLSL (location, m2expr_GetWordOne (location), op2,
- FALSE),
- FALSE),
- FALSE));
+ false),
+ false),
+ false));
}
else
{
@@ -596,9 +596,9 @@ m2statement_BuildExcludeVarConst (location_t location, tree type, tree op1,
m2expr_BuildSetNegate (
location,
m2expr_BuildLSL (location, m2expr_GetWordOne (location), op2,
- FALSE),
- FALSE),
- FALSE));
+ false),
+ false),
+ false));
}
}
@@ -607,7 +607,7 @@ m2statement_BuildExcludeVarConst (location_t location, tree type, tree op1,
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);
@@ -616,7 +616,7 @@ m2statement_BuildExcludeVarVar (location_t location, tree type, tree varset,
/* 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))
@@ -629,9 +629,9 @@ m2statement_BuildExcludeVarVar (location_t location, tree type, tree varset,
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);
@@ -639,10 +639,10 @@ m2statement_BuildExcludeVarVar (location_t location, tree type, tree varset,
/* 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;
@@ -652,7 +652,7 @@ m2statement_BuildExcludeVarVar (location_t location, tree type, tree varset,
m2expr_BuildMult (
location, word_index,
m2decl_BuildIntegerConstant (SET_WORD_SIZE / BITS_PER_UNIT),
- FALSE));
+ false));
v1 = m2expr_BuildLogicalAnd (
location,
@@ -661,9 +661,9 @@ m2statement_BuildExcludeVarVar (location_t location, tree type, tree varset,
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 (
@@ -679,7 +679,7 @@ m2statement_BuildExcludeVarVar (location_t location, tree type, tree varset,
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);
@@ -695,8 +695,8 @@ m2statement_BuildIncludeVarConst (location_t location, tree type, tree op1,
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
{
@@ -717,8 +717,8 @@ m2statement_BuildIncludeVarConst (location_t location, tree type, tree op1,
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));
}
}
@@ -727,7 +727,7 @@ m2statement_BuildIncludeVarConst (location_t location, tree type, tree op1,
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);
@@ -736,7 +736,7 @@ m2statement_BuildIncludeVarVar (location_t location, tree type, tree varset,
/* 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 (
@@ -751,21 +751,21 @@ m2statement_BuildIncludeVarVar (location_t location, tree type, tree varset,
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. */
@@ -774,15 +774,15 @@ m2statement_BuildIncludeVarVar (location_t location, tree type, tree varset,
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 (
@@ -798,7 +798,7 @@ m2statement_BuildIncludeVarVar (location_t location, tree type, tree varset,
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;
@@ -831,7 +831,7 @@ m2statement_BuildStart (location_t location, char *name, int inner_module)
/* 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;
@@ -892,14 +892,14 @@ m2statement_BuildReturnValueCode (location_t location, tree fndecl, tree value)
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,
diff --git a/gcc/m2/gm2-gcc/m2statement.h b/gcc/m2/gm2-gcc/m2statement.h
index 37b2785b7fa..1ca70f8fc3a 100644
--- a/gcc/m2/gm2-gcc/m2statement.h
+++ b/gcc/m2/gm2-gcc/m2statement.h
@@ -42,22 +42,22 @@ EXTERN tree m2statement_BuildStart (location_t location, char *name,
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,
@@ -84,10 +84,10 @@ EXTERN void m2statement_BuildPushFunctionContext (void);
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,
diff --git a/gcc/m2/gm2-gcc/m2top.cc b/gcc/m2/gm2-gcc/m2top.cc
index d1d9b8918ab..df8e0c0917a 100644
--- a/gcc/m2/gm2-gcc/m2top.cc
+++ b/gcc/m2/gm2-gcc/m2top.cc
@@ -59,7 +59,7 @@ m2top_FinishBackend (void)
/* 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;
}
diff --git a/gcc/m2/gm2-gcc/m2top.h b/gcc/m2/gm2-gcc/m2top.h
index 5f474c94402..3d577754ccd 100644
--- a/gcc/m2/gm2-gcc/m2top.h
+++ b/gcc/m2/gm2-gcc/m2top.h
@@ -38,7 +38,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
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. */
diff --git a/gcc/m2/gm2-gcc/m2tree.cc b/gcc/m2/gm2-gcc/m2tree.cc
index c8e126c2bc9..33dc57d5df7 100644
--- a/gcc/m2/gm2-gcc/m2tree.cc
+++ b/gcc/m2/gm2-gcc/m2tree.cc
@@ -26,19 +26,19 @@ along with GNU Modula-2; see the file COPYING3. If not see
#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))
@@ -105,7 +105,7 @@ m2tree_skip_reference_type (tree exp)
/* 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);
@@ -116,7 +116,7 @@ m2tree_IsOrdinal (tree 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)
diff --git a/gcc/m2/gm2-gcc/m2tree.h b/gcc/m2/gm2-gcc/m2tree.h
index da7a9571c17..43eeebbb285 100644
--- a/gcc/m2/gm2-gcc/m2tree.h
+++ b/gcc/m2/gm2-gcc/m2tree.h
@@ -36,15 +36,16 @@ along with GNU Modula-2; see the file COPYING3. If not see
#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);
diff --git a/gcc/m2/gm2-gcc/m2type.cc b/gcc/m2/gm2-gcc/m2type.cc
index 634fad8df7c..6ee68a9b520 100644
--- a/gcc/m2/gm2-gcc/m2type.cc
+++ b/gcc/m2/gm2-gcc/m2type.cc
@@ -38,8 +38,8 @@ along with GNU Modula-2; see the file COPYING3. If not see
#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
@@ -191,7 +191,7 @@ m2type_GetArrayNoOfElements (location_t location, tree arraytype)
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
@@ -255,10 +255,10 @@ gm2_build_array_type (tree elementtype, tree indextype, int fetype)
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);
@@ -270,29 +270,29 @@ m2type_ValueInTypeRange (tree type, tree value)
&& (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)
@@ -847,7 +847,7 @@ m2type_GetPackedBooleanType (void)
return m2_packed_boolean_type_node;
}
-/* GetBooleanTrue return modula-2 TRUE. */
+/* GetBooleanTrue return modula-2 true. */
tree
m2type_GetBooleanTrue (void)
@@ -1004,7 +1004,7 @@ build_bitset_type (location_t location)
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
@@ -1014,7 +1014,7 @@ tree
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);
@@ -1028,12 +1028,12 @@ m2type_BuildSetTypeFromSubrange (location_t location,
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);
}
@@ -1061,7 +1061,7 @@ build_m2_size_set_type (location_t location, int precision)
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
@@ -1095,12 +1095,12 @@ build_m2_specific_size_type (location_t location, enum tree_code base,
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;
}
}
@@ -1119,8 +1119,8 @@ m2type_BuildSmallestTypeRange (location_t location, tree low, tree high)
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);
@@ -1162,7 +1162,7 @@ finish_build_pointer_type (tree t, tree to_type, enum machine_mode mode,
tree
m2type_BuildProcTypeParameterDeclaration (location_t location, tree type,
- int isreference)
+ bool isreference)
{
m2assert_AssertLocation (location);
ASSERT_BOOL (isreference);
@@ -1332,11 +1332,11 @@ m2type_BuildVariableArrayAndDeclare (location_t location, tree elementtype,
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);
@@ -1367,7 +1367,7 @@ build_m2_iso_word_node (location_t location, int loc)
(m2expr_BuildSub (location,
m2decl_BuildIntegerConstant (
m2decl_GetBitsPerInt () / BITS_PER_UNIT),
- m2expr_GetIntegerOne (location), FALSE))),
+ m2expr_GetIntegerOne (location), false))),
loc);
return c;
}
@@ -1547,56 +1547,56 @@ static tree
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
@@ -1604,9 +1604,9 @@ build_m2_bitset8_type_node (location_t location)
{
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
@@ -1614,9 +1614,9 @@ build_m2_bitset16_type_node (location_t location)
{
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
@@ -1624,37 +1624,37 @@ build_m2_bitset32_type_node (location_t location)
{
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
@@ -1725,7 +1725,16 @@ build_m2_cardinal_address_type_node (location_t location)
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. */
@@ -1781,7 +1790,8 @@ m2type_InitBaseTypes (location_t location)
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;
@@ -1932,7 +1942,7 @@ m2type_GetMaxFrom (location_t location, tree type)
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));
}
@@ -2118,7 +2128,7 @@ gm2_finish_enum (location_t location, tree enumtype, tree values)
/* 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;
@@ -2201,7 +2211,7 @@ tree
m2type_BuildConstPointerType (tree totype)
{
tree t = build_pointer_type (m2tree_skip_type_decl (totype));
- TYPE_READONLY (t) = TRUE;
+ TYPE_READONLY (t) = true;
return t;
}
@@ -2209,7 +2219,7 @@ m2type_BuildConstPointerType (tree totype)
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),
@@ -2386,8 +2396,8 @@ m2type_BuildEndArrayConstructor (void *p)
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);
@@ -2454,13 +2464,13 @@ m2type_BuildArrayStringConstructor (location_t location, tree arrayType,
{
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);
}
@@ -2512,7 +2522,7 @@ tree
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);
}
@@ -2548,7 +2558,7 @@ gm2_start_struct (location_t location, enum tree_code code, char *name)
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;
@@ -2590,7 +2600,7 @@ m2type_BuildStartVarient (location_t location, char *name)
tree
m2type_BuildEndVarient (location_t location, tree varientField,
- tree varientList, int isPacked)
+ tree varientList, bool isPacked)
{
tree varient = TREE_TYPE (varientField);
m2assert_AssertLocation (location);
@@ -2618,7 +2628,7 @@ m2type_BuildStartFieldVarient (location_t location, char *name)
tree
m2type_BuildEndRecord (location_t location, tree record, tree fieldlist,
- int isPacked)
+ bool isPacked)
{
tree x, d;
@@ -2682,7 +2692,7 @@ m2type_BuildEndRecord (location_t location, tree record, tree fieldlist,
tree
m2type_BuildEndFieldVarient (location_t location, tree varientField,
- tree varientList, int isPacked)
+ tree varientList, bool isPacked)
{
tree record = TREE_TYPE (varientField);
@@ -2764,7 +2774,7 @@ m2type_SetAlignment (tree node, tree align)
{
tree type = NULL_TREE;
tree decl = NULL_TREE;
- int is_type = FALSE;
+ bool is_type = false;
int i;
if (DECL_P (node))
@@ -2775,7 +2785,7 @@ m2type_SetAlignment (tree node, tree align)
}
else if (TYPE_P (node))
{
- is_type = 1;
+ is_type = true;
type = node;
}
@@ -2874,8 +2884,8 @@ m2type_BuildNumberOfArrayElements (location_t location, tree arrayType)
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;
}
@@ -2912,7 +2922,7 @@ m2type_GarbageCollect (void)
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;
@@ -2976,7 +2986,7 @@ m2type_gm2_unsigned_type (tree type)
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
@@ -3010,7 +3020,7 @@ m2type_gm2_signed_type (tree type)
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
@@ -3027,9 +3037,9 @@ check_type (tree baseType, tree type, int unsignedp, tree baseu, tree bases,
*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
@@ -3085,7 +3095,7 @@ m2type_gm2_signed_or_unsigned_type (int unsignedp, tree 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)
diff --git a/gcc/m2/gm2-gcc/m2type.h b/gcc/m2/gm2-gcc/m2type.h
index fa4c25d92b1..ab0488c46b4 100644
--- a/gcc/m2/gm2-gcc/m2type.h
+++ b/gcc/m2/gm2-gcc/m2type.h
@@ -35,12 +35,14 @@ along with GNU Modula-2; see the file COPYING3. If not see
#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);
@@ -62,7 +64,7 @@ EXTERN tree m2type_SetTypePacked (tree node);
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);
@@ -73,10 +75,10 @@ EXTERN tree m2type_BuildStartFieldRecord (location_t location, char *name,
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);
@@ -160,7 +162,7 @@ EXTERN tree m2type_BuildSmallestTypeRange (location_t location, tree low,
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);
@@ -185,7 +187,7 @@ EXTERN tree m2type_GetMinFrom (location_t location, tree type);
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,
@@ -193,7 +195,7 @@ 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);
@@ -214,7 +216,7 @@ EXTERN tree m2type_gm2_signed_or_unsigned_type (int unsignedp, tree type);
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);
diff --git a/gcc/m2/gm2-lang.cc b/gcc/m2/gm2-lang.cc
index 162baf75c3f..a1b32d8ecf3 100644
--- a/gcc/m2/gm2-lang.cc
+++ b/gcc/m2/gm2-lang.cc
@@ -1033,7 +1033,7 @@ convert_loc (location_t location, tree type, tree expr)
{
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:
diff --git a/gcc/m2/gm2-libs/Builtins.def b/gcc/m2/gm2-libs/Builtins.def
index e619e8f10ec..eda36c3cfce 100644
--- a/gcc/m2/gm2-libs/Builtins.def
+++ b/gcc/m2/gm2-libs/Builtins.def
@@ -30,9 +30,9 @@ FROM SYSTEM IMPORT ADDRESS ;
(* 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 ;
diff --git a/gcc/m2/gm2-libs/Builtins.mod b/gcc/m2/gm2-libs/Builtins.mod
index af5cd2901a5..98ab3a38729 100644
--- a/gcc/m2/gm2-libs/Builtins.mod
+++ b/gcc/m2/gm2-libs/Builtins.mod
@@ -57,19 +57,19 @@ BEGIN
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 ;
diff --git a/gcc/m2/mc-boot/GASCII.cc b/gcc/m2/mc-boot/GASCII.cc
index 2f768ce24c8..0758c8f106a 100644
--- a/gcc/m2/mc-boot/GASCII.cc
+++ b/gcc/m2/mc-boot/GASCII.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GASCII.h b/gcc/m2/mc-boot/GASCII.h
index b5091fd6df7..952fbf3b228 100644
--- a/gcc/m2/mc-boot/GASCII.h
+++ b/gcc/m2/mc-boot/GASCII.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GArgs.cc b/gcc/m2/mc-boot/GArgs.cc
index 106ddfd30c6..cc98f01e735 100644
--- a/gcc/m2/mc-boot/GArgs.cc
+++ b/gcc/m2/mc-boot/GArgs.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -56,7 +57,7 @@ static Args__T1 Source;
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
@@ -71,7 +72,7 @@ extern "C" unsigned int Args_Narg (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)
{
int i;
unsigned int High;
diff --git a/gcc/m2/mc-boot/GArgs.h b/gcc/m2/mc-boot/GArgs.h
index d7c93ea80b8..9866f432fd6 100644
--- a/gcc/m2/mc-boot/GArgs.h
+++ b/gcc/m2/mc-boot/GArgs.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -53,7 +54,7 @@ extern "C" {
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
diff --git a/gcc/m2/mc-boot/GAssertion.cc b/gcc/m2/mc-boot/GAssertion.cc
index 21ee6c0b2f2..2f1cac60305 100644
--- a/gcc/m2/mc-boot/GAssertion.cc
+++ b/gcc/m2/mc-boot/GAssertion.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -44,14 +45,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
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)
{
diff --git a/gcc/m2/mc-boot/GAssertion.h b/gcc/m2/mc-boot/GAssertion.h
index f983353dcee..0e0af34d8ce 100644
--- a/gcc/m2/mc-boot/GAssertion.h
+++ b/gcc/m2/mc-boot/GAssertion.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -53,7 +54,7 @@ extern "C" {
is called.
*/
-EXTERN void Assertion_Assert (unsigned int Condition);
+EXTERN void Assertion_Assert (bool Condition);
# ifdef __cplusplus
}
# endif
diff --git a/gcc/m2/mc-boot/GBreak.cc b/gcc/m2/mc-boot/GBreak.cc
index 9be003bd619..15e55d8639a 100644
--- a/gcc/m2/mc-boot/GBreak.cc
+++ b/gcc/m2/mc-boot/GBreak.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GBreak.h b/gcc/m2/mc-boot/GBreak.h
index 397328c5286..328bc8bd423 100644
--- a/gcc/m2/mc-boot/GBreak.h
+++ b/gcc/m2/mc-boot/GBreak.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GCOROUTINES.h b/gcc/m2/mc-boot/GCOROUTINES.h
index 89cfbd974e3..ae1ee92ddb4 100644
--- a/gcc/m2/mc-boot/GCOROUTINES.h
+++ b/gcc/m2/mc-boot/GCOROUTINES.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GCmdArgs.cc b/gcc/m2/mc-boot/GCmdArgs.cc
index c304a407182..101fd233271 100644
--- a/gcc/m2/mc-boot/GCmdArgs.cc
+++ b/gcc/m2/mc-boot/GCmdArgs.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -51,7 +52,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
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
@@ -66,7 +67,7 @@ extern "C" unsigned int CmdArgs_Narg (const char *CmdLine_, unsigned int _CmdLin
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.
@@ -87,10 +88,10 @@ static void CopyUntil (const char *From_, unsigned int _From_high, unsigned int
*/
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);
/*
@@ -99,7 +100,7 @@ static unsigned int 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;
@@ -222,28 +223,28 @@ static void CopyChar (const char *From_, unsigned int _From_high, unsigned int *
}
}
-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. */
@@ -257,11 +258,11 @@ static unsigned int SingleQuote (char ch)
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. */
diff --git a/gcc/m2/mc-boot/GCmdArgs.h b/gcc/m2/mc-boot/GCmdArgs.h
index f35ef0daa4d..65668aa0a96 100644
--- a/gcc/m2/mc-boot/GCmdArgs.h
+++ b/gcc/m2/mc-boot/GCmdArgs.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -53,7 +54,7 @@ extern "C" {
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
diff --git a/gcc/m2/mc-boot/GDebug.cc b/gcc/m2/mc-boot/GDebug.cc
index 6329abb11b1..98de9dfb4e3 100644
--- a/gcc/m2/mc-boot/GDebug.cc
+++ b/gcc/m2/mc-boot/GDebug.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GDebug.h b/gcc/m2/mc-boot/GDebug.h
index ed509a27a24..3a02b54c819 100644
--- a/gcc/m2/mc-boot/GDebug.h
+++ b/gcc/m2/mc-boot/GDebug.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GDynamicStrings.cc b/gcc/m2/mc-boot/GDynamicStrings.cc
index dfc163646bb..41d25f1d4bf 100644
--- a/gcc/m2/mc-boot/GDynamicStrings.cc
+++ b/gcc/m2/mc-boot/GDynamicStrings.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -58,10 +59,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# 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;
@@ -90,10 +91,10 @@ struct DynamicStrings_DebugInfo_r {
};
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;
};
@@ -117,7 +118,7 @@ struct DynamicStrings_stringRecord_r {
DynamicStrings_DebugInfo debug;
};
-static unsigned int Initialized;
+static bool Initialized;
static DynamicStrings_frame frameHead;
static DynamicStrings_String captured;
@@ -202,21 +203,21 @@ extern "C" DynamicStrings_String DynamicStrings_Add (DynamicStrings_String a, Dy
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.
@@ -363,7 +364,7 @@ extern "C" void DynamicStrings_PushAllocation (void);
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
@@ -375,7 +376,7 @@ extern "C" void DynamicStrings_PopAllocation (unsigned int halt);
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. */
@@ -483,7 +484,7 @@ static DynamicStrings_String AssignDebug (DynamicStrings_String s, const char *f
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.
@@ -513,13 +514,13 @@ static void AddDeallocated (DynamicStrings_String s);
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.
@@ -589,13 +590,13 @@ static DynamicStrings_String AddToGarbage (DynamicStrings_String a, DynamicStrin
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 -
@@ -735,7 +736,7 @@ static void doDSdbExit (DynamicStrings_String s)
{
if (CheckOn)
{
- s = DynamicStrings_PopAllocationExemption (TRUE, s);
+ s = DynamicStrings_PopAllocationExemption (true, s);
}
}
@@ -957,7 +958,7 @@ static DynamicStrings_String AssignDebug (DynamicStrings_String s, const char *f
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))
{
@@ -1047,7 +1048,7 @@ static void AddDeallocated (DynamicStrings_String s)
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;
@@ -1056,14 +1057,14 @@ static unsigned int IsOnAllocated (DynamicStrings_String s)
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 ();
}
@@ -1073,7 +1074,7 @@ static unsigned int 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)
{
DynamicStrings_frame f;
@@ -1082,14 +1083,14 @@ static unsigned int IsOnDeallocated (DynamicStrings_String s)
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 ();
}
@@ -1235,10 +1236,10 @@ static void DeallocateCharStar (DynamicStrings_String s)
{
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;
}
}
@@ -1272,7 +1273,7 @@ static void MarkInvalid (DynamicStrings_String s)
}
if (s->head != NULL)
{
- s->head->charStarValid = FALSE;
+ s->head->charStarValid = false;
}
}
@@ -1368,7 +1369,7 @@ static DynamicStrings_String AddToGarbage (DynamicStrings_String a, DynamicStrin
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))
{
@@ -1376,7 +1377,7 @@ static unsigned int IsOnGarbage (DynamicStrings_String e, DynamicStrings_String
{
if (e->head->garbage == s)
{
- return TRUE;
+ return true;
}
else
{
@@ -1384,7 +1385,7 @@ static unsigned int IsOnGarbage (DynamicStrings_String e, DynamicStrings_String
}
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -1394,7 +1395,7 @@ static unsigned int IsOnGarbage (DynamicStrings_String e, DynamicStrings_String
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. */
@@ -1503,7 +1504,7 @@ static void Init (void)
{
if (! Initialized)
{
- Initialized = TRUE;
+ Initialized = true;
frameHead = NULL;
DynamicStrings_PushAllocation ();
}
@@ -1528,10 +1529,10 @@ extern "C" DynamicStrings_String DynamicStrings_InitString (const char *a_, unsi
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);
@@ -1631,10 +1632,10 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringCharStar (void * a)
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);
@@ -1857,7 +1858,7 @@ extern "C" DynamicStrings_String DynamicStrings_Add (DynamicStrings_String a, Dy
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;
@@ -1876,18 +1877,18 @@ extern "C" unsigned int DynamicStrings_Equal (DynamicStrings_String a, DynamicSt
{
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 ();
@@ -1899,7 +1900,7 @@ extern "C" unsigned int DynamicStrings_Equal (DynamicStrings_String a, DynamicSt
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;
@@ -1916,12 +1917,12 @@ extern "C" unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, v
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 ();
@@ -1933,7 +1934,7 @@ extern "C" unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, v
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];
@@ -1954,12 +1955,12 @@ extern "C" unsigned int DynamicStrings_EqualArray (DynamicStrings_String s, cons
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 ();
@@ -2435,7 +2436,7 @@ extern "C" void * DynamicStrings_string (DynamicStrings_String s)
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;
@@ -2451,7 +2452,7 @@ extern "C" void * DynamicStrings_string (DynamicStrings_String s)
a = a->contents.next;
}
(*p) = ASCII_nul;
- s->head->charStarValid = TRUE;
+ s->head->charStarValid = true;
}
return s->head->charStar;
}
@@ -2596,7 +2597,7 @@ extern "C" void DynamicStrings_PushAllocation (void)
with an exit code of 1.
*/
-extern "C" void DynamicStrings_PopAllocation (unsigned int halt)
+extern "C" void DynamicStrings_PopAllocation (bool halt)
{
if (CheckOn)
{
@@ -2616,11 +2617,11 @@ extern "C" void DynamicStrings_PopAllocation (unsigned int halt)
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)
@@ -2636,7 +2637,7 @@ extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned
{
if (frameHead->alloc != NULL)
{
- b = FALSE;
+ b = false;
s = frameHead->alloc;
while (s != NULL)
{
@@ -2646,7 +2647,7 @@ extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned
{
writeString ((const char *) "the following strings have been lost", 36);
writeLn ();
- b = TRUE;
+ b = true;
}
DumpStringInfo (s, 0);
}
@@ -2667,7 +2668,7 @@ extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned
extern "C" void _M2_DynamicStrings_init (__attribute__((unused)) int argc,__attribute__((unused)) char *argv[],__attribute__((unused)) char *envp[])
{
- Initialized = FALSE;
+ Initialized = false;
Init ();
}
diff --git a/gcc/m2/mc-boot/GDynamicStrings.h b/gcc/m2/mc-boot/GDynamicStrings.h
index c602ebc74e0..a69f70344f3 100644
--- a/gcc/m2/mc-boot/GDynamicStrings.h
+++ b/gcc/m2/mc-boot/GDynamicStrings.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -139,21 +140,21 @@ EXTERN DynamicStrings_String DynamicStrings_Add (DynamicStrings_String a, Dynami
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.
@@ -310,7 +311,7 @@ EXTERN void DynamicStrings_PushAllocation (void);
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
@@ -325,7 +326,7 @@ EXTERN void DynamicStrings_PopAllocation (unsigned int halt);
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
diff --git a/gcc/m2/mc-boot/GEnvironment.cc b/gcc/m2/mc-boot/GEnvironment.cc
index aa5e7662873..53e248d27dc 100644
--- a/gcc/m2/mc-boot/GEnvironment.cc
+++ b/gcc/m2/mc-boot/GEnvironment.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -53,7 +54,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
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.
@@ -61,7 +62,7 @@ extern "C" unsigned int Environment_GetEnvironment (const char *Env_, unsigned i
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);
/*
@@ -71,7 +72,7 @@ extern "C" unsigned int Environment_PutEnvironment (const char *EnvDef_, unsigne
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;
@@ -108,7 +109,7 @@ extern "C" unsigned int Environment_GetEnvironment (const char *Env_, unsigned i
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];
diff --git a/gcc/m2/mc-boot/GEnvironment.h b/gcc/m2/mc-boot/GEnvironment.h
index 82501c41608..d0b44d19d9d 100644
--- a/gcc/m2/mc-boot/GEnvironment.h
+++ b/gcc/m2/mc-boot/GEnvironment.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -55,7 +56,7 @@ extern "C" {
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
@@ -64,7 +65,7 @@ EXTERN unsigned int Environment_GetEnvironment (const char *Env_, unsigned int _
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
diff --git a/gcc/m2/mc-boot/GFIO.cc b/gcc/m2/mc-boot/GFIO.cc
index 65819a10a4b..c25d75440f2 100644
--- a/gcc/m2/mc-boot/GFIO.cc
+++ b/gcc/m2/mc-boot/GFIO.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -95,7 +96,7 @@ struct FIO_NameInfo_r {
};
struct FIO_buf_r {
- unsigned int valid;
+ bool valid;
long int bufstart;
unsigned int position;
void *address;
@@ -111,7 +112,7 @@ struct FIO_fds_r {
FIO_NameInfo name;
FIO_FileStatus state;
FIO_FileUsage usage;
- unsigned int output;
+ bool output;
FIO_Buffer buffer;
long int abspos;
};
@@ -123,17 +124,17 @@ static FIO_File Error;
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:
@@ -147,7 +148,7 @@ extern "C" void FIO_Close (FIO_File f);
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
@@ -176,7 +177,7 @@ extern "C" FIO_File FIO_openToWrite (void * fname, unsigned int flength);
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.
@@ -229,20 +230,20 @@ extern "C" void FIO_WriteChar (FIO_File f, char ch);
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.
@@ -381,13 +382,13 @@ static void SetState (FIO_File f, FIO_FileStatus s);
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.
@@ -456,7 +457,7 @@ static void FormatError2 (const char *a_, unsigned int _a_high, const unsigned c
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 -
@@ -478,7 +479,7 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a);
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.
@@ -577,7 +578,7 @@ static void SetState (FIO_File f, FIO_FileStatus s)
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;
@@ -615,7 +616,7 @@ static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength,
}
else
{
- fd->buffer->valid = FALSE;
+ fd->buffer->valid = false;
fd->buffer->bufstart = 0;
fd->buffer->size = buflength;
fd->buffer->position = 0;
@@ -655,7 +656,7 @@ static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength,
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;
@@ -761,7 +762,7 @@ static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes)
/* now disable the buffer as we read directly into, a. */
if (fd->buffer != NULL)
{
- fd->buffer->valid = FALSE;
+ fd->buffer->valid = false;
}
}
else
@@ -778,7 +779,7 @@ static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes)
/* 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)
@@ -864,7 +865,7 @@ static int BufferedRead (FIO_File f, unsigned int nBytes, void * a)
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;
@@ -879,7 +880,7 @@ static int BufferedRead (FIO_File f, unsigned int nBytes, void * a)
}
else
{
- fd->buffer->valid = FALSE;
+ fd->buffer->valid = false;
fd->buffer->position = 0;
fd->buffer->left = 0;
fd->buffer->filled = 0;
@@ -1138,7 +1139,7 @@ static void FormatError2 (const char *a_, unsigned int _a_high, const unsigned c
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;
@@ -1212,7 +1213,7 @@ static void SetEndOfLine (FIO_File f, char ch)
{
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));
@@ -1307,7 +1308,7 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a)
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;
@@ -1353,13 +1354,13 @@ static void Init (void)
{
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);
@@ -1372,13 +1373,13 @@ static void Init (void)
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
{
@@ -1394,11 +1395,11 @@ extern "C" unsigned int 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" bool FIO_IsActive (FIO_File f)
{
if (f == Error)
{
- return FALSE;
+ return false;
}
else
{
@@ -1408,7 +1409,7 @@ extern "C" unsigned int FIO_IsActive (FIO_File f)
__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];
@@ -1447,7 +1448,7 @@ extern "C" FIO_File FIO_OpenToWrite (const char *fname_, unsigned int _fname_hig
__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];
@@ -1511,7 +1512,7 @@ extern "C" void FIO_Close (FIO_File f)
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;
@@ -1519,12 +1520,12 @@ extern "C" unsigned int FIO_exists (void * fname, unsigned int flength)
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 ();
@@ -1549,8 +1550,8 @@ extern "C" FIO_File FIO_openToRead (void * fname, unsigned int flength)
}
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. */
@@ -1576,8 +1577,8 @@ extern "C" FIO_File FIO_openToWrite (void * fname, unsigned int flength)
}
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. */
@@ -1594,7 +1595,7 @@ extern "C" FIO_File FIO_openToWrite (void * fname, unsigned int flength)
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;
@@ -1663,7 +1664,7 @@ extern "C" unsigned int FIO_ReadNBytes (FIO_File f, unsigned int nBytes, void *
if (f != Error)
{
- CheckAccess (f, FIO_openedforread, FALSE);
+ CheckAccess (f, FIO_openedforread, false);
n = ReadFromBuffer (f, dest, nBytes);
if (n <= 0)
{
@@ -1694,7 +1695,7 @@ extern "C" unsigned int FIO_ReadNBytes (FIO_File f, unsigned int nBytes, void *
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]));
@@ -1715,7 +1716,7 @@ extern "C" unsigned int FIO_WriteNBytes (FIO_File f, unsigned int nBytes, void *
int total;
FIO_FileDescriptor fd;
- CheckAccess (f, FIO_openedforwrite, TRUE);
+ CheckAccess (f, FIO_openedforwrite, true);
FIO_FlushBuffer (f);
if (f != Error)
{
@@ -1753,7 +1754,7 @@ extern "C" unsigned int FIO_WriteNBytes (FIO_File f, unsigned int nBytes, void *
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. */
}
@@ -1765,7 +1766,7 @@ 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)
{
- CheckAccess (f, FIO_openedforwrite, TRUE);
+ CheckAccess (f, FIO_openedforwrite, true);
if ((BufferedWrite (f, sizeof (ch), &ch)) == ((int ) (sizeof (ch))))
{} /* empty. */
}
@@ -1775,11 +1776,11 @@ extern "C" void FIO_WriteChar (FIO_File f, char ch)
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));
@@ -1788,7 +1789,7 @@ extern "C" unsigned int FIO_EOF (FIO_File f)
return fd->state == FIO_endoffile;
}
}
- return TRUE;
+ return true;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -1799,12 +1800,12 @@ extern "C" unsigned int FIO_EOF (FIO_File f)
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.
@@ -1825,7 +1826,7 @@ extern "C" unsigned int FIO_EOLN (FIO_File f)
}
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -1835,14 +1836,14 @@ extern "C" unsigned int 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)
{
FIO_FileDescriptor fd;
- CheckAccess (f, FIO_openedforread, FALSE);
+ CheckAccess (f, FIO_openedforread, false);
if (f == Error)
{
- return FALSE;
+ return false;
}
else
{
@@ -1864,7 +1865,7 @@ extern "C" char FIO_ReadChar (FIO_File f)
{
char ch;
- CheckAccess (f, FIO_openedforread, FALSE);
+ CheckAccess (f, FIO_openedforread, false);
if ((BufferedRead (f, sizeof (ch), &ch)) == ((int ) (sizeof (ch))))
{
SetEndOfLine (f, ch);
@@ -1897,7 +1898,7 @@ extern "C" void FIO_UnReadChar (FIO_File f, char 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));
@@ -1987,7 +1988,7 @@ extern "C" void FIO_ReadString (FIO_File f, char *a, unsigned int _a_high)
unsigned int i;
char ch;
- CheckAccess (f, FIO_openedforread, FALSE);
+ CheckAccess (f, FIO_openedforread, false);
high = _a_high;
i = 0;
do {
@@ -2078,7 +2079,7 @@ extern "C" void FIO_SetPositionFromBeginning (FIO_File f, long int pos)
{
/* 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)
@@ -2106,7 +2107,7 @@ extern "C" void FIO_SetPositionFromBeginning (FIO_File f, long int pos)
}
if (fd->buffer != NULL)
{
- fd->buffer->valid = FALSE;
+ fd->buffer->valid = false;
fd->buffer->bufstart = fd->abspos;
}
}
@@ -2156,7 +2157,7 @@ extern "C" void FIO_SetPositionFromEnd (FIO_File f, long int pos)
}
if (fd->buffer != NULL)
{
- fd->buffer->valid = FALSE;
+ fd->buffer->valid = false;
fd->buffer->bufstart = offset;
}
}
diff --git a/gcc/m2/mc-boot/GFIO.h b/gcc/m2/mc-boot/GFIO.h
index 9562283076e..a4a9e40c05b 100644
--- a/gcc/m2/mc-boot/GFIO.h
+++ b/gcc/m2/mc-boot/GFIO.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -58,19 +59,19 @@ EXTERN FIO_File FIO_StdErr;
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
@@ -104,7 +105,7 @@ EXTERN FIO_File FIO_OpenToWrite (const char *fname_, unsigned int _fname_high);
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:
@@ -113,10 +114,10 @@ EXTERN FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_high,
*/
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.
@@ -169,7 +170,7 @@ EXTERN void FIO_WriteChar (FIO_File f, char ch);
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.
@@ -177,14 +178,14 @@ EXTERN unsigned int FIO_EOF (FIO_File f);
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.
diff --git a/gcc/m2/mc-boot/GFormatStrings.cc b/gcc/m2/mc-boot/GFormatStrings.cc
index 78e7a5a559c..b8d0f922a7a 100644
--- a/gcc/m2/mc-boot/GFormatStrings.cc
+++ b/gcc/m2/mc-boot/GFormatStrings.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -124,7 +125,7 @@ static void DSdbExit (DynamicStrings_String s);
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
@@ -136,7 +137,7 @@ static void Cast (unsigned char *a, unsigned int _a_high, const unsigned char *b
isHex -
*/
-static unsigned int isHex (char ch);
+static bool isHex (char ch);
/*
toHex -
@@ -154,7 +155,7 @@ static unsigned int toOct (char ch);
isOct -
*/
-static unsigned int isOct (char ch);
+static bool isOct (char ch);
/*
FormatString - returns a String containing, s, together with encapsulated
@@ -203,7 +204,7 @@ static void doDSdbEnter (void)
static void doDSdbExit (DynamicStrings_String s)
{
- s = DynamicStrings_PopAllocationExemption (TRUE, s);
+ s = DynamicStrings_PopAllocationExemption (true, s);
}
@@ -229,7 +230,7 @@ static void DSdbExit (DynamicStrings_String 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. */
@@ -268,7 +269,7 @@ static void Cast (unsigned char *a, unsigned int _a_high, const unsigned char *b
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. */
@@ -317,7 +318,7 @@ static unsigned int toOct (char ch)
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. */
@@ -363,7 +364,7 @@ static DynamicStrings_String FormatString (DynamicStrings_String fmt, int *start
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;
@@ -388,12 +389,12 @@ static DynamicStrings_String PerformFormatString (DynamicStrings_String fmt, int
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')
@@ -454,7 +455,7 @@ static DynamicStrings_String PerformFormatString (DynamicStrings_String fmt, int
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;
@@ -465,7 +466,7 @@ static DynamicStrings_String PerformFormatString (DynamicStrings_String fmt, int
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;
@@ -476,7 +477,7 @@ static DynamicStrings_String PerformFormatString (DynamicStrings_String fmt, int
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;
diff --git a/gcc/m2/mc-boot/GFormatStrings.h b/gcc/m2/mc-boot/GFormatStrings.h
index 69137fa4bc8..0e90b554f9d 100644
--- a/gcc/m2/mc-boot/GFormatStrings.h
+++ b/gcc/m2/mc-boot/GFormatStrings.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GFpuIO.cc b/gcc/m2/mc-boot/GFpuIO.cc
index 205c27b811e..ab45ed4e1ac 100644
--- a/gcc/m2/mc-boot/GFpuIO.cc
+++ b/gcc/m2/mc-boot/GFpuIO.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -231,7 +232,7 @@ extern "C" void FpuIO_WriteLongReal (long double x, unsigned int TotalWidth, uns
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];
@@ -301,7 +302,7 @@ extern "C" void FpuIO_WriteLongInt (long int x, unsigned int n)
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. */
@@ -322,7 +323,7 @@ extern "C" void FpuIO_LongIntToStr (long int x, unsigned int n, char *a, unsigne
{
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);
}
diff --git a/gcc/m2/mc-boot/GFpuIO.h b/gcc/m2/mc-boot/GFpuIO.h
index d1a0e736505..631f09b22bd 100644
--- a/gcc/m2/mc-boot/GFpuIO.h
+++ b/gcc/m2/mc-boot/GFpuIO.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GIO.cc b/gcc/m2/mc-boot/GIO.cc
index e56c74382f5..feaf27d1674 100644
--- a/gcc/m2/mc-boot/GIO.cc
+++ b/gcc/m2/mc-boot/GIO.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -58,8 +59,8 @@ typedef struct IO_BasicFds_r IO_BasicFds;
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]; };
@@ -84,8 +85,8 @@ extern "C" void IO_Write (char ch);
*/
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
@@ -94,7 +95,7 @@ extern "C" void IO_BufferedMode (int fd, unsigned int input);
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
@@ -103,13 +104,13 @@ extern "C" void IO_EchoOn (int fd, unsigned int input);
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,
@@ -122,7 +123,7 @@ static void doWrite (int fd, FIO_File f, char 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
@@ -149,7 +150,7 @@ static void Init (void);
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. */
@@ -184,7 +185,7 @@ static void doWrite (int fd, FIO_File f, char ch)
r = errno_geterrno ();
if ((r != errno_EAGAIN) && (r != errno_EINTR))
{
- fdState.array[fd].IsEof = TRUE;
+ fdState.array[fd].IsEof = true;
return ;
}
}
@@ -202,7 +203,7 @@ static void doWrite (int fd, FIO_File f, char 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)
{
if (termios_SetFlag (t, f, b))
{} /* empty. */
@@ -225,22 +226,22 @@ static void doraw (termios_TERMIOS term)
* 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);
}
@@ -262,20 +263,20 @@ static void dononraw (termios_TERMIOS term)
* 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);
}
@@ -285,12 +286,12 @@ static void dononraw (termios_TERMIOS term)
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;
}
@@ -325,7 +326,7 @@ extern "C" void IO_Read (char *ch)
r = errno_geterrno ();
if (r != errno_EAGAIN)
{
- fdState.array[0].IsEof = TRUE;
+ fdState.array[0].IsEof = true;
(*ch) = ASCII_eof;
return ;
}
@@ -361,14 +362,14 @@ extern "C" void IO_Error (char ch)
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)
@@ -386,14 +387,14 @@ extern "C" void IO_UnBufferedMode (int fd, unsigned int input)
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)
@@ -419,7 +420,7 @@ extern "C" void IO_BufferedMode (int fd, unsigned int input)
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;
@@ -427,7 +428,7 @@ extern "C" void IO_EchoOn (int fd, unsigned int input)
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);
@@ -448,7 +449,7 @@ extern "C" void IO_EchoOn (int fd, unsigned int input)
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;
@@ -456,7 +457,7 @@ extern "C" void IO_EchoOff (int fd, unsigned int input)
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);
diff --git a/gcc/m2/mc-boot/GIO.h b/gcc/m2/mc-boot/GIO.h
index c9775d270f6..6604ee15c78 100644
--- a/gcc/m2/mc-boot/GIO.h
+++ b/gcc/m2/mc-boot/GIO.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -55,13 +56,13 @@ EXTERN void IO_Error (char ch);
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
@@ -70,7 +71,7 @@ EXTERN void IO_BufferedMode (int fd, unsigned int input);
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
@@ -79,7 +80,7 @@ EXTERN void IO_EchoOn (int fd, unsigned int input);
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
diff --git a/gcc/m2/mc-boot/GIndexing.cc b/gcc/m2/mc-boot/GIndexing.cc
index 0817ff36ca2..4c8e7f6f609 100644
--- a/gcc/m2/mc-boot/GIndexing.cc
+++ b/gcc/m2/mc-boot/GIndexing.cc
@@ -21,6 +21,7 @@ Boston, MA 02110-1301, USA. */
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -70,7 +71,7 @@ struct Indexing__T2_r {
unsigned int Used;
unsigned int Low;
unsigned int High;
- unsigned int Debug;
+ bool Debug;
unsigned int Map;
};
@@ -98,7 +99,7 @@ extern "C" Indexing_Index Indexing_DebugIndex (Indexing_Index i);
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.
@@ -128,7 +129,7 @@ extern "C" void * Indexing_GetIndice (Indexing_Index i, unsigned int n);
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.
@@ -170,7 +171,7 @@ extern "C" Indexing_Index Indexing_InitIndex (unsigned int low)
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;
@@ -199,7 +200,7 @@ extern "C" Indexing_Index Indexing_KillIndex (Indexing_Index 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 ();
@@ -211,7 +212,7 @@ extern "C" Indexing_Index Indexing_DebugIndex (Indexing_Index i)
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)
{
@@ -363,7 +364,7 @@ extern "C" void * Indexing_GetIndice (Indexing_Index i, unsigned int n)
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;
@@ -376,13 +377,13 @@ extern "C" unsigned int Indexing_IsIndiceInIndex (Indexing_Index i, void * a)
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 ();
}
diff --git a/gcc/m2/mc-boot/GIndexing.h b/gcc/m2/mc-boot/GIndexing.h
index c94a986b868..9c8bdc761c3 100644
--- a/gcc/m2/mc-boot/GIndexing.h
+++ b/gcc/m2/mc-boot/GIndexing.h
@@ -29,6 +29,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -77,7 +78,7 @@ EXTERN Indexing_Index Indexing_DebugIndex (Indexing_Index i);
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.
@@ -107,7 +108,7 @@ EXTERN void * Indexing_GetIndice (Indexing_Index i, unsigned int n);
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.
diff --git a/gcc/m2/mc-boot/GM2Dependent.cc b/gcc/m2/mc-boot/GM2Dependent.cc
index 64441fff642..23fb28d26a9 100644
--- a/gcc/m2/mc-boot/GM2Dependent.cc
+++ b/gcc/m2/mc-boot/GM2Dependent.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -74,9 +75,9 @@ struct M2Dependent_ArgCVEnvP_p { M2Dependent_ArgCVEnvP_t proc; };
struct M2Dependent_DependencyList_r {
PROC proc;
- unsigned int forced;
- unsigned int forc;
- unsigned int appl;
+ bool forced;
+ bool forc;
+ bool appl;
M2Dependent_DependencyState state;
};
@@ -92,14 +93,14 @@ struct M2Dependent__T2_r {
};
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
@@ -154,7 +155,7 @@ static void RemoveModule (M2Dependent_ModuleChain *head, M2Dependent_ModuleChain
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 -
@@ -213,19 +214,19 @@ static int strlen_ (M2LINK_PtrToChar string);
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.
@@ -265,7 +266,7 @@ static void DisplayModuleInfo (M2Dependent_DependencyState state, const char *de
DumpModuleData -
*/
-static void DumpModuleData (unsigned int flag);
+static void DumpModuleData (bool flag);
/*
combine - dest := src + dest. Places src at the front of list dest.
@@ -280,7 +281,7 @@ static void combine (M2Dependent_DependencyState src, M2Dependent_DependencyStat
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 -
@@ -312,7 +313,7 @@ static void warning3 (const char *format_, unsigned int _format_high, void * arg
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,
@@ -430,7 +431,7 @@ static void RemoveModule (M2Dependent_ModuleChain *head, M2Dependent_ModuleChain
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;
@@ -440,12 +441,12 @@ static unsigned int onChain (M2Dependent_DependencyState state, M2Dependent_Modu
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 ();
}
@@ -663,7 +664,7 @@ static int strlen_ (M2LINK_PtrToChar string)
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];
@@ -682,7 +683,7 @@ static void traceprintf (unsigned int flag, const char *str_, unsigned int _str_
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];
@@ -707,7 +708,7 @@ static void traceprintf2 (unsigned int flag, const char *str_, unsigned int _str
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];
@@ -907,7 +908,7 @@ static void DisplayModuleInfo (M2Dependent_DependencyState state, const char *de
DumpModuleData -
*/
-static void DumpModuleData (unsigned int flag)
+static void DumpModuleData (bool flag)
{
M2Dependent_ModuleChain mptr;
@@ -945,7 +946,7 @@ static void combine (M2Dependent_DependencyState src, M2Dependent_DependencyStat
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;
@@ -981,7 +982,7 @@ static void ForceModule (void * modname, unsigned int modlen, void * libname, un
mptr = LookupModuleN (M2Dependent_ordered, modname, modlen, libname, liblen);
if (mptr != NULL)
{
- mptr->dependency.forced = TRUE;
+ mptr->dependency.forced = true;
moveTo (M2Dependent_user, mptr);
}
}
@@ -1115,7 +1116,7 @@ static void warning3 (const char *format_, unsigned int _format_high, void * arg
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];
@@ -1153,67 +1154,67 @@ static void SetupDebugFlags (void)
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
@@ -1252,7 +1253,7 @@ static void CheckInitialized (void)
{
if (! Initialized)
{
- Initialized = TRUE;
+ Initialized = true;
Init ();
}
}
@@ -1273,7 +1274,7 @@ extern "C" void M2Dependent_ConstructModules (void * applicationmodule, void * l
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);
diff --git a/gcc/m2/mc-boot/GM2Dependent.h b/gcc/m2/mc-boot/GM2Dependent.h
index 068bbfe3f7c..a26f957bccb 100644
--- a/gcc/m2/mc-boot/GM2Dependent.h
+++ b/gcc/m2/mc-boot/GM2Dependent.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GM2EXCEPTION.cc b/gcc/m2/mc-boot/GM2EXCEPTION.cc
index 387b0476462..7f817d16aa0 100644
--- a/gcc/m2/mc-boot/GM2EXCEPTION.cc
+++ b/gcc/m2/mc-boot/GM2EXCEPTION.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -43,7 +44,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
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)
{
@@ -67,7 +68,7 @@ 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;
diff --git a/gcc/m2/mc-boot/GM2EXCEPTION.h b/gcc/m2/mc-boot/GM2EXCEPTION.h
index 8dd781f6bb3..1ef236732bc 100644
--- a/gcc/m2/mc-boot/GM2EXCEPTION.h
+++ b/gcc/m2/mc-boot/GM2EXCEPTION.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -50,7 +51,7 @@ extern "C" {
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
diff --git a/gcc/m2/mc-boot/GM2LINK.h b/gcc/m2/mc-boot/GM2LINK.h
index 890e3b3185d..edbcc9c5ae8 100644
--- a/gcc/m2/mc-boot/GM2LINK.h
+++ b/gcc/m2/mc-boot/GM2LINK.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -50,7 +51,7 @@ extern "C" {
typedef char *M2LINK_PtrToChar;
EXTERN M2LINK_PtrToChar M2LINK_ForcedModuleInitOrder;
-EXTERN unsigned int M2LINK_StaticInitialization;
+EXTERN bool M2LINK_StaticInitialization;
# ifdef __cplusplus
}
# endif
diff --git a/gcc/m2/mc-boot/GM2RTS.cc b/gcc/m2/mc-boot/GM2RTS.cc
index 2e8680ccb96..93bb9c20d19 100644
--- a/gcc/m2/mc-boot/GM2RTS.cc
+++ b/gcc/m2/mc-boot/GM2RTS.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -87,9 +88,9 @@ struct M2RTS__T1_r {
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
@@ -128,7 +129,7 @@ extern "C" void M2RTS_RequestDependant (void * modulename, void * libname, void
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
@@ -143,7 +144,7 @@ extern "C" void M2RTS_ExecuteInitialProcedures (void);
main program module.
*/
-extern "C" unsigned int M2RTS_InstallInitialProcedure (PROC p);
+extern "C" bool M2RTS_InstallInitialProcedure (PROC p);
/*
ExecuteTerminationProcedures - calls each installed termination procedure
@@ -247,7 +248,7 @@ static void ExecuteReverse (M2RTS_ProcedureChain procptr);
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.
@@ -310,7 +311,7 @@ static void ExecuteReverse (M2RTS_ProcedureChain procptr)
defined by proclist.
*/
-static unsigned int AppendProc (M2RTS_ProcedureList *proclist, PROC proc)
+static bool AppendProc (M2RTS_ProcedureList *proclist, PROC proc)
{
M2RTS_ProcedureChain pdes;
@@ -323,7 +324,7 @@ static unsigned int AppendProc (M2RTS_ProcedureList *proclist, PROC proc)
(*proclist).head = pdes;
}
(*proclist).tail = pdes;
- return TRUE;
+ return true;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -407,8 +408,8 @@ static void Init (void)
InitProcList (&InitialProc);
InitProcList (&TerminateProc);
ExitValue = 0;
- isHalting = FALSE;
- CallExit = FALSE; /* default by calling abort */
+ isHalting = false;
+ CallExit = false; /* default by calling abort */
}
@@ -423,7 +424,7 @@ static void CheckInitialized (void)
{
if (! Initialized)
{
- Initialized = TRUE;
+ Initialized = true;
Init ();
}
}
@@ -482,7 +483,7 @@ extern "C" void M2RTS_RequestDependant (void * modulename, void * libname, void
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. */
@@ -507,7 +508,7 @@ extern "C" void M2RTS_ExecuteInitialProcedures (void)
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. */
@@ -554,7 +555,7 @@ extern "C" void M2RTS_HALT (int exitcode)
{
if (exitcode != -1)
{
- CallExit = TRUE;
+ CallExit = true;
ExitValue = exitcode;
}
if (isHalting)
@@ -564,7 +565,7 @@ extern "C" void M2RTS_HALT (int exitcode)
}
else
{
- isHalting = TRUE;
+ isHalting = true;
M2RTS_ExecuteTerminationProcedures ();
}
if (CallExit)
@@ -618,7 +619,7 @@ extern "C" void M2RTS_HaltC (void * filename, unsigned int line, void * function
extern "C" void M2RTS_ExitOnHalt (int e)
{
ExitValue = e;
- CallExit = TRUE;
+ CallExit = true;
}
diff --git a/gcc/m2/mc-boot/GM2RTS.h b/gcc/m2/mc-boot/GM2RTS.h
index eb1025c7922..85a553225d0 100644
--- a/gcc/m2/mc-boot/GM2RTS.h
+++ b/gcc/m2/mc-boot/GM2RTS.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -79,7 +80,7 @@ EXTERN void M2RTS_RequestDependant (void * modulename, void * libname, void * de
procedure is installed.
*/
-EXTERN unsigned int M2RTS_InstallTerminationProcedure (PROC p);
+EXTERN bool M2RTS_InstallTerminationProcedure (PROC p);
/*
ExecuteInitialProcedures - executes the initial procedures installed
@@ -94,7 +95,7 @@ EXTERN void M2RTS_ExecuteInitialProcedures (void);
program module.
*/
-EXTERN unsigned int M2RTS_InstallInitialProcedure (PROC p);
+EXTERN bool M2RTS_InstallInitialProcedure (PROC p);
/*
ExecuteTerminationProcedures - calls each installed termination procedure
diff --git a/gcc/m2/mc-boot/GMemUtils.cc b/gcc/m2/mc-boot/GMemUtils.cc
index a80e00ecec8..72c024af0d1 100644
--- a/gcc/m2/mc-boot/GMemUtils.cc
+++ b/gcc/m2/mc-boot/GMemUtils.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GMemUtils.h b/gcc/m2/mc-boot/GMemUtils.h
index 55dbd7fdcc9..dbf00654084 100644
--- a/gcc/m2/mc-boot/GMemUtils.h
+++ b/gcc/m2/mc-boot/GMemUtils.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GNumberIO.cc b/gcc/m2/mc-boot/GNumberIO.cc
index 53bac45552c..e9c5018f119 100644
--- a/gcc/m2/mc-boot/GNumberIO.cc
+++ b/gcc/m2/mc-boot/GNumberIO.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -190,7 +191,7 @@ extern "C" void NumberIO_CardToStr (unsigned int x, unsigned int n, char *a, uns
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];
@@ -200,7 +201,7 @@ extern "C" void NumberIO_StrToCard (const char *a_, unsigned int _a_high, unsign
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)
@@ -211,18 +212,18 @@ extern "C" void NumberIO_StrToCard (const char *a_, unsigned int _a_high, unsign
}
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)
@@ -231,12 +232,12 @@ extern "C" void NumberIO_StrToCard (const char *a_, unsigned int _a_high, unsign
i += 1;
if ((a[i] < '0') || (a[i] > '9'))
{
- ok = FALSE;
+ ok = false;
}
}
else
{
- ok = FALSE;
+ ok = false;
}
} while (! (! ok));
}
@@ -314,12 +315,12 @@ extern "C" void NumberIO_IntToStr (int x, unsigned int n, char *a, unsigned int
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)
{
@@ -329,7 +330,7 @@ extern "C" void NumberIO_IntToStr (int x, unsigned int n, char *a, unsigned int
else
{
c = x;
- Negative = FALSE;
+ Negative = false;
}
i = 0;
do {
@@ -372,8 +373,8 @@ extern "C" void NumberIO_IntToStr (int x, unsigned int n, char *a, unsigned int
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];
@@ -383,8 +384,8 @@ extern "C" void NumberIO_StrToInt (const char *a_, unsigned int _a_high, int *x)
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)
@@ -402,18 +403,18 @@ extern "C" void NumberIO_StrToInt (const char *a_, unsigned int _a_high, int *x)
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)
{
@@ -429,12 +430,12 @@ extern "C" void NumberIO_StrToInt (const char *a_, unsigned int _a_high, int *x)
i += 1;
if ((a[i] < '0') || (a[i] > '9'))
{
- ok = FALSE;
+ ok = false;
}
}
else
{
- ok = FALSE;
+ ok = false;
}
} while (! (! ok));
}
@@ -597,7 +598,7 @@ extern "C" void NumberIO_StrToBin (const char *a_, unsigned int _a_high, unsigne
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];
@@ -607,7 +608,7 @@ extern "C" void NumberIO_StrToBinInt (const char *a_, unsigned int _a_high, int
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)
@@ -618,18 +619,18 @@ extern "C" void NumberIO_StrToBinInt (const char *a_, unsigned int _a_high, int
}
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)
@@ -638,12 +639,12 @@ extern "C" void NumberIO_StrToBinInt (const char *a_, unsigned int _a_high, int
i += 1;
if ((a[i] < '0') || (a[i] > '1'))
{
- ok = FALSE;
+ ok = false;
}
}
else
{
- ok = FALSE;
+ ok = false;
}
} while (! (! ok));
}
@@ -652,7 +653,7 @@ extern "C" void NumberIO_StrToBinInt (const char *a_, unsigned int _a_high, int
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];
@@ -662,14 +663,14 @@ extern "C" void NumberIO_StrToHexInt (const char *a_, unsigned int _a_high, int
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
{
@@ -678,13 +679,13 @@ extern "C" void NumberIO_StrToHexInt (const char *a_, unsigned int _a_high, int
}
else
{
- ok = FALSE;
+ ok = false;
}
}
(*x) = 0;
if (i < higha)
{
- ok = TRUE;
+ ok = true;
do {
if ((a[i] >= '0') && (a[i] <= '9'))
{
@@ -701,12 +702,12 @@ extern "C" void NumberIO_StrToHexInt (const char *a_, unsigned int _a_high, int
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));
}
@@ -715,7 +716,7 @@ extern "C" void NumberIO_StrToHexInt (const char *a_, unsigned int _a_high, int
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];
@@ -725,7 +726,7 @@ extern "C" void NumberIO_StrToOctInt (const char *a_, unsigned int _a_high, int
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)
@@ -736,18 +737,18 @@ extern "C" void NumberIO_StrToOctInt (const char *a_, unsigned int _a_high, int
}
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)
@@ -756,12 +757,12 @@ extern "C" void NumberIO_StrToOctInt (const char *a_, unsigned int _a_high, int
i += 1;
if ((a[i] < '0') || (a[i] > '7'))
{
- ok = FALSE;
+ ok = false;
}
}
else
{
- ok = FALSE;
+ ok = false;
}
} while (! (! ok));
}
diff --git a/gcc/m2/mc-boot/GNumberIO.h b/gcc/m2/mc-boot/GNumberIO.h
index 1a5690e1c25..a18fb256e01 100644
--- a/gcc/m2/mc-boot/GNumberIO.h
+++ b/gcc/m2/mc-boot/GNumberIO.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GPushBackInput.cc b/gcc/m2/mc-boot/GPushBackInput.cc
index e15b3eb9007..fa052b4d6c3 100644
--- a/gcc/m2/mc-boot/GPushBackInput.cc
+++ b/gcc/m2/mc-boot/GPushBackInput.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -68,7 +69,7 @@ static unsigned int ExitStatus;
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.
@@ -141,7 +142,7 @@ extern "C" unsigned int PushBackInput_GetExitStatus (void);
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.
@@ -441,7 +442,7 @@ extern "C" unsigned int PushBackInput_GetExitStatus (void)
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;
}
@@ -479,7 +480,7 @@ extern "C" unsigned int PushBackInput_GetCurrentLine (void)
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 ();
}
diff --git a/gcc/m2/mc-boot/GPushBackInput.h b/gcc/m2/mc-boot/GPushBackInput.h
index ce7cc8e5137..09a65f516eb 100644
--- a/gcc/m2/mc-boot/GPushBackInput.h
+++ b/gcc/m2/mc-boot/GPushBackInput.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -121,7 +122,7 @@ EXTERN unsigned int PushBackInput_GetExitStatus (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.
diff --git a/gcc/m2/mc-boot/GRTExceptions.cc b/gcc/m2/mc-boot/GRTExceptions.cc
index 23f8fede117..21624a9cf3c 100644
--- a/gcc/m2/mc-boot/GRTExceptions.cc
+++ b/gcc/m2/mc-boot/GRTExceptions.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -92,7 +93,7 @@ struct RTExceptions__T3_r {
RTExceptions_Handler stack;
};
-static unsigned int inException;
+static bool inException;
static RTExceptions_Handler freeHandler;
static RTExceptions_EHBlock freeEHB;
static RTExceptions_EHBlock currentEHB;
@@ -185,7 +186,7 @@ extern "C" void RTExceptions_BaseExceptionsThrow (void);
in the exception state.
*/
-extern "C" unsigned int RTExceptions_IsInExceptionState (void);
+extern "C" bool RTExceptions_IsInExceptionState (void);
/*
SetExceptionState - returns the current exception state and
@@ -193,7 +194,7 @@ extern "C" unsigned int RTExceptions_IsInExceptionState (void);
to.
*/
-extern "C" unsigned int RTExceptions_SetExceptionState (unsigned int to);
+extern "C" bool RTExceptions_SetExceptionState (bool to);
/*
SwitchExceptionState - assigns, from, with the current exception
@@ -201,7 +202,7 @@ extern "C" unsigned int RTExceptions_SetExceptionState (unsigned int to);
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
@@ -871,7 +872,7 @@ static void exception (void * a)
static void Init (void)
{
- inException = FALSE;
+ inException = false;
freeHandler = NULL;
freeEHB = NULL;
currentEHB = RTExceptions_InitExceptionBlock ();
@@ -1132,7 +1133,7 @@ extern "C" void RTExceptions_BaseExceptionsThrow (void)
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. */
@@ -1146,9 +1147,9 @@ extern "C" unsigned int RTExceptions_IsInExceptionState (void)
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;
@@ -1164,7 +1165,7 @@ extern "C" unsigned int RTExceptions_SetExceptionState (unsigned int 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;
diff --git a/gcc/m2/mc-boot/GRTExceptions.h b/gcc/m2/mc-boot/GRTExceptions.h
index 3f8e64dc7f3..c48f7bbde03 100644
--- a/gcc/m2/mc-boot/GRTExceptions.h
+++ b/gcc/m2/mc-boot/GRTExceptions.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -146,7 +147,7 @@ EXTERN void RTExceptions_BaseExceptionsThrow (void);
in the exception state.
*/
-EXTERN unsigned int RTExceptions_IsInExceptionState (void);
+EXTERN bool RTExceptions_IsInExceptionState (void);
/*
SetExceptionState - returns the current exception state and
@@ -154,7 +155,7 @@ EXTERN unsigned int RTExceptions_IsInExceptionState (void);
to.
*/
-EXTERN unsigned int RTExceptions_SetExceptionState (unsigned int to);
+EXTERN bool RTExceptions_SetExceptionState (bool to);
/*
SwitchExceptionState - assigns, from, with the current exception
@@ -162,7 +163,7 @@ EXTERN unsigned int RTExceptions_SetExceptionState (unsigned int to);
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
diff --git a/gcc/m2/mc-boot/GRTco.h b/gcc/m2/mc-boot/GRTco.h
index 180c495a9a2..09e6d8b4cff 100644
--- a/gcc/m2/mc-boot/GRTco.h
+++ b/gcc/m2/mc-boot/GRTco.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GRTentity.h b/gcc/m2/mc-boot/GRTentity.h
index 9fc2492b123..9efb64502f7 100644
--- a/gcc/m2/mc-boot/GRTentity.h
+++ b/gcc/m2/mc-boot/GRTentity.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -58,7 +59,7 @@ EXTERN RTentity_Group RTentity_KillGroup (RTentity_Group g);
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
diff --git a/gcc/m2/mc-boot/GRTint.cc b/gcc/m2/mc-boot/GRTint.cc
index a3030f2d9a1..f8e26c105ac 100644
--- a/gcc/m2/mc-boot/GRTint.cc
+++ b/gcc/m2/mc-boot/GRTint.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -62,7 +63,7 @@ typedef struct RTint_DispatchVector_p RTint_DispatchVector;
# define Microseconds 1000000
# define DebugTime 0
-# define Debugging FALSE
+# define Debugging false
typedef struct RTint__T1_r RTint__T1;
typedef RTint__T1 *RTint_Vector;
@@ -84,7 +85,7 @@ struct RTint__T1_r {
int File;
Selective_Timeval rel;
Selective_Timeval abs_;
- unsigned int queued;
+ bool queued;
};
struct RTint__T2_a { RTint_Vector array[(7)-(COROUTINES_UnassignedPriority)+1]; };
@@ -92,7 +93,7 @@ static unsigned int VecNo;
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
@@ -162,7 +163,7 @@ extern "C" void RTint_ExcludeVector (unsigned int vec);
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 -
@@ -218,7 +219,7 @@ static void AddTime (Selective_Timeval t1, Selective_Timeval t2);
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.
@@ -230,7 +231,7 @@ static void SubTime (unsigned int *s, unsigned int *m, Selective_Timeval a, Sele
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 -
@@ -428,7 +429,7 @@ static void AddTime (Selective_Timeval t1, Selective_Timeval t2)
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;
@@ -488,7 +489,7 @@ static void SubTime (unsigned int *s, unsigned int *m, Selective_Timeval a, Sele
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;
@@ -520,7 +521,7 @@ static unsigned int activatePending (unsigned int untilInterrupt, RTint_Dispatch
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;
@@ -535,7 +536,7 @@ static unsigned int activatePending (unsigned int untilInterrupt, RTint_Dispatch
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;
@@ -568,7 +569,7 @@ static unsigned int activatePending (unsigned int untilInterrupt, RTint_Dispatch
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)
{
@@ -588,7 +589,7 @@ static unsigned int activatePending (unsigned int untilInterrupt, RTint_Dispatch
p -= 1;
}
RTco_signal (lock);
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -609,7 +610,7 @@ static void init (void)
{
Pending.array[p-(COROUTINES_UnassignedPriority)] = NULL;
}
- initialized = TRUE;
+ initialized = true;
RTco_signal (lock);
}
@@ -726,7 +727,7 @@ extern "C" unsigned int RTint_InitTimeVector (unsigned int micro, unsigned int s
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);
@@ -850,7 +851,7 @@ extern "C" void RTint_IncludeVector (unsigned int vec)
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, µ);
@@ -907,7 +908,7 @@ extern "C" void RTint_ExcludeVector (unsigned int vec)
}
if (vptr->type == RTint_time)
{
- vptr->queued = FALSE;
+ vptr->queued = false;
}
}
RTco_signal (lock);
@@ -923,9 +924,9 @@ extern "C" void RTint_ExcludeVector (unsigned int vec)
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;
@@ -955,7 +956,7 @@ extern "C" void RTint_Listen (unsigned int untilInterrupt, RTint_DispatchVector
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)];
@@ -981,7 +982,7 @@ extern "C" void RTint_Listen (unsigned int untilInterrupt, RTint_DispatchVector
libc_printf ((const char *) "shortest delay is %u.%06u\\n", 27, sec, micro);
}
Selective_SetTime (timeval, sec, micro);
- found = TRUE;
+ found = true;
}
break;
diff --git a/gcc/m2/mc-boot/GRTint.h b/gcc/m2/mc-boot/GRTint.h
index ccc6afefc40..83fef96754d 100644
--- a/gcc/m2/mc-boot/GRTint.h
+++ b/gcc/m2/mc-boot/GRTint.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -122,7 +123,7 @@ EXTERN void RTint_ExcludeVector (unsigned int vec);
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.
diff --git a/gcc/m2/mc-boot/GSArgs.cc b/gcc/m2/mc-boot/GSArgs.cc
index 143d2783c16..f98849f9710 100644
--- a/gcc/m2/mc-boot/GSArgs.cc
+++ b/gcc/m2/mc-boot/GSArgs.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -64,7 +65,7 @@ typedef SArgs_PtrToChar *SArgs_PtrToPtrToChar;
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
@@ -81,7 +82,7 @@ extern "C" unsigned int SArgs_Narg (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)
{
int i;
SArgs_PtrToPtrToChar ppc;
@@ -92,12 +93,12 @@ extern "C" unsigned int SArgs_GetArg (DynamicStrings_String *s, unsigned int n)
/* 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 ();
diff --git a/gcc/m2/mc-boot/GSArgs.h b/gcc/m2/mc-boot/GSArgs.h
index 631aaa79200..087238acf11 100644
--- a/gcc/m2/mc-boot/GSArgs.h
+++ b/gcc/m2/mc-boot/GSArgs.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -56,7 +57,7 @@ extern "C" {
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
diff --git a/gcc/m2/mc-boot/GSFIO.cc b/gcc/m2/mc-boot/GSFIO.cc
index 1a800138812..43be478c506 100644
--- a/gcc/m2/mc-boot/GSFIO.cc
+++ b/gcc/m2/mc-boot/GSFIO.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -49,7 +50,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
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
@@ -81,7 +82,7 @@ extern "C" FIO_File SFIO_OpenToWrite (DynamicStrings_String fname);
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.
@@ -103,7 +104,7 @@ extern "C" DynamicStrings_String SFIO_ReadS (FIO_File file);
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. */
@@ -153,7 +154,7 @@ extern "C" FIO_File SFIO_OpenToWrite (DynamicStrings_String fname)
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. */
diff --git a/gcc/m2/mc-boot/GSFIO.h b/gcc/m2/mc-boot/GSFIO.h
index 02bfa650130..982016e7fab 100644
--- a/gcc/m2/mc-boot/GSFIO.h
+++ b/gcc/m2/mc-boot/GSFIO.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -54,7 +55,7 @@ extern "C" {
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
@@ -86,7 +87,7 @@ EXTERN FIO_File SFIO_OpenToWrite (DynamicStrings_String fname);
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.
diff --git a/gcc/m2/mc-boot/GSYSTEM.h b/gcc/m2/mc-boot/GSYSTEM.h
index 4460451fac6..d355ab70d40 100644
--- a/gcc/m2/mc-boot/GSYSTEM.h
+++ b/gcc/m2/mc-boot/GSYSTEM.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GSelective.h b/gcc/m2/mc-boot/GSelective.h
index a88cc360b49..289c685f075 100644
--- a/gcc/m2/mc-boot/GSelective.h
+++ b/gcc/m2/mc-boot/GSelective.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -62,7 +63,7 @@ EXTERN Selective_SetOfFd Selective_KillSet (Selective_SetOfFd s);
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);
diff --git a/gcc/m2/mc-boot/GStdIO.cc b/gcc/m2/mc-boot/GStdIO.cc
index 41affe2a054..c15eb6dfea3 100644
--- a/gcc/m2/mc-boot/GStdIO.cc
+++ b/gcc/m2/mc-boot/GStdIO.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GStdIO.h b/gcc/m2/mc-boot/GStdIO.h
index d1f48e0c918..e235a531b6a 100644
--- a/gcc/m2/mc-boot/GStdIO.h
+++ b/gcc/m2/mc-boot/GStdIO.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GStorage.cc b/gcc/m2/mc-boot/GStorage.cc
index 5dac021d866..1311597c2c3 100644
--- a/gcc/m2/mc-boot/GStorage.cc
+++ b/gcc/m2/mc-boot/GStorage.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -41,7 +42,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
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)
{
@@ -58,7 +59,7 @@ extern "C" void Storage_REALLOCATE (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. */
diff --git a/gcc/m2/mc-boot/GStorage.h b/gcc/m2/mc-boot/GStorage.h
index e6075f807da..d7cd15ea7b0 100644
--- a/gcc/m2/mc-boot/GStorage.h
+++ b/gcc/m2/mc-boot/GStorage.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -77,7 +78,7 @@ EXTERN void Storage_REALLOCATE (void * *a, unsigned int Size);
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
diff --git a/gcc/m2/mc-boot/GStrCase.cc b/gcc/m2/mc-boot/GStrCase.cc
index e3491b6d75b..e55c6f8cc65 100644
--- a/gcc/m2/mc-boot/GStrCase.cc
+++ b/gcc/m2/mc-boot/GStrCase.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GStrCase.h b/gcc/m2/mc-boot/GStrCase.h
index dbcf1bd0657..2a3f4105f32 100644
--- a/gcc/m2/mc-boot/GStrCase.h
+++ b/gcc/m2/mc-boot/GStrCase.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GStrIO.cc b/gcc/m2/mc-boot/GStrIO.cc
index 1e091bce545..dc1ad67d03e 100644
--- a/gcc/m2/mc-boot/GStrIO.cc
+++ b/gcc/m2/mc-boot/GStrIO.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -44,7 +45,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# include "GStdIO.h"
# include "Glibc.h"
-static unsigned int IsATTY;
+static bool IsATTY;
/*
WriteLn - writes a carriage return and a newline
@@ -85,7 +86,7 @@ static void Echo (char ch);
AlphaNum- returns true if character, ch, is an alphanumeric character.
*/
-static unsigned int AlphaNum (char ch);
+static bool AlphaNum (char ch);
/*
@@ -119,7 +120,7 @@ static void Echo (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. */
@@ -269,7 +270,7 @@ extern "C" void StrIO_WriteString (const char *a_, unsigned int _a_high)
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[])
diff --git a/gcc/m2/mc-boot/GStrIO.h b/gcc/m2/mc-boot/GStrIO.h
index 94d49ae079d..7883172a12a 100644
--- a/gcc/m2/mc-boot/GStrIO.h
+++ b/gcc/m2/mc-boot/GStrIO.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GStrLib.cc b/gcc/m2/mc-boot/GStrLib.cc
index 537eeb96356..6d07827f089 100644
--- a/gcc/m2/mc-boot/GStrLib.cc
+++ b/gcc/m2/mc-boot/GStrLib.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -58,8 +59,8 @@ extern "C" void StrLib_StrConCat (const char *a_, unsigned int _a_high, const ch
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);
/*
@@ -74,7 +75,7 @@ extern "C" void StrLib_StrCopy (const char *src_, unsigned int _src_high, char *
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
@@ -87,14 +88,14 @@ extern "C" void StrLib_StrRemoveWhitePrefix (const char *a_, unsigned int _a_hig
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. */
@@ -142,7 +143,7 @@ extern "C" void StrLib_StrConCat (const char *a_, unsigned int _a_high, const ch
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;
@@ -161,12 +162,12 @@ extern "C" unsigned int StrLib_StrLess (const char *a_, unsigned int _a_high, co
{
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;
@@ -176,7 +177,7 @@ extern "C" unsigned int StrLib_StrLess (const char *a_, unsigned int _a_high, co
__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;
@@ -195,7 +196,7 @@ extern "C" unsigned int StrLib_StrEqual (const char *a_, unsigned int _a_high, c
{
if (a[i] != b[i])
{
- return FALSE;
+ return false;
}
i += 1;
}
@@ -260,7 +261,7 @@ extern "C" void StrLib_StrCopy (const char *src_, unsigned int _src_high, char *
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;
@@ -287,7 +288,7 @@ extern "C" unsigned int StrLib_IsSubString (const char *a_, unsigned int _a_high
}
if (j == LengthB)
{
- return TRUE;
+ return true;
}
else
{
@@ -295,7 +296,7 @@ extern "C" unsigned int StrLib_IsSubString (const char *a_, unsigned int _a_high
}
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
diff --git a/gcc/m2/mc-boot/GStrLib.h b/gcc/m2/mc-boot/GStrLib.h
index b23c1f9b2f9..de3250b0b6c 100644
--- a/gcc/m2/mc-boot/GStrLib.h
+++ b/gcc/m2/mc-boot/GStrLib.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -59,13 +60,13 @@ EXTERN void StrLib_StrConCat (const char *a_, unsigned int _a_high, const char *
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.
@@ -85,7 +86,7 @@ EXTERN void StrLib_StrCopy (const char *src_, unsigned int _src_high, char *dest
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
diff --git a/gcc/m2/mc-boot/GStringConvert.cc b/gcc/m2/mc-boot/GStringConvert.cc
index faa5e34459e..f3696607abe 100644
--- a/gcc/m2/mc-boot/GStringConvert.cc
+++ b/gcc/m2/mc-boot/GStringConvert.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -67,7 +68,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
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
@@ -78,7 +79,7 @@ extern "C" DynamicStrings_String StringConvert_IntegerToString (int i, unsigned
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.
@@ -88,7 +89,7 @@ extern "C" DynamicStrings_String StringConvert_CardinalToString (unsigned int c,
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.
@@ -98,7 +99,7 @@ extern "C" int StringConvert_StringToInteger (DynamicStrings_String s, unsigned
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
@@ -112,7 +113,7 @@ extern "C" unsigned int StringConvert_StringToCardinal (DynamicStrings_String s,
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.
@@ -122,7 +123,7 @@ extern "C" DynamicStrings_String StringConvert_LongIntegerToString (long int i,
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
@@ -135,7 +136,7 @@ extern "C" long int StringConvert_StringToLongInteger (DynamicStrings_String s,
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.
@@ -145,7 +146,7 @@ extern "C" DynamicStrings_String StringConvert_LongCardinalToString (long unsign
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
@@ -158,7 +159,7 @@ extern "C" long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_
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.
@@ -168,7 +169,7 @@ extern "C" DynamicStrings_String StringConvert_ShortCardinalToString (short unsi
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
@@ -180,7 +181,7 @@ extern "C" int StringConvert_stoi (DynamicStrings_String s);
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.
@@ -234,7 +235,7 @@ extern "C" unsigned int StringConvert_bstoc (DynamicStrings_String s);
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,
@@ -319,7 +320,7 @@ extern "C" DynamicStrings_String StringConvert_ToDecimalPlaces (DynamicStrings_S
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 -
@@ -343,49 +344,49 @@ static long unsigned int LongMin (long unsigned int a, long unsigned int b);
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.
@@ -441,7 +442,7 @@ static DynamicStrings_String carryOne (DynamicStrings_String s, unsigned int i);
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];
@@ -518,7 +519,7 @@ static long unsigned int LongMin (long unsigned int a, long unsigned int b)
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. */
@@ -531,16 +532,16 @@ static unsigned int IsDigit (char ch)
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 ();
@@ -552,23 +553,23 @@ static unsigned int IsDecimalDigitValid (char ch, unsigned int base, unsigned in
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 ();
@@ -580,16 +581,16 @@ static unsigned int IsHexidecimalDigitValid (char ch, unsigned int base, unsigne
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 ();
@@ -601,23 +602,23 @@ static unsigned int IsDecimalDigitValidLong (char ch, unsigned int base, long un
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 ();
@@ -629,16 +630,16 @@ static unsigned int IsHexidecimalDigitValidLong (char ch, unsigned int base, lon
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 ();
@@ -650,23 +651,23 @@ static unsigned int IsDecimalDigitValidShort (char ch, unsigned int base, short
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 ();
@@ -1073,7 +1074,7 @@ static DynamicStrings_String carryOne (DynamicStrings_String s, unsigned int i)
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;
@@ -1086,11 +1087,11 @@ extern "C" DynamicStrings_String StringConvert_IntegerToString (int i, unsigned
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
@@ -1112,7 +1113,7 @@ extern "C" DynamicStrings_String StringConvert_IntegerToString (int i, unsigned
}
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
{
@@ -1151,7 +1152,7 @@ extern "C" DynamicStrings_String StringConvert_IntegerToString (int i, unsigned
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;
@@ -1196,18 +1197,18 @@ extern "C" DynamicStrings_String StringConvert_CardinalToString (unsigned int c,
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 - */
@@ -1221,7 +1222,7 @@ extern "C" int StringConvert_StringToInteger (DynamicStrings_String s, unsigned
}
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;
}
}
@@ -1247,7 +1248,7 @@ extern "C" int StringConvert_StringToInteger (DynamicStrings_String s, unsigned
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;
@@ -1266,7 +1267,7 @@ extern "C" unsigned int StringConvert_StringToCardinal (DynamicStrings_String s,
}
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;
}
}
@@ -1289,7 +1290,7 @@ extern "C" unsigned int StringConvert_StringToCardinal (DynamicStrings_String s,
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;
@@ -1303,11 +1304,11 @@ extern "C" DynamicStrings_String StringConvert_LongIntegerToString (long int i,
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
@@ -1329,7 +1330,7 @@ extern "C" DynamicStrings_String StringConvert_LongIntegerToString (long int i,
}
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
{
@@ -1367,18 +1368,18 @@ extern "C" DynamicStrings_String StringConvert_LongIntegerToString (long int i,
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 - */
@@ -1392,7 +1393,7 @@ extern "C" long int StringConvert_StringToLongInteger (DynamicStrings_String s,
}
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;
}
}
@@ -1421,7 +1422,7 @@ extern "C" long int StringConvert_StringToLongInteger (DynamicStrings_String s,
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;
@@ -1466,7 +1467,7 @@ extern "C" DynamicStrings_String StringConvert_LongCardinalToString (long unsign
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;
@@ -1485,7 +1486,7 @@ extern "C" long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_
}
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;
}
}
@@ -1507,7 +1508,7 @@ extern "C" long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_
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;
@@ -1552,7 +1553,7 @@ extern "C" DynamicStrings_String StringConvert_ShortCardinalToString (short unsi
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;
@@ -1571,7 +1572,7 @@ extern "C" short unsigned int StringConvert_StringToShortCardinal (DynamicString
}
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;
}
}
@@ -1588,7 +1589,7 @@ extern "C" short unsigned int StringConvert_StringToShortCardinal (DynamicString
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. */
@@ -1600,9 +1601,9 @@ extern "C" int StringConvert_stoi (DynamicStrings_String s)
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 ();
}
@@ -1614,7 +1615,7 @@ extern "C" DynamicStrings_String StringConvert_itos (int i, unsigned int width,
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 ();
}
@@ -1626,7 +1627,7 @@ extern "C" DynamicStrings_String StringConvert_ctos (unsigned int c, unsigned in
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. */
@@ -1640,7 +1641,7 @@ extern "C" unsigned int StringConvert_stoc (DynamicStrings_String s)
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. */
@@ -1654,7 +1655,7 @@ extern "C" int StringConvert_hstoi (DynamicStrings_String s)
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. */
@@ -1668,7 +1669,7 @@ extern "C" int StringConvert_ostoi (DynamicStrings_String s)
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. */
@@ -1682,7 +1683,7 @@ extern "C" int StringConvert_bstoi (DynamicStrings_String s)
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. */
@@ -1696,7 +1697,7 @@ extern "C" unsigned int StringConvert_hstoc (DynamicStrings_String s)
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. */
@@ -1710,7 +1711,7 @@ extern "C" unsigned int StringConvert_ostoc (DynamicStrings_String s)
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. */
@@ -1722,9 +1723,9 @@ extern "C" unsigned int StringConvert_bstoc (DynamicStrings_String s)
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 */
@@ -1763,16 +1764,16 @@ extern "C" long double StringConvert_StringToLongreal (DynamicStrings_String s,
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
@@ -1832,7 +1833,7 @@ extern "C" DynamicStrings_String StringConvert_LongrealToString (long double x,
{
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
{
@@ -1846,7 +1847,7 @@ extern "C" DynamicStrings_String StringConvert_LongrealToString (long double x,
{
s = StringConvert_ToDecimalPlaces (s, FractionWidth);
s = DynamicStrings_ConCat (DynamicStrings_InitStringChar ('-'), DynamicStrings_Mark (s));
- sign = FALSE;
+ sign = false;
}
else
{
@@ -1871,7 +1872,7 @@ extern "C" DynamicStrings_String StringConvert_LongrealToString (long double x,
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. */
@@ -1885,7 +1886,7 @@ extern "C" double StringConvert_stor (DynamicStrings_String s)
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. */
diff --git a/gcc/m2/mc-boot/GStringConvert.h b/gcc/m2/mc-boot/GStringConvert.h
index fc320fa051b..d3826fa4ca5 100644
--- a/gcc/m2/mc-boot/GStringConvert.h
+++ b/gcc/m2/mc-boot/GStringConvert.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -61,7 +62,7 @@ extern "C" {
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
@@ -74,7 +75,7 @@ EXTERN DynamicStrings_String StringConvert_IntegerToString (int i, unsigned int
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.
@@ -84,7 +85,7 @@ EXTERN DynamicStrings_String StringConvert_CardinalToString (unsigned int c, uns
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.
@@ -94,7 +95,7 @@ EXTERN int StringConvert_StringToInteger (DynamicStrings_String s, unsigned int
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
@@ -108,7 +109,7 @@ EXTERN unsigned int StringConvert_StringToCardinal (DynamicStrings_String s, uns
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.
@@ -118,7 +119,7 @@ EXTERN DynamicStrings_String StringConvert_LongIntegerToString (long int i, unsi
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
@@ -131,7 +132,7 @@ EXTERN long int StringConvert_StringToLongInteger (DynamicStrings_String s, unsi
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.
@@ -141,7 +142,7 @@ EXTERN DynamicStrings_String StringConvert_LongCardinalToString (long unsigned i
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
@@ -154,7 +155,7 @@ EXTERN long unsigned int StringConvert_StringToLongCardinal (DynamicStrings_Stri
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.
@@ -164,7 +165,7 @@ EXTERN DynamicStrings_String StringConvert_ShortCardinalToString (short unsigned
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
@@ -176,7 +177,7 @@ EXTERN int StringConvert_stoi (DynamicStrings_String s);
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.
@@ -231,7 +232,7 @@ EXTERN unsigned int StringConvert_bstoc (DynamicStrings_String s);
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,
diff --git a/gcc/m2/mc-boot/GSysExceptions.h b/gcc/m2/mc-boot/GSysExceptions.h
index bcc0a41c0b6..1dcb55d1159 100644
--- a/gcc/m2/mc-boot/GSysExceptions.h
+++ b/gcc/m2/mc-boot/GSysExceptions.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GSysStorage.cc b/gcc/m2/mc-boot/GSysStorage.cc
index 98c03f66c35..ea7d4730870 100644
--- a/gcc/m2/mc-boot/GSysStorage.cc
+++ b/gcc/m2/mc-boot/GSysStorage.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -52,12 +53,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# 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);
@@ -79,7 +80,7 @@ extern "C" void SysStorage_REALLOCATE (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.
@@ -182,7 +183,7 @@ extern "C" void SysStorage_REALLOCATE (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)
{
void * a;
@@ -198,7 +199,7 @@ extern "C" unsigned int SysStorage_Available (unsigned int size)
{
libc_printf ((const char *) " no\\n", 7, size);
}
- return FALSE;
+ return false;
}
else
{
@@ -207,7 +208,7 @@ extern "C" unsigned int SysStorage_Available (unsigned int size)
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 ();
@@ -232,7 +233,7 @@ extern "C" void _M2_SysStorage_init (__attribute__((unused)) int argc,__attribut
}
else
{
- trace = FALSE;
+ trace = false;
}
if (enableZero)
{
@@ -240,7 +241,7 @@ extern "C" void _M2_SysStorage_init (__attribute__((unused)) int argc,__attribut
}
else
{
- zero = FALSE;
+ zero = false;
}
}
diff --git a/gcc/m2/mc-boot/GSysStorage.h b/gcc/m2/mc-boot/GSysStorage.h
index 10b89b3313a..df8bf89b26e 100644
--- a/gcc/m2/mc-boot/GSysStorage.h
+++ b/gcc/m2/mc-boot/GSysStorage.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -77,7 +78,7 @@ EXTERN void SysStorage_REALLOCATE (void * *a, unsigned int size);
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.
diff --git a/gcc/m2/mc-boot/GTimeString.cc b/gcc/m2/mc-boot/GTimeString.cc
index 7e50f4b7551..1ad7a32a0eb 100644
--- a/gcc/m2/mc-boot/GTimeString.cc
+++ b/gcc/m2/mc-boot/GTimeString.cc
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GTimeString.h b/gcc/m2/mc-boot/GTimeString.h
index a5b2618bf55..061e111d4ff 100644
--- a/gcc/m2/mc-boot/GTimeString.h
+++ b/gcc/m2/mc-boot/GTimeString.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/GUnixArgs.h b/gcc/m2/mc-boot/GUnixArgs.h
index 9a1283480d9..8c56ead1510 100644
--- a/gcc/m2/mc-boot/GUnixArgs.h
+++ b/gcc/m2/mc-boot/GUnixArgs.h
@@ -34,6 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
diff --git a/gcc/m2/mc-boot/Galists.cc b/gcc/m2/mc-boot/Galists.cc
index 3e84a500337..d3e576d1be0 100644
--- a/gcc/m2/mc-boot/Galists.cc
+++ b/gcc/m2/mc-boot/Galists.cc
@@ -22,6 +22,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -122,7 +123,7 @@ extern "C" void alists_removeItemFromList (alists_alist l, void * c);
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.
@@ -330,11 +331,11 @@ extern "C" void alists_removeItemFromList (alists_alist l, void * c)
{
alists_alist p;
unsigned int i;
- unsigned int found;
+ bool found;
if (l != NULL)
{
- found = FALSE;
+ found = false;
p = NULL;
do {
i = 1;
@@ -344,7 +345,7 @@ extern "C" void alists_removeItemFromList (alists_alist l, void * c)
}
if ((i <= l->noOfelements) && (l->elements.array[i-1] == c))
{
- found = TRUE;
+ found = true;
}
else
{
@@ -364,7 +365,7 @@ extern "C" void alists_removeItemFromList (alists_alist l, void * c)
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;
@@ -374,7 +375,7 @@ extern "C" unsigned int alists_isItemInList (alists_alist l, void * c)
{
if (l->elements.array[i-1] == c)
{
- return TRUE;
+ return true;
}
else
{
@@ -383,7 +384,7 @@ extern "C" unsigned int alists_isItemInList (alists_alist l, void * c)
}
l = l->next;
} while (! (l == NULL));
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
diff --git a/gcc/m2/mc-boot/Galists.h b/gcc/m2/mc-boot/Galists.h
index 02724784813..77601a2d529 100644
--- a/gcc/m2/mc-boot/Galists.h
+++ b/gcc/m2/mc-boot/Galists.h
@@ -29,6 +29,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -110,7 +111,7 @@ EXTERN void alists_removeItemFromList (alists_alist l, void * c);
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.
diff --git a/gcc/m2/mc-boot/Gdecl.cc b/gcc/m2/mc-boot/Gdecl.cc
index 4a851638d39..a9712d3da24 100644
--- a/gcc/m2/mc-boot/Gdecl.cc
+++ b/gcc/m2/mc-boot/Gdecl.cc
@@ -22,6 +22,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
+#include <stdbool.h>
# if !defined (PROC_D)
# define PROC_D
typedef void (*PROC_t) (void);
@@ -143,14 +144,14 @@ typedef struct StdIO_ProcRead_p StdIO_ProcRead;
# 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;
@@ -335,13 +336,13 @@ struct alists__T14_a { void * array[MaxnoOfelements-1+1]; };
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 {
@@ -374,7 +375,7 @@ struct mcError__T11_r {
mcError_error parent;
mcError_error child;
mcError_error next;
- unsigned int fatal;
+ bool fatal;
DynamicStrings_String s;
unsigned int token;
};
@@ -407,7 +408,7 @@ struct decl_setvalueT_r {
struct decl_identlistT_r {
wlists_wlist names;
- unsigned int cnamed;
+ bool cnamed;
};
struct decl_commentT_r {
@@ -432,8 +433,8 @@ struct decl_typeT_r {
nameKey_Name name;
decl_node type;
decl_node scope;
- unsigned int isHidden;
- unsigned int isInternal;
+ bool isHidden;
+ bool isInternal;
};
struct decl_recordT_r {
@@ -474,13 +475,13 @@ struct decl_arrayT_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;
@@ -502,18 +503,18 @@ struct decl_varparamT_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_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 {
@@ -536,7 +537,7 @@ struct decl_varientfieldT_r {
nameKey_Name name;
decl_node parent;
decl_node varient;
- unsigned int simple;
+ bool simple;
Indexing_Index listOfSons;
decl_node scope;
};
@@ -616,8 +617,8 @@ struct decl_scopeT_r {
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;
@@ -645,7 +646,7 @@ struct decl_nodeProcedure_p { decl_nodeProcedure_t proc; };
struct decl_cnameT_r {
nameKey_Name name;
- unsigned int init;
+ bool init;
};
struct Indexing__T5_r {
@@ -654,7 +655,7 @@ struct Indexing__T5_r {
unsigned int Used;
unsigned int Low;
unsigned int High;
- unsigned int Debug;
+ bool Debug;
unsigned int Map;
};
@@ -662,7 +663,7 @@ struct mcComment__T6_r {
mcComment_commentType type;
DynamicStrings_String content;
nameKey_Name procName;
- unsigned int used;
+ bool used;
};
struct wlists__T10_a { unsigned int array[maxNoOfElements-1+1]; };
@@ -678,7 +679,7 @@ struct decl_intrinsicT_r {
unsigned int noArgs;
decl_node type;
decl_commentPair intrinsicComment;
- unsigned int postUnreachable;
+ bool postUnreachable;
};
struct decl_funccallT_r {
@@ -699,17 +700,17 @@ struct decl_varT_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;
@@ -767,13 +768,13 @@ struct decl_procedureT_r {
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;
@@ -792,25 +793,25 @@ struct decl_moduleT_r {
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;
};
@@ -824,9 +825,9 @@ struct decl_impT_r {
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;
};
@@ -845,8 +846,8 @@ struct wlists__T9_r {
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;
@@ -863,10 +864,10 @@ typedef struct DynamicStrings_DebugInfo_r DynamicStrings_DebugInfo;
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;
};
@@ -1017,8 +1018,8 @@ static mcPretty_pretty doP;
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);
@@ -1031,9 +1032,9 @@ extern "C" void M2RTS_ConstructModules (void * applicationmodule, void * libname
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));
@@ -1092,25 +1093,25 @@ extern "C" unsigned int decl_getFirstUsed (decl_node n);
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.
@@ -1134,7 +1135,7 @@ extern "C" void decl_setEnumsComplete (decl_node n);
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
@@ -1153,7 +1154,7 @@ extern "C" decl_node decl_getNextEnum (void);
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
@@ -1161,7 +1162,7 @@ extern "C" unsigned int decl_isModule (decl_node n);
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.
@@ -1209,13 +1210,13 @@ extern "C" decl_node decl_lookupInScope (decl_node scope, nameKey_Name n);
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.
@@ -1247,32 +1248,32 @@ extern "C" void decl_putTypeHidden (decl_node 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
@@ -1291,55 +1292,55 @@ extern "C" decl_node decl_getScope (decl_node n);
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
@@ -1353,79 +1354,79 @@ extern "C" decl_node decl_addOptParameter (decl_node proc, nameKey_Name id, decl
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.
@@ -1589,7 +1590,7 @@ extern "C" decl_node decl_lookupSym (nameKey_Name n);
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.
@@ -1685,13 +1686,13 @@ extern "C" void decl_putOptReturn (decl_node proc);
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.
@@ -1716,21 +1717,21 @@ extern "C" decl_node decl_makeIdentList (void);
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.
@@ -1742,7 +1743,7 @@ extern "C" decl_node decl_makeVarargs (void);
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.
@@ -1782,7 +1783,7 @@ extern "C" decl_node decl_makePointerRef (decl_node ptr, decl_node field);
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.
@@ -1838,7 +1839,7 @@ extern "C" decl_node decl_makeSetValue (void);
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
@@ -1872,7 +1873,7 @@ extern "C" decl_node decl_makeExpList (void);
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.
@@ -1927,7 +1928,7 @@ extern "C" decl_node decl_makeStatementSequence (void);
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.
@@ -1975,7 +1976,7 @@ extern "C" decl_node decl_makeReturn (void);
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.
@@ -2000,7 +2001,7 @@ extern "C" void decl_putWhile (decl_node n, decl_node e, decl_node s);
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.
@@ -2047,7 +2048,7 @@ extern "C" decl_node decl_makeExit (decl_node l, unsigned int n);
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.
@@ -2059,7 +2060,7 @@ extern "C" decl_node decl_makeLoop (void);
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.
@@ -2091,7 +2092,7 @@ extern "C" decl_node decl_makeIf (decl_node e, decl_node 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);
/*
makeElsif - creates and returns an elsif node.
@@ -2105,7 +2106,7 @@ extern "C" decl_node decl_makeElsif (decl_node i, decl_node e, decl_node s);
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,
@@ -2124,7 +2125,7 @@ extern "C" decl_node decl_makeFor (void);
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
@@ -2147,7 +2148,7 @@ extern "C" decl_node decl_makeRepeat (void);
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
@@ -2178,7 +2179,7 @@ extern "C" decl_node decl_makeCase (void);
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.
@@ -2212,7 +2213,7 @@ extern "C" decl_node decl_makeCaseLabelList (decl_node l, decl_node s);
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.
@@ -2224,7 +2225,7 @@ extern "C" decl_node decl_makeCaseList (void);
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.
@@ -2242,13 +2243,13 @@ extern "C" decl_node decl_makeRange (decl_node lo, decl_node hi);
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
@@ -2288,9 +2289,9 @@ extern "C" nameKey_Name nameKey_makeKey (const char *a_, unsigned int _a_high);
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);
@@ -2310,7 +2311,7 @@ extern "C" void symbolKey_delSymKey (symbolKey_symbolTree t, nameKey_Name name);
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
@@ -2320,7 +2321,7 @@ extern "C" unsigned int symbolKey_isEmptyTree (symbolKey_symbolTree t);
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,
@@ -2338,7 +2339,7 @@ extern "C" void symbolKey_foreachNodeDo (symbolKey_symbolTree t, symbolKey_perfo
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.
@@ -2389,51 +2390,51 @@ extern "C" DynamicStrings_String mcComment_getInbodyStatementComment (mcComment_
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);
@@ -2531,21 +2532,21 @@ extern "C" DynamicStrings_String DynamicStrings_Add (DynamicStrings_String a, Dy
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.
@@ -2692,7 +2693,7 @@ extern "C" void DynamicStrings_PushAllocation (void);
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
@@ -2704,19 +2705,19 @@ extern "C" void DynamicStrings_PopAllocation (unsigned int halt);
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);
@@ -2725,29 +2726,30 @@ extern "C" int StringConvert_bstoi (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);
@@ -2973,7 +2975,7 @@ extern "C" void mcError_errorAbort0 (const char *a_, unsigned int _a_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);
@@ -2996,11 +2998,11 @@ extern "C" void mcLexBuf_setFile (void * filename);
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);
/*
@@ -3113,7 +3115,7 @@ extern "C" Indexing_Index Indexing_DebugIndex (Indexing_Index i);
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.
@@ -3143,7 +3145,7 @@ extern "C" void * Indexing_GetIndice (Indexing_Index i, unsigned int n);
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.
@@ -3226,7 +3228,7 @@ extern "C" void alists_removeItemFromList (alists_alist l, void * c);
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.
@@ -3304,7 +3306,7 @@ extern "C" void wlists_replaceItemInList (wlists_wlist l, unsigned int n, unsign
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.
@@ -3354,8 +3356,8 @@ extern "C" void keyc_genDefs (mcPretty_pretty p);
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);
@@ -3389,7 +3391,7 @@ extern "C" void NumberIO_StrToHexInt (const char *a_, unsigned int _a_high, int
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);
@@ -3425,7 +3427,7 @@ static void disposeNode (decl_node *n);
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.
@@ -3437,25 +3439,25 @@ static void importEnumFields (decl_node m, decl_node n);
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.
@@ -3485,7 +3487,7 @@ static decl_node makeModule (nameKey_Name n);
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.
@@ -3535,7 +3537,7 @@ static void setUnary (decl_node u, decl_nodeT k, decl_node a, decl_node t);
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
@@ -3548,13 +3550,13 @@ static decl_node checkPtr (decl_node n);
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
@@ -3585,19 +3587,19 @@ static decl_node makeOptParameter (decl_node l, decl_node type, decl_node init);
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.
@@ -3609,7 +3611,7 @@ static unsigned int identListLen (decl_node n);
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
@@ -3617,7 +3619,7 @@ static void checkParameters (decl_node p, decl_node i, decl_node type, unsigned
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,
@@ -3672,7 +3674,7 @@ static decl_node getRecord (decl_node n);
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
@@ -3716,7 +3718,7 @@ static unsigned int expListLen (decl_node p);
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
@@ -3735,7 +3737,7 @@ static decl_node doMakeConstExp (void);
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.
@@ -3782,7 +3784,7 @@ static void checkCHeaders (decl_node c);
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.
@@ -3794,7 +3796,7 @@ static void putTypeInternal (decl_node des);
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.
@@ -3836,13 +3838,13 @@ static void out3 (const char *a_, unsigned int _a_high, unsigned int l, nameKey_
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
@@ -3855,7 +3857,7 @@ static decl_node makeUnary (decl_nodeT k, decl_node e, decl_node res);
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.
@@ -3911,19 +3913,19 @@ static decl_node doMakeComponentRef (decl_node rec, decl_node field);
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.
@@ -3937,7 +3939,7 @@ static decl_node makeBase (decl_nodeT k);
isOrdinal - returns TRUE if, n, is an ordinal type.
*/
-static unsigned int isOrdinal (decl_node n);
+static bool isOrdinal (decl_node n);
/*
mixTypes -
@@ -4015,7 +4017,7 @@ static decl_node getSymScope (decl_node n);
isQualifiedForced - should the node be written with a module prefix?
*/
-static unsigned int isQualifiedForced (decl_node n);
+static bool isQualifiedForced (decl_node n);
/*
getFQstring -
@@ -4027,7 +4029,7 @@ static DynamicStrings_String getFQstring (decl_node n);
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.
@@ -4057,13 +4059,13 @@ static void doConstC (decl_node n);
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)
@@ -4075,13 +4077,13 @@ static void doSetSub (mcPretty_pretty p, decl_node left, decl_node right);
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 -
@@ -4117,7 +4119,7 @@ static void doPointerRefC (mcPretty_pretty p, decl_node l, decl_node r);
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 -
@@ -4135,7 +4137,7 @@ static void doEnumerationField (mcPretty_pretty p, decl_node n);
isZero - returns TRUE if node, n, is zero.
*/
-static unsigned int isZero (decl_node n);
+static bool isZero (decl_node n);
/*
doArrayRef -
@@ -4220,7 +4222,7 @@ static void doExprC (mcPretty_pretty p, decl_node n);
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 -
@@ -4250,7 +4252,7 @@ static void doLiteral (mcPretty_pretty p, decl_node n);
isString - returns TRUE if node, n, is a string.
*/
-static unsigned int isString (decl_node n);
+static bool isString (decl_node n);
/*
doString -
@@ -4293,7 +4295,7 @@ static unsigned int lenCstring (DynamicStrings_String s);
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 -
@@ -4305,13 +4307,13 @@ static void doStringC (mcPretty_pretty p, decl_node n);
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 -
@@ -4389,25 +4391,25 @@ static void initCname (decl_cnameT *c);
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 -
@@ -4425,13 +4427,13 @@ static void doNameM2 (mcPretty_pretty p, decl_node n);
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 -
@@ -4562,7 +4564,13 @@ static void doCompletePartialProcType (mcPretty_pretty p, decl_node t, decl_node
isBase -
*/
-static unsigned int isBase (decl_node n);
+static bool isBase (decl_node n);
+
+/*
+ doBoolC -
+*/
+
+static void doBoolC (mcPretty_pretty p);
/*
doBaseC -
@@ -4574,7 +4582,7 @@ static void doBaseC (mcPretty_pretty p, decl_node n);
isSystem -
*/
-static unsigned int isSystem (decl_node n);
+static bool isSystem (decl_node n);
/*
doSystemC -
@@ -4622,13 +4630,13 @@ static void doRecordC (mcPretty_pretty p, decl_node n, decl_node *m);
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 -
@@ -4677,7 +4685,7 @@ static void doTypeNameC (mcPretty_pretty p, decl_node n);
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 -
@@ -4707,13 +4715,13 @@ static void doProcedureComment (mcPretty_pretty p, DynamicStrings_String s);
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 -
@@ -4913,14 +4921,14 @@ static void doStatementSequenceC (mcPretty_pretty p, decl_node s);
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 -
@@ -4944,13 +4952,13 @@ static void doReturnC (mcPretty_pretty p, decl_node s);
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.
@@ -4962,7 +4970,7 @@ static void doExprCastC (mcPretty_pretty p, decl_node e, decl_node type);
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 -
@@ -4974,7 +4982,7 @@ static void doAssignmentC (mcPretty_pretty p, decl_node s);
containsStatement -
*/
-static unsigned int containsStatement (decl_node s);
+static bool containsStatement (decl_node s);
/*
doCompoundStmt -
@@ -4992,7 +5000,7 @@ static void doElsifC (mcPretty_pretty p, decl_node s);
noIfElse -
*/
-static unsigned int noIfElse (decl_node n);
+static bool noIfElse (decl_node n);
/*
noIfElseChained - returns TRUE if, n, is an IF statement which
@@ -5001,26 +5009,26 @@ static unsigned int noIfElse (decl_node n);
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.
@@ -5105,14 +5113,14 @@ static void doAdrExprC (mcPretty_pretty p, decl_node n);
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
@@ -5134,13 +5142,13 @@ static void emitN (mcPretty_pretty p, const char *a_, unsigned int _a_high, unsi
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 -
@@ -5166,13 +5174,13 @@ static decl_node getNthParam (Indexing_Index l, unsigned int i);
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 -
@@ -5275,7 +5283,7 @@ static void doMaxC (mcPretty_pretty p, decl_node n);
The intrinsic functions are represented as unary and binary nodes.
*/
-static unsigned int isIntrinsic (decl_node n);
+static bool isIntrinsic (decl_node n);
/*
doHalt -
@@ -5323,7 +5331,7 @@ static void doIntrinsicC (mcPretty_pretty p, decl_node n);
isIntrinsicFunction - returns true if, n, is an instrinsic function.
*/
-static unsigned int isIntrinsicFunction (decl_node n);
+static bool isIntrinsicFunction (decl_node n);
/*
doSizeC -
@@ -5359,7 +5367,7 @@ static void doFuncCallC (mcPretty_pretty p, decl_node n);
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 -
@@ -5395,13 +5403,13 @@ static void doRangeIfListC (mcPretty_pretty p, decl_node e, decl_node c);
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 -
@@ -5432,7 +5440,7 @@ static void doCaseIfElseC (mcPretty_pretty p, decl_node n);
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
@@ -5440,7 +5448,7 @@ static unsigned int canUseSwitchCaseLabels (decl_node n);
selectors are single values rather than ranges.
*/
-static unsigned int canUseSwitch (decl_node n);
+static bool canUseSwitch (decl_node n);
/*
doCaseC -
@@ -5495,49 +5503,49 @@ static void includeParameters (decl_node n);
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 -
@@ -5766,13 +5774,13 @@ static decl_dependentState doDependants (alists_alist l, decl_node n);
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 -
@@ -6141,7 +6149,7 @@ static void outputHiddenComplete (decl_node n);
tryPartial -
*/
-static unsigned int tryPartial (decl_node n, decl_nodeProcedure pt);
+static bool tryPartial (decl_node n, decl_nodeProcedure pt);
/*
outputPartialRecordArrayProcType -
@@ -6551,13 +6559,13 @@ static void addGenericAfter (decl_node n, decl_node c);
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.
@@ -6702,7 +6710,7 @@ static void disposeNode (decl_node *n)
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;
@@ -6711,7 +6719,7 @@ static unsigned int isLocal (decl_node n)
{
return decl_isProcedure (s);
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -6752,7 +6760,7 @@ static void importEnumFields (decl_node m, decl_node n)
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. */
@@ -6764,7 +6772,7 @@ static unsigned int 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)
{
return n == longcomplexN;
/* static analysis guarentees a RETURN statement will be used before here. */
@@ -6776,7 +6784,7 @@ static unsigned int 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)
{
return n == shortcomplexN;
/* static analysis guarentees a RETURN statement will be used before here. */
@@ -6788,7 +6796,7 @@ static unsigned int 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)
{
mcDebug_assert (n != NULL);
return (decl_isProcType (n)) || (n == procN);
@@ -6824,16 +6832,16 @@ static decl_node makeDef (nameKey_Name n)
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. */
@@ -6859,9 +6867,9 @@ static decl_node makeImp (nameKey_Name n)
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. */
@@ -6886,9 +6894,9 @@ static decl_node makeModule (nameKey_Name n)
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. */
@@ -6900,7 +6908,7 @@ static decl_node makeModule (nameKey_Name n)
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. */
@@ -7071,17 +7079,17 @@ static void completedEnum (decl_node n)
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;
}
}
@@ -7130,7 +7138,7 @@ static void setUnary (decl_node u, decl_nodeT k, decl_node a, decl_node t)
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;
@@ -7171,7 +7179,7 @@ static decl_node checkPtr (decl_node n)
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. */
@@ -7183,7 +7191,7 @@ static unsigned int 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)
{
decl_node v;
unsigned int i;
@@ -7200,7 +7208,7 @@ static void makeVariablesFromParameters (decl_node proc, decl_node id, decl_node
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);
@@ -7257,7 +7265,7 @@ static void putProcTypeReturn (decl_node proc, decl_node type)
static void putProcTypeOptReturn (decl_node proc)
{
mcDebug_assert (decl_isProcType (proc));
- proc->proctypeF.returnopt = TRUE;
+ proc->proctypeF.returnopt = true;
}
@@ -7284,10 +7292,10 @@ static decl_node makeOptParameter (decl_node l, decl_node type, decl_node init)
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 ();
}
@@ -7297,7 +7305,7 @@ static unsigned int setwatch (decl_node n)
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. */
@@ -7309,7 +7317,7 @@ static unsigned int runwatch (void)
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. */
@@ -7341,7 +7349,7 @@ static unsigned int identListLen (decl_node n)
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);
@@ -7354,7 +7362,7 @@ static void checkParameters (decl_node p, decl_node i, decl_node type, unsigned
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)
{
@@ -7376,7 +7384,7 @@ static decl_node makeVarientField (decl_node v, decl_node p)
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;
@@ -7473,7 +7481,7 @@ static decl_node putFieldRecord (decl_node r, nameKey_Name tag, decl_node type,
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);
/*
@@ -7587,7 +7595,7 @@ static decl_node getRecord (decl_node n)
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;
@@ -7737,7 +7745,7 @@ static unsigned int expListLen (decl_node p)
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)
{
@@ -7808,7 +7816,7 @@ static decl_node doMakeConstExp (void)
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)
@@ -7831,12 +7839,12 @@ static unsigned int isAnyType (decl_node n)
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. */
@@ -8102,7 +8110,7 @@ static void checkCHeaders (decl_node c)
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;
@@ -8119,7 +8127,7 @@ static void putTypeInternal (decl_node des)
{
mcDebug_assert (des != NULL);
mcDebug_assert (decl_isType (des));
- des->typeF.isInternal = TRUE;
+ des->typeF.isInternal = true;
}
@@ -8127,7 +8135,7 @@ static void putTypeInternal (decl_node des)
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));
@@ -8270,7 +8278,7 @@ static void out3 (const char *a_, unsigned int _a_high, unsigned int l, nameKey_
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)
@@ -8294,12 +8302,12 @@ static unsigned int isUnary (decl_node n)
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. */
@@ -8311,7 +8319,7 @@ static unsigned int 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)
{
mcDebug_assert (n != NULL);
switch (n->kind)
@@ -8334,12 +8342,12 @@ static unsigned int isBinary (decl_node n)
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. */
@@ -8405,7 +8413,7 @@ static decl_node makeUnary (decl_nodeT k, decl_node e, decl_node res)
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. */
@@ -8652,7 +8660,7 @@ static decl_node doMakeComponentRef (decl_node rec, decl_node field)
isComponentRef -
*/
-static unsigned int isComponentRef (decl_node n)
+static bool isComponentRef (decl_node n)
{
mcDebug_assert (n != NULL);
return n->kind == decl_componentref;
@@ -8665,7 +8673,7 @@ static unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_arrayref;
@@ -8678,7 +8686,7 @@ static unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_deref;
@@ -8769,7 +8777,7 @@ static decl_node makeBase (decl_nodeT k)
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)
{
@@ -8787,12 +8795,12 @@ static unsigned int isOrdinal (decl_node n)
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. */
@@ -9379,7 +9387,7 @@ static decl_node getSymScope (decl_node n)
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. */
@@ -9428,7 +9436,7 @@ static DynamicStrings_String getFQstring (decl_node n)
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;
@@ -9524,7 +9532,7 @@ static void doConstC (decl_node n)
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)
@@ -9532,7 +9540,7 @@ static unsigned int needsParen (decl_node n)
case decl_nil:
case decl_true:
case decl_false:
- return FALSE;
+ return false;
break;
case decl_constexp:
@@ -9556,11 +9564,11 @@ static unsigned int needsParen (decl_node n)
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:
@@ -9569,27 +9577,27 @@ static unsigned int needsParen (decl_node n)
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:
@@ -9599,43 +9607,43 @@ static unsigned int needsParen (decl_node n)
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:
@@ -9658,26 +9666,26 @@ static unsigned int needsParen (decl_node n)
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;
@@ -9685,7 +9693,7 @@ static unsigned int needsParen (decl_node n)
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 ();
}
@@ -9695,7 +9703,7 @@ static unsigned int 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)
{
char op[_op_high+1];
@@ -9762,7 +9770,7 @@ static void doSetSub (mcPretty_pretty p, decl_node left, decl_node right)
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;
@@ -9774,7 +9782,7 @@ static void doPolyBinary (mcPretty_pretty p, decl_nodeT op, decl_node left, decl
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:
@@ -9782,11 +9790,11 @@ static void doPolyBinary (mcPretty_pretty p, decl_nodeT op, decl_node left, decl
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;
@@ -9800,19 +9808,19 @@ static void doPolyBinary (mcPretty_pretty p, decl_nodeT op, decl_node left, decl
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;
@@ -9828,7 +9836,7 @@ static void doPolyBinary (mcPretty_pretty p, decl_nodeT op, decl_node left, decl
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];
@@ -10131,7 +10139,7 @@ static void doPointerRefC (mcPretty_pretty p, decl_node l, decl_node r)
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];
@@ -10172,7 +10180,7 @@ static void doConstExpr (mcPretty_pretty p, decl_node n)
static void doEnumerationField (mcPretty_pretty p, decl_node n)
{
- doFQDNameC (p, n, FALSE);
+ doFQDNameC (p, n, false);
}
@@ -10180,7 +10188,7 @@ static void doEnumerationField (mcPretty_pretty p, decl_node n)
isZero - returns TRUE if node, n, is zero.
*/
-static unsigned int isZero (decl_node n)
+static bool isZero (decl_node n)
{
if (isConstExp (n))
{
@@ -10248,7 +10256,7 @@ static void doArrayRef (mcPretty_pretty p, decl_node n)
static void doProcedure (mcPretty_pretty p, decl_node n)
{
mcDebug_assert (decl_isProcedure (n));
- doFQDNameC (p, n, TRUE);
+ doFQDNameC (p, n, true);
}
@@ -10258,7 +10266,7 @@ static void doProcedure (mcPretty_pretty p, decl_node n)
static void doRecordfield (mcPretty_pretty p, decl_node n)
{
- doDNameC (p, n, FALSE);
+ doDNameC (p, n, false);
}
@@ -10457,7 +10465,14 @@ static void outNull (mcPretty_pretty p)
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);
+ }
}
@@ -10468,7 +10483,14 @@ static void outTrue (mcPretty_pretty p)
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);
+ }
}
@@ -10497,15 +10519,15 @@ static void doExprC (mcPretty_pretty p, decl_node n)
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:
@@ -10586,27 +10608,27 @@ static void doExprC (mcPretty_pretty p, decl_node n)
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:
@@ -10622,27 +10644,27 @@ static void doExprC (mcPretty_pretty p, decl_node n)
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:
@@ -10650,11 +10672,11 @@ static void doExprC (mcPretty_pretty p, decl_node n)
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:
@@ -10745,7 +10767,7 @@ static void doExprC (mcPretty_pretty p, decl_node n)
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;
@@ -10783,59 +10805,59 @@ static void doExprM2 (mcPretty_pretty p, decl_node n)
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:
@@ -10843,71 +10865,71 @@ static void doExprM2 (mcPretty_pretty p, decl_node n)
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:
@@ -10927,11 +10949,11 @@ static void doExprM2 (mcPretty_pretty p, decl_node n)
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:
@@ -10956,12 +10978,12 @@ static void doVar (mcPretty_pretty p, decl_node n)
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);
}
}
@@ -11038,7 +11060,7 @@ static void doLiteral (mcPretty_pretty p, decl_node n)
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;
@@ -11193,7 +11215,7 @@ static unsigned int lenCstring (DynamicStrings_String s)
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)
{
@@ -11265,7 +11287,7 @@ static void doStringC (mcPretty_pretty p, decl_node n)
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. */
@@ -11277,7 +11299,7 @@ static unsigned int isPunct (char ch)
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. */
@@ -11420,7 +11442,7 @@ static void outCard (mcPretty_pretty p, unsigned int c)
{
DynamicStrings_String s;
- s = StringConvert_CardinalToString (c, 0, ' ', 10, FALSE);
+ s = StringConvert_CardinalToString (c, 0, ' ', 10, false);
outTextS (p, s);
s = DynamicStrings_KillString (s);
}
@@ -11481,7 +11503,7 @@ static void doEnumerationC (mcPretty_pretty p, decl_node n)
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);
@@ -11526,7 +11548,7 @@ static void doNameC (mcPretty_pretty p, decl_node n)
static void initCname (decl_cnameT *c)
{
- (*c).init = FALSE;
+ (*c).init = false;
}
@@ -11534,7 +11556,7 @@ static void initCname (decl_cnameT *c)
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;
@@ -11544,7 +11566,7 @@ static nameKey_Name doCname (nameKey_Name n, decl_cnameT *c, unsigned int scopes
}
else
{
- (*c).init = TRUE;
+ (*c).init = true;
s = keyc_cname (n, scopes);
if (s == NULL)
{
@@ -11566,7 +11588,7 @@ static nameKey_Name doCname (nameKey_Name n, decl_cnameT *c, unsigned int scopes
getDName -
*/
-static nameKey_Name getDName (decl_node n, unsigned int scopes)
+static nameKey_Name getDName (decl_node n, bool scopes)
{
nameKey_Name m;
@@ -11603,7 +11625,7 @@ static nameKey_Name getDName (decl_node n, unsigned int 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)
{
if ((n != NULL) && ((decl_getSymName (n)) != nameKey_NulName))
{
@@ -11616,7 +11638,7 @@ static void doDNameC (mcPretty_pretty p, decl_node n, unsigned int 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)
{
DynamicStrings_String s;
@@ -11654,7 +11676,7 @@ static void doNameM2 (mcPretty_pretty p, decl_node n)
doUsed -
*/
-static void doUsed (mcPretty_pretty p, unsigned int used)
+static void doUsed (mcPretty_pretty p, bool used)
{
if (! used)
{
@@ -11668,7 +11690,7 @@ static void doUsed (mcPretty_pretty p, unsigned int 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)))
{
@@ -11815,11 +11837,11 @@ static void doParamC (mcPretty_pretty p, decl_node n)
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)))
{
@@ -11897,11 +11919,11 @@ static void doVarParamC (mcPretty_pretty p, decl_node n)
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);
@@ -12494,7 +12516,7 @@ static void doCompletePartialProcType (mcPretty_pretty p, decl_node t, decl_node
isBase -
*/
-static unsigned int isBase (decl_node n)
+static bool isBase (decl_node n)
{
switch (n->kind)
{
@@ -12514,12 +12536,12 @@ static unsigned int isBase (decl_node n)
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. */
@@ -12527,6 +12549,23 @@ static unsigned int isBase (decl_node n)
}
+/*
+ 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 -
*/
@@ -12592,7 +12631,7 @@ static void doBaseC (mcPretty_pretty p, decl_node n)
break;
case decl_boolean:
- outText (p, (const char *) "unsigned int", 12);
+ doBoolC (p);
break;
case decl_proc:
@@ -12612,37 +12651,37 @@ static void doBaseC (mcPretty_pretty p, decl_node n)
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. */
@@ -12771,7 +12810,7 @@ static void doRecordFieldC (mcPretty_pretty p, decl_node f)
m = NULL;
mcPretty_setNeedSpace (p);
doTypeC (p, f->recordfieldF.type, &m);
- doDNameC (p, f, FALSE);
+ doDNameC (p, f, false);
}
@@ -12946,7 +12985,7 @@ static void doRecordC (mcPretty_pretty p, decl_node n, decl_node *m)
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. */
@@ -12958,10 +12997,10 @@ static unsigned int 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)
{
/* --fixme-- needs to be completed. */
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -13190,7 +13229,7 @@ static void doTypeNameC (mcPretty_pretty p, decl_node n)
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;
@@ -13233,7 +13272,7 @@ static void doVarC (decl_node n)
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);
}
@@ -13287,7 +13326,7 @@ static void doProcedureComment (mcPretty_pretty p, DynamicStrings_String s)
doProcedureHeadingC -
*/
-static void doProcedureHeadingC (decl_node n, unsigned int prototype)
+static void doProcedureHeadingC (decl_node n, bool prototype)
{
unsigned int i;
unsigned int h;
@@ -13318,7 +13357,7 @@ static void doProcedureHeadingC (decl_node n, unsigned int prototype)
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);
@@ -13352,15 +13391,15 @@ static void doProcedureHeadingC (decl_node n, unsigned int prototype)
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))
@@ -13376,7 +13415,7 @@ static unsigned int checkDeclareUnboundedParamCopyC (mcPretty_pretty p, decl_nod
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;
}
}
@@ -13445,12 +13484,12 @@ static void doUnboundedParamCopyC (mcPretty_pretty p, decl_node n)
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));
@@ -13487,7 +13526,7 @@ static void doPrototypeC (decl_node n)
if (! (decl_isExported (n)))
{
keyc_enterScope (n);
- doProcedureHeadingC (n, TRUE);
+ doProcedureHeadingC (n, true);
mcPretty_print (doP, (const char *) ";\\n", 3);
keyc_leaveScope (n);
}
@@ -13597,7 +13636,7 @@ static void simplifyType (alists_alist l, decl_node *p)
s = tempName ();
(*p) = makeIntermediateType (s, (*p));
s = DynamicStrings_KillString (s);
- simplified = FALSE;
+ simplified = false;
}
simplifyNode (l, (*p));
}
@@ -13788,7 +13827,7 @@ static void doSimplify (decl_node n)
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));
@@ -14048,7 +14087,7 @@ static void doStatementSequenceC (mcPretty_pretty p, decl_node s)
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;
@@ -14062,7 +14101,7 @@ static unsigned int isStatementSequenceEmpty (decl_node s)
only one statement.
*/
-static unsigned int isSingleStatement (decl_node s)
+static bool isSingleStatement (decl_node s)
{
unsigned int h;
@@ -14070,7 +14109,7 @@ static unsigned int isSingleStatement (decl_node s)
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));
@@ -14157,7 +14196,7 @@ static void doReturnC (mcPretty_pretty p, decl_node s)
isZtypeEquivalent -
*/
-static unsigned int isZtypeEquivalent (decl_node type)
+static bool isZtypeEquivalent (decl_node type)
{
switch (type->kind)
{
@@ -14168,12 +14207,12 @@ static unsigned int isZtypeEquivalent (decl_node type)
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. */
@@ -14185,7 +14224,7 @@ static unsigned int 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)
{
type1 = decl_skipType (type1);
type2 = decl_skipType (type2);
@@ -14248,7 +14287,7 @@ static void doExprCastC (mcPretty_pretty p, decl_node e, decl_node type)
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))));
@@ -14279,7 +14318,7 @@ static void doAssignmentC (mcPretty_pretty p, decl_node s)
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. */
@@ -14389,7 +14428,7 @@ static void doElsifC (mcPretty_pretty p, decl_node s)
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. */
@@ -14404,7 +14443,7 @@ static unsigned int noIfElse (decl_node n)
in a return value of TRUE.
*/
-static unsigned int noIfElseChained (decl_node n)
+static bool noIfElseChained (decl_node n)
{
decl_node e;
@@ -14422,7 +14461,7 @@ static unsigned int noIfElseChained (decl_node n)
{
/* avoid dangling else. */
/* neither else or elsif. */
- return TRUE;
+ return true;
}
else
{
@@ -14445,7 +14484,7 @@ static unsigned int noIfElseChained (decl_node n)
{
/* avoid dangling else. */
/* neither else or elsif. */
- return TRUE;
+ return true;
}
else
{
@@ -14457,7 +14496,7 @@ static unsigned int noIfElseChained (decl_node n)
}
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -14467,7 +14506,7 @@ static unsigned int noIfElseChained (decl_node n)
hasIfElse -
*/
-static unsigned int hasIfElse (decl_node n)
+static bool hasIfElse (decl_node n)
{
if (n != NULL)
{
@@ -14476,7 +14515,7 @@ static unsigned int hasIfElse (decl_node n)
/* avoid gcc warning by using compound statement even if not strictly necessary. */
if (isStatementSequenceEmpty (n))
{
- return FALSE;
+ return false;
}
else if (isSingleStatement (n))
{
@@ -14486,7 +14525,7 @@ static unsigned int hasIfElse (decl_node n)
}
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -14496,7 +14535,7 @@ static unsigned int hasIfElse (decl_node n)
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. */
@@ -14509,7 +14548,7 @@ static unsigned int isIfElse (decl_node n)
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)
{
@@ -14518,7 +14557,7 @@ static unsigned int hasIfAndNoElse (decl_node n)
{
if (isStatementSequenceEmpty (n))
{
- return FALSE;
+ return false;
}
else if (isSingleStatement (n))
{
@@ -14539,7 +14578,7 @@ static unsigned int hasIfAndNoElse (decl_node n)
return noIfElseChained (n);
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -14902,14 +14941,14 @@ static void doFuncUnbounded (mcPretty_pretty p, decl_node actual, decl_node form
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))
{
@@ -15012,7 +15051,7 @@ static void doAdrExprC (mcPretty_pretty p, decl_node n)
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. */
@@ -15025,17 +15064,17 @@ static unsigned int typePair (decl_node a, decl_node b, decl_node x, decl_node y
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 ();
@@ -15147,7 +15186,7 @@ static void emitN (mcPretty_pretty p, const char *a_, unsigned int _a_high, unsi
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))
{
@@ -15163,7 +15202,7 @@ static unsigned int isForC (decl_node 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 ();
}
@@ -15173,7 +15212,7 @@ static unsigned int 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)
{
nameKey_Name name;
@@ -15350,7 +15389,7 @@ static decl_node getNthParam (Indexing_Index l, unsigned int i)
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;
@@ -15390,7 +15429,7 @@ static void doFuncArgsC (mcPretty_pretty p, decl_node s, Indexing_Index l, unsig
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;
@@ -15969,7 +16008,7 @@ static void doMaxC (mcPretty_pretty p, decl_node n)
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)
{
@@ -15982,12 +16021,12 @@ static unsigned int isIntrinsic (decl_node n)
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. */
@@ -16219,7 +16258,7 @@ static void doIntrinsicC (mcPretty_pretty p, decl_node n)
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)
{
@@ -16240,12 +16279,12 @@ static unsigned int isIntrinsicFunction (decl_node n)
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. */
@@ -16316,9 +16355,9 @@ static void doFuncExprC (mcPretty_pretty p, decl_node n)
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
{
@@ -16330,12 +16369,12 @@ static void doFuncExprC (mcPretty_pretty p, decl_node n)
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);
}
}
}
@@ -16358,7 +16397,7 @@ static void doFuncCallC (mcPretty_pretty p, decl_node n)
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);
@@ -16540,7 +16579,7 @@ static void doRangeIfListC (mcPretty_pretty p, decl_node e, decl_node c)
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);
@@ -16559,7 +16598,7 @@ static void doCaseLabels (mcPretty_pretty p, decl_node n, unsigned int 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)
{
unsigned int i;
unsigned int h;
@@ -16651,7 +16690,7 @@ static void doCaseElseC (mcPretty_pretty p, decl_node n)
else
{
outText (p, (const char *) "\\ndefault:\\n", 12);
- doCaseStatementC (p, n->caseF.else_, TRUE);
+ doCaseStatementC (p, n->caseF.else_, true);
}
}
@@ -16666,7 +16705,7 @@ static void doCaseIfElseC (mcPretty_pretty p, decl_node n)
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);
@@ -16681,7 +16720,7 @@ static void doCaseIfElseC (mcPretty_pretty p, decl_node n)
{
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);
}
}
@@ -16692,7 +16731,7 @@ static void doCaseIfElseC (mcPretty_pretty p, decl_node n)
single values and not ranges.
*/
-static unsigned int canUseSwitchCaseLabels (decl_node n)
+static bool canUseSwitchCaseLabels (decl_node n)
{
unsigned int i;
unsigned int h;
@@ -16708,11 +16747,11 @@ static unsigned int canUseSwitchCaseLabels (decl_node n)
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 ();
}
@@ -16724,7 +16763,7 @@ static unsigned int canUseSwitchCaseLabels (decl_node n)
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;
@@ -16738,11 +16777,11 @@ static unsigned int canUseSwitch (decl_node n)
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 ();
}
@@ -16957,7 +16996,7 @@ static void includeParameters (decl_node n)
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. */
@@ -16969,7 +17008,7 @@ static unsigned int isHalt (decl_node n)
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. */
@@ -16981,7 +17020,7 @@ static unsigned int isReturnOrHalt (decl_node n)
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. */
@@ -16993,7 +17032,7 @@ static unsigned int isLastStatementReturn (decl_node n)
isLastStatementSequence -
*/
-static unsigned int isLastStatementSequence (decl_node n, decl_isNodeF q)
+static bool isLastStatementSequence (decl_node n, decl_isNodeF q)
{
unsigned int h;
@@ -17003,7 +17042,7 @@ static unsigned int isLastStatementSequence (decl_node n, decl_isNodeF q)
{
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 ();
}
@@ -17013,12 +17052,12 @@ static unsigned int 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)
{
- 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);
@@ -17041,12 +17080,12 @@ static unsigned int 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)
{
- 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);
@@ -17069,14 +17108,14 @@ static unsigned int 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)
{
- 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);
@@ -17101,13 +17140,13 @@ static unsigned int 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)
{
- unsigned int ret;
+ bool ret;
if (n == NULL)
{
- return FALSE;
+ return false;
}
else if (decl_isStatementSequence (n))
{
@@ -17138,9 +17177,9 @@ static unsigned int isLastStatement (decl_node n, decl_isNodeF q)
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 ();
}
@@ -17157,7 +17196,7 @@ static void doProcedureC (decl_node n)
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);
@@ -18274,28 +18313,28 @@ static decl_dependentState doDependants (alists_alist l, decl_node n)
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 ();
}
@@ -18305,21 +18344,21 @@ static unsigned int tryComplete (decl_node n, decl_nodeProcedure c, decl_nodePro
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 ();
}
@@ -19839,7 +19878,7 @@ static void outputHiddenComplete (decl_node n)
tryPartial -
*/
-static unsigned int tryPartial (decl_node n, decl_nodeProcedure pt)
+static bool tryPartial (decl_node n, decl_nodeProcedure pt)
{
decl_node q;
@@ -19857,18 +19896,18 @@ static unsigned int tryPartial (decl_node n, decl_nodeProcedure pt)
{
(*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 ();
}
@@ -20368,7 +20407,7 @@ static void runPrototypeExported (decl_node n)
if (decl_isExported (n))
{
keyc_enterScope (n);
- doProcedureHeadingC (n, TRUE);
+ doProcedureHeadingC (n, true);
mcPretty_print (doP, (const char *) ";\\n", 3);
keyc_leaveScope (n);
}
@@ -21787,7 +21826,7 @@ static void addGenericAfter (decl_node n, decl_node c)
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. */
@@ -21799,7 +21838,7 @@ static unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_comment;
@@ -22355,7 +22394,7 @@ static void init (void)
makeM2rts ();
outputState = decl_punct;
tempCount = 0;
- mustVisitScope = FALSE;
+ mustVisitScope = false;
}
@@ -22402,7 +22441,7 @@ extern "C" unsigned int decl_getFirstUsed (decl_node n)
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;
@@ -22415,7 +22454,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_imp;
@@ -22428,7 +22467,7 @@ extern "C" unsigned int 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)
{
return (decl_isImp (n)) || (decl_isModule (n));
/* static analysis guarentees a RETURN statement will be used before here. */
@@ -22440,7 +22479,7 @@ extern "C" unsigned int 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)
{
switch (n->kind)
{
@@ -22475,15 +22514,15 @@ extern "C" void decl_unsetVisited (decl_node n)
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;
@@ -22503,15 +22542,15 @@ extern "C" void decl_setVisited (decl_node n)
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;
@@ -22531,15 +22570,15 @@ extern "C" void decl_setEnumsComplete (decl_node n)
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;
@@ -22554,7 +22593,7 @@ extern "C" void decl_setEnumsComplete (decl_node n)
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)
{
@@ -22641,7 +22680,7 @@ extern "C" decl_node decl_getNextEnum (void)
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;
@@ -22656,7 +22695,7 @@ extern "C" unsigned int decl_isModule (decl_node n)
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;
@@ -22759,7 +22798,7 @@ extern "C" decl_node decl_lookupModule (nameKey_Name n)
extern "C" void decl_putDefForC (decl_node n)
{
mcDebug_assert (decl_isDef (n));
- n->defF.forC = TRUE;
+ n->defF.forC = true;
}
@@ -22805,7 +22844,7 @@ extern "C" decl_node decl_lookupInScope (decl_node scope, nameKey_Name n)
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;
@@ -22818,7 +22857,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_type;
@@ -23210,10 +23249,10 @@ extern "C" void decl_putTypeHidden (decl_node des)
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;
}
@@ -23221,7 +23260,7 @@ extern "C" void decl_putTypeHidden (decl_node 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)
{
mcDebug_assert (n != NULL);
mcDebug_assert (decl_isType (n));
@@ -23235,7 +23274,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (decl_isDef (n));
return n->defF.hasHidden;
@@ -23248,7 +23287,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_var;
@@ -23261,9 +23300,9 @@ extern "C" unsigned int 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)
{
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -23274,7 +23313,7 @@ extern "C" unsigned int decl_isTemporary (decl_node n)
the definition module.
*/
-extern "C" unsigned int decl_isExported (decl_node n)
+extern "C" bool decl_isExported (decl_node n)
{
decl_node s;
@@ -23289,11 +23328,11 @@ extern "C" unsigned int decl_isExported (decl_node n)
default:
- return FALSE;
+ return false;
break;
}
}
- return FALSE;
+ return false;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -23579,7 +23618,7 @@ extern "C" decl_node decl_getScope (decl_node n)
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;
@@ -23592,14 +23631,14 @@ extern "C" unsigned int 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)
{
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 ();
}
@@ -23609,7 +23648,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_enumerationfield;
@@ -23622,7 +23661,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_enumeration;
@@ -23635,7 +23674,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return (n->kind == decl_array) && n->arrayF.isUnbounded;
@@ -23648,7 +23687,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return (n->kind == decl_param) || (n->kind == decl_varparam);
@@ -23661,7 +23700,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_varparam;
@@ -23674,7 +23713,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_param;
@@ -23687,7 +23726,7 @@ extern "C" unsigned int 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)
{
return decl_isParam (n);
/* static analysis guarentees a RETURN statement will be used before here. */
@@ -23709,7 +23748,7 @@ extern "C" decl_node decl_addOptParameter (decl_node proc, nameKey_Name id, decl
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);
@@ -23725,7 +23764,7 @@ extern "C" decl_node decl_addOptParameter (decl_node proc, nameKey_Name id, decl
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. */
@@ -23737,7 +23776,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_record;
@@ -23750,7 +23789,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_recordfield;
@@ -23763,7 +23802,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_varientfield;
@@ -23776,7 +23815,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_array;
@@ -23789,7 +23828,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_proctype;
@@ -23802,7 +23841,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_pointer;
@@ -23815,7 +23854,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_procedure;
@@ -23828,7 +23867,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_varient;
@@ -23841,7 +23880,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_set;
@@ -23854,7 +23893,7 @@ extern "C" unsigned int 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)
{
mcDebug_assert (n != NULL);
return n->kind == decl_subrange;
@@ -23867,7 +23906,7 @@ extern "C" unsigned int 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)
{
return n == ztypeN;
/* static analysis guarentees a RETURN statement will be used before here. */
@@ -23879,7 +23918,7 @@ extern "C" unsigned int 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)
{
return n == rtypeN;
/* static analysis guarentees a RETURN statement will be used before here. */
@@ -23929,8 +23968,8 @@ extern "C" decl_node decl_makeType (nameKey_Name n)
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 ();
@@ -23949,7 +23988,7 @@ extern "C" decl_node decl_makeTypeImp (nameKey_Name n)
d = decl_lookupSym (n);
if (d != NULL)
{
- d->typeF.isHidden = FALSE;
+ d->typeF.isHidden = false;
return addToScope (d);
}
else
@@ -23958,7 +23997,7 @@ extern "C" decl_node decl_makeTypeImp (nameKey_Name n)
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. */
@@ -23979,9 +24018,9 @@ extern "C" decl_node decl_makeVar (nameKey_Name n)
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. */
@@ -24151,7 +24190,7 @@ extern "C" decl_node decl_makeArray (decl_node subr, decl_node type)
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 ();
@@ -24165,7 +24204,7 @@ extern "C" decl_node decl_makeArray (decl_node subr, decl_node type)
extern "C" void decl_putUnbounded (decl_node n)
{
mcDebug_assert (n->kind == decl_array);
- n->arrayF.isUnbounded = TRUE;
+ n->arrayF.isUnbounded = true;
}
@@ -24307,7 +24346,7 @@ extern "C" void decl_buildVarientSelector (decl_node r, decl_node v, nameKey_Nam
/* 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);
}
}
@@ -24804,7 +24843,7 @@ extern "C" decl_node decl_lookupSym (nameKey_Name n)
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))
@@ -24998,13 +25037,13 @@ extern "C" decl_node decl_makeProcedure (nameKey_Name n)
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;
@@ -25061,9 +25100,9 @@ extern "C" decl_node decl_makeProcType (void)
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. */
@@ -25098,11 +25137,11 @@ extern "C" void decl_putOptReturn (decl_node proc)
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;
}
}
@@ -25111,7 +25150,7 @@ extern "C" void decl_putOptReturn (decl_node proc)
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;
@@ -25120,7 +25159,7 @@ extern "C" decl_node decl_makeVarParameter (decl_node l, decl_node type, decl_no
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;
@@ -25133,7 +25172,7 @@ extern "C" decl_node decl_makeVarParameter (decl_node l, decl_node type, decl_no
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;
@@ -25142,7 +25181,7 @@ extern "C" decl_node decl_makeNonVarParameter (decl_node l, decl_node type, decl
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;
@@ -25169,10 +25208,10 @@ extern "C" void decl_paramEnter (decl_node n)
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;
}
}
@@ -25187,7 +25226,7 @@ extern "C" decl_node decl_makeIdentList (void)
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 ();
@@ -25199,17 +25238,17 @@ extern "C" decl_node decl_makeIdentList (void)
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 ();
@@ -25221,16 +25260,16 @@ extern "C" unsigned int decl_putIdent (decl_node n, nameKey_Name i)
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. */
+ c[...]
[diff truncated at 524288 bytes]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-12 13:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-12 13:27 [gcc r13-6614] [PR modula2/109089] implementation of boolean should be C++/C bool Gaius Mulley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).