From 512f7f5b275ec011ff0bf406771fcbeada1caf29 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 10 Dec 2014 16:40:43 +0100 Subject: Code nits - get rid of '== NULL' / '!= NULL' --- arm/arm_stub.S | 2 +- arm/warm.c | 4 ++-- cpu.c | 4 ++-- cpu_threaded.c | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arm/arm_stub.S b/arm/arm_stub.S index 1fc0db6..73c73fa 100644 --- a/arm/arm_stub.S +++ b/arm/arm_stub.S @@ -740,7 +740,7 @@ execute_ewram_ptr: @ u32 gamepak_index = address >> 15; @ u8 *map = memory_map_read[gamepak_index]; -@ if(map == NULL) +@ if(!map) @ map = load_gamepak_page(gamepak_index & 0x3FF); @ value = address##type(map, address & 0x7FFF) diff --git a/arm/warm.c b/arm/warm.c index 7cf22ac..e4eb711 100644 --- a/arm/warm.c +++ b/arm/warm.c @@ -80,7 +80,7 @@ static int manual_insmod_26(const char *fname, const char *opts) FILE *f; f = fopen(fname, "rb"); - if (f == NULL) + if (!f) return -1; fseek(f, 0, SEEK_END); @@ -88,7 +88,7 @@ static int manual_insmod_26(const char *fname, const char *opts) fseek(f, 0, SEEK_SET); buff = malloc(len); - if (buff == NULL) + if (!buff) goto fail0; read_len = fread(buff, 1, len, f); diff --git a/cpu.c b/cpu.c index db27e84..f1cbfaa 100644 --- a/cpu.c +++ b/cpu.c @@ -689,7 +689,7 @@ void print_register_usage(void) pc_region = new_pc_region; \ pc_address_block = memory_map_read[new_pc_region]; \ \ - if(pc_address_block == NULL) \ + if(!pc_address_block) \ pc_address_block = load_gamepak_page(pc_region & 0x3FF); \ } \ @@ -4069,7 +4069,7 @@ void execute_arm(u32 cycles) u32 old_pc; - if(pc_address_block == NULL) + if(!pc_address_block) pc_address_block = load_gamepak_page(pc_region & 0x3FF); while(1) diff --git a/cpu_threaded.c b/cpu_threaded.c index 0c75fb9..4436a69 100644 --- a/cpu_threaded.c +++ b/cpu_threaded.c @@ -216,7 +216,7 @@ extern u8 bit_count[256]; pc_region = new_pc_region; \ pc_address_block = memory_map_read[new_pc_region]; \ \ - if(pc_address_block == NULL) \ + if(!pc_address_block) \ pc_address_block = load_gamepak_page(pc_region & 0x3FF); \ } \ @@ -2798,7 +2798,7 @@ u8 function_cc *block_lookup_address_##type(u32 pc) \ block_ptr = (u32 *)block_ptr[1]; \ } \ \ - if(block_ptr == NULL) \ + if(!block_ptr) \ { \ __label__ redo; \ s32 translation_result; \ @@ -3208,7 +3208,7 @@ s32 translate_block_arm(u32 pc, translation_region_type generate_block_extra_vars_arm(); arm_fix_pc(); - if(pc_address_block == NULL) + if(!pc_address_block) pc_address_block = load_gamepak_page(pc_region & 0x3FF); switch(translation_region) @@ -3389,7 +3389,7 @@ s32 translate_block_arm(u32 pc, translation_region_type { branch_target = external_block_exits[i].branch_target; arm_link_block(); - if(translation_target == NULL) + if(!translation_target) return -1; generate_branch_patch_unconditional( external_block_exits[i].branch_source, translation_target); @@ -3425,7 +3425,7 @@ s32 translate_block_thumb(u32 pc, translation_region_type generate_block_extra_vars_thumb(); thumb_fix_pc(); - if(pc_address_block == NULL) + if(!pc_address_block) pc_address_block = load_gamepak_page(pc_region & 0x3FF); switch(translation_region) @@ -3606,7 +3606,7 @@ s32 translate_block_thumb(u32 pc, translation_region_type { branch_target = external_block_exits[i].branch_target; thumb_link_block(); - if(translation_target == NULL) + if(!translation_target) return -1; generate_branch_patch_unconditional( external_block_exits[i].branch_source, translation_target); -- cgit v1.2.3