From: Mark Wooding Date: Tue, 5 May 2020 22:18:08 +0000 (+0100) Subject: Merge branch '5.2.x' X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/commitdiff_plain/174d2af141dde3ef33fd69bc5a43338bee0895fa?hp=e58d874c65611b7d71659b15d8f536e4393bce22 Merge branch '5.2.x' * 5.2.x: server/schedule.c: Maintain separate variables for raw and resolved tracks. lib/printf.h, libtests/t-printf.c: Bodge to inhibit warning from GCC 9. --- diff --git a/lib/printf.h b/lib/printf.h index 9adb9ab..1451fc2 100644 --- a/lib/printf.h +++ b/lib/printf.h @@ -41,7 +41,10 @@ int byte_snprintf(char buffer[], size_t bufsize, const char *fmt, ...) - attribute((format (printf, 3, 4))); +#ifndef INHIBIT_PRINTF_FORMAT_CHECKING + attribute((format (printf, 3, 4))) +#endif + ; /* analogues of [v]snprintf */ int byte_vasprintf(char **ptrp, @@ -50,7 +53,10 @@ int byte_vasprintf(char **ptrp, int byte_asprintf(char **ptrp, const char *fmt, ...) - attribute((format (printf, 2, 3))); +#ifndef INHIBIT_PRINTF_FORMAT_CHECKING + attribute((format (printf, 2, 3))) +#endif + ; /* analogues of [v]asprintf (uses xmalloc/xrealloc) */ int byte_xvasprintf(char **ptrp, @@ -59,12 +65,18 @@ int byte_xvasprintf(char **ptrp, int byte_xasprintf(char **ptrp, const char *fmt, ...) - attribute((format (printf, 2, 3))); +#ifndef INHIBIT_PRINTF_FORMAT_CHECKING + attribute((format (printf, 2, 3))) +#endif + ; /* same but terminate on error */ int byte_vfprintf(FILE *fp, const char *fmt, va_list ap); int byte_fprintf(FILE *fp, const char *fmt, ...) - attribute((format (printf, 2, 3))); +#ifndef INHIBIT_PRINTF_FORMAT_CHECKING + attribute((format (printf, 2, 3))) +#endif + ; /* analogues of [v]fprintf */ #endif /* PRINTF_H */ diff --git a/libtests/t-printf.c b/libtests/t-printf.c index d9c22af..fbbf5e7 100644 --- a/libtests/t-printf.c +++ b/libtests/t-printf.c @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#define INHIBIT_PRINTF_FORMAT_CHECKING #include "test.h" /* launder a string constant to stop gcc warnings */ diff --git a/server/schedule.c b/server/schedule.c index 219fc14..520ae2e 100644 --- a/server/schedule.c +++ b/server/schedule.c @@ -359,6 +359,7 @@ static void schedule_play(ev_source *ev, const char *who, struct kvp *actiondata) { const char *track = kvp_get(actiondata, "track"); + const char *rtrack = 0; struct queue_entry *q; /* This stuff has rather a lot in common with c_play() */ @@ -370,12 +371,12 @@ static void schedule_play(ev_source *ev, disorder_error(0, "scheduled event %s: no such track as %s", id, track); return; } - if(!(track = trackdb_resolve(track))) { + if(!(rtrack = trackdb_resolve(track))) { disorder_error(0, "scheduled event %s: cannot resolve track %s", id, track); return; } - disorder_info("scheduled event %s: %s play %s", id, who, track); - q = queue_add(track, who, WHERE_START, NULL, origin_scheduled); + disorder_info("scheduled event %s: %s play %s", id, who, rtrack); + q = queue_add(rtrack, who, WHERE_START, NULL, origin_scheduled); queue_write(); if(q == qhead.next && playing) prepare(ev, q);