mirror of https://github.com/mgba-emu/mgba.git
ARM7: Make component numbers be size_t instead of int
This commit is contained in:
parent
f62c068a2c
commit
f9110fc51e
|
@ -71,7 +71,7 @@ static inline enum RegisterBank _ARMSelectBank(enum PrivilegeMode mode) {
|
|||
|
||||
void ARMInit(struct ARMCore* cpu) {
|
||||
cpu->master->init(cpu, cpu->master);
|
||||
int i;
|
||||
size_t i;
|
||||
for (i = 0; i < cpu->numComponents; ++i) {
|
||||
if (cpu->components[i] && cpu->components[i]->init) {
|
||||
cpu->components[i]->init(cpu, cpu->components[i]);
|
||||
|
@ -83,7 +83,7 @@ void ARMDeinit(struct ARMCore* cpu) {
|
|||
if (cpu->master->deinit) {
|
||||
cpu->master->deinit(cpu->master);
|
||||
}
|
||||
int i;
|
||||
size_t i;
|
||||
for (i = 0; i < cpu->numComponents; ++i) {
|
||||
if (cpu->components[i] && cpu->components[i]->deinit) {
|
||||
cpu->components[i]->deinit(cpu->components[i]);
|
||||
|
@ -97,14 +97,14 @@ void ARMSetComponents(struct ARMCore* cpu, struct ARMComponent* master, int extr
|
|||
cpu->components = extras;
|
||||
}
|
||||
|
||||
void ARMHotplugAttach(struct ARMCore* cpu, int slot) {
|
||||
void ARMHotplugAttach(struct ARMCore* cpu, size_t slot) {
|
||||
if (slot >= cpu->numComponents) {
|
||||
return;
|
||||
}
|
||||
cpu->components[slot]->init(cpu, cpu->components[slot]);
|
||||
}
|
||||
|
||||
void ARMHotplugDetach(struct ARMCore* cpu, int slot) {
|
||||
void ARMHotplugDetach(struct ARMCore* cpu, size_t slot) {
|
||||
if (slot >= cpu->numComponents) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -158,15 +158,15 @@ struct ARMCore {
|
|||
|
||||
struct ARMComponent* master;
|
||||
|
||||
int numComponents;
|
||||
size_t numComponents;
|
||||
struct ARMComponent** components;
|
||||
};
|
||||
|
||||
void ARMInit(struct ARMCore* cpu);
|
||||
void ARMDeinit(struct ARMCore* cpu);
|
||||
void ARMSetComponents(struct ARMCore* cpu, struct ARMComponent* master, int extra, struct ARMComponent** extras);
|
||||
void ARMHotplugAttach(struct ARMCore* cpu, int slot);
|
||||
void ARMHotplugDetach(struct ARMCore* cpu, int slot);
|
||||
void ARMHotplugAttach(struct ARMCore* cpu, size_t slot);
|
||||
void ARMHotplugDetach(struct ARMCore* cpu, size_t slot);
|
||||
|
||||
void ARMReset(struct ARMCore* cpu);
|
||||
void ARMSetPrivilegeMode(struct ARMCore*, enum PrivilegeMode);
|
||||
|
|
|
@ -20,7 +20,7 @@ static uint32_t _popcount32(unsigned bits) {
|
|||
#define FIND_DEBUGGER(DEBUGGER, CPU) \
|
||||
{ \
|
||||
DEBUGGER = 0; \
|
||||
int i; \
|
||||
size_t i; \
|
||||
for (i = 0; i < CPU->numComponents; ++i) { \
|
||||
if (CPU->components[i]->id == ARM_DEBUGGER_ID) { \
|
||||
DEBUGGER = (struct ARMDebugger*) cpu->components[i]; \
|
||||
|
|
Loading…
Reference in New Issue