Skip to content

Commit

Permalink
refactor: replace magic constant in *Reg32
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualEhrmanntraut committed Aug 26, 2024
1 parent 3fd7f08 commit 5198971
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions NootedRed/NRed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ const char *NRed::getGCPrefix() {
}

UInt32 NRed::readReg32(UInt32 reg) {
if ((reg * 4) < this->rmmio->getLength()) {
if ((reg * sizeof(UInt32)) < this->rmmio->getLength()) {
return this->rmmioPtr[reg];
} else {
this->rmmioPtr[mmPCIE_INDEX2] = reg;
Expand All @@ -446,7 +446,7 @@ UInt32 NRed::readReg32(UInt32 reg) {
}

void NRed::writeReg32(UInt32 reg, UInt32 val) {
if ((reg * 4) < this->rmmio->getLength()) {
if ((reg * sizeof(UInt32)) < this->rmmio->getLength()) {
this->rmmioPtr[reg] = val;
} else {
this->rmmioPtr[mmPCIE_INDEX2] = reg;
Expand Down

0 comments on commit 5198971

Please sign in to comment.