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

Skip to content
Commit d02f038
Browse files
committed
Orthography fixes for new castNode() macro.
Clean up hastily-composed comment. Normalize whitespace. Erik Rijkers and myself
1 parent 357e061 commit d02f038

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

496496
/*
497-
* castNode(type, ptr) casts ptr to type and, if cassert is enabled, verifies
498-
* that the the c actually has the appropriate type (using it's nodeTag()).
497+
* castNode(type, ptr) casts ptr to "type *", and if assertions are enabled,
498+
* verifies that the node has the appropriate type (using its nodeTag()).
499499
*
500500
* Use an inline function when assertions are enabled, to avoid multiple
501-
* evaluations of the ptr argument (which could e.g. be a function call). If
502-
* inline functions are not available - only a small number of platforms -
501+
* evaluations of the ptr argument (which could e.g. be a function call).
502+
* If inline functions are not available - only a small number of platforms -
503503
* don't Assert, but use the non-checking version.
504504
*/
505505
#if defined(USE_ASSERT_CHECKING) && defined(PG_USE_INLINE)
506-
static inline Node*
507-
castNodeImpl(enum NodeTag type, void *ptr)
506+
static inline Node *
507+
castNodeImpl(NodeTag type, void *ptr)
508508
{
509509
Assert(ptr == NULL || nodeTag(ptr) == type);
510-
return ptr;
510+
return (Node *) ptr;
511511
}
512512
#define castNode(_type_, nodeptr) ((_type_ *) castNodeImpl(T_##_type_, nodeptr))
513513
#else
514-
#define castNode(_type_,nodeptr) ((_type_ *)(nodeptr))
515-
#endif
514+
#define castNode(_type_, nodeptr) ((_type_ *) (nodeptr))
515+
#endif /* USE_ASSERT_CHECKING && PG_USE_INLINE */
516516

517517

518518
/* ----------------------------------------------------------------

0 commit comments

Comments
 (0)
0