Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/BLAKE2/BLAKE2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/b2sum
diff options
context:
space:
mode:
authorSamuel Neves <sneves@dei.uc.pt>2016-10-12 17:19:55 +0300
committerSamuel Neves <sneves@dei.uc.pt>2016-10-12 17:19:55 +0300
commitc19dd2bd835ae98d8f40e7d712042476b4ad1ccf (patch)
tree53fd914ee1bce5f324ee6083162221a4d9a9e522 /b2sum
parent7a39ee4736dce7d9ded9cd4b0eaea7a7fe18d721 (diff)
formatting, more c89
Diffstat (limited to 'b2sum')
-rw-r--r--b2sum/b2sum.c14
-rw-r--r--b2sum/makefile8
2 files changed, 11 insertions, 11 deletions
diff --git a/b2sum/b2sum.c b/b2sum/b2sum.c
index 3ba666e..e354364 100644
--- a/b2sum/b2sum.c
+++ b/b2sum/b2sum.c
@@ -1,14 +1,14 @@
/*
BLAKE2 reference source code package - b2sum tool
-
+
Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the
terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at
your option. The terms of these licenses can be found at:
-
+
- CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0
- OpenSSL license : https://www.openssl.org/source/license.html
- Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0
-
+
More information about the BLAKE2 hash function can be found at
https://blake2.net.
*/
@@ -256,12 +256,11 @@ int main( int argc, char **argv )
unsigned long outbytes = 0;
unsigned char hash[BLAKE2B_OUTBYTES] = {0};
bool bsdstyle = false;
- int c;
+ int c, i;
opterr = 1;
while( 1 )
{
- int this_option_optind = optind ? optind : 1;
int option_index = 0;
char *end = NULL;
unsigned long outbits;
@@ -343,7 +342,7 @@ int main( int argc, char **argv )
if( optind == argc )
argv[argc++] = (char *) "-";
- for( int i = optind; i < argc; ++i )
+ for( i = optind; i < argc; ++i )
{
FILE *f = NULL;
if( argv[i][0] == '-' && argv[i][1] == '\0' )
@@ -363,6 +362,7 @@ int main( int argc, char **argv )
}
else
{
+ size_t j;
if( bsdstyle )
{
if( outbytes < maxbytes )
@@ -371,7 +371,7 @@ int main( int argc, char **argv )
printf( "%s (%s) = ", algorithm, argv[i] );
}
- for( size_t j = 0; j < outbytes; ++j )
+ for( j = 0; j < outbytes; ++j )
printf( "%02x", hash[j] );
if( bsdstyle )
diff --git a/b2sum/makefile b/b2sum/makefile
index 4d19474..c14b9a9 100644
--- a/b2sum/makefile
+++ b/b2sum/makefile
@@ -5,12 +5,12 @@ NO_OPENMP?=0
NO_OPENMP_0=-fopenmp
NO_OPENMP_1=
CC?=gcc
-CFLAGS?=-O3 -march=native -Werror=declaration-after-statement
-CFLAGS+=-std=c99 -I../sse
+CFLAGS?=-O3 -march=native
+CFLAGS+=-std=c89 -Wall -Wextra -pedantic -Wno-long-long -I../sse
CFLAGS+=$(NO_OPENMP_$(NO_OPENMP))
LIBS=
-#FILES=b2sum.c ../ref/blake2b-ref.c ../ref/blake2s-ref.c ../ref/blake2bp-ref.c ../ref/blake2sp-ref.c
-FILES=b2sum.c ../sse/blake2b.c ../sse/blake2s.c ../sse/blake2bp.c ../sse/blake2sp.c
+#FILES=b2sum.c ../ref/blake2b-ref.c ../ref/blake2s-ref.c ../ref/blake2bp-ref.c ../ref/blake2sp-ref.c
+FILES=b2sum.c ../sse/blake2b.c ../sse/blake2s.c ../sse/blake2bp.c ../sse/blake2sp.c
all: $(FILES)
$(CC) $(FILES) $(CFLAGS) $(LIBS) -o $(PROG)