From 4d97aea4c99059722ad3e5c73a9fd5797561ac81 Mon Sep 17 00:00:00 2001 From: Thibault Kruse Date: Sun, 28 Aug 2016 11:40:09 +0900 Subject: [PATCH 1/2] fix typos --- CppCoreGuidelines.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 98ec6a3..ff6bd38 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -7255,7 +7255,7 @@ Union rule summary: * [C.180: Use `union`s to save Memory](#Ru-union) * [C.181: Avoid "naked" `union`s](#Ru-naked) * [C.182: Use anonymous `union`s to implement tagged unions](#Ru-anonymous) -* [C183: Don't use a `union` for type punning](#Ru-pun) +* [C.183: Don't use a `union` for type punning](#Ru-pun) * ??? ### C.180: Use `union`s to save memory @@ -7338,8 +7338,8 @@ The soon-to-be-standard `variant` type (to be found in ``) does that fo ##### Reason -A well-designed tagged usin is type safe. -An *anonymous* union simplifies the definition of a class with a (tag,union) pair. +A well-designed tagged union is type safe. +An *anonymous* union simplifies the definition of a class with a (tag, union) pair. ##### Example @@ -7348,7 +7348,7 @@ You can look there for an explanation. The code is somewhat elaborate. Handling a type with user-defined assignment and destructor is tricky. -Saving programmers from haing to write such code is one reason for including `variant` in the standard. +Saving programmers from having to write such code is one reason for including `variant` in the standard. class Value { // two alternative representations represented as a union private: @@ -7450,7 +7450,7 @@ Type punning using a `union` is a source of errors. unsigned char c[sizeof(int)]; }; -The idea of `Pun` is to be able to look at the characte representation of an `int`. +The idea of `Pun` is to be able to look at the character representation of an `int`. void bad(Pun& u) { @@ -9081,7 +9081,7 @@ Can cause maintenance problems. If this is a large `if`-statement, it is easy to overlook that a new `d` has been introduced in the inner scope. This is a known source of bugs. -Sometimes suce reuse of a name in an inner scope is called "shadowing". +Sometimes such reuse of a name in an inner scope is called "shadowing". ##### Note @@ -10780,11 +10780,11 @@ Avoid wrong results. ##### Example int x = -3; - unsigned int y = 7; - - cout << x-y << '\n'; // unsigned result, possibly 4294967286 - cout << x+y << '\n'; // unsiged result: 4 - cout << x*y << '\n'; // unsigned result, possibly 4294967275 + unsigned int y = 7; + + cout << x - y << '\n'; // unsigned result, possibly 4294967286 + cout << x + y << '\n'; // unsigned result: 4 + cout << x * y << '\n'; // unsigned result, possibly 4294967275 It is harder to spot the problem in more realistic examples. @@ -10825,7 +10825,7 @@ can be surprising for many programmers. ##### Reason Because most arithmetic is assumed to be signed; -`x-y` yields a negative number when `y>x` except in the rare cases wrhere you really want modulo arithmetic. +`x-y` yields a negative number when `y>x` except in the rare cases where you really want modulo arithmetic. ##### Example @@ -16463,7 +16463,7 @@ and errors (when we didn't deal correctly with semi-constructed objects consiste * Always establish a class invariant in a constructor. * Don't define an object before it is needed. -### NR.6: Don't: Place all cleanup actions at the end of a fucntion and `goto exit` +### NR.6: Don't: Place all cleanup actions at the end of a function and `goto exit` ##### Reason (not to follow this rule) @@ -16505,7 +16505,7 @@ and spot the bug. ##### Alternative -* [M]ake member data `public` or (preferably) `private`](#Rh-protected) +* [Make member data `public` or (preferably) `private`](#Rh-protected) # RF: References From b6ab4ed0666511e946ec724673da411143572a69 Mon Sep 17 00:00:00 2001 From: Thibault Kruse Date: Sun, 28 Aug 2016 12:03:35 +0900 Subject: [PATCH 2/2] spell check fix --- scripts/hunspell/isocpp.dic | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/hunspell/isocpp.dic b/scripts/hunspell/isocpp.dic index d2295c2..180a652 100644 --- a/scripts/hunspell/isocpp.dic +++ b/scripts/hunspell/isocpp.dic @@ -1,5 +1,6 @@ ' 0xFF0000 +0b0101'0101 '14 2D 2K @@ -47,6 +48,7 @@ BDE behaviorless BigPOD Bjarne +blog Bloomberg Boehm bool @@ -181,6 +183,7 @@ gp GPLv3 gsl GSL +GSL's gx handcoded Henricson @@ -261,6 +264,7 @@ memoized memset metameta metaprogram +metaprograms metaprogramming Metaprogramming Meyers01 @@ -272,6 +276,7 @@ microbenchmarks modify1 modify2 moredata +multithreaded msgsl mtx Murray93 @@ -342,6 +347,7 @@ polymorphically POPL PortHandle PostInitialize +pp216 PPP pre Pre