This commit is contained in:
twinaphex 2020-02-04 06:05:00 +01:00
parent 3990254a7c
commit 8627d638e1
9 changed files with 19 additions and 17 deletions

View File

@ -57,7 +57,7 @@ static void *android_camera_init(const char *device, uint64_t caps,
goto dealloc; goto dealloc;
GET_OBJECT_CLASS(env, class, android_app->activity->clazz); GET_OBJECT_CLASS(env, class, android_app->activity->clazz);
if (class == NULL) if (!class)
goto dealloc; goto dealloc;
GET_METHOD_ID(env, androidcamera->onCameraInit, class, GET_METHOD_ID(env, androidcamera->onCameraInit, class,

View File

@ -99,7 +99,7 @@ void packet_buffer_get_packet(packet_buffer_t *packet_buffer, AVPacket *pkt)
{ {
AVPacketNode_t *new_tail = NULL; AVPacketNode_t *new_tail = NULL;
if (packet_buffer->tail == NULL) if (!packet_buffer->tail)
return; return;
av_packet_move_ref(pkt, packet_buffer->tail->data); av_packet_move_ref(pkt, packet_buffer->tail->data);

View File

@ -19,10 +19,11 @@ static int exec_3dsx_actual(const char* path, const char** args, bool appendPath
bool fileExists; bool fileExists;
bool inited; bool inited;
if(path == NULL || path[0] == '\0'){ if (!path || path[0] == '\0')
errno = EINVAL; {
return -1; errno = EINVAL;
} return -1;
}
fileExists = stat(path, &sBuff) == 0; fileExists = stat(path, &sBuff) == 0;
if(!fileExists){ 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){ int exec_3dsx_no_path_in_args(const char* path, const char** args){
return exec_3dsx_actual(path, args, false/*appendPath*/); return exec_3dsx_actual(path, args, false/*appendPath*/);
} }

View File

@ -35,7 +35,7 @@ static int isCiaInstalled(u64 titleId, u16 version){
return -1; return -1;
titleIds = malloc(titlesToRetrieve * sizeof(uint64_t)); titleIds = malloc(titlesToRetrieve * sizeof(uint64_t));
if(titleIds == NULL) if (!titleIds)
return -1; return -1;
failed = AM_GetTitleList(&titlesRetrieved, MEDIATYPE_SD, titlesToRetrieve, titleIds); failed = AM_GetTitleList(&titlesRetrieved, MEDIATYPE_SD, titlesToRetrieve, titleIds);
@ -116,10 +116,11 @@ int exec_cia(const char* path, const char** args){
bool fileExists; bool fileExists;
bool inited; bool inited;
if(path == NULL || path[0] == '\0'){ if (!path || path[0] == '\0')
errno = EINVAL; {
return -1; errno = EINVAL;
} return -1;
}
fileExists = stat(path, &sBuff) == 0; fileExists = stat(path, &sBuff) == 0;
if(!fileExists){ if(!fileExists){

View File

@ -166,7 +166,7 @@ static void frontend_gx_get_environment_settings(
/* This situation can happen on some loaders so we really need some /* This situation can happen on some loaders so we really need some
fake args or else retroarch will just crash on parsing NULL pointers */ 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; struct rarch_main_wrap *args = (struct rarch_main_wrap*)params_data;
if (args) if (args)

View File

@ -148,7 +148,7 @@ void system_exec_wii(const char *_path, bool should_load_game)
RARCH_LOG("Attempt to load executable: [%s]\n", path); RARCH_LOG("Attempt to load executable: [%s]\n", path);
fp = fopen(path, "rb"); fp = fopen(path, "rb");
if (fp == NULL) if (!fp)
{ {
RARCH_ERR("Could not open DOL file %s.\n", path); RARCH_ERR("Could not open DOL file %s.\n", path);
goto exit; goto exit;

View File

@ -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) 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) static int bintree_insert_internal(bintree_t *t, struct bintree_node *root, void *value)

View File

@ -45,7 +45,7 @@ static void *android_location_init(void)
goto dealloc; goto dealloc;
GET_OBJECT_CLASS(env, class, android_app->activity->clazz); GET_OBJECT_CLASS(env, class, android_app->activity->clazz);
if (class == NULL) if (!class)
goto dealloc; goto dealloc;
GET_METHOD_ID(env, androidlocation->onLocationInit, class, GET_METHOD_ID(env, androidlocation->onLocationInit, class,

View File

@ -126,7 +126,7 @@ static const char *database_info_get_current_element_name(
if (!handle || !handle->list) if (!handle || !handle->list)
return NULL; return NULL;
/* Skip pruned entries */ /* 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) if (++handle->list_ptr >= handle->list->size)
return NULL; return NULL;