From d03813c83cf3b34192308f74a29120129d864929 Mon Sep 17 00:00:00 2001 From: pwx1285814 Date: Tue, 2 Jul 2024 18:40:35 +0800 Subject: [PATCH] =?UTF-8?q?cleancode=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: pwx1285814 Change-Id: Ib1c13a6ec527ed42bbf3dd929cac9c133a9dccd1 --- .../native_cpp/screen_sink/src/dscreen_sink_handler.cpp | 4 ++-- .../common/decision_center/src/screen_decision_center.cpp | 4 ++-- .../encoder/src/image_source_encoder.cpp | 4 ++-- .../screensinkprocessor/src/image_sink_decoder_test.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp b/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp index b13d6b77..9c09b2a3 100644 --- a/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp +++ b/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -110,7 +110,7 @@ void DScreenSinkHandler::FinishStartSA(const std::string ¶ms, const sptrAddDeathRecipient(sinkSvrRecipient_); dScreenSinkProxy_ = iface_cast(remoteObject); - if ((dScreenSinkProxy_== nullptr) || (dScreenSinkProxy_->AsObject() == nullptr)) { + if ((dScreenSinkProxy_ == nullptr) || (dScreenSinkProxy_->AsObject() == nullptr)) { DHLOGE("Failed to get dscreen sink proxy."); ReportSaFail(DSCREEN_INIT_FAIL, ERR_DH_SCREEN_SA_SINKPROXY_NOT_INIT, DISTRIBUTED_HARDWARE_SCREEN_SINK_SA_ID, "dscreen sink get proxy failed."); diff --git a/services/common/decision_center/src/screen_decision_center.cpp b/services/common/decision_center/src/screen_decision_center.cpp index 2eae20c6..283c9d9d 100644 --- a/services/common/decision_center/src/screen_decision_center.cpp +++ b/services/common/decision_center/src/screen_decision_center.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -115,7 +115,7 @@ int32_t ScreenDecisionCenter::ConfigureDecisionCenter(std::shared_ptr &surface) { DHLOGI("%{public}s: SetJpegSurface.", DSCREEN_LOG_TAG); - if (surface ==nullptr) { + if (surface == nullptr) { DHLOGE("%{public}s: Jpeg source is null.", DSCREEN_LOG_TAG); return ERR_DH_SCREEN_TRANS_NULL_VALUE; } diff --git a/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp b/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp index 381d35b4..fa17fc66 100644 --- a/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp +++ b/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -58,7 +58,7 @@ void ImageSourceEncoder::InitDscreenDBG() } GetDscreenDBGItfFunc getDscreenDBGItfFunc = (GetDscreenDBGItfFunc)dlsym(pHandler_, GET_DBG_ITF_FUNC.c_str()); GetImageDirtyFunc getImageDirtyFunc = (GetImageDirtyFunc)dlsym(pHandler_, GET_IMAGE_DIRTY_FUNC.c_str()); - if (getDscreenDBGItfFunc == nullptr || getImageDirtyFunc ==nullptr) { + if (getDscreenDBGItfFunc == nullptr || getImageDirtyFunc == nullptr) { DHLOGE("get FUNC failed, failed reason: %{public}s.", dlerror()); return; } diff --git a/services/screentransport/test/unittest/screensinkprocessor/src/image_sink_decoder_test.cpp b/services/screentransport/test/unittest/screensinkprocessor/src/image_sink_decoder_test.cpp index 4b726456..baa3e9ec 100644 --- a/services/screentransport/test/unittest/screensinkprocessor/src/image_sink_decoder_test.cpp +++ b/services/screentransport/test/unittest/screensinkprocessor/src/image_sink_decoder_test.cpp @@ -445,7 +445,7 @@ HWTEST_F(ImageSinkDecoderTest, ProcessData_004, TestSize.Level1) HWTEST_F(ImageSinkDecoderTest, ProcessData_005, TestSize.Level1) { std::shared_ptr buffer = Media::AVSharedMemoryBase::CreateFromLocal(100, - Media::AVSharedMemory::FLAGS_READ_WRITE, "userBuffer");; + Media::AVSharedMemory::FLAGS_READ_WRITE, "userBuffer"); imageDecoder_->availableInputBufferQueue_.push(buffer); std::shared_ptr screenData = std::make_shared(100); int32_t ret = imageDecoder_->ProcessData(screenData, 0); @@ -461,7 +461,7 @@ HWTEST_F(ImageSinkDecoderTest, ProcessData_005, TestSize.Level1) HWTEST_F(ImageSinkDecoderTest, ProcessData_006, TestSize.Level1) { std::shared_ptr buffer = Media::AVSharedMemoryBase::CreateFromLocal(100, - Media::AVSharedMemory::FLAGS_READ_WRITE, "userBuffer");; + Media::AVSharedMemory::FLAGS_READ_WRITE, "userBuffer"); imageDecoder_->availableInputBufferQueue_.push(buffer); std::shared_ptr screenData = std::make_shared(110); int32_t ret = imageDecoder_->ProcessData(screenData, 0); -- Gitee