Rename time and index parameter to avoid name conflict.
As noted in #557, several functions use 'index' resp. 'time'
as parameter names in their declaration and/or definition, causing name
conflicts with the functions in the C standard library of the same
name some compilers warn about.
This commit renames the arguments accordingly.
diff --git a/library/entropy.c b/library/entropy.c
index 540a27c..c6f44df 100644
--- a/library/entropy.c
+++ b/library/entropy.c
@@ -104,23 +104,23 @@
f_source_ptr f_source, void *p_source,
size_t threshold )
{
- int index, ret = 0;
+ int idx, ret = 0;
#if defined(POLARSSL_THREADING_C)
if( ( ret = polarssl_mutex_lock( &ctx->mutex ) ) != 0 )
return( ret );
#endif
- index = ctx->source_count;
- if( index >= ENTROPY_MAX_SOURCES )
+ idx = ctx->source_count;
+ if( idx >= ENTROPY_MAX_SOURCES )
{
ret = POLARSSL_ERR_ENTROPY_MAX_SOURCES;
goto exit;
}
- ctx->source[index].f_source = f_source;
- ctx->source[index].p_source = p_source;
- ctx->source[index].threshold = threshold;
+ ctx->source[idx].f_source = f_source;
+ ctx->source[idx].p_source = p_source;
+ ctx->source[idx].threshold = threshold;
ctx->source_count++;