pgsql-server/src/backend/nodes copyfuncs.c equ ...

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql-server/src/backend/nodes copyfuncs.c equ ...
Date: 2002-11-25 03:33:27
Message-ID: 20021125033327.658FC475AD7@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

CVSROOT: /cvsroot
Module name: pgsql-server
Changes by: tgl(at)postgresql(dot)org 02/11/24 22:33:27

Modified files:
src/backend/nodes: copyfuncs.c equalfuncs.c

Log message:
Restructure the code in copyfuncs and equalfuncs to put much heavier
reliance on macros, in hopes of eliminating silly typos (like copying
to the wrong field) and just generally making it easier to see the forest
instead of the trees. As an example, here is the new code for A_Indices:

static A_Indices *
_copyAIndices(A_Indices *from)
{
A_Indices *newnode = makeNode(A_Indices);

COPY_NODE_FIELD(lidx);
COPY_NODE_FIELD(uidx);

return newnode;
}

static bool
_equalAIndices(A_Indices *a, A_Indices *b)
{
COMPARE_NODE_FIELD(lidx);
COMPARE_NODE_FIELD(uidx);

return true;
}

I plan to redo outfuncs/readfuncs in a similar style, but am committing
what I've got.

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2002-11-25 03:36:51 pgsql-server/src backend/commands/trigger.c ba ...
Previous Message D'Arcy Cain 2002-11-25 03:11:16 pgsql-server/src/interfaces/python pgdb.py