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

Commit3612019

Browse files
committed
doc: Document function pointer source code style
as implemented in1356f78
1 parent821fb8c commit3612019

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

‎doc/src/sgml/sources.sgml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,5 +964,23 @@ handle_sighup(SIGNAL_ARGS)
964964
</para>
965965
</simplesect>
966966

967+
<simplesect>
968+
<title>Calling Function Pointers</title>
969+
970+
<para>
971+
For clarity, it is preferred to explicitly dereference a function pointer
972+
when calling the pointed-to function if the pointer is a simple variable,
973+
for example:
974+
<programlisting>
975+
(*emit_log_hook) (edata);
976+
</programlisting>
977+
(even though <literal>emit_log_hook(edata)</literal> would also work).
978+
When the function pointer is part of a structure, then the extra
979+
punctuation can and usually should be omitted, for example:
980+
<programlisting>
981+
paramInfo->paramFetch(paramInfo, paramId);
982+
</programlisting>
983+
</para>
984+
</simplesect>
967985
</sect1>
968986
</chapter>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp