fix lots of errors calling debug() with incorrect argument patterns.

This commit is contained in:
Mike Brady
2025-12-30 14:59:27 +00:00
parent b5f1157c1c
commit 3aa34cd712
12 changed files with 85 additions and 71 deletions
+17 -7
View File
@@ -708,10 +708,10 @@ int parse_options(int argc, char **argv) {
if (config_lookup_int(config.cfg, "general.port", &value)) {
if ((value < 0) || (value > 65535))
#ifdef CONFIG_AIRPLAY_2
die("Invalid port number \"%sd\". It should be between 0 and 65535, default is 7000",
die("Invalid port number \"%d\". It should be between 0 and 65535, default is 7000",
value);
#else
die("Invalid port number \"%sd\". It should be between 0 and 65535, default is 5000",
die("Invalid port number \"%d\". It should be between 0 and 65535, default is 5000",
value);
#endif
else
@@ -721,7 +721,7 @@ int parse_options(int argc, char **argv) {
/* Get the udp port base setting. */
if (config_lookup_int(config.cfg, "general.udp_port_base", &value)) {
if ((value < 0) || (value > 65535))
die("Invalid port number \"%sd\". It should be between 0 and 65535, default is 6001",
die("Invalid port number \"%d\". It should be between 0 and 65535, default is 6001",
value);
else
config.udp_port_base = value;
@@ -731,7 +731,7 @@ int parse_options(int argc, char **argv) {
* starting at the port base. Only three ports are needed. */
if (config_lookup_int(config.cfg, "general.udp_port_range", &value)) {
if ((value < 3) || (value > 65535))
die("Invalid port range \"%sd\". It should be between 3 and 65535, default is 10",
die("Invalid port range \"%d\". It should be between 3 and 65535, default is 10",
value);
else
config.udp_port_range = value;
@@ -896,7 +896,7 @@ int parse_options(int argc, char **argv) {
if ((dvalue >= 0.0) && (dvalue <= 3.0))
config.diagnostic_drop_packet_fraction = dvalue;
else
die("Invalid diagnostics drop_this_fraction_of_audio_packets setting \"%d\". It should "
die("Invalid diagnostics drop_this_fraction_of_audio_packets setting \"%f\". It should "
"be "
"between 0.0 and 1.0, "
"inclusive.",
@@ -1234,7 +1234,7 @@ int parse_options(int argc, char **argv) {
} else if (value < 60) {
warn("Invalid value \"%d\" for \"session_timeout\". It must be 0 (i.e. no timeout) or at "
"least 60. "
"The default of %f will be used instead.",
"The default of %d will be used instead.",
value, config.timeout);
config.dont_check_timeout = 0;
} else {
@@ -2024,6 +2024,12 @@ void termHandler(__attribute__((unused)) int k) {
void _display_config(const char *filename, const int linenumber, __attribute__((unused)) int argc,
__attribute__((unused)) char **argv) {
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-zero-length"
#endif
_inform(filename, linenumber, ">> Display Config Start.");
// see the man entry on popen
@@ -2202,7 +2208,11 @@ void _display_config(const char *filename, const int linenumber, __attribute__((
}
}
_inform(filename, linenumber, "");
_inform(filename, linenumber, ">> Display Config End.");
_inform(filename, linenumber, ">> Display Config End.");
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
}
#define display_config(argc, argv) _display_config(__FILE__, __LINE__, argc, argv)