Skip to content

Commit

Permalink
Add comment to coccinelle rule
Browse files Browse the repository at this point in the history
  • Loading branch information
mkindahl committed Dec 11, 2023
1 parent 02aa733 commit 0e05ac6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions coccinelle/namestr.cocci
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ typedef Name;
NameData E;
@@
- E.data
+ /* Use NameStr rather than accessing data member directly */
+ NameStr(E)

@@
NameData *E;
@@
- E->data
+ /* Use NameStr rather than accessing data member directly */
+ NameStr(*E)

@@
Name E;
@@
- E->data
+ /* Use NameStr rather than accessing data member directly */
+ NameStr(*E)


3 changes: 2 additions & 1 deletion tsl/src/deparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ column_is_serial(Relation rel, Name column)
NameStr(rel->rd_rel->relname));
InitFunctionCallInfoData(*fcinfo, NULL, 2, InvalidOid, NULL, NULL);
FC_ARG(fcinfo, 0) = CStringGetTextDatum(relation_name);
FC_ARG(fcinfo, 1) = CStringGetTextDatum(NameStr(*column));
FC_ARG(fcinfo, 1) = CStringGetTextDatum(/* Use NameStr rather than accessing data member directly */
NameStr(*column));
FC_NULL(fcinfo, 0) = false;
FC_NULL(fcinfo, 1) = false;
pg_get_serial_sequence(fcinfo);
Expand Down

0 comments on commit 0e05ac6

Please sign in to comment.