mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
Use string_is_equal more
This commit is contained in:
parent
89b7fb5380
commit
fbd2e9aa84
6 changed files with 23 additions and 19 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <queues/fifo_buffer.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
#include <retro_endianness.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../audio_driver.h"
|
||||
#include "../../configuration.h"
|
||||
|
@ -174,7 +175,7 @@ static void choose_output_device(coreaudio_t *dev, const char* device)
|
|||
|
||||
if (AudioObjectGetPropertyData(devices[i],
|
||||
&propaddr, 0, 0, &size, device_name) == noErr
|
||||
&& !strcmp(device_name, device))
|
||||
&& string_is_equal(device_name, device))
|
||||
{
|
||||
AudioUnitSetProperty(dev->dev, kAudioOutputUnitProperty_CurrentDevice,
|
||||
kAudioUnitScope_Global, 0, &devices[i], sizeof(AudioDeviceID));
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <exynos/exynos_fimg2d.h>
|
||||
|
||||
#include <retro_inline.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../common/drm_common.h"
|
||||
|
||||
|
@ -173,7 +174,7 @@ static int exynos_get_device_index(void)
|
|||
|
||||
ver = drmGetVersion(fd);
|
||||
|
||||
if (!strcmp("exynos", ver->name))
|
||||
if (string_is_equal("exynos", ver->name))
|
||||
found = true;
|
||||
else
|
||||
++index;
|
||||
|
|
|
@ -628,7 +628,7 @@ static int android_input_get_id_index_from_name(android_input_data_t *android_da
|
|||
int i;
|
||||
for (i = 0; i < android_data->pads_connected; i++)
|
||||
{
|
||||
if (!strcmp(name, android_data->pad_states[i].name))
|
||||
if (string_is_equal(name, android_data->pad_states[i].name))
|
||||
return i;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include <boolean.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../../driver.h"
|
||||
|
||||
|
@ -300,12 +301,12 @@ static void sdl_grab_mouse(void *data, bool state)
|
|||
SDL_Window *w;
|
||||
};
|
||||
|
||||
if (!strcmp(video_driver_get_ident(), "sdl2"))
|
||||
{
|
||||
/* First member of sdl2_video_t is the window */
|
||||
SDL_SetWindowGrab(((struct temp*)video_driver_get_ptr(false))->w,
|
||||
state ? SDL_TRUE : SDL_FALSE);
|
||||
}
|
||||
if (!string_is_equal(video_driver_get_ident(), "sdl2"))
|
||||
return;
|
||||
|
||||
/* First member of sdl2_video_t is the window */
|
||||
SDL_SetWindowGrab(((struct temp*)video_driver_get_ptr(false))->w,
|
||||
state ? SDL_TRUE : SDL_FALSE);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <linux/kd.h>
|
||||
|
||||
#include <file/file_path.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#include "../drivers_keyboard/keyboard_event_udev.h"
|
||||
#include "../common/linux_common.h"
|
||||
|
@ -301,7 +302,7 @@ static void udev_input_remove_device(udev_input_t *udev, const char *devnode)
|
|||
|
||||
for (i = 0; i < udev->num_devices; i++)
|
||||
{
|
||||
if (strcmp(devnode, udev->devices[i]->devnode) != 0)
|
||||
if (!string_is_equal(devnode, udev->devices[i]->devnode))
|
||||
continue;
|
||||
|
||||
close(udev->devices[i]->fd);
|
||||
|
@ -333,9 +334,9 @@ static void udev_input_handle_hotplug(udev_input_t *udev)
|
|||
action = udev_device_get_action(dev);
|
||||
devnode = udev_device_get_devnode(dev);
|
||||
|
||||
is_keyboard = val_keyboard && !strcmp(val_keyboard, "1") && devnode;
|
||||
is_mouse = val_mouse && !strcmp(val_mouse, "1") && devnode;
|
||||
is_touchpad = val_touchpad && !strcmp(val_touchpad, "1") && devnode;
|
||||
is_keyboard = val_keyboard && string_is_equal(val_keyboard, "1") && devnode;
|
||||
is_mouse = val_mouse && string_is_equal(val_mouse, "1") && devnode;
|
||||
is_touchpad = val_touchpad && string_is_equal(val_touchpad, "1") && devnode;
|
||||
|
||||
if (!is_keyboard && !is_mouse && !is_touchpad)
|
||||
goto end;
|
||||
|
@ -356,12 +357,12 @@ static void udev_input_handle_hotplug(udev_input_t *udev)
|
|||
devtype = "mouse";
|
||||
}
|
||||
|
||||
if (!strcmp(action, "add"))
|
||||
if (string_is_equal(action, "add"))
|
||||
{
|
||||
RARCH_LOG("[udev]: Hotplug add %s: %s.\n", devtype, devnode);
|
||||
add_device(udev, devnode, cb);
|
||||
}
|
||||
else if (!strcmp(action, "remove"))
|
||||
else if (string_is_equal(action, "remove"))
|
||||
{
|
||||
RARCH_LOG("[udev]: Hotplug remove %s: %s.\n", devtype, devnode);
|
||||
udev_input_remove_device(udev, devnode);
|
||||
|
|
|
@ -391,7 +391,7 @@ static void udev_joypad_remove_device(const char *path)
|
|||
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
{
|
||||
if (udev_pads[i].path && !strcmp(udev_pads[i].path, path))
|
||||
if (udev_pads[i].path && string_is_equal(udev_pads[i].path, path))
|
||||
{
|
||||
input_config_autoconfigure_disconnect(i, udev_pads[i].ident);
|
||||
udev_free_pad(i);
|
||||
|
@ -428,15 +428,15 @@ static void udev_joypad_handle_hotplug(void)
|
|||
action = udev_device_get_action(dev);
|
||||
devnode = udev_device_get_devnode(dev);
|
||||
|
||||
if (!val || strcmp(val, "1") || !devnode)
|
||||
if (!val || !string_is_equal(val, "1") || !devnode)
|
||||
goto end;
|
||||
|
||||
if (!strcmp(action, "add"))
|
||||
if (string_is_equal(action, "add"))
|
||||
{
|
||||
RARCH_LOG("[udev]: Hotplug add: %s.\n", devnode);
|
||||
udev_check_device(dev, devnode, true);
|
||||
}
|
||||
else if (!strcmp(action, "remove"))
|
||||
else if (string_is_equal(action, "remove"))
|
||||
{
|
||||
RARCH_LOG("[udev]: Hotplug remove: %s.\n", devnode);
|
||||
udev_joypad_remove_device(devnode);
|
||||
|
|
Loading…
Add table
Reference in a new issue