mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
C++: Fix mixed tabs and spaces in non-test code
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
import cpp
|
||||
|
||||
string exprString(Expr e) {
|
||||
if (e instanceof ArrayToPointerConversion) then (
|
||||
result = e.(ArrayToPointerConversion).getExpr().(Literal).getValue()
|
||||
) else (
|
||||
result = e.toString()
|
||||
)
|
||||
if (e instanceof ArrayToPointerConversion) then (
|
||||
result = e.(ArrayToPointerConversion).getExpr().(Literal).getValue()
|
||||
) else (
|
||||
result = e.toString()
|
||||
)
|
||||
}
|
||||
|
||||
from Cast c, Type cType, string cTypeName, string toStruct
|
||||
|
||||
@@ -5,31 +5,31 @@
|
||||
import cpp
|
||||
|
||||
predicate nameCheck(Declaration d) {
|
||||
count(d.toString()) = 1 and
|
||||
count(string s | d.hasName(s)) = 1 and
|
||||
d.hasName(d.toString())
|
||||
count(d.toString()) = 1 and
|
||||
count(string s | d.hasName(s)) = 1 and
|
||||
d.hasName(d.toString())
|
||||
}
|
||||
|
||||
string accessType(Field f) {
|
||||
(f.isPublic() and result = "public") or
|
||||
(f.isProtected() and result = "protected") or
|
||||
(f.isPrivate() and result = "private")
|
||||
(f.isPublic() and result = "public") or
|
||||
(f.isProtected() and result = "protected") or
|
||||
(f.isPrivate() and result = "private")
|
||||
}
|
||||
|
||||
string fieldType(Field f) {
|
||||
result = f.getType().getAQlClass() and
|
||||
(
|
||||
result.matches("%Type") or
|
||||
result = "Enum"
|
||||
)
|
||||
result = f.getType().getAQlClass() and
|
||||
(
|
||||
result.matches("%Type") or
|
||||
result = "Enum"
|
||||
)
|
||||
}
|
||||
|
||||
string pointedType(Field f) {
|
||||
if f.getType() instanceof PointerType then (
|
||||
result = f.getType().(PointerType).getBaseType().toString()
|
||||
) else (
|
||||
result = ""
|
||||
)
|
||||
if f.getType() instanceof PointerType then (
|
||||
result = f.getType().(PointerType).getBaseType().toString()
|
||||
) else (
|
||||
result = ""
|
||||
)
|
||||
}
|
||||
|
||||
from Class c, Field f
|
||||
|
||||
Reference in New Issue
Block a user