Commit 4efbfc00d9907627c6ba2ec768edb6a1f2f3cec0

Thomas de Grivel 2024-06-17T11:07:57

fix compilation with clang

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
diff --git a/cli/rtbuf_cli.c b/cli/rtbuf_cli.c
index c253862..e8212c0 100644
--- a/cli/rtbuf_cli.c
+++ b/cli/rtbuf_cli.c
@@ -232,7 +232,7 @@ void * rtbuf_cli_run_thread_proc (void *arg)
   return 0;
 }
 
-int rtbuf_cli_start ()
+int rtbuf_cli_start (void)
 {
   if (!g_rtbuf_run && g_rtbuf_cli_run_thread) {
     if (pthread_join(g_rtbuf_cli_run_thread, 0))
@@ -255,7 +255,7 @@ int rtbuf_cli_start_ (int argc, const char *argv[])
   return rtbuf_cli_start();
 }
 
-int rtbuf_cli_stop ()
+int rtbuf_cli_stop (void)
 {
   if (g_rtbuf_run)
     g_rtbuf_run = 0;
@@ -355,7 +355,7 @@ void debug_read (int argc, const char **argv, f_cli f)
   }
 }
 
-void repl_init ()
+void repl_init (void)
 {
   cli_init(&g_cli);
   cli_prompt(&g_cli, "rtbuf> ");
@@ -374,7 +374,7 @@ int load (const char *path)
   return 0;
 }
 
