First part of the const changes etc

This commit is contained in:
Henrik Rydgård 2024-09-17 15:13:13 +02:00
parent 9d48e51205
commit 2ba4eaf3dd
11 changed files with 14 additions and 26 deletions

View File

@ -1934,7 +1934,7 @@ inline int64_t abs64(int64_t x) {
return x >= 0 ? x : -x;
}
int Count(bool part[4]) {
static int Count(const bool part[4]) {
int cnt = 0;
for (int i = 0; i < 4; i++) {
if (part[i])

View File

@ -456,7 +456,7 @@ public:
void AddNewLit(u32 val);
bool TrySetValue_TwoOp(ARMReg reg, u32 val);
CCFlags GetCC() { return CCFlags(condition >> 28); }
CCFlags GetCC() const { return CCFlags(condition >> 28); }
void SetCC(CCFlags cond = CC_AL);
// Special purpose instructions

View File

@ -74,7 +74,7 @@ public:
size_t size() const { return data_.size(); }
bool empty() const { return size() == 0; }
void clear() { data_.resize(0); }
bool IsVoid() { return void_; }
bool IsVoid() const { return void_; }
protected:
// TODO: Find a better internal representation, like a cord.

View File

@ -73,7 +73,7 @@ void ppsspp_md5_starts( md5_context *ctx )
ctx->state[3] = 0x10325476;
}
static void ppsspp_md5_process( md5_context *ctx, unsigned char data[64] )
static void ppsspp_md5_process( md5_context *ctx, const unsigned char data[64] )
{
unsigned long X[16], A, B, C, D;

View File

@ -74,7 +74,7 @@ void sha1_starts( sha1_context *ctx )
ctx->state[4] = 0xC3D2E1F0;
}
static void sha1_process( sha1_context *ctx, unsigned char data[64] )
static void sha1_process( sha1_context *ctx, const unsigned char data[64] )
{
unsigned long temp, W[16], A, B, C, D, E;

View File

@ -204,10 +204,6 @@ void PathBrowser::ResetPending() {
pendingPath_.clear();
}
bool PathBrowser::IsListingReady() {
return ready_;
}
std::string PathBrowser::GetFriendlyPath() const {
// Show relative to memstick root if there.
if (path_.StartsWith(aliasMatch_)) {

View File

@ -23,7 +23,9 @@ public:
void Refresh() {
HandlePath();
}
bool IsListingReady();
bool IsListingReady() const {
return ready_;
}
bool GetListing(std::vector<File::FileInfo> &fileInfo, const char *filter = nullptr, bool *cancel = nullptr);
bool CanNavigateUp();

View File

@ -86,7 +86,6 @@ public:
// Utility for users of this class, not used internally.
enum { INVALID_OFFSET = 0xFFFFFFFF };
private:
// Needs context in case of defragment.
void Begin() {
buf_ = 0;
@ -105,7 +104,6 @@ private:
Unmap();
}
public:
void Map();
void Unmap();

View File

@ -376,14 +376,6 @@ public:
deleter_.pushBuffers.push_back(pushbuffer);
}
void BeginPushBuffer(GLPushBuffer *pushbuffer) {
pushbuffer->Begin();
}
void EndPushBuffer(GLPushBuffer *pushbuffer) {
pushbuffer->End();
}
bool IsInRenderPass() const {
return curRenderStep_ && curRenderStep_->stepType == GLRStepType::RENDER;
}

View File

@ -799,12 +799,12 @@ OpenGLContext::~OpenGLContext() {
void OpenGLContext::BeginFrame(DebugFlags debugFlags) {
renderManager_.BeginFrame(debugFlags & DebugFlags::PROFILE_TIMESTAMPS);
FrameData &frameData = frameData_[renderManager_.GetCurFrame()];
renderManager_.BeginPushBuffer(frameData.push);
frameData.push->Begin();
}
void OpenGLContext::EndFrame() {
FrameData &frameData = frameData_[renderManager_.GetCurFrame()];
renderManager_.EndPushBuffer(frameData.push); // upload the data!
frameData.push->End(); // upload the data!
renderManager_.Finish();
Invalidate(InvalidationFlags::CACHED_RENDER_STATE);
}

View File

@ -150,16 +150,16 @@ void DrawEngineGLES::ClearInputLayoutMap() {
void DrawEngineGLES::BeginFrame() {
FrameData &frameData = frameData_[render_->GetCurFrame()];
render_->BeginPushBuffer(frameData.pushIndex);
render_->BeginPushBuffer(frameData.pushVertex);
frameData.pushIndex->Begin();
frameData.pushVertex->Begin();
lastRenderStepId_ = -1;
}
void DrawEngineGLES::EndFrame() {
FrameData &frameData = frameData_[render_->GetCurFrame()];
render_->EndPushBuffer(frameData.pushIndex);
render_->EndPushBuffer(frameData.pushVertex);
frameData.pushIndex->End();
frameData.pushVertex->End();
tessDataTransferGLES->EndFrame();
}