mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 19:17:19 +02:00
Code Cleanup
- Migrated format helper functions over from taskd. - Converted much of the sprintf usage to format calls.
This commit is contained in:
parent
5f007ed1d9
commit
a6cf99a83c
12 changed files with 138 additions and 47 deletions
|
@ -640,17 +640,13 @@ const bool Config::getBoolean (const std::string& key)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Config::set (const std::string& key, const int value)
|
||||
{
|
||||
char v[24];
|
||||
sprintf (v, "%d", value);
|
||||
(*this)[key] = v;
|
||||
(*this)[key] = format (value);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Config::set (const std::string& key, const double value)
|
||||
{
|
||||
char v[32];
|
||||
sprintf (v, "%f", value);
|
||||
(*this)[key] = v;
|
||||
(*this)[key] = format (value, 1, 8);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue