Skip to content

Commit 3f1100b

Browse files
committed
Clarify format of multi-line function calls
https://bugzilla.tianocore.org/show_bug.cgi?id=425 Cc: Laszlo Ersek <[email protected]> Cc: Jordan Justen <[email protected]> Cc: Liming Gao <[email protected]> Cc: Kevin W Shaw <[email protected]> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael Kinney <[email protected]> Reviewed-by: Laszlo Ersek <[email protected]>
1 parent f19f17c commit 3f1100b

File tree

2 files changed

+60
-43
lines changed

2 files changed

+60
-43
lines changed

5_source_files/52_spacing.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,23 +130,39 @@ if (MyVar != 0) {
130130
If ((--MyInteger) > 0) {
131131
```
132132

133-
#### 5.2.2.4 Subsequent lines of multi-line function calls should line up one or two tabstops from the beginning of the function name
133+
#### 5.2.2.4 Subsequent lines of multi-line function calls should line up two spaces from the beginning of the function name
134134

135-
Use either one or two tab stops to ensure that each parameter is indented at
136-
least two spaces after the function name. Either of the below examples is
137-
acceptable:
135+
If a function call or function like macro invocation is broken up into multiple
136+
lines, then:
137+
138+
* One argument per line, including the first argument on its own line.
139+
* Indent each argument 2 spaces from the start of the function name. If a
140+
function is called through a structure or union member, of type
141+
pointer-to-function, then indent each argument 2 spaces from the start of the
142+
member name.
143+
* Align the close parenthesis with the start of the last argument
138144

139145
```c
146+
CopyMem (
147+
Destination,
148+
Source,
149+
SIZE_4KB
150+
);
151+
140152
Status = gBS->AllocatePool (
141153
EfiBootServicesData,
142154
sizeof (DRIVER_NAME_INSTANCE),
143155
&PrivateData
144156
);
145-
Status = gBS->AllocatePool (
146-
EfiBootServicesData,
147-
sizeof (DRIVER_NAME_INSTANCE),
148-
&PrivateData
149-
);
157+
158+
DEBUG ((
159+
DEBUG_INFO,
160+
"The addresses of the 4 buffers are %p, %p, %p, and %p\n",
161+
Buffer1,
162+
Buffer2,
163+
Buffer3,
164+
Buffer4
165+
));
150166
```
151167
152168
#### 5.2.2.5 Always put space after commas or semicolons that separate items

README.md

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -77,37 +77,38 @@ Copyright (c) 2006-2017, Intel Corporation. All rights reserved.
7777

7878
### Revision History
7979

80-
| Revision | Revision History | Date |
81-
| ---------- | ---------------------------------------------------------------------------------------------------- | ---------- |
82-
| 0.0.1 | First swag. | 6/23/00 |
83-
| 0.0.2 | Included feedback from team. | 8/3/00 |
84-
| 0.3 | Add comments. | 8/10/00 |
85-
| 0.3001 | Pre-vacation update, need to sync with new numbering process. | 9/11/00 |
86-
| 0.31 | Incorporated Sync 1 learnings. | 12/12/00 |
87-
| 0.32 | Completed TAT ARs. | 6/8/01 |
88-
| 0.33 | Added goto rules. | 8/16/01 |
89-
| 0.34 | Updated to match driver and Runtime Lib. | 11/15/01 |
90-
| 0.9 | Updated to Intel(R) Platform Innovation Framework for EFI. Added checklist appendix. | 1/8/04 |
91-
| 0.91 | Completed editing and formatting pass. | 3/3/04 |
92-
| 0.92 | Updated the structure declaration rules: Added section 4.8 and modified the checklist in Appendix A. | 4/8/04 |
93-
| 0.93 | Added some minor clarifications in section 3.1, 4.5, 7.1, and 10. | 9/14/04 |
94-
| 0.94 | Revised to accommodate Doxygen style commenting standards | 3/1/06 |
95-
| 0.50 | Change to new numbering scheme. Incorporate Review Comments. Editing and formatting. | 4/21/06 |
96-
| 0.51 | Changed to EDK II. | 7/13/06 |
97-
| 0.52 | Update rules to clarify areas of misinterpretation. Add copyright formatting rules. | 2/09/2010 |
98-
| 0.60 | Re-organize document and update to current rules. | 2/15/2010 |
99-
| 0.70 | Release for Review | 3/1/2010 |
100-
| 0.95 | Review comments incorporated, Release to Tech Pubs for Finalization | 3/10/2010 |
101-
| 1.00 | First full release | 3/15/2010 |
102-
| 1.01 | Restructure into book format. | 12/08/2011 |
103-
| 1.02 | Incorporate suggestions and trackers | 3/19/2012 |
104-
| | Release For Review | 4/2/2012 |
105-
| | Release | 4/16/2012 |
106-
| 1.03 | Update and incorporate requests and bug fixes. Remove "Intel Confidential" classification. | 9/11/2014 |
107-
| 1.50 | Release for Review | 9/26/2014 |
108-
| 1.80 | Incorporate US Review Comments | 10/10/2014 |
109-
| 1.85 | Incorporate PRC Review Comments | 10/24/2014 |
110-
| | Release for Extended US & PRC Review | 10/28/2014 |
111-
| 2.0 | Release | 11/14/2014 |
112-
| 2.1 | DRAFT for REFORMAT | 10/30/2015 |
113-
| 2.2 | Convert to Gitbook | April 2017 |
80+
| Revision | Revision History | Date |
81+
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
82+
| 0.0.1 | First swag. | 6/23/00 |
83+
| 0.0.2 | Included feedback from team. | 8/3/00 |
84+
| 0.3 | Add comments. | 8/10/00 |
85+
| 0.3001 | Pre-vacation update, need to sync with new numbering process. | 9/11/00 |
86+
| 0.31 | Incorporated Sync 1 learnings. | 12/12/00 |
87+
| 0.32 | Completed TAT ARs. | 6/8/01 |
88+
| 0.33 | Added goto rules. | 8/16/01 |
89+
| 0.34 | Updated to match driver and Runtime Lib. | 11/15/01 |
90+
| 0.9 | Updated to Intel(R) Platform Innovation Framework for EFI. Added checklist appendix. | 1/8/04 |
91+
| 0.91 | Completed editing and formatting pass. | 3/3/04 |
92+
| 0.92 | Updated the structure declaration rules: Added section 4.8 and modified the checklist in Appendix A. | 4/8/04 |
93+
| 0.93 | Added some minor clarifications in section 3.1, 4.5, 7.1, and 10. | 9/14/04 |
94+
| 0.94 | Revised to accommodate Doxygen style commenting standards | 3/1/06 |
95+
| 0.50 | Change to new numbering scheme. Incorporate Review Comments. Editing and formatting. | 4/21/06 |
96+
| 0.51 | Changed to EDK II. | 7/13/06 |
97+
| 0.52 | Update rules to clarify areas of misinterpretation. Add copyright formatting rules. | 2/09/2010 |
98+
| 0.60 | Re-organize document and update to current rules. | 2/15/2010 |
99+
| 0.70 | Release for Review | 3/1/2010 |
100+
| 0.95 | Review comments incorporated, Release to Tech Pubs for Finalization | 3/10/2010 |
101+
| 1.00 | First full release | 3/15/2010 |
102+
| 1.01 | Restructure into book format. | 12/08/2011 |
103+
| 1.02 | Incorporate suggestions and trackers | 3/19/2012 |
104+
| | Release For Review | 4/2/2012 |
105+
| | Release | 4/16/2012 |
106+
| 1.03 | Update and incorporate requests and bug fixes. Remove "Intel Confidential" classification. | 9/11/2014 |
107+
| 1.50 | Release for Review | 9/26/2014 |
108+
| 1.80 | Incorporate US Review Comments | 10/10/2014 |
109+
| 1.85 | Incorporate PRC Review Comments | 10/24/2014 |
110+
| | Release for Extended US & PRC Review | 10/28/2014 |
111+
| 2.0 | Release | 11/14/2014 |
112+
| 2.1 | DRAFT for REFORMAT | 10/30/2015 |
113+
| 2.2 | Convert to Gitbook | June 2017 |
114+
| | [#425](https://bugzilla.tianocore.org/show_bug.cgi?id=425) [CCS] clarify line breaking and indentation requirements for multi-line function calls | |

0 commit comments

Comments
 (0)