git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: d7cff12) | patch
Silence some Coverity warnings and improve code consistency.
2021年4月11日 21:02:04 +0000 (17:02 -0400)
2021年4月11日 21:02:04 +0000 (17:02 -0400)
commit 6277435a8a89c59f716c111200c072d1454b8ff2
Silence some Coverity warnings and improve code consistency.

Coverity complained about possible overflow in expressions like
intresult = tm->tm_sec * 1000000 + fsec;
on the grounds that the multiplication would happen in 32-bit
arithmetic before widening to the int64 result. I think these
are all false positives because of the limited possible range of
tm_sec; but nonetheless it seems silly to spell it like that when
nearby lines have the identical computation written with a 64-bit
constant.

... or more accurately, with an LL constant, which is not project
style. Make all of these use INT64CONST(), as we do elsewhere.

This is all new code from a2da77cdb, so no need for back-patch.
src/backend/utils/adt/date.c diff | blob | blame | history
src/backend/utils/adt/timestamp.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /