From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Canokeys.org" <contact@canokeys.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Anthony Perard" <anthony.perard@citrix.com>,
"Paul Durrant" <paul@xen.org>,
"Akihiko Odaki" <akihiko.odaki@gmail.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Hongren (Zenithal) Zheng" <i@zenithal.me>,
xen-devel@lists.xenproject.org,
"Alex Williamson" <alex.williamson@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Bernhard Beschow" <shentey@gmail.com>
Subject: [PULL 04/17] hw/audio/cs4231a: Const'ify global tables
Date: Fri, 10 Jun 2022 11:20:30 +0200 [thread overview]
Message-ID: <20220610092043.1874654-5-kraxel@redhat.com> (raw)
In-Reply-To: <20220610092043.1874654-1-kraxel@redhat.com>
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>
Message-Id: <20220520180109.8224-3-shentey@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
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 0723e3943044..7f17a72a9cb7 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
next prev parent reply other threads:[~2022-06-10 10:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-10 9:20 [PULL 00/17] Kraxel 20220610 patches Gerd Hoffmann
2022-06-10 9:20 ` [PULL 01/17] ui/gtk-gl-area: implement GL context destruction Gerd Hoffmann
2022-06-10 9:20 ` [PULL 02/17] ui/gtk-gl-area: create the requested GL context version Gerd Hoffmann
2022-06-10 9:20 ` [PULL 03/17] ui/cocoa: Fix poweroff request code Gerd Hoffmann
2022-06-10 9:20 ` Gerd Hoffmann [this message]
2022-06-10 9:20 ` [PULL 05/17] hw/usb: Add CanoKey Implementation Gerd Hoffmann
2022-06-10 9:20 ` [PULL 06/17] hw/usb/canokey: Add trace events Gerd Hoffmann
2022-06-10 9:20 ` [PULL 07/17] meson: Add CanoKey Gerd Hoffmann
2022-06-10 9:20 ` [PULL 08/17] docs: Add CanoKey documentation Gerd Hoffmann
2022-06-10 9:20 ` [PULL 09/17] docs/system/devices/usb: Add CanoKey to USB devices examples Gerd Hoffmann
2022-06-10 9:20 ` [PULL 10/17] MAINTAINERS: add myself as CanoKey maintainer Gerd Hoffmann
2022-06-10 9:20 ` [PULL 11/17] hw/usb/hcd-ehci: fix writeback order Gerd Hoffmann
2022-06-10 9:20 ` [PULL 12/17] usbredir: avoid queuing hello packet on snapshot restore Gerd Hoffmann
2022-06-10 9:20 ` [PULL 13/17] virtio-gpu: update done only on the scanout associated with rect Gerd Hoffmann
2022-06-10 9:20 ` [PULL 14/17] ui: move 'pc-bios/keymaps' to 'ui/keymaps' Gerd Hoffmann
2022-06-10 9:20 ` [PULL 15/17] ui/console: Do not return a value with ui_info Gerd Hoffmann
2022-06-10 9:20 ` [PULL 16/17] ui: Deliver refresh rate via QemuUIInfo Gerd Hoffmann
2022-06-10 9:20 ` [PULL 17/17] virtio-gpu: Respect UI refresh rate for EDID Gerd Hoffmann
2022-06-10 20:16 ` [PULL 00/17] Kraxel 20220610 patches Richard Henderson
2022-06-11 16:34 ` Volker Rümelin
2022-06-12 1:10 ` Akihiko Odaki
2022-06-13 8:45 ` Daniel P. Berrangé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220610092043.1874654-5-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=akihiko.odaki@gmail.com \
--cc=alex.williamson@redhat.com \
--cc=anthony.perard@citrix.com \
--cc=contact@canokeys.org \
--cc=f4bug@amsat.org \
--cc=i@zenithal.me \
--cc=mst@redhat.com \
--cc=paul@xen.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=shentey@gmail.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).