Switch buffile.c/h to use pgoff_t

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Switch buffile.c/h to use pgoff_t
Дата
Msg-id aUStrqoOCDRFAq1M@paquier.xyz
обсуждение исходный текст
Ответы Re: Switch buffile.c/h to use pgoff_t
Список pgsql-hackers
Hi all,
(Added Bryan in CC as he has been looking at this stuff previously.)

An mentioned on this thread and as a part of the quest to remove more
of long in the tree, buffile.c and buffile.h still rely on an
unportable off_t, which is signed 4 bytes on Windows:
https://www.postgresql.org/message-id/0f238ff4-c442-42f5-adb8-01b762c94ca1@gmail.com

Please find attached a patch to do the switch.  I was surprised to see
that the amount of code to adapt was limited, the routines of
buffile.h changed in this commit being used in other places that keep
track of offsets.  Hence these other files just need to do a off_t =>
pgoff_t flip in a couple of structures to be updated, as far as I can
see.

This removes a couple of extra long casts, as well as one comment in
BufFileSeek() that relates to overflows for large offsets, that would
not exist with this switch, which is nice.

Thanks,
--
Michael

Вложения

В списке pgsql-hackers по дате отправления: