Skip to content

Commit 9100ab9

Browse files
committed
CPP: Autoformat.
1 parent accb824 commit 9100ab9

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

cpp/ql/src/semmle/code/cpp/commons/Printf.qll

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,10 @@ class FormattingFunctionCall extends Expr {
170170
* format string.
171171
*/
172172
int getNumFormatArgument() {
173-
result = count(this.getFormatArgument(_)) and
174-
175-
// format arguments must be known
176-
exists(getTarget().(FormattingFunction).getFirstFormatArgumentIndex())
177-
}
173+
result = count(this.getFormatArgument(_)) and
174+
// format arguments must be known
175+
exists(getTarget().(FormattingFunction).getFirstFormatArgumentIndex())
176+
}
178177
}
179178

180179
/**

cpp/ql/src/semmle/code/cpp/models/interfaces/FormattingFunction.qll

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,14 @@ abstract class FormattingFunction extends Function {
116116
* the first format specifier in the format string.
117117
*/
118118
int getFirstFormatArgumentIndex() {
119-
result = getNumberOfParameters()
120-
and
119+
result = getNumberOfParameters() and
121120
// the formatting function either has a definition in the snapshot, or all
122121
// `DeclarationEntry`s agree on the number of parameters (otherwise we don't
123122
// really know the correct number)
124123
(
125-
hasDefinition() or
126-
forall(FunctionDeclarationEntry fde |
127-
fde = getADeclarationEntry() |
124+
hasDefinition()
125+
or
126+
forall(FunctionDeclarationEntry fde | fde = getADeclarationEntry() |
128127
result = fde.getNumberOfParameters()
129128
)
130129
)

0 commit comments

Comments
 (0)