Skip to content

Commit 3259d17

Browse files
Fix query formatting
1 parent 14b7c61 commit 3259d17

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

c/misra/src/rules/DIR-5-2/NotNoDeadlocksBetweenThreads.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import cpp
1717
import codingstandards.c.misra
1818
import codingstandards.cpp.rules.preventdeadlockbylockinginpredefinedorder.PreventDeadlockByLockingInPredefinedOrder
1919

20-
class NotNoDeadlocksBetweenThreadsQuery extends PreventDeadlockByLockingInPredefinedOrderSharedQuery {
20+
class NotNoDeadlocksBetweenThreadsQuery extends PreventDeadlockByLockingInPredefinedOrderSharedQuery
21+
{
2122
NotNoDeadlocksBetweenThreadsQuery() {
2223
this = Concurrency6Package::notNoDeadlocksBetweenThreadsQuery()
2324
}

c/misra/src/rules/DIR-5-3/ThreadCreatedByThread.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ where
4242
enclosingFunction = tc.getEnclosingFunction() and
4343
threadRoot = enclosingFunction.getThreadRoot()
4444
select tc, "Thread creation call reachable from threaded function '$@'.", threadRoot,
45-
threadRoot.toString()
45+
threadRoot.toString()

c/misra/src/rules/RULE-21-25/InvalidMemoryOrderArgument.ql

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,13 @@ class MemoryOrderConstantExpr extends Expr {
4040
MemoryOrder ord;
4141

4242
MemoryOrderConstantExpr() {
43-
if
44-
this instanceof MemoryOrderConstantAccess
45-
then
46-
ord = this.(MemoryOrderConstantAccess).getTarget()
47-
else
48-
ord.getIntValue() = getValue().toInt()
43+
if this instanceof MemoryOrderConstantAccess
44+
then ord = this.(MemoryOrderConstantAccess).getTarget()
45+
else ord.getIntValue() = getValue().toInt()
4946
}
5047

5148
/* Get the name of the `MemoryOrder` this expression is valued as. */
52-
string getMemoryOrderString() {
53-
result = ord.toString()
54-
}
49+
string getMemoryOrderString() { result = ord.toString() }
5550
}
5651

5752
/**
@@ -75,7 +70,8 @@ class MemoryOrderedStdAtomicFunction extends Function {
7570
baseParamIdx = 1 and
7671
baseParams = 2
7772
or
78-
getName().regexpMatch(prefix + ["atomic_store", "atomic_fetch_.*", "atomic_exchange"] + suffix) and
73+
getName()
74+
.regexpMatch(prefix + ["atomic_store", "atomic_fetch_.*", "atomic_exchange"] + suffix) and
7975
baseParamIdx = 2 and
8076
baseParams = 3
8177
or

0 commit comments

Comments
 (0)