Skip to content

Commit 538bee9

Browse files
committed
Changed operator bool to explicit rather than implicit conversion in Serial
1 parent 5755dde commit 538bee9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cores/arduino/HardwareSerial.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class HardwareSerial : public Stream
132132
inline size_t write(unsigned int n) { return write((uint8_t)n); }
133133
inline size_t write(int n) { return write((uint8_t)n); }
134134
using Print::write; // pull in write(str) and write(buf, size) from Print
135-
operator bool() { return true; }
135+
explicit constexpr operator bool() { return true; }
136136

137137
// Interrupt handlers - Not intended to be called externally
138138
inline void _rx_complete_irq(void);

libraries/SoftwareSerial/src/SoftwareSerial.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class SoftwareSerial : public Stream
103103
virtual int read();
104104
virtual int available();
105105
virtual void flush();
106-
operator bool() { return true; }
106+
explicit constexpr operator bool() { return true; }
107107

108108
using Print::write;
109109

0 commit comments

Comments
 (0)