From cec00731f59893ba0851bc5eb2187037c7b21dbf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 15 Jul 2020 17:22:07 +0200 Subject: Fix conversion warnings --- src/plugin.c | 2 +- src/util.c | 2 +- src/world.c | 2 +- utils/lv2apply.c | 6 +++--- utils/lv2bench.c | 6 +++--- utils/lv2info.c | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/plugin.c b/src/plugin.c index 0924109..a6919d5 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -353,7 +353,7 @@ lilv_plugin_load_ports_if_necessary(const LilvPlugin* const_plugin) // Check sanity for (uint32_t i = 0; i < plugin->num_ports; ++i) { if (!plugin->ports[i]) { - LILV_ERRORF("Plugin <%s> is missing port %d/%d\n", + LILV_ERRORF("Plugin <%s> is missing port %u/%u\n", lilv_node_as_uri(plugin->plugin_uri), i, plugin->num_ports); lilv_plugin_free_ports(plugin); break; diff --git a/src/util.c b/src/util.c index 5ba450a..8758742 100644 --- a/src/util.c +++ b/src/util.c @@ -302,7 +302,7 @@ lilv_find_free_path(const char* in_path, char* path = (char*)malloc(in_path_len + 7); memcpy(path, in_path, in_path_len + 1); - for (int i = 2; i < 1000000; ++i) { + for (unsigned i = 2; i < 1000000u; ++i) { if (!exists(path, user_data)) { return path; } diff --git a/src/world.c b/src/world.c index cf859eb..fc4fc7e 100644 --- a/src/world.c +++ b/src/world.c @@ -345,7 +345,7 @@ const uint8_t* lilv_world_blank_node_prefix(LilvWorld* world) { static char str[32]; - snprintf(str, sizeof(str), "%d", world->n_read_files++); + snprintf(str, sizeof(str), "%u", world->n_read_files++); return (const uint8_t*)str; } diff --git a/utils/lv2apply.c b/utils/lv2apply.c index 14a5ff0..b130c9f 100644 --- a/utils/lv2apply.c +++ b/utils/lv2apply.c @@ -169,7 +169,7 @@ create_ports(LV2Apply* self) port->is_input = true; } else if (!lilv_port_is_a(self->plugin, lport, lv2_OutputPort) && !port->optional) { - return fatal(self, 1, "Port %d is neither input nor output\n", i); + return fatal(self, 1, "Port %u is neither input nor output\n", i); } /* Check if port is an audio or control port */ @@ -183,7 +183,7 @@ create_ports(LV2Apply* self) ++self->n_audio_out; } } else if (!port->optional) { - return fatal(self, 1, "Port %d has unsupported type\n", i); + return fatal(self, 1, "Port %u has unsupported type\n", i); } } @@ -296,7 +296,7 @@ main(int argc, char** argv) if (self.n_audio_in == 0 || (in_fmt.channels != (int)self.n_audio_in && in_fmt.channels != 1)) { - return fatal(&self, 6, "Unable to map %d inputs to %d ports\n", + return fatal(&self, 6, "Unable to map %d inputs to %u ports\n", in_fmt.channels, self.n_audio_in); } diff --git a/utils/lv2bench.c b/utils/lv2bench.c index 698bf71..2c22a3b 100644 --- a/utils/lv2bench.c +++ b/utils/lv2bench.c @@ -146,7 +146,7 @@ bench(const LilvPlugin* p, uint32_t sample_count, uint32_t block_size) } else if (lilv_port_is_a(p, port, lv2_OutputPort)) { lilv_instance_connect_port(instance, index, out); } else { - fprintf(stderr, "<%s> port %d neither input nor output, skipping\n", + fprintf(stderr, "<%s> port %u neither input nor output, skipping\n", uri, index); lilv_instance_free(instance); free(seq_out); @@ -162,7 +162,7 @@ bench(const LilvPlugin* p, uint32_t sample_count, uint32_t block_size) lilv_instance_connect_port(instance, index, seq_out); } } else { - fprintf(stderr, "<%s> port %d has unknown type, skipping\n", + fprintf(stderr, "<%s> port %u has unknown type, skipping\n", uri, index); lilv_instance_free(instance); free(seq_out); @@ -193,7 +193,7 @@ bench(const LilvPlugin* p, uint32_t sample_count, uint32_t block_size) uri_table_destroy(&uri_table); if (full_output) { - printf("%d %d ", block_size, sample_count); + printf("%u %u ", block_size, sample_count); } printf("%lf %s\n", elapsed, uri); diff --git a/utils/lv2info.c b/utils/lv2info.c index 7fed585..f4c5c3f 100644 --- a/utils/lv2info.c +++ b/utils/lv2info.c @@ -47,7 +47,7 @@ print_port(const LilvPlugin* p, { const LilvPort* port = lilv_plugin_get_port_by_index(p, index); - printf("\n\tPort %d:\n", index); + printf("\n\tPort %u:\n", index); if (!port) { printf("\t\tERROR: Illegal/nonexistent port\n"); @@ -183,7 +183,7 @@ print_plugin(LilvWorld* world, if (lilv_plugin_has_latency(p)) { uint32_t latency_port = lilv_plugin_get_latency_port_index(p); - printf("\tHas latency: yes, reported by port %d\n", latency_port); + printf("\tHas latency: yes, reported by port %u\n", latency_port); } else { printf("\tHas latency: no\n"); } -- cgit v1.2.1