(gfx/drivers) Cleanups

This commit is contained in:
twinaphex 2015-06-13 02:49:29 +02:00
parent 34a44983a0
commit 7197b58ed6
10 changed files with 47 additions and 37 deletions

View File

@ -400,7 +400,7 @@ static bool dispmanx_gfx_frame(void *data, const void *frame, unsigned width,
if (_dispvars->menu_active)
{
char buf[128];
char buf[128] = {0};
video_monitor_get_fps(buf, sizeof(buf), NULL, 0);
}

View File

@ -181,9 +181,9 @@ static INLINE unsigned align_common(unsigned i, unsigned j)
/* Find the index of a compatible DRM device. */
static int exynos_get_device_index(void)
{
char buf[32];
int fd;
drmVersionPtr ver;
char buf[32] = {0};
int index = 0;
bool found = false;
@ -584,9 +584,9 @@ static void exynos_g2d_free(struct exynos_data *pdata)
static int exynos_open(struct exynos_data *pdata)
{
char buf[32];
unsigned i;
int fd = -1;
char buf[32] = {0};
struct exynos_drm *drm = NULL;
struct exynos_fliphandler *fliphandler = NULL;
settings_t *settings = config_get_ptr();
@ -1439,7 +1439,8 @@ static bool exynos_gfx_frame(void *data, const void *frame, unsigned width,
if (settings->fps_show)
{
char buffer[128], buffer_fps[128];
char buffer[128] = {0};
char buffer_fps[128] = {0};
video_monitor_get_fps(buffer, sizeof(buffer),
settings->fps_show ? buffer_fps : NULL, sizeof(buffer_fps));
rarch_main_msg_queue_push(buffer_fps, 1, 1, false);

View File

@ -2142,7 +2142,8 @@ static void DEBUG_CALLBACK_TYPE gl_debug_cb(GLenum source, GLenum type,
GLuint id, GLenum severity, GLsizei length,
const GLchar *message, void *userParam)
{
const char *src, *typestr;
const char *src = NULL;
const char **typestr = NULL;
gl_t *gl = (gl_t*)userParam; /* Useful for debugger. */
(void)gl;

View File

@ -1029,7 +1029,8 @@ static bool gx_frame(void *data, const void *frame,
unsigned width, unsigned height, unsigned pitch,
const char *msg)
{
char fps_txt[128], fps_text_buf[128];
char fps_txt[128] = {0};
char fps_text_buf[128] = {0};
gx_video_t *gx = (gx_video_t*)data;
struct __gx_regdef *__gx = (struct __gx_regdef*)__gxregs;
u8 clear_efb = GX_FALSE;
@ -1124,10 +1125,13 @@ static bool gx_frame(void *data, const void *frame,
if (settings->fps_show)
{
char mem1_txt[128];
char mem1_txt[128] = {0};
char mem2_txt[128] = {0};
unsigned x = 15;
unsigned y = 35;
(void)mem2_txt;
gx_blit_line(x, y, fps_text_buf);
y += FONT_HEIGHT * (gx->double_strike ? 1 : 2);
snprintf(mem1_txt, sizeof(mem1_txt), "MEM1: %8d / %8d",
@ -1135,7 +1139,6 @@ static bool gx_frame(void *data, const void *frame,
gx_blit_line(x, y, mem1_txt);
#ifdef HW_RVL
y += FONT_HEIGHT * (gx->double_strike ? 1 : 2);
char mem2_txt[128];
snprintf(mem2_txt, sizeof(mem2_txt), "MEM2: %8d / %8d",
gx_mem2_used(), gx_mem2_total());
gx_blit_line(x, y, mem2_txt);

View File

@ -85,7 +85,7 @@ typedef struct omapfb_data
static const char *omapfb_get_fb_device(void)
{
static char fbname[12];
static char fbname[12] = {0};
settings_t *settings = config_get_ptr();
const int fbidx = settings->video.monitor_index;
@ -173,7 +173,9 @@ static int omapfb_detect_screen(omapfb_data_t *pdata)
int w, h;
FILE *f;
int fb_id, overlay_id = -1, display_id = -1;
char buff[64], manager_name[64], display_name[64];
char buff[64] = {0};
char manager_name[64] = {0};
char display_name[64] = {0};
/* Find out the native screen resolution, which is needed to
* properly center the scaled image data. */

View File

@ -466,7 +466,8 @@ error:
static bool psp_frame(void *data, const void *frame,
unsigned width, unsigned height, unsigned pitch, const char *msg)
{
static char fps_txt[128], fps_text_buf[128];
static char fps_txt[128] = {0};
static char fps_text_buf[128] = {0};
psp1_video_t *psp = (psp1_video_t*)data;
settings_t *settings = config_get_ptr();
#ifdef DISPLAY_FPS

View File

@ -92,7 +92,7 @@ static void sdl2_init_font(sdl2_video_t *vid, const char *font_path,
{
int i, r, g, b;
SDL_Color colors[256];
SDL_Surface *tmp;
SDL_Surface *tmp = NULL;
SDL_Palette *pal = NULL;
const struct font_atlas *atlas = NULL;
settings_t *settings = config_get_ptr();
@ -479,7 +479,7 @@ static void check_window(sdl2_video_t *vid)
static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width,
unsigned height, unsigned pitch, const char *msg)
{
char buf[128];
char buf[128] = {0};
sdl2_video_t *vid = (sdl2_video_t*)data;
driver_t *driver = driver_get_ptr();

View File

@ -348,7 +348,7 @@ static void sdl_gfx_check_window(sdl_video_t *vid)
static bool sdl_gfx_frame(void *data, const void *frame, unsigned width,
unsigned height, unsigned pitch, const char *msg)
{
char buf[128];
char buf[128] = {0};
sdl_video_t *vid = (sdl_video_t*)data;
if (!frame)

View File

@ -795,7 +795,8 @@ static bool sunxi_gfx_frame(void *data, const void *frame, unsigned width,
if (_dispvars->menu_active)
{
char buf[128];
char buf[128] = {0};
video_monitor_get_fps(buf, sizeof(buf), NULL, 0);
ioctl(_dispvars->sunxi_disp->fd_fb, FBIO_WAITFORVSYNC, 0);
return true;

View File

@ -408,7 +408,8 @@ static void *xv_init(const video_info_t *video,
const input_driver_t **input, void **input_data)
{
unsigned i;
char buf[128], buf_fps[128];
char buf[128] = {0};
char buf_fps[128] = {0};
struct sigaction sa = {{0}};
XSetWindowAttributes attributes = {0};
XVisualInfo visualtemplate = {0};
@ -764,8 +765,8 @@ static void xv_render_msg(xv_t *xv, const char *msg,
static bool xv_frame(void *data, const void *frame, unsigned width,
unsigned height, unsigned pitch, const char *msg)
{
char buf[128];
XWindowAttributes target;
char buf[128] = {0};
xv_t *xv = (xv_t*)data;
if (!frame)