mirror of
https://github.com/libretro/ppsspp.git
synced 2025-01-19 07:04:45 +00:00
Core: Mark some functions as const
This commit is contained in:
parent
0c349e062a
commit
f830d5dec7
@ -141,7 +141,7 @@ struct ConfigSetting {
|
||||
cb_.s = def;
|
||||
}
|
||||
|
||||
bool HasMore() {
|
||||
bool HasMore() const {
|
||||
return type_ != TYPE_TERMINATOR;
|
||||
}
|
||||
|
||||
|
@ -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++)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
@ -485,7 +485,7 @@ public:
|
||||
nfl_->altCharCode = charCode;
|
||||
}
|
||||
|
||||
int GetFontHandle(int index) {
|
||||
int GetFontHandle(int index) const {
|
||||
return fonts_[index];
|
||||
}
|
||||
|
||||
|
@ -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<maxCount; i++)
|
||||
|
@ -447,7 +447,7 @@ public:
|
||||
return error;
|
||||
};
|
||||
|
||||
bool IsValid(SceUID handle);
|
||||
bool IsValid(SceUID handle) const;
|
||||
|
||||
template <class T>
|
||||
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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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.
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
@ -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.
|
||||
|
@ -183,7 +183,7 @@ namespace SaveState
|
||||
next_ = 0;
|
||||
}
|
||||
|
||||
bool Empty()
|
||||
bool Empty() const
|
||||
{
|
||||
return next_ == first_;
|
||||
}
|
||||
|
@ -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_;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user