ext/result.cc in swift-0.5.0 vs ext/result.cc in swift-0.5.1

- old
+ new

@@ -86,14 +86,14 @@ } CATCH_DBI_EXCEPTIONS(); } // Calculates local offset at a given time, including dst. -size_t client_tzoffset(uint64_t local, int isdst) { +int64_t client_tzoffset(int64_t local, int isdst) { struct tm tm; gmtime_r((const time_t*)&local, &tm); - return local + (isdst ? 3600 : 0) - mktime(&tm); + return (int64_t)(local + (isdst ? 3600 : 0) - mktime(&tm)); } // pinched from do_postgres static void reduce(uint64_t *numerator, uint64_t *denominator) { uint64_t a, b, c; @@ -106,11 +106,11 @@ *denominator = *denominator / b; } VALUE typecast_datetime(const char *data, uint64_t len) { struct tm tm; - uint64_t epoch, adjust, offset; + int64_t epoch, adjust, offset; double usec = 0; char tzsign = 0; int tzhour = 0, tzmin = 0; @@ -146,10 +146,10 @@ ajd_n = epoch_ajd_n*ajd_d + ajd_n*epoch_ajd_d; ajd_d = epoch_ajd_d*ajd_d; reduce(&ajd_n, &ajd_d); VALUE ajd = rb_rational_new(SIZET2NUM(ajd_n), SIZET2NUM(ajd_d)); - return rb_funcall(cDateTime, fNewBang, 3, ajd, rb_rational_new(INT2FIX(offset), daysecs), sg); + return rb_funcall(cDateTime, fNewBang, 3, ajd, rb_rational_new(INT2FIX(adjust), daysecs), sg); } // TODO: throw a warning ? return rb_str_new(data, len); }