Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3ebf2b4

Browse files
committed
Remove extraneous semicolon from uses of relptr_declare().
If we're going to write a semicolon after calls of relptr_declare(),then we don't need one inside the macro, and removing it suppresses"empty declaration" warnings from pickier compilers (eg pademelon).While at it, we might as well use relptr() inside relptr_declare(),because otherwise that macro would likely go unused altogether.Also improve the comment, which I for one found unclear,and provide a specific example of intended usage.
1 parent44a977f commit3ebf2b4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

‎src/include/utils/relptr.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/*
1818
* Relative pointers are intended to be used when storing an address that may
19-
* be relative either to the base of theprocesses address space or some
19+
* be relative either to the base of theprocess's address space or some
2020
* dynamic shared memory segment mapped therein.
2121
*
2222
* The idea here is that you declare a relative pointer as relptr(type)
@@ -29,11 +29,14 @@
2929
#definerelptr(type) union { type *relptr_type; Size relptr_off; }
3030

3131
/*
32-
* pgindent gets confused by declarations of the type relptr(type), so it's
33-
* useful to give them a name that doesn't include parentheses.
32+
* pgindent gets confused by declarations that use "relptr(type)" directly,
33+
* so preferred style is to write
34+
*typedef struct ... SomeStruct;
35+
*relptr_declare(SomeStruct, RelptrSomeStruct);
36+
* and then declare pointer variables as "RelptrSomeStruct someptr".
3437
*/
35-
#definerelptr_declare(type,name) \
36-
typedefunion {type *relptr_type; Size relptr_off; } name;
38+
#definerelptr_declare(type,relptrtype) \
39+
typedefrelptr(type) relptrtype
3740

3841
#ifdefHAVE__BUILTIN_TYPES_COMPATIBLE_P
3942
#definerelptr_access(base,rp) \

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp