Open canndrew opened 7 years ago
atoi and atof are used so that we don't rely on Qt's conversions. I think it is worth having a conversation though as to whether we should use the newer c++11 functions:
http://en.cppreference.com/w/cpp/string/basic_string/stol http://en.cppreference.com/w/cpp/string/basic_string/stof
Once we make sure that it won't break anything all of the atoi and atof calls could be replaced with the equivalent c++11 functions.
What's the motive for avoiding Qt's conversion functions? Keeping ato{f,i}
would be a bad idea since they can be used to invoke undefined behaviour and there's lots of places where they're being fed unsanitized user input.
Are we currently pre-C++11 compatible and, if so, is that something we want to maintain?
Replace their usage with
toDouble
/toInt