Skip to content

Commit 99d5270

Browse files
authored
Merge pull request #291 from pillo79/pr-warning-cleanup
misc: pre-release warning cleanup
2 parents ce6072a + f64b3cd commit 99d5270

File tree

16 files changed

+68
-27
lines changed

16 files changed

+68
-27
lines changed

boards.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ nano_matter.menu.link_mode.static.upload.extension=bin-zsk.bin
580580
nano_matter.build.zephyr_target=arduino_nano_matter
581581
nano_matter.build.zephyr_args=
582582
nano_matter.build.zephyr_hals=hal_silabs
583+
nano_matter.build.artifact=zephyr_main
583584
nano_matter.build.variant=arduino_nano_matter_mgm240sd22vna
584585
nano_matter.build.mcu=cortex-m33
585586
nano_matter.build.fpu=-mfpu=fpv4-sp-d16

libraries/Arduino_LED_Matrix/examples/Reflash_Bootanimation/bootanimation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#include "stdint.h"
22

3-
__attribute__((packed)) struct bootanimation_user_data {
3+
struct bootanimation_user_data {
44
size_t magic; // must be 0xBA for bootanimation
55
size_t len_loop;
66
size_t len_end;
77
size_t empty;
88
uint8_t *buf_loop;
9-
};
9+
} __attribute__((packed));
1010

1111
unsigned int bootanimation_end_len = 3120;
1212
unsigned int bootanimation_len = 18720;

libraries/Arduino_LED_Matrix/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ paragraph=This library provides a simple interface for controlling the LED matri
77
category=Communication
88
url=https://www.arduino.cc/
99
architectures=*
10-
depends=
10+
depends=ArduinoGraphics

libraries/Camera/src/camera.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,19 @@ 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

