mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-02 23:14:34 +00:00
Cleanups
This commit is contained in:
parent
3990254a7c
commit
8627d638e1
@ -57,7 +57,7 @@ static void *android_camera_init(const char *device, uint64_t caps,
|
||||
goto dealloc;
|
||||
|
||||
GET_OBJECT_CLASS(env, class, android_app->activity->clazz);
|
||||
if (class == NULL)
|
||||
if (!class)
|
||||
goto dealloc;
|
||||
|
||||
GET_METHOD_ID(env, androidcamera->onCameraInit, class,
|
||||
|
@ -99,7 +99,7 @@ void packet_buffer_get_packet(packet_buffer_t *packet_buffer, AVPacket *pkt)
|
||||
{
|
||||
AVPacketNode_t *new_tail = NULL;
|
||||
|
||||
if (packet_buffer->tail == NULL)
|
||||
if (!packet_buffer->tail)
|
||||
return;
|
||||
|
||||
av_packet_move_ref(pkt, packet_buffer->tail->data);
|
||||
|
@ -19,10 +19,11 @@ static int exec_3dsx_actual(const char* path, const char** args, bool appendPath
|
||||
bool fileExists;
|
||||
bool inited;
|
||||
|
||||
if(path == NULL || path[0] == '\0'){
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
if (!path || path[0] == '\0')
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
fileExists = stat(path, &sBuff) == 0;
|
||||
if(!fileExists){
|
||||
@ -80,4 +81,4 @@ int exec_3dsx(const char* path, const char** args){
|
||||
|
||||
int exec_3dsx_no_path_in_args(const char* path, const char** args){
|
||||
return exec_3dsx_actual(path, args, false/*appendPath*/);
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ static int isCiaInstalled(u64 titleId, u16 version){
|
||||
return -1;
|
||||
|
||||
titleIds = malloc(titlesToRetrieve * sizeof(uint64_t));
|
||||
if(titleIds == NULL)
|
||||
if (!titleIds)
|
||||
return -1;
|
||||
|
||||
failed = AM_GetTitleList(&titlesRetrieved, MEDIATYPE_SD, titlesToRetrieve, titleIds);
|
||||
@ -116,10 +116,11 @@ int exec_cia(const char* path, const char** args){
|
||||
bool fileExists;
|
||||
bool inited;
|
||||
|
||||
if(path == NULL || path[0] == '\0'){
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
if (!path || path[0] == '\0')
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
fileExists = stat(path, &sBuff) == 0;
|
||||
if(!fileExists){
|
||||
|
@ -166,7 +166,7 @@ static void frontend_gx_get_environment_settings(
|
||||
|
||||
/* This situation can happen on some loaders so we really need some
|
||||
fake args or else retroarch will just crash on parsing NULL pointers */
|
||||
if(*argc == 0 || argv == NULL)
|
||||
if(*argc == 0 || !argv)
|
||||
{
|
||||
struct rarch_main_wrap *args = (struct rarch_main_wrap*)params_data;
|
||||
if (args)
|
||||
|
@ -148,7 +148,7 @@ void system_exec_wii(const char *_path, bool should_load_game)
|
||||
RARCH_LOG("Attempt to load executable: [%s]\n", path);
|
||||
|
||||
fp = fopen(path, "rb");
|
||||
if (fp == NULL)
|
||||
if (!fp)
|
||||
{
|
||||
RARCH_ERR("Could not open DOL file %s.\n", path);
|
||||
goto exit;
|
||||
|
@ -61,7 +61,7 @@ static struct bintree_node *bintree_new_nil_node(struct bintree_node *parent)
|
||||
|
||||
static INLINE int bintree_is_nil(const struct bintree_node *node)
|
||||
{
|
||||
return (node == NULL) || (node->value == NIL_NODE);
|
||||
return !node || (node->value == NIL_NODE);
|
||||
}
|
||||
|
||||
static int bintree_insert_internal(bintree_t *t, struct bintree_node *root, void *value)
|
||||
|
@ -45,7 +45,7 @@ static void *android_location_init(void)
|
||||
goto dealloc;
|
||||
|
||||
GET_OBJECT_CLASS(env, class, android_app->activity->clazz);
|
||||
if (class == NULL)
|
||||
if (!class)
|
||||
goto dealloc;
|
||||
|
||||
GET_METHOD_ID(env, androidlocation->onLocationInit, class,
|
||||
|
@ -126,7 +126,7 @@ static const char *database_info_get_current_element_name(
|
||||
if (!handle || !handle->list)
|
||||
return NULL;
|
||||
/* Skip pruned entries */
|
||||
while (handle->list->elems[handle->list_ptr].data == NULL)
|
||||
while (!handle->list->elems[handle->list_ptr].data)
|
||||
{
|
||||
if (++handle->list_ptr >= handle->list->size)
|
||||
return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user