chiark / gitweb /
Merge branch '5.2.x'
authorMark Wooding <mdw@distorted.org.uk>
Tue, 5 May 2020 22:18:08 +0000 (23:18 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 5 May 2020 22:18:08 +0000 (23:18 +0100)
* 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.

lib/printf.h
libtests/t-printf.c
server/schedule.c

index 9adb9ab40b4106bdc2fdd9467d2e8df6eaf717b5..1451fc249102aabacfc52cd44c97534fa1389c7c 100644 (file)
@@ -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 */
index d9c22afe2a88288deb70b0c92cadda3a12bf38d1..fbbf5e74648137b575e74df1730cc9f88eba07db 100644 (file)
@@ -15,6 +15,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#define INHIBIT_PRINTF_FORMAT_CHECKING
 #include "test.h"
 
 /* launder a string constant to stop gcc warnings */
index 219fc14b50de3f74179d9c0af61d4c713ef5e69c..520ae2e6e38736b8845e356611f909a7bd742ed3 100644 (file)
@@ -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);