Hi,
On 2022-02-12 21:16:05 -0500, Joseph Koshakow wrote:
> I've attached the patch below.
Any reason for using int return types?
> +/* As above, but initial val produces years */
> +static int
> +AdjustYears(int val, struct pg_tm *tm, int multiplier)
> +{
> + int years;
> + if (pg_mul_s32_overflow(val, multiplier, &years))
> + return 1;
> + if (pg_add_s32_overflow(tm->tm_year, years, &tm->tm_year))
> + return 1;
> + return 0;
> }
particularly since the pg_*_overflow stuff uses bool?
Greetings,
Andres Freund