Skip to content

Commit 0a1b3a9

Browse files
practicalswiftdanmar
authored andcommitted
Fix typos (danmar#1568)
1 parent 5636497 commit 0a1b3a9

13 files changed

+66
-66
lines changed

addons/misra.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ def generateTable():
524524
def remove_file_prefix(file_path, prefix):
525525
"""
526526
Remove a file path prefix from a give path. leftover
527-
directory seperators at the beginning of a file
527+
directory separators at the beginning of a file
528528
after the removal are also stripped.
529529
530530
Example:
@@ -537,7 +537,7 @@ def remove_file_prefix(file_path, prefix):
537537
result = None
538538
if file_path.startswith(prefix):
539539
result = file_path[len(prefix):]
540-
# Remove any leftover directory seperators at the
540+
# Remove any leftover directory separators at the
541541
# beginning
542542
result = result.lstrip('\\/')
543543
else:
@@ -565,7 +565,7 @@ def __init__(self):
565565
# Dictionary of dictionaries for rules to suppress
566566
# Dict1 is keyed by rule number in the hundreds format of
567567
# Major * 100 + minor. ie Rule 5.2 = (5*100) + 2
568-
# Dict 2 is keyed by filename. An entry of None means suppress globaly.
568+
# Dict 2 is keyed by filename. An entry of None means suppress globally.
569569
# Each file name entry contails a list of tuples of (lineNumber, symbolName)
570570
# or an item of None which indicates suppress rule for the entire file.
571571
# The line and symbol name tuple may have None as either of its elements but
@@ -1882,7 +1882,7 @@ def showSuppressedRules(self):
18821882
def setFilePrefix(self, prefix):
18831883
"""
18841884
Set the file prefix to ignnore from files when matching
1885-
supression files
1885+
suppression files
18861886
"""
18871887
self.filePrefix = prefix
18881888

@@ -2179,7 +2179,7 @@ def parseDump(self, dumpfile):
21792179
print('Not expected: ' + actual)
21802180
exitCode = 1
21812181

2182-
# Exisitng behavior of verify mode is to exit
2182+
# Existing behavior of verify mode is to exit
21832183
# on the first un-expected output.
21842184
# TODO: Is this required? or can it be moved to after
21852185
# all input files have been processed

addons/namingng.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# "uint32_t": "ui32"}
2020
# }
2121
#
22-
# RE_VARNAME, RE_PRIVATE_MEMBER_VARIABE and RE_FUNCTIONNAME are regular expressions to cover hte basic names
22+
# RE_VARNAME, RE_PRIVATE_MEMBER_VARIABE and RE_FUNCTIONNAME are regular expressions to cover the basic names
2323
# In var_prefixes and function_prefixes there are the variable-type/prefix pairs
2424

2525
import cppcheckdata

cfg/zlib.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<def format="2">
3-
<!-- Reference to zlib documention https://www.zlib.net/manual.html -->
3+
<!-- Reference to zlib documentation https://www.zlib.net/manual.html -->
44
<!-- Data structures and types -->
55
<podtype name="alloc_func"/>
66
<podtype name="Byte" sign="u" size="1"/>

cmake/options.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ option(ANALYZE_DATAFLOW "Clang dynamic analyzer: general dynamic dataflow an
2323
option(WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF)
2424
option(WARNINGS_ANSI_ISO "Issue all the mandatory diagnostics Listed in C standard" ON)
2525

26-
set(USE_MATCHCOMPILER "Auto" CACHE STRING "Usage of match compliler")
26+
set(USE_MATCHCOMPILER "Auto" CACHE STRING "Usage of match compiler")
2727
set_property(CACHE USE_MATCHCOMPILER PROPERTY STRINGS Auto Off On Verify)
2828
if (USE_MATCHCOMPILER STREQUAL "Auto")
2929
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")

doxyfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ USE_HTAGS = NO
840840
VERBATIM_HEADERS = YES
841841

842842
# If CLANG_ASSISTED_PARSING is set to YES, then doxygen will use the clang parser
843-
# for more acurate parsing at the cost of reduced performance. This can be
843+
# for more accurate parsing at the cost of reduced performance. This can be
844844
# particularly helpful with template rich C++ code for which doxygen's built-in
845845
# parser lacks the necessary type information.
846846

@@ -929,7 +929,7 @@ HTML_STYLESHEET =
929929
# user-defined cascading style sheet that is included after the standard
930930
# style sheets created by doxygen. Using this option one can overrule
931931
# certain style aspects. This is preferred over using HTML_STYLESHEET
932-
# since it does not replace the standard style sheet and is therefor more
932+
# since it does not replace the standard style sheet and is therefore more
933933
# robust against future updates. Doxygen will copy the style sheet file to
934934
# the output directory.
935935

lib/valueflow.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1971,7 +1971,7 @@ static bool valueFlowForward(Token * const startToken,
19711971
Token *lambdaEndToken = const_cast<Token *>(findLambdaEndToken(tok2));
19721972
if (isVariableChanged(lambdaEndToken->link(), lambdaEndToken, varid, var->isGlobal(), settings, tokenlist->isCPP()))
19731973
return false;
1974-
// Dont skip lambdas for lifetime values
1974+
// Don't skip lambdas for lifetime values
19751975
if (!std::all_of(values.begin(), values.end(), std::mem_fn(&ValueFlow::Value::isLifetimeValue))) {
19761976
tok2 = lambdaEndToken;
19771977
continue;
@@ -2682,7 +2682,7 @@ struct LifetimeStore {
26822682
value.tokvalue = var->nameToken();
26832683
value.errorPath = errorPath;
26842684
value.lifetimeKind = type;
2685-
// Dont add the value a second time
2685+
// Don't add the value a second time
26862686
if (std::find(tok->values().begin(), tok->values().end(), value) != tok->values().end())
26872687
return;
26882688
setTokenValue(tok, value, tokenlist->getSettings());
@@ -2714,7 +2714,7 @@ struct LifetimeStore {
27142714
value.tokvalue = var->nameToken();
27152715
value.errorPath = errorPath;
27162716
value.lifetimeKind = type;
2717-
// Dont add the value a second time
2717+
// Don't add the value a second time
27182718
if (std::find(tok->values().begin(), tok->values().end(), value) != tok->values().end())
27192719
continue;
27202720
setTokenValue(tok, value, tokenlist->getSettings());
@@ -4190,7 +4190,7 @@ static void valueFlowSubFunction(TokenList *tokenlist, const Settings *settings)
41904190
// passing value(s) to function
41914191
std::list<ValueFlow::Value> argvalues(getFunctionArgumentValues(argtok));
41924192

4193-
// Dont forward lifetime values
4193+
// Don't forward lifetime values
41944194
argvalues.remove_if(std::mem_fn(&ValueFlow::Value::isLifetimeValue));
41954195

41964196
if (argvalues.empty())

test/testautovariables.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -1571,38 +1571,38 @@ class TestAutoVariables : public TestFixture {
15711571
"}\n");
15721572
ASSERT_EQUALS("", errout.str());
15731573

1574-
// Dont decay std::array
1574+
// Don't decay std::array
15751575
check("std::array<char, 1> f() {\n"
15761576
" std::array<char, 1> x;\n"
15771577
" return x;\n"
15781578
"}\n");
15791579
ASSERT_EQUALS("", errout.str());
15801580

1581-
// Make sure we dont hang
1581+
// Make sure we don't hang
15821582
check("struct A;\n"
15831583
"void f() {\n"
15841584
" using T = A[3];\n"
15851585
" A &&a = T{1, 2, 3}[1];\n"
15861586
"}\n");
15871587
ASSERT_EQUALS("", errout.str());
15881588

1589-
// Make sure we dont hang
1589+
// Make sure we don't hang
15901590
check("struct A;\n"
15911591
"void f() {\n"
15921592
" using T = A[3];\n"
15931593
" A &&a = T{1, 2, 3}[1]();\n"
15941594
"}\n");
15951595
ASSERT_EQUALS("", errout.str());
15961596

1597-
// Make sure we dont hang
1597+
// Make sure we don't hang
15981598
check("struct A;\n"
15991599
"void f() {\n"
16001600
" using T = A[3];\n"
16011601
" A &&a = T{1, 2, 3}[1];\n"
16021602
"}\n");
16031603
ASSERT_EQUALS("", errout.str());
16041604

1605-
// Make sure we dont hang
1605+
// Make sure we don't hang
16061606
check("struct A;\n"
16071607
"void f() {\n"
16081608
" using T = A[3];\n"

test/testcondition.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2158,7 +2158,7 @@ class TestCondition : public TestFixture {
21582158
" X(do);\n"
21592159
" if (x > 100) {}\n"
21602160
"}");
2161-
// TODO: we should probably throw unknownMacro InternalError. Complain that the macro X must be defined. We cant check the code well without the definition.
2161+
// 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.
21622162
TODO_ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:4]: (style) Condition 'x>100' is always false\n", "", errout.str());
21632163

21642164
check("void f(const int *i) {\n"

test/testconstructors.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -3484,12 +3484,12 @@ class TestConstructors : public TestFixture {
34843484
}
34853485

34863486
void templateConstructor() { // ticket #7942
3487-
check("template <class T> struct Containter {\n"
3488-
" Containter();\n"
3487+
check("template <class T> struct Container {\n"
3488+
" Container();\n"
34893489
" T* mElements;\n"
34903490
"};\n"
3491-
"template <class T> Containter<T>::Containter() : mElements(nullptr) {}\n"
3492-
"Containter<int> intContainer;");
3491+
"template <class T> Container<T>::Container() : mElements(nullptr) {}\n"
3492+
"Container<int> intContainer;");
34933493
ASSERT_EQUALS("", errout.str());
34943494
}
34953495

test/testgarbage.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ class TestGarbage : public TestFixture {
824824

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

test/testsimplifytemplate.cpp

+24-24
Original file line numberDiff line numberDiff line change
@@ -1313,34 +1313,34 @@ class TestSimplifyTemplate : public TestFixture {
13131313
}
13141314

13151315
void template67() { // ticket #8122
1316-
const char code[] = "template <class T> struct Containter {\n"
1317-
" Containter();\n"
1318-
" Containter(const Containter &);\n"
1319-
" Containter & operator = (const Containter &);\n"
1320-
" ~Containter();\n"
1316+
const char code[] = "template <class T> struct Container {\n"
1317+
" Container();\n"
1318+
" Container(const Container &);\n"
1319+
" Container & operator = (const Container &);\n"
1320+
" ~Container();\n"
13211321
" T* mElements;\n"
1322-
" const Containter * c;\n"
1322+
" const Container * c;\n"
13231323
"};\n"
1324-
"template <class T> Containter<T>::Containter() : mElements(nullptr), c(nullptr) {}\n"
1325-
"template <class T> Containter<T>::Containter(const Containter & x) { nElements = x.nElements; c = x.c; }\n"
1326-
"template <class T> Containter<T> & Containter<T>::operator = (const Containter & x) { mElements = x.mElements; c = x.c; return *this; }\n"
1327-
"template <class T> Containter<T>::~Containter() {}\n"
1328-
"Containter<int> intContainer;";
1329-
1330-
const char expected[] = "struct Containter<int> ; "
1331-
"Containter<int> intContainer ; "
1332-
"struct Containter<int> { "
1333-
"Containter<int> ( ) ; "
1334-
"Containter<int> ( const Containter<int> & ) ; "
1335-
"Containter<int> & operator= ( const Containter<int> & ) ; "
1336-
"~ Containter<int> ( ) ; "
1324+
"template <class T> Container<T>::Container() : mElements(nullptr), c(nullptr) {}\n"
1325+
"template <class T> Container<T>::Container(const Container & x) { nElements = x.nElements; c = x.c; }\n"
1326+
"template <class T> Container<T> & Container<T>::operator = (const Container & x) { mElements = x.mElements; c = x.c; return *this; }\n"
1327+
"template <class T> Container<T>::~Container() {}\n"
1328+
"Container<int> intContainer;";
1329+
1330+
const char expected[] = "struct Container<int> ; "
1331+
"Container<int> intContainer ; "
1332+
"struct Container<int> { "
1333+
"Container<int> ( ) ; "
1334+
"Container<int> ( const Container<int> & ) ; "
1335+
"Container<int> & operator= ( const Container<int> & ) ; "
1336+
"~ Container<int> ( ) ; "
13371337
"int * mElements ; "
1338-
"const Containter<int> * c ; "
1338+
"const Container<int> * c ; "
13391339
"} ; "
1340-
"Containter<int> :: Containter<int> ( ) : mElements ( nullptr ) , c ( nullptr ) { } "
1341-
"Containter<int> :: Containter<int> ( const Containter<int> & x ) { nElements = x . nElements ; c = x . c ; } "
1342-
"Containter<int> & Containter<int> :: operator= ( const Containter<int> & x ) { mElements = x . mElements ; c = x . c ; return * this ; } "
1343-
"Containter<int> :: ~ Containter<int> ( ) { }";
1340+
"Container<int> :: Container<int> ( ) : mElements ( nullptr ) , c ( nullptr ) { } "
1341+
"Container<int> :: Container<int> ( const Container<int> & x ) { nElements = x . nElements ; c = x . c ; } "
1342+
"Container<int> & Container<int> :: operator= ( const Container<int> & x ) { mElements = x . mElements ; c = x . c ; return * this ; } "
1343+
"Container<int> :: ~ Container<int> ( ) { }";
13441344

13451345
ASSERT_EQUALS(expected, tok(code));
13461346
}

test/testtokenize.cpp

+16-16
Original file line numberDiff line numberDiff line change
@@ -822,36 +822,36 @@ class TestTokenizer : public TestFixture {
822822

823823
void tokenize34() { // #8031
824824
{
825-
const char code[] = "struct Containter {\n"
826-
" Containter();\n"
825+
const char code[] = "struct Container {\n"
826+
" Container();\n"
827827
" int* mElements;\n"
828828
"};\n"
829-
"Containter::Containter() : mElements(nullptr) {}\n"
830-
"Containter intContainer;";
831-
const char exp [] = "1: struct Containter {\n"
832-
"2: Containter ( ) ;\n"
829+
"Container::Container() : mElements(nullptr) {}\n"
830+
"Container intContainer;";
831+
const char exp [] = "1: struct Container {\n"
832+
"2: Container ( ) ;\n"
833833
"3: int * mElements@1 ;\n"
834834
"4: } ;\n"
835-
"5: Containter :: Containter ( ) : mElements@1 ( nullptr ) { }\n"
836-
"6: Containter intContainer@2 ;\n";
835+
"5: Container :: Container ( ) : mElements@1 ( nullptr ) { }\n"
836+
"6: Container intContainer@2 ;\n";
837837
ASSERT_EQUALS(exp, tokenizeDebugListing(code, /*simplify=*/true));
838838
}
839839
{
840-
const char code[] = "template<class T> struct Containter {\n"
841-
" Containter();\n"
840+
const char code[] = "template<class T> struct Container {\n"
841+
" Container();\n"
842842
" int* mElements;\n"
843843
"};\n"
844-
"template <class T> Containter<T>::Containter() : mElements(nullptr) {}\n"
845-
"Containter<int> intContainer;";
846-
const char exp [] = "1: struct Containter<int> ;\n"
844+
"template <class T> Container<T>::Container() : mElements(nullptr) {}\n"
845+
"Container<int> intContainer;";
846+
const char exp [] = "1: struct Container<int> ;\n"
847847
"2:\n"
848848
"|\n"
849849
"5:\n"
850-
"6: Containter<int> intContainer@1 ; struct Containter<int> {\n"
851-
"2: Containter<int> ( ) ;\n"
850+
"6: Container<int> intContainer@1 ; struct Container<int> {\n"
851+
"2: Container<int> ( ) ;\n"
852852
"3: int * mElements@2 ;\n"
853853
"4: } ;\n"
854-
"5: Containter<int> :: Containter<int> ( ) : mElements@2 ( nullptr ) { }\n";
854+
"5: Container<int> :: Container<int> ( ) : mElements@2 ( nullptr ) { }\n";
855855
ASSERT_EQUALS(exp, tokenizeDebugListing(code, /*simplify=*/true));
856856
}
857857
}

tools/matchcompiler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ def main():
659659
parser.add_argument('--line', action='store_true', default=False,
660660
help='add line directive to input files into build files')
661661
parser.add_argument('file', nargs='*',
662-
help='file to complile')
662+
help='file to compile')
663663
args = parser.parse_args()
664664
lib_dir = args.read_dir
665665
build_dir = args.write_dir

0 commit comments

Comments
 (0)