From 10834d52a982dfb2bfca561d87107aec6ca377ab Mon Sep 17 00:00:00 2001 From: Barret Rennie Date: Wed, 9 Dec 2020 04:31:55 +0000 Subject: [PATCH] Bug 1677000 - Address unpublished clang-tidy lints r=Gijs There are two new lints introduced since IOUtils was written that we're hitting now: * IOUtils::InternalFileInfo's constructor does not initialize `mType`, `mSize`, `mLastModified`, and `mPermissions`; and * We should be using a nested namespace statement. We haven't hit them since these lines haven't been touched, but I noticed them on the code review frontend. Differential Revision: https://phabricator.services.mozilla.com/D99163 --- dom/system/IOUtils.cpp | 6 ++---- dom/system/IOUtils.h | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dom/system/IOUtils.cpp b/dom/system/IOUtils.cpp index cbc7f49c2a01..425f1832e9dd 100644 --- a/dom/system/IOUtils.cpp +++ b/dom/system/IOUtils.cpp @@ -59,8 +59,7 @@ } \ } while (0) -namespace mozilla { -namespace dom { +namespace mozilla::dom { // static helper functions @@ -1417,8 +1416,7 @@ IOUtils::InternalWriteOpts::FromBinding(const WriteOptions& aOptions) { return opts; } -} // namespace dom -} // namespace mozilla +} // namespace mozilla::dom #undef REJECT_IF_SHUTTING_DOWN #undef REJECT_IF_INIT_PATH_FAILED diff --git a/dom/system/IOUtils.h b/dom/system/IOUtils.h index 3502eecad134..368ba8ea5dd0 100644 --- a/dom/system/IOUtils.h +++ b/dom/system/IOUtils.h @@ -407,11 +407,11 @@ class IOUtils::IOError { */ struct IOUtils::InternalFileInfo { nsString mPath; - FileType mType; - uint64_t mSize; - uint64_t mLastModified; + FileType mType = FileType::Other; + uint64_t mSize = 0; + uint64_t mLastModified = 0; Maybe mCreationTime; - uint32_t mPermissions; + uint32_t mPermissions = 0; }; /**