-int repl ()
+int repl (void)
 {
   while (cli_read(&g_cli) >= 0) {
     /* debug_read(cli.argc, cli.argv, cli.f); */
@@ -383,7 +383,7 @@ int repl ()
   return 0;
 }
 
-int rtbuf_cli_do_event ()
+int rtbuf_cli_do_event (void)
 {
   if (cli_read_nonblocking(&g_cli) >= 0) {
     /* debug_read(cli.argc, cli.argv, cli.f); */
diff --git a/cli/rtbuf_cli.h b/cli/rtbuf_cli.h
index f5a57f7..6021ebc 100644
--- a/cli/rtbuf_cli.h
+++ b/cli/rtbuf_cli.h
@@ -22,14 +22,14 @@ extern f_rtbuf_position g_rtbuf_position_cb;
 extern pthread_t g_rtbuf_cli_run_thread;
 
 int rtbuf_cli_exit (int argc, const char *argv[]);
-void repl_init ();
+void repl_init (void);
 int load (const char *path);
-int repl ();
+int repl (void);
 void rtbuf_cli_args (int argc, char *argv[]);
 
-int rtbuf_cli_start ();
-int rtbuf_cli_stop ();
+int rtbuf_cli_start (void);
+int rtbuf_cli_stop (void);
 
-int rtbuf_cli_do_event ();
+int rtbuf_cli_do_event (void);
 
 #endif /* RTBUF_CLI_H */
diff --git a/gtk3/queue.c b/gtk3/queue.c
index 2830aa7..3aba9fa 100644
--- a/gtk3/queue.c
+++ b/gtk3/queue.c
@@ -32,7 +32,7 @@ void queue_destroy (s_queue *q)
   q->length = 0;
 }
 
-s_queue * queue_new ()
+s_queue * queue_new (void)
 {
   s_queue *q = malloc(sizeof(s_queue));
   if (q)
diff --git a/gtk3/queue.h b/gtk3/queue.h
index 10e5a01..a911547 100644
--- a/gtk3/queue.h
+++ b/gtk3/queue.h
@@ -26,7 +26,7 @@ struct queue {
 
 void      queue_init (s_queue *q);
 void      queue_destroy (s_queue *q);
-s_queue * queue_new ();
+s_queue * queue_new (void);
 void      queue_delete (s_queue *q);
 void      queue_enqueue (s_queue *q, void *item);
 void *    queue_dequeue (s_queue *q);
diff --git a/gtk3/rtbuf_gtk3.c b/gtk3/rtbuf_gtk3.c
index f010d16..771f842 100644
--- a/gtk3/rtbuf_gtk3.c
+++ b/gtk3/rtbuf_gtk3.c
@@ -178,7 +178,7 @@ void rtbuf_gtk_destroy (GtkWidget *widget, gpointer data)
   gtk_widget_destroy(widget);
 }
 
-void rtbuf_gtk_library_menu ()
+void rtbuf_gtk_library_menu (void)
 {
   if (!library_menu)
     library_menu = GTK_MENU(gtk_builder_get_object(builder,
@@ -393,7 +393,7 @@ void rtbuf_gtk_modular_stop (GtkWidget *widget, gpointer data)
   rtbuf_cli_stop();
 }
 
-void rtbuf_gtk_modular_toolbar ()
+void rtbuf_gtk_modular_toolbar (void)
 {
   GtkWidget *image;
   GtkToolItem *item;
@@ -417,7 +417,7 @@ void rtbuf_gtk_modular_toolbar ()
   gtk_toolbar_insert(modular_toolbar, item, -1);
 }
 
-void rtbuf_gtk_modular ()
+void rtbuf_gtk_modular (void)
 {
   GObject *button;
 
@@ -446,10 +446,10 @@ void rtbuf_gtk_modular ()
                    G_CALLBACK(rtbuf_gtk_modular_motion), NULL);
 }
 
-int rtbuf_gtk_builder ()
+int rtbuf_gtk_builder (void)
 {
   GError *error = NULL;
-  builder = gtk_builder_new ();
+  builder = gtk_builder_new();
   if (gtk_builder_add_from_resource(builder, "/rtbuf/rtbuf_gtk3_modular.ui",
                                     &error) == 0) {
     g_printerr("Error loading resource /rtbuf/rtbuf_gtk3_modular.ui: %s\n",
@@ -460,13 +460,13 @@ int rtbuf_gtk_builder ()
   return 0;
 }
 
-void rtbuf_gtk_lock ()
+void rtbuf_gtk_lock (void)
 {
   if (pthread_equal(pthread_self(), g_rtbuf_cli_run_thread))
     g_mutex_lock(&g_mutex);
 }
 
-void rtbuf_gtk_unlock ()
+void rtbuf_gtk_unlock (void)
 {
   if (pthread_equal(pthread_self(), g_rtbuf_cli_run_thread))
     g_mutex_unlock(&g_mutex);
diff --git a/gtk3/rtbuf_gtk3_connection.c b/gtk3/rtbuf_gtk3_connection.c
index 96dbd09..4f087d5 100644
--- a/gtk3/rtbuf_gtk3_connection.c
+++ b/gtk3/rtbuf_gtk3_connection.c
@@ -21,14 +21,14 @@ s_data_type g_rtbuf_gtk_connection_type = {
 };
 s_data_alloc g_rtbuf_gtk_connection_alloc;
 
-void rtbuf_gtk_connection_init ()
+void rtbuf_gtk_connection_init (void)
 {
   data_alloc_init(&g_rtbuf_gtk_connection_alloc,
                   &g_rtbuf_gtk_connection_type,
                   RTBUF_MAX * 10, NULL, NULL);
 }
 
-s_rtbuf_gtk_connection * rtbuf_gtk_connection_new ()
+s_rtbuf_gtk_connection * rtbuf_gtk_connection_new (void)
 {
   s_rtbuf_gtk_connection *connection = data_new(&g_rtbuf_gtk_connection_alloc);
   return connection;
diff --git a/gtk3/rtbuf_gtk3_connection.h b/gtk3/rtbuf_gtk3_connection.h
index cac9abd..85fe7d7 100644
--- a/gtk3/rtbuf_gtk3_connection.h
+++ b/gtk3/rtbuf_gtk3_connection.h
@@ -25,8 +25,8 @@ struct rtbuf_gtk_connection {
   s_rtbuf_gtk_connection *next;
 };
 
-void rtbuf_gtk_connection_init ();
-s_rtbuf_gtk_connection * rtbuf_gtk_connection_new ();
+void rtbuf_gtk_connection_init (void);
+s_rtbuf_gtk_connection * rtbuf_gtk_connection_new (void);
 void rtbuf_gtk_connection_delete (s_rtbuf_gtk_connection *connection);
 
 void rtbuf_gtk_connection_push (s_rtbuf_gtk_connection **head,
diff --git a/gtk3/rtbuf_gtk3_library.c b/gtk3/rtbuf_gtk3_library.c
index 193c81e..3424817 100644
--- a/gtk3/rtbuf_gtk3_library.c
+++ b/gtk3/rtbuf_gtk3_library.c
@@ -189,7 +189,7 @@ void rtbuf_gtk_library_load_directory (const char *path, size_t prefix_len)
   }
 }
 
-void rtbuf_gtk_library_load ()
+void rtbuf_gtk_library_load (void)
 {
   char **path = g_rtbuf_lib_path;
   if (g_rtbuf_gtk_library_tree) {
diff --git a/gtk3/rtbuf_gtk3_library.h b/gtk3/rtbuf_gtk3_library.h
index d00c504..021a27f 100644
--- a/gtk3/rtbuf_gtk3_library.h
+++ b/gtk3/rtbuf_gtk3_library.h
@@ -28,6 +28,6 @@ struct rtbuf_gtk_library_tree {
 
 extern s_rtbuf_gtk_library_tree *g_rtbuf_gtk_library_tree;
 
-void rtbuf_gtk_library_load ();
+void rtbuf_gtk_library_load (void);
 
 #endif /* RTBUF_GTK_LIBRARY_H */
diff --git a/gtk3/rtbuf_gtk3_rtbuf_info.c b/gtk3/rtbuf_gtk3_rtbuf_info.c
index 78d013c..47f7433 100644
--- a/gtk3/rtbuf_gtk3_rtbuf_info.c
+++ b/gtk3/rtbuf_gtk3_rtbuf_info.c
@@ -22,14 +22,14 @@ s_data_type  g_rtbuf_gtk_rtbuf_info_type = {
 
 s_data_alloc g_rtbuf_gtk_rtbuf_info_alloc;
 
-void rtbuf_gtk_rtbuf_info_init ()
+void rtbuf_gtk_rtbuf_info_init (void)
 {
   data_alloc_init(&g_rtbuf_gtk_rtbuf_info_alloc,
                   &g_rtbuf_gtk_rtbuf_info_type,
                   RTBUF_MAX, 0, 0);
 }
 
-s_rtbuf_gtk_rtbuf_info *rtbuf_gtk_rtbuf_info_new ()
+s_rtbuf_gtk_rtbuf_info *rtbuf_gtk_rtbuf_info_new (void)
 {
   s_rtbuf_gtk_rtbuf_info *info =
     data_new(&g_rtbuf_gtk_rtbuf_info_alloc);
diff --git a/gtk3/rtbuf_gtk3_rtbuf_info.h b/gtk3/rtbuf_gtk3_rtbuf_info.h
index e026ded..a07f3d5 100644
--- a/gtk3/rtbuf_gtk3_rtbuf_info.h
+++ b/gtk3/rtbuf_gtk3_rtbuf_info.h
@@ -26,8 +26,8 @@ typedef struct rtbuf_gtk_rtbuf_info {
   RtbufOutputWidget *out[RTBUF_PROC_OUT_MAX];
 } s_rtbuf_gtk_rtbuf_info;
 
-void rtbuf_gtk_rtbuf_info_init ();
-s_rtbuf_gtk_rtbuf_info *rtbuf_gtk_rtbuf_info_new ();
+void rtbuf_gtk_rtbuf_info_init (void);
+s_rtbuf_gtk_rtbuf_info *rtbuf_gtk_rtbuf_info_new (void);
 void rtbuf_gtk_rtbuf_info_delete (s_rtbuf_gtk_rtbuf_info *info);
 
 #endif /* RTBUF_GTK_RTBUF_INFO_H */
diff --git a/lib/music.c b/lib/music.c
index 57f34c5..403b4e3 100644
--- a/lib/music.c
+++ b/lib/music.c
@@ -20,7 +20,7 @@
 int    g_rtbuf_music_init = 0;
 double g_rtbuf_music_tune = 0.0;
 
-int rtbuf_music_init ()
+int rtbuf_music_init (void)
 {
   double tune_c;
   if (g_rtbuf_music_init)
diff --git a/lib/music.h b/lib/music.h
index 7b59a7e..7399ce4 100644
--- a/lib/music.h
+++ b/lib/music.h
@@ -73,7 +73,7 @@ typedef struct rtbuf_music_notes {
 #define RTBUF_MUSIC_NOTES_SIZE sizeof(unsigned int)
 #define RTBUF_MUSIC_NOTES_TYPE "music_notes"
 
-int  rtbuf_music_init ();
+int  rtbuf_music_init (void);
 void rtbuf_music_notes_init (s_rtbuf_music_notes *notes);
 int  rtbuf_music_notes_new (s_rtbuf_music_notes *notes, double velocity);
 void rtbuf_music_notes_delete (s_rtbuf_music_notes *notes,
diff --git a/lib/music_type.c b/lib/music_type.c
index 1666c5e..a45cb35 100644
--- a/lib/music_type.c
+++ b/lib/music_type.c
@@ -15,7 +15,7 @@
 #include "../librtbuf/rtbuf.h"
 #include "music.h"
 
-void notes_in ()
+void notes_in (void)
 {
   unsigned int i = 0;
   const char *st = "RTBUF_SIGNAL_SAMPLE_TYPE";
@@ -50,7 +50,7 @@ void notes_in ()
   }
 }
 
-void notes_out ()
+void notes_out (void)
 {
   unsigned int i = 0;
   const char *st = "RTBUF_SIGNAL_SAMPLE_TYPE";
@@ -70,7 +70,7 @@ void notes_out ()
   }
 }
 
-int main ()
+int main (void)
 {
   printf("/* file generated by rtbuf_music_type */\n");
   printf("#ifndef RTBUF_MUSIC_TYPE_H\n"
diff --git a/lib/portaudio/config.c b/lib/portaudio/config.c
index 6b2b48e..a57f3ea 100644
--- a/lib/portaudio/config.c
+++ b/lib/portaudio/config.c
@@ -13,7 +13,7 @@
  */
 #include <portaudio.h>
 
-int main ()
+int main (void)
 {
   return 0;
 }
diff --git a/lib/portaudio_type.c b/lib/portaudio_type.c
index 0a6e41e..0741069 100644
--- a/lib/portaudio_type.c
+++ b/lib/portaudio_type.c
@@ -15,7 +15,7 @@
 #include "../librtbuf/rtbuf.h"
 #include "portaudio.h"
 
-int main ()
+int main (void)
 {
   printf("/* file generated by rtbuf_portaudio_type */\n");
   printf("#ifndef RTBUF_PORTAUDIO_TYPE_H\n"
diff --git a/lib/reverb_type.c b/lib/reverb_type.c
index 0804c41..8f96a48 100644
--- a/lib/reverb_type.c
+++ b/lib/reverb_type.c
@@ -15,7 +15,7 @@
 #include "../librtbuf/rtbuf.h"
 #include "reverb.h"
 
-int main ()
+int main (void)
 {
   printf("/* file generated by rtbuf_reverb_type */\n");
   printf("#ifndef RTBUF_REVERB_TYPE_H\n"
diff --git a/lib/signal_type.c b/lib/signal_type.c
index 14c5f6a..f218c5a 100644
--- a/lib/signal_type.c
+++ b/lib/signal_type.c
@@ -15,7 +15,7 @@
 #include "../librtbuf/rtbuf.h"
 #include "signal.h"
 
-int main ()
+int main (void)
 {
   printf("/* file generated by rtbuf_signal_type */\n");
   printf("#ifndef RTBUF_SIGNAL_TYPE_H\n"
diff --git a/lib/sndio/check_sndio.c b/lib/sndio/check_sndio.c
index 3b13449..cbc5e92 100644
--- a/lib/sndio/check_sndio.c
+++ b/lib/sndio/check_sndio.c
@@ -13,7 +13,7 @@
  */
 #include <sndio.h>
 
-int main ()
+int main (void)
 {
   struct sio_hdl *sio_hdl = sio_open(SIO_DEVANY, SIO_PLAY, 0);
   sio_close(sio_hdl);
diff --git a/lib/sndio/config.c b/lib/sndio/config.c
index 8a3e3af..4c761de 100644
--- a/lib/sndio/config.c
+++ b/lib/sndio/config.c
@@ -13,7 +13,7 @@
  */
 #include <sndio.h>
 
-int main ()
+int main (void)
 {
   return 0;
 }
diff --git a/lib/sndio_type.c b/lib/sndio_type.c
index 2a179ee..5d5e6b3 100644
--- a/lib/sndio_type.c
+++ b/lib/sndio_type.c
@@ -15,7 +15,7 @@
 #include "../librtbuf/rtbuf.h"
 #include "sndio.h"
 
-int main ()
+int main (void)
 {
   printf("/* file generated by rtbuf_sndio_type */\n");
   printf("#ifndef RTBUF_SNDIO_TYPE_H\n"
diff --git a/lib/synth_type.c b/lib/synth_type.c
index 3676d9c..713c78e 100644
--- a/lib/synth_type.c
+++ b/lib/synth_type.c
@@ -16,7 +16,7 @@
 #include "music.h"
 #include "music_type.h"
 
-void notes_in ()
+void notes_in (void)
 {
   unsigned int i = 0;
   const char *st = "RTBUF_SIGNAL_TYPE";
@@ -43,7 +43,7 @@ void notes_in ()
   }
 }
 
-int main ()
+int main (void)
 {
   printf("/* file generated by rtbuf_synth_type */\n");
   printf("#ifndef RTBUF_SYNTH_TYPE_H\n"
diff --git a/librtbuf/data.c b/librtbuf/data.c
index a5b67fa..11ea609 100644
--- a/librtbuf/data.c
+++ b/librtbuf/data.c
@@ -30,7 +30,7 @@ s_data_type g_data_type_type = {
 s_data_alloc *g_data_type_alloc = NULL;
 u_data_type *g_data_type = NULL;
 
-int libdata_init ()
+int libdata_init (void)
 {
   data_alloc_init(&g_data_alloc_alloc, &g_data_alloc_type,
                   DATA_ALLOC_MAX, 0, (f_data_clean*) data_alloc_clean);
@@ -42,7 +42,7 @@ int libdata_init ()
   return 0;
 }
 
-void libdata_shutdown ()
+void libdata_shutdown (void)
 {
   if (g_data_alloc) {
     data_alloc_delete_all();
@@ -150,7 +150,7 @@ void data_alloc_delete (s_data_alloc *da)
   data_delete(&g_data_alloc_alloc, da);
 }
 
-void data_alloc_delete_all ()
+void data_alloc_delete_all (void)
 {
   unsigned i = 0;
   int n = g_data_alloc_alloc.n;
diff --git a/librtbuf/data.h b/librtbuf/data.h
index b2c08e9..0967c40 100644
--- a/librtbuf/data.h
+++ b/librtbuf/data.h
@@ -92,9 +92,9 @@ s_data_alloc * data_alloc_new (s_data_type *t,
                                unsigned int max, f_data_init *init,
                                f_data_clean *clean);
 void           data_alloc_delete (s_data_alloc *da);
-void           data_alloc_delete_all ();
+void           data_alloc_delete_all (void);
 
-int libdata_init ();
-void libdata_shutdown ();
+int libdata_init (void);
+void libdata_shutdown (void);
 
 #endif
diff --git a/librtbuf/lib.h b/librtbuf/lib.h
index d4bcf55..2418d0c 100644
--- a/librtbuf/lib.h
+++ b/librtbuf/lib.h
@@ -88,12 +88,12 @@ extern s_data_alloc g_rtbuf_lib_alloc;
 extern s_rtbuf_lib *g_rtbuf_lib;
 
 void          rtbuf_lib_delete (s_rtbuf_lib *rl);
-void          rtbuf_lib_delete_all ();
+void          rtbuf_lib_delete_all (void);
 int           rtbuf_lib_find (const char *str);
-void          rtbuf_lib_init_ ();
-void          rtbuf_lib_shutdown ();
+void          rtbuf_lib_init_ (void);
+void          rtbuf_lib_shutdown (void);
 s_rtbuf_lib * rtbuf_lib_load (const char *path);
-s_rtbuf_lib * rtbuf_lib_new ();
+s_rtbuf_lib * rtbuf_lib_new (void);
 void          rtbuf_lib_print (const s_rtbuf_lib *lib);
 void          rtbuf_lib_print_long (unsigned int i);
 
diff --git a/librtbuf/proc.h b/librtbuf/proc.h
index d9962da..702dc37 100644
--- a/librtbuf/proc.h
+++ b/librtbuf/proc.h
@@ -61,14 +61,14 @@ extern s_data_alloc  g_rtbuf_proc_alloc;
 extern s_rtbuf_proc *g_rtbuf_proc;
 
 void           rtbuf_proc_delete (s_rtbuf_proc *proc);
-void           rtbuf_proc_delete_all ();
+void           rtbuf_proc_delete_all (void);
 s_rtbuf_proc * rtbuf_proc_find (const char *x);
-void           rtbuf_proc_init ();
-s_rtbuf_proc * rtbuf_proc_new ();
+void           rtbuf_proc_init (void);
+s_rtbuf_proc * rtbuf_proc_new (void);
 int            rtbuf_proc_out_find (s_rtbuf_proc *proc,
                                     const char *name);
 int            rtbuf_proc_p (s_rtbuf_proc *proc);
 void           rtbuf_proc_print (s_rtbuf_proc *proc);
-void           rtbuf_proc_shutdown ();
+void           rtbuf_proc_shutdown (void);
 
 #endif
diff --git a/librtbuf/rtbuf.c b/librtbuf/rtbuf.c
index 402f907..5be276b 100644
--- a/librtbuf/rtbuf.c
+++ b/librtbuf/rtbuf.c
@@ -44,7 +44,7 @@ f_rtbuf_delete_cb g_rtbuf_delete_cb = 0;
 f_rtbuf_bind_cb   g_rtbuf_bind_cb = 0;
 f_rtbuf_unbind_cb g_rtbuf_unbind_cb = 0;
 
-int librtbuf_init ()
+int librtbuf_init (void)
 {
   libdata_init();
   bzero(g_rtbuf_sorted, sizeof(g_rtbuf_sorted));
@@ -58,7 +58,7 @@ int librtbuf_init ()
   return 0;
 }
 
-void librtbuf_shutdown ()
+void librtbuf_shutdown (void)
 {
   rtbuf_var_shutdown();
   rtbuf_lib_shutdown();
@@ -207,7 +207,7 @@ void rtbuf_unbind_all_out (s_rtbuf *rtb)
   assert(g_rtbuf <= rtb);
   assert(rtb < g_rtbuf + RTBUF_MAX);
   rtb_i = rtb - g_rtbuf;
-  while (i < g_rtbuf_alloc.n && rtb->refc) {
+  while (i < g_rtbuf_alloc.n && n && rtb->refc) {
     if (g_rtbuf[i].data) {
       rtbuf_unbind_all_out_rtbuf(rtb, rtb_i, &g_rtbuf[i]);
       n--;
@@ -357,17 +357,17 @@ void rtbuf_find_roots (s_rtbuf_in_stack *rvs)
   s_rtbuf *rtb = g_rtbuf;
   unsigned int i = 0;
   unsigned int n = g_rtbuf_alloc.n - g_rtbuf_alloc.free_n;
-  unsigned int c = 0;
-  /* printf("rtbuf_find_roots\n"); */
-  while (i < g_rtbuf_alloc.n && n > 0) {
-    /* printf(" rtbuf_find_roots %u %u\n", i, n); */
+  // unsigned int c = 0;
+  // printf("rtbuf_find_roots\n");
+  while (i < g_rtbuf_alloc.n && n) {
+    // printf(" rtbuf_find_roots %u %u\n", i, n);
     if (rtb->data) {
       if (rtb->flags & RTBUF_DELETE)
         rtbuf_delete_(rtb);
       else {
         if (rtb->refc == 0) {
           rtbuf_in_stack_push(rvs, i, 0);
-          c++;
+          // c++;
         }
       }
       n--;
@@ -375,7 +375,7 @@ void rtbuf_find_roots (s_rtbuf_in_stack *rvs)
     rtb++;
     i++;
   }
-  /* printf(" rtbuf_find_roots => %u\n", c); */
+  // printf(" rtbuf_find_roots => %u\n", c);
 }
 
 /* XXX needs rewrite */
@@ -406,7 +406,7 @@ void rtbuf_sort_push_child (s_rtbuf_in_stack *rvs,
 }
 
 /* XXX needs rewrite */
-void rtbuf_sort ()
+void rtbuf_sort (void)
 {
   s_rtbuf_in_stack rvs;
   s_rtbuf_in_ptr *ptr;
@@ -428,7 +428,7 @@ void rtbuf_sort ()
   rtbuf_print_sorted();
 }
 
-int rtbuf_start ()
+int rtbuf_start (void)
 {
   unsigned int i = 0;
   /* printf("rtbuf_start\n"); */
@@ -452,7 +452,7 @@ int rtbuf_start ()
   return 0;
 }
 
-int rtbuf_run ()
+int rtbuf_run (void)
 {
   unsigned int i = 0;
   /* printf("rtbuf_run\n"); */
@@ -484,7 +484,7 @@ int rtbuf_run ()
   return 0;
 }
 
-void rtbuf_stop ()
+void rtbuf_stop (void)
 {
   unsigned int i = 0;
   /* printf("rtbuf_stop\n"); */
@@ -635,7 +635,7 @@ void rtbuf_print_long (const s_rtbuf *rtbuf)
   fflush(stdout);
 }
 
-void rtbuf_print_sorted ()
+void rtbuf_print_sorted (void)
 {
   unsigned int i = 0;
   while (i < g_rtbuf_sorted_n) {
diff --git a/librtbuf/rtbuf.h b/librtbuf/rtbuf.h
index 6a00531..1f232d4 100644
--- a/librtbuf/rtbuf.h
+++ b/librtbuf/rtbuf.h
@@ -168,7 +168,7 @@ extern f_rtbuf_unbind_cb g_rtbuf_unbind_cb;
  *
  * @sa librtbuf_shutdown
  */
-int librtbuf_init ();
+int librtbuf_init (void);
 
 /**
  * @brief Shutdown librtbuf.
@@ -178,7 +178,7 @@ int librtbuf_init ();
  *
  * @sa librtbuf_init
  */
-void librtbuf_shutdown ();
+void librtbuf_shutdown (void);
 
 int rtbuf_err (const char *msg);
 
@@ -220,13 +220,13 @@ void  rtbuf_bind (unsigned int src, unsigned int out,
 int   rtbuf_out_find (s_rtbuf *rtb, symbol sym);
 int   rtbuf_data_set (s_rtbuf *rtb, symbol name, void *value,
                       unsigned int size);
-void  rtbuf_sort ();
-int   rtbuf_start ();
-int   rtbuf_run ();
-void  rtbuf_stop ();
+void  rtbuf_sort (void);
+int   rtbuf_start (void);
+int   rtbuf_run (void);
+void  rtbuf_stop (void);
 void  rtbuf_print (const s_rtbuf *rtbuf);
 void  rtbuf_print_long (const s_rtbuf *rtbuf);
-void  rtbuf_print_sorted ();
+void  rtbuf_print_sorted (void);
 
 int  rtbuf_out_int (s_rtbuf *rtb, unsigned int out, int default_value);
 
diff --git a/librtbuf/rtbuf_lib.c b/librtbuf/rtbuf_lib.c
index 9e56aa1..3f7ad1c 100644
--- a/librtbuf/rtbuf_lib.c
+++ b/librtbuf/rtbuf_lib.c
@@ -35,7 +35,7 @@ char *g_rtbuf_lib_path[] = { "./lib/",
                              RTBUF_LIBDIR "/",
                              0 };
 
-void rtbuf_lib_init_ ()
+void rtbuf_lib_init_ (void)
 {
   char *in = getenv("HOME");
   char *out = g_rtbuf_lib_user_dir;
@@ -53,7 +53,7 @@ void rtbuf_lib_init_ ()
   *out = 0;
 }
 
-void rtbuf_lib_shutdown ()
+void rtbuf_lib_shutdown (void)
 {
   if (g_rtbuf_lib) {
     rtbuf_lib_delete_all();
@@ -91,7 +91,7 @@ int rtbuf_lib_find (const char *str)
   return -1;
 }
 
-s_rtbuf_lib * rtbuf_lib_new ()
+s_rtbuf_lib * rtbuf_lib_new (void)
 {
   s_rtbuf_lib *lib = data_new(&g_rtbuf_lib_alloc);
   return lib;
@@ -110,7 +110,7 @@ void rtbuf_lib_delete (s_rtbuf_lib *rl)
   data_delete(&g_rtbuf_lib_alloc, rl);
 }
 
-void rtbuf_lib_delete_all ()
+void rtbuf_lib_delete_all (void)
 {
   unsigned i = 0;
   int n = g_rtbuf_lib_alloc.n;
diff --git a/librtbuf/rtbuf_proc.c b/librtbuf/rtbuf_proc.c
index fddc1c4..8e2990e 100644
--- a/librtbuf/rtbuf_proc.c
+++ b/librtbuf/rtbuf_proc.c
@@ -26,7 +26,7 @@ s_data_type g_rtbuf_proc_type = {
 s_data_alloc g_rtbuf_proc_alloc;
 s_rtbuf_proc *g_rtbuf_proc;
 
-void rtbuf_proc_init ()
+void rtbuf_proc_init (void)
 {
   data_alloc_init(&g_rtbuf_proc_alloc, &g_rtbuf_proc_type,
                   RTBUF_PROC_MAX, 0, 0);
@@ -34,7 +34,7 @@ void rtbuf_proc_init ()
   assert(g_rtbuf_proc);
 }
 
-void rtbuf_proc_shutdown ()
+void rtbuf_proc_shutdown (void)
 {
   if (g_rtbuf_proc) {
     rtbuf_proc_delete_all();
@@ -48,7 +48,7 @@ int rtbuf_proc_p (s_rtbuf_proc *proc)
   return proc && proc->name;
 }
 
-s_rtbuf_proc * rtbuf_proc_new ()
+s_rtbuf_proc * rtbuf_proc_new (void)
 {
   s_rtbuf_proc *rf = data_new(&g_rtbuf_proc_alloc);
   return rf;
@@ -60,7 +60,7 @@ void rtbuf_proc_delete (s_rtbuf_proc *proc)
   data_delete(&g_rtbuf_proc_alloc, proc);
 }
 
-void rtbuf_proc_delete_all ()
+void rtbuf_proc_delete_all (void)
 {
   unsigned i = 0;
   int n = g_rtbuf_proc_alloc.n;
diff --git a/librtbuf/rtbuf_type.c b/librtbuf/rtbuf_type.c
index ab3f635..8abee1a 100644
--- a/librtbuf/rtbuf_type.c
+++ b/librtbuf/rtbuf_type.c
@@ -26,7 +26,7 @@ s_data_type   g_rtbuf_data_type_type = {
 s_data_alloc  g_rtbuf_data_type_alloc;
 s_rtbuf_type *g_rtbuf_data_type;
 
-void rtbuf_type_init ()
+void rtbuf_type_init (void)
 {
   data_alloc_init(&g_rtbuf_data_type_alloc, &g_rtbuf_data_type_type,
                   RTBUF_TYPE_MAX, 0, 0);
@@ -44,7 +44,7 @@ void rtbuf_type_init ()
   rtbuf_type_define("double"        , sizeof(double));
 }
 
-void rtbuf_type_shutdown ()
+void rtbuf_type_shutdown (void)
 {
   if (g_rtbuf_data_type) {
     rtbuf_type_delete_all();
@@ -70,7 +70,7 @@ void rtbuf_type_delete (s_rtbuf_type *rt)
   data_delete(&g_rtbuf_data_type_alloc, rt);
 }
 
-void rtbuf_type_delete_all ()
+void rtbuf_type_delete_all (void)
 {
   unsigned i = 0;
   int n = g_rtbuf_data_type_alloc.n;
diff --git a/librtbuf/rtbuf_var.c b/librtbuf/rtbuf_var.c
index 126a196..404b283 100644
--- a/librtbuf/rtbuf_var.c
+++ b/librtbuf/rtbuf_var.c
@@ -53,11 +53,11 @@ void rtbuf_var_delete (s_rtbuf_var *var)
   data_delete(&g_rtbuf_var_alloc, var);
 }
 
-void rtbuf_var_delete_all ()
+void rtbuf_var_delete_all (void)
 {
   unsigned i = 0;
   int n = g_rtbuf_var_alloc.n;
-  while (i < g_rtbuf_var_alloc.max) {
+  while (i < g_rtbuf_var_alloc.max && n > 0) {
     if (g_rtbuf_var[i].name) {
       rtbuf_var_delete(g_rtbuf_var + i);
       n--;
diff --git a/librtbuf/symbol.c b/librtbuf/symbol.c
index 34a79ba..153ab0b 100644
--- a/librtbuf/symbol.c
+++ b/librtbuf/symbol.c
@@ -45,7 +45,7 @@ void g_str_reset (char *head)
 const char  *g_symbols[SYMBOL_MAX];
 unsigned int g_symbols_n = 0;
 
-void symbols_init () {
+void symbols_init (void) {
   bzero(g_str_start, sizeof(g_str_start));
   bzero(g_symbols, sizeof(g_symbols));
 }
diff --git a/librtbuf/symbol.h b/librtbuf/symbol.h
index e302a6e..d032d24 100644
--- a/librtbuf/symbol.h
+++ b/librtbuf/symbol.h
@@ -31,7 +31,7 @@ void   g_str_reset (char *head);
 extern symbol       g_symbols[SYMBOL_MAX];
 extern unsigned int g_symbols_n;
 
-void   symbols_init ();
+void   symbols_init (void);
 symbol symbol_new (symbol name);
 void   symbol_delete (symbol sym);
 symbol symbol_find (symbol name);
diff --git a/librtbuf/type.h b/librtbuf/type.h
index 8e3a428..57d0993 100644
--- a/librtbuf/type.h
+++ b/librtbuf/type.h
@@ -25,12 +25,12 @@ struct rtbuf_type {
 
 #define RTBUF_TYPE_MAX 1024
 
-void           rtbuf_type_init ();
-void           rtbuf_type_shutdown ();
+void           rtbuf_type_init (void);
+void           rtbuf_type_shutdown (void);
 s_rtbuf_type * rtbuf_type_new (const char *name,
                                unsigned int size);
 void           rtbuf_type_delete (s_rtbuf_type *rt);
-void           rtbuf_type_delete_all ();
+void           rtbuf_type_delete_all (void);
 s_rtbuf_type * rtbuf_type_find (symbol name);
 s_rtbuf_type * rtbuf_type_define (const char *name,
                                   unsigned int size);
diff --git a/librtbuf/var.h b/librtbuf/var.h
index a2bf8c4..2d7ab34 100644
--- a/librtbuf/var.h
+++ b/librtbuf/var.h
@@ -27,7 +27,7 @@ struct rtbuf_var {
 void          rtbuf_var_init (void);
 void          rtbuf_var_shutdown (void);
 void          rtbuf_var_delete (s_rtbuf_var *var);
-void          rtbuf_var_delete_all ();
+void          rtbuf_var_delete_all (void);
 s_rtbuf_var * rtbuf_var_find (const char *name);
 s_rtbuf_var * rtbuf_var_rtbuf_set (const char *name, unsigned i);
 void          rtbuf_var_print (const s_rtbuf_var *v);
diff --git a/test/synth b/test/synth
index c754747..48f7d36 100644
--- a/test/synth
+++ b/test/synth
@@ -4,8 +4,8 @@ let Keyboard00 = new glfw3/keyboard 100 100
 load synth/adsr
 let ADSR00 = new synth/adsr 300 300
 
-load signal/sinus
-let Osc00 = new signal/sinus 300 800
+load signal/square
+let Osc00 = new signal/square 300 800
 
 load synth/synth
 let Synth00 = new synth/synth 1000 100
@@ -14,10 +14,14 @@ bind Keyboard00 notes Synth00 notes
 bind ADSR00 signal Synth00 envelope
 bind Osc00 signal Synth00 oscillator
 
+load signal/flanger
+let Flanger00 = new signal/flanger 500 500
+
+bind Synth00 signal Flanger00 signal
+
 load portaudio/output
 let Output = new portaudio/output 1600 100
 
-bind Synth00 signal Output left
-bind Synth00 signal Output right
+bind Flanger00 signal Output left
 
 start