aboutsummaryrefslogtreecommitdiff
path: root/libgm2/libm2iso
diff options
context:
space:
mode:
authorGaius Mulley <gaiusmod2@gmail.com>2023-05-13 15:49:50 +0100
committerGaius Mulley <gaiusmod2@gmail.com>2023-05-13 15:49:50 +0100
commit2415442489d35a70953e11ac723452f39eb06e26 (patch)
tree647137763f12302c373683bffdedd5284be2180d /libgm2/libm2iso
parent8b18714fbb1ca9812b33b3de75fe6ba4a57d4946 (diff)
downloadgcc-2415442489d35a70953e11ac723452f39eb06e26.zip
gcc-2415442489d35a70953e11ac723452f39eb06e26.tar.gz
gcc-2415442489d35a70953e11ac723452f39eb06e26.tar.bz2
Replace bool as boolean instead of int in libgm2
This patch tidies KeyBoardLEDs.cc, RTco.cc, sckt.cc and wrapc.cc by removing the TRUE/FALSE macros and using bool, true and false. libgm2/ChangeLog: * libm2cor/KeyBoardLEDs.cc (TRUE): Remove. (FALSE): Remove. (init): Replace TRUE with true. * libm2iso/RTco.cc (TRUE): Remove. (FALSE): Remove. (initSem): Replace int with bool. (init): Replace FALSE with false. * libm2pim/sckt.cc (TRUE): Remove. (FALSE): Remove. * libm2pim/wrapc.cc: Replace TRUE with true and FALSE with false. (FALSE): Remove. (TRUE): Remove. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'libgm2/libm2iso')
-rw-r--r--libgm2/libm2iso/RTco.cc20
1 files changed, 6 insertions, 14 deletions
diff --git a/libgm2/libm2iso/RTco.cc b/libgm2/libm2iso/RTco.cc
index 71d4f4b..17e8010 100644
--- a/libgm2/libm2iso/RTco.cc
+++ b/libgm2/libm2iso/RTco.cc
@@ -61,14 +61,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define gm2_printf __printf__
#endif
-#if !defined(TRUE)
-#define TRUE (1 == 1)
-#endif
-
-#if !defined(FALSE)
-#define FALSE (1 == 0)
-#endif
-
#if defined(TRACEON)
#define tprintf printf
#else
@@ -92,7 +84,7 @@ typedef struct threadCB_s
typedef struct threadSem_s
{
__gthread_cond_t counter;
- int waiting;
+ bool waiting;
int sem_value;
} threadSem;
@@ -104,7 +96,7 @@ static threadSem **semArray = NULL;
/* These are used to lock the above module data structures. */
static __gthread_mutex_t lock; /* This is the only mutex for
the whole module. */
-static int initialized = FALSE;
+static int initialized = false;
extern "C" int EXPORT(init) (void);
@@ -128,7 +120,7 @@ static void
initSem (threadSem *sem, int value)
{
__GTHREAD_COND_INIT_FUNCTION (&sem->counter);
- sem->waiting = FALSE;
+ sem->waiting = false;
sem->sem_value = value;
}
@@ -138,9 +130,9 @@ waitSem (threadSem *sem)
__gthread_mutex_lock (&lock);
if (sem->sem_value == 0)
{
- sem->waiting = TRUE;
+ sem->waiting = true;
__gthread_cond_wait (&sem->counter, &lock);
- sem->waiting = FALSE;
+ sem->waiting = false;
}
else
sem->sem_value--;
@@ -495,7 +487,7 @@ EXPORT(init) (void)
tprintf ("checking init\n");
if (! initialized)
{
- initialized = TRUE;
+ initialized = true;
tprintf ("RTco initialized\n");
__GTHREAD_MUTEX_INIT_FUNCTION (&lock);