Switch to stdbool.h

- Add `#include <stdbool.h> to all files previously using the
   `TRUE`/`FALSE` macros
 - Replace all instances of `TRUE`/`FALSE` with `true`/`false`,
   respectively
 - Definitions of `TRUE`/`FALSE` macros retained in wiringPi.h for compatibility.
This commit is contained in:
Connor Gibson
2025-06-01 15:15:56 -07:00
parent 3cf394b206
commit 55e189eda5
42 changed files with 262 additions and 277 deletions

View File

@@ -26,6 +26,7 @@
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <stdarg.h>
@@ -36,9 +37,6 @@
#include "network.h"
#define TRUE (1==1)
#define FALSE (!TRUE)
// Local data
#define SALT_LEN 16

View File

@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
@@ -40,7 +41,7 @@
int noLocalPins = FALSE ;
int noLocalPins = false ;
void runRemoteCommands (int fd)

View File

@@ -22,6 +22,7 @@
#include <arpa/inet.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
@@ -46,7 +47,7 @@
// Globals
static const char *usage = "[-h] [-d] [-g | -1 | -z] [[-x extension:pin:params] ...] password" ;
static int doDaemon = FALSE ;
static int doDaemon = false ;
//
@@ -156,7 +157,7 @@ int main (int argc, char *argv [])
exit (EXIT_FAILURE) ;
}
doDaemon = TRUE ;
doDaemon = true ;
daemonise (PIDFILE) ;
for (i = 2 ; i < argc ; ++i)
@@ -216,7 +217,7 @@ int main (int argc, char *argv [])
for (i = 2 ; i < argc ; ++i)
argv [i - 1] = argv [i] ;
--argc ;
noLocalPins = TRUE ;
noLocalPins = true ;
++wpiSetup ;
continue ;
}
@@ -263,7 +264,7 @@ int main (int argc, char *argv [])
logMsg ("Loading extension: %s", argv [2]) ;
if (!loadWPiExtension (argv [0], argv [2], TRUE))
if (!loadWPiExtension (argv [0], argv [2], true))
{
logMsg ("Extension load failed: %s", strerror (errno)) ;
exit (EXIT_FAILURE) ;