This commit is contained in:
practicalswift 2019-01-06 17:15:57 +01:00 committed by Daniel Marjamäki
parent 5636497c0b
commit 0a1b3a9d6f
13 changed files with 65 additions and 65 deletions

View File

@ -524,7 +524,7 @@ def generateTable():
def remove_file_prefix(file_path, prefix):
"""
Remove a file path prefix from a give path. leftover
directory seperators at the beginning of a file
directory separators at the beginning of a file
after the removal are also stripped.
Example:
@ -537,7 +537,7 @@ def remove_file_prefix(file_path, prefix):
result = None
if file_path.startswith(prefix):
result = file_path[len(prefix):]
# Remove any leftover directory seperators at the
# Remove any leftover directory separators at the
# beginning
result = result.lstrip('\\/')
else:
@ -565,7 +565,7 @@ class MisraChecker:
# Dictionary of dictionaries for rules to suppress
# Dict1 is keyed by rule number in the hundreds format of
# Major * 100 + minor. ie Rule 5.2 = (5*100) + 2
# Dict 2 is keyed by filename. An entry of None means suppress globaly.
# Dict 2 is keyed by filename. An entry of None means suppress globally.
# Each file name entry contails a list of tuples of (lineNumber, symbolName)
# or an item of None which indicates suppress rule for the entire file.
# The line and symbol name tuple may have None as either of its elements but
@ -1882,7 +1882,7 @@ class MisraChecker:
def setFilePrefix(self, prefix):
"""
Set the file prefix to ignnore from files when matching
supression files
suppression files
"""
self.filePrefix = prefix
@ -2179,7 +2179,7 @@ else:
print('Not expected: ' + actual)
exitCode = 1
# Exisitng behavior of verify mode is to exit
# Existing behavior of verify mode is to exit
# on the first un-expected output.
# TODO: Is this required? or can it be moved to after
# all input files have been processed

View File

@ -19,7 +19,7 @@
# "uint32_t": "ui32"}
# }
#
# RE_VARNAME, RE_PRIVATE_MEMBER_VARIABE and RE_FUNCTIONNAME are regular expressions to cover hte basic names
# RE_VARNAME, RE_PRIVATE_MEMBER_VARIABE and RE_FUNCTIONNAME are regular expressions to cover the basic names
# In var_prefixes and function_prefixes there are the variable-type/prefix pairs
import cppcheckdata

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<def format="2">
<!-- Reference to zlib documention https://www.zlib.net/manual.html -->
<!-- Reference to zlib documentation https://www.zlib.net/manual.html -->
<!-- Data structures and types -->
<podtype name="alloc_func"/>
<podtype name="Byte" sign="u" size="1"/>

View File

@ -23,7 +23,7 @@ option(ANALYZE_DATAFLOW "Clang dynamic analyzer: general dynamic dataflow an
option(WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF)
option(WARNINGS_ANSI_ISO "Issue all the mandatory diagnostics Listed in C standard" ON)
set(USE_MATCHCOMPILER "Auto" CACHE STRING "Usage of match compliler")
set(USE_MATCHCOMPILER "Auto" CACHE STRING "Usage of match compiler")
set_property(CACHE USE_MATCHCOMPILER PROPERTY STRINGS Auto Off On Verify)
if (USE_MATCHCOMPILER STREQUAL "Auto")
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")

View File

@ -840,7 +840,7 @@ USE_HTAGS = NO
VERBATIM_HEADERS = YES
# If CLANG_ASSISTED_PARSING is set to YES, then doxygen will use the clang parser
# for more acurate parsing at the cost of reduced performance. This can be
# for more accurate parsing at the cost of reduced performance. This can be
# particularly helpful with template rich C++ code for which doxygen's built-in
# parser lacks the necessary type information.
@ -929,7 +929,7 @@ HTML_STYLESHEET =
# user-defined cascading style sheet that is included after the standard
# style sheets created by doxygen. Using this option one can overrule
# certain style aspects. This is preferred over using HTML_STYLESHEET
# since it does not replace the standard style sheet and is therefor more
# since it does not replace the standard style sheet and is therefore more
# robust against future updates. Doxygen will copy the style sheet file to
# the output directory.

View File

@ -1971,7 +1971,7 @@ static bool valueFlowForward(Token * const startToken,
Token *lambdaEndToken = const_cast<Token *>(findLambdaEndToken(tok2));
if (isVariableChanged(lambdaEndToken->link(), lambdaEndToken, varid, var->isGlobal(), settings, tokenlist->isCPP()))
return false;
// Dont skip lambdas for lifetime values
// Don't skip lambdas for lifetime values
if (!std::all_of(values.begin(), values.end(), std::mem_fn(&ValueFlow::Value::isLifetimeValue))) {
tok2 = lambdaEndToken;
continue;
@ -2682,7 +2682,7 @@ struct LifetimeStore {
value.tokvalue = var->nameToken();
value.errorPath = errorPath;
value.lifetimeKind = type;
// Dont add the value a second time
// Don't add the value a second time
if (std::find(tok->values().begin(), tok->values().end(), value) != tok->values().end())
return;
setTokenValue(tok, value, tokenlist->getSettings());
@ -2714,7 +2714,7 @@ struct LifetimeStore {
value.tokvalue = var->nameToken();
value.errorPath = errorPath;
value.lifetimeKind = type;
// Dont add the value a second time
// Don't add the value a second time
if (std::find(tok->values().begin(), tok->values().end(), value) != tok->values().end())
continue;
setTokenValue(tok, value, tokenlist->getSettings());
@ -4190,7 +4190,7 @@ static void valueFlowSubFunction(TokenList *tokenlist, const Settings *settings)
// passing value(s) to function
std::list<ValueFlow::Value> argvalues(getFunctionArgumentValues(argtok));
// Dont forward lifetime values
// Don't forward lifetime values
argvalues.remove_if(std::mem_fn(&ValueFlow::Value::isLifetimeValue));
if (argvalues.empty())

View File

@ -1571,14 +1571,14 @@ private:
"}\n");
ASSERT_EQUALS("", errout.str());
// Dont decay std::array
// Don't decay std::array
check("std::array<char, 1> f() {\n"
" std::array<char, 1> x;\n"
" return x;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
// Make sure we dont hang
// Make sure we don't hang
check("struct A;\n"
"void f() {\n"
" using T = A[3];\n"
@ -1586,7 +1586,7 @@ private:
"}\n");
ASSERT_EQUALS("", errout.str());
// Make sure we dont hang
// Make sure we don't hang
check("struct A;\n"
"void f() {\n"
" using T = A[3];\n"
@ -1594,7 +1594,7 @@ private:
"}\n");
ASSERT_EQUALS("", errout.str());
// Make sure we dont hang
// Make sure we don't hang
check("struct A;\n"
"void f() {\n"
" using T = A[3];\n"
@ -1602,7 +1602,7 @@ private:
"}\n");
ASSERT_EQUALS("", errout.str());
// Make sure we dont hang
// Make sure we don't hang
check("struct A;\n"
"void f() {\n"
" using T = A[3];\n"

View File

@ -2158,7 +2158,7 @@ private:
" X(do);\n"
" if (x > 100) {}\n"
"}");
// TODO: we should probably throw unknownMacro InternalError. Complain that the macro X must be defined. We cant check the code well without the definition.
// TODO: we should probably throw unknownMacro InternalError. Complain that the macro X must be defined. We can't check the code well without the definition.
TODO_ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:4]: (style) Condition 'x>100' is always false\n", "", errout.str());
check("void f(const int *i) {\n"

View File

@ -3484,12 +3484,12 @@ private:
}
void templateConstructor() { // ticket #7942
check("template <class T> struct Containter {\n"
" Containter();\n"
check("template <class T> struct Container {\n"
" Container();\n"
" T* mElements;\n"
"};\n"
"template <class T> Containter<T>::Containter() : mElements(nullptr) {}\n"
"Containter<int> intContainer;");
"template <class T> Container<T>::Container() : mElements(nullptr) {}\n"
"Container<int> intContainer;");
ASSERT_EQUALS("", errout.str());
}

View File

@ -824,7 +824,7 @@ private:
void garbageCode98() { // #6838
ASSERT_THROW(checkCode("for (cocon To::ta@Taaaaaforconst oken aaaaaaaaaaaa5Dl()\n"
"const unsiged in;\n"
"const unsigned in;\n"
"fon *tok = f);.s(Token i = d-)L;"), InternalError);
}

View File

@ -1313,34 +1313,34 @@ private:
}
void template67() { // ticket #8122
const char code[] = "template <class T> struct Containter {\n"
" Containter();\n"
" Containter(const Containter &);\n"
" Containter & operator = (const Containter &);\n"
" ~Containter();\n"
const char code[] = "template <class T> struct Container {\n"
" Container();\n"
" Container(const Container &);\n"
" Container & operator = (const Container &);\n"
" ~Container();\n"
" T* mElements;\n"
" const Containter * c;\n"
" const Container * c;\n"
"};\n"
"template <class T> Containter<T>::Containter() : mElements(nullptr), c(nullptr) {}\n"
"template <class T> Containter<T>::Containter(const Containter & x) { nElements = x.nElements; c = x.c; }\n"
"template <class T> Containter<T> & Containter<T>::operator = (const Containter & x) { mElements = x.mElements; c = x.c; return *this; }\n"
"template <class T> Containter<T>::~Containter() {}\n"
"Containter<int> intContainer;";
"template <class T> Container<T>::Container() : mElements(nullptr), c(nullptr) {}\n"
"template <class T> Container<T>::Container(const Container & x) { nElements = x.nElements; c = x.c; }\n"
"template <class T> Container<T> & Container<T>::operator = (const Container & x) { mElements = x.mElements; c = x.c; return *this; }\n"
"template <class T> Container<T>::~Container() {}\n"
"Container<int> intContainer;";
const char expected[] = "struct Containter<int> ; "
"Containter<int> intContainer ; "
"struct Containter<int> { "
"Containter<int> ( ) ; "
"Containter<int> ( const Containter<int> & ) ; "
"Containter<int> & operator= ( const Containter<int> & ) ; "
"~ Containter<int> ( ) ; "
const char expected[] = "struct Container<int> ; "
"Container<int> intContainer ; "
"struct Container<int> { "
"Container<int> ( ) ; "
"Container<int> ( const Container<int> & ) ; "
"Container<int> & operator= ( const Container<int> & ) ; "
"~ Container<int> ( ) ; "
"int * mElements ; "
"const Containter<int> * c ; "
"const Container<int> * c ; "
"} ; "
"Containter<int> :: Containter<int> ( ) : mElements ( nullptr ) , c ( nullptr ) { } "
"Containter<int> :: Containter<int> ( const Containter<int> & x ) { nElements = x . nElements ; c = x . c ; } "
"Containter<int> & Containter<int> :: operator= ( const Containter<int> & x ) { mElements = x . mElements ; c = x . c ; return * this ; } "
"Containter<int> :: ~ Containter<int> ( ) { }";
"Container<int> :: Container<int> ( ) : mElements ( nullptr ) , c ( nullptr ) { } "
"Container<int> :: Container<int> ( const Container<int> & x ) { nElements = x . nElements ; c = x . c ; } "
"Container<int> & Container<int> :: operator= ( const Container<int> & x ) { mElements = x . mElements ; c = x . c ; return * this ; } "
"Container<int> :: ~ Container<int> ( ) { }";
ASSERT_EQUALS(expected, tok(code));
}

View File

@ -822,36 +822,36 @@ private:
void tokenize34() { // #8031
{
const char code[] = "struct Containter {\n"
" Containter();\n"
const char code[] = "struct Container {\n"
" Container();\n"
" int* mElements;\n"
"};\n"
"Containter::Containter() : mElements(nullptr) {}\n"
"Containter intContainer;";
const char exp [] = "1: struct Containter {\n"
"2: Containter ( ) ;\n"
"Container::Container() : mElements(nullptr) {}\n"
"Container intContainer;";
const char exp [] = "1: struct Container {\n"
"2: Container ( ) ;\n"
"3: int * mElements@1 ;\n"
"4: } ;\n"
"5: Containter :: Containter ( ) : mElements@1 ( nullptr ) { }\n"
"6: Containter intContainer@2 ;\n";
"5: Container :: Container ( ) : mElements@1 ( nullptr ) { }\n"
"6: Container intContainer@2 ;\n";
ASSERT_EQUALS(exp, tokenizeDebugListing(code, /*simplify=*/true));
}
{
const char code[] = "template<class T> struct Containter {\n"
" Containter();\n"
const char code[] = "template<class T> struct Container {\n"
" Container();\n"
" int* mElements;\n"
"};\n"
"template <class T> Containter<T>::Containter() : mElements(nullptr) {}\n"
"Containter<int> intContainer;";
const char exp [] = "1: struct Containter<int> ;\n"
"template <class T> Container<T>::Container() : mElements(nullptr) {}\n"
"Container<int> intContainer;";
const char exp [] = "1: struct Container<int> ;\n"
"2:\n"
"|\n"
"5:\n"
"6: Containter<int> intContainer@1 ; struct Containter<int> {\n"
"2: Containter<int> ( ) ;\n"
"6: Container<int> intContainer@1 ; struct Container<int> {\n"
"2: Container<int> ( ) ;\n"
"3: int * mElements@2 ;\n"
"4: } ;\n"
"5: Containter<int> :: Containter<int> ( ) : mElements@2 ( nullptr ) { }\n";
"5: Container<int> :: Container<int> ( ) : mElements@2 ( nullptr ) { }\n";
ASSERT_EQUALS(exp, tokenizeDebugListing(code, /*simplify=*/true));
}
}

View File

@ -659,7 +659,7 @@ def main():
parser.add_argument('--line', action='store_true', default=False,
help='add line directive to input files into build files')
parser.add_argument('file', nargs='*',
help='file to complile')
help='file to compile')
args = parser.parse_args()
lib_dir = args.read_dir
build_dir = args.write_dir