@@ -80,14 +80,14 @@ class BufferedSerial:
8080 int baud = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE
8181 );
8282
83- virtual ~BufferedSerial ();
83+ ~BufferedSerial () override ;
8484
8585 /* * Equivalent to POSIX poll(). Derived from FileHandle.
8686 * Provides a mechanism to multiplex input/output over a set of file
8787 * handles.
8888 * The events that can be reported are POLLIN, POLLOUT, POLLHUP.
8989 */
90- virtual short poll (short events) const ;
90+ short poll (short events) const final ;
9191
9292 /* Resolve ambiguities versus our private SerialBase
9393 * (for writable, spelling differs, but just in case)
@@ -107,7 +107,7 @@ class BufferedSerial:
107107 * @param length The number of bytes to write
108108 * @return The number of bytes written, negative error on failure
109109 */
110- virtual ssize_t write (const void *buffer, size_t length);
110+ ssize_t write (const void *buffer, size_t length) override ;
111111
112112 /* * Read the contents of a file into a buffer
113113 *
@@ -123,21 +123,21 @@ class BufferedSerial:
123123 * @return The number of bytes read, 0 at end of file, negative
124124 * error on failure
125125 */
126- virtual ssize_t read (void *buffer, size_t length);
126+ ssize_t read (void *buffer, size_t length) override ;
127127
128128 /* * Close a file
129129 *
130130 * @return 0 on success, negative error code on failure
131131 */
132- virtual int close ();
132+ int close () override ;
133133
134134 /* * Check if the file in an interactive terminal device
135135 *
136136 * @return True if the file is a terminal
137137 * @return False if the file is not a terminal
138138 * @return Negative error code on failure
139139 */
140- virtual int isatty ();
140+ int isatty () override ;
141141
142142 /* * Move the file position to a given offset from from a given location
143143 *
@@ -152,20 +152,20 @@ class BufferedSerial:
152152 * @return The new offset of the file, negative error code on
153153 * failure
154154 */
155- virtual off_t seek (off_t offset, int whence);
155+ off_t seek (off_t offset, int whence) override ;
156156
157157 /* * Flush any buffers associated with the file
158158 *
159159 * @return 0 on success, negative error code on failure
160160 */
161- virtual int sync ();
161+ int sync () override ;
162162
163163 /* * Set blocking or non-blocking mode
164164 * The default is blocking.
165165 *
166166 * @param blocking true for blocking mode, false for non-blocking mode.
167167 */
168- virtual int set_blocking (bool blocking)
168+ int set_blocking (bool blocking) override
169169 {
170170 _blocking = blocking;
171171 return 0 ;
@@ -175,7 +175,7 @@ class BufferedSerial:
175175 *
176176 * @return true for blocking mode, false for non-blocking mode.
177177 */
178- virtual bool is_blocking () const
178+ bool is_blocking () const override
179179 {
180180 return _blocking;
181181 }
@@ -193,7 +193,7 @@ class BufferedSerial:
193193 * @return 0 on success
194194 * @return Negative error code on failure
195195 */
196- virtual int enable_input (bool enabled);
196+ int enable_input (bool enabled) override ;
197197
198198 /* * Enable or disable output
199199 *
@@ -208,7 +208,7 @@ class BufferedSerial:
208208 * @return 0 on success
209209 * @return Negative error code on failure
210210 */
211- virtual int enable_output (bool enabled);
211+ int enable_output (bool enabled) override ;
212212
213213 /* * Register a callback on state change of the file.
214214 *
@@ -227,7 +227,7 @@ class BufferedSerial:
227227 *
228228 * @param func Function to call on state change
229229 */
230- virtual void sigio (Callback<void ()> func);
230+ void sigio (Callback<void ()> func) override ;
231231
232232 /* * Setup interrupt handler for DCD line
233233 *
@@ -288,11 +288,11 @@ class BufferedSerial:
288288
289289 /* * Acquire mutex
290290 */
291- virtual void api_lock (void );
291+ void api_lock (void );
292292
293293 /* * Release mutex
294294 */
295- virtual void api_unlock (void );
295+ void api_unlock (void );
296296
297297 /* * Unbuffered write - invoked when write called from critical section
298298 * @param buf_ptr The buffer to write from
0 commit comments