(MIDI) Turn bunch of functions static

(Menu) Remove menu_display_null driver
This commit is contained in:
twinaphex 2020-01-06 17:30:09 +01:00
parent 641662d77c
commit 203bea3fe6
7 changed files with 73 additions and 163 deletions

View File

@ -816,8 +816,7 @@ ifeq ($(HAVE_MENU_COMMON), 1)
menu/drivers/menu_generic.o \
menu/drivers/null.o \
menu/menu_thumbnail_path.o \
menu/menu_thumbnail.o \
menu/drivers_display/menu_display_null.o
menu/menu_thumbnail.o
ifeq ($(HAVE_MENU_WIDGETS), 1)
OBJ += menu/widgets/menu_widgets.o

View File

@ -1280,8 +1280,6 @@ MENU
#include "../menu/drivers/null.c"
#include "../menu/drivers/menu_generic.c"
#include "../menu/drivers_display/menu_display_null.c"
#if defined(HAVE_D3D8)
#include "../menu/drivers_display/menu_display_d3d8.c"
#endif

View File

@ -1,102 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2017 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <time.h>
#include <queues/message_queue.h>
#include <retro_miscellaneous.h>
#include "../../gfx/font_driver.h"
#include "../../retroarch.h"
#include "../menu_driver.h"
static void *menu_display_null_get_default_mvp(video_frame_info_t *video_info)
{
return NULL;
}
static void menu_display_null_blend_begin(video_frame_info_t *video_info)
{
}
static void menu_display_null_blend_end(video_frame_info_t *video_info)
{
}
static void menu_display_null_draw(menu_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
{
}
static void menu_display_null_draw_pipeline(
menu_display_ctx_draw_t *draw, video_frame_info_t *video_info)
{
}
static void menu_display_null_viewport(menu_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
{
}
static void menu_display_null_restore_clear_color(void)
{
}
static void menu_display_null_clear_color(
menu_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
{
(void)clearcolor;
}
static bool menu_display_null_font_init_first(
void **font_handle, void *video_data,
const char *font_path, float menu_font_size,
bool is_threaded)
{
return true;
}
static const float *menu_display_null_get_default_vertices(void)
{
static float dummy[16] = {0.0f};
return &dummy[0];
}
static const float *menu_display_null_get_default_tex_coords(void)
{
static float dummy[16] = {0.0f};
return &dummy[0];
}
menu_display_ctx_driver_t menu_display_ctx_null = {
menu_display_null_draw,
menu_display_null_draw_pipeline,
menu_display_null_viewport,
menu_display_null_blend_begin,
menu_display_null_blend_end,
menu_display_null_restore_clear_color,
menu_display_null_clear_color,
menu_display_null_get_default_mvp,
menu_display_null_get_default_vertices,
menu_display_null_get_default_tex_coords,
menu_display_null_font_init_first,
MENU_VIDEO_DRIVER_GENERIC,
"null",
false,
NULL,
NULL
};

View File

@ -125,6 +125,25 @@ static const menu_ctx_driver_t *menu_ctx_drivers[] = {
NULL
};
static menu_display_ctx_driver_t menu_display_ctx_null = {
NULL, /* draw */
NULL, /* draw_pipeline */
NULL, /* viewport */
NULL, /* blend_begin */
NULL, /* blend_end */
NULL, /* restore_clear_color */
NULL, /* clear_color */
NULL, /* get_default_mvp */
NULL, /* get_default_vertices */
NULL, /* get_default_tex_coords */
NULL, /* font_init_first */
MENU_VIDEO_DRIVER_GENERIC,
"null",
false,
NULL,
NULL
};
/* Menu display drivers */
static menu_display_ctx_driver_t *menu_display_ctx_drivers[] = {
#ifdef HAVE_D3D8

View File

@ -736,7 +736,6 @@ extern menu_display_ctx_driver_t menu_display_ctx_vga;
extern menu_display_ctx_driver_t menu_display_ctx_fpga;
extern menu_display_ctx_driver_t menu_display_ctx_switch;
extern menu_display_ctx_driver_t menu_display_ctx_sixel;
extern menu_display_ctx_driver_t menu_display_ctx_null;
extern menu_ctx_driver_t menu_ctx_ozone;
extern menu_ctx_driver_t menu_ctx_xui;

View File

@ -201,27 +201,14 @@ typedef struct midi_driver
bool (*flush)(void *p);
} midi_driver_t;
const void *midi_driver_find_handle(int index);
struct string_list *midi_driver_get_avail_inputs(void);
struct string_list *midi_driver_get_avail_outputs(void);
bool midi_driver_set_all_sounds_off(void);
bool midi_driver_set_volume(unsigned volume);
bool midi_driver_init(void);
void midi_driver_free(void);
bool midi_driver_set_input(const char *input);
bool midi_driver_set_output(const char *output);
bool midi_driver_input_enabled(void);
bool midi_driver_output_enabled(void);
bool midi_driver_read(uint8_t *byte);
bool midi_driver_write(uint8_t byte, uint32_t delta_time);
bool midi_driver_flush(void);
/**
* midi_driver_get_event_size:
* This is a convenience function for finding out the size of the event based

View File

@ -1145,6 +1145,14 @@ static const void *input_driver_find_handle(int idx);
static const void *joypad_driver_find_handle(int idx);
static const void *hid_driver_find_handle(int idx);
static bool midi_driver_read(uint8_t *byte);
static bool midi_driver_write(uint8_t byte, uint32_t delta_time);
static bool midi_driver_output_enabled(void);
static bool midi_driver_input_enabled(void);
static bool midi_driver_set_all_sounds_off(void);
static const void *midi_driver_find_handle(int index);
static bool midi_driver_flush(void);
struct string_list *dir_list_new_special(const char *input_dir,
enum dir_list_type type, const char *filter)
{
@ -17876,7 +17884,7 @@ static midi_driver_t *midi_driver_find_driver(const char *ident)
return &midi_null;
}
const void *midi_driver_find_handle(int index)
static const void *midi_driver_find_handle(int index)
{
if (index < 0 || index >= ARRAY_SIZE(midi_drivers))
return NULL;
@ -17893,7 +17901,8 @@ struct string_list *midi_driver_get_avail_outputs(void)
{
return midi_drv_outputs;
}
bool midi_driver_set_all_sounds_off(void)
static bool midi_driver_set_all_sounds_off(void)
{
midi_event_t event;
uint8_t i;
@ -17952,7 +17961,7 @@ bool midi_driver_set_volume(unsigned volume)
return true;
}
bool midi_driver_init_io_buffers(void)
static bool midi_driver_init_io_buffers(void)
{
midi_drv_input_buffer = (uint8_t*)malloc(MIDI_DRIVER_BUF_SIZE);
midi_drv_output_buffer = (uint8_t*)malloc(MIDI_DRIVER_BUF_SIZE);
@ -17969,7 +17978,42 @@ bool midi_driver_init_io_buffers(void)
return true;
}
bool midi_driver_init(void)
static void midi_driver_free(void)
{
if (midi_drv_data)
{
midi_drv->free(midi_drv_data);
midi_drv_data = NULL;
}
if (midi_drv_inputs)
{
string_list_free(midi_drv_inputs);
midi_drv_inputs = NULL;
}
if (midi_drv_outputs)
{
string_list_free(midi_drv_outputs);
midi_drv_outputs = NULL;
}
if (midi_drv_input_buffer)
{
free(midi_drv_input_buffer);
midi_drv_input_buffer = NULL;
}
if (midi_drv_output_buffer)
{
free(midi_drv_output_buffer);
midi_drv_output_buffer = NULL;
}
midi_drv_input_enabled = false;
midi_drv_output_enabled = false;
}
static bool midi_driver_init(void)
{
settings_t *settings = configuration_settings;
union string_list_elem_attr attr = {0};
@ -18069,40 +18113,6 @@ bool midi_driver_init(void)
return err_str == NULL;
}
void midi_driver_free(void)
{
if (midi_drv_data)
{
midi_drv->free(midi_drv_data);
midi_drv_data = NULL;
}
if (midi_drv_inputs)
{
string_list_free(midi_drv_inputs);
midi_drv_inputs = NULL;
}
if (midi_drv_outputs)
{
string_list_free(midi_drv_outputs);
midi_drv_outputs = NULL;
}
if (midi_drv_input_buffer)
{
free(midi_drv_input_buffer);
midi_drv_input_buffer = NULL;
}
if (midi_drv_output_buffer)
{
free(midi_drv_output_buffer);
midi_drv_output_buffer = NULL;
}
midi_drv_input_enabled = false;
midi_drv_output_enabled = false;
}
bool midi_driver_set_input(const char *input)
{
if (!midi_drv_data)
@ -18178,17 +18188,17 @@ bool midi_driver_set_output(const char *output)
return true;
}
bool midi_driver_input_enabled(void)
static bool midi_driver_input_enabled(void)
{
return midi_drv_input_enabled;
}
bool midi_driver_output_enabled(void)
static bool midi_driver_output_enabled(void)
{
return midi_drv_output_enabled;
}
bool midi_driver_read(uint8_t *byte)
static bool midi_driver_read(uint8_t *byte)
{
static int i;
@ -18241,7 +18251,7 @@ bool midi_driver_read(uint8_t *byte)
return true;
}
bool midi_driver_write(uint8_t byte, uint32_t delta_time)
static bool midi_driver_write(uint8_t byte, uint32_t delta_time)
{
static int event_size;
@ -18347,7 +18357,7 @@ bool midi_driver_write(uint8_t byte, uint32_t delta_time)
return true;
}
bool midi_driver_flush(void)
static bool midi_driver_flush(void)
{
if (!midi_drv_data)
{