From bfa51483d6dcfb56b5b604a15b0136d578735136 Mon Sep 17 00:00:00 2001 From: XUranus <2257238649wdx@gmail.com> Date: Fri, 3 Nov 2023 12:08:41 +0800 Subject: [PATCH] code lint --- include/common/BlockingQueue.h | 2 +- src/native/TaskResourceManager.cpp | 5 ++--- src/native/win32/Win32RawIO.cpp | 2 +- src/task/VolumeBlockReader.cpp | 2 +- src/task/VolumeProtectTaskContext.cpp | 8 ++++---- test/VolumeBackupTest.cpp | 1 + 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/common/BlockingQueue.h b/include/common/BlockingQueue.h index 502bb9c..8cc90cd 100644 --- a/include/common/BlockingQueue.h +++ b/include/common/BlockingQueue.h @@ -46,7 +46,7 @@ class BlockingQueue { template BlockingQueue::BlockingQueue(std::size_t maxSize) - : m_finished(false), m_maxSize(maxSize) + : m_finished(false), m_maxSize(maxSize) {} /** diff --git a/src/native/TaskResourceManager.cpp b/src/native/TaskResourceManager.cpp index bada1ba..079f949 100644 --- a/src/native/TaskResourceManager.cpp +++ b/src/native/TaskResourceManager.cpp @@ -77,7 +77,6 @@ static bool CreateFragmentBinaryBackupCopy( static bool FragmentBinaryBackupCopyExists(std::vector fragmentFiles) { for (const std::string& fragmentFile : fragmentFiles) { - ErrCodeType errorCode = 0; if (!fsapi::IsFileExists(fragmentFile)) { INFOLOG("fragment binary file %s not exists", fragmentFile.c_str()); return false; @@ -222,9 +221,9 @@ bool TaskResourceManager::DetachCopyResource() // implement BackupTaskResourceManager... BackupTaskResourceManager::BackupTaskResourceManager(const BackupTaskResourceManagerParams& param) : TaskResourceManager(param.copyFormat, param.copyDataDirPath, param.copyName), + m_backupType(param.backupType), m_volumeSize(param.volumeSize), - m_maxSessionSize(param.maxSessionSize), - m_backupType(param.backupType) + m_maxSessionSize(param.maxSessionSize) {}; BackupTaskResourceManager::~BackupTaskResourceManager() diff --git a/src/native/win32/Win32RawIO.cpp b/src/native/win32/Win32RawIO.cpp index 394748b..b2d2399 100644 --- a/src/native/win32/Win32RawIO.cpp +++ b/src/native/win32/Win32RawIO.cpp @@ -693,7 +693,7 @@ bool rawio::win32::GetVirtualDiskPhysicalDrivePath( } opStatus = ::GetVirtualDiskPhysicalPath(hVirtualDiskFile, &wPhysicalDriveNameLength, wPhysicalDriveName); - if(opStatus != ERROR_SUCCESS) { // Unable to retrieve virtual disk path + if (opStatus != ERROR_SUCCESS) { // Unable to retrieve virtual disk path errorCode = opStatus; ::CloseHandle(hVirtualDiskFile); return false; diff --git a/src/task/VolumeBlockReader.cpp b/src/task/VolumeBlockReader.cpp index 0841fa4..42dfad1 100644 --- a/src/task/VolumeBlockReader.cpp +++ b/src/task/VolumeBlockReader.cpp @@ -103,7 +103,7 @@ VolumeBlockReader::~VolumeBlockReader() } VolumeBlockReader::VolumeBlockReader(const VolumeBlockReaderParam& param) - : m_sourceType(param.sourceType), + : m_sourceType(param.sourceType), m_sourcePath(param.sourcePath), m_baseOffset(param.sourceOffset), m_sharedConfig(param.sharedConfig), diff --git a/src/task/VolumeProtectTaskContext.cpp b/src/task/VolumeProtectTaskContext.cpp index 010ff60..f2f882b 100644 --- a/src/task/VolumeProtectTaskContext.cpp +++ b/src/task/VolumeProtectTaskContext.cpp @@ -300,9 +300,9 @@ std::shared_ptr CheckpointSnapshot::LoadFrom(const std::stri } auto checkpointSnapshot = std::make_shared(bitmapBytes); uint64_t offset = 0; - memcpy(checkpointSnapshot->processedBitmapBuffer, buffer + offset, sizeof(uint8_t) * bitmapBytes); + memcpy(checkpointSnapshot->processedBitmapBuffer,buffer + offset, sizeof(uint8_t) * bitmapBytes); offset += bitmapBytes; - memcpy(checkpointSnapshot->writtenBitmapBuffer, buffer + offset , sizeof(uint8_t) * bitmapBytes); + memcpy(checkpointSnapshot->writtenBitmapBuffer,buffer + offset, sizeof(uint8_t) * bitmapBytes); delete[] buffer; return checkpointSnapshot; } @@ -472,9 +472,9 @@ bool VolumeTaskCheckpointTrait::RestoreSessionBitmap(std::shared_ptrsharedContext->processedBitmap = std::make_shared( - checkpointSnapshot->processedBitmapBuffer , checkpointSnapshot->bitmapBufferBytesLength); + checkpointSnapshot->processedBitmapBuffer ,checkpointSnapshot->bitmapBufferBytesLength); session->sharedContext->writtenBitmap = std::make_shared( - checkpointSnapshot->writtenBitmapBuffer , checkpointSnapshot->bitmapBufferBytesLength); + checkpointSnapshot->writtenBitmapBuffer ,checkpointSnapshot->bitmapBufferBytesLength); checkpointSnapshot->writtenBitmapBuffer = nullptr; checkpointSnapshot->processedBitmapBuffer = nullptr; DBGLOG("restore session bitmap from %s success", checkpointFilePath.c_str()); diff --git a/test/VolumeBackupTest.cpp b/test/VolumeBackupTest.cpp index c495a9a..6fc4c96 100644 --- a/test/VolumeBackupTest.cpp +++ b/test/VolumeBackupTest.cpp @@ -28,6 +28,7 @@ using namespace ::testing; using namespace volumeprotect; +using namespace volumeprotect::task; namespace { constexpr auto DEFAULT_MOCK_SESSION_BLOCK_SIZE = 4LLU * ONE_MB;