int main(int argc, char *argv[])
{
- struct option long_option[] =
+ static const struct option long_option[] =
{
{"help", 0, NULL, 'h'},
{"file", 1, NULL, 'f'},
{"version", 0, NULL, 'v'},
{NULL, 0, NULL, 0},
};
- char *devfiles[] = {
+ static const char *const devfiles[] = {
"/dev/snd/controlC",
"/dev/snd/pcmC",
"/dev/snd/midiC",
snd_ctl_elem_type_t type;
unsigned int idx, count;
static char res[1024], tmp[16];
- static const char *hex = "0123456789abcdef";
+ static const char hex[] = "0123456789abcdef";
char *pos;
const char *pos1;
#define MIXER_ELEM_HAS_VOLUME 0x800
/* left and right channels for each type */
-static snd_mixer_selem_channel_id_t mixer_elem_chn[][2] = {
+static const snd_mixer_selem_channel_id_t mixer_elem_chn[][2] = {
{ SND_MIXER_SCHN_FRONT_LEFT, SND_MIXER_SCHN_FRONT_RIGHT },
{ SND_MIXER_SCHN_REAR_LEFT, SND_MIXER_SCHN_REAR_RIGHT },
{ SND_MIXER_SCHN_FRONT_CENTER, SND_MIXER_SCHN_UNKNOWN },
int main(int argc, char *argv[])
{
- static char short_options[] = "hVlLp:s:r:S::dt:a";
- static struct option long_options[] = {
+ static const char short_options[] = "hVlLp:s:r:S::dt:a";
+ static const struct option long_options[] = {
{"help", 0, NULL, 'h'},
{"version", 0, NULL, 'V'},
{"list-devices", 0, NULL, 'l'},
return snd_mixer_selem_set_capture_dB(elem, c, value, 0);
}
-static struct volume_ops_set vol_ops[2] = {
+static const struct volume_ops_set vol_ops[2] = {
{
.has_volume = snd_mixer_selem_has_playback_volume,
.v = {{ snd_mixer_selem_get_playback_volume_range,
char *name;
unsigned int mask;
} channel_mask_t;
-static channel_mask_t chanmask[] = {
+static const channel_mask_t chanmask[] = {
{"frontleft", 1 << SND_MIXER_SCHN_FRONT_LEFT},
{"frontright", 1 << SND_MIXER_SCHN_FRONT_RIGHT},
{"frontcenter", 1 << SND_MIXER_SCHN_FRONT_CENTER},
static unsigned int channels_mask(char **arg, unsigned int def)
{
- channel_mask_t *c;
+ const channel_mask_t *c;
for (c = chanmask; c->name; c++) {
if (strncasecmp(*arg, c->name, strlen(c->name)) == 0) {
{
int morehelp, level = 0;
int read_stdin = 0;
- static struct option long_option[] =
+ static const struct option long_option[] =
{
{"help", 0, NULL, 'h'},
{"card", 1, NULL, 'c'},
int main(int argc, char *argv[])
{
int option_index;
- char *short_options = "hnlLD:qt:c:f:r:d:MNF:A:R:T:B:vV:IPC";
- static struct option long_options[] = {
+ static const char short_options[] = "hnlLD:qt:c:f:r:d:MNF:A:R:T:B:vV:IPC";
+ static const struct option long_options[] = {
{"help", 0, 0, 'h'},
{"version", 0, 0, OPT_VERSION},
{"list-devnames", 0, 0, 'n'},
const char *name;
};
-static struct category_str con_category[] = {
+static const struct category_str con_category[] = {
{ IEC958_AES1_CON_GENERAL, "general" },
{ IEC958_AES1_CON_IEC908_CD, "CD" },
const char *desc;
};
-static struct cmdtbl cmds[] = {
+static const struct cmdtbl cmds[] = {
{ "pro", IDX_PRO, CMD_BOOL,
"professional (common)\n\toff = consumer mode, on = professional mode" },
{ "aud", IDX_NOAUDIO, CMD_BOOL_INV,
SUBSCRIBE, UNSUBSCRIBE, LIST, REMOVE_ALL
};
-static struct option long_option[] = {
+static const struct option long_option[] = {
{"disconnect", 0, NULL, 'd'},
{"input", 0, NULL, 'i'},
{"output", 0, NULL, 'o'},
switch (cmd >> 4) {
/* maps SMF events to ALSA sequencer events */
- static unsigned char cmd_type[] = {
+ static const unsigned char cmd_type[] = {
[0x8] = SND_SEQ_EVENT_NOTEOFF,
[0x9] = SND_SEQ_EVENT_NOTEON,
[0xa] = SND_SEQ_EVENT_KEYPRESS,
int main(int argc, char *argv[])
{
- static char short_options[] = "hVlp:d:";
- static struct option long_options[] = {
+ static const char short_options[] = "hVlp:d:";
+ static const struct option long_options[] = {
{"help", 0, NULL, 'h'},
{"version", 0, NULL, 'V'},
{"list", 0, NULL, 'l'},
int main(int argc, char *argv[])
{
- static char short_options[] = "hVlp:b:f:t:sdm:i:";
- static struct option long_options[] = {
+ static const char short_options[] = "hVlp:b:f:t:sdm:i:";
+ static const struct option long_options[] = {
{"help", 0, NULL, 'h'},
{"version", 0, NULL, 'V'},
{"list", 0, NULL, 'l'},
int main(int argc, char *argv[])
{
- static char short_options[] = "hVlp:";
- static struct option long_options[] = {
+ static const char short_options[] = "hVlp:";
+ static const struct option long_options[] = {
{"help", 0, NULL, 'h'},
{"version", 0, NULL, 'V'},
{"list", 0, NULL, 'l'},
* main routine
*/
-static struct option long_option[] = {
+static const struct option long_option[] = {
{"port", 1, NULL, 'p'},
{"source", 1, NULL, 's'},
{"dest", 1, NULL, 'd'},
static const char *given_test_wav_file = NULL;
static char *wav_file_dir = SOUNDSDIR;
-static const char *channel_name[MAX_CHANNELS] = {
+static const char *const channel_name[MAX_CHANNELS] = {
N_("Front Left"),
N_("Front Right"),
N_("Rear Left"),
static int setup_wav_file(int chn)
{
- static const char *wavs[MAX_CHANNELS] = {
+ static const char *const wavs[MAX_CHANNELS] = {
"Front_Left.wav",
"Front_Right.wav",
"Rear_Left.wav",
unsigned int n, nloops;
struct timeval tv1,tv2;
- struct option long_option[] = {
+ static const struct option long_option[] = {
{"help", 0, NULL, 'h'},
{"device", 1, NULL, 'D'},
{"rate", 1, NULL, 'r'},