Cleanup (memory management, STL containers, type safety) based on SonarCloud report (#845)

* Removed static/global variable

* No need for ControllerManager as a singleton

* Updated factory handling

* Replaced loops

* Added const

* Added translations, fixed TODO, simplified operation creation

* Fixed SonarCloud warnings

* Replaced void * by BYTE *

* Added explicit mode_page_datetime struct

* Unit test updates

* Use enum classes

* Upddated file size check

* Use C++ output formatting

* Removed unused code

* Use array for garbage buffer

* Fixed data returned by READ CAPACITY(10)

* For mode pages: Replaced BYTE by std::byte

* Use std::byte for INQUIRY

* Use std::byte for REQUEST SENSE

* Replaced C array by vector

* Replaced C style array

* Replaced BYTE by std::byte

* Replaced DWORD

* Use more byte arreys

* Updated CTapDriver initialization/deletion

* Made status uint32_t instead of DWORD

* Replaced command byte array by vector

* Updated error handling

* Removed obsolete casts

* Improved locality of code

* rw_command has become obsolete

* Dynamically allocate command byte buffer

* Simplified receiving commands

* Use references

* Type safety update, dispatcher update

* Removed macros, replaced BOOL/FALSE/TRUE
This commit is contained in:
Uwe Seimet
2022-09-21 08:27:51 +02:00
committed by GitHub
parent 241e739d3a
commit 119dd55ef0
71 changed files with 1401 additions and 1628 deletions

View File

@@ -14,6 +14,7 @@ TEST(ControllerManagerTest, ControllerManager)
{
const int ID = 4;
const int LUN = 6;
ControllerManager controller_manager;
auto device = device_factory.CreateDevice(UNDEFINED, "services", ID);
device->SetId(ID);