Internals: C++11 style cleanups. No functional change.

This commit is contained in:
Wilson Snyder
2021-07-11 18:42:01 -04:00
parent 5ad3c4e499
commit 8ecdc85cf7
91 changed files with 300 additions and 294 deletions
+3 -3
View File
@@ -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))) {