[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':
{
- [lmi-commits] [lmi] master updated (0eafcb0 -> 6425b3b), Greg Chicares, 2020/03/28
- [lmi-commits] [lmi] master f340f72 06/22: Explicitly qualify std::size_t, Greg Chicares, 2020/03/28
- [lmi-commits] [lmi] master 2696d31 04/22: Update copyright notices, Greg Chicares, 2020/03/28
- [lmi-commits] [lmi] master 2b4947a 08/22: Write inequality comparisons in number-line order, Greg Chicares, 2020/03/28
- [lmi-commits] [lmi] master 063c376 10/22: Generally avoid "`" where "'" is at least as good, Greg Chicares, 2020/03/28
- [lmi-commits] [lmi] master 0622c32 07/22: Regularize whitespace,
Greg Chicares <=
- [lmi-commits] [lmi] master c029dd3 12/22: Improve documentation, Greg Chicares, 2020/03/28
- [lmi-commits] [lmi] master 4cafdca 02/22: Add lmi_md5sum utility implementing subset of standard md5sum, Greg Chicares, 2020/03/28
- [lmi-commits] [lmi] master d82ac15 13/22: Split a long line, Greg Chicares, 2020/03/28
- [lmi-commits] [lmi] master 28956d7 14/22: Temporarily allow an "MD5 !!" marker, Greg Chicares, 2020/03/28
- [lmi-commits] [lmi] master 925f946 05/22: Include headers iff appropriate, Greg Chicares, 2020/03/28
- [lmi-commits] [lmi] master fc09a91 03/22: Add unit tests for MD5-related functionality, Greg Chicares, 2020/03/28
- [lmi-commits] [lmi] master 225cf10 09/22: Avoid a warning by a different means, Greg Chicares, 2020/03/28
- [lmi-commits] [lmi] master 2db19f5 11/22: Remove unnecessary shared-object attributes, Greg Chicares, 2020/03/28
- [lmi-commits] [lmi] master 28f8ffc 15/22: Explicitly qualify std::cout, Greg Chicares, 2020/03/28
- [lmi-commits] [lmi] master f14ad11 01/22: Implement MD5 checksum files reading in lmi code, Greg Chicares, 2020/03/28