Skip to content

Commit 5b39474

Browse files
authored
Merge pull request #381 from fpistm/boolean
Replace boolean with standard bool
2 parents 0b05ea3 + 48b6e7d commit 5b39474

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

Diff for: cores/arduino/WCharacter.h

+26-26
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ extern "C" {
2828

2929
// WCharacter.h prototypes
3030
#if defined ( __GNUC__ )
31-
inline boolean isAlphaNumeric(int c) __attribute__((always_inline));
32-
inline boolean isAlpha(int c) __attribute__((always_inline));
33-
inline boolean isAscii(int c) __attribute__((always_inline));
34-
inline boolean isWhitespace(int c) __attribute__((always_inline));
35-
inline boolean isControl(int c) __attribute__((always_inline));
36-
inline boolean isDigit(int c) __attribute__((always_inline));
37-
inline boolean isGraph(int c) __attribute__((always_inline));
38-
inline boolean isLowerCase(int c) __attribute__((always_inline));
39-
inline boolean isPrintable(int c) __attribute__((always_inline));
40-
inline boolean isPunct(int c) __attribute__((always_inline));
41-
inline boolean isSpace(int c) __attribute__((always_inline));
42-
inline boolean isUpperCase(int c) __attribute__((always_inline));
43-
inline boolean isHexadecimalDigit(int c) __attribute__((always_inline));
31+
inline bool isAlphaNumeric(int c) __attribute__((always_inline));
32+
inline bool isAlpha(int c) __attribute__((always_inline));
33+
inline bool isAscii(int c) __attribute__((always_inline));
34+
inline bool isWhitespace(int c) __attribute__((always_inline));
35+
inline bool isControl(int c) __attribute__((always_inline));
36+
inline bool isDigit(int c) __attribute__((always_inline));
37+
inline bool isGraph(int c) __attribute__((always_inline));
38+
inline bool isLowerCase(int c) __attribute__((always_inline));
39+
inline bool isPrintable(int c) __attribute__((always_inline));
40+
inline bool isPunct(int c) __attribute__((always_inline));
41+
inline bool isSpace(int c) __attribute__((always_inline));
42+
inline bool isUpperCase(int c) __attribute__((always_inline));
43+
inline bool isHexadecimalDigit(int c) __attribute__((always_inline));
4444
inline int toAscii(int c) __attribute__((always_inline));
4545
inline int toLowerCase(int c) __attribute__((always_inline));
4646
inline int toUpperCase(int c)__attribute__((always_inline));
@@ -49,74 +49,74 @@ inline int toUpperCase(int c)__attribute__((always_inline));
4949

5050
// Checks for an alphanumeric character.
5151
// It is equivalent to (isalpha(c) || isdigit(c)).
52-
inline boolean isAlphaNumeric(int c)
52+
inline bool isAlphaNumeric(int c)
5353
{
5454
return ( isalnum(c) == 0 ? false : true);
5555
}
5656

5757

5858
// Checks for an alphabetic character.
5959
// It is equivalent to (isupper(c) || islower(c)).
60-
inline boolean isAlpha(int c)
60+
inline bool isAlpha(int c)
6161
{
6262
return ( isalpha(c) == 0 ? false : true);
6363
}
6464

6565

6666
// Checks whether c is a 7-bit unsigned char value
6767
// that fits into the ASCII character set.
68-
inline boolean isAscii(int c)
68+
inline bool isAscii(int c)
6969
{
7070
/* return ( isascii(c) == 0 ? false : true); */
7171
return ( (c & ~0x7f) != 0 ? false : true);
7272
}
7373

7474

7575
// Checks for a blank character, that is, a space or a tab.
76-
inline boolean isWhitespace(int c)
76+
inline bool isWhitespace(int c)
7777
{
7878
return ( isblank (c) == 0 ? false : true);
7979
}
8080

8181

8282
// Checks for a control character.
83-
inline boolean isControl(int c)
83+
inline bool isControl(int c)
8484
{
8585
return ( iscntrl (c) == 0 ? false : true);
8686
}
8787

8888

8989
// Checks for a digit (0 through 9).
90-
inline boolean isDigit(int c)
90+
inline bool isDigit(int c)
9191
{
9292
return ( isdigit (c) == 0 ? false : true);
9393
}
9494

9595

9696
// Checks for any printable character except space.
97-
inline boolean isGraph(int c)
97+
inline bool isGraph(int c)
9898
{
9999
return ( isgraph (c) == 0 ? false : true);
100100
}
101101

102102

103103
// Checks for a lower-case character.
104-
inline boolean isLowerCase(int c)
104+
inline bool isLowerCase(int c)
105105
{
106106
return (islower (c) == 0 ? false : true);
107107
}
108108

109109

110110
// Checks for any printable character including space.
111-
inline boolean isPrintable(int c)
111+
inline bool isPrintable(int c)
112112
{
113113
return ( isprint (c) == 0 ? false : true);
114114
}
115115

116116

117117
// Checks for any printable character which is not a space
118118
// or an alphanumeric character.
119-
inline boolean isPunct(int c)
119+
inline bool isPunct(int c)
120120
{
121121
return ( ispunct (c) == 0 ? false : true);
122122
}
@@ -125,22 +125,22 @@ inline boolean isPunct(int c)
125125
// Checks for white-space characters. For the avr-libc library,
126126
// these are: space, formfeed ('\f'), newline ('\n'), carriage
127127
// return ('\r'), horizontal tab ('\t'), and vertical tab ('\v').
128-
inline boolean isSpace(int c)
128+
inline bool isSpace(int c)
129129
{
130130
return ( isspace (c) == 0 ? false : true);
131131
}
132132

133133

134134
// Checks for an uppercase letter.
135-
inline boolean isUpperCase(int c)
135+
inline bool isUpperCase(int c)
136136
{
137137
return ( isupper (c) == 0 ? false : true);
138138
}
139139

140140

141141
// Checks for a hexadecimal digits, i.e. one of 0 1 2 3 4 5 6 7
142142
// 8 9 a b c d e f A B C D E F.
143-
inline boolean isHexadecimalDigit(int c)
143+
inline bool isHexadecimalDigit(int c)
144144
{
145145
return ( isxdigit (c) == 0 ? false : true);
146146
}

Diff for: cores/arduino/wiring_constants.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ enum BitOrder {
107107

108108
typedef unsigned int word;
109109

110-
typedef bool boolean ;
110+
typedef bool boolean __attribute__ ((deprecated));
111111

112112
typedef uint8_t byte ;
113113

Diff for: libraries/Servo/src/stm32/Servo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static void finISR(stimer_t *obj)
8989
TimerPulseDeinit(obj);
9090
}
9191

92-
static boolean isTimerActive(timer16_Sequence_t timer)
92+
static bool isTimerActive(timer16_Sequence_t timer)
9393
{
9494
// returns true if any servo is active on this timer
9595
for(uint8_t channel=0; channel < SERVOS_PER_TIMER; channel++) {

0 commit comments

Comments
 (0)