aboutsummaryrefslogtreecommitdiff
path: root/lib/uuid
diff options
context:
space:
mode:
authorAndreas Dilger <adilger@dilger.ca>2012-11-29 05:47:52 -0700
committerTheodore Ts'o <tytso@mit.edu>2012-12-29 17:28:37 -0500
commit1d6fd6d0c3766a8165e69284c75812574a29c804 (patch)
tree57003befa60b0478809b1d78e84f0d4133d7f7d0 /lib/uuid
parentf797cf3e37b476aac593fe9a9f4630448d335332 (diff)
downloade2fsprogs-1d6fd6d0c3766a8165e69284c75812574a29c804.tar.gz
misc: cleanup unused variables on MacOS
Clean up unused variables found by GCC on MacOS. Signed-off-by: Andreas Dilger <adilger@dilger.ca> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'lib/uuid')
-rw-r--r--lib/uuid/gen_uuid.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/uuid/gen_uuid.c b/lib/uuid/gen_uuid.c
index 42d7563d..efa4e3d3 100644
--- a/lib/uuid/gen_uuid.c
+++ b/lib/uuid/gen_uuid.c
@@ -176,8 +176,7 @@ static void get_random_bytes(void *buf, int nbytes)
{
int i, n = nbytes, fd = get_random_fd();
int lose_counter = 0;
- unsigned char *cp = (unsigned char *) buf;
- unsigned short tmp_seed[3];
+ unsigned char *cp = buf;
if (fd >= 0) {
while (n > 0) {
@@ -200,12 +199,16 @@ static void get_random_bytes(void *buf, int nbytes)
for (cp = buf, i = 0; i < nbytes; i++)
*cp++ ^= (rand() >> 7) & 0xFF;
#ifdef DO_JRAND_MIX
- memcpy(tmp_seed, jrand_seed, sizeof(tmp_seed));
- jrand_seed[2] = jrand_seed[2] ^ syscall(__NR_gettid);
- for (cp = buf, i = 0; i < nbytes; i++)
- *cp++ ^= (jrand48(tmp_seed) >> 7) & 0xFF;
- memcpy(jrand_seed, tmp_seed,
- sizeof(jrand_seed)-sizeof(unsigned short));
+ {
+ unsigned short tmp_seed[3];
+
+ memcpy(tmp_seed, jrand_seed, sizeof(tmp_seed));
+ jrand_seed[2] = jrand_seed[2] ^ syscall(__NR_gettid);
+ for (cp = buf, i = 0; i < nbytes; i++)
+ *cp++ ^= (jrand48(tmp_seed) >> 7) & 0xFF;
+ memcpy(jrand_seed, tmp_seed,
+ sizeof(jrand_seed) - sizeof(unsigned short));
+ }
#endif
return;