diff options
| author | 2014-10-25 15:19:05 -0400 | |
|---|---|---|
| committer | 2014-10-25 15:19:05 -0400 | |
| commit | 70058f8151a9c6599bbcd9d5772b87c9602ed0fa (patch) | |
| tree | b7f0711f1d817b18f041fea31cfcf0ebe9cbba69 /src/common/timer.cpp | |
| parent | Merge pull request #112 from bunnei/skyeye-dyncom-interpreter (diff) | |
| parent | Removed uses of raw c-string manipulation functions. (diff) | |
| download | yuzu-70058f8151a9c6599bbcd9d5772b87c9602ed0fa.tar.gz yuzu-70058f8151a9c6599bbcd9d5772b87c9602ed0fa.tar.xz yuzu-70058f8151a9c6599bbcd9d5772b87c9602ed0fa.zip | |
Merge pull request #148 from archshift/no-cstring
Removed some uses of raw c-string manipulation functions.
Diffstat (limited to '')
| -rw-r--r-- | src/common/timer.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/common/timer.cpp b/src/common/timer.cpp index f8e1fadca..ded4a344e 100644 --- a/src/common/timer.cpp +++ b/src/common/timer.cpp | |||
| @@ -169,7 +169,6 @@ std::string Timer::GetTimeFormatted() | |||
| 169 | { | 169 | { |
| 170 | time_t sysTime; | 170 | time_t sysTime; |
| 171 | struct tm * gmTime; | 171 | struct tm * gmTime; |
| 172 | char formattedTime[13]; | ||
| 173 | char tmp[13]; | 172 | char tmp[13]; |
| 174 | 173 | ||
| 175 | time(&sysTime); | 174 | time(&sysTime); |
| @@ -181,14 +180,12 @@ std::string Timer::GetTimeFormatted() | |||
| 181 | #ifdef _WIN32 | 180 | #ifdef _WIN32 |
| 182 | struct timeb tp; | 181 | struct timeb tp; |
| 183 | (void)::ftime(&tp); | 182 | (void)::ftime(&tp); |
| 184 | sprintf(formattedTime, "%s:%03i", tmp, tp.millitm); | 183 | return StringFromFormat("%s:%03i", tmp, tp.millitm); |
| 185 | #else | 184 | #else |
| 186 | struct timeval t; | 185 | struct timeval t; |
| 187 | (void)gettimeofday(&t, NULL); | 186 | (void)gettimeofday(&t, NULL); |
| 188 | sprintf(formattedTime, "%s:%03d", tmp, (int)(t.tv_usec / 1000)); | 187 | return StringFromFormat("%s:%03d", tmp, (int)(t.tv_usec / 1000)); |
| 189 | #endif | 188 | #endif |
| 190 | |||
| 191 | return std::string(formattedTime); | ||
| 192 | } | 189 | } |
| 193 | 190 | ||
| 194 | // Returns a timestamp with decimals for precise time comparisons | 191 | // Returns a timestamp with decimals for precise time comparisons |