Correct some non-const string literals.

Should not be treated as non-const char *.
This commit is contained in:
Unknown W. Brackets 2014-04-27 20:41:51 -07:00
parent 80eb12a9d6
commit bcf63a0fae
4 changed files with 10 additions and 10 deletions

View File

@ -14,7 +14,7 @@ std::vector<SFunc *> g_static_funcs_list;
struct ModuleInfo
{
u32 id;
char* name;
const char* name;
}
static const g_module_list[] =
{

View File

@ -31,7 +31,7 @@ struct SFunc
{
func_caller* func;
void* ptr;
char* name;
const char* name;
std::vector<SFuncOp> ops;
u64 group;
u32 found;
@ -117,7 +117,7 @@ public:
template<typename T> __forceinline void AddFunc(u32 id, T func);
template<typename T> __forceinline void AddFuncSub(const char group[8], const u64 ops[], char* name, T func);
template<typename T> __forceinline void AddFuncSub(const char group[8], const u64 ops[], const char* name, T func);
};
template<typename T>
@ -127,7 +127,7 @@ __forceinline void Module::AddFunc(u32 id, T func)
}
template<typename T>
__forceinline void Module::AddFuncSub(const char group[8], const u64 ops[], char* name, T func)
__forceinline void Module::AddFuncSub(const char group[8], const u64 ops[], const char* name, T func)
{
if (!ops[0]) return;

View File

@ -64,7 +64,7 @@ bool TRPLoader::LoadHeader(bool show)
return true;
}
bool TRPLoader::ContainsEntry(char *filename)
bool TRPLoader::ContainsEntry(const char *filename)
{
for (const TRPEntry& entry : m_entries) {
if (!strcmp(entry.name, filename))
@ -73,7 +73,7 @@ bool TRPLoader::ContainsEntry(char *filename)
return false;
}
void TRPLoader::RemoveEntry(char *filename)
void TRPLoader::RemoveEntry(const char *filename)
{
std::vector<TRPEntry>::iterator i = m_entries.begin();
while (i != m_entries.end()) {
@ -84,7 +84,7 @@ void TRPLoader::RemoveEntry(char *filename)
}
}
void TRPLoader::RenameEntry(char *oldname, char *newname)
void TRPLoader::RenameEntry(const char *oldname, const char *newname)
{
for (const TRPEntry& entry : m_entries) {
if (!strcmp(entry.name, oldname))

View File

@ -34,9 +34,9 @@ public:
virtual bool Install(std::string dest, bool show = false);
virtual bool LoadHeader(bool show = false);
virtual bool ContainsEntry(char *filename);
virtual void RemoveEntry(char *filename);
virtual void RenameEntry(char *oldname, char *newname);
virtual bool ContainsEntry(const char *filename);
virtual void RemoveEntry(const char *filename);
virtual void RenameEntry(const char *oldname, const char *newname);
virtual bool Close();
};