]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Make some static tables and strings constants.
authorDiego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
Fri, 21 Nov 2008 00:21:32 +0000 (01:21 +0100)
committerDiego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
Fri, 21 Nov 2008 12:04:41 +0000 (13:04 +0100)
By doing this we move them from the .data section to .rodata setion,
or from .data.rel to .data.rel.ro.

The .rodata section is mapped directly from the on-disk file, which is
always a save, while .data.rel.ro is mapped directly when using
prelink, which is a save in a lot of cases.

Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
14 files changed:
aserver/aserver.c
src/async.c
src/pcm/pcm_adpcm.c
src/pcm/pcm_direct.c
src/pcm/pcm_extplug.c
src/pcm/pcm_file.c
src/pcm/pcm_iec958.c
src/pcm/pcm_ioplug.c
src/pcm/pcm_misc.c
src/pcm/pcm_params.c
src/pcm/pcm_plug.c
src/pcm/pcm_softvol.c
src/pcm/plugin_ops.h
src/seq/seq_midi_event.c

index 481b0ae758074aca4ab5015e3f493ac3118e3779..73ea4e957d3b3d3e42f53551e08a3baf926315bf 100644 (file)
@@ -1005,7 +1005,7 @@ static void usage(void)
 
 int main(int argc, char **argv)
 {
-       static struct option long_options[] = {
+       static const struct option long_options[] = {
                {"help", 0, 0, 'h'},
                { 0 , 0 , 0, 0 }
        };
index f6c6e63c7aaa0abc54f4771f0da128e3eb5cfb2f..98aec78e00a8ddcd7202376f44febd2a310e550a 100644 (file)
@@ -44,7 +44,7 @@ void snd_async_init(void)
 }
 #else
 /** async signal number */
-static int snd_async_signo = SIGIO;
+static const int snd_async_signo = SIGIO;
 #endif
 
 static LIST_HEAD(snd_async_handlers);
index 4f9c46b0835137d80327e11e0b0c9e38a0421ec7..29599f3e4c667eeceda7e60a4102f3273a7db80a 100644 (file)
@@ -89,10 +89,10 @@ typedef struct {
 #endif
 
 /* First table lookup for Ima-ADPCM quantizer */
-static char IndexAdjust[8] = { -1, -1, -1, -1, 2, 4, 6, 8 };
+static const char IndexAdjust[8] = { -1, -1, -1, -1, 2, 4, 6, 8 };
 
 /* Second table lookup for Ima-ADPCM quantizer */
-static short StepSize[89] = {
+static const short StepSize[89] = {
        7, 8, 9, 10, 11, 12, 13, 14, 16, 17,
        19, 21, 23, 25, 28, 31, 34, 37, 41, 45,
        50, 55, 60, 66, 73, 80, 88, 97, 107, 118,
index 11709638001533ef2b04145849297231615b01da..82cc126c3e6fffd767b7c55becc150c255b20692 100644 (file)
@@ -654,7 +654,7 @@ static int hw_param_interval_refine_minmax(snd_pcm_hw_params_t *params,
 int snd_pcm_direct_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
 {
        snd_pcm_direct_t *dshare = pcm->private_data;
-       static snd_mask_t access = { .bits = { 
+       static const snd_mask_t access = { .bits = { 
                                        (1<<SNDRV_PCM_ACCESS_MMAP_INTERLEAVED) |
                                        (1<<SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED) |
                                        (1<<SNDRV_PCM_ACCESS_RW_INTERLEAVED) |
index 56510143d2323c9eb8d83d3b1f7fbfbe2630f374..31d8d9464f0fd52bb553965ef629e1761cdd6c4b 100644 (file)
@@ -45,14 +45,14 @@ typedef struct snd_pcm_extplug_priv {
        struct snd_ext_parm sparams[SND_PCM_EXTPLUG_HW_PARAMS];
 } extplug_priv_t;
 
-static int hw_params_type[SND_PCM_EXTPLUG_HW_PARAMS] = {
+static const int hw_params_type[SND_PCM_EXTPLUG_HW_PARAMS] = {
        [SND_PCM_EXTPLUG_HW_FORMAT] = SND_PCM_HW_PARAM_FORMAT,
        [SND_PCM_EXTPLUG_HW_CHANNELS] = SND_PCM_HW_PARAM_CHANNELS
 };
 
 #define is_mask_type(i) (hw_params_type[i] < SND_PCM_HW_PARAM_FIRST_INTERVAL)
 
-static unsigned int excl_parbits[SND_PCM_EXTPLUG_HW_PARAMS] = {
+static const unsigned int excl_parbits[SND_PCM_EXTPLUG_HW_PARAMS] = {
        [SND_PCM_EXTPLUG_HW_FORMAT] = (SND_PCM_HW_PARBIT_FORMAT|
                                       SND_PCM_HW_PARBIT_SUBFORMAT |
                                       SND_PCM_HW_PARBIT_SAMPLE_BITS),
index e3216da70374806dc2696f81565c09e103857416..376dac0d102cb283cf3827ff1688a918a6471b53 100644 (file)
@@ -100,14 +100,14 @@ static void setup_wav_header(snd_pcm_t *pcm, struct wav_fmt *fmt)
 static int write_wav_header(snd_pcm_t *pcm)
 {
        snd_pcm_file_t *file = pcm->private_data;
-       static char header[] = {
+       static const char header[] = {
                'R', 'I', 'F', 'F',
                0x24, 0, 0, 0,
                'W', 'A', 'V', 'E',
                'f', 'm', 't', ' ',
                0x10, 0, 0, 0,
        };
-       static char header2[] = {
+       static const char header2[] = {
                'd', 'a', 't', 'a',
                0, 0, 0, 0
        };
index f0990d2fa56978843152974b7c0ad035adb4c558..5e4858db982e267efc92bc662a5354632114974f 100644 (file)
@@ -453,7 +453,7 @@ int snd_pcm_iec958_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sfo
        snd_pcm_t *pcm;
        snd_pcm_iec958_t *iec;
        int err;
-       static unsigned char default_status_bits[] = {
+       static const unsigned char default_status_bits[] = {
                IEC958_AES0_CON_EMPHASIS_NONE,
                IEC958_AES1_CON_ORIGINAL | IEC958_AES1_CON_PCM_CODER,
                0,
index a30efebdf5946aba78a3fc0cb77994f56fa503bc..393dfa409a288167295f1dc3b2897d0e21293e2b 100644 (file)
@@ -146,7 +146,7 @@ static int snd_pcm_ioplug_prepare(snd_pcm_t *pcm)
        return 0;
 }
 
-static int hw_params_type[SND_PCM_IOPLUG_HW_PARAMS] = {
+static const int hw_params_type[SND_PCM_IOPLUG_HW_PARAMS] = {
        [SND_PCM_IOPLUG_HW_ACCESS] = SND_PCM_HW_PARAM_ACCESS,
        [SND_PCM_IOPLUG_HW_FORMAT] = SND_PCM_HW_PARAM_FORMAT,
        [SND_PCM_IOPLUG_HW_CHANNELS] = SND_PCM_HW_PARAM_CHANNELS,
@@ -483,7 +483,7 @@ static int snd_pcm_ioplug_drain(snd_pcm_t *pcm)
 static int snd_pcm_ioplug_pause(snd_pcm_t *pcm, int enable)
 {
        ioplug_priv_t *io = pcm->private_data;
-       static snd_pcm_state_t states[2] = {
+       static const snd_pcm_state_t states[2] = {
                SND_PCM_STATE_RUNNING, SND_PCM_STATE_PAUSED
        };
        int prev, err;
index c075b24fe3987e8f2cd26ae6f1010f42b747f295..d52160cec65355810a606c458e7d07c2f78a255d 100644 (file)
@@ -623,7 +623,7 @@ int snd_pcm_format_set_silence(snd_pcm_format_t format, void *data, unsigned int
        return 0;
 }
 
-static int linear_formats[4][2][2] = {
+static const int linear_formats[4][2][2] = {
        { { SNDRV_PCM_FORMAT_S8, SNDRV_PCM_FORMAT_S8 },
          { SNDRV_PCM_FORMAT_U8, SNDRV_PCM_FORMAT_U8 } },
        { { SNDRV_PCM_FORMAT_S16_LE, SNDRV_PCM_FORMAT_S16_BE },
@@ -634,7 +634,7 @@ static int linear_formats[4][2][2] = {
          { SNDRV_PCM_FORMAT_U32_LE, SNDRV_PCM_FORMAT_U32_BE } }
 };
 
-static int linear24_formats[3][2][2] = {
+static const int linear24_formats[3][2][2] = {
        { { SNDRV_PCM_FORMAT_S24_3LE, SNDRV_PCM_FORMAT_S24_3BE },
          { SNDRV_PCM_FORMAT_U24_3LE, SNDRV_PCM_FORMAT_U24_3BE } },
        { { SNDRV_PCM_FORMAT_S20_3LE, SNDRV_PCM_FORMAT_S20_3BE },
index 34625995e62f8562cda4d93756d7107cfa6f18a5..c3c3b3ee00f5794b7f3ac15cf10b117244a13e32 100644 (file)
@@ -1232,7 +1232,7 @@ void snd_pcm_hw_param_dump(const snd_pcm_hw_params_t *params,
 
 #define HW_PARAM(v) [SND_PCM_HW_PARAM_##v] = #v
 
-const char *snd_pcm_hw_param_names[] = {
+const char *const snd_pcm_hw_param_names[] = {
        HW_PARAM(ACCESS),
        HW_PARAM(FORMAT),
        HW_PARAM(SUBFORMAT),
@@ -1660,7 +1660,7 @@ int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm,
 typedef struct _snd_pcm_hw_rule snd_pcm_hw_rule_t;
 
 typedef int (*snd_pcm_hw_rule_func_t)(snd_pcm_hw_params_t *params,
-                                     snd_pcm_hw_rule_t *rule);
+                                     const snd_pcm_hw_rule_t *rule);
 
 struct _snd_pcm_hw_rule {
        int var;
@@ -1670,7 +1670,7 @@ struct _snd_pcm_hw_rule {
 };
 
 static int snd_pcm_hw_rule_mul(snd_pcm_hw_params_t *params,
-                              snd_pcm_hw_rule_t *rule)
+                              const snd_pcm_hw_rule_t *rule)
 {
        snd_interval_t t;
        snd_interval_mul(hw_param_interval_c(params, rule->deps[0]),
@@ -1679,7 +1679,7 @@ static int snd_pcm_hw_rule_mul(snd_pcm_hw_params_t *params,
 }
 
 static int snd_pcm_hw_rule_div(snd_pcm_hw_params_t *params,
-                       snd_pcm_hw_rule_t *rule)
+                       const snd_pcm_hw_rule_t *rule)
 {
        snd_interval_t t;
        snd_interval_div(hw_param_interval_c(params, rule->deps[0]),
@@ -1688,7 +1688,7 @@ static int snd_pcm_hw_rule_div(snd_pcm_hw_params_t *params,
 }
 
 static int snd_pcm_hw_rule_muldivk(snd_pcm_hw_params_t *params,
-                                  snd_pcm_hw_rule_t *rule)
+                                  const snd_pcm_hw_rule_t *rule)
 {
        snd_interval_t t;
        snd_interval_muldivk(hw_param_interval_c(params, rule->deps[0]),
@@ -1698,7 +1698,7 @@ static int snd_pcm_hw_rule_muldivk(snd_pcm_hw_params_t *params,
 }
 
 static int snd_pcm_hw_rule_mulkdiv(snd_pcm_hw_params_t *params,
-                                  snd_pcm_hw_rule_t *rule)
+                                  const snd_pcm_hw_rule_t *rule)
 {
        snd_interval_t t;
        snd_interval_mulkdiv(hw_param_interval_c(params, rule->deps[0]),
@@ -1708,7 +1708,7 @@ static int snd_pcm_hw_rule_mulkdiv(snd_pcm_hw_params_t *params,
 }
 
 static int snd_pcm_hw_rule_format(snd_pcm_hw_params_t *params,
-                                 snd_pcm_hw_rule_t *rule)
+                                 const snd_pcm_hw_rule_t *rule)
 {
        int changed = 0;
        snd_pcm_format_t k;
@@ -1733,7 +1733,7 @@ static int snd_pcm_hw_rule_format(snd_pcm_hw_params_t *params,
 
 
 static int snd_pcm_hw_rule_sample_bits(snd_pcm_hw_params_t *params,
-                                      snd_pcm_hw_rule_t *rule)
+                                      const snd_pcm_hw_rule_t *rule)
 {
        unsigned int min, max;
        snd_pcm_format_t k;
@@ -1767,7 +1767,7 @@ static int snd_pcm_hw_rule_sample_bits(snd_pcm_hw_params_t *params,
        return changed;
 }
 
-static snd_pcm_hw_rule_t refine_rules[] = {
+static const snd_pcm_hw_rule_t refine_rules[] = {
        {
                .var = SND_PCM_HW_PARAM_FORMAT,
                .func = snd_pcm_hw_rule_format,
@@ -1911,7 +1911,7 @@ static snd_pcm_hw_rule_t refine_rules[] = {
 
 #define RULES (sizeof(refine_rules) / sizeof(refine_rules[0]))
 
-static snd_mask_t refine_masks[SND_PCM_HW_PARAM_LAST_MASK - SND_PCM_HW_PARAM_FIRST_MASK + 1] = {
+static const snd_mask_t refine_masks[SND_PCM_HW_PARAM_LAST_MASK - SND_PCM_HW_PARAM_FIRST_MASK + 1] = {
        [SND_PCM_HW_PARAM_ACCESS - SND_PCM_HW_PARAM_FIRST_MASK] = {
                .bits = { 0x1f },
        },
@@ -1923,7 +1923,7 @@ static snd_mask_t refine_masks[SND_PCM_HW_PARAM_LAST_MASK - SND_PCM_HW_PARAM_FIR
        },
 };
   
-static snd_interval_t refine_intervals[SND_PCM_HW_PARAM_LAST_INTERVAL - SND_PCM_HW_PARAM_FIRST_INTERVAL + 1] = {
+static const snd_interval_t refine_intervals[SND_PCM_HW_PARAM_LAST_INTERVAL - SND_PCM_HW_PARAM_FIRST_INTERVAL + 1] = {
        [SND_PCM_HW_PARAM_SAMPLE_BITS - SND_PCM_HW_PARAM_FIRST_INTERVAL] = {
                .min = 1, .max = UINT_MAX,
                .openmin = 0, .openmax = 0, .integer = 1, .empty = 0,
@@ -2022,7 +2022,7 @@ int snd_pcm_hw_refine_soft(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_hw_params_t
        do {
                again = 0;
                for (k = 0; k < RULES; k++) {
-                       snd_pcm_hw_rule_t *r = &refine_rules[k];
+                       const snd_pcm_hw_rule_t *r = &refine_rules[k];
                        unsigned int d;
                        int doit = 0;
                        for (d = 0; r->deps[d] >= 0; d++) {
index 4e1f605d41df44cbc31a12a9075fa07db67dd127..b90f6ecf6bfc72fa9e14a07c7245f3569eaa66fd 100644 (file)
@@ -87,7 +87,7 @@ static int snd_pcm_plug_info(snd_pcm_t *pcm, snd_pcm_info_t *info)
        return 0;
 }
 
-static snd_pcm_format_t linear_preferred_formats[] = {
+static const snd_pcm_format_t linear_preferred_formats[] = {
 #ifdef SND_LITTLE_ENDIAN
        SND_PCM_FORMAT_S16_LE,
        SND_PCM_FORMAT_U16_LE,
@@ -176,7 +176,7 @@ static snd_pcm_format_t linear_preferred_formats[] = {
 #endif
 
 #ifdef BUILD_PCM_NONLINEAR
-static snd_pcm_format_t nonlinear_preferred_formats[] = {
+static const snd_pcm_format_t nonlinear_preferred_formats[] = {
 #ifdef BUILD_PCM_PLUGIN_MULAW
        SND_PCM_FORMAT_MU_LAW,
 #endif
@@ -190,7 +190,7 @@ static snd_pcm_format_t nonlinear_preferred_formats[] = {
 #endif
 
 #ifdef BUILD_PCM_PLUGIN_LFLOAT
-static snd_pcm_format_t float_preferred_formats[] = {
+static const snd_pcm_format_t float_preferred_formats[] = {
 #ifdef SND_LITTLE_ENDIAN
        SND_PCM_FORMAT_FLOAT_LE,
        SND_PCM_FORMAT_FLOAT64_LE,
@@ -205,7 +205,7 @@ static snd_pcm_format_t float_preferred_formats[] = {
 };
 #endif
 
-static char linear_format_widths[32] = {
+static const char linear_format_widths[32] = {
        0, 0, 0, 0, 0, 0, 0, 1,
        0, 0, 0, 0, 0, 0, 0, 1,
        0, 1, 0, 1, 0, 0, 0, 1,
@@ -615,7 +615,7 @@ static int snd_pcm_plug_insert_plugins(snd_pcm_t *pcm,
                                       snd_pcm_plug_params_t *slave)
 {
        snd_pcm_plug_t *plug = pcm->private_data;
-       static int (*funcs[])(snd_pcm_t *_pcm, snd_pcm_t **new, snd_pcm_plug_params_t *s, snd_pcm_plug_params_t *d) = {
+       static int (*const funcs[])(snd_pcm_t *_pcm, snd_pcm_t **new, snd_pcm_plug_params_t *s, snd_pcm_plug_params_t *d) = {
 #ifdef BUILD_PCM_PLUGIN_MMAP_EMUL
                snd_pcm_plug_change_mmap,
 #endif
index 8268f1dbb38349baab534882a1d1885af59e1479..d06e01b0bcf67ca119f5e77af8580b1c40078643 100644 (file)
@@ -61,7 +61,7 @@ typedef struct {
 #define ZERO_DB                  0.0
 #define MAX_DB_UPPER_LIMIT      50
 
-static unsigned int preset_dB_value[PRESET_RESOLUTION] = {
+static const unsigned int preset_dB_value[PRESET_RESOLUTION] = {
        0x00b8, 0x00bd, 0x00c1, 0x00c5, 0x00ca, 0x00cf, 0x00d4, 0x00d9,
        0x00de, 0x00e3, 0x00e8, 0x00ed, 0x00f3, 0x00f9, 0x00fe, 0x0104,
        0x010a, 0x0111, 0x0117, 0x011e, 0x0124, 0x012b, 0x0132, 0x0139,
@@ -714,7 +714,7 @@ static int softvol_load_control(snd_pcm_t *pcm, snd_pcm_softvol_t *svol,
 
        /* set up dB table */
        if (min_dB == PRESET_MIN_DB && max_dB == ZERO_DB && resolution == PRESET_RESOLUTION)
-               svol->dB_value = preset_dB_value;
+               svol->dB_value = (unsigned int*)preset_dB_value;
        else {
 #ifndef HAVE_SOFT_FLOAT
                svol->dB_value = calloc(resolution, sizeof(unsigned int));
index 10b963cedb1f227cab8960d2686a1de1b958de70..04220d6abe939c5277780b4727fd4d15b07dc818 100644 (file)
@@ -108,7 +108,7 @@ copy_64: as_s64(dst) = as_s64c(src); goto COPY_END;
 
 #ifdef CONV_LABELS
 /* src_wid src_endswap sign_toggle dst_wid dst_endswap */
-static void *conv_labels[4 * 2 * 2 * 4 * 2] = {
+static void *const conv_labels[4 * 2 * 2 * 4 * 2] = {
        &&conv_xxx1_xxx1,        /*  8h ->  8h */
        &&conv_xxx1_xxx1,        /*  8h ->  8s */
        &&conv_xxx1_xx10,        /*  8h -> 16h */
@@ -341,7 +341,7 @@ conv_1234_123C: as_u32(dst) = as_u32c(src) ^ 0x80; goto CONV_END;
 
 #ifdef GET16_LABELS
 /* src_wid src_endswap sign_toggle */
-static void *get16_labels[4 * 2 * 2 + 4 * 3] = {
+static void *const get16_labels[4 * 2 * 2 + 4 * 3] = {
        &&get16_1_10,    /*  8h -> 16h */
        &&get16_1_90,    /*  8h ^> 16h */
        &&get16_1_10,    /*  8s -> 16h */
@@ -407,7 +407,7 @@ get16_123_B2_18: sample = (_get_triple_s(src) >> 2) ^ 0x8000; goto GET16_END;
 
 #ifdef PUT16_LABELS
 /* dst_wid dst_endswap sign_toggle */
-static void *put16_labels[4 * 2 * 2] = {
+static void *const put16_labels[4 * 2 * 2] = {
        &&put16_12_1,            /* 16h ->  8h */
        &&put16_12_9,            /* 16h ^>  8h */
        &&put16_12_1,            /* 16h ->  8s */
@@ -453,7 +453,7 @@ put16_12_0029: as_u32(dst) = (u_int32_t)bswap_16(sample) ^ 0x80; goto PUT16_END;
 
 #ifdef GET32_LABELS
 /* src_wid src_endswap sign_toggle */
-static void *get32_labels[4 * 2 * 2 + 4 * 3] = {
+static void *const get32_labels[4 * 2 * 2 + 4 * 3] = {
        &&get32_1_1000,          /*  8h -> 32h */
        &&get32_1_9000,          /*  8h ^> 32h */
        &&get32_1_1000,          /*  8s -> 32h */
@@ -528,7 +528,7 @@ __conv24_get: goto *put;
 
 #ifdef PUT32_LABELS
 /* dst_wid dst_endswap sign_toggle */
-static void *put32_labels[4 * 2 * 2 + 4 * 3] = {
+static void *const put32_labels[4 * 2 * 2 + 4 * 3] = {
        &&put32_1234_1,          /* 32h ->  8h */
        &&put32_1234_9,          /* 32h ^>  8h */
        &&put32_1234_1,          /* 32h ->  8s */
@@ -604,7 +604,7 @@ put32_1234_329_18: _put_triple_s(dst, (sample ^ 0x80000000) >> 14); goto PUT32_E
 
 #ifdef GETU_LABELS
 /* width endswap sign_toggle */
-static void *getu_labels[4 * 2 * 2] = {
+static void *const getu_labels[4 * 2 * 2] = {
        &&getu_1_1,             /*  8h ->  8h */
        &&getu_1_9,             /*  8h ^>  8h */
        &&getu_1_1,             /*  8s ->  8h */
@@ -645,7 +645,7 @@ getu_1234_C321: sample = bswap_32(as_u32c(src) ^ 0x80); goto GETU_END;
 
 #ifdef GETS_LABELS
 /* width endswap sign_toggle */
-static void *gets_labels[4 * 2 * 2] = {
+static void *const gets_labels[4 * 2 * 2] = {
        &&gets_1_1,             /*  8h ->  8h */
        &&gets_1_9,             /*  8h ^>  8h */
        &&gets_1_1,             /*  8s ->  8h */
@@ -686,7 +686,7 @@ gets_1234_C321: sample = (int32_t)bswap_32(as_s32c(src) ^ 0x80); goto GETS_END;
 
 #ifdef PUT_LABELS
 /* width endswap sign_toggle */
-static void *put_labels[4 * 2 * 2] = {
+static void *const put_labels[4 * 2 * 2] = {
        &&put_1_1,              /*  8h ->  8h */
        &&put_1_9,              /*  8h ^>  8h */
        &&put_1_1,              /*  8h ->  8s */
@@ -726,7 +726,7 @@ put_1234_4329: as_u32(dst) = bswap_32(sample) ^ 0x80; goto PUT_END;
 
 #ifdef PUT32F_LABELS
 /* type (0 = float, 1 = float64), endswap */
-static void *put32float_labels[2 * 2] = {
+static void *const put32float_labels[2 * 2] = {
        &&put32f_1234_1234F,    /* 32h -> (float)h */
        &&put32f_1234_4321F,    /* 32h -> (float)s */
        &&put32f_1234_1234D,    /* 32h -> (float64)h */
@@ -745,7 +745,7 @@ put32f_1234_4321D: tmp_double.d = (double_t)((int32_t)sample) / (double_t)0x8000
 
 #ifdef GET32F_LABELS
 /* type (0 = float, 1 = float64), endswap */
-static void *get32float_labels[2 * 2] = {
+static void *const get32float_labels[2 * 2] = {
        &&get32f_1234F_1234,    /* (float)h -> 32h */
        &&get32f_4321F_1234,    /* (float)s -> 32h */
        &&get32f_1234D_1234,    /* (float64)h -> 32h */
@@ -924,7 +924,7 @@ static inline void _norms(const void *src, void *dst,
 }
 
 /* src_wid dst_sign dst_wid dst_end */
-static void *norms_labels[4 * 2 * 4 * 2] = {
+static void *const norms_labels[4 * 2 * 4 * 2] = {
        &&norms_8_u8,           /*  s8 -> u8 */
        &&norms_8_u8,           /*  s8 -> u8 */
        &&norms_8_u16h,         /*  s8 -> u16h */
index 1d2b871fe5317d30203dde95d618b5651b786271..b5caa1b8a67217007900089103d76ce820c80557 100644 (file)
@@ -78,7 +78,7 @@ static void songpos_decode(const snd_seq_event_t *ev, unsigned char *buf);
  * event list
  */
 #ifndef DOC_HIDDEN
-static struct status_event_list_t {
+static const struct status_event_list_t {
        int event;
        int qlen;
        event_encode_t encode;
@@ -116,7 +116,7 @@ static struct status_event_list_t {
 static int extra_decode_ctrl14(snd_midi_event_t *dev, unsigned char *buf, int len, const snd_seq_event_t *ev);
 static int extra_decode_xrpn(snd_midi_event_t *dev, unsigned char *buf, int count, const snd_seq_event_t *ev);
 
-static struct extra_event_list_t {
+static const struct extra_event_list_t {
        int event;
        int (*decode)(snd_midi_event_t *dev, unsigned char *buf, int len, const snd_seq_event_t *ev);
 } extra_event[] = {
@@ -549,12 +549,12 @@ static int extra_decode_ctrl14(snd_midi_event_t *dev, unsigned char *buf, int co
 static int extra_decode_xrpn(snd_midi_event_t *dev, unsigned char *buf, int count, const snd_seq_event_t *ev)
 {
        unsigned char cmd;
-       char *cbytes;
-       static char cbytes_nrpn[4] = { MIDI_CTL_NONREG_PARM_NUM_MSB,
+       const char *cbytes;
+       static const char cbytes_nrpn[4] = { MIDI_CTL_NONREG_PARM_NUM_MSB,
                                       MIDI_CTL_NONREG_PARM_NUM_LSB,
                                       MIDI_CTL_MSB_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_MSB_DATA_ENTRY,
                                       MIDI_CTL_LSB_DATA_ENTRY };