summaryrefslogtreecommitdiff
path: root/crc
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-01-19 14:04:16 -0700
committerJens Axboe <jaxboe@fusionio.com>2011-01-19 14:04:16 -0700
commit2b13e716c0921356c0930522718e00b8df34293a (patch)
treeda060d7329090de6736267897818760c07d06403 /crc
parent58483fa41bb08def4dbd3c4c9624116b643c7599 (diff)
downloadfio-2b13e716c0921356c0930522718e00b8df34293a.tar.gz
fio-2b13e716c0921356c0930522718e00b8df34293a.tar.bz2
Get rid of shadow declarations
Reported-by: Bruce Cran <bruce@cran.org.uk> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'crc')
-rw-r--r--crc/sha256.c12
-rw-r--r--crc/sha512.c12
2 files changed, 12 insertions, 12 deletions
diff --git a/crc/sha256.c b/crc/sha256.c
index 0091d447..dcb16772 100644
--- a/crc/sha256.c
+++ b/crc/sha256.c
@@ -243,10 +243,10 @@ void sha256_init(struct sha256_ctx *sctx)
void sha256_update(struct sha256_ctx *sctx, const uint8_t *data,
unsigned int len)
{
- unsigned int i, index, part_len;
+ unsigned int i, idx, part_len;
/* Compute number of bytes mod 128 */
- index = (unsigned int)((sctx->count[0] >> 3) & 0x3f);
+ idx = (unsigned int)((sctx->count[0] >> 3) & 0x3f);
/* Update number of bits */
if ((sctx->count[0] += (len << 3)) < (len << 3)) {
@@ -254,20 +254,20 @@ void sha256_update(struct sha256_ctx *sctx, const uint8_t *data,
sctx->count[1] += (len >> 29);
}
- part_len = 64 - index;
+ part_len = 64 - idx;
/* Transform as many times as possible. */
if (len >= part_len) {
- memcpy(&sctx->buf[index], data, part_len);
+ memcpy(&sctx->buf[idx], data, part_len);
sha256_transform(sctx->state, sctx->buf);
for (i = part_len; i + 63 < len; i += 64)
sha256_transform(sctx->state, &data[i]);
- index = 0;
+ idx = 0;
} else {
i = 0;
}
/* Buffer remaining input */
- memcpy(&sctx->buf[index], &data[i], len-i);
+ memcpy(&sctx->buf[idx], &data[i], len-i);
}
diff --git a/crc/sha512.c b/crc/sha512.c
index 0d44ace5..9268a490 100644
--- a/crc/sha512.c
+++ b/crc/sha512.c
@@ -162,10 +162,10 @@ void sha512_init(struct sha512_ctx *sctx)
void sha512_update(struct sha512_ctx *sctx, const uint8_t *data,
unsigned int len)
{
- unsigned int i, index, part_len;
+ unsigned int i, idx, part_len;
/* Compute number of bytes mod 128 */
- index = (unsigned int)((sctx->count[0] >> 3) & 0x7F);
+ idx = (unsigned int)((sctx->count[0] >> 3) & 0x7F);
/* Update number of bits */
if ((sctx->count[0] += (len << 3)) < (len << 3)) {
@@ -175,23 +175,23 @@ void sha512_update(struct sha512_ctx *sctx, const uint8_t *data,
sctx->count[1] += (len >> 29);
}
- part_len = 128 - index;
+ part_len = 128 - idx;
/* Transform as many times as possible. */
if (len >= part_len) {
- memcpy(&sctx->buf[index], data, part_len);
+ memcpy(&sctx->buf[idx], data, part_len);
sha512_transform(sctx->state, sctx->W, sctx->buf);
for (i = part_len; i + 127 < len; i+=128)
sha512_transform(sctx->state, sctx->W, &data[i]);
- index = 0;
+ idx = 0;
} else {
i = 0;
}
/* Buffer remaining input */
- memcpy(&sctx->buf[index], &data[i], len - i);
+ memcpy(&sctx->buf[idx], &data[i], len - i);
/* erase our data */
memset(sctx->W, 0, sizeof(sctx->W));