Start using const for non-mutating variables

This commit is contained in:
twinaphex 2015-05-20 19:28:05 +02:00
parent e779c25801
commit 679feefae3
5 changed files with 9 additions and 6 deletions

View File

@ -2229,7 +2229,7 @@ bool config_save_file(const char *path)
config_file_t *conf = config_file_new(path);
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
video_viewport_t *custom_vp = video_viewport_get_custom();
const video_viewport_t *custom_vp = (const video_viewport_t*)video_viewport_get_custom();
if (!conf)
conf = config_file_new(NULL);

View File

@ -3099,7 +3099,8 @@ static retro_proc_address_t gl_get_proc_address(void *data, const char *sym)
static void gl_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
{
gl_t *gl = (gl_t*)data;
struct retro_system_av_info *av_info = video_viewport_get_system_av_info();
const struct retro_system_av_info *av_info =
(const struct retro_system_av_info*)video_viewport_get_system_av_info();
switch (aspect_ratio_idx)
{

View File

@ -433,7 +433,8 @@ static void gx_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
{
driver_t *driver = driver_get_ptr();
gx_video_t *gx = (gx_video_t*)driver->video_data;
struct retro_system_av_info *av_info = video_viewport_get_system_av_info();
const struct retro_system_av_info *av_info =
(const struct retro_system_av_info*)video_viewport_get_system_av_info();
if (aspect_ratio_idx == ASPECT_RATIO_SQUARE)
video_viewport_set_square_pixel(

View File

@ -639,7 +639,8 @@ void sdl2_poke_set_filtering(void *data, unsigned index, bool smooth)
static void sdl2_poke_set_aspect_ratio(void *data, unsigned aspectratio_index)
{
sdl2_video_t *vid = (sdl2_video_t*)data;
struct retro_system_av_info *av_info = video_viewport_get_system_av_info();
const struct retro_system_av_info *av_info =
(const struct retro_system_av_info*)video_viewport_get_system_av_info();
switch (aspectratio_index)
{

View File

@ -501,7 +501,7 @@ static void *xv_init(const video_info_t *video,
attributes.event_mask = StructureNotifyMask | KeyPressMask |
KeyReleaseMask | ButtonReleaseMask | ButtonPressMask | DestroyNotify | ClientMessage;
width = video->fullscreen ? ((video->width == 0) ? geom->base_width : video->width) : video->width;
width = video->fullscreen ? ( (video->width == 0) ? geom->base_width : video->width) : video->width;
height = video->fullscreen ? ((video->height == 0) ? geom->base_height : video->height) : video->height;
xv->window = XCreateWindow(xv->display, DefaultRootWindow(xv->display),
0, 0, width, height,
@ -531,7 +531,7 @@ static void *xv_init(const video_info_t *video,
if (atom != None)
XvSetPortAttribute(xv->display, xv->port, atom, 1);
xv->width = geom->max_width;
xv->width = geom->max_width;
xv->height = geom->max_height;
xv->image = XvShmCreateImage(xv->display, xv->port, xv->fourcc,