mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
Cleanups - try to remove stdio.h include where possible
This commit is contained in:
parent
c3fe980a1d
commit
01c3684b10
@ -14,7 +14,7 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -16,11 +16,9 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libretro.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <boolean.h>
|
#include <boolean.h>
|
||||||
|
|
||||||
@ -140,8 +138,7 @@ bitmapfont_lut_t *bitmapfont_10x10_load(unsigned language)
|
|||||||
num_glyphs = (glyph_max - glyph_min) + 1;
|
num_glyphs = (glyph_max - glyph_min) + 1;
|
||||||
|
|
||||||
/* Initialise font struct */
|
/* Initialise font struct */
|
||||||
font = (bitmapfont_lut_t*)calloc(1, sizeof(bitmapfont_lut_t));
|
if (!(font = (bitmapfont_lut_t*)calloc(1, sizeof(bitmapfont_lut_t))))
|
||||||
if (!font)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
font->glyph_min = glyph_min;
|
font->glyph_min = glyph_min;
|
||||||
@ -150,8 +147,7 @@ bitmapfont_lut_t *bitmapfont_10x10_load(unsigned language)
|
|||||||
/* Note: Need to use a calloc() here, otherwise
|
/* Note: Need to use a calloc() here, otherwise
|
||||||
* we'll get undefined behaviour when calling
|
* we'll get undefined behaviour when calling
|
||||||
* bitmapfont_free_lut() if the following loop fails */
|
* bitmapfont_free_lut() if the following loop fails */
|
||||||
font->lut = (bool**)calloc(1, num_glyphs * sizeof(bool*));
|
if (!(font->lut = (bool**)calloc(1, num_glyphs * sizeof(bool*))))
|
||||||
if (!font->lut)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* Loop over all possible characters */
|
/* Loop over all possible characters */
|
||||||
|
@ -17,11 +17,9 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libretro.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <boolean.h>
|
#include <boolean.h>
|
||||||
|
|
||||||
@ -70,51 +68,46 @@ bitmapfont_lut_t *bitmapfont_6x10_load(unsigned language)
|
|||||||
* specified language */
|
* specified language */
|
||||||
switch (language)
|
switch (language)
|
||||||
{
|
{
|
||||||
/* Needed individually for any non-Latin languages */
|
/* Needed individually for any non-Latin languages */
|
||||||
case RETRO_LANGUAGE_ENGLISH:
|
case RETRO_LANGUAGE_ENGLISH:
|
||||||
{
|
font_file = FONT_6X10_FILE_ENG;
|
||||||
font_file = FONT_6X10_FILE_ENG;
|
font_size = FONT_6X10_SIZE_ENG;
|
||||||
font_size = FONT_6X10_SIZE_ENG;
|
glyph_min = FONT_6X10_GLYPH_MIN_ENG;
|
||||||
glyph_min = FONT_6X10_GLYPH_MIN_ENG;
|
glyph_max = FONT_6X10_GLYPH_MAX_ENG;
|
||||||
glyph_max = FONT_6X10_GLYPH_MAX_ENG;
|
break;
|
||||||
break;
|
/* All Latin alphabet languages go here */
|
||||||
}
|
case RETRO_LANGUAGE_FRENCH:
|
||||||
|
case RETRO_LANGUAGE_SPANISH:
|
||||||
/* All Latin alphabet languages go here */
|
case RETRO_LANGUAGE_GERMAN:
|
||||||
case RETRO_LANGUAGE_FRENCH:
|
case RETRO_LANGUAGE_ITALIAN:
|
||||||
case RETRO_LANGUAGE_SPANISH:
|
case RETRO_LANGUAGE_DUTCH:
|
||||||
case RETRO_LANGUAGE_GERMAN:
|
case RETRO_LANGUAGE_PORTUGUESE_BRAZIL:
|
||||||
case RETRO_LANGUAGE_ITALIAN:
|
case RETRO_LANGUAGE_PORTUGUESE_PORTUGAL:
|
||||||
case RETRO_LANGUAGE_DUTCH:
|
case RETRO_LANGUAGE_ESPERANTO:
|
||||||
case RETRO_LANGUAGE_PORTUGUESE_BRAZIL:
|
case RETRO_LANGUAGE_POLISH:
|
||||||
case RETRO_LANGUAGE_PORTUGUESE_PORTUGAL:
|
case RETRO_LANGUAGE_VIETNAMESE:
|
||||||
case RETRO_LANGUAGE_ESPERANTO:
|
case RETRO_LANGUAGE_TURKISH:
|
||||||
case RETRO_LANGUAGE_POLISH:
|
case RETRO_LANGUAGE_SLOVAK:
|
||||||
case RETRO_LANGUAGE_VIETNAMESE:
|
case RETRO_LANGUAGE_ASTURIAN:
|
||||||
case RETRO_LANGUAGE_TURKISH:
|
case RETRO_LANGUAGE_FINNISH:
|
||||||
case RETRO_LANGUAGE_SLOVAK:
|
case RETRO_LANGUAGE_INDONESIAN:
|
||||||
case RETRO_LANGUAGE_ASTURIAN:
|
case RETRO_LANGUAGE_SWEDISH:
|
||||||
case RETRO_LANGUAGE_FINNISH:
|
case RETRO_LANGUAGE_CZECH:
|
||||||
case RETRO_LANGUAGE_INDONESIAN:
|
case RETRO_LANGUAGE_HUNGARIAN:
|
||||||
case RETRO_LANGUAGE_SWEDISH:
|
#if 0
|
||||||
case RETRO_LANGUAGE_CZECH:
|
/* These languages are not yet added */
|
||||||
case RETRO_LANGUAGE_HUNGARIAN:
|
case RETRO_LANGUAGE_ROMANIAN:
|
||||||
/* These languages are not yet added
|
case RETRO_LANGUAGE_CROATIAN:
|
||||||
case RETRO_LANGUAGE_ROMANIAN:
|
case RETRO_LANGUAGE_SERBIAN:
|
||||||
case RETRO_LANGUAGE_CROATIAN:
|
case RETRO_LANGUAGE_WELSH:
|
||||||
case RETRO_LANGUAGE_SERBIAN:
|
#endif
|
||||||
case RETRO_LANGUAGE_WELSH:
|
font_file = FONT_6X10_FILE_LSE;
|
||||||
*/
|
font_size = FONT_6X10_SIZE_LSE;
|
||||||
{
|
glyph_min = FONT_6X10_GLYPH_MIN_LSE;
|
||||||
font_file = FONT_6X10_FILE_LSE;
|
glyph_max = FONT_6X10_GLYPH_MAX_LSE;
|
||||||
font_size = FONT_6X10_SIZE_LSE;
|
break;
|
||||||
glyph_min = FONT_6X10_GLYPH_MIN_LSE;
|
default:
|
||||||
glyph_max = FONT_6X10_GLYPH_MAX_LSE;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sanity check: should only trigger on bug */
|
/* Sanity check: should only trigger on bug */
|
||||||
|
@ -15,13 +15,11 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <retro_miscellaneous.h>
|
#include <retro_miscellaneous.h>
|
||||||
|
|
||||||
#include "../../config.def.h"
|
|
||||||
|
|
||||||
#include "../input_driver.h"
|
#include "../input_driver.h"
|
||||||
#include "../input_keymaps.h"
|
#include "../input_keymaps.h"
|
||||||
#include "../drivers_keyboard/keyboard_event_dos.h"
|
#include "../drivers_keyboard/keyboard_event_dos.h"
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
#include <stdio.h>
|
#include <stdint.h>
|
||||||
#include "../led_driver.h"
|
#include "../led_driver.h"
|
||||||
#include "../led_defines.h"
|
#include "../led_defines.h"
|
||||||
|
|
||||||
#include "../../input/input_overlay.h"
|
#include "../../input/input_overlay.h"
|
||||||
|
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../retroarch.h"
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <stdio.h>
|
#include <stdint.h>
|
||||||
#include "../led_driver.h"
|
#include "../led_driver.h"
|
||||||
#include "../led_defines.h"
|
#include "../led_defines.h"
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <X11/XKBlib.h>
|
||||||
|
|
||||||
#include "../led_driver.h"
|
#include "../led_driver.h"
|
||||||
#include "../led_defines.h"
|
#include "../led_defines.h"
|
||||||
|
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../retroarch.h"
|
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/XKBlib.h>
|
|
||||||
|
|
||||||
/* Keys when setting in XKeyboardControl.led */
|
/* Keys when setting in XKeyboardControl.led */
|
||||||
#define XK_NUMLOCK 2
|
#define XK_NUMLOCK 2
|
||||||
@ -49,33 +49,38 @@ static keyboard_led_t *x11kb_cur = &x11kb_curins;
|
|||||||
|
|
||||||
static int get_led(int led)
|
static int get_led(int led)
|
||||||
{
|
{
|
||||||
Display *dpy = XOpenDisplay(0);
|
|
||||||
XKeyboardState state;
|
XKeyboardState state;
|
||||||
|
Display *dpy = XOpenDisplay(0);
|
||||||
|
|
||||||
XGetKeyboardControl(dpy, &state);
|
XGetKeyboardControl(dpy, &state);
|
||||||
XCloseDisplay(dpy);
|
XCloseDisplay(dpy);
|
||||||
|
|
||||||
switch (led)
|
switch (led)
|
||||||
{
|
{
|
||||||
case XK_NUMLOCK:
|
case XK_NUMLOCK:
|
||||||
return (state.led_mask & XM_NUMLOCK) ? 1 : 0;
|
if (state.led_mask & XM_NUMLOCK)
|
||||||
|
return 1;
|
||||||
break;
|
break;
|
||||||
case XK_CAPSLOCK:
|
case XK_CAPSLOCK:
|
||||||
return (state.led_mask & XM_CAPSLOCK) ? 1 : 0;
|
if (state.led_mask & XM_CAPSLOCK)
|
||||||
|
return 1;
|
||||||
break;
|
break;
|
||||||
case XK_SCROLLLOCK:
|
case XK_SCROLLLOCK:
|
||||||
return (state.led_mask & XM_SCROLLLOCK) ? 1 : 0;
|
if (state.led_mask & XM_SCROLLLOCK)
|
||||||
|
return 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_led(int led, int state)
|
static void set_led(int led, int state)
|
||||||
{
|
{
|
||||||
Display *dpy = XOpenDisplay(0);
|
|
||||||
XKeyboardControl values;
|
XKeyboardControl values;
|
||||||
values.led = led;
|
Display *dpy = XOpenDisplay(0);
|
||||||
|
values.led = led;
|
||||||
values.led_mode = state ? LedModeOn : LedModeOff;
|
values.led_mode = state ? LedModeOn : LedModeOff;
|
||||||
XChangeKeyboardControl(dpy, KBLed | KBLedMode, &values);
|
XChangeKeyboardControl(dpy, KBLed | KBLedMode, &values);
|
||||||
XCloseDisplay(dpy);
|
XCloseDisplay(dpy);
|
||||||
@ -116,9 +121,9 @@ static void keyboard_init(void)
|
|||||||
|
|
||||||
for (i = 0; i < MAX_LEDS; i++)
|
for (i = 0; i < MAX_LEDS; i++)
|
||||||
{
|
{
|
||||||
x11kb_cur->setup[i] = keyboard_led(i, -1);
|
x11kb_cur->setup[i] = keyboard_led(i, -1);
|
||||||
x11kb_cur->state[i] = -1;
|
x11kb_cur->state[i] = -1;
|
||||||
x11kb_cur->map[i] = settings->uints.led_map[i];
|
x11kb_cur->map[i] = settings->uints.led_map[i];
|
||||||
if (x11kb_cur->map[i] < 0)
|
if (x11kb_cur->map[i] < 0)
|
||||||
x11kb_cur->map[i] = i;
|
x11kb_cur->map[i] = i;
|
||||||
}
|
}
|
||||||
|
@ -16,9 +16,9 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <boolean.h>
|
#include <boolean.h>
|
||||||
|
|
||||||
|
@ -16,9 +16,9 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <boolean.h>
|
#include <boolean.h>
|
||||||
|
|
||||||
|
@ -16,9 +16,9 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <boolean.h>
|
#include <boolean.h>
|
||||||
|
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include <string/stdstring.h>
|
#include <string/stdstring.h>
|
||||||
|
@ -15,9 +15,10 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include <string/stdstring.h>
|
#include <string/stdstring.h>
|
||||||
|
@ -15,9 +15,10 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include <string/stdstring.h>
|
#include <string/stdstring.h>
|
||||||
@ -27,7 +28,6 @@
|
|||||||
|
|
||||||
#include "tasks_internal.h"
|
#include "tasks_internal.h"
|
||||||
|
|
||||||
#include "../configuration.h"
|
|
||||||
#include "../msg_hash.h"
|
#include "../msg_hash.h"
|
||||||
#include "../file_path_special.h"
|
#include "../file_path_special.h"
|
||||||
#include "../playlist.h"
|
#include "../playlist.h"
|
||||||
|
@ -15,17 +15,17 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
#include <boolean.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <boolean.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include <file/file_path.h>
|
#include <file/file_path.h>
|
||||||
#include <compat/strl.h>
|
#include <compat/strl.h>
|
||||||
#include <string/stdstring.h>
|
#include <string/stdstring.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user