Skip to content

Commit 5566aed

Browse files
committed
cleanup warnings
1 parent 3388b82 commit 5566aed

File tree

8 files changed

+33
-9
lines changed

8 files changed

+33
-9
lines changed

cores/arduino/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ extern "C" {
133133
}
134134

135135
//Declared weak in Arduino.h to allow user redefinitions.
136-
int atexit(void (*func)()) { return 0; }
136+
int atexit(void (*func)()) {
137+
(void)func;
138+
return 0;
139+
}
137140

138141
namespace __gnu_cxx {
139142
void __verbose_terminate_handler() { }

libraries/BlockDevices/BlockDevice.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ typedef pin_size_t pin_t;
4141

4242
class BlockDevice {
4343
private:
44-
virtual int open() {}
45-
virtual int close() {}
44+
virtual int open() { return 0; }
45+
virtual int close() { return 0; }
4646
virtual int write(const void *buffer, bd_addr_t addr, bd_size_t size) {
47-
program(buffer, addr, size);
47+
return program(buffer, addr, size);
4848
}
4949

5050

@@ -67,13 +67,20 @@ class BlockDevice {
6767
/* Write blocks */
6868
virtual int program(const void *buffer, bd_addr_t addr, bd_size_t size) = 0;
6969
virtual int erase(bd_addr_t addr, bd_size_t size) = 0;
70-
virtual int trim(bd_addr_t addr, bd_size_t size) { return 0; }
70+
virtual int trim(bd_addr_t addr, bd_size_t size) {
71+
(void)addr;
72+
(void)size;
73+
return 0;
74+
}
7175

7276

7377
virtual bd_size_t get_read_size() const = 0;
7478
virtual bd_size_t get_program_size() const = 0;
7579
virtual bd_size_t get_erase_size() const { return get_program_size();}
76-
virtual bd_size_t get_erase_size(bd_addr_t addr) const { return get_erase_size(); }
80+
virtual bd_size_t get_erase_size(bd_addr_t addr) const {
81+
(void)addr;
82+
return get_erase_size();
83+
}
7784

7885

7986
virtual int get_erase_value() const { return -1; }

libraries/Storage/FileHandle.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
1718
#include "FileHandle.h"
1819

1920
//namespace mbed {

libraries/Storage/FileHandle.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ class FileHandle : private NonCopyable<FileHandle> {
148148
*/
149149
virtual int truncate(off_t length)
150150
{
151+
(void)length;
151152
return -EINVAL;
152153
}
153154

@@ -189,6 +190,7 @@ class FileHandle : private NonCopyable<FileHandle> {
189190
*/
190191
virtual int enable_input(bool enabled)
191192
{
193+
(void)enabled;
192194
return -EINVAL;
193195
}
194196

@@ -207,6 +209,7 @@ class FileHandle : private NonCopyable<FileHandle> {
207209
*/
208210
virtual int enable_output(bool enabled)
209211
{
212+
(void)enabled;
210213
return -EINVAL;
211214
}
212215

@@ -223,6 +226,7 @@ class FileHandle : private NonCopyable<FileHandle> {
223226
virtual short poll(short events) const
224227
{
225228
// Possible default for real files
229+
(void)events;
226230
return POLLIN | POLLOUT;
227231
}
228232

@@ -268,6 +272,7 @@ class FileHandle : private NonCopyable<FileHandle> {
268272
virtual void sigio(void (*func)())
269273
{
270274
//Default for real files. Do nothing for real files.
275+
(void)func;
271276
}
272277
};
273278

libraries/Storage/FileSystem.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "FileSystem.h"
2121
#include <errno.h>
2222

23+
#pragma GCC diagnostic ignored "-Wunused-parameter"
24+
2325
//namespace mbed {
2426

2527
FileSystem::FileSystem(const char *name)

libraries/Storage/FileSystemHandle.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
#include "FileSystemHandle.h"
1919

20+
#pragma GCC diagnostic ignored "-Wunused-parameter"
21+
2022
//namespace mbed {
2123

2224
int FileSystemHandle::open(DirHandle **dir, const char *path)

libraries/Storage/storage_common.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,17 @@ static inline void debug_mem(uint8_t *b, uint32_t _size)
7777
#else
7878

7979
static inline void debug_if(int condition, const char *format, ...) {
80-
80+
(void)condition;
81+
(void)format;
8182
}
8283

8384
static inline void debug(const char *format, ...) {
84-
85+
(void)format;
8586
}
8687

8788
static inline void debug_mem(uint8_t *b, uint32_t _size) {
88-
89+
(void)b;
90+
(void)_size;
8991
}
9092

9193
#endif // STORAGE_DEBUG

libraries/Storage/storage_retarget.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include <errno.h>
2929
#include "storage_retarget.h"
3030

31+
#pragma GCC diagnostic ignored "-Wunused-parameter"
32+
3133
static PlatformMutex _mutex;
3234

3335
/* DIR is typedeffed to struct DIR_impl in header */

0 commit comments

Comments
 (0)