Skip to content

Commit 9d9e826

Browse files
committed
More code clean-up
1 parent 3c2887f commit 9d9e826

File tree

6 files changed

+15
-28
lines changed

6 files changed

+15
-28
lines changed

cpu/ppc/ppcfpopcodes.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ void dppc_interpreter::ppc_stfs() {
746746
ppc_grab_regsfpsia(ppc_cur_instruction);
747747
uint32_t ea = int32_t(int16_t(ppc_cur_instruction));
748748
ea += (reg_a) ? val_reg_a : 0;
749-
float result = ppc_state.fpr[reg_s].dbl64_r;
749+
float result = float(ppc_state.fpr[reg_s].dbl64_r);
750750
mmu_write_vmem<uint32_t>(ea, *(uint32_t*)(&result));
751751
}
752752

@@ -755,7 +755,7 @@ void dppc_interpreter::ppc_stfsu() {
755755
if (reg_a != 0) {
756756
uint32_t ea = int32_t(int16_t(ppc_cur_instruction));
757757
ea += val_reg_a;
758-
float result = ppc_state.fpr[reg_s].dbl64_r;
758+
float result = float(ppc_state.fpr[reg_s].dbl64_r);
759759
mmu_write_vmem<uint32_t>(ea, *(uint32_t*)(&result));
760760
ppc_state.gpr[reg_a] = ea;
761761
} else {
@@ -766,15 +766,15 @@ void dppc_interpreter::ppc_stfsu() {
766766
void dppc_interpreter::ppc_stfsx() {
767767
ppc_grab_regsfpsiab(ppc_cur_instruction);
768768
uint32_t ea = val_reg_b + (reg_a ? val_reg_a : 0);
769-
float result = ppc_state.fpr[reg_s].dbl64_r;
769+
float result = float(ppc_state.fpr[reg_s].dbl64_r);
770770
mmu_write_vmem<uint32_t>(ea, *(uint32_t*)(&result));
771771
}
772772

773773
void dppc_interpreter::ppc_stfsux() {
774774
ppc_grab_regsfpsiab(ppc_cur_instruction);
775775
if (reg_a) {
776776
uint32_t ea = val_reg_a + val_reg_b;
777-
float result = ppc_state.fpr[reg_s].dbl64_r;
777+
float result = float(ppc_state.fpr[reg_s].dbl64_r);
778778
mmu_write_vmem<uint32_t>(ea, *(uint32_t*)(&result));
779779
ppc_state.gpr[reg_a] = ea;
780780
} else {

cpu/ppc/ppcmmu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ uint32_t tlb_size_mask = TLB_SIZE - 1;
372372

373373
// fake TLB entry for handling of unmapped memory accesses
374374
uint64_t UnmappedVal = -1ULL;
375-
TLBEntry UnmappedMem = {TLB_INVALID_TAG, TLBFlags::PAGE_NOPHYS, 0, 0};
375+
TLBEntry UnmappedMem = {TLB_INVALID_TAG, TLBFlags::PAGE_NOPHYS, 0, {{0}}};
376376

377377
uint8_t CurITLBMode = {0xFF}; // current ITLB mode
378378
uint8_t CurDTLBMode = {0xFF}; // current DTLB mode

cpu/ppc/ppcmmu.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,4 @@ extern T mmu_read_vmem(uint32_t guest_va);
134134
template <class T>
135135
extern void mmu_write_vmem(uint32_t guest_va, T value);
136136

137-
//====================== Deprecated calls =========================
138-
#if 0
139-
extern void mem_write_byte(uint32_t addr, uint8_t value);
140-
extern void mem_write_word(uint32_t addr, uint16_t value);
141-
extern void mem_write_dword(uint32_t addr, uint32_t value);
142-
extern void mem_write_qword(uint32_t addr, uint64_t value);
143-
extern uint8_t mem_grab_byte(uint32_t addr);
144-
extern uint16_t mem_grab_word(uint32_t addr);
145-
extern uint32_t mem_grab_dword(uint32_t addr);
146-
extern uint64_t mem_grab_qword(uint32_t addr);
147-
extern uint8_t* quickinstruction_translate(uint32_t address_grab);
148-
#endif
149-
150137
#endif // PPCMMU_H

cpu/ppc/ppcopcodes.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ void ppc_changecrf0(uint32_t set_result) {
4747
}
4848

4949
// Affects the XER register's Carry Bit
50-
inline void ppc_carry(uint32_t a, uint32_t b) {
50+
inline static void ppc_carry(uint32_t a, uint32_t b) {
5151
if (b < a) {
5252
ppc_state.spr[SPR::XER] |= XER::CA;
5353
} else {
5454
ppc_state.spr[SPR::XER] &= ~XER::CA;
5555
}
5656
}
5757

58-
inline void ppc_carry_sub(uint32_t a, uint32_t b) {
58+
inline static void ppc_carry_sub(uint32_t a, uint32_t b) {
5959
if (b >= a) {
6060
ppc_state.spr[SPR::XER] |= XER::CA;
6161
} else {
@@ -65,7 +65,7 @@ inline void ppc_carry_sub(uint32_t a, uint32_t b) {
6565

6666
// Affects the XER register's SO and OV Bits
6767

68-
inline void ppc_setsoov(uint32_t a, uint32_t b, uint32_t d) {
68+
inline static void ppc_setsoov(uint32_t a, uint32_t b, uint32_t d) {
6969
if (int32_t((a ^ b) & (a ^ d)) < 0) {
7070
ppc_state.spr[SPR::XER] |= XER::SO | XER::OV;
7171
} else {
@@ -84,7 +84,7 @@ void do_ctx_sync() {
8484
}
8585
}
8686

87-
void add_ctx_sync_action(const CtxSyncCallback &cb) {
87+
static void add_ctx_sync_action(const CtxSyncCallback& cb) {
8888
gCtxSyncCallbacks.push_back(cb);
8989
}
9090

devices/common/ofnvram.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static uint32_t str2env(string& num_str) {
6060

6161
bool OfConfigAppl::validate() {
6262
int i;
63-
OfConfigHdrAppl hdr;
63+
OfConfigHdrAppl hdr{};
6464

6565
if (this->nvram_obj == nullptr)
6666
return false;
@@ -151,9 +151,9 @@ const OfConfigImpl::config_dict& OfConfigAppl::get_config_vars() {
151151

152152
// populate the remaining variables
153153
for (auto& var : of_vars) {
154-
auto name = var.first;
155-
auto type = std::get<0>(var.second);
156-
auto offset = std::get<1>(var.second);
154+
auto& name = var.first;
155+
auto type = std::get<0>(var.second);
156+
auto offset = std::get<1>(var.second);
157157

158158
switch (type) {
159159
case OF_VAR_TYPE_INT:
@@ -354,7 +354,7 @@ bool OfConfigChrp::validate()
354354
if (!of_part_found)
355355
return false;
356356

357-
OfConfigHdrChrp hdr;
357+
OfConfigHdrChrp hdr{};
358358

359359
// read OF partition header
360360
for (i = 0; i < sizeof(OfConfigHdrChrp); i++) {

devices/common/scsi/mesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ uint8_t MeshController::read(uint8_t reg_offset) {
100100
}
101101

102102
void MeshController::write(uint8_t reg_offset, uint8_t value) {
103-
uint16_t new_stat;
103+
//uint16_t new_stat;
104104

105105
switch(reg_offset) {
106106
case MeshReg::XferCount0:

0 commit comments

Comments
 (0)