lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 1a68606 23/33: Conserve 80-character maximum


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 1a68606 23/33: Conserve 80-character maximum width
Date: Mon, 3 May 2021 08:15:54 -0400 (EDT)

branch: master
commit 1a686063596430972076f0cd0fb2eb52d50aaac3
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Conserve 80-character maximum width
    
    Particularly for source files that already conform to the ideal
    eighty-character maximum width (excluding longer copyright notices),
    strive not to widen any line beyond that ideal.
---
 view_ex.cpp                  | 6 +++++-
 wx_test_benchmark_census.cpp | 3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/view_ex.cpp b/view_ex.cpp
index db32b53..e22c72b 100644
--- a/view_ex.cpp
+++ b/view_ex.cpp
@@ -208,5 +208,9 @@ std::string ViewEx::base_filename() const
 {
     std::string 
t(GetDocument()->GetUserReadableName().ToStdString(wxConvUTF8));
     fs::path path(t);
-    return path.has_filename() ? path.filename().string() : 
std::string("Hastur");
+// Allowed by
+//   http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0980r0.pdf
+//  static constexpr std::string unnameable{"Hastur"};
+    static std::string const unnameable{"Hastur"};
+    return path.has_filename() ? path.filename().string() : unnameable;
 }
diff --git a/wx_test_benchmark_census.cpp b/wx_test_benchmark_census.cpp
index a52d4fb..3408486 100644
--- a/wx_test_benchmark_census.cpp
+++ b/wx_test_benchmark_census.cpp
@@ -137,7 +137,8 @@ LMI_WX_TEST_CASE(benchmark_census)
 {
     for(auto const& i : fs::directory_iterator(get_test_files_path()))
         {
-        
if(!wxString::FromUTF8(i.path().filename().string()).Matches("MSEC*.cns"))
+        std::string const s {i.path().filename().string()};
+        if(!wxString::FromUTF8(s).Matches("MSEC*.cns"))
             {
             continue;
             }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]