ARM7: Make component numbers be size_t instead of int
Jeffrey Pfau jeffrey@endrift.com
Wed, 04 Feb 2015 02:35:30 -0800
3 files changed,
8 insertions(+),
8 deletions(-)
M
src/arm/arm.c
→
src/arm/arm.c
@@ -71,7 +71,7 @@ }
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 @@ cpu->numComponents = extra;
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; }
M
src/arm/arm.h
→
src/arm/arm.h
@@ -158,15 +158,15 @@ struct ARMInterruptHandler irqh;
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);
M
src/debugger/memory-debugger.c
→
src/debugger/memory-debugger.c
@@ -20,7 +20,7 @@
#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]; \