Debian Codegraph @

debian/patches/60_gcc14.patch

raw
1 Index: rplay/lib/tilde.c
2 Description: fix issues found by gcc14
3 ===================================================================
4 --- rplay.orig/lib/tilde.c 2024-08-09 22:05:42.791234018 +0200
5 +++ rplay/lib/tilde.c 2024-08-09 22:05:42.787234013 +0200
6 @@ -40,6 +40,8 @@
7 #include "tilde.h"
8 #include <sys/types.h>
9 #include <pwd.h>
10 +#include <unistd.h>
11 +#include <sys/types.h>
12
13 #if defined (USG) && !defined (HAVE_GETPW_DECLS)
14 extern struct passwd *getpwuid (), *getpwnam ();
15 Index: rplay/rplay/rplay.c
16 ===================================================================
17 --- rplay.orig/rplay/rplay.c 2024-08-09 22:05:42.791234018 +0200
18 +++ rplay/rplay/rplay.c 2024-08-09 22:05:42.787234013 +0200
19 @@ -35,6 +35,7 @@
20 #include <string.h>
21 #endif
22 #include <unistd.h>
23 +#include <time.h>
24 #include "rplay.h"
25 #include "getopt.h"
26
27 @@ -105,9 +106,9 @@
28 int buffer_size = BUFFER_SIZE;
29
30 #ifdef __STDC__
31 -main(int argc, char **argv)
32 +int main(int argc, char **argv)
33 #else
34 -main(argc, argv)
35 +int main(argc, argv)
36 int argc;
37 char **argv;
38 #endif
39 Index: rplay/rplayd/audio/audio_oss.c
40 ===================================================================
41 --- rplay.orig/rplayd/audio/audio_oss.c 2024-08-09 22:05:42.791234018 +0200
42 +++ rplay/rplayd/audio/audio_oss.c 2024-08-09 22:05:42.787234013 +0200
43 @@ -35,6 +35,12 @@
44 #include <sys/errno.h>
45 #include <errno.h>
46 #include <sys/soundcard.h>
47 +#include <string.h>
48 +#include <unistd.h>
49 +
50 +int rplay_audio_set_port();
51 +int rplay_audio_setfragsize(int);
52 +int rplay_audio_mixer_open();
53
54 /*
55 * External variables:
56 Index: rplay/rptp/rptp.c
57 ===================================================================
58 --- rplay.orig/rptp/rptp.c 2024-08-09 22:05:42.791234018 +0200
59 +++ rplay/rptp/rptp.c 2024-08-09 22:05:42.787234013 +0200
60 @@ -37,6 +37,8 @@
61 #endif /* HAVE_LIBREADLINE */
62 #include "rplay.h"
63 #include "getopt.h"
64 +#include <ctype.h>
65 +#include <unistd.h>
66
67 typedef struct
68 {
69 @@ -150,9 +152,9 @@
70 extern char *optarg;
71
72 #ifdef __STDC__
73 -main(int argc, char **argv)
74 +int main(int argc, char **argv)
75 #else
76 -main(argc, argv)
77 +int main(argc, argv)
78 int argc;
79 char **argv;
80 #endif
81 Index: rplay/adpcm/g721.c
82 ===================================================================
83 --- rplay.orig/adpcm/g721.c 2024-08-09 22:05:42.791234018 +0200
84 +++ rplay/adpcm/g721.c 2024-08-09 22:05:42.787234013 +0200
85 @@ -49,6 +49,7 @@
86 *
87 */
88 #include "g72x.h"
89 +#include "avoid-implicit.h"
90
91 static short qtab_721[7] = {-124, 80, 178, 246, 300, 349, 400};
92 /*
93 Index: rplay/configure.in
94 ===================================================================
95 --- rplay.orig/configure.in 2024-08-09 22:05:42.791234018 +0200
96 +++ rplay/configure.in 2024-08-10 19:36:29.918639005 +0200
97 @@ -17,7 +17,7 @@
98
99 echo configuring rplay version $RPLAY_VERSION
100 AC_SUBST(RPLAY_VERSION)
101 -AC_DEFINE_UNQUOTED([RPLAY_VERSION], [], "$RPLAY_VERSION")
102 +AC_DEFINE_UNQUOTED([RPLAY_VERSION], ["$RPLAY_VERSION"], "$RPLAY_VERSION")
103
104 # We want these before the checks, so the checks can modify their values.
105 test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
106 @@ -34,11 +34,11 @@
107 AC_ARG_ENABLE(rplayd-group, [ --enable-rplayd-group=GROUP], RPLAYD_GROUP=$enableval)
108 if test -n "$RPLAYD_USER"
109 then
110 -AC_DEFINE_UNQUOTED([RPLAYD_USER], [], "$RPLAYD_USER")
111 +AC_DEFINE_UNQUOTED([RPLAYD_USER], ["nobody"], "$RPLAYD_USER")
112 fi
113 if test -n "$RPLAYD_GROUP"
114 then
115 -AC_DEFINE_UNQUOTED([RPLAYD_GROUP], [], "$RPLAYD_GROUP")
116 +AC_DEFINE_UNQUOTED([RPLAYD_GROUP], ["audio"], "$RPLAYD_GROUP")
117 fi
118
119
120 @@ -242,6 +242,7 @@
121 if test $RPLAY_TARGET = "solaris"; then
122 AC_DEFINE([SVR4], [], "target is solaris")
123 fi
124 +DEFS=-DHAVE_CONFIG_H
125 AC_SUBST(DEFS)
126
127 dnl
128 @@ -258,6 +259,10 @@
129 oss|FreeBSD|generic) BUILD_TARGETS="$BUILD_TARGETS devrplay";;
130 esac
131
132 +dnl
133 +dnl add some autoheader stuff that should not be removed by autoheader
134 +AH_BOTTOM([#include <config-add-bottom.h>])
135 +
136 AC_SUBST(BUILD_TARGETS)
137
138 AC_OUTPUT(Makefile.config Makefile include/Makefile lib/Makefile adpcm/Makefile gsm/Makefile librplay/Makefile rplayd/Makefile rplay/Makefile rptp/Makefile doc/Makefile devrplay/Makefile)
139 Index: rplay/adpcm/avoid-implicit.h
140 ===================================================================
141 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
142 +++ rplay/adpcm/avoid-implicit.h 2024-08-09 22:05:42.787234013 +0200
143 @@ -0,0 +1,14 @@
144 +//XXX avoid implicit definitions:
145 +int alaw2linear(unsigned char);
146 +unsigned char linear2alaw(int);
147 +int ulaw2linear(unsigned char);
148 +unsigned char linear2ulaw(int);
149 +int predictor_zero(struct g72x_state *);
150 +int predictor_pole(struct g72x_state *);
151 +int step_size( struct g72x_state *);
152 +int quantize(int, int, short *, int);
153 +void update(int, int, int, int, int, int, int, struct g72x_state *);
154 +int tandem_adjust_alaw(int, int, int, int, int, short *);
155 +int tandem_adjust_ulaw(int, int, int, int, int, short *);
156 +int reconstruct(int, int, int);
157 +void g72x_init_state(struct g72x_state *);
158 Index: rplay/adpcm/g723_24.c
159 ===================================================================
160 --- rplay.orig/adpcm/g723_24.c 2024-08-09 22:05:42.791234018 +0200
161 +++ rplay/adpcm/g723_24.c 2024-08-09 22:05:42.787234013 +0200
162 @@ -38,6 +38,7 @@
163 *
164 */
165 #include "g72x.h"
166 +#include "avoid-implicit.h"
167
168 /*
169 * Maps G.723_24 code word to reconstructed scale factor normalized log
170 @@ -57,6 +58,8 @@
171
172 static short qtab_723_24[3] = {8, 218, 331};
173
174 +#include "avoid-implicit.h"
175 +
176 /*
177 * g723_24_encoder()
178 *
179 Index: rplay/librplay/rplay.c
180 ===================================================================
181 --- rplay.orig/librplay/rplay.c 2024-08-09 22:05:42.791234018 +0200
182 +++ rplay/librplay/rplay.c 2024-08-09 22:05:42.787234013 +0200
183 @@ -47,6 +47,7 @@
184 #ifdef HAVE_MEMORY_H
185 #include <memory.h>
186 #endif
187 +#include <time.h>
188
189 /* Make sure MAXHOSTNAMELEN is defined. */
190 #ifndef MAXHOSTNAMELEN
191 Index: rplay/adpcm/g723_40.c
192 ===================================================================
193 --- rplay.orig/adpcm/g723_40.c 2024-08-09 22:05:42.791234018 +0200
194 +++ rplay/adpcm/g723_40.c 2024-08-09 22:05:42.787234013 +0200
195 @@ -46,6 +46,7 @@
196 *
197 */
198 #include "g72x.h"
199 +#include "avoid-implicit.h"
200
201 /*
202 * Maps G.723_40 code word to ructeconstructed scale factor normalized log
203 Index: rplay/adpcm/g72x.c
204 ===================================================================
205 --- rplay.orig/adpcm/g72x.c 2024-08-09 22:05:42.791234018 +0200
206 +++ rplay/adpcm/g72x.c 2024-08-09 22:05:42.787234013 +0200
207 @@ -31,6 +31,8 @@
208 */
209
210 #include "g72x.h"
211 +#include "avoid-implicit.h"
212 +#include <stdlib.h>
213
214 static short power2[15] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80,
215 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000};
216 Index: rplay/include/config-add-bottom.h
217 ===================================================================
218 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
219 +++ rplay/include/config-add-bottom.h 2024-08-09 22:05:42.787234013 +0200
220 @@ -0,0 +1,273 @@
221 +/* $Id: config.h.in,v 1.4 1999/06/09 06:25:20 boyns Exp $ -*- c -*- */
222 +
223 +/*
224 + * Copyright (C) 1993-99 Mark R. Boyns <[email protected]>
225 + *
226 + * This file is part of rplay.
227 + *
228 + * rplay is free software; you can redistribute it and/or modify
229 + * it under the terms of the GNU General Public License as published by
230 + * the Free Software Foundation; either version 2 of the License, or
231 + * (at your option) any later version.
232 + *
233 + * rplay is distributed in the hope that it will be useful,
234 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
235 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
236 + * GNU General Public License for more details.
237 + *
238 + * You should have received a copy of the GNU General Public License
239 + * along with rplay; see the file COPYING. If not, write to the
240 + * Free Software Foundation, Inc.,
241 + * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
242 + */
243 +
244 +
245 +#ifndef _config_add_bottom_h
246 +#define _config_add_bottom_h
247 +
248 +#undef SVR4
249 +
250 +/*
251 + * rplayd user and group privs. (default unset)
252 + *
253 + * Example:
254 + * #define RPLAYD_USER "nobody"
255 + * #define RPLAYD_GROUP "audio"
256 + */
257 +#undef RPLAYD_USER
258 +#undef RPLAYD_GROUP
259 +
260 +/*
261 + * Use host authentication.
262 + */
263 +#define AUTH
264 +
265 +/*
266 + * Support rplay 2.0 packets. If you define this then you
267 + * should also define OLD_RPLAY_PORTS below.
268 + */
269 +#define OLD_RPLAY
270 +
271 +/*
272 + * Support older RPLAY port 55555 and RPTP port 55556.
273 + * This option really enables support for 2 RPLAY ports and 2 RPTP ports
274 + * which default to 5555/55555 for RPLAY and 5556/55556 for RPTP.
275 + */
276 +#define OTHER_RPLAY_PORTS
277 +
278 +/*
279 + * Maximum number of sounds that can be playing at once.
280 + */
281 +#define SPOOL_SIZE 12
282 +
283 +/*
284 + * The size of rplayd's internal sound hash table.
285 + */
286 +#define MAX_SOUNDS 4001 /* yes that is a prime number */
287 +
288 +/*
289 + * Should rplayd log by default?
290 + */
291 +/* #define RPLAYD_ALWAYS_LOG */
292 +
293 +/*
294 + * Define the default rplayd logging level:
295 + * 1 - System and rplayd errors.
296 + * 2 - + RPTP connections, get, put, find.
297 + * 3 - + play, stop, pause, continue, etc.
298 + * 4 - + Debug messages.
299 + *
300 + * Note that the logging level can also be specified with
301 + * rplayd command line options. This is only used if
302 + * RPLAYD_ALWAYS_LOG is defined above.
303 + */
304 +#define RPLAYD_LOG_LEVEL 1
305 +
306 +/*
307 + * By default, rplayd will never timeout. If you would rather
308 + * have rplayd exit after some period of idle time, change the zero
309 + * below to the appropriate number of seconds.
310 + *
311 + * NOTE: This value used to be 360 instead of 0.
312 + */
313 +#define RPLAYD_TIMEOUT 0 /* seconds */
314 +
315 +/*
316 + * Maximum size of the rplay.cache directory.
317 + *
318 + * The size you choose should at least be big enough to hold the
319 + * largest sound you plan on playing. Note that this is the disk
320 + * cache and not the memory cache which is mentioned below.
321 + */
322 +#define RPLAY_CACHE_SIZE (8*1024*1024)
323 +
324 +/*
325 + * Memory cache.
326 + *
327 + * Sounds are cached using mmap (if available) or malloc (no mmap).
328 + * Non-cached sounds are read piece by piece.
329 + *
330 + * MEMORY_CACHE_SOUND_SIZE - maximum size of a sound that can be cached in memory.
331 + * MEMORY_CACHE_SIZE - maximum size of the entire memory cache.
332 + *
333 + * Setting MEMORY_CACHE_SIZE=0 will disable the memory cache.
334 + */
335 +#define MEMORY_CACHE_SOUND_SIZE (2*1024*1024)
336 +#define MEMORY_CACHE_SIZE (4*1024*1024)
337 +
338 +/*
339 + * Delay time between RPTP server pings.
340 + */
341 +#define RPTP_PING_DELAY 5
342 +
343 +/*
344 + * Number of times to try and connect to an RPTP server.
345 + */
346 +#define RPTP_CONNECT_ATTEMPTS 3
347 +
348 +/*
349 + * Close RPTP connections after 300 idle seconds (disabled with zero).
350 + */
351 +#define RPTP_CONNECTION_TIMEOUT 300
352 +
353 +/*
354 + * Maximum number of RPTP client connections (disabled with zero).
355 + */
356 +#define RPTP_MAX_CONNECTIONS 16
357 +
358 +/*
359 + * Enable simulated hardware volume control.
360 + */
361 +/* #define FAKE_VOLUME */
362 +
363 +/*
364 + * Enable the automatic re-reading of rplayd's configuration files when
365 + * they are modified.
366 + */
367 +#define AUTO_REREAD
368 +
369 +/*
370 + * The maximum sample rate that rplayd will/can ever output.
371 + */
372 +#define MAX_SAMPLE_RATE 48000 /* 48000 Hz */
373 +
374 +/*
375 + * A list of directories that cannot be accessed to obtain sound files.
376 + * This feature can be disabled using `#undef BAD_DIRS'.
377 + */
378 +#define BAD_DIRS "/dev:/etc:/devices:/proc"
379 +
380 +#define HAVE_ADPCM
381 +#define HAVE_GSM
382 +#undef HAVE_CDROM
383 +#undef HAVE_CDDA
384 +
385 +#if defined (sun) && defined (SVR4) /* Solaris 2.x */
386 +#define HAVE_CDROM
387 +#define HAVE_CDDA
388 +#endif /* Solaris 2.x */
389 +
390 +#if defined (linux)
391 +#define HAVE_OSS
392 +#define HAVE_CDROM
393 +#endif
394 +
395 +#define HAVE_HELPERS
396 +
397 +/* Convert HAVE_ to HAS_ for gsm. See gsm/include/config.h.gsm */
398 +#ifdef HAVE_STDLIB_H
399 +#define HAS_STDLIB_H
400 +#endif
401 +
402 +#ifdef HAVE_LIMITS_H
403 +#define HAS_LIMITS_H
404 +#endif
405 +
406 +#ifdef HAVE_FCNTL_H
407 +#define HAS_FCNTL_H
408 +#endif
409 +
410 +#ifdef HAVE_FSTAT
411 +#define HAS_FSTAT
412 +#endif
413 +
414 +#ifdef HAVE_FCHOWN
415 +#define HAS_FCHOWN
416 +#endif
417 +
418 +#ifdef HAVE_STRING_H
419 +#define HAS_STRING_H
420 +#endif
421 +
422 +#ifdef HAVE_STRINGS_H
423 +#define HAS_STRINGS_H
424 +#endif
425 +
426 +#ifdef HAVE_UNISTD_H
427 +#define HAS_UNISTD_H
428 +#endif
429 +
430 +#ifdef HAVE_UTIME
431 +#define HAS_UTIME
432 +#endif
433 +
434 +#ifdef HAVE_UTIMES
435 +#define HAS_UTIMES
436 +#endif
437 +
438 +#ifdef HAVE_UTIME_H
439 +#define HAS_UTIMES_H
440 +#endif
441 +
442 +/*
443 + * Maximum UDP packet size.
444 + */
445 +#define MAX_PACKET 8192
446 +
447 +/*
448 + * Solaris 2.x using gcc or SunPro cc and HP-UX
449 + */
450 +#if (defined(sun) && (defined(__svr4__) || defined(SVR4))) || defined(__hpux)
451 +#ifndef HAVE_RANDOM
452 +#define random() lrand48()
453 +#endif
454 +#ifndef HAVE_SRANDOM
455 +#define srandom(x) srand48(x)
456 +#endif
457 +#endif
458 +
459 +#ifndef MIN
460 +#define MIN(a,b) (((a)<(b))?(a):(b))
461 +#endif
462 +
463 +#ifndef MAX
464 +#define MAX(a,b) (((a)>(b))?(a):(b))
465 +#endif
466 +
467 +#ifndef HAVE_MEMMOVE
468 +#define memmove(d, s, n) bcopy ((s), (d), (n))
469 +#endif
470 +
471 +#ifdef HAVE_SNPRINTF
472 +#define SNPRINTF snprintf
473 +#else
474 +#define SNPRINTF sprintf
475 +#endif
476 +
477 +#ifdef HAVE_VSNPRINTF
478 +#define VSNPRINTF vsnprintf
479 +#else
480 +#define VSNPRINTF vsprintf
481 +#endif
482 +
483 +#if defined(HAVE_SNPRINTF) || defined(HAVE_VSNPRINTF)
484 +#define SIZE(buf, n) buf,n
485 +#else
486 +#define SIZE(buf, n) buf
487 +#endif
488 +
489 +#ifndef RPLAY_VERSION
490 +#define RPLAY_VERSION ""
491 +#endif
492 +
493 +#endif /* _config_add_bottom_h */
494 Index: rplay/adpcm/decode.c
495 ===================================================================
496 --- rplay.orig/adpcm/decode.c 2024-08-09 22:05:42.791234018 +0200
497 +++ rplay/adpcm/decode.c 2024-08-09 22:05:42.787234013 +0200
498 @@ -6,8 +6,9 @@
499 * Usage : decode [-3|4|5] [-a|u|l] < infile > outfile
500 */
501 #include <stdio.h>
502 +#include <stdlib.h>
503 #include "g72x.h"
504 -
505 +#include "avoid-implicit.h"
506
507 /*
508 * Unpack input codes and pass them back as bytes.
509 @@ -37,7 +38,7 @@
510 }
511
512
513 -main(argc, argv)
514 +int main(argc, argv)
515 int argc;
516 char **argv;
517 {
518 Index: rplay/librplay/rptp.c
519 ===================================================================
520 --- rplay.orig/librplay/rptp.c 2024-08-09 22:05:42.791234018 +0200
521 +++ rplay/librplay/rptp.c 2024-08-09 22:05:42.787234013 +0200
522 @@ -45,6 +45,7 @@
523 #include <varargs.h>
524 #endif
525 #include <errno.h>
526 +#include <ctype.h>
527
528 int rptp_errno = RPTP_ERROR_NONE;
529
530 Index: rplay/contrib/mailsound/mailsound.c
531 ===================================================================
532 --- rplay.orig/contrib/mailsound/mailsound.c 2024-08-09 22:05:42.791234018 +0200
533 +++ rplay/contrib/mailsound/mailsound.c 2024-08-09 22:12:39.479586778 +0200
534 @@ -21,6 +21,11 @@
535 #include <string.h>
536 #include <rplay.h>
537 #include <pwd.h>
538 +#include <time.h>
539 +#include <unistd.h>
540 +#define _REGEX_RE_COMP
541 +#include <sys/types.h>
542 +#include <regex.h>
543
544 #define PUBLIC
545 #define PRIVATE static
546 @@ -38,8 +43,8 @@
547 */
548 PRIVATE void dump_state();
549 PRIVATE void parse_args(int ac, char **av, int size);
550 -PRIVATE compare(char *buffer, char *from, long size);
551 -PRIVATE play_sound(char *sound, long size);
552 +PRIVATE int compare(char *buffer, char *from, long size);
553 +PRIVATE int play_sound(char *sound, long size);
554
555 /* Private variables
556 * =================
557 @@ -68,11 +73,11 @@
558 */
559
560 /**************************************************************************
561 - * PUBLIC main(int ac, char **av)
562 + * PUBLIC int main(int ac, char **av)
563 * PURPOSE:
564 * None
565 */
566 -PUBLIC main(int ac, char **av)
567 +PUBLIC int main(int ac, char **av)
568 {
569 char buffer[1000];
570 char path[200];
571 @@ -86,7 +91,10 @@
572 * Read the first line of the message. This is what we will use
573 * to find out what sound to play.
574 */
575 - gets(buffer);
576 + //original version: gets(buffer);
577 + if (fgets(buffer, sizeof(buffer), stdin)) {
578 + buffer[strcspn(buffer, "\n")] = '\0';
579 + }
580 size = strlen(buffer) + 1;
581 if (!strtok(buffer, " "))
582 exit(1);
583 @@ -98,8 +106,10 @@
584 * We now need to read the rest of the message to determine its
585 * size.
586 */
587 - while (gets(buffer))
588 + //original version: while (gets(buffer))
589 + while (fgets(buffer, sizeof(buffer), stdin))
590 {
591 + buffer[strcspn(buffer, "\n")] = '\0';
592 if (strncmp(buffer, "Subject: ", 9) == 0)
593 {
594 strcpy(subject, buffer + 9);
595 @@ -140,13 +150,13 @@
596
597
598 /**************************************************************************
599 - * PRIVATE compare(char *buffer, char *from, long size)
600 + * PRIVATE int compare(char *buffer, char *from, long size)
601 * PURPOSE:
602 * None
603 * PARAMETERS:
604 * None
605 */
606 -PRIVATE compare(char *buffer, char *from, long size)
607 +PRIVATE int compare(char *buffer, char *from, long size)
608 {
609 char *pattern, *sound_args;
610 char *p;
611 @@ -166,13 +176,13 @@
612
613
614 /**************************************************************************
615 - * PRIVATE play_sound(char *sound_args, long size)
616 + * PRIVATE int play_sound(char *sound_args, long size)
617 * PURPOSE:
618 * None
619 * PARAMETERS:
620 * None
621 */
622 -PRIVATE play_sound(char *sound_args, long size)
623 +PRIVATE int play_sound(char *sound_args, long size)
624 {
625 int ac;
626 char *av[50];
627 Index: rplay/rplayd/cdrom.c
628 ===================================================================
629 --- rplay.orig/rplayd/cdrom.c 2024-08-09 22:05:42.791234018 +0200
630 +++ rplay/rplayd/cdrom.c 2024-08-09 22:05:42.787234013 +0200
631 @@ -35,6 +35,11 @@
632
633 #include <sys/types.h>
634 #include <sys/errno.h>
635 +#include <sys/ioctl.h>
636 +#include <sys/stat.h>
637 +#include <fcntl.h>
638 +#include <unistd.h>
639 +
640 #include "rplayd.h"
641 #include "cdrom.h"
642
643 Index: rplay/adpcm/encode.c
644 ===================================================================
645 --- rplay.orig/adpcm/encode.c 2024-08-09 22:05:42.791234018 +0200
646 +++ rplay/adpcm/encode.c 2024-08-09 22:05:42.787234013 +0200
647 @@ -6,8 +6,9 @@
648 * Usage : encode [-3|4|5] [-a|u|l] < infile > outfile
649 */
650 #include <stdio.h>
651 +#include <stdlib.h>
652 #include "g72x.h"
653 -
654 +#include "avoid-implicit.h"
655
656 /*
657 * Pack output codes into bytes and write them to stdout.
658 @@ -34,7 +35,7 @@
659 }
660
661
662 -main(argc, argv)
663 +int main(argc, argv)
664 int argc;
665 char **argv;
666 {
667 Index: rplay/rplayd/command.c
668 ===================================================================
669 --- rplay.orig/rplayd/command.c 2024-08-09 22:05:42.791234018 +0200
670 +++ rplay/rplayd/command.c 2024-08-09 22:05:42.787234013 +0200
671 @@ -116,6 +116,9 @@
672 static int command_monitor( /* CONNECTION *c, int argc, char **argv */ );
673 #endif
674
675 +void monitor_alloc();
676 +void monitor_cleanup();
677 +
678 #ifdef DEBUG
679 extern int command_die( /* CONNECTION *c, int argc, char **argv */ );
680 #endif
681 Index: rplay/rplayd/rplayd.c
682 ===================================================================
683 --- rplay.orig/rplayd/rplayd.c 2024-08-09 22:05:42.791234018 +0200
684 +++ rplay/rplayd/rplayd.c 2024-08-10 19:43:19.915025197 +0200
685 @@ -55,6 +55,8 @@
686 #endif
687 #include <pwd.h>
688 #include <grp.h>
689 +#include <time.h>
690 +#include <signal.h>
691 #include "rplayd.h"
692 #include "connection.h"
693 #include "spool.h"
694 @@ -302,6 +304,9 @@
695 static void reset();
696 static void audio_test();
697
698 +void monitor_cleanup();
699 +void helper_reread(char *);
700 +
701 #if defined(HAVE_CDROM) || defined(HAVE_HELPERS)
702 #ifdef __STDC__
703 void rplayd_pipe_read( /* fd_set *rfds */ );
704 @@ -317,9 +322,9 @@
705 #endif
706
707 #ifdef __STDC__
708 -main(int argc, char **argv)
709 +int main(int argc, char **argv)
710 #else
711 -main(argc, argv)
712 +int main(argc, argv)
713 int argc;
714 char **argv;
715 #endif
716 @@ -1396,7 +1401,7 @@
717 }
718 }
719
720 -monitor_alloc()
721 +void monitor_alloc()
722 {
723 if (!monitor_buffers)
724 {
725 @@ -1418,7 +1423,7 @@
726 monitor_update = 0;
727 }
728
729 -monitor_cleanup()
730 +void monitor_cleanup()
731 {
732 BUFFER *b, *b_next;
733
734 @@ -2046,7 +2051,7 @@
735 {
736 /* Ingore SIGPIPE since read will handle closed TCP connections.
737 Handle SIGHUP, SIGINT, and SIGCHLD. */
738 -#ifdef HAVE_SIGSET
739 +#ifdef XXX_DO_NOT_USE_HAVE_SIGSET
740 sigset(SIGPIPE, SIG_IGN);
741 sigset(SIGHUP, handle_sighup);
742 sigset(SIGINT, handle_sigint);
743 Index: rplay/rplayd/connection.c
744 ===================================================================
745 --- rplay.orig/rplayd/connection.c 2024-08-09 22:05:42.791234018 +0200
746 +++ rplay/rplayd/connection.c 2024-08-09 22:05:42.787234013 +0200
747 @@ -36,6 +36,8 @@
748 #else
749 #include <varargs.h>
750 #endif
751 +#include <time.h>
752 +#include <ctype.h>
753 #include "rplayd.h"
754 #include "connection.h"
755 #include "command.h"
756 Index: rplay/rplayd/helper.c
757 ===================================================================
758 --- rplay.orig/rplayd/helper.c 2024-08-09 22:05:42.727233963 +0200
759 +++ rplay/rplayd/helper.c 2024-08-09 22:12:24.939574939 +0200
760 @@ -39,6 +39,7 @@
761 #ifdef HAVE_STRING_H
762 #include <string.h>
763 #endif
764 +#include <time.h>
765 #include "rplayd.h"
766 #include "helper.h"
767 #include "misc.h"
768 Index: rplay/rplayd/host.c
769 ===================================================================
770 --- rplay.orig/rplayd/host.c 2024-08-09 22:05:42.727233963 +0200
771 +++ rplay/rplayd/host.c 2024-08-09 22:17:39.823831666 +0200
772 @@ -30,6 +30,7 @@
773 #ifdef HAVE_STRING_H
774 #include <string.h>
775 #endif
776 +#include <time.h>
777 #include "host.h"
778 #include "buffer.h"
779 #include "misc.h"
780 Index: rplay/rplayd/connection.h
781 ===================================================================
782 --- rplay.orig/rplayd/connection.h 2024-08-07 23:37:23.154353264 +0200
783 +++ rplay/rplayd/connection.h 2024-08-10 18:28:01.699308989 +0200
784 @@ -162,6 +162,7 @@
785 extern void connection_notify (CONNECTION *c, int wait_event,...);
786 extern void connection_flow_pause (SPOOL *sp);
787 extern void connection_flow_continue (SPOOL *sp);
788 +extern void connection_monitor_continue();
789 extern int connection_idle ();
790 extern EVENT *event_create (int event_type,...);
791 extern void event_first (CONNECTION *c, EVENT *e);
792 @@ -190,6 +191,7 @@
793 extern void connection_notify ( /* CONNECTION *c, int wait_event, ... */ );
794 extern void connection_flow_pause ( /* SPOOL *sp */ );
795 extern void connection_flow_continue ( /* SPOOL *sp */ );
796 +extern void connection_monitor_continue();
797 extern int connection_idle ();
798 extern EVENT *event_create ( /* int event_type, ... */ );
799 extern void event_first ( /* CONNECTION *c, EVENT *e */ );
800 Index: rplay/rplayd/server.c
801 ===================================================================
802 --- rplay.orig/rplayd/server.c 2024-08-07 23:37:23.158353269 +0200
803 +++ rplay/rplayd/server.c 2024-08-10 19:36:53.630659790 +0200
804 @@ -34,6 +34,7 @@
805 #ifdef HAVE_STRING_H
806 #include <string.h>
807 #endif
808 +#include <time.h>
809 #include "rplayd.h"
810 #include "server.h"
811 #include "connection.h"
812 Index: rplay/rplayd/sound.c
813 ===================================================================
814 --- rplay.orig/rplayd/sound.c 2024-08-09 22:05:42.727233963 +0200
815 +++ rplay/rplayd/sound.c 2024-08-10 19:46:09.963199964 +0200
816 @@ -77,6 +77,10 @@
817 #endif
818 #endif
819 #endif
820 +#include <time.h>
821 +
822 +void g72x_init_state(struct g72x_state *);
823 +int sound_free(SOUND *);
824
825 /* Make sure MAXPATHLEN is defined. */
826 #ifndef MAXPATHLEN
827 @@ -2188,7 +2192,7 @@
828
829 close(fds[0]);
830
831 -#ifdef HAVE_SIGSET
832 +#ifdef XXX_DO_NOT_USE_HAVE_SIGSET
833 sigset(SIGHUP, SIG_DFL);
834 sigset(SIGINT, SIG_DFL);
835 sigset(SIGCHLD, SIG_DFL);
836 Index: rplay/rplayd/spool.c
837 ===================================================================
838 --- rplay.orig/rplayd/spool.c 2024-08-09 22:05:42.727233963 +0200
839 +++ rplay/rplayd/spool.c 2024-08-10 19:50:04.151436286 +0200
840 @@ -42,6 +42,7 @@
841 #ifdef TEST_FLANGE
842 #include "flange.h"
843 #endif
844 +#include <time.h>
845
846 /* Make sure MAXPATHLEN is defined. */
847 #ifndef MAXPATHLEN
848 Index: rplay/rplayd/timer.c
849 ===================================================================
850 --- rplay.orig/rplayd/timer.c 2024-08-09 22:05:42.727233963 +0200
851 +++ rplay/rplayd/timer.c 2024-08-10 19:55:03.303731251 +0200
852 @@ -33,6 +33,8 @@
853 #include "rplayd.h"
854 #include "timer.h"
855
856 +int rplay_audio_getospace_bytes();
857 +
858 double timer_rate = 0.0;
859 double timer_count = 0.0;
860 int timer_enabled = 0;