Skip to content

Commit 83c35b6

Browse files
committed
fix: using helpers namespace, fix printf format
1 parent 4772d4d commit 83c35b6

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/pdrouting.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
MODULE_DEF(pdrouting, module_pdrouting::pdrouting)
3737

3838
using namespace robotkernel;
39+
using namespace robotkernel::helpers;
3940
using namespace std;
4041
using namespace module_pdrouting;
4142

@@ -71,7 +72,7 @@ void pdrouting::one_to_many::start() {
7172
tmp_pdout.dev = robotkernel::get_device<process_data>(tmp_pdout.name);
7273

7374
if (tmp_pdout.dev->length != in_length) {
74-
throw std::runtime_error(string_printf("%s: pdout %s has wrong length! (need %d bytes, got %d bytes)",
75+
throw std::runtime_error(string_printf("%s: pdout %s has wrong length! (need %zu bytes, got %zu bytes)",
7576
name.c_str(), tmp_pdout.name.c_str(), tmp_pdout.dev->length, in_length));
7677
}
7778

@@ -171,8 +172,8 @@ void pdrouting::pd_demux::start() {
171172
act_len += output.len;
172173

173174
if (act_len > pdin.dev->length)
174-
throw std::runtime_error(string_printf("demuxer %s length mismatch: pd %s has %u bytes, "
175-
"we need %u bytes\n", name.c_str(), pdin.name.c_str(), pdin.dev->length, act_len));
175+
throw std::runtime_error(string_printf("demuxer %s length mismatch: pd %s has %zu bytes, "
176+
"we need %zu bytes\n", name.c_str(), pdin.name.c_str(), pdin.dev->length, act_len));
176177

177178
size_t skip_len = 0;
178179
bool gen_abort = false;
@@ -362,8 +363,8 @@ void pdrouting::pd_mux::start() {
362363
act_len += input.len;
363364

364365
if (act_len > pdout.dev->length)
365-
throw std::runtime_error(string_printf("muxer %s length mismatch: pd %s has %u bytes, "
366-
"we need %u bytes\n", name.c_str(), pdout.name.c_str(), pdout.dev->length, act_len));
366+
throw std::runtime_error(string_printf("muxer %s length mismatch: pd %s has %zu bytes, "
367+
"we need %zu bytes\n", name.c_str(), pdout.name.c_str(), pdout.dev->length, act_len));
367368

368369
size_t skip_len = 0;
369370
bool gen_abort = false;

0 commit comments

Comments
 (0)