Thread: pgsql: XLogReader general code cleanup

pgsql: XLogReader general code cleanup

From
Alvaro Herrera
Date:
XLogReader general code cleanup

Some minor tweaks and comment additions, for cleanliness sake and to
avoid having the upcoming timeline-following patch be polluted with
unrelated cleanup.

Extracted from a larger patch by Craig Ringer, reviewed by Andres
Freund, with some additions by myself.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3b02ea4f0780ccce7dc116010201dad7ee50a401

Modified Files
--------------
src/backend/access/transam/xlogreader.c        | 54 ++++++++++++++++++--------
src/backend/access/transam/xlogutils.c         | 21 +++++++---
src/backend/replication/logical/logicalfuncs.c | 18 ++++++++-
src/include/access/xlogreader.h                | 17 ++++++--
src/include/access/xlogutils.h                 |  6 ++-
5 files changed, 86 insertions(+), 30 deletions(-)


Re: pgsql: XLogReader general code cleanup

From
Peter Eisentraut
Date:
On 03/30/2016 05:57 PM, Alvaro Herrera wrote:
> XLogReader general code cleanup

This is causing compiler warnings on 32-bit environments(?):

xlogreader.c: In function ‘XLogReadRecord’:
xlogreader.c:334:7: error: format ‘%lu’ expects argument of type ‘long
unsigned int’, but argument 5 has type ‘unsigned int’ [-Werror=format=]
        "invalid record length at %X/%X: wanted %lu, got %u",
        ^
xlogreader.c: In function ‘ValidXLogRecordHeader’:
xlogreader.c:633:7: error: format ‘%lu’ expects argument of type ‘long
unsigned int’, but argument 5 has type ‘unsigned int’ [-Werror=format=]
        "invalid record length at %X/%X: wanted %lu, got %u",
        ^



Re: pgsql: XLogReader general code cleanup

From
Alvaro Herrera
Date:
Peter Eisentraut wrote:
> On 03/30/2016 05:57 PM, Alvaro Herrera wrote:
> >XLogReader general code cleanup
>
> This is causing compiler warnings on 32-bit environments(?):

Will fix.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: pgsql: XLogReader general code cleanup

From
Alvaro Herrera
Date:
Alvaro Herrera wrote:
> Peter Eisentraut wrote:
> > On 03/30/2016 05:57 PM, Alvaro Herrera wrote:
> > >XLogReader general code cleanup
> >
> > This is causing compiler warnings on 32-bit environments(?):
>
> Will fix.

Fix pushed.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services