Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 969d766

Browse files
committed
C++: Tidy up long comments that attach to items
1 parent 4769d00 commit 969d766

5 files changed

Lines changed: 27 additions & 24 deletions

File tree

cpp/ql/src/semmle/code/cpp/controlflow/Dominance.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import cpp
1111

1212

13-
/*
13+
/**
1414
* In rare cases, the same node is used in multiple control-flow scopes. This
1515
* confuses the dominance analysis, so this predicate is used to exclude them.
1616
*/

cpp/ql/src/semmle/code/cpp/padding/SanityCheck.ql

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,28 @@ import Padding
99

1010
/*
1111
* Sanity-check: Find discrepancies between computed and actual size on LP64.
12-
*
13-
from Type t, LP64 a, int padded, int bit, int real, MemberVariable v
14-
where padded = a.paddedSize(t) and bit = a.bitSize(t)
15-
and real = t.getSize() * 8 and padded != real and count(t.getSize()) = 1
16-
select t, a.paddedSize(t) as Padded, real, v, t.(PaddedType).memberSize(v, a)
17-
/** /
12+
*/
13+
14+
/*
15+
* from Type t, LP64 a, int padded, int bit, int real, MemberVariable v
16+
* where padded = a.paddedSize(t) and bit = a.bitSize(t)
17+
* and real = t.getSize() * 8 and padded != real and count(t.getSize()) = 1
18+
* select t, a.paddedSize(t) as Padded, real, v, t.(PaddedType).memberSize(v, a)
19+
*/
20+
21+
/*
22+
* from PaddedType t, LP64 a, MemberVariable v
23+
* where t instanceof Union and v = t.getAMember() and not exists(t.memberSize(v, a))
24+
* select t, v, v.getType().explain()
25+
*/
26+
27+
/*
28+
* from PaddedType t, LP64 a, MemberVariable v
29+
* where not exists(a.paddedSize(t))
30+
* select t, t.fieldIndex(v) as i, v, t.memberSize(v, a) order by t, i
31+
*/
1832

19-
from PaddedType t, LP64 a, MemberVariable v
20-
where t instanceof Union and v = t.getAMember() and not exists(t.memberSize(v, a))
21-
select t, v, v.getType().explain()
22-
/**
23-
from PaddedType t, LP64 a, MemberVariable v
24-
where not exists(a.paddedSize(t))
25-
select t, t.fieldIndex(v) as i, v, t.memberSize(v, a) order by t, i
26-
/**/
2733
from PaddedType t, LP64 a
2834
where a.wastedSpace(t) != 0
2935
select t, a.paddedSize(t) as size, a.wastedSpace(t) as waste order by waste desc
30-
/**/
3136

cpp/ql/src/semmle/code/cpp/pointsto/PointsTo.qll

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ predicate flowFromCompound(Element parent, string label, Element dest)
375375
//
376376
}
377377

378-
/*
378+
/**
379379
* The values stored in src point to the compounds (destParent, destLabel).
380380
*/
381381
predicate pointerToCompound(Element destParent, string destLabel, Element src)
@@ -624,7 +624,7 @@ predicate setlocations(int set, @element location)
624624

625625
class PointsToExpr extends Expr
626626
{
627-
/*
627+
/**
628628
* This predicate is empty by default. It should be overridden and defined to
629629
* include just those expressions for which points-to information is desired.
630630
*/
@@ -645,10 +645,8 @@ class PointsToExpr extends Expr
645645
float confidence() { result = 1.0 / count(this.pointsTo()) }
646646
}
647647

648-
/*
649-
* This is used above in a `pragma[noopt]` context, which prevents its
650-
* customary inlining. We materialise it explicitly here.
651-
*/
648+
// This is used above in a `pragma[noopt]` context, which prevents its
649+
// customary inlining. We materialise it explicitly here.
652650
private @element localUnresolveElement(Element e) {
653651
result = unresolveElement(e)
654652
}

cpp/ql/src/semmle/code/cpp/valuenumbering/GlobalValueNumbering.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ private predicate mk_PointerFieldAccess(
356356
qualifier = globalValueNumber(access.getQualifier().getFullyConverted())
357357
}
358358

359-
/*
359+
/**
360360
* `obj->field` is equivalent to `(*obj).field`, so we need to wrap an
361361
* extra `GVN_Deref` around the qualifier.
362362
*/

cpp/ql/src/semmle/code/cpp/valuenumbering/HashCons.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ private predicate mk_ArgConsInner(HashCons head, HC_Args tail, int i, HC_Args li
579579
mk_ArgCons(head, i, tail, c)
580580
}
581581

582-
/*
582+
/**
583583
* The 0th argument of an allocator call in a new expression is always an error expression;
584584
* this works around it
585585
*/

0 commit comments

Comments
 (0)