diff options
author | Chris Want <cwant@ualberta.ca> | 2006-02-01 23:16:50 +0300 |
---|---|---|
committer | Chris Want <cwant@ualberta.ca> | 2006-02-01 23:16:50 +0300 |
commit | dc2cab13bde32fd99ea2e694b9b49ef1d9608a03 (patch) | |
tree | 0a07ba07fc7d3f9d92d0b2d47bb05e61bb3a29ac /source | |
parent | 76ba34768e36d89b764d798e4fc26a12ea3d9dd9 (diff) |
Strangely, the BLI_timestr() function returns nonsense on linux for
ia64. It appears that if I get rid of the fmod expression, and
use integer math I get the right values. Hopefully this isn't a
problem for anybody.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/util.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index d6ed130c9bc..04c2092e56d 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -1137,10 +1137,10 @@ int BLI_strncasecmp(const char *s1, const char *s2, int n) { void BLI_timestr(double time, char *str) { /* format 00:00:00.00 (hr:min:sec) string has to be 12 long */ - int hr= (int) time/(60*60); - int min= (int) fmod(time/60, 60.0); - int sec= (int) fmod(time, 60.0); - int hun= (int) fmod(time*100.0, 100.0); + int hr= ((int) time) / (60*60); + int min= ( ((int) time) / 60 ) % 60; + int sec= ((int) (time)) % 60; + int hun= ((int) (time * 100.0)) % 100; if (hr) { sprintf(str, "%.2d:%.2d:%.2d.%.2d",hr,min,sec,hun); |