fix code style warnings

Signed-off-by: Gymee <yumeijie@huawei.com>
Change-Id: I7f6290aae5d4728fc80e3b582f6bf31826fc6564
This commit is contained in:
Gymee 2021-09-24 16:03:57 +08:00
parent c098d05193
commit 8afdb9f029
6 changed files with 22 additions and 24 deletions

View File

@ -43,7 +43,6 @@ public:
const std::string& GetDeviceId() const;
int32_t GetDeviceType() const;
int32_t GetDeviceState() const;
bool Marshalling(Parcel& parcel) const override;
private:

View File

@ -44,10 +44,11 @@ int32_t AbilityConnectionWrapperStub::OnRemoteRequest(uint32_t code, MessageParc
HILOGE("AbilityConnectionWrapperStub element is null");
return ERR_INVALID_VALUE;
}
int32_t resultCode = ERR_NONE;
switch (code) {
case IAbilityConnection::ON_ABILITY_CONNECT_DONE: {
if (auto remoteObject = data.ReadParcelable<IRemoteObject>()) {
auto resultCode = data.ReadInt32();
resultCode = data.ReadInt32();
OnAbilityConnectDone(*element, remoteObject, resultCode);
return ERR_NONE;
}
@ -55,7 +56,7 @@ int32_t AbilityConnectionWrapperStub::OnRemoteRequest(uint32_t code, MessageParc
return ERR_INVALID_DATA;
}
case IAbilityConnection::ON_ABILITY_DISCONNECT_DONE: {
auto resultCode = data.ReadInt32();
resultCode = data.ReadInt32();
OnAbilityDisconnectDone(*element, resultCode);
return ERR_NONE;
}

View File

@ -137,7 +137,6 @@ bool DnetworkAdapter::AddDeviceChangeListener(const std::shared_ptr<DeviceListen
}
HILOGI("AddDeviceChangeListener %{public}s", (errCode == ERR_OK) ? "success" : "timeout");
};
if (!dnetworkHandler_->PostTask(registerTask)) {
HILOGE("AddDeviceChangeListener post task failed");
return false;

View File

@ -731,7 +731,7 @@ void DistributedSchedService::ProcessConnectDied(const sptr<IRemoteObject>& conn
}
DecreaseConnectLocked(callerInfo.uid);
if (itConnect->first != nullptr) {
itConnect->first ->RemoveDeathRecipient(connectDeathRecipient_);
itConnect->first->RemoveDeathRecipient(connectDeathRecipient_);
}
distributedConnectAbilityMap_.erase(itConnect++);
} else {

View File

@ -57,7 +57,6 @@ bool DtbschedmgrDeviceInfoStorage::Init()
std::this_thread::sleep_for(1s);
}
};
if (!initHandler_->PostTask(func)) {
HILOGE("DtbschedmgrDeviceInfoStorage::Init handler postTask failed");
return false;

View File

@ -18,27 +18,27 @@
namespace OHOS {
namespace DistributedSchedule {
#define DECLARE_SINGLE_INSTANCE_BASE(className) \
public: \
static className& GetInstance(); \
private: \
className(const className&) = delete; \
className& operator= (const className&) = delete;\
className(className&&) = delete; \
className& operator= (className&&) = delete; \
#define DECLARE_SINGLE_INSTANCE_BASE(className) \
public: \
static className& GetInstance(); \
private: \
className(const className&) = delete; \
className& operator= (const className&) = delete; \
className(className&&) = delete; \
className& operator= (className&&) = delete; \
#define DECLARE_SINGLE_INSTANCE(className) \
DECLARE_SINGLE_INSTANCE_BASE(className)\
private: \
className() = default; \
~className() = default; \
#define DECLARE_SINGLE_INSTANCE(className) \
DECLARE_SINGLE_INSTANCE_BASE(className) \
private: \
className() = default; \
~className() = default; \
#define IMPLEMENT_SINGLE_INSTANCE(className)\
className& className::GetInstance() \
{ \
static auto instance = new className(); \
return *instance; \
#define IMPLEMENT_SINGLE_INSTANCE(className) \
className& className::GetInstance() \
{ \
static auto instance = new className(); \
return *instance; \
}
}; // namespace DistributedSchedule
}; // namespace OHOS