Skip to content

Commit 9719da8

Browse files
committed
C++: Move a class that looks like it's intended to be public (and is used outside of the library) above the 'Implementation details' threshold.
1 parent d444778 commit 9719da8

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

cpp/ql/src/Microsoft/SAL.qll

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,22 @@ class SALMaybeNull extends SALAnnotation {
101101
}
102102
}
103103

104+
/**
105+
* A parameter annotated by one or more SAL annotations.
106+
*/
107+
class SALParameter extends Parameter {
108+
/** One of this parameter's annotations. */
109+
SALAnnotation a;
110+
111+
SALParameter() { annotatesAt(a, this.getADeclarationEntry(), _, _) }
112+
113+
predicate isIn() { a.getMacroName().toLowerCase().matches("%\\_in%") }
114+
115+
predicate isOut() { a.getMacroName().toLowerCase().matches("%\\_out%") }
116+
117+
predicate isInOut() { a.getMacroName().toLowerCase().matches("%\\_inout%") }
118+
}
119+
104120
///////////////////////////////////////////////////////////////////////////////
105121
// Implementation details
106122
/**
@@ -131,22 +147,6 @@ private predicate annotatesAtPosition(SALPosition pos, DeclarationEntry d, File
131147
)
132148
}
133149

134-
/**
135-
* A parameter annotated by one or more SAL annotations.
136-
*/
137-
class SALParameter extends Parameter {
138-
/** One of this parameter's annotations. */
139-
SALAnnotation a;
140-
141-
SALParameter() { annotatesAt(a, this.getADeclarationEntry(), _, _) }
142-
143-
predicate isIn() { a.getMacroName().toLowerCase().matches("%\\_in%") }
144-
145-
predicate isOut() { a.getMacroName().toLowerCase().matches("%\\_out%") }
146-
147-
predicate isInOut() { a.getMacroName().toLowerCase().matches("%\\_inout%") }
148-
}
149-
150150
/**
151151
* A SAL element, that is, a SAL annotation or a declaration entry
152152
* that may have SAL annotations.

0 commit comments

Comments
 (0)