1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Add missing "const" all over the place.

Only "./configure --enable-gpl" on x86 was tested.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This commit is contained in:
Reimar Döffinger 2014-08-29 00:32:32 +02:00
parent be4aac302b
commit d9e2aceb7f
32 changed files with 57 additions and 57 deletions

View File

@ -91,7 +91,7 @@ enum HTTPState {
RTSPSTATE_SEND_PACKET,
};
static const char *http_state[] = {
static const char * const http_state[] = {
"HTTP_WAIT_REQUEST",
"HTTP_SEND_HEADER",

View File

@ -53,7 +53,7 @@ static const uint8_t run_value_bits_short[16] = {
3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9
};
static const uint8_t *run_value_bits[2] = {
static const uint8_t * const run_value_bits[2] = {
run_value_bits_long, run_value_bits_short
};

View File

@ -132,7 +132,7 @@ static const uint8_t aic_c_ext_scan[192] = {
177, 184, 176, 169, 162, 161, 168, 160,
};
static const uint8_t *aic_scan[NUM_BANDS] = {
static const uint8_t * const aic_scan[NUM_BANDS] = {
aic_y_scan, aic_c_scan, aic_y_ext_scan, aic_c_ext_scan
};

View File

@ -84,52 +84,52 @@ av_cold void ff_atrac3p_init_vlcs(void)
{
int i, wl_vlc_offs, ct_vlc_offs, sf_vlc_offs, tab_offset;
static int wl_nb_bits[4] = { 2, 3, 5, 5 };
static int wl_nb_codes[4] = { 3, 5, 8, 8 };
static const uint8_t *wl_bits[4] = {
static const int wl_nb_bits[4] = { 2, 3, 5, 5 };
static const int wl_nb_codes[4] = { 3, 5, 8, 8 };
static const uint8_t * const wl_bits[4] = {
atrac3p_wl_huff_bits1, atrac3p_wl_huff_bits2,
atrac3p_wl_huff_bits3, atrac3p_wl_huff_bits4
};
static const uint8_t *wl_codes[4] = {
static const uint8_t * const wl_codes[4] = {
atrac3p_wl_huff_code1, atrac3p_wl_huff_code2,
atrac3p_wl_huff_code3, atrac3p_wl_huff_code4
};
static const uint8_t *wl_xlats[4] = {
static const uint8_t * const wl_xlats[4] = {
atrac3p_wl_huff_xlat1, atrac3p_wl_huff_xlat2, NULL, NULL
};
static int ct_nb_bits[4] = { 3, 4, 4, 4 };
static int ct_nb_codes[4] = { 4, 8, 8, 8 };
static const uint8_t *ct_bits[4] = {
static const int ct_nb_bits[4] = { 3, 4, 4, 4 };
static const int ct_nb_codes[4] = { 4, 8, 8, 8 };
static const uint8_t * const ct_bits[4] = {
atrac3p_ct_huff_bits1, atrac3p_ct_huff_bits2,
atrac3p_ct_huff_bits2, atrac3p_ct_huff_bits3
};
static const uint8_t *ct_codes[4] = {
static const uint8_t * const ct_codes[4] = {
atrac3p_ct_huff_code1, atrac3p_ct_huff_code2,
atrac3p_ct_huff_code2, atrac3p_ct_huff_code3
};
static const uint8_t *ct_xlats[4] = {
static const uint8_t * const ct_xlats[4] = {
NULL, NULL, atrac3p_ct_huff_xlat1, NULL
};
static int sf_nb_bits[8] = { 9, 9, 9, 9, 6, 6, 7, 7 };
static int sf_nb_codes[8] = { 64, 64, 64, 64, 16, 16, 16, 16 };
static const uint8_t *sf_bits[8] = {
static const int sf_nb_bits[8] = { 9, 9, 9, 9, 6, 6, 7, 7 };
static const int sf_nb_codes[8] = { 64, 64, 64, 64, 16, 16, 16, 16 };
static const uint8_t * const sf_bits[8] = {
atrac3p_sf_huff_bits1, atrac3p_sf_huff_bits1, atrac3p_sf_huff_bits2,
atrac3p_sf_huff_bits3, atrac3p_sf_huff_bits4, atrac3p_sf_huff_bits4,
atrac3p_sf_huff_bits5, atrac3p_sf_huff_bits6
};
static const uint16_t *sf_codes[8] = {
static const uint16_t * const sf_codes[8] = {
atrac3p_sf_huff_code1, atrac3p_sf_huff_code1, atrac3p_sf_huff_code2,
atrac3p_sf_huff_code3, atrac3p_sf_huff_code4, atrac3p_sf_huff_code4,
atrac3p_sf_huff_code5, atrac3p_sf_huff_code6
};
static const uint8_t *sf_xlats[8] = {
static const uint8_t * const sf_xlats[8] = {
atrac3p_sf_huff_xlat1, atrac3p_sf_huff_xlat2, NULL, NULL,
atrac3p_sf_huff_xlat4, atrac3p_sf_huff_xlat5, NULL, NULL
};
static const uint8_t *gain_cbs[11] = {
static const uint8_t * const gain_cbs[11] = {
atrac3p_huff_gain_npoints1_cb, atrac3p_huff_gain_npoints1_cb,
atrac3p_huff_gain_lev1_cb, atrac3p_huff_gain_lev2_cb,
atrac3p_huff_gain_lev3_cb, atrac3p_huff_gain_lev4_cb,
@ -137,7 +137,7 @@ av_cold void ff_atrac3p_init_vlcs(void)
atrac3p_huff_gain_loc4_cb, atrac3p_huff_gain_loc2_cb,
atrac3p_huff_gain_loc5_cb
};
static const uint8_t *gain_xlats[11] = {
static const uint8_t * const gain_xlats[11] = {
NULL, atrac3p_huff_gain_npoints2_xlat, atrac3p_huff_gain_lev1_xlat,
atrac3p_huff_gain_lev2_xlat, atrac3p_huff_gain_lev3_xlat,
atrac3p_huff_gain_lev4_xlat, atrac3p_huff_gain_loc3_xlat,
@ -145,13 +145,13 @@ av_cold void ff_atrac3p_init_vlcs(void)
atrac3p_huff_gain_loc2_xlat, atrac3p_huff_gain_loc5_xlat
};
static const uint8_t *tone_cbs[7] = {
static const uint8_t * const tone_cbs[7] = {
atrac3p_huff_tonebands_cb, atrac3p_huff_numwavs1_cb,
atrac3p_huff_numwavs2_cb, atrac3p_huff_wav_ampsf1_cb,
atrac3p_huff_wav_ampsf2_cb, atrac3p_huff_wav_ampsf3_cb,
atrac3p_huff_freq_cb
};
static const uint8_t *tone_xlats[7] = {
static const uint8_t * const tone_xlats[7] = {
NULL, NULL, atrac3p_huff_numwavs2_xlat, atrac3p_huff_wav_ampsf1_xlat,
atrac3p_huff_wav_ampsf2_xlat, atrac3p_huff_wav_ampsf3_xlat,
atrac3p_huff_freq_xlat

View File

@ -38,12 +38,12 @@ static const uint8_t bitstream_sfreq[] = { 1, 2, 3, 6, 7, 8, 11, 12, 13 };
/* Auditory filter center frequencies and bandwidths, in Hz.
* The last two are made up, because there is no scientific data.
*/
static uint16_t fc[] = {
static const uint16_t fc[] = {
50, 150, 250, 350, 450, 570, 700, 840, 1000, 1170, 1370, 1600, 1850, 2150,
2500, 2900, 3400, 4000, 4800, 5800, 7000, 8500, 10500, 13500, 17000
};
static uint16_t erb[] = {
static const uint16_t erb[] = {
80, 100, 100, 100, 110, 120, 140, 150, 160, 190, 210, 240, 280,
320, 380, 450, 550, 700, 900, 1100, 1300, 1800, 2500, 3500, 4500
};

View File

@ -1451,7 +1451,7 @@ static const float * const evrc_lspq_quant_codebooks[] = {
evrc_lspq_quant_codebook1[0], evrc_lspq_quant_codebook2[0],
};
static const float * const *evrc_lspq_codebooks[] = {
static const float * const * const evrc_lspq_codebooks[] = {
0,
evrc_lspq_quant_codebooks,
0,

View File

@ -77,7 +77,7 @@ static const int16_t low_inv_quant5[32] = {
587, 473, 370, 276, 190, 110, 35, -35
};
static const int16_t *low_inv_quants[3] = { ff_g722_low_inv_quant6,
static const int16_t * const low_inv_quants[3] = { ff_g722_low_inv_quant6,
low_inv_quant5,
ff_g722_low_inv_quant4 };

View File

@ -118,8 +118,8 @@ static uint8_t requant_tab[8][128];
*/
static av_cold void build_requant_tab(void)
{
static int8_t offsets[8] = { 1, 1, 2, -3, -3, 3, 4, 4 };
static int8_t deltas [8] = { 0, 1, 0, 4, 4, 1, 0, 1 };
static const int8_t offsets[8] = { 1, 1, 2, -3, -3, 3, 4, 4 };
static const int8_t deltas [8] = { 0, 1, 0, 4, 4, 1, 0, 1 };
int i, j, step;

View File

@ -61,7 +61,7 @@ static const uint8_t ivi4_horizontal_scan_4x4[16] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
};
static const uint8_t *scan_index_to_tab[15] = {
static const uint8_t * const scan_index_to_tab[15] = {
// for 8x8 transforms
ff_zigzag_direct,
ivi4_alternate_scan_8x8,

View File

@ -81,7 +81,7 @@ static const uint8_t run_value_bits_short[16] = {
3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9
};
static const uint8_t *run_value_bits[2] = {
static const uint8_t * const run_value_bits[2] = {
run_value_bits_long, run_value_bits_short
};

View File

@ -41,7 +41,7 @@ static av_cold int mov_text_encode_init(AVCodecContext *avctx)
* For now, we'll use a fixed default style. When we add styling
* support, this will be generated from the ASS style.
*/
static uint8_t text_sample_entry[] = {
static const uint8_t text_sample_entry[] = {
0x00, 0x00, 0x00, 0x00, // uint32_t displayFlags
0x01, // int8_t horizontal-justification
0xFF, // int8_t vertical-justification

View File

@ -59,7 +59,7 @@
#define WA (SQRT_2 * (-C3 - C5))
#define WB (SQRT_2 * (C5 - C3))
static vector float fdctconsts[3] = {
static const vector float fdctconsts[3] = {
{ W0, W1, W2, W3 },
{ W4, W5, W6, W7 },
{ W8, W9, WA, WB }

View File

@ -139,7 +139,7 @@ const float ff_pow_0_5[] = {
1.0/(1 << 13), 1.0/(1 << 14), 1.0/(1 << 15), 1.0/(1 << 16)
};
static void dequant(float *out, const int *idx, const float *cbs[])
static void dequant(float *out, const int *idx, const float * const cbs[])
{
int i;
int stride = 2;

View File

@ -206,7 +206,7 @@ static const float lsf_cb5[32][2] = {
{ 0.150514, 0.034366}, { 0.186092, -0.069272}
};
static const float *lsf_codebooks[] = {
static const float * const lsf_codebooks[] = {
lsf_cb1[0], lsf_cb2[0], lsf_cb3[0], lsf_cb4[0], lsf_cb5[0]
};

View File

@ -637,7 +637,7 @@ static const WavPackDecorrSpec very_high_specs[] = {
{ 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } },
};
static const WavPackDecorrSpec *decorr_filters[] = {
static const WavPackDecorrSpec * const decorr_filters[] = {
&fast_specs[0], &default_specs[0], &high_specs[0], &very_high_specs[0],
};

View File

@ -44,12 +44,12 @@ extern char ff_mlp_iirorder_2;
extern char ff_mlp_iirorder_1;
extern char ff_mlp_iirorder_0;
static const void *firtable[9] = { &ff_mlp_firorder_0, &ff_mlp_firorder_1,
static const void * const firtable[9] = { &ff_mlp_firorder_0, &ff_mlp_firorder_1,
&ff_mlp_firorder_2, &ff_mlp_firorder_3,
&ff_mlp_firorder_4, &ff_mlp_firorder_5,
&ff_mlp_firorder_6, &ff_mlp_firorder_7,
&ff_mlp_firorder_8 };
static const void *iirtable[5] = { &ff_mlp_iirorder_0, &ff_mlp_iirorder_1,
static const void * const iirtable[5] = { &ff_mlp_iirorder_0, &ff_mlp_iirorder_1,
&ff_mlp_iirorder_2, &ff_mlp_iirorder_3,
&ff_mlp_iirorder_4 };

View File

@ -61,7 +61,7 @@ extern emu_edge_vfix_func ff_emu_edge_vfix20_mmx;
extern emu_edge_vfix_func ff_emu_edge_vfix21_mmx;
extern emu_edge_vfix_func ff_emu_edge_vfix22_mmx;
#if ARCH_X86_32
static emu_edge_vfix_func *vfixtbl_mmx[22] = {
static emu_edge_vfix_func * const vfixtbl_mmx[22] = {
&ff_emu_edge_vfix1_mmx, &ff_emu_edge_vfix2_mmx, &ff_emu_edge_vfix3_mmx,
&ff_emu_edge_vfix4_mmx, &ff_emu_edge_vfix5_mmx, &ff_emu_edge_vfix6_mmx,
&ff_emu_edge_vfix7_mmx, &ff_emu_edge_vfix8_mmx, &ff_emu_edge_vfix9_mmx,
@ -80,7 +80,7 @@ extern emu_edge_vfix_func ff_emu_edge_vfix19_sse;
extern emu_edge_vfix_func ff_emu_edge_vfix20_sse;
extern emu_edge_vfix_func ff_emu_edge_vfix21_sse;
extern emu_edge_vfix_func ff_emu_edge_vfix22_sse;
static emu_edge_vfix_func *vfixtbl_sse[22] = {
static emu_edge_vfix_func * const vfixtbl_sse[22] = {
ff_emu_edge_vfix1_mmx, ff_emu_edge_vfix2_mmx, ff_emu_edge_vfix3_mmx,
ff_emu_edge_vfix4_mmx, ff_emu_edge_vfix5_mmx, ff_emu_edge_vfix6_mmx,
ff_emu_edge_vfix7_mmx, ff_emu_edge_vfix8_mmx, ff_emu_edge_vfix9_mmx,
@ -109,7 +109,7 @@ extern emu_edge_hfix_func ff_emu_edge_hfix18_mmx;
extern emu_edge_hfix_func ff_emu_edge_hfix20_mmx;
extern emu_edge_hfix_func ff_emu_edge_hfix22_mmx;
#if ARCH_X86_32
static emu_edge_hfix_func *hfixtbl_mmx[11] = {
static emu_edge_hfix_func * const hfixtbl_mmx[11] = {
ff_emu_edge_hfix2_mmx, ff_emu_edge_hfix4_mmx, ff_emu_edge_hfix6_mmx,
ff_emu_edge_hfix8_mmx, ff_emu_edge_hfix10_mmx, ff_emu_edge_hfix12_mmx,
ff_emu_edge_hfix14_mmx, ff_emu_edge_hfix16_mmx, ff_emu_edge_hfix18_mmx,
@ -121,7 +121,7 @@ extern emu_edge_hfix_func ff_emu_edge_hfix16_sse2;
extern emu_edge_hfix_func ff_emu_edge_hfix18_sse2;
extern emu_edge_hfix_func ff_emu_edge_hfix20_sse2;
extern emu_edge_hfix_func ff_emu_edge_hfix22_sse2;
static emu_edge_hfix_func *hfixtbl_sse2[11] = {
static emu_edge_hfix_func * const hfixtbl_sse2[11] = {
ff_emu_edge_hfix2_mmx, ff_emu_edge_hfix4_mmx, ff_emu_edge_hfix6_mmx,
ff_emu_edge_hfix8_mmx, ff_emu_edge_hfix10_mmx, ff_emu_edge_hfix12_mmx,
ff_emu_edge_hfix14_mmx, ff_emu_edge_hfix16_sse2, ff_emu_edge_hfix18_sse2,

View File

@ -80,7 +80,7 @@ typedef struct VideoData {
#define VIDEO_FORMAT NTSC
#endif
static int bktr_dev[] = { METEOR_DEV0, METEOR_DEV1, METEOR_DEV2,
static const int bktr_dev[] = { METEOR_DEV0, METEOR_DEV1, METEOR_DEV2,
METEOR_DEV3, METEOR_DEV_SVIDEO };
uint8_t *video_buf;

View File

@ -164,7 +164,7 @@ typedef struct OpenGLVertexInfo
} OpenGLVertexInfo;
/* defines 2 triangles to display */
static GLushort g_index[6] =
static const GLushort g_index[6] =
{
0, 1, 2,
0, 3, 2,

View File

@ -38,7 +38,7 @@
#include "internal.h"
#include "af_volume.h"
static const char *precision_str[] = {
static const char * const precision_str[] = {
"fixed", "float", "double"
};

View File

@ -72,7 +72,7 @@ static av_cold int init(AVFilterContext *ctx)
}
enum perm { RO, RW };
static const char *perm_str[2] = { "RO", "RW" };
static const char * const perm_str[2] = { "RO", "RW" };
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{

View File

@ -158,7 +158,7 @@ static void calc_coefficients(AVFilterContext *ctx)
}
}
static const char *color_modes[] = {"bt709", "fcc", "bt601", "smpte240m"};
static const char * const color_modes[] = {"bt709", "fcc", "bt601", "smpte240m"};
static av_cold int init(AVFilterContext *ctx)
{

View File

@ -272,7 +272,7 @@ struct ft_error
{
int err;
const char *err_msg;
} static ft_errors[] =
} static const ft_errors[] =
#include FT_ERRORS_H
#define FT_ERRMSG(e) ft_errors[e].err_msg

View File

@ -76,7 +76,7 @@ enum EOFAction {
EOF_ACTION_PASS
};
static const char *eof_action_str[] = {
static const char * const eof_action_str[] = {
"repeat", "endall", "pass"
};

View File

@ -38,7 +38,7 @@
#include <float.h>
static const char *var_names[] = {
static const char * const var_names[] = {
"in_w" , "iw", ///< width of the input video
"in_h" , "ih", ///< height of the input video
"out_w", "ow", ///< width of the input video
@ -130,7 +130,7 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
static enum PixelFormat pix_fmts[] = {
static const enum PixelFormat pix_fmts[] = {
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA,
AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA,

View File

@ -254,7 +254,7 @@ static const AVOption subtitles_options[] = {
{NULL},
};
static const char *font_mimetypes[] = {
static const char * const font_mimetypes[] = {
"application/x-truetype-font",
"application/vnd.ms-opentype",
"application/x-font-ttf",

View File

@ -60,7 +60,7 @@ typedef struct ModPlugContext {
AVExpr *expr; ///< parsed color eval expression
} ModPlugContext;
static const char *var_names[] = {
static const char * const var_names[] = {
"x", "y",
"w", "h",
"t",

View File

@ -344,7 +344,7 @@ static const struct MovChannelLayoutMap mov_ch_layout_map_9ch[] = {
{ 0, 0 },
};
static const struct MovChannelLayoutMap *mov_ch_layout_map[] = {
static const struct MovChannelLayoutMap * const mov_ch_layout_map[] = {
mov_ch_layout_map_misc,
mov_ch_layout_map_1ch,
mov_ch_layout_map_2ch,

View File

@ -74,7 +74,7 @@ RTSP_STATUS_VERSION =505,
RTSP_STATUS_UNSUPPORTED_OPTION =551,
};
static const av_unused char *rtsp_status_strings[] = {
static const av_unused char * const rtsp_status_strings[] = {
[RTSP_STATUS_CONTINUE] ="Continue",
[RTSP_STATUS_OK] ="OK",
[RTSP_STATUS_CREATED] ="Created",

View File

@ -28,7 +28,7 @@
#include "audio_data.h"
#include "audio_mix.h"
static const char *coeff_type_names[] = { "q8", "q15", "flt" };
static const char * const coeff_type_names[] = { "q8", "q15", "flt" };
struct AudioMix {
AVAudioResampleContext *avr;

View File

@ -72,7 +72,7 @@ int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type)
const char *av_get_colorspace_name(enum AVColorSpace val)
{
static const char *name[] = {
static const char * const name[] = {
[AVCOL_SPC_RGB] = "GBR",
[AVCOL_SPC_BT709] = "bt709",
[AVCOL_SPC_FCC] = "fcc",

View File

@ -154,7 +154,7 @@ static const struct PPFilter filters[]=
{NULL, NULL,0,0,0,0} //End Marker
};
static const char *replaceTable[]=
static const char * const replaceTable[]=
{
"default", "hb:a,vb:a,dr:a",
"de", "hb:a,vb:a,dr:a",