8000 Orthography fixes for new castNode() macro. · hackingwu/postgres@3f6e085 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3f6e085

Browse files
committed
Orthography fixes for new castNode() macro.
Clean up hastily-composed comment. Normalize whitespace. Erik Rijkers and myself
1 parent 15c54e8 commit 3f6e085

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
@@ -481,25 +481,25 @@ extern PGDLLIMPORT Node *newNodeMacroHolder;
481481
#define IsA(nodeptr,_type_) (nodeTag(nodeptr) == T_##_type_)
482482

483483
/*
484-
* castNode(type, ptr) casts ptr to type and, if cassert is enabled, verifies
485-
* that the the c actually has the appropriate type (using it's nodeTag()).
484+
* castNode(type, ptr) casts ptr to "type *", and if assertions are enabled,
485+
* verifies that the node has the appropriate type (using its nodeTag()).
486486
*
487487
* Use an inline function when assertions are enabled, to avoid multiple
488-
* evaluations of the ptr argument (which could e.g. be a function call). If
489-
* inline functions are not available - only a small number of platforms -
488+
* evaluations of the ptr argument (which could e.g. be a function call).
489+
* If inline functions are not available - only a small number of platforms -
490490
* don't Assert, but use the non-checking version.
491491
*/
492492
#if defined(USE_ASSERT_CHECKING) && defined(PG_USE_INLINE)
493-
static inline Node*
494-
castNodeImpl(enum NodeTag type, void *ptr)
493+
static inline Node *
494+
castNodeImpl(NodeTag type, void *ptr)
495495
{
496496
Assert(ptr == NULL || nodeTag(ptr) == type);
497-
return ptr;
497+
return (Node *) ptr;
498498
}
499499
#define castNode(_type_, nodeptr) ((_type_ *) castNodeImpl(T_##_type_, nodeptr))
500500
#else
501-
#define castNode(_type_,nodeptr) ((_type_ *)(nodeptr))
502-
#endif
501+
#define castNode(_type_, nodeptr) ((_type_ *) (nodeptr))
502+
#endif /* USE_ASSERT_CHECKING && PG_USE_INLINE */
503503

504504

505505
/* ----------------------------------------------------------------

0 commit comments

Comments
 (0)
0