Closed Bug 1318335 Opened 9 years ago Closed 8 years ago

Convert some code in ipc/ to C++11

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

defect
Not set
normal

Tracking

(firefox53 fixed)

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: andi, Assigned: andi)

References

Details

Attachments

(4 files)

Using the checkers provided by clang-tidy we can refresh the code to make it use the features of C++11 like: - auto variables declarations - default CTORS and DTORS - using new range loop operators
QA Contact: bpostelnicu
Assignee: nobody → bpostelnicu
Attachment #8811732 - Flags: review?(wmccloskey)
Attachment #8811733 - Flags: review?(wmccloskey)
Attachment #8811734 - Flags: review?(wmccloskey)
Attachment #8811735 - Flags: review?(wmccloskey)
Comment on attachment 8811732 [details] Bug 1318335 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11 in ipc/. https://reviewboard.mozilla.org/r/93732/#review95018 ::: ipc/glue/SharedMemoryBasic_mach.mm:454 (Diff revision 2) > void > SharedMemoryBasic::Shutdown() > { > StaticMutexAutoLock smal(gMutex); > > - for (auto it = gThreads.begin(); it != gThreads.end(); ++it) { > + for (auto& gThread : gThreads) { Local variables shouldn't be named gFoo. Please just call this |thread|. Same for the others below.
Attachment #8811732 - Flags: review?(wmccloskey) → review-
Comment on attachment 8811733 [details] Bug 1318335 - Use auto type specifier where aplicable for variable declarations to improve code readability and maintainability in ipc/. https://reviewboard.mozilla.org/r/93734/#review95020
Attachment #8811733 - Flags: review?(wmccloskey) → review+
Comment on attachment 8811734 [details] Bug 1318335 - Replace default bodies of special member functions with = default; in ipc/. https://reviewboard.mozilla.org/r/93736/#review95022 ::: ipc/glue/BackgroundParentImpl.cpp:402 (Diff revision 2) > } > return NS_OK; > } > > private: > - ~InitUDPSocketParentCallback() {}; > + ~InitUDPSocketParentCallback() = default;; Please remove the extra ;
Attachment #8811734 - Flags: review?(wmccloskey) → review+
Comment on attachment 8811735 [details] Bug 1318335 - Use C++11's override and remove virtual where applicable in ipc/. https://reviewboard.mozilla.org/r/93738/#review95024
Attachment #8811735 - Flags: review?(wmccloskey) → review+
Comment on attachment 8811732 [details] Bug 1318335 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11 in ipc/. https://reviewboard.mozilla.org/r/93732/#review96188
Attachment #8811732 - Flags: review?(wmccloskey) → review+
Pushed by bpostelnicu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/841c964971a8 Converts for(...; ...; ...) loops to use the new range-based loops in C++11 in ipc/. r=billm https://hg.mozilla.org/integration/autoland/rev/d27c040abf57 Use auto type specifier where aplicable for variable declarations to improve code readability and maintainability in ipc/. r=billm https://hg.mozilla.org/integration/autoland/rev/e8582a4033dc Replace default bodies of special member functions with = default; in ipc/. r=billm https://hg.mozilla.org/integration/autoland/rev/6deceff197dc Use C++11's override and remove virtual where applicable in ipc/. r=billm
QA Contact: bpostelnicu
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: