Commit 5f8cd399 authored by Justus Piater's avatar Justus Piater Committed by Rémi Denis-Courmont
Browse files

Declared many static variables const



Signed-off-by: default avatarRémi Denis-Courmont <rdenis@simphalempin.com>
parent c75cb72e
......@@ -50,7 +50,7 @@ static inline int bs_eof( bs_t *s )
}
static inline uint32_t bs_read( bs_t *s, int i_count )
{
static uint32_t i_mask[33] =
static const uint32_t i_mask[33] =
{ 0x00,
0x01, 0x03, 0x07, 0x0f,
0x1f, 0x3f, 0x7f, 0xff,
......
......@@ -286,7 +286,7 @@ static const GUID VLC_KSDATAFORMAT_SUBTYPE_UNKNOWN = {0x00000000, 0x0000, 0x0000
#define WAVE_SPEAKER_TOP_BACK_RIGHT 0x20000
#define WAVE_SPEAKER_RESERVED 0x80000000
static struct
static const struct
{
uint16_t i_tag;
vlc_fourcc_t i_fourcc;
......@@ -354,7 +354,7 @@ static inline void fourcc_to_wf_tag( vlc_fourcc_t fcc, uint16_t *pi_tag )
* to determine the actual format. Microsoft has stopped giving out wFormatTag
* assignments in lieu of letting 3rd parties generate their own GUIDs
*/
static struct
static const struct
{
GUID guid_tag;
vlc_fourcc_t i_fourcc;
......
......@@ -241,7 +241,7 @@ static inline const char * GetCapabilityHelp( char *psz_capability, int i_type)
return " ";
}
static struct config_category_t categories_array[] =
static const struct config_category_t categories_array[] =
{
/* Interface */
{ CAT_INTERFACE, INTF_TITLE, INTF_HELP },
......
......@@ -66,7 +66,7 @@ static int gcry_vlc_mutex_unlock( void **lock )
return VLC_SUCCESS;
}
static struct gcry_thread_cbs gcry_threads_vlc =
static const struct gcry_thread_cbs gcry_threads_vlc =
{
GCRY_THREAD_OPTION_USER,
NULL,
......
......@@ -435,7 +435,7 @@ static int AccessControlResetCallback( vlc_object_t *p_this,
const char *psz_var, vlc_value_t oldval,
vlc_value_t newval, void *p_data );
static struct
static const struct
{
unsigned int i_v4l2;
int i_fourcc;
......@@ -480,7 +480,7 @@ static const __u32 p_chroma_fallbacks[] =
{ V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_YVU420, V4L2_PIX_FMT_YUV422P,
V4L2_PIX_FMT_YUYV, V4L2_PIX_FMT_UYVY, V4L2_PIX_FMT_MJPEG };
static struct
static const struct
{
const char *psz_name;
unsigned int i_cid;
......
......@@ -117,7 +117,7 @@ static block_t *S8toU8( filter_t *, block_t * );
static block_t *Swap16( filter_t *, block_t * );
static block_t *Swap24( filter_t *, block_t * );
static struct
static const struct
{
vlc_fourcc_t i_src;
vlc_fourcc_t i_dst;
......
......@@ -51,12 +51,12 @@ static void Close ( vlc_object_t * );
static void DoWork ( aout_instance_t *, aout_filter_t *, aout_buffer_t *,
aout_buffer_t * );
static void FilterFloatUP( float Imp[], float ImpD[], uint16_t Nwing,
static void FilterFloatUP( const float Imp[], const float ImpD[], uint16_t Nwing,
float *f_in, float *f_out, uint32_t ui_remainder,
uint32_t ui_output_rate, int16_t Inc,
int i_nb_channels );
static void FilterFloatUD( float Imp[], float ImpD[], uint16_t Nwing,
static void FilterFloatUD( const float Imp[], const float ImpD[], uint16_t Nwing,
float *f_in, float *f_out, uint32_t ui_remainder,
uint32_t ui_output_rate, uint32_t ui_input_rate,
int16_t Inc, int i_nb_channels );
......@@ -449,11 +449,11 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
}
void FilterFloatUP( float Imp[], float ImpD[], uint16_t Nwing, float *p_in,
void FilterFloatUP( const float Imp[], const float ImpD[], uint16_t Nwing, float *p_in,
float *p_out, uint32_t ui_remainder,
uint32_t ui_output_rate, int16_t Inc, int i_nb_channels )
{
float *Hp, *Hdp, *End;
const float *Hp, *Hdp, *End;
float t, temp;
uint32_t ui_linear_remainder;
int i;
......@@ -492,12 +492,12 @@ void FilterFloatUP( float Imp[], float ImpD[], uint16_t Nwing, float *p_in,
}
}
void FilterFloatUD( float Imp[], float ImpD[], uint16_t Nwing, float *p_in,
void FilterFloatUD( const float Imp[], const float ImpD[], uint16_t Nwing, float *p_in,
float *p_out, uint32_t ui_remainder,
uint32_t ui_output_rate, uint32_t ui_input_rate,
int16_t Inc, int i_nb_channels )
{
float *Hp, *Hdp, *End;
const float *Hp, *Hdp, *End;
float t, temp;
uint32_t ui_linear_remainder;
int i, ui_counter = 0;
......
......@@ -46,7 +46,7 @@
#define SMALL_FILTER_NMULT ((int16_t)13)
#define SMALL_FILTER_SCALE 13128 /* Unity-gain scale factor */
#define SMALL_FILTER_NWING 1536 /* Filter table length */
static float SMALL_FILTER_FLOAT_IMP[] /* Impulse response */ = {
static const float SMALL_FILTER_FLOAT_IMP[] /* Impulse response */ = {
0.900000,
0.899980,
0.899920,
......@@ -1585,7 +1585,7 @@ static float SMALL_FILTER_FLOAT_IMP[] /* Impulse response */ = {
-0.000046
};
static float SMALL_FILTER_FLOAT_IMPD[] /* Impulse response */ = {
static const float SMALL_FILTER_FLOAT_IMPD[] /* Impulse response */ = {
-0.000020,
-0.000060,
-0.000100,
......
......@@ -56,7 +56,7 @@ struct aout_sys_t
};
#define CHANNELS_MAX 6
static int pi_channels_maps[CHANNELS_MAX+1] =
static const int pi_channels_maps[CHANNELS_MAX+1] =
{
0,
AOUT_CHAN_CENTER,
......@@ -138,7 +138,7 @@ static int Open( vlc_object_t * p_this )
{
aout_instance_t * p_aout = (aout_instance_t *)p_this;
char * psz_name, * psz_format;
const char ** ppsz_compare = format_list;
const char * const * ppsz_compare = format_list;
vlc_value_t val;
int i_channels, i = 0;
......
......@@ -508,7 +508,7 @@ struct encoder_sys_t
int i_s16tolog; /* used with int16_t to m/alaw */
};
static int8_t alaw_encode[2049] =
static const int8_t alaw_encode[2049] =
{
0xD5, 0xD4, 0xD7, 0xD6, 0xD1, 0xD0, 0xD3, 0xD2, 0xDD, 0xDC, 0xDF, 0xDE,
0xD9, 0xD8, 0xDB, 0xDA, 0xC5, 0xC4, 0xC7, 0xC6, 0xC1, 0xC0, 0xC3, 0xC2,
......@@ -683,7 +683,7 @@ static int8_t alaw_encode[2049] =
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x2A
}; /* alaw_encode */
static int8_t ulaw_encode[8193] =
static const int8_t ulaw_encode[8193] =
{
0xFF, 0xFE, 0xFE, 0xFD, 0xFD, 0xFC, 0xFC, 0xFB, 0xFB, 0xFA, 0xFA, 0xF9,
0xF9, 0xF8, 0xF8, 0xF7, 0xF7, 0xF6, 0xF6, 0xF5, 0xF5, 0xF4, 0xF4, 0xF3,
......
......@@ -45,7 +45,7 @@
#include "avcodec.h"
static unsigned int pi_channels_maps[7] =
static const unsigned int pi_channels_maps[7] =
{
0,
AOUT_CHAN_CENTER, AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
......
......@@ -30,7 +30,7 @@ void LibavutilCallback( void *p_opaque, int i_level,
{
int i_vlc_level;
AVCodecContext *p_avctx = (AVCodecContext *)p_opaque;
AVClass *p_avc;
const AVClass *p_avc;
vlc_object_t *p_this;
char *psz_new_format;
const char *psz_item_name;
......
......@@ -25,7 +25,7 @@
/*****************************************************************************
* Codec fourcc -> ffmpeg_id mapping
*****************************************************************************/
static struct
static const struct
{
vlc_fourcc_t i_fourcc;
int i_codec;
......
......@@ -107,7 +107,7 @@ enum {
STATE_SEND_DATA
};
static int pi_channels_maps[7] =
static const int pi_channels_maps[7] =
{
0,
AOUT_CHAN_CENTER,
......@@ -1121,7 +1121,7 @@ static uint64_t read_utf8( const uint8_t *p_buf, int *pi_read )
}
/* CRC-8, poly = x^8 + x^2 + x^1 + x^0, init = 0 */
static uint8_t const flac_crc8_table[256] = {
static const uint8_t flac_crc8_table[256] = {
0x00, 0x07, 0x0E, 0x09, 0x1C, 0x1B, 0x12, 0x15,
0x38, 0x3F, 0x36, 0x31, 0x24, 0x23, 0x2A, 0x2D,
0x70, 0x77, 0x7E, 0x79, 0x6C, 0x6B, 0x62, 0x65,
......
......@@ -203,7 +203,7 @@ struct decoder_sys_t
int i_out;
};
static int pi_channels_maps[6] =
static const int pi_channels_maps[6] =
{
0,
AOUT_CHAN_CENTER,
......
......@@ -155,7 +155,7 @@ typedef struct __attribute__((__packed__)) {
void *__builtin_new(unsigned long size) {return malloc(size);}
void __builtin_delete(void *p) {free(p);}
static int pi_channels_maps[7] =
static const int pi_channels_maps[7] =
{
0,
AOUT_CHAN_CENTER,
......
......@@ -72,7 +72,7 @@ struct decoder_sys_t
};
static int pi_channels_maps[6] =
static const int pi_channels_maps[6] =
{
0,
AOUT_CHAN_CENTER, AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
......
......@@ -99,7 +99,7 @@ struct decoder_sys_t
mtime_t prev_pts;
int i_page[9];
bool b_erase[9];
uint16_t * pi_active_national_set[9];
const uint16_t * pi_active_national_set[9];
int i_wanted_page, i_wanted_magazine;
bool b_ignore_sub_flag;
};
......@@ -119,7 +119,7 @@ struct decoder_sys_t
* 0x08 0x09 0x0a 0x0b 0x0c 0x0d (apparently a control character) 0x0e 0x0f
*/
static uint16_t ppi_national_subsets[][20] =
static const uint16_t ppi_national_subsets[][20] =
{
{ 0x00a3, 0x0024, 0x0040, 0x00ab, 0x00bd, 0x00bb, 0x005e, 0x0023,
0x002d, 0x00bc, 0x00a6, 0x00be, 0x00f7 }, /* english ,000 */
......
......@@ -95,7 +95,7 @@ struct decoder_sys_t
int pi_chan_table[AOUT_CHAN_MAX];
};
static int pi_channels_maps[9] =
static const int pi_channels_maps[9] =
{
0,
AOUT_CHAN_CENTER,
......
......@@ -214,17 +214,17 @@ DBUS_METHOD( handle_root );
DBUS_METHOD( handle_player );
DBUS_METHOD( handle_tracklist );
static DBusObjectPathVTable vlc_dbus_root_vtable = {
static const DBusObjectPathVTable vlc_dbus_root_vtable = {
NULL, handle_root, /* handler function */
NULL, NULL, NULL, NULL
};
static DBusObjectPathVTable vlc_dbus_player_vtable = {
static const DBusObjectPathVTable vlc_dbus_player_vtable = {
NULL, handle_player, /* handler function */
NULL, NULL, NULL, NULL
};
static DBusObjectPathVTable vlc_dbus_tracklist_vtable = {
static const DBusObjectPathVTable vlc_dbus_tracklist_vtable = {
NULL, handle_tracklist, /* handler function */
NULL, NULL, NULL, NULL
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment