Skip to content

Commit

Permalink
Fix a bunch of warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpd002 committed May 4, 2023
1 parent 9ed731a commit aee69ac
Show file tree
Hide file tree
Showing 58 changed files with 164 additions and 253 deletions.
3 changes: 2 additions & 1 deletion Source/ELF.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "ElfDefs.h"
#include "PtrStream.h"
#include "EndianUtils.h"
#include "maybe_unused.h"

struct ELFTRAITS32
{
Expand Down Expand Up @@ -189,7 +190,7 @@ class CELF
stream.Seek(m_header.nSectHeaderStart, Framework::STREAM_SEEK_SET);
for(auto& section : m_sections)
{
auto readAmount = stream.Read(&section, sizeof(section));
FRAMEWORK_MAYBE_UNUSED auto readAmount = stream.Read(&section, sizeof(section));
assert(readAmount == sizeof(section));
if(m_header.nId[ELF::EI_DATA] == ELF::ELFDATA2MSB)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/FrameDump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void CFrameDump::Read(Framework::CStream& input)
if(fileHeader.first.find(STATE_PACKET_METADATA_PREFIX) == 0)
{
unsigned int packetIdx = 0;
int scanCount = sscanf(fileHeader.first.c_str(), STATE_PACKET_METADATA_PREFIX "%d", &packetIdx);
FRAMEWORK_MAYBE_UNUSED int scanCount = sscanf(fileHeader.first.c_str(), STATE_PACKET_METADATA_PREFIX "%d", &packetIdx);
assert(scanCount == 1);
packetFiles[packetIdx] = fileHeader.first;
}
Expand Down
14 changes: 1 addition & 13 deletions Source/PS2VM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,7 @@
#define PREF_PS2_ARCADEROMS_DIRECTORY_DEFAULT ("arcaderoms")

CPS2VM::CPS2VM()
: m_nStatus(PAUSED)
, m_nEnd(false)
, m_pad(NULL)
, m_singleStepEe(false)
, m_singleStepIop(false)
, m_singleStepVu0(false)
, m_singleStepVu1(false)
, m_vblankTicks(0)
, m_inVblank(false)
, m_eeExecutionTicks(0)
, m_iopExecutionTicks(0)
, m_spuUpdateTicks(SPU_UPDATE_TICKS)
, m_eeProfilerZone(CProfiler::GetInstance().RegisterZone("EE"))
: m_eeProfilerZone(CProfiler::GetInstance().RegisterZone("EE"))
, m_iopProfilerZone(CProfiler::GetInstance().RegisterZone("IOP"))
, m_spuProfilerZone(CProfiler::GetInstance().RegisterZone("SPU"))
, m_gsSyncProfilerZone(CProfiler::GetInstance().RegisterZone("GSSYNC"))
Expand Down
16 changes: 8 additions & 8 deletions Source/PS2VM.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,24 +141,24 @@ class CPS2VM : public CVirtualMachine
void EmuThread();

std::thread m_thread;
STATUS m_nStatus;
bool m_nEnd;
STATUS m_nStatus = PAUSED;
bool m_nEnd = false;

uint32 m_onScreenTicksTotal = 0;
uint32 m_vblankTicksTotal = 0;
int m_vblankTicks = 0;
bool m_inVblank = 0;
int m_spuUpdateTicks = 0;
bool m_inVblank = false;
int m_spuUpdateTicks = SPU_UPDATE_TICKS;
int m_eeExecutionTicks = 0;
int m_iopExecutionTicks = 0;
CFrameLimiter m_frameLimiter;

CPU_UTILISATION_INFO m_cpuUtilisation;

bool m_singleStepEe;
bool m_singleStepIop;
bool m_singleStepVu0;
bool m_singleStepVu1;
bool m_singleStepEe = false;
bool m_singleStepIop = false;
bool m_singleStepVu0 = false;
bool m_singleStepVu1 = false;

#ifdef DEBUGGER_INCLUDED
CFrameDump m_frameDump;
Expand Down
14 changes: 7 additions & 7 deletions Source/ee/DMAC.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ class CDMAC

void UpdateCpCond();

uint8* m_ram = nullptr;
uint8* m_spr = nullptr;
uint8* m_vuMem0 = nullptr;
uint8* m_vuMem1 = nullptr;

CMIPS& m_ee;

D_CTRL_REG m_D_CTRL;
uint32 m_D_STAT;
uint32 m_D_ENABLE;
Expand Down Expand Up @@ -219,13 +226,6 @@ class CDMAC
Dmac::CChannel m_D9;
uint32 m_D9_SADR;

uint8* m_ram;
uint8* m_spr;
uint8* m_vuMem0;
uint8* m_vuMem1;

CMIPS& m_ee;

Dmac::DmaReceiveHandler m_receiveDma5;
Dmac::DmaReceiveHandler m_receiveDma6;
};
4 changes: 2 additions & 2 deletions Source/ee/Dmac_Channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ namespace Dmac
void ExecuteSourceChainTransfer(bool);
void ClearSTR();

CDMAC& m_dmac;
unsigned int m_number = 0;
uint32 m_nSCCTRL;
DmaReceiveHandler m_receive;
CDMAC& m_dmac;
uint32 m_nSCCTRL;
};
};
5 changes: 3 additions & 2 deletions Source/ee/EeBasicBlock.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "EeBasicBlock.h"
#include "offsetof_def.h"

