Skip to content

Commit 41aa393

Browse files
committed
warning cleanup: add missing return statements
Add missing default return values to functions returning non-void. Also remove spuperfluous 'return;' statements at the end of functions. Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
1 parent bfa23be commit 41aa393

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

libraries/Camera/src/camera.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@ uint32_t FrameBuffer::getBufferSize() {
3131
if (this->vbuf) {
3232
return this->vbuf->bytesused;
3333
}
34+
35+
return 0;
3436
}
3537

3638
uint8_t *FrameBuffer::getBuffer() {
3739
if (this->vbuf) {
3840
return this->vbuf->buffer;
3941
}
42+
43+
return NULL;
4044
}
4145

4246
Camera::Camera() : vdev(NULL), byte_swap(false), yuv_to_gray(false) {

libraries/SocketWrapper/SocketHelpers.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ void NetworkInterface::config(const IPAddress ip, const IPAddress dns_server,
163163
setDnsServerIP(dns_server);
164164
setGatewayIP(gateway);
165165
setSubnetMask(subnet);
166-
return;
167166
}
168167

169168
void NetworkInterface::setLocalIP(const IPAddress ip) {
@@ -175,7 +174,6 @@ void NetworkInterface::setLocalIP(const IPAddress ip) {
175174
return;
176175
}
177176
LOG_INF("Local IP address set: %s", ip.toString().c_str());
178-
return;
179177
}
180178

181179
void NetworkInterface::setSubnetMask(const IPAddress subnet) {

libraries/WiFi/src/WiFi.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ int WiFiClass::status() {
8484

8585
int8_t WiFiClass::scanNetworks() {
8686
// TODO: borrow code from mbed core for scan results handling
87+
return 0;
8788
}
8889

8990
char *WiFiClass::SSID() {

0 commit comments

Comments
 (0)