Skip to content

Commit 6148518

Browse files
Format qll, update package metadata
1 parent 076b1c4 commit 6148518

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

c/common/src/codingstandards/c/TgMath.qll

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import cpp
32

43
private string getATgMathMacroName(boolean allowComplex) {
@@ -35,21 +34,17 @@ class TgMathInvocation extends MacroInvocation {
3534
}
3635

3736
Expr getOperandArgument(int i) {
38-
result = call.getArgument(i)
39-
and not hasOutputArgument(call.getTarget().getName(), i)
37+
result = call.getArgument(i) and
38+
not hasOutputArgument(call.getTarget().getName(), i)
4039
}
4140

4241
int getNumberOfOperandArguments() {
4342
result = call.getNumberOfArguments() - count(int i | hasOutputArgument(getMacroName(), i))
4443
}
4544

46-
Expr getAnOperandArgument() {
47-
result = getOperandArgument(_)
48-
}
45+
Expr getAnOperandArgument() { result = getOperandArgument(_) }
4946

50-
predicate allowsComplex() {
51-
allowComplex = true
52-
}
47+
predicate allowsComplex() { allowComplex = true }
5348
}
5449

5550
private Call getACallInExpansion(MacroInvocation mi) { result = mi.getAnExpandedElement() }
@@ -65,4 +60,4 @@ private Call getBestCallInExpansion(MacroInvocation mi) {
6560
or
6661
count(getNameMatchedCallInExpansion(mi)) > 1 and
6762
result = rank[1](Call c | c = getACallInExpansion(mi) | c order by c.getTarget().getName())
68-
}
63+
}

c/misra/src/rules/RULE-21-22/TgMathArgumentWithInvalidEssentialType.ql

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* @id c/misra/tg-math-argument-with-invalid-essential-type
3-
* @name RULE-21-22: All operand arguments to any type-generic macros in <tgmath.h> shall have an appropriate essential
3+
* @name RULE-21-22: All operand arguments to type-generic macros in <tgmath.h> shall have an appropriate essential type
44
* @description All operand arguments to any type-generic macros in <tgmath.h> shall have an
5-
* appropriate essential type
5+
* appropriate essential type.
66
* @kind problem
77
* @precision high
88
* @problem.severity error

c/misra/src/rules/RULE-21-23/TgMathArgumentsWithDifferingStandardType.ql

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* @id c/misra/tg-math-arguments-with-differing-standard-type
3-
* @name RULE-21-23: All operand arguments to any multi-argument type-generic macros in <tgmath.h> shall have the same
3+
* @name RULE-21-23: Operand arguments for an invocation of a type-generic macro shall have the same standard type
44
* @description All operand arguments to any multi-argument type-generic macros in <tgmath.h> shall
5-
* have the same standard type
5+
* have the same standard type.
66
* @kind problem
77
* @precision high
88
* @problem.severity error

rule_packages/c/EssentialTypes2.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
},
77
"queries": [
88
{
9-
"description": "All operand arguments to any type-generic macros in <tgmath.h> shall have an appropriate essential type",
9+
"description": "All operand arguments to any type-generic macros in <tgmath.h> shall have an appropriate essential type.",
1010
"kind": "problem",
11-
"name": "All operand arguments to any type-generic macros in <tgmath.h> shall have an appropriate essential",
11+
"name": "All operand arguments to type-generic macros in <tgmath.h> shall have an appropriate essential type",
1212
"precision": "high",
1313
"severity": "error",
1414
"short_name": "TgMathArgumentWithInvalidEssentialType",
@@ -29,9 +29,9 @@
2929
},
3030
"queries": [
3131
{
32-
"description": "All operand arguments to any multi-argument type-generic macros in <tgmath.h> shall have the same standard type",
32+
"description": "All operand arguments to any multi-argument type-generic macros in <tgmath.h> shall have the same standard type.",
3333
"kind": "problem",
34-
"name": "All operand arguments to any multi-argument type-generic macros in <tgmath.h> shall have the same",
34+
"name": "Operand arguments for an invocation of a type-generic macro shall have the same standard type",
3535
"precision": "high",
3636
"severity": "error",
3737
"short_name": "TgMathArgumentsWithDifferingStandardType",

0 commit comments

Comments
 (0)