[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 42/49] hw/audio/cs4231a: Const'ify global tables
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 42/49] hw/audio/cs4231a: Const'ify global tables |
Date: |
Sat, 11 Jun 2022 12:33:05 +0200 |
From: Bernhard Beschow <shentey@gmail.com>
The tables contain spcifically crafted constants for algorithms, so make
them immutable.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20220520180109.8224-3-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/audio/cs4231a.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c
index 0723e39430..7f17a72a9c 100644
--- a/hw/audio/cs4231a.c
+++ b/hw/audio/cs4231a.c
@@ -84,7 +84,7 @@ struct CSState {
int transferred;
int aci_counter;
SWVoiceOut *voice;
- int16_t *tab;
+ const int16_t *tab;
};
#define MODE2 (1 << 6)
@@ -142,13 +142,13 @@ enum {
Capture_Lower_Base_Count
};
-static int freqs[2][8] = {
+static const int freqs[2][8] = {
{ 8000, 16000, 27420, 32000, -1, -1, 48000, 9000 },
{ 5510, 11025, 18900, 22050, 37800, 44100, 33075, 6620 }
};
/* Tables courtesy http://hazelware.luggle.com/tutorials/mulawcompression.html
*/
-static int16_t MuLawDecompressTable[256] =
+static const int16_t MuLawDecompressTable[256] =
{
-32124,-31100,-30076,-29052,-28028,-27004,-25980,-24956,
-23932,-22908,-21884,-20860,-19836,-18812,-17788,-16764,
@@ -184,7 +184,7 @@ static int16_t MuLawDecompressTable[256] =
56, 48, 40, 32, 24, 16, 8, 0
};
-static int16_t ALawDecompressTable[256] =
+static const int16_t ALawDecompressTable[256] =
{
-5504, -5248, -6016, -5760, -4480, -4224, -4992, -4736,
-7552, -7296, -8064, -7808, -6528, -6272, -7040, -6784,
--
2.36.1
- [PULL 34/49] hw/isa/piix3: Move pci_map_irq_fn near pci_set_irq_fn, (continued)
- [PULL 34/49] hw/isa/piix3: Move pci_map_irq_fn near pci_set_irq_fn, Philippe Mathieu-Daudé, 2022/06/11
- [PULL 36/49] hw/isa/piix3: Factor out ISABus retrieval from piix3_create(), Philippe Mathieu-Daudé, 2022/06/11
- [PULL 33/49] hw/isa/piix4: Inline and remove piix4_create(), Philippe Mathieu-Daudé, 2022/06/11
- [PULL 37/49] hw/isa/piix3: Inline and remove piix3_create(), Philippe Mathieu-Daudé, 2022/06/11
- [PULL 35/49] hw/isa/piix3: QOM'ify PCI device creation and wiring, Philippe Mathieu-Daudé, 2022/06/11
- [PULL 38/49] hw/i386/microvm-dt: Force explicit failure if retrieving QOM property fails, Philippe Mathieu-Daudé, 2022/06/11
- [PULL 39/49] hw/i386/microvm-dt: Determine mc146818rtc's IRQ number from QOM property, Philippe Mathieu-Daudé, 2022/06/11
- [PULL 40/49] hw/rtc/mc146818rtc: QOM'ify io_base offset, Philippe Mathieu-Daudé, 2022/06/11
- [PULL 44/49] hw/i386/pc: Unexport functions used only internally, Philippe Mathieu-Daudé, 2022/06/11
- [PULL 41/49] hw: Reuse TYPE_I8042 define, Philippe Mathieu-Daudé, 2022/06/11
- [PULL 42/49] hw/audio/cs4231a: Const'ify global tables,
Philippe Mathieu-Daudé <=
- [PULL 43/49] hw/i386/pc: Unexport PC_CPU_MODEL_IDS macro, Philippe Mathieu-Daudé, 2022/06/11
- [PULL 47/49] accel/tcg/cpu-exec: Unexport dump_drift_info(), Philippe Mathieu-Daudé, 2022/06/11
- [PULL 46/49] hw/net/fsl_etsec/etsec: Remove obsolete and unused etsec_create(), Philippe Mathieu-Daudé, 2022/06/11
- [PULL 48/49] accel/tcg: Inline dump_opcount_info() and remove it, Philippe Mathieu-Daudé, 2022/06/11
- [PULL 45/49] hw/i386/pc: Remove orphan declarations, Philippe Mathieu-Daudé, 2022/06/11
- [PULL 49/49] docs/devel: Fix link to developer mailing lists, Philippe Mathieu-Daudé, 2022/06/11
- Re: [PULL 00/49] MIPS patches for 2022-06-11, Philippe Mathieu-Daudé, 2022/06/11
- Re: [PULL 00/49] MIPS patches for 2022-06-11, Richard Henderson, 2022/06/11