Cleanup up non-prototyped functions (static) and const-correctness

More fixes based on the compiler directives -Wcast-qual -Wwrite-strings
-Wmissing-prototypes -Wmissing-declarations. Not everything with regards
to -Wcast-qual has been fixed as some have unwanted consequences for the
rest of the code.
This commit is contained in:
Paul Bakker 2013-06-25 16:25:17 +02:00
parent 169b7f4a13
commit b6c5d2e1a6
16 changed files with 98 additions and 93 deletions

View file

@ -1,7 +1,7 @@
/*
* Entropy accumulator implementation
*
* Copyright (C) 2006-2011, Brainspark B.V.
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
@ -81,14 +81,14 @@ int entropy_add_source( entropy_context *ctx,
/*
* Entropy accumulator update
*/
int entropy_update( entropy_context *ctx, unsigned char source_id,
const unsigned char *data, size_t len )
static int entropy_update( entropy_context *ctx, unsigned char source_id,
const unsigned char *data, size_t len )
{
unsigned char header[2];
unsigned char tmp[ENTROPY_BLOCK_SIZE];
size_t use_len = len;
const unsigned char *p = data;
if( use_len > ENTROPY_BLOCK_SIZE )
{
sha4( data, len, tmp, 0 );
@ -102,7 +102,7 @@ int entropy_update( entropy_context *ctx, unsigned char source_id,
sha4_update( &ctx->accumulator, header, 2 );
sha4_update( &ctx->accumulator, p, use_len );
return( 0 );
}