Task #637
Avoid using default NULL in const char *
Status: | Approved | Start date: | 01/08/2014 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | Miroslav Fidler | % Done: | 0% | |
Category: | Core | Spent time: | - | |
Target version: | - |
Description
From issue 577, there are some places where the use of char *name = NULL should be reviewed. For example:
- Core/profile.h ==> TimingInspector(const char *name = NULL)
- Core/Debug.cpp TimingInspector::TimingInspector(const char *name) ==> name = _name ? _name : "";
- Core/util.h ==> LoadFromFile(T& x, const char *name = NULL, int version = Null)
StoreToFile(T& x, const char *name = NULL, int version = Null)
- Core/Stream.cpp > String Cfgname(const char *file) {
return file ? String(file) : ConfigFile();
}
- Core/Value.h > static void Register(const char *name = NULL);
static void SvoRegister(const char *name = NULL);
- Core/Xmlize.h ==> String StoreAsXML(const T& data, const char *name = NULL)
bool StoreAsXMLFile(Callback1<XmlIO> xmlize, const char *name = NULL, const char *file = NULL);
bool StoreAsXMLFile(T& data, const char *name = NULL, const char *file = NULL)
- Core/Xmlize.cpp ==> bool StoreAsXMLFile(Callback1<XmlIO> xmlize, const char *name, const char *file) {
return SaveFile(sXMLFile(file), StoreAsXML(xmlize, name ? (String)name : GetExeTitle()));
}
History
#1 Updated by Miroslav Fidler over 11 years ago
- Status changed from New to Approved
I have checked all of them and they are legit, with NULL being meaningful.
#2 Updated by Iñaki Zabala over 11 years ago
Ok. Thank you.