42-
Camera::Camera() : vdev(NULL), byte_swap(false), yuv_to_gray(false) {
46+
Camera::Camera() : byte_swap(false), yuv_to_gray(false), vdev(NULL) {
4347
for (size_t i = 0; i < ARRAY_SIZE(this->vbuf); i++) {
4448
this->vbuf[i] = NULL;
4549
}
@@ -74,13 +78,13 @@ bool Camera::begin(uint32_t width, uint32_t height, uint32_t pixformat, bool byt
7478
return false;
7579
}
7680

77-
for (size_t i = 0; caps.format_caps[i].pixelformat != NULL; i++) {
81+
for (size_t i = 0; caps.format_caps[i].pixelformat != 0; i++) {
7882
const struct video_format_cap *fcap = &caps.format_caps[i];
7983
if (fcap->width_min == width && fcap->height_min == height &&
8084
fcap->pixelformat == pixformat) {
8185
break;
8286
}
83-
if (caps.format_caps[i + 1].pixelformat == NULL) {
87+
if (caps.format_caps[i + 1].pixelformat == 0) {
8488
Serial.println("The specified format is not supported");
8589
return false;
8690
}

libraries/Ethernet/examples/WebClient/WebClient.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ void loop() {
110110
Serial.print("Received ");
111111
Serial.print(byteCount);
112112
Serial.print(" bytes in ");
113-
float seconds = (float)(endMicros - beginMicros) / 1000000.0;
113+
float seconds = (endMicros - beginMicros) / 1000000.0f;
114114
Serial.print(seconds, 4);
115-
float rate = (float)byteCount / seconds / 1000.0;
116115
Serial.print(", rate = ");
116+
float rate = byteCount / 1000.0f / seconds;
117117
Serial.print(rate);
118118
Serial.print(" kbytes/second");
119119
Serial.println();

libraries/SocketWrapper/SocketHelpers.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ void NetworkInterface::event_handler(struct net_mgmt_event_callback *cb, uint64_
1010
struct net_if *iface) {
1111
int i = 0;
1212

13+
ARG_UNUSED(cb);
14+
1315
if (mgmt_event != NET_EVENT_IPV4_ADDR_ADD) {
1416
return;
1517
}
@@ -38,6 +40,10 @@ void NetworkInterface::option_handler(struct net_dhcpv4_option_callback *cb, siz
3840
enum net_dhcpv4_msg_type msg_type, struct net_if *iface) {
3941
char buf[NET_IPV4_ADDR_LEN];
4042

43+
ARG_UNUSED(length);
44+
ARG_UNUSED(msg_type);
45+
ARG_UNUSED(iface);
46+
4147
LOG_INF("DHCP Option %d: %s", cb->option, net_addr_ntop(AF_INET, cb->data, buf, sizeof(buf)));
4248
}
4349

@@ -58,7 +64,7 @@ int NetworkInterface::dhcp() {
5864
return 0;
5965
}
6066

61-
void NetworkInterface::enable_dhcpv4_server(struct net_if *netif, char *_netmask) {
67+
void NetworkInterface::enable_dhcpv4_server(struct net_if *netif, const char *_netmask) {
6268
static struct in_addr addr;
6369
static struct in_addr netmaskAddr;
6470

@@ -140,7 +146,7 @@ void NetworkInterface::setMACAddress(const uint8_t *mac) {
140146
net_if_up(netif); // Bring the interface back up after changing the MAC address
141147
}
142148

143-
int NetworkInterface::begin(bool blocking, uint32_t additional_event_mask) {
149+
int NetworkInterface::begin(bool blocking, uint64_t additional_event_mask) {
144150
dhcp();
145151
int ret = net_mgmt_event_wait_on_iface(netif, NET_EVENT_IPV4_ADDR_ADD | additional_event_mask,
146152
NULL, NULL, NULL, blocking ? K_FOREVER : K_SECONDS(1));
@@ -157,7 +163,6 @@ void NetworkInterface::config(const IPAddress ip, const IPAddress dns_server,
157163
setDnsServerIP(dns_server);
158164
setGatewayIP(gateway);
159165
setSubnetMask(subnet);
160-
return;
161166
}
162167

163168
void NetworkInterface::setLocalIP(const IPAddress ip) {
@@ -169,13 +174,17 @@ void NetworkInterface::setLocalIP(const IPAddress ip) {
169174
return;
170175
}
171176
LOG_INF("Local IP address set: %s", ip.toString().c_str());
172-
return;
173177
}
174178

175179
void NetworkInterface::setSubnetMask(const IPAddress subnet) {
176180
struct in_addr netmask_addr;
177181
netmask_addr.s_addr = subnet;
182+
#pragma GCC diagnostic push
183+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
184+
// TODO: store the address that was manually set and replace this call
185+
// with net_if_ipv4_set_netmask_by_addr
178186
net_if_ipv4_set_netmask(netif, &netmask_addr);
187+
#pragma GCC diagnostic pop
179188
LOG_INF("Subnet mask set: %s", subnet.toString().c_str());
180189
return;
181190
}
@@ -185,9 +194,9 @@ void NetworkInterface::setGatewayIP(const IPAddress gateway) {
185194
gw_addr.s_addr = gateway;
186195
net_if_ipv4_set_gw(netif, &gw_addr);
187196
LOG_INF("Gateway IP set: %s", gateway.toString().c_str());
188-
return;
189197
}
190198

191199
void NetworkInterface::setDnsServerIP(const IPAddress dns_server) {
192-
return; // DNS server dynamic configuration is not supported
200+
// DNS server dynamic configuration is not supported
201+
ARG_UNUSED(dns_server);
193202
}

libraries/SocketWrapper/SocketHelpers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class NetworkInterface {
3434
protected:
3535
struct net_if *netif = nullptr;
3636
int dhcp();
37-
void enable_dhcpv4_server(struct net_if *netif, char *_netmask = "255.255.255.0");
37+
void enable_dhcpv4_server(struct net_if *netif, const char *_netmask = "255.255.255.0");
3838

3939
public:
4040
NetworkInterface() {
@@ -57,7 +57,7 @@ class NetworkInterface {
5757
void setGatewayIP(const IPAddress gateway);
5858
void setDnsServerIP(const IPAddress dns_server);
5959

60-
int begin(bool blocking = true, uint32_t additional_event_mask = 0);
60+
int begin(bool blocking = true, uint64_t additional_event_mask = 0);
6161

6262
bool disconnect();
6363
};

libraries/SocketWrapper/ZephyrServer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ class ZephyrServer : public arduino::Server, ZephyrSocketWrapper {
4040
}
4141

4242
ZephyrClient accept(uint8_t *status = nullptr) {
43+
ARG_UNUSED(status);
44+
4345
ZephyrClient client;
4446
int sock = ZephyrSocketWrapper::accept();
4547
client.setSocket(sock);

0 commit comments

Comments
 (0)