Fix compiler warnings: uninitialized variables.

- mpc601_block_address_translation will now return 0 for prot and pa when bat_hit is false (when the if statement is not positive during the for loop). The calling function doesn't care what prot and pa are when bat_hit is false, but we do this to remove the compiler warining.
- For tlb_flush_entry, the compiler thinks m might not always be in the range 0 to 5 so tlb1 and tlb2 might not get initialized by the switch statement. Add default to get around this warning.
This commit is contained in:
joevt 2022-12-21 03:36:48 -08:00
parent 64fec88436
commit 46bc8567e9

View File

@ -125,11 +125,11 @@ static BATResult mpc601_block_address_translation(uint32_t la)
// logical to physical translation
pa = bat_entry->phys_hi | (la & ~bat_entry->hi_mask);
break;
return BATResult{bat_hit, prot, pa};
}
}
return BATResult{bat_hit, prot, pa};
return BATResult{bat_hit, 0, 0};
}
/** PowerPC-style block address translation. */
@ -742,6 +742,7 @@ void tlb_flush_entry(uint32_t ea)
tlb1 = &dtlb1_mode2[0];
tlb2 = &dtlb2_mode2[0];
break;
default:
case 5:
tlb1 = &dtlb1_mode3[0];
tlb2 = &dtlb2_mode3[0];