Re: INT64_MIN and _MAX
От | Andrew Gierth |
---|---|
Тема | Re: INT64_MIN and _MAX |
Дата | |
Msg-id | 87619tc5wc.fsf@news-spur.riddles.org.uk обсуждение исходный текст |
Ответ на | Re: INT64_MIN and _MAX (Andres Freund <andres@anarazel.de>) |
Ответы |
Re: INT64_MIN and _MAX
|
Список | pgsql-hackers |
>>>>> "Andres" == Andres Freund <andres@anarazel.de> writes: >> Hm, it looks like the same could be said for INT32_MIN and _MAX; >> some places use INT_MIN etc., others say "we shouldn't assume int = >> int32" and use (-0x7fffffff - 1) or whatever instead. Andres> I have been annoyed by this multiple times. I think we should Andres> make sure the C99 defines are there (providing values if they Andres> aren't) and always use those. We've used them in parts of the Andres> tree long enough that it's unlikely to cause problems. Nothing Andres> is helped by using different things in other parts of the tree. Andres> Willing to cook up a patch? How's this one? This replaces the one I posted before; it does both INT64_MIN/MAX and INT32_MIN/MAX, and also int16/int8/uint*. Uses of 0x7fffffff in code have been replaced unless there was a reason not to, with either INT_MAX or INT32_MAX according to the type required. What I have _not_ done yet is audit uses of INT_MIN/MAX to see which ones should really be INT32_MIN/MAX. -- Andrew (irc:RhodiumToad)
Вложения
В списке pgsql-hackers по дате отправления: