Constify Load/Save

This commit is contained in:
simon.kagstrom 2010-02-07 14:31:24 +00:00
parent 3a83b3f66a
commit b9880faf01
3 changed files with 6 additions and 6 deletions

View File

@ -253,7 +253,7 @@ void Prefs::Check(void)
* Load preferences from file * Load preferences from file
*/ */
void Prefs::Load(char *filename) void Prefs::Load(const char *filename)
{ {
FILE *file; FILE *file;
char line[256], keyword[256], value[256]; char line[256], keyword[256], value[256];
@ -405,7 +405,7 @@ void Prefs::Load(char *filename)
* true: success, false: error * true: success, false: error
*/ */
bool Prefs::Save(char *filename) bool Prefs::Save(const char *filename)
{ {
FILE *file; FILE *file;

View File

@ -96,8 +96,8 @@ public:
Prefs(); Prefs();
bool ShowEditor(bool startup, char *prefs_name); bool ShowEditor(bool startup, char *prefs_name);
void Check(void); void Check(void);
void Load(char *filename); void Load(const char *filename);
bool Save(char *filename); bool Save(const char *filename);
bool operator==(const Prefs &rhs) const; bool operator==(const Prefs &rhs) const;
bool operator!=(const Prefs &rhs) const; bool operator!=(const Prefs &rhs) const;

View File

@ -95,7 +95,7 @@ void Frodo::ReadyToRun(void)
{ {
getcwd(AppDirPath, 256); getcwd(AppDirPath, 256);
ThePrefs.Load((char*)PREFS_PATH); ThePrefs.Load(PREFS_PATH);
// Create and start C64 // Create and start C64
TheC64 = new C64; TheC64 = new C64;
@ -109,7 +109,7 @@ void Frodo::ReadyToRun(void)
Prefs *Frodo::reload_prefs(void) Prefs *Frodo::reload_prefs(void)
{ {
static Prefs newprefs; static Prefs newprefs;
newprefs.Load((char*)PREFS_PATH); newprefs.Load(PREFS_PATH);
return &newprefs; return &newprefs;
} }