void CEeBasicBlock::CompileEpilog(CMipsJitter* jitter, bool loopsOnItself)
{
Expand Down Expand Up @@ -123,8 +124,8 @@ bool CEeBasicBlock::IsIdleLoopBlock() const
}

//Just make sure that we've at least defined our comparision register
bool compareRsDefined = defState & (1 << compareRs);
bool compareRtDefined = defState & (1 << compareRt);
FRAMEWORK_MAYBE_UNUSED bool compareRsDefined = defState & (1 << compareRs);
FRAMEWORK_MAYBE_UNUSED bool compareRtDefined = defState & (1 << compareRt);

assert(compareRsDefined || compareRtDefined);

Expand Down
6 changes: 6 additions & 0 deletions Source/ee/Ee_IdleEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ void CIdleEvaluator::STRATEGY_SEMACHECKER::NotifyEvent(EVENT eventType, uint32 a
m_lastWaitSema = -1;
m_isIdle = false;
break;
default:
break;
}
}

Expand Down Expand Up @@ -99,6 +101,8 @@ void CIdleEvaluator::STRATEGY_SELFTHREADROTATE::NotifyEvent(EVENT eventType, uin
m_selfRotateThreadCount = 0;
m_isIdle = false;
break;
default:
break;
}
}

Expand Down Expand Up @@ -139,6 +143,8 @@ void CIdleEvaluator::STRATEGY_THREADROTATEBOUNCE::NotifyEvent(EVENT eventType, u
case EVENT_INTERRUPT:
m_bounceCount = 0;
break;
default:
break;
}
m_isIdle = (m_bounceCount > 1000);
}
2 changes: 1 addition & 1 deletion Source/ee/Ee_SubSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ CSubSystem::CSubSystem(uint8* iopRam, CIopBios& iopBios)
, m_sif(m_dmac, m_ram, iopRam)
, m_ipu(m_intc)
, m_timer(m_intc, m_gs)
, m_iopBios(iopBios)
, m_MAVU0(PS2::VUMEM0SIZE - 1)
, m_MAVU1(PS2::VUMEM1SIZE - 1)
, m_COP_SCU(MIPS_REGSIZE_64)
, m_COP_FPU(MIPS_REGSIZE_64)
, m_COP_VU(MIPS_REGSIZE_64)
, m_iopBios(iopBios)
{
//Some alignment checks, this is needed because of SIMD instructions used in generated code
assert((reinterpret_cast<size_t>(&m_EE.m_State) & 0x0F) == 0);
Expand Down
10 changes: 5 additions & 5 deletions Source/ee/Ee_SubSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ namespace Ee
uint8* m_vuMem1 = nullptr;
uint8* m_microMem1 = nullptr;

CMIPS m_EE;
CMIPS m_VU0;
CMIPS m_VU1;

CGSHandler* m_gs = nullptr;
CDMAC m_dmac;
CGIF m_gif;
Expand All @@ -61,13 +65,9 @@ namespace Ee
CINTC m_intc;
CIPU m_ipu;
CTimer m_timer;
CPS2OS* m_os;
CPS2OS* m_os = nullptr;
CIopBios& m_iopBios;

CMIPS m_EE;
CMIPS m_VU0;
CMIPS m_VU1;

void* operator new(size_t allocSize)
{
return framework_aligned_alloc(allocSize, 0x10);
Expand Down
2 changes: 1 addition & 1 deletion Source/ee/GIF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ void CGIF::ProcessFifoWrite(uint32 address, uint32 value)
m_fifoIndex += 4;
if(m_fifoIndex == FIFO_SIZE)
{
uint32 processed = ProcessMultiplePackets(m_fifoBuffer, FIFO_SIZE, 0, FIFO_SIZE, CGsPacketMetadata(3));
FRAMEWORK_MAYBE_UNUSED uint32 processed = ProcessMultiplePackets(m_fifoBuffer, FIFO_SIZE, 0, FIFO_SIZE, CGsPacketMetadata(3));
assert(processed == FIFO_SIZE);
m_fifoIndex = 0;
}
Expand Down
52 changes: 3 additions & 49 deletions Source/ee/IPU.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#include "IPU.h"
#include <cassert>
#include <cstring>
#include <stdio.h>
#include <exception>
#include <functional>
#include "IPU.h"
#include "maybe_unused.h"
#include "IPU_MacroblockAddressIncrementTable.h"
#include "IPU_MacroblockTypeITable.h"
#include "IPU_MacroblockTypePTable.h"
Expand Down Expand Up @@ -742,13 +743,6 @@ void CIPU::DisassembleCommand(uint32 nValue)
//OUT FIFO class implementation
/////////////////////////////////////////////

CIPU::COUTFIFO::COUTFIFO()
: m_buffer(nullptr)
, m_alloc(0)
, m_size(0)
{
}

CIPU::COUTFIFO::~COUTFIFO()
{
free(m_buffer);
Expand Down Expand Up @@ -1100,7 +1094,7 @@ bool CIPU::CIDECCommand::Execute()
if(m_CSCCommand->Execute())
{
//All data should have been consumed by CSC, so nothing should remain
uint32 remainLength = m_temp_IN_FIFO.GetAvailableBits() + (m_blockStream.GetRemainingLength() * 8);
FRAMEWORK_MAYBE_UNUSED uint32 remainLength = m_temp_IN_FIFO.GetAvailableBits() + (m_blockStream.GetRemainingLength() * 8);
assert(remainLength == 0);
m_state = STATE_CHECKSTARTCODE;
break;
Expand Down Expand Up @@ -1399,21 +1393,6 @@ bool CIPU::CBDECCommand::Execute()
//BDEC ReadDct subcommand implementation
/////////////////////////////////////////////

CIPU::CBDECCommand_ReadDct::CBDECCommand_ReadDct()
: m_state(STATE_INIT)
, m_IN_FIFO(NULL)
, m_coeffTable(NULL)
, m_block(NULL)
, m_dcPredictor(NULL)
, m_dcDiff(0)
, m_channelId(0)
, m_mbi(false)
, m_isMpeg1CoeffVLCTable(false)
, m_isMpeg2(true)
, m_blockIndex(0)
{
}

void CIPU::CBDECCommand_ReadDct::Initialize(CINFIFO* fifo, int16* block, unsigned int channelId, int16* dcPredictor, bool mbi, bool isMpeg1CoeffVLCTable, bool isMpeg2)
{
m_state = STATE_INIT;
Expand Down Expand Up @@ -1546,14 +1525,6 @@ bool CIPU::CBDECCommand_ReadDct::Execute()
/////////////////////////////////////////////
//BDEC ReadDcDiff subcommand implementation
/////////////////////////////////////////////
CIPU::CBDECCommand_ReadDcDiff::CBDECCommand_ReadDcDiff()
: m_state(STATE_READSIZE)
, m_result(NULL)
, m_IN_FIFO(NULL)
, m_channelId(0)
, m_dcSize(0)
{
}

void CIPU::CBDECCommand_ReadDcDiff::Initialize(CINFIFO* fifo, unsigned int channelId, int16* result)
{
Expand Down Expand Up @@ -1631,15 +1602,6 @@ bool CIPU::CBDECCommand_ReadDcDiff::Execute()
//VDEC command implementation
/////////////////////////////////////////////

CIPU::CVDECCommand::CVDECCommand()
: m_IN_FIFO(NULL)
, m_state(STATE_ADVANCE)
, m_commandCode(0)
, m_result(NULL)
, m_table(NULL)
{
}

void CIPU::CVDECCommand::Initialize(CINFIFO* fifo, uint32 commandCode, uint32 pictureType, uint32* result)
{
m_IN_FIFO = fifo;
Expand Down Expand Up @@ -1743,14 +1705,6 @@ bool CIPU::CVDECCommand::Execute()
//FDEC command implementation
/////////////////////////////////////////////

CIPU::CFDECCommand::CFDECCommand()
: m_IN_FIFO(NULL)
, m_state(STATE_ADVANCE)
, m_commandCode(0)
, m_result(NULL)
{
}

void CIPU::CFDECCommand::Initialize(CINFIFO* fifo, uint32 commandCode, uint32* result)
{
m_IN_FIFO = fifo;
Expand Down
Loading

0 comments on commit aee69ac

Please sign in to comment.