Skip to content

Commit 6e1c2bc

Browse files
committed
🚨 Fix compiler warnings in printf formatting
1 parent 3c90419 commit 6e1c2bc

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

actor_model/src/process.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ auto Process::send(const Message& message)
124124
ESP_LOGE(
125125
get_uuid_str(pid).c_str(),
126126
"Unable to send message (payload size %zu)",
127-
message.payload()->size()
127+
static_cast<size_t>(message.payload()->size())
128128
);
129129
}
130130
return did_send;

firmware_update/src/firmware_update_actor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ auto firmware_update_actor_behaviour(
667667

668668
if (all_files_valid and (new_version > current_version))
669669
{
670-
printf("Newer firmware update version %d available, downloading\n", new_version);
670+
printf("Newer firmware update version %lu available, downloading\n", new_version);
671671

672672
if (firmware_update_metadata->checksum())
673673
{

network_manager/src/network_check_actor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ auto ping_success_callback(esp_ping_handle_t hdl, void *args)
6262
sizeof(elapsed_time)
6363
);
6464
printf(
65-
"%d bytes from %s icmp_seq=%d ttl=%d time=%d ms\n",
65+
"%lu bytes from %s icmp_seq=%d ttl=%d time=%lu ms\n",
6666
recv_len,
6767
inet_ntoa(target_addr.u_addr.ip4),
6868
seqno,
@@ -98,7 +98,7 @@ auto ping_end_callback(esp_ping_handle_t hdl, void *args)
9898
} else {
9999
printf("\n--- %s ping statistics ---\n", inet6_ntoa(*ip_2_ip6(&target_addr)));
100100
}
101-
printf("%d packets transmitted, %d received, %d%% packet loss, time %dms\n",
101+
printf("%lu packets transmitted, %lu received, %lu%% packet loss, time %lums\n",
102102
transmitted, received, loss, total_time_ms);
103103
// delete the ping sessions, so that we clean up all resources and can create a new ping session
104104
// we don't have to call delete function in the callback, instead we can call delete function from other tasks

requests/src/queued_endpoint_actor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ auto queued_endpoint_actor_behaviour(
250250
TAG,
251251
"Response error (%d), resending: '%.*s'\n",
252252
response->code(),
253-
response->body()->size(),
253+
static_cast<int>(response->body()->size()),
254254
response->body()->data()
255255
);
256256

uuid/lib/sole/sole.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,27 +176,27 @@ namespace sole {
176176
auto i = 0;
177177

178178
// Include 1 byte for -, and 1 for null (ignored)
179-
snprintf(&s[i], 8 + 1 + 1, "%08x-", (a));
179+
snprintf(&s[i], 8 + 1 + 1, "%08lx-", (a));
180180
i += 8 + 1;
181181

182182
// Include 1 byte for -, and 1 for null (ignored)
183-
snprintf(&s[i], 4 + 1 + 1, "%04x-", (b >> 16));
183+
snprintf(&s[i], 4 + 1 + 1, "%04lx-", (b >> 16));
184184
i += 4 + 1;
185185

186186
// Include 1 byte for -, and 1 for null (ignored)
187-
snprintf(&s[i], 4 + 1 + 1, "%04x-", (b & 0xFFFF));
187+
snprintf(&s[i], 4 + 1 + 1, "%04lx-", (b & 0xFFFF));
188188
i += 4 + 1;
189189

190190
// Include 1 byte for -, and 1 for null (ignored)
191-
snprintf(&s[i], 4 + 1 + 1, "%04x-", (c >> 16 ));
191+
snprintf(&s[i], 4 + 1 + 1, "%04lx-", (c >> 16 ));
192192
i += 4 + 1;
193193

194194
// Include 1 byte for null (ignored)
195-
snprintf(&s[i], 4 + 1, "%04x", (c & 0xFFFF));
195+
snprintf(&s[i], 4 + 1, "%04lx", (c & 0xFFFF));
196196
i += 4;
197197

198198
// Include 1 byte for null (ignored)
199-
snprintf(&s[i], 8 + 1, "%08x", (d));
199+
snprintf(&s[i], 8 + 1, "%08lx", (d));
200200
i += 8;
201201

202202
// Strip the trailing null that snprintf adds

0 commit comments

Comments
 (0)