summaryrefslogtreecommitdiff
path: root/usr.bin/aucat
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/aucat
parentdb4c912e2c3b4339405a13cabc595a39db12c4aa (diff)
const-ify lookup tables; ok ratchov@
Diffstat (limited to 'usr.bin/aucat')
-rw-r--r--usr.bin/aucat/afile.c32
-rw-r--r--usr.bin/aucat/aucat.c4
-rw-r--r--usr.bin/aucat/dsp.c12
-rw-r--r--usr.bin/aucat/dsp.h4
4 files changed, 26 insertions, 26 deletions
diff --git a/usr.bin/aucat/afile.c b/usr.bin/aucat/afile.c
index b880878243c..6677c11850d 100644
--- a/usr.bin/aucat/afile.c
+++ b/usr.bin/aucat/afile.c
@@ -131,28 +131,28 @@ struct au_hdr {
/* followed by optional desc[] continuation */
};
-char wav_id_riff[4] = {'R', 'I', 'F', 'F'};
-char wav_id_wave[4] = {'W', 'A', 'V', 'E'};
-char wav_id_data[4] = {'d', 'a', 't', 'a'};
-char wav_id_fmt[4] = {'f', 'm', 't', ' '};
-char wav_guid[14] = {
+const char wav_id_riff[4] = {'R', 'I', 'F', 'F'};
+const char wav_id_wave[4] = {'W', 'A', 'V', 'E'};
+const char wav_id_data[4] = {'d', 'a', 't', 'a'};
+const char wav_id_fmt[4] = {'f', 'm', 't', ' '};
+const char wav_guid[14] = {
0x00, 0x00, 0x00, 0x00,
0x10, 0x00, 0x80, 0x00,
0x00, 0xAA, 0x00, 0x38,
0x9B, 0x71
};
-char aiff_id_form[4] = {'F', 'O', 'R', 'M'};
-char aiff_id_aiff[4] = {'A', 'I', 'F', 'F'};
-char aiff_id_aifc[4] = {'A', 'I', 'F', 'C'};
-char aiff_id_data[4] = {'S', 'S', 'N', 'D'};
-char aiff_id_comm[4] = {'C', 'O', 'M', 'M'};
-char aiff_id_none[4] = {'N', 'O', 'N', 'E'};
-char aiff_id_fl32[4] = {'f', 'l', '3', '2'};
-char aiff_id_ulaw[4] = {'u', 'l', 'a', 'w'};
-char aiff_id_alaw[4] = {'a', 'l', 'a', 'w'};
-
-char au_id[4] = {'.', 's', 'n', 'd'};
+const char aiff_id_form[4] = {'F', 'O', 'R', 'M'};
+const char aiff_id_aiff[4] = {'A', 'I', 'F', 'F'};
+const char aiff_id_aifc[4] = {'A', 'I', 'F', 'C'};
+const char aiff_id_data[4] = {'S', 'S', 'N', 'D'};
+const char aiff_id_comm[4] = {'C', 'O', 'M', 'M'};
+const char aiff_id_none[4] = {'N', 'O', 'N', 'E'};
+const char aiff_id_fl32[4] = {'f', 'l', '3', '2'};
+const char aiff_id_ulaw[4] = {'u', 'l', 'a', 'w'};
+const char aiff_id_alaw[4] = {'a', 'l', 'a', 'w'};
+
+const char au_id[4] = {'.', 's', 'n', 'd'};
static inline unsigned int
le16_get(le16_t *p)
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c
index 3f12c0b1c50..8d2ae50d908 100644
--- a/usr.bin/aucat/aucat.c
+++ b/usr.bin/aucat/aucat.c
@@ -132,8 +132,8 @@ struct slot *slot_list = NULL;
/*
* length of voice and common MIDI 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 };
char usagestr[] = "usage: aucat [-dn] [-b size] "
"[-c min:max] [-e enc] [-f device] [-g position]\n\t"
diff --git a/usr.bin/aucat/dsp.c b/usr.bin/aucat/dsp.c
index dd36a25058b..4b62f1d5e97 100644
--- a/usr.bin/aucat/dsp.c
+++ b/usr.bin/aucat/dsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsp.c,v 1.15 2021/01/11 14:45:51 ratchov Exp $ */
+/* $OpenBSD: dsp.c,v 1.16 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
};
-short dec_ulawmap[256] = {
+const short dec_ulawmap[256] = {
-32124, -31100, -30076, -29052, -28028, -27004, -25980, -24956,
-23932, -22908, -21884, -20860, -19836, -18812, -17788, -16764,
-15996, -15484, -14972, -14460, -13948, -13436, -12924, -12412,
@@ -73,7 +73,7 @@ short dec_ulawmap[256] = {
56, 48, 40, 32, 24, 16, 8, 0
};
-short dec_alawmap[256] = {
+const short dec_alawmap[256] = {
-5504, -5248, -6016, -5760, -4480, -4224, -4992, -4736,
-7552, -7296, -8064, -7808, -6528, -6272, -7040, -6784,
-2752, -2624, -3008, -2880, -2240, -2112, -2496, -2368,
@@ -108,7 +108,7 @@ short dec_alawmap[256] = {
944, 912, 1008, 976, 816, 784, 880, 848
};
-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,
@@ -842,7 +842,7 @@ dec_do_ulaw(struct conv *p, unsigned char *in,
unsigned int f;
unsigned char *idata;
adata_t *odata;
- short *map;
+ const short *map;
#ifdef DEBUG
if (log_level >= 4) {
diff --git a/usr.bin/aucat/dsp.h b/usr.bin/aucat/dsp.h
index 267ae2138de..2758147ce69 100644
--- a/usr.bin/aucat/dsp.h
+++ b/usr.bin/aucat/dsp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsp.h,v 1.6 2021/01/11 14:45:51 ratchov Exp $ */
+/* $OpenBSD: dsp.h,v 1.7 2021/01/12 15:46:53 naddy Exp $ */
/*
* Copyright (c) 2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -165,7 +165,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 *);