Skip to content

Commit 2fb07fd

Browse files
committed
rand: avoid uninitialized loadavg warnings
1 parent 5f796f8 commit 2fb07fd

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/util/rand.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ GIT_INLINE(int) getseed(uint64_t *seed)
7676
GIT_INLINE(int) getseed(uint64_t *seed)
7777
{
7878
struct timeval tv;
79-
double loadavg[3];
8079
int fd;
8180

8281
# if defined(GIT_RAND_GETLOADAVG)
82+
double loadavg[3];
8383
bits convert;
8484
# endif
8585

@@ -125,8 +125,6 @@ GIT_INLINE(int) getseed(uint64_t *seed)
125125
convert.f = loadavg[0]; *seed ^= (convert.d >> 36);
126126
convert.f = loadavg[1]; *seed ^= (convert.d);
127127
convert.f = loadavg[2]; *seed ^= (convert.d >> 16);
128-
# else
129-
GIT_UNUSED(loadavg[0]);
130128
# endif
131129

132130
*seed ^= git_time_monotonic();

0 commit comments

Comments
 (0)