summaryrefslogtreecommitdiff
path: root/usr.bin/sndiod
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2021-01-12 15:46:54 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2021-01-12 15:46:54 +0000
commit0cc1a0f75ef63189a2883238dd15c5eb0140fa11 (patch)
tree35cbd2ae8611b4f1882ebffcbf01a64477b9f894 /usr.bin/sndiod
parentdb4c912e2c3b4339405a13cabc595a39db12c4aa (diff)
const-ify lookup tables; ok ratchov@
Diffstat (limited to 'usr.bin/sndiod')
-rw-r--r--usr.bin/sndiod/dsp.c6
-rw-r--r--usr.bin/sndiod/dsp.h4
-rw-r--r--usr.bin/sndiod/midi.c6
3 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/sndiod/dsp.c b/usr.bin/sndiod/dsp.c
index 5b8ade88be4..9b0a477a596 100644
--- a/usr.bin/sndiod/dsp.c
+++ b/usr.bin/sndiod/dsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsp.c,v 1.16 2021/01/11 14:26:00 ratchov Exp $ */
+/* $OpenBSD: dsp.c,v 1.17 2021/01/12 15:46:53 naddy Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -18,7 +18,7 @@
#include "dsp.h"
#include "utils.h"
-int aparams_ctltovol[128] = {
+const int aparams_ctltovol[128] = {
0,
256, 266, 276, 287, 299, 310, 323, 335,
348, 362, 376, 391, 406, 422, 439, 456,
@@ -38,7 +38,7 @@ int aparams_ctltovol[128] = {
26008, 27029, 28090, 29193, 30339, 31530, 32768
};
-int resamp_filt[RESAMP_LENGTH / RESAMP_STEP + 1] = {
+const int resamp_filt[RESAMP_LENGTH / RESAMP_STEP + 1] = {
0, 0, 3, 9, 22, 42, 73, 116,
174, 248, 341, 454, 589, 749, 934, 1148,
1392, 1666, 1974, 2316, 2693, 3107, 3560, 4051,
diff --git a/usr.bin/sndiod/dsp.h b/usr.bin/sndiod/dsp.h
index 2fc5a94b922..71cae26d9fe 100644
--- a/usr.bin/sndiod/dsp.h
+++ b/usr.bin/sndiod/dsp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsp.h,v 1.8 2021/01/11 14:26:00 ratchov Exp $ */
+/* $OpenBSD: dsp.h,v 1.9 2021/01/12 15:46:53 naddy Exp $ */
/*
* Copyright (c) 2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -164,7 +164,7 @@ struct cmap {
};
#define MIDI_TO_ADATA(m) (aparams_ctltovol[m] << (ADATA_BITS - 16))
-extern int aparams_ctltovol[128];
+extern const int aparams_ctltovol[128];
void aparams_init(struct aparams *);
void aparams_log(struct aparams *);
diff --git a/usr.bin/sndiod/midi.c b/usr.bin/sndiod/midi.c
index a739cb474e9..5a2d0daa2bf 100644
--- a/usr.bin/sndiod/midi.c
+++ b/usr.bin/sndiod/midi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: midi.c,v 1.25 2020/06/12 15:40:18 ratchov Exp $ */
+/* $OpenBSD: midi.c,v 1.26 2021/01/12 15:46:53 naddy Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -54,8 +54,8 @@ struct midithru {
/*
* length of voice and common messages (status byte included)
*/
-unsigned int voice_len[] = { 3, 3, 3, 3, 2, 2, 3 };
-unsigned int common_len[] = { 0, 2, 3, 2, 0, 0, 1, 1 };
+const unsigned int voice_len[] = { 3, 3, 3, 3, 2, 2, 3 };
+const unsigned int common_len[] = { 0, 2, 3, 2, 0, 0, 1, 1 };
void
midi_log(struct midi *ep)