diff --git a/Core/Config.cpp b/Core/Config.cpp index 3a22b46ed..7c4d2d3cf 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -141,7 +141,7 @@ struct ConfigSetting { cb_.s = def; } - bool HasMore() { + bool HasMore() const { return type_ != TYPE_TERMINATOR; } diff --git a/Core/ELF/ElfReader.cpp b/Core/ELF/ElfReader.cpp index 2df7fa01e..c8ba0aa8d 100644 --- a/Core/ELF/ElfReader.cpp +++ b/Core/ELF/ElfReader.cpp @@ -580,7 +580,7 @@ int ElfReader::LoadInto(u32 loadAddress, bool fromTop) } -SectionID ElfReader::GetSectionByName(const char *name, int firstSection) +SectionID ElfReader::GetSectionByName(const char *name, int firstSection) const { for (int i = firstSection; i < header->e_shnum; i++) { diff --git a/Core/ELF/ElfReader.h b/Core/ELF/ElfReader.h index 62417a7db..80427db58 100644 --- a/Core/ELF/ElfReader.h +++ b/Core/ELF/ElfReader.h @@ -72,10 +72,10 @@ public: } // Quick accessors - ElfType GetType() { return (ElfType)(u16)(header->e_type); } - ElfMachine GetMachine() { return (ElfMachine)(u16)(header->e_machine); } - u32 GetEntryPoint() { return entryPoint; } - u32 GetFlags() { return (u32)(header->e_flags); } + ElfType GetType() const { return (ElfType)(u16)(header->e_type); } + ElfMachine GetMachine() const { return (ElfMachine)(u16)(header->e_machine); } + u32 GetEntryPoint() const { return entryPoint; } + u32 GetFlags() const { return (u32)(header->e_flags); } int GetNumSegments() const { return (int)(header->e_phnum); } int GetNumSections() const { return (int)(header->e_shnum); } @@ -100,7 +100,7 @@ public: int GetSectionSize(SectionID section) const { return sections[section].sh_size; } - SectionID GetSectionByName(const char *name, int firstSection=0); //-1 for not found + SectionID GetSectionByName(const char *name, int firstSection=0) const; //-1 for not found u32 GetSegmentPaddr(int segment) const { return segments[segment].p_paddr; diff --git a/Core/HLE/sceAtrac.cpp b/Core/HLE/sceAtrac.cpp index 46554ffbc..39b4feaed 100644 --- a/Core/HLE/sceAtrac.cpp +++ b/Core/HLE/sceAtrac.cpp @@ -218,12 +218,12 @@ struct Atrac { } int Analyze(); - u32 getDecodePosBySample(int sample) { + u32 getDecodePosBySample(int sample) const { int atracSamplesPerFrame = (codecType == PSP_MODE_AT_3_PLUS ? ATRAC3PLUS_MAX_SAMPLES : ATRAC3_MAX_SAMPLES); return (u32)(firstSampleoffset + sample / atracSamplesPerFrame * atracBytesPerFrame ); } - int getRemainFrames() { + int getRemainFrames() const { // games would like to add atrac data when it wants. // Do not try to guess when it want to add data. // Just return current remainFrames. diff --git a/Core/HLE/sceFont.cpp b/Core/HLE/sceFont.cpp index 7f5e8a886..e95d62fd6 100644 --- a/Core/HLE/sceFont.cpp +++ b/Core/HLE/sceFont.cpp @@ -485,7 +485,7 @@ public: nfl_->altCharCode = charCode; } - int GetFontHandle(int index) { + int GetFontHandle(int index) const { return fonts_[index]; } diff --git a/Core/HLE/sceKernel.cpp b/Core/HLE/sceKernel.cpp index a9c6fa04c..c4bbded76 100644 --- a/Core/HLE/sceKernel.cpp +++ b/Core/HLE/sceKernel.cpp @@ -470,7 +470,7 @@ SceUID KernelObjectPool::Create(KernelObject *obj, int rangeBottom, int rangeTop return 0; } -bool KernelObjectPool::IsValid(SceUID handle) +bool KernelObjectPool::IsValid(SceUID handle) const { int index = handle - handleOffset; if (index < 0) @@ -520,7 +520,7 @@ void KernelObjectPool::List() } } -int KernelObjectPool::GetCount() +int KernelObjectPool::GetCount() const { int count = 0; for (int i=0; i T* Get(SceUID handle, u32 &outError) @@ -533,7 +533,7 @@ public: KernelObject *&operator [](SceUID handle); void List(); void Clear(); - int GetCount(); + int GetCount() const; private: enum { diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index 538987354..100bbf4de 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -258,7 +258,7 @@ struct SceKernelVplHeader { return false; } - u32 FreeSize() { + u32 FreeSize() const { // Size less the header and number of allocated bytes. return sizeMinus8_ + 8 - 0x20 - allocatedInBlocks_ * 8; } diff --git a/Core/HLE/scePsmf.cpp b/Core/HLE/scePsmf.cpp index 3bf2e907d..bc5c61e6f 100644 --- a/Core/HLE/scePsmf.cpp +++ b/Core/HLE/scePsmf.cpp @@ -163,7 +163,7 @@ public: ~Psmf(); void DoState(PointerWrap &p); - bool isValidCurrentStreamNumber() { + bool isValidCurrentStreamNumber() const { return currentStreamNum >= 0 && currentStreamNum < (int)streamMap.size(); // urgh, checking size isn't really right here. } diff --git a/Core/HW/MpegDemux.h b/Core/HW/MpegDemux.h index f52904b86..1394cd860 100644 --- a/Core/HW/MpegDemux.h +++ b/Core/HW/MpegDemux.h @@ -21,7 +21,7 @@ public: int getNextAudioFrame(u8 **buf, int *headerCode1, int *headerCode2, s64 *pts = NULL); bool hasNextAudioFrame(int *gotsizeOut, int *frameSizeOut, int *headerCode1, int *headerCode2); - inline int getRemainSize() { + int getRemainSize() const { return m_len - m_readSize; } @@ -52,7 +52,7 @@ private: s64 readPts(int c) { return (((s64) (c & 0x0E)) << 29) | ((read16() >> 1) << 15) | (read16() >> 1); } - bool isEOF() { + bool isEOF() const { return m_index >= m_len; } void skip(int n) { diff --git a/Core/HW/SasAudio.cpp b/Core/HW/SasAudio.cpp index 94b3433a9..61942a6a8 100644 --- a/Core/HW/SasAudio.cpp +++ b/Core/HW/SasAudio.cpp @@ -417,7 +417,7 @@ void SasVoice::ReadSamples(s16 *output, int numSamples) { } } -bool SasVoice::HaveSamplesEnded() { +bool SasVoice::HaveSamplesEnded() const { switch (type) { case VOICETYPE_VAG: return vag.End(); diff --git a/Core/HW/SasAudio.h b/Core/HW/SasAudio.h index aa83623fc..2f9aa9771 100644 --- a/Core/HW/SasAudio.h +++ b/Core/HW/SasAudio.h @@ -222,7 +222,7 @@ struct SasVoice { void DoState(PointerWrap &p); void ReadSamples(s16 *output, int numSamples); - bool HaveSamplesEnded(); + bool HaveSamplesEnded() const; bool playing; bool paused; // a voice can be playing AND paused. In that case, it won't play. diff --git a/Core/SaveState.cpp b/Core/SaveState.cpp index d284d0d75..19e3155f6 100644 --- a/Core/SaveState.cpp +++ b/Core/SaveState.cpp @@ -183,7 +183,7 @@ namespace SaveState next_ = 0; } - bool Empty() + bool Empty() const { return next_ == first_; } diff --git a/Core/Util/PPGeDraw.h b/Core/Util/PPGeDraw.h index 7bb195edc..8283d99f7 100644 --- a/Core/Util/PPGeDraw.h +++ b/Core/Util/PPGeDraw.h @@ -122,11 +122,11 @@ public: // Do not use, only for savestate upgrading. void CompatLoad(u32 texture, int width, int height); - int Width() { + int Width() const { return width_; } - int Height() { + int Height() const { return height_; }