summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-12-19 13:14:46 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-12-19 13:14:46 +0900
commitd64e10228da1cabf07c3d5f6289e219a12d4cd86 (patch)
tree0cded7c06cb2e59cb472bf7b1b3c90b11daeb21b /time.c
parentdf4820e749fbada28b622ccd36c3a1d542231705 (diff)
downloadruby-d64e10228da1cabf07c3d5f6289e219a12d4cd86.tar.gz
Fix guess_diff type
`unsigned_time_t` has the same size as `time_t`, but it doesn't mean these types are same except for signedness. For instance, while `long` and `long long` has the same size and `time_t` is defined as the latter on 64bit OpenBSD, `unsigned_time_t` has been defined as `long`.
Diffstat (limited to 'time.c')
-rw-r--r--time.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/time.c b/time.c
index bedfc88fe4..3b8ca5784a 100644
--- a/time.c
+++ b/time.c
@@ -3193,7 +3193,7 @@ static const bool debug_guessrange =
static inline void
debug_report_guessrange(time_t guess_lo, time_t guess_hi)
{
- unsigned_time_t guess_diff = (unsigned_time_t)(guess_hi-guess_lo);
+ time_t guess_diff = guess_hi - guess_lo;
fprintf(stderr, "find time guess range: %"PRI_TIMET_PREFIX"d - "
"%"PRI_TIMET_PREFIX"d : %"PRI_TIMET_PREFIX"u\n",
guess_lo, guess_hi, guess_diff);