Skip to content
Browse files

memtest.c fixed to actually use v1 and v2 in memtest_fill_value().

  • Loading branch information...
1 parent 841048f commit ffe003dcbe9e719659f9a9d690f5bc5fd7b0615e @antirez committed Apr 27, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/memtest.c
View
12 src/memtest.c
@@ -132,13 +132,13 @@ void memtest_fill_value(unsigned long *l, size_t bytes, unsigned long v1,
v = (off & 1) ? v2 : v1;
for (w = 0; w < iwords; w++) {
#ifdef MEMTEST_32BIT
- *l1 = *l2 = ((unsigned long) (rand()&0xffff)) |
- (((unsigned long) (rand()&0xffff)) << 16);
+ *l1 = *l2 = ((unsigned long) v) |
+ (((unsigned long) v) << 16);
#else
- *l1 = *l2 = ((unsigned long) (rand()&0xffff)) |
- (((unsigned long) (rand()&0xffff)) << 16) |
- (((unsigned long) (rand()&0xffff)) << 32) |
- (((unsigned long) (rand()&0xffff)) << 48);
+ *l1 = *l2 = ((unsigned long) v) |
+ (((unsigned long) v) << 16) |
+ (((unsigned long) v) << 32) |
+ (((unsigned long) v) << 48);
#endif
l1 += step;
l2 += step;

0 comments on commit ffe003d

Please sign in to comment.
Something went wrong with that request. Please try again.