ALSA: seq: More constifications
Apply const prefix to the remaining sequencer code: the static tables for MIDI macros, RPN/NRPN, and some strings. Just for minor optimization and no functional changes. Link: https://lore.kernel.org/r/20200105144823.29547-7-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
d03af9b8ea
commit
731922a593
|
@ -460,10 +460,10 @@ enabled_str(int bool)
|
||||||
return bool ? "enabled" : "disabled";
|
return bool ? "enabled" : "disabled";
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static const char *
|
||||||
filemode_str(int val)
|
filemode_str(int val)
|
||||||
{
|
{
|
||||||
static char *str[] = {
|
static const char * const str[] = {
|
||||||
"none", "read", "write", "read/write",
|
"none", "read", "write", "read/write",
|
||||||
};
|
};
|
||||||
return str[val & SNDRV_SEQ_OSS_FILE_ACMODE];
|
return str[val & SNDRV_SEQ_OSS_FILE_ACMODE];
|
||||||
|
|
|
@ -479,11 +479,11 @@ sysex(const struct snd_midi_op *ops, void *private, unsigned char *buf, int len,
|
||||||
struct snd_midi_channel_set *chset)
|
struct snd_midi_channel_set *chset)
|
||||||
{
|
{
|
||||||
/* GM on */
|
/* GM on */
|
||||||
static unsigned char gm_on_macro[] = {
|
static const unsigned char gm_on_macro[] = {
|
||||||
0x7e,0x7f,0x09,0x01,
|
0x7e,0x7f,0x09,0x01,
|
||||||
};
|
};
|
||||||
/* XG on */
|
/* XG on */
|
||||||
static unsigned char xg_on_macro[] = {
|
static const unsigned char xg_on_macro[] = {
|
||||||
0x43,0x10,0x4c,0x00,0x00,0x7e,0x00,
|
0x43,0x10,0x4c,0x00,0x00,0x7e,0x00,
|
||||||
};
|
};
|
||||||
/* GS prefix
|
/* GS prefix
|
||||||
|
@ -492,7 +492,7 @@ sysex(const struct snd_midi_op *ops, void *private, unsigned char *buf, int len,
|
||||||
* chorus mode: XX=0x01, YY=0x38, ZZ=0-7
|
* chorus mode: XX=0x01, YY=0x38, ZZ=0-7
|
||||||
* master vol: XX=0x00, YY=0x04, ZZ=0-127
|
* master vol: XX=0x00, YY=0x04, ZZ=0-127
|
||||||
*/
|
*/
|
||||||
static unsigned char gs_pfx_macro[] = {
|
static const unsigned char gs_pfx_macro[] = {
|
||||||
0x41,0x10,0x42,0x12,0x40,/*XX,YY,ZZ*/
|
0x41,0x10,0x42,0x12,0x40,/*XX,YY,ZZ*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -422,12 +422,12 @@ static int extra_decode_xrpn(struct snd_midi_event *dev, unsigned char *buf,
|
||||||
int count, struct snd_seq_event *ev)
|
int count, struct snd_seq_event *ev)
|
||||||
{
|
{
|
||||||
unsigned char cmd;
|
unsigned char cmd;
|
||||||
char *cbytes;
|
const char *cbytes;
|
||||||
static char cbytes_nrpn[4] = { MIDI_CTL_NONREG_PARM_NUM_MSB,
|
static const char cbytes_nrpn[4] = { MIDI_CTL_NONREG_PARM_NUM_MSB,
|
||||||
MIDI_CTL_NONREG_PARM_NUM_LSB,
|
MIDI_CTL_NONREG_PARM_NUM_LSB,
|
||||||
MIDI_CTL_MSB_DATA_ENTRY,
|
MIDI_CTL_MSB_DATA_ENTRY,
|
||||||
MIDI_CTL_LSB_DATA_ENTRY };
|
MIDI_CTL_LSB_DATA_ENTRY };
|
||||||
static char cbytes_rpn[4] = { MIDI_CTL_REGIST_PARM_NUM_MSB,
|
static const char cbytes_rpn[4] = { MIDI_CTL_REGIST_PARM_NUM_MSB,
|
||||||
MIDI_CTL_REGIST_PARM_NUM_LSB,
|
MIDI_CTL_REGIST_PARM_NUM_LSB,
|
||||||
MIDI_CTL_MSB_DATA_ENTRY,
|
MIDI_CTL_MSB_DATA_ENTRY,
|
||||||
MIDI_CTL_LSB_DATA_ENTRY };
|
MIDI_CTL_LSB_DATA_ENTRY };
|
||||||
|
|
Loading…
Reference in New Issue