mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Internals: C++11 style cleanups. No functional change.
This commit is contained in:
+3
-3
@@ -236,8 +236,8 @@ void V3Os::createDir(const string& dirname) {
|
||||
}
|
||||
|
||||
void V3Os::unlinkRegexp(const string& dir, const string& regexp) {
|
||||
if (DIR* dirp = opendir(dir.c_str())) {
|
||||
while (struct dirent* direntp = readdir(dirp)) {
|
||||
if (DIR* const dirp = opendir(dir.c_str())) {
|
||||
while (struct dirent* const direntp = readdir(dirp)) {
|
||||
if (VString::wildmatch(direntp->d_name, regexp.c_str())) {
|
||||
const string fullname = dir + "/" + string(direntp->d_name);
|
||||
#if defined(_WIN32) || defined(__MINGW32__)
|
||||
@@ -273,7 +273,7 @@ string V3Os::trueRandom(size_t size) {
|
||||
BCRYPT_USE_SYSTEM_PREFERRED_RNG);
|
||||
if (!BCRYPT_SUCCESS(hr)) v3fatal("Could not acquire random data.");
|
||||
#else
|
||||
std::ifstream is("/dev/urandom", std::ios::in | std::ios::binary);
|
||||
std::ifstream is{"/dev/urandom", std::ios::in | std::ios::binary};
|
||||
// This read uses the size of the buffer.
|
||||
// Flawfinder: ignore
|
||||
if (VL_UNCOVERABLE(!is.read(data, size))) {
|
||||
|
||||
Reference in New Issue
Block a user