lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 0622c32 07/22: Regularize whitespace


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 0622c32 07/22: Regularize whitespace
Date: Sat, 28 Mar 2020 18:23:36 -0400 (EDT)

branch: master
commit 0622c321551b972a0ccc81d3f636501da08a0a85
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Regularize whitespace
---
 md5sum.cpp          | 10 +++++-----
 md5sum.hpp          | 14 +++++++-------
 md5sum_cli.cpp      |  2 +-
 md5sum_test.cpp     | 14 +++++++-------
 rate_table_tool.cpp |  2 +-
 5 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/md5sum.cpp b/md5sum.cpp
index f3d1307..4060443 100644
--- a/md5sum.cpp
+++ b/md5sum.cpp
@@ -34,7 +34,7 @@
 #include <stdexcept>
 
 std::vector<md5sum_for_file> md5_read_checksum_stream
-    (std::istream& is
+    (std::istream     & is
     ,std::string const& stream_description
     )
 {
@@ -119,7 +119,7 @@ std::vector<md5sum_for_file> 
md5_read_checksum_file(fs::path const& filename)
 }
 
 std::string md5_calculate_stream_checksum
-    (std::istream& is
+    (std::istream     & is
     ,std::string const& stream_description
     )
 {
@@ -145,7 +145,7 @@ std::string md5_calculate_stream_checksum
         read_count = is.gcount();
 
         // If end of file is reached, end the loop.
-        if (is.eof())
+        if(is.eof())
             {
             break;
             }
@@ -183,7 +183,7 @@ std::string md5_calculate_stream_checksum
 
 std::string LMI_SO md5_calculate_file_checksum
     (fs::path const& filename
-    ,md5_file_mode file_mode
+    ,md5_file_mode   file_mode
     )
 {
     auto const filename_string = filename.string();
@@ -191,7 +191,7 @@ std::string LMI_SO md5_calculate_file_checksum
     std::vector<unsigned char> md5(md5len);
 
     std::ios_base::openmode open_mode{std::ios_base::in};
-    switch (file_mode)
+    switch(file_mode)
         {
         case md5_file_mode::binary:
             open_mode |= std::ios_base::binary;
diff --git a/md5sum.hpp b/md5sum.hpp
index cb86f93..0d1b2cb 100644
--- a/md5sum.hpp
+++ b/md5sum.hpp
@@ -36,9 +36,9 @@
 // The gnu libc md5 implementation seems to assume this:
 static_assert(8 == CHAR_BIT || 16 == CHAR_BIT);
 // so md5 output is 128 bits == 16 8-bit bytes or 8 16-bit bytes:
-enum { md5len = 128 / CHAR_BIT };
+enum {md5len = 128 / CHAR_BIT};
 
-enum { chars_per_formatted_hex_byte = CHAR_BIT / 4 };
+enum {chars_per_formatted_hex_byte = CHAR_BIT / 4};
 
 enum class md5_file_mode
 {
@@ -49,8 +49,8 @@ enum class md5_file_mode
 struct md5sum_for_file
 {
     md5sum_for_file(fs::path&& path, std::string&& sum, md5_file_mode mode)
-        :filename{std::move(path)}
-        ,md5sum{std::move(sum)}
+        :filename {std::move(path)}
+        ,md5sum   {std::move(sum)}
         ,file_mode{mode}
     {}
 
@@ -78,7 +78,7 @@ struct md5sum_for_file
 /// The stream_description parameter is only used in exceptions messages.
 
 std::vector<md5sum_for_file> LMI_SO md5_read_checksum_stream
-    (std::istream& is
+    (std::istream     & is
     ,std::string const& stream_description
     );
 
@@ -97,7 +97,7 @@ std::vector<md5sum_for_file> LMI_SO md5_read_checksum_file
 /// Throws an std::runtime_error in case of an error.
 
 std::string LMI_SO md5_calculate_stream_checksum
-    (std::istream& is
+    (std::istream     & is
     ,std::string const& stream_description
     );
 
@@ -107,7 +107,7 @@ std::string LMI_SO md5_calculate_stream_checksum
 
 std::string LMI_SO md5_calculate_file_checksum
     (fs::path const& filename
-    ,md5_file_mode file_mode = md5_file_mode::binary
+    ,md5_file_mode   file_mode = md5_file_mode::binary
     );
 
 /// Hex representation of an md5 sum as a string.
diff --git a/md5sum_cli.cpp b/md5sum_cli.cpp
index 629c066..26a0771 100644
--- a/md5sum_cli.cpp
+++ b/md5sum_cli.cpp
@@ -131,7 +131,7 @@ int try_main(int argc, char* argv[])
 
     while(EOF != (c = getopt_long ()))
         {
-        switch (c)
+        switch(c)
             {
             case 'b':
                 have_input_mode_option = true;
diff --git a/md5sum_test.cpp b/md5sum_test.cpp
index b503613..d240fe5 100644
--- a/md5sum_test.cpp
+++ b/md5sum_test.cpp
@@ -80,7 +80,7 @@ std::ostream& operator<<(std::ostream& os, 
std::vector<md5sum_for_file> const& v
     for(auto const& s : v)
         {
         char delimiter;
-        switch (s.file_mode)
+        switch(s.file_mode)
             {
             case md5_file_mode::binary:
                 delimiter = '*';
@@ -122,10 +122,10 @@ class MD5SumTest
   private:
     void RemoveTestFilesIfNecessary(char const* file, int line) const;
     void WriteAndCheckFile
-        (char const* filename
+        (char const*        filename
         ,std::string const& text
-        ,char const* file
-        ,int line
+        ,char const*        file
+        ,int                line
         ) const;
 
     void InitializeTestFile() const;
@@ -283,10 +283,10 @@ void MD5SumTest::RemoveTestFilesIfNecessary(char const* 
file, int line) const
 /// Read the file back after the writing and check the content.
 
 void MD5SumTest::WriteAndCheckFile
-    (char const* filename
+    (char const*        filename
     ,std::string const& text
-    ,char const* file
-    ,int line
+    ,char const*        file
+    ,int                line
     ) const
 {
     std::ofstream os{filename, ios_out_trunc_binary()};
diff --git a/rate_table_tool.cpp b/rate_table_tool.cpp
index 3055938..11bdadd 100644
--- a/rate_table_tool.cpp
+++ b/rate_table_tool.cpp
@@ -494,7 +494,7 @@ int try_main(int argc, char* argv[])
 
     while(EOF != (c = getopt_long ()))
       {
-        switch (c)
+        switch(c)
           {
           case 'a':
             {



reply via email to

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