Check in a clang-tidy
This should've been done when we first created the repo, but better late
than never.
Signed-off-by: Ed Tanous <edtanous@google.com>
Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: I68da1d13167ec94f9d008dea307c9f23a991d42c
diff --git a/src/erase/pattern.cpp b/src/erase/pattern.cpp
index 0e510a0..5563661 100644
--- a/src/erase/pattern.cpp
+++ b/src/erase/pattern.cpp
@@ -30,8 +30,11 @@
// static seed defines a fixed prng sequnce so it can be verified later,
// and validated for entropy
uint64_t currentIndex = 0;
+
+ // random number generator seeded with a constant value will
+ // generate a predictable sequence of values NOLINTNEXTLINE
std::minstd_rand0 generator(seed);
- std::array<std::byte, blockSize> randArr;
+ std::array<std::byte, blockSize> randArr{};
ManagedFd fd =
stdplus::fd::open(devPath, stdplus::fd::OpenAccess::WriteOnly);
@@ -65,9 +68,11 @@
{
uint64_t currentIndex = 0;
+ // random number generator seeded with a constant value will
+ // generate a predictable sequence of values NOLINTNEXTLINE
std::minstd_rand0 generator(seed);
- std::array<std::byte, blockSize> randArr;
- std::array<std::byte, blockSize> readArr;
+ std::array<std::byte, blockSize> randArr{};
+ std::array<std::byte, blockSize> readArr{};
ManagedFd fd =
stdplus::fd::open(devPath, stdplus::fd::OpenAccess::ReadOnly);