From 38cb91fcb54be1e2d8130d32f46197291e659023 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 17 Jun 2016 14:58:39 +1000 Subject: [PATCH] tools/hash: style --- tools/hash.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tools/hash.cpp b/tools/hash.cpp index 7dd483c3..e2a9cb5e 100644 --- a/tools/hash.cpp +++ b/tools/hash.cpp @@ -12,7 +12,7 @@ * limitations under the License. * * Copyright: - * 2014, Danny Robson + * 2014-2016, Danny Robson */ #include @@ -35,7 +35,9 @@ #include "hash/sha2.hpp" -static const char* NAMES[] = { +/////////////////////////////////////////////////////////////////////////////// +static +const char* NAMES[] = { "adler32", "bsdsum", "crc32", @@ -49,8 +51,11 @@ static const char* NAMES[] = { }; -static void -compute (std::istream &is, const char *name) { +/////////////////////////////////////////////////////////////////////////////// +static +void +compute (std::istream &is, const char *name) +{ std::vector data { std::istream_iterator (is), std::istream_iterator ( ) @@ -95,6 +100,7 @@ compute (std::istream &is, const char *name) { } +/////////////////////////////////////////////////////////////////////////////// enum { ARG_CMD, ARG_HASH, @@ -119,7 +125,8 @@ print_usage (int argc, char **argv) //----------------------------------------------------------------------------- int -main (int argc, char **argv) { +main (int argc, char **argv) +{ if (argc != NUM_ARGS) { print_usage (argc, argv); return EXIT_FAILURE;