Permalink
Browse files

allocate setting_t structure

  • Loading branch information...
1 parent 632ae84 commit 07f36b955141aaaa150b6d879b77ca4c7ba3ca48 Henrik Friedrichsen committed Aug 26, 2008
Showing with 6 additions and 6 deletions.
  1. +6 −6 settings.h
View
12 settings.h
@@ -18,17 +18,17 @@ class CSettings
void LoadConfig();
void ParseLine(std::string line);
- inline void Set(std::string name, int ival) { settings[name]->type = TYPE_INT; settings[name]->ival = ival; }
- inline void Set(std::string name, std::string sval) { settings[name]->type = TYPE_STRING; settings[name]->sval = sval; }
+ void Set(std::string name, int ival) { settings[name].type = TYPE_INT; settings[name].ival = ival; }
+ void Set(std::string name, std::string sval) { settings[name].type = TYPE_STRING; settings[name].sval = sval; }
- int GetI(std::string name) { return settings[name]->ival; }
- std::string GetS(std::string name) { return settings[name]->sval; }
+ int GetI(std::string name) { return settings[name].ival; }
+ std::string GetS(std::string name) { return settings[name].sval; }
inline std::string* getDir() { return &_dir; }
- inline std::map<std::string, setting_t*>* getSettingMap() { return &settings; }
+ inline std::map<std::string, setting_t>* getSettingMap() { return &settings; }
private:
- std::map<std::string, setting_t*> settings;
+ std::map<std::string, setting_t> settings;
std::string _dir;
};
extern CSettings* Settings;

0 comments on commit 07f36b9

Please sign in to comment.