Skip to content

Commit ae14530

Browse files
committed
Orthography fixes for new castNode() macro.
Clean up hastily-composed comment. Normalize whitespace. Erik Rijkers and myself
1 parent 332068a commit ae14530

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/include/nodes/nodes.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -487,25 +487,25 @@ extern PGDLLIMPORT Node *newNodeMacroHolder;
487487
#define IsA(nodeptr,_type_) (nodeTag(nodeptr) == T_##_type_)
488488

489489
/*
490-
* castNode(type, ptr) casts ptr to type and, if cassert is enabled, verifies
491-
* that the the c actually has the appropriate type (using it's nodeTag()).
490+
* castNode(type, ptr) casts ptr to "type *", and if assertions are enabled,
491+
* verifies that the node has the appropriate type (using its nodeTag()).
492492
*
493493
* Use an inline function when assertions are enabled, to avoid multiple
494-
* evaluations of the ptr argument (which could e.g. be a function call). If
495-
* inline functions are not available - only a small number of platforms -
494+
* evaluations of the ptr argument (which could e.g. be a function call).
495+
* If inline functions are not available - only a small number of platforms -
496496
* don't Assert, but use the non-checking version.
497497
*/
498498
#if defined(USE_ASSERT_CHECKING) && defined(PG_USE_INLINE)
499-
static inline Node*
500-
castNodeImpl(enum NodeTag type, void *ptr)
499+
static inline Node *
500+
castNodeImpl(NodeTag type, void *ptr)
501501
{
502502
Assert(ptr == NULL || nodeTag(ptr) == type);
503-
return ptr;
503+
return (Node *) ptr;
504504
}
505505
#define castNode(_type_, nodeptr) ((_type_ *) castNodeImpl(T_##_type_, nodeptr))
506506
#else
507-
#define castNode(_type_,nodeptr) ((_type_ *)(nodeptr))
508-
#endif
507+
#define castNode(_type_, nodeptr) ((_type_ *) (nodeptr))
508+
#endif /* USE_ASSERT_CHECKING && PG_USE_INLINE */
509509

510510

511511
/* ----------------------------------------------------------------

0 commit comments

Comments
 (0)