From 8f8c232effcf403f28966d10f090083213f44fc3 Mon Sep 17 00:00:00 2001 From: Thibault Kruse Date: Mon, 22 Aug 2016 23:00:08 +0200 Subject: [PATCH 1/4] fix pushed merge conflicts --- scripts/Makefile | 5 ----- scripts/python/md-split.py | 20 +------------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index a3e28cb..a992333 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -55,13 +55,8 @@ show-diff: nodejs/node_modules/remark nodejs/package.json $(SOURCEPATH) $(BUILD_ .PHONY: check-references check-references: $(SOURCEPATH) $(BUILD_DIR) Makefile ## check references unique -<<<<<<< HEAD @rm -f $(BUILD_DIR)/$(SOURCEFILE).uniq - @grep -oP '(?<= $(BUILD_DIR)/$(SOURCEFILE).uniq -======= - rm -f $(BUILD_DIR)/$(SOURCEFILE).uniq @grep -oP '(?<= $(BUILD_DIR)/$(SOURCEFILE).uniq ->>>>>>> 70d056f087b45f22bda925c9657eec5eaf7a45bf ## check if output has data @if [ -s "build/CppCoreGuidelines.md.uniq" ]; then echo 'Found duplicate anchors:'; cat $(BUILD_DIR)/$(SOURCEFILE).uniq; false; fi diff --git a/scripts/python/md-split.py b/scripts/python/md-split.py index 3ef80e8..fb147e9 100755 --- a/scripts/python/md-split.py +++ b/scripts/python/md-split.py @@ -93,30 +93,17 @@ def process_code(read_filehandle, text_filehandle, line, linenum, sourcefile, co if comment_idx >= 0: no_comment_line = line[:comment_idx] text_filehandle.write(line[comment_idx + 2:]) -<<<<<<< HEAD - if (not has_actual_code and not line.strip().startswith('//') and not line.strip().startswith('???') - and not line.strip() ==''): + and not line.strip() == ''): has_actual_code = True -======= - if (not has_actual_code - and not line.strip().startswith('//') - and not line.strip().startswith('???') - and not line.strip() == ''): - has_actual_code = True ->>>>>>> 180cd89a1f3105a20e79b81964b4d388dca94040 else: # write empty line so line numbers stay stable text_filehandle.write('\n') if (not line.strip() == '```'): -<<<<<<< HEAD if ('???' == no_comment_line or '...' == no_comment_line): -======= - if ('???' in no_comment_line or '...' in no_comment_line): ->>>>>>> 180cd89a1f3105a20e79b81964b4d388dca94040 has_question_marks = True linebuffer.append(dedent(line) if not fenced else line) try: @@ -127,12 +114,7 @@ def process_code(read_filehandle, text_filehandle, line, linenum, sourcefile, co break codefile = os.path.join(codedir, '%s%s.cpp' % (name, index)) if fenced: -<<<<<<< HEAD - text_filehandle.write('') -======= text_filehandle.write('\n') - ->>>>>>> 180cd89a1f3105a20e79b81964b4d388dca94040 if (has_actual_code and not has_question_marks): # add commonly used headers, so that lines can compile with io.open(codefile, 'w') as code_filehandle: From c0bff4596143c8bc980cee5c2d635f91cb9bc7c7 Mon Sep 17 00:00:00 2001 From: Thibault Kruse Date: Thu, 11 Aug 2016 10:54:08 +0200 Subject: [PATCH 2/4] style fixes --- CppCoreGuidelines.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 7fde7d7..4c59e51 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -5464,7 +5464,7 @@ The compiler is more likely to get the default semantics right and you cannot im Tracer& operator=(Tracer&&) = default; }; -Because we defined the destructor, we must define the copy and move operations. The `=default` is the best and simplest way of doing that. +Because we defined the destructor, we must define the copy and move operations. The `= default` is the best and simplest way of doing that. ##### Example, bad @@ -7484,7 +7484,7 @@ The default is the easiest to read and write. enum class Direction : char { n, s, e, w, ne, nw, se, sw }; // underlying type saves space - + enum class Web_color : int { red = 0xFF0000, green = 0x00FF00, blue = 0x0000FF }; // underlying type is redundant @@ -12180,10 +12180,10 @@ Not all member functions can be called. ##### Example class Vector { // very simplified vector of doubles - // if elem!=nullptr then elem points to sz doubles + // if elem != nullptr then elem points to sz doubles public: Vector() : elem{nullptr}, sz{0}{} - vector(int s) : elem{new double},sz{s} { /* initialize elements */ } + vector(int s) : elem{new double}, sz{s} { /* initialize elements */ } ~Vector() { delete elem; } double& operator[](int s) { return elem[s]; } // ... From a1c248b26f663f1807b5bd4678a596a6f424fed6 Mon Sep 17 00:00:00 2001 From: Thibault Kruse Date: Thu, 11 Aug 2016 10:51:58 +0200 Subject: [PATCH 3/4] unique variable names in example --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 4c59e51..13d2159 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -16200,7 +16200,7 @@ Note that a C-style `(T)expression` cast means to perform the first of the follo }; Derived1 d1; - Base* p = &d1; // ok, implicit conversion to pointer to Base is fine + Base* p1 = &d1; // ok, implicit conversion to pointer to Base is fine // BAD, tries to treat d1 as a Derived2, which it is not Derived2* p2 = (Derived2*)(p); From ae9e7f0118f19052966a498a5411fc30097f1185 Mon Sep 17 00:00:00 2001 From: Thibault Kruse Date: Mon, 22 Aug 2016 23:34:06 +0200 Subject: [PATCH 4/4] fix typos in custom spellcheck dict --- scripts/hunspell/isocpp.dic | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/hunspell/isocpp.dic b/scripts/hunspell/isocpp.dic index aad6238..d2295c2 100644 --- a/scripts/hunspell/isocpp.dic +++ b/scripts/hunspell/isocpp.dic @@ -120,7 +120,7 @@ derived1 derived2 destructors Destructors -detatch +detach Dewhurst Dewhurst03 disambiguator @@ -135,6 +135,7 @@ enum Enum enums eq +eqdefault EqualityComparable errno expr @@ -491,7 +492,8 @@ typesafe UB unaliased uncompromised -unenforcable +undetached +unenforceable uninit uniqueptrparam unnamed2