}
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,
#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;
* 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;
return " ";
}
-static struct config_category_t categories_array[] =
+static const struct config_category_t categories_array[] =
{
/* Interface */
{ CAT_INTERFACE, INTF_TITLE, INTF_HELP },
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,
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;
{ 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;
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;
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 );
}
-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;
}
}
-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;
#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,
-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,
};
#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,
{
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;
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,
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,
#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,
{
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;
/*****************************************************************************
* Codec fourcc -> ffmpeg_id mapping
*****************************************************************************/
-static struct
+static const struct
{
vlc_fourcc_t i_fourcc;
int i_codec;
STATE_SEND_DATA
};
-static int pi_channels_maps[7] =
+static const int pi_channels_maps[7] =
{
0,
AOUT_CHAN_CENTER,
}
/* 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,
int i_out;
};
-static int pi_channels_maps[6] =
+static const int pi_channels_maps[6] =
{
0,
AOUT_CHAN_CENTER,
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,
};
-static int pi_channels_maps[6] =
+static const int pi_channels_maps[6] =
{
0,
AOUT_CHAN_CENTER, AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
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;
};
* 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 */
int pi_chan_table[AOUT_CHAN_MAX];
};
-static int pi_channels_maps[9] =
+static const int pi_channels_maps[9] =
{
0,
AOUT_CHAN_CENTER,
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
};
};
/* Static mapping of macros type to macro strings */
-static struct
+static const struct
{
const char *psz_name;
int i_type;
#undef iargs
/** vm functions. KEEP IN SYNC WITH imports.h! */
-static asa_import_func importfuncs[] = {
+static const asa_import_func importfuncs[] = {
asai_commit,
asai_discard,
asai_break,
/* */
-static struct
+static const struct
{
const guid_t *p_id;
int i_type;
-static struct
+static const struct
{
vlc_fourcc_t i_fourcc;
const char *psz_type;
VLC_UNUSED( p_chk );
}
-static struct
+static const struct
{
vlc_fourcc_t i_fourcc;
int (*AVI_ChunkRead_function)( stream_t *s, avi_chunk_t *p_chk );
!strncmp( tracks[i_track]->psz_codec, "A_AAC/MPEG4/", strlen( "A_AAC/MPEG4/" ) ) )
{
int i_profile, i_srate, sbr = 0;
- static unsigned int i_sample_rates[] =
+ static const unsigned int i_sample_rates[] =
{
96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050,
16000, 12000, 11025, 8000, 7350, 0, 0, 0
if( p_drms->i_user == 0 && p_drms->i_key == 0 )
{
- static char const p_secret[] = "tr1-th3n.y00_by3";
+ static const char p_secret[] = "tr1-th3n.y00_by3";
memcpy( p_drms->p_key, p_secret, 16 );
REVERSE( p_drms->p_key, 4 );
}
uint32_t i_version )
{
char p_secret1[] = "Tv!*";
- static char const p_secret2[] = "____v8rhvsaAvOKM____FfUH%798=[;."
+ static const char p_secret2[] = "____v8rhvsaAvOKM____FfUH%798=[;."
"____f8677680a634____ba87fnOIf)(*";
unsigned int i;
static uint32_t i_secret = 0;
- static uint32_t p_secret3[] =
+ static const uint32_t p_secret3[] =
{
0xAAAAAAAA, 0x01757700, 0x00554580, 0x01724500, 0x00424580,
0x01427700, 0x00000080, 0xC1D59D01, 0x80144981, 0x815C8901,
*****************************************************************************/
static int GetSystemKey( uint32_t *p_sys_key, bool b_ipod )
{
- static char const p_secret5[ 8 ] = "YuaFlafu";
- static char const p_secret6[ 8 ] = "zPif98ga";
+ static const char p_secret5[ 8 ] = "YuaFlafu";
+ static const char p_secret6[ 8 ] = "zPif98ga";
struct md5_s md5;
int64_t i_ipod_id;
uint32_t p_system_hash[ 4 ];
*****************************************************************************/
static int GetUserKey( void *_p_drms, uint32_t *p_user_key )
{
- static char const p_secret7[] = "mUfnpognadfgf873";
+ static const char p_secret7[] = "mUfnpognadfgf873";
struct drms_s *p_drms = (struct drms_s *)_p_drms;
struct aes_s aes;
struct shuffle_s shuffle;
DWORD i_serial;
LPBYTE p_reg_buf;
- static LPCTSTR p_reg_keys[ 3 ][ 2 ] =
+ static const LPCTSTR p_reg_keys[ 3 ][ 2 ] =
{
{
_T("HARDWARE\\DESCRIPTION\\System"),
return 0; /* Needed for correct operation of go back */
}
-static struct
+static const struct
{
const char *psz_name;
const char *psz_option;
const char *psz_chroma;
};
-static struct preset_t p_presets[] =
+static const struct preset_t p_presets[] =
{
{ "sqcif", 128, 96, 29.97, "4:3", "YV12" },
{ "qcif", 176, 144, 29.97, "4:3", "YV12" },
uint32_t i_chroma;
char *psz_aspect_ratio;
unsigned int i_aspect = 0;
- struct preset_t *p_preset = NULL;
+ const struct preset_t *p_preset = NULL;
const uint8_t *p_peek;
bool b_valid = false;
bool b_y4m = false;
static int ParseDKS ( demux_t *, subtitle_t *, int );
static int ParseSubViewer1 ( demux_t *, subtitle_t *, int );
-static struct
+static const struct
{
const char *psz_type_name;
int i_type;
#define DEPTH_PL -1
#define DEPTH_SEL 1
-static int ItemUpdate_Type = QEvent::User + PLEventType + 2;
-static int ItemDelete_Type = QEvent::User + PLEventType + 3;
-static int ItemAppend_Type = QEvent::User + PLEventType + 4;
-static int PLUpdate_Type = QEvent::User + PLEventType + 5;
+static const int ItemUpdate_Type = QEvent::User + PLEventType + 2;
+static const int ItemDelete_Type = QEvent::User + PLEventType + 3;
+static const int ItemAppend_Type = QEvent::User + PLEventType + 4;
+static const int PLUpdate_Type = QEvent::User + PLEventType + 5;
class PLEvent : public QEvent
{
#ifdef UPDATE_CHECK
-static int UDOkEvent = QEvent::User + DialogEventType + 21;
-static int UDErrorEvent = QEvent::User + DialogEventType + 22;
+static const int UDOkEvent = QEvent::User + DialogEventType + 21;
+static const int UDErrorEvent = QEvent::User + DialogEventType + 22;
class UpdateDialog : public QVLCFrame
{
PLEventType = 200
};
-static int DialogEvent_Type = QEvent::User + DialogEventType + 1;
-//static int PLUndockEvent_Type = QEvent::User + DialogEventType + 2;
-//static int PLDockEvent_Type = QEvent::User + DialogEventType + 3;
-static int SetVideoOnTopEvent_Type = QEvent::User + DialogEventType + 4;
+static const int DialogEvent_Type = QEvent::User + DialogEventType + 1;
+//static const int PLUndockEvent_Type = QEvent::User + DialogEventType + 2;
+//static const int PLDockEvent_Type = QEvent::User + DialogEventType + 3;
+static const int SetVideoOnTopEvent_Type = QEvent::User + DialogEventType + 4;
class DialogEvent : public QEvent
{
static int Render( filter_t *p_filter, subpicture_region_t *p_region,
line_desc_t *p_line, int i_width, int i_height )
{
- static uint8_t pi_gamma[16] =
+ static const uint8_t pi_gamma[16] =
{0x00, 0x52, 0x84, 0x96, 0xb8, 0xca, 0xdc, 0xee, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
*
*****************************************************************************/
/* Functions to register */
-static luaL_Reg p_reg[] =
+static const luaL_Reg p_reg[] =
{
{ "peek", vlclua_demux_peek },
{ NULL, NULL }
};
/* Functions to register for parse() function call only */
-static luaL_Reg p_reg_parse[] =
+static const luaL_Reg p_reg_parse[] =
{
{ "read", vlclua_demux_read },
{ "readline", vlclua_demux_readline },
lua_setfield( L, -2, psz_name );
}
-static struct
+static const struct
{
const char *psz_shortcut;
const char *psz_name;
return config_GetPsz( p_intf, "lua-intf" );
}
-static luaL_Reg p_reg[] = { { NULL, NULL } };
+static const luaL_Reg p_reg[] = { { NULL, NULL } };
int Open_LuaIntf( vlc_object_t *p_this )
{
/*****************************************************************************
* Init lua
*****************************************************************************/
-static luaL_Reg p_reg[] = { { NULL, NULL } };
+static const luaL_Reg p_reg[] = { { NULL, NULL } };
static lua_State * vlclua_meta_init( vlc_object_t *p_this, input_item_t * p_item )
{
int i_logpy;
};
-static uint8_t pi_gamma[16] =
+static const uint8_t pi_gamma[16] =
{0x00, 0x41, 0x52, 0x63, 0x84, 0x85, 0x96, 0xa7, 0xb8, 0xc9,
0xca, 0xdb, 0xdc, 0xed, 0xee, 0xff};
static int64_t get_timestamp(void);
-static uint32_t mvhd_matrix[9] =
+static const uint32_t mvhd_matrix[9] =
{ 0x10000, 0, 0, 0, 0x10000, 0, 0, 0, 0x40000000 };
static bo_t *GetMoovBox( sout_mux_t *p_mux )
static int EncoderThread( struct sout_stream_sys_t * p_sys );
-static int pi_channels_maps[6] =
+static const int pi_channels_maps[6] =
{
0,
AOUT_CHAN_CENTER, AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
- p_src->p[1].i_visible_pitch;
/* The dithering matrices */
- static int dither10[4] = { 0x0, 0x8, 0x2, 0xa };
- static int dither11[4] = { 0xc, 0x4, 0xe, 0x6 };
- static int dither12[4] = { 0x3, 0xb, 0x1, 0x9 };
- static int dither13[4] = { 0xf, 0x7, 0xd, 0x5 };
-
- static int dither20[4] = { 0x0, 0x10, 0x4, 0x14 };
- static int dither21[4] = { 0x18, 0x8, 0x1c, 0xc };
- static int dither22[4] = { 0x6, 0x16, 0x2, 0x12 };
- static int dither23[4] = { 0x1e, 0xe, 0x1a, 0xa };
+ static const int dither10[4] = { 0x0, 0x8, 0x2, 0xa };
+ static const int dither11[4] = { 0xc, 0x4, 0xe, 0x6 };
+ static const int dither12[4] = { 0x3, 0xb, 0x1, 0x9 };
+ static const int dither13[4] = { 0xf, 0x7, 0xd, 0x5 };
+
+ static const int dither20[4] = { 0x0, 0x10, 0x4, 0x14 };
+ static const int dither21[4] = { 0x18, 0x8, 0x1c, 0xc };
+ static const int dither22[4] = { 0x6, 0x16, 0x2, 0x12 };
+ static const int dither23[4] = { 0x1e, 0xe, 0x1a, 0xa };
SetOffset( p_filter->fmt_in.video.i_width,
p_filter->fmt_in.video.i_height,
#define FILTERMODE_TEXT N_("Filter mode")
#define FILTERMODE_LONGTEXT N_("kind of filtering which should be use to "\
"calcuate the color output")
-static int pi_filtermode_values[] = {
+static const int pi_filtermode_values[] = {
(int)afmNoFilter,
(int)afmCombined,
(int)afmPercent
};
-static const char *ppsz_filtermode_descriptions[] = {
+static const char *const ppsz_filtermode_descriptions[] = {
N_("No Filtering"),
N_("Combined"),
N_("Percent")
#define CHANNELASSIGN_LONGTEXT N_("Maps the hardware channel X to logical "\
"channel Y to fix wrong wiring :-)")
-static int pi_channel_assignment_values[] = {
+static const int pi_channel_assignment_values[] = {
-1,
0,
1,
3,
4
};
-static const char *ppsz_channel_assignment_descriptions[] = {
+static const char *const ppsz_channel_assignment_descriptions[] = {
N_("disabled"),
N_("summary"),
N_("left"),
/*****************************************************************************
* Command functions
*****************************************************************************/
-static commanddesc_t p_commands[] =
+static const commanddesc_t p_commands[] =
{
{ .psz_command = "DataSharedMem",
.b_atomic = true,
/*****************************************************************************
* Key events handling
*****************************************************************************/
-static struct
+static const struct
{
SDLKey sdl_key;
int i_vlckey;
/* following functions are local */
-static unsigned accel_priority[] = {
+static const unsigned accel_priority[] = {
VLC_XVMC_ACCEL_VLD,
};
aout_buffer_t *, aout_buffer_t * );
static int FilterCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
-static struct
+static const struct
{
const char *psz_name;
int (*pf_run)( visual_effect_t *, aout_instance_t *,
{
int this_option_optind = optind ? optind : 1;
int option_index = 0;
- static struct option long_options[] =
+ static const struct option long_options[] =
{
{"add", 1, 0, 0},
{"append", 0, 0, 0},
* Misc functions
*
*/
-static struct
+static const struct
{
vlc_fourcc_t i_codec;
const char *psz_ext;
*/
char *mstrtime( char *psz_buffer, mtime_t date )
{
- static mtime_t ll1000 = 1000, ll60 = 60, ll24 = 24;
+ static const mtime_t ll1000 = 1000, ll60 = 60, ll24 = 24;
snprintf( psz_buffer, MSTRTIME_MAX_SIZE, "%02d:%02d:%02d-%03d.%03d",
(int) (date / (ll1000 * ll1000 * ll60 * ll60) % ll24),
/*****************************************************************************
* Various functions
*****************************************************************************/
-static struct
+static const struct
{
const char psz_ext[8];
const char *psz_mime;