Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark virtual-function overrides with explicit override keyword #320

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions arduino/opencr_arduino/opencr/cores/arduino/Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class Client : public Stream {
public:
virtual int connect(IPAddress ip, uint16_t port) =0;
virtual int connect(const char *host, uint16_t port) =0;
virtual size_t write(uint8_t) =0;
virtual size_t write(const uint8_t *buf, size_t size) =0;
virtual int available() = 0;
virtual int read() = 0;
virtual size_t write(uint8_t) override =0;
virtual size_t write(const uint8_t *buf, size_t size) override =0;
virtual int available() override = 0;
virtual int read() override = 0;
virtual int read(uint8_t *buf, size_t size) = 0;
virtual int peek() = 0;
virtual void flush() = 0;
virtual int peek() override = 0;
virtual void flush() override = 0;
virtual void stop() = 0;
virtual uint8_t connected() = 0;
virtual operator bool() = 0;
Expand Down
10 changes: 5 additions & 5 deletions arduino/opencr_arduino/opencr/cores/arduino/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ class HardwareSerial : public Stream
public:
virtual void begin(unsigned long) = 0;
virtual void end() = 0;
virtual int available(void) = 0;
virtual int peek(void) = 0;
virtual int read(void) = 0;
virtual void flush(void) = 0;
virtual size_t write(uint8_t) = 0;
virtual int available(void) override = 0;
virtual int peek(void) override = 0;
virtual int read(void) override = 0;
virtual void flush(void) override = 0;
virtual size_t write(uint8_t) override = 0;
using Print::write; // pull in write(str) and write(buf, size) from Print
virtual operator bool() = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion arduino/opencr_arduino/opencr/cores/arduino/IPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class IPAddress : public Printable {
IPAddress& operator=(const uint8_t *address);
IPAddress& operator=(uint32_t address);

virtual size_t printTo(Print& p) const;
virtual size_t printTo(Print& p) const override;

friend class EthernetClass;
friend class UDP;
Expand Down
18 changes: 9 additions & 9 deletions arduino/opencr_arduino/opencr/cores/arduino/UARTClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ class UARTClass : public HardwareSerial
};
UARTClass(uint8_t uart_num, uint8_t uart_mode, uint8_t *txBuffer, uint16_t tx_buffer_size);
UARTClass(void);
void begin(const uint32_t dwBaudRate);
void begin(const uint32_t dwBaudRate) override;
void begin(const uint32_t dwBaudRate, const UARTModes config);
void end(void);
int available(void);
void end(void) override;
int available(void) override;
int availableForWrite(void);
int peek(void);
int read(void);
void flush(void);
int peek(void) override;
int read(void) override;
void flush(void) override;
void flushRx( uint32_t timeout_ms );
size_t write(const uint8_t c);
size_t write(const uint8_t *buffer, size_t size);
size_t write(const uint8_t c) override;
size_t write(const uint8_t *buffer, size_t size) override;
using Print::write; // pull in write(str) and write(buf, size) from Print


Expand All @@ -64,7 +64,7 @@ class UARTClass : public HardwareSerial
uint32_t getRxCnt(void);
uint32_t getTxCnt(void);

operator bool() { return true; }; // UART always active
operator bool() override { return true; }; // UART always active


protected:
Expand Down
12 changes: 6 additions & 6 deletions arduino/opencr_arduino/opencr/cores/arduino/USBSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ class USBSerial : public Stream {
void begin(uint32_t baud_count, uint8_t config);
void end(void);

virtual int available(void);
virtual int available(void) override;
//virtual void accept(void);
virtual int peek(void);
virtual int read(void);
virtual void flush(void);
virtual size_t write(uint8_t c);
virtual size_t write(const uint8_t *buffer, size_t size);
virtual int peek(void) override;
virtual int read(void) override;
virtual void flush(void) override;
virtual size_t write(uint8_t c) override;
virtual size_t write(const uint8_t *buffer, size_t size) override;
using Print::write; // pull in write(str) from Print
operator bool();

Expand Down
12 changes: 6 additions & 6 deletions arduino/opencr_arduino/opencr/cores/arduino/Udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,26 @@ class UDP : public Stream {
// Returns 1 if the packet was sent successfully, 0 if there was an error
virtual int endPacket() =0;
// Write a single byte into the packet
virtual size_t write(uint8_t) =0;
virtual size_t write(uint8_t) override =0;
// Write size bytes from buffer into the packet
virtual size_t write(const uint8_t *buffer, size_t size) =0;
virtual size_t write(const uint8_t *buffer, size_t size) override =0;

// Start processing the next available incoming packet
// Returns the size of the packet in bytes, or 0 if no packets are available
virtual int parsePacket() =0;
// Number of bytes remaining in the current packet
virtual int available() =0;
virtual int available() override =0;
// Read a single byte from the current packet
virtual int read() =0;
virtual int read() override =0;
// Read up to len bytes from the current packet and place them into buffer
// Returns the number of bytes read, or 0 if none are available
virtual int read(unsigned char* buffer, size_t len) =0;
// Read up to len characters from the current packet and place them into buffer
// Returns the number of characters read, or 0 if none are available
virtual int read(char* buffer, size_t len) =0;
// Return the next byte from the current packet without moving on to the next byte
virtual int peek() =0;
virtual void flush() =0; // Finish reading the current packet
virtual int peek() override =0;
virtual void flush() override =0; // Finish reading the current packet

// Return the IP address of the host who sent the current incoming packet
virtual IPAddress remoteIP() =0;
Expand Down