fix build warning

Signed-off-by:gudehe<gudehe@huawei.com>
This commit is contained in:
gudehe 2021-12-09 11:44:37 +08:00
parent f62d406d38
commit d7504bcfca
13 changed files with 58 additions and 38 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
.vscode

View File

@ -16,7 +16,7 @@
#ifndef OHOS_STORAGE_DAEMON_DISK_MANAGER_H
#define OHOS_STORAGE_DAEMON_DISK_MANAGER_H
#include "nocopyable.h"
#include "utils/nocopyable.h"
namespace OHOS {
namespace StorageDaemon {

View File

@ -16,13 +16,11 @@
#ifndef OHOS_STORAGE_DAEMON_ISTORAGE_DAEMON_H
#define OHOS_STORAGE_DAEMON_ISTORAGE_DAEMON_H
#include <string>
#include "iremote_broker.h"
#include <string>
namespace OHOS {
namespace StorageDaemon {
using namespace std;
class IStorageDaemon : public IRemoteBroker {
public:
enum {
@ -34,17 +32,17 @@ public:
FORMAT,
ADD_USER,
DEL_USER,
REMOVE_USER,
PREPARE_USER_DIRS,
DESTROY_USER_DIRS,
};
virtual int32_t Shutdown();
virtual int32_t Mount(string volId, uint32_t flags);
virtual int32_t UMount(string volId);
virtual int32_t Check(string volId);
virtual int32_t Format(string voldId);
virtual int32_t Mount(std::string volId, uint32_t flags);
virtual int32_t UMount(std::string volId);
virtual int32_t Check(std::string volId);
virtual int32_t Format(std::string voldId);
virtual int32_t AddUser(int32_t userId);
virtual int32_t RemoveUser(int32_t userId);

View File

@ -17,7 +17,6 @@
#define OHOS_STORAGE_DAEMON_STORAGE_DAEMON_H
#include "ipc/storage_daemon_stub.h"
#include "utils/errno.h"
namespace OHOS {
namespace StorageDaemon {
@ -25,10 +24,10 @@ class StorageDaemon : StorageDaemonStub {
public:
virtual int32_t Shutdown() override;
virtual int32_t Mount(string volId, uint32_t flags) override;
virtual int32_t UMount(string volId) override;
virtual int32_t Check(string volId) override;
virtual int32_t Format(string voldId) override;
virtual int32_t Mount(std::string volId, uint32_t flags) override;
virtual int32_t UMount(std::string volId) override;
virtual int32_t Check(std::string volId) override;
virtual int32_t Format(std::string voldId) override;
virtual int32_t AddUser(int32_t userId) override;
virtual int32_t RemoveUser(int32_t userId) override;

View File

@ -26,10 +26,10 @@ public:
StorageDaemonProxy(const sptr<IRemoteObject> &impl);
virtual int32_t Shutdown() override;
virtual int32_t Mount(string volId, uint32_t flags) override;
virtual int32_t UMount(string volId) override;
virtual int32_t Check(string volId) override;
virtual int32_t Format(string voldId) override;
virtual int32_t Mount(std::string volId, uint32_t flags) override;
virtual int32_t UMount(std::string volId) override;
virtual int32_t Check(std::string volId) override;
virtual int32_t Format(std::string voldId) override;
virtual int32_t AddUser(int32_t userId) override;
virtual int32_t RemoveUser(int32_t userId) override;

View File

@ -16,7 +16,7 @@
#ifndef OHOS_STORAGE_DAEMON_NETLINK_MANAGER_H
#define OHOS_STORAGE_DAEMON_NETLINK_MANAGER_H
#include "nocopyable.h"
#include "utils/nocopyable.h"
namespace OHOS {
namespace StorageDaemon {

View File

@ -19,13 +19,7 @@
#include <unordered_map>
#include "user/user_info.h"
#include "nocopyable.h"
#define DISABLE_COPY_ASSIGN_MOVE(ClassName) \
ClassName(const ClassName &) = delete; \
ClassName(ClassName &&) = delete; \
ClassName& operator=(const ClassName &) = delete; \
ClassName& operator=(ClassName &&) = delete
#include "utils/nocopyable.h"
namespace OHOS {
namespace StorageDaemon {

View File

@ -0,0 +1,27 @@
/*
* Copyright (c) 2021 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef STORAGE_DAEMON_UTILS_NO_COPYABLE_H
#define STORAGE_DAEMON_UTILS_NO_COPYABLE_H
namespace OHOS {
namespace StorageDaemon {
#define DISABLE_COPY_ASSIGN_MOVE(ClassName) \
ClassName(const ClassName &) = delete; \
ClassName(ClassName &&) = delete; \
ClassName& operator=(const ClassName &) = delete; \
ClassName& operator=(ClassName &&) = delete
} // STORAGE_DAEMON
} // OHOS
#endif // STORAGE_DAEMON_UTILS_NO_COPYABLE_H

View File

@ -16,7 +16,7 @@
#ifndef OHOS_STORAGE_DAEMON_VOLUME_MANAGER_H
#define OHOS_STORAGE_DAEMON_VOLUME_MANAGER_H
#include "nocopyable.h"
#include "utils/nocopyable.h"
namespace OHOS {
namespace StorageDaemon {

View File

@ -15,6 +15,7 @@
#include "ipc/storage_daemon.h"
#include "user/user_manager.h"
#include "utils/errno.h"
namespace OHOS {
namespace StorageDaemon {
@ -25,22 +26,22 @@ int32_t Shutdown()
return E_OK;
}
int32_t Mount(string volId)
int32_t Mount(std::string volId)
{
return E_OK;
}
int32_t UMount(string volId)
int32_t UMount(std::string volId)
{
return E_OK;
}
int32_t Check(string volId)
int32_t Check(std::string volId)
{
return E_OK;
}
int32_t Format(string voldId)
int32_t Format(std::string voldId)
{
return E_OK;
}

View File

@ -32,22 +32,22 @@ int32_t StorageDaemonProxy::Shutdown()
return Remote()->SendRequest(SHUTDOWN, data, reply, option);
}
int32_t StorageDaemonProxy::Mount(string volId, uint32_t flags)
int32_t StorageDaemonProxy::Mount(std::string volId, uint32_t flags)
{
return E_OK;
}
int32_t StorageDaemonProxy::UMount(string volId)
int32_t StorageDaemonProxy::UMount(std::string volId)
{
return E_OK;
}
int32_t StorageDaemonProxy::Check(string volId)
int32_t StorageDaemonProxy::Check(std::string volId)
{
return E_OK;
}
int32_t StorageDaemonProxy::Format(string voldId)
int32_t StorageDaemonProxy::Format(std::string voldId)
{
return E_OK;
}
@ -81,7 +81,7 @@ int32_t StorageDaemonProxy::RemoveUser(int32_t userId)
if (!data.WriteInt32(userId)) {
return E_IPC_ERROR;
}
int err = Remote()->SendRequest(DEL_USER, data, reply, option);
int err = Remote()->SendRequest(REMOVE_USER, data, reply, option);
if (err != E_OK) {
return E_IPC_ERROR;
}

View File

@ -32,7 +32,7 @@ int32_t StorageDaemonStub::OnRemoteRequest(uint32_t code, MessageParcel &data,
case SHUTDOWN: err = HandleShutdown(); break;
case ADD_USER: err = HandleAddUser(data, reply); break;
case DEL_USER: err = HandleRemoveUser(data, reply); break;
case REMOVE_USER: err = HandleRemoveUser(data, reply); break;
case PREPARE_USER_DIRS: err = HandlePrepareUserDirs(data, reply); break;
case DESTROY_USER_DIRS: err = HandleDestroyUserDirs(data, reply); break;
default: {