Index: src/OFDate.m ================================================================== --- src/OFDate.m +++ src/OFDate.m @@ -49,11 +49,11 @@ #ifdef HAVE_GMTIME_R # define GMTIME_RET(field) \ time_t seconds = (time_t)_seconds; \ struct tm tm; \ \ - if (seconds != floor(_seconds)) \ + if (seconds != trunc(_seconds)) \ @throw [OFOutOfRangeException exception]; \ \ if (gmtime_r(&seconds, &tm) == NULL) \ @throw [OFOutOfRangeException exception]; \ \ @@ -60,11 +60,11 @@ return tm.field; # define LOCALTIME_RET(field) \ time_t seconds = (time_t)_seconds; \ struct tm tm; \ \ - if (seconds != floor(_seconds)) \ + if (seconds != trunc(_seconds)) \ @throw [OFOutOfRangeException exception]; \ \ if (localtime_r(&seconds, &tm) == NULL) \ @throw [OFOutOfRangeException exception]; \ \ @@ -73,11 +73,11 @@ # ifdef OF_HAVE_THREADS # define GMTIME_RET(field) \ time_t seconds = (time_t)_seconds; \ struct tm *tm; \ \ - if (seconds != floor(_seconds)) \ + if (seconds != trunc(_seconds)) \ @throw [OFOutOfRangeException exception]; \ \ [mutex lock]; \ \ @try { \ @@ -90,11 +90,11 @@ } # define LOCALTIME_RET(field) \ time_t seconds = (time_t)_seconds; \ struct tm *tm; \ \ - if (seconds != floor(_seconds)) \ + if (seconds != trunc(_seconds)) \ @throw [OFOutOfRangeException exception]; \ \ [mutex lock]; \ \ @try { \ @@ -108,11 +108,11 @@ # else # define GMTIME_RET(field) \ time_t seconds = (time_t)_seconds; \ struct tm *tm; \ \ - if (seconds != floor(_seconds)) \ + if (seconds != trunc(_seconds)) \ @throw [OFOutOfRangeException exception]; \ \ if ((tm = gmtime(&seconds)) == NULL) \ @throw [OFOutOfRangeException exception]; \ \ @@ -119,11 +119,11 @@ return tm->field; # define LOCALTIME_RET(field) \ time_t seconds = (time_t)_seconds; \ struct tm *tm; \ \ - if (seconds != floor(_seconds)) \ + if (seconds != trunc(_seconds)) \ @throw [OFOutOfRangeException exception]; \ \ if ((tm = localtime(&seconds)) == NULL) \ @throw [OFOutOfRangeException exception]; \ \ @@ -499,11 +499,11 @@ return [ret autorelease]; } - (uint32_t)microsecond { - return (uint32_t)((_seconds - floor(_seconds)) * 1000000); + return (uint32_t)((_seconds - trunc(_seconds)) * 1000000); } - (uint8_t)second { GMTIME_RET(tm_sec) @@ -589,11 +589,11 @@ char *buffer; #else wchar_t *buffer; #endif - if (seconds != floor(_seconds)) + if (seconds != trunc(_seconds)) @throw [OFOutOfRangeException exception]; #ifdef HAVE_GMTIME_R if (gmtime_r(&seconds, &tm) == NULL) @throw [OFOutOfRangeException exception]; @@ -649,11 +649,11 @@ char *buffer; #else wchar_t *buffer; #endif - if (seconds != floor(_seconds)) + if (seconds != trunc(_seconds)) @throw [OFOutOfRangeException exception]; #ifdef HAVE_LOCALTIME_R if (localtime_r(&seconds, &tm) == NULL) @throw [OFOutOfRangeException exception]; Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -202,11 +202,11 @@ struct timespec rqtp; rqtp.tv_sec = (time_t)timeInterval; rqtp.tv_nsec = lrint((timeInterval - rqtp.tv_sec) * 1000000000); - if (rqtp.tv_sec != floor(timeInterval)) + if (rqtp.tv_sec != trunc(timeInterval)) @throw [OFOutOfRangeException exception]; nanosleep(&rqtp, NULL); #elif defined(OF_AMIGAOS) if (timeInterval * 50 > ULONG_MAX) @@ -231,11 +231,11 @@ if (timeInterval > UINT_MAX) @throw [OFOutOfRangeException exception]; sleep((unsigned int)timeInterval); usleep((unsigned int)lrint( - (timeInterval - floor(timeInterval)) * 1000000)); + (timeInterval - trunc(timeInterval)) * 1000000)); #endif } + (void)sleepUntilDate: (OFDate *)date { Index: utils/ofhttp/ProgressBar.m ================================================================== --- utils/ofhttp/ProgressBar.m +++ utils/ofhttp/ProgressBar.m @@ -104,11 +104,11 @@ [of_stdout writeString: @"\r ▕"]; for (size_t i = 0; i < (size_t)bars; i++) [of_stdout writeString: @"█"]; if (bars < barWidth) { - float rem = bars - floorf(bars); + float rem = bars - truncf(bars); if (rem >= 0.875) [of_stdout writeString: @"▉"]; else if (rem >= 0.75) [of_stdout writeString: @"▊"];