Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Commit

Permalink
Fix new clang-tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mkow committed May 9, 2018
1 parent 214da39 commit 392f9fc
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 46 deletions.
6 changes: 3 additions & 3 deletions include/client/dbif.h
Expand Up @@ -68,7 +68,7 @@ struct ChunkDataItemQuery {
ChunkDataItemQuery(uint64_t children_qid, uint64_t data_items_qid,
const QPointer<dbif::InfoPromise>& promise,
const data::NodeID& id, bool sub);
typedef std::map<data::NodeID, std::shared_ptr<proto::Node>> ChildrenMap;
using ChildrenMap = std::map<data::NodeID, std::shared_ptr<proto::Node>>;

bool ready();

Expand All @@ -92,8 +92,8 @@ class NCWrapper : public QObject {
Q_OBJECT

public:
typedef std::map<data::NodeID, NCObjectHandle> ChildrenMap;
typedef void (NCWrapper::*MessageHandler)(const msg_ptr&);
using ChildrenMap = std::map<data::NodeID, NCObjectHandle>;
using MessageHandler = void (NCWrapper::*)(const msg_ptr&);

explicit NCWrapper(NetworkClient* network_client, QObject* parent = nullptr);
static dbif::ObjectType typeFromTags(
Expand Down
6 changes: 3 additions & 3 deletions include/client/networkclient.h
Expand Up @@ -40,8 +40,8 @@ const QString SCHEME_SSL("veles+ssl");

class NodeTree;

typedef std::pair<bool, std::shared_ptr<std::string>> pair_str;
typedef std::shared_ptr<proto::MsgpackMsg> msg_ptr;
using pair_str = std::pair<bool, std::shared_ptr<std::string>>;
using msg_ptr = std::shared_ptr<proto::MsgpackMsg>;

/*****************************************************************************/
/* NetworkClient */
Expand Down Expand Up @@ -92,7 +92,7 @@ class NetworkClient : public QObject {
virtual void handleBroadcastRunMessage(const msg_ptr& msg);
virtual void handlePluginHandlerUnregisteredMessage(const msg_ptr& msg);

typedef void (NetworkClient::*MessageHandler)(const msg_ptr&);
using MessageHandler = void (NetworkClient::*)(const msg_ptr&);

signals:
void connectionStatusChanged(ConnectionStatus connection_status);
Expand Down
2 changes: 1 addition & 1 deletion include/client/node.h
Expand Up @@ -35,7 +35,7 @@ namespace client {
class NodeTree;
class NetworkClient;

typedef std::set<std::string> Tags;
using Tags = std::set<std::string>;

/*****************************************************************************/
/* Node */
Expand Down
2 changes: 1 addition & 1 deletion include/client/nodetree.h
Expand Up @@ -24,7 +24,7 @@
namespace veles {
namespace client {

typedef std::shared_ptr<proto::MsgpackMsg> msg_ptr;
using msg_ptr = std::shared_ptr<proto::MsgpackMsg>;

/*****************************************************************************/
/* NodeTree */
Expand Down
2 changes: 1 addition & 1 deletion include/data/types.h
Expand Up @@ -22,7 +22,7 @@ namespace veles {

namespace dbif {
class ObjectHandleBase;
typedef QSharedPointer<ObjectHandleBase> ObjectHandle;
using ObjectHandle = QSharedPointer<ObjectHandleBase>;
} // namespace dbif

namespace data {
Expand Down
10 changes: 5 additions & 5 deletions include/dbif/info.h
Expand Up @@ -44,27 +44,27 @@ struct BlobDataReply;
struct ChunkDataReply;

struct DescriptionRequest : InfoRequest {
typedef DescriptionReply ReplyType;
using ReplyType = DescriptionReply;
};

struct ChildrenRequest : InfoRequest {
typedef ChildrenReply ReplyType;
using ReplyType = ChildrenReply;
};

struct ParsersListRequest : InfoRequest {
typedef ParsersListReply ReplyType;
using ReplyType = ParsersListReply;
};

struct BlobDataRequest : InfoRequest {
const uint64_t start;
const uint64_t end;
explicit BlobDataRequest(uint64_t start, uint64_t end)
: start(start), end(end) {}
typedef BlobDataReply ReplyType;
using ReplyType = BlobDataReply;
};

struct ChunkDataRequest : InfoRequest {
typedef ChunkDataReply ReplyType;
using ReplyType = ChunkDataReply;
};

// Replies
Expand Down
20 changes: 10 additions & 10 deletions include/dbif/method.h
Expand Up @@ -50,7 +50,7 @@ struct RootCreateFileBlobFromDataRequest : MethodRequest {
explicit RootCreateFileBlobFromDataRequest(data::BinData&& data,
const QString& path)
: data(data), path(path) {}
typedef CreatedReply ReplyType;
using ReplyType = CreatedReply;
};

struct ChunkCreateRequest : MethodRequest {
Expand All @@ -67,7 +67,7 @@ struct ChunkCreateRequest : MethodRequest {
parent_chunk(parent_chunk),
start(start),
end(end) {}
typedef CreatedReply ReplyType;
using ReplyType = CreatedReply;
};

struct ChunkCreateSubBlobRequest : MethodRequest {
Expand All @@ -78,23 +78,23 @@ struct ChunkCreateSubBlobRequest : MethodRequest {
: data(data), name(name) {}
explicit ChunkCreateSubBlobRequest(data::BinData&& data, const QString& name)
: data(data), name(name) {}
typedef CreatedReply ReplyType;
using ReplyType = CreatedReply;
};

struct DeleteRequest : MethodRequest {
typedef NullReply ReplyType;
using ReplyType = NullReply;
};

struct SetNameRequest : MethodRequest {
QString name;
explicit SetNameRequest(const QString& name) : name(name) {}
typedef NullReply ReplyType;
using ReplyType = NullReply;
};

struct SetCommentRequest : MethodRequest {
QString comment;
explicit SetCommentRequest(const QString& comment) : comment(comment) {}
typedef NullReply ReplyType;
using ReplyType = NullReply;
};

struct ChangeDataRequest : MethodRequest {
Expand All @@ -105,15 +105,15 @@ struct ChangeDataRequest : MethodRequest {
: start(start), end(end), data(data) {}
ChangeDataRequest(uint64_t start, uint64_t end, data::BinData&& data)
: start(start), end(end), data(data) {}
typedef NullReply ReplyType;
using ReplyType = NullReply;
};

struct SetChunkBoundsRequest : MethodRequest {
const uint64_t start;
const uint64_t end;
explicit SetChunkBoundsRequest(uint64_t start, uint64_t end)
: start(start), end(end) {}
typedef NullReply ReplyType;
using ReplyType = NullReply;
};

struct SetChunkParseRequest : MethodRequest {
Expand All @@ -123,7 +123,7 @@ struct SetChunkParseRequest : MethodRequest {
SetChunkParseRequest(uint64_t start, uint64_t end,
std::vector<data::ChunkDataItem> items)
: start(start), end(end), items(items) {}
typedef NullReply ReplyType;
using ReplyType = NullReply;
};

struct BlobParseRequest : MethodRequest {
Expand All @@ -133,7 +133,7 @@ struct BlobParseRequest : MethodRequest {
explicit BlobParseRequest(QString parser_id = "", uint64_t start = 0,
ObjectHandle parent_chunk = ObjectHandle())
: parser_id(parser_id), start(start), parent_chunk(parent_chunk) {}
typedef NullReply ReplyType;
using ReplyType = NullReply;
};

// Replies
Expand Down
10 changes: 5 additions & 5 deletions include/dbif/types.h
Expand Up @@ -30,11 +30,11 @@ struct MethodReply;
struct Error;
class InfoPromise;
class MethodResultPromise;
typedef QSharedPointer<InfoRequest> PInfoRequest;
typedef QSharedPointer<InfoReply> PInfoReply;
typedef QSharedPointer<MethodRequest> PMethodRequest;
typedef QSharedPointer<MethodReply> PMethodReply;
typedef QSharedPointer<Error> PError;
using PInfoRequest = QSharedPointer<InfoRequest>;
using PInfoReply = QSharedPointer<InfoReply>;
using PMethodRequest = QSharedPointer<MethodRequest>;
using PMethodReply = QSharedPointer<MethodReply>;
using PError = QSharedPointer<Error>;

enum ObjectType {
ROOT,
Expand Down
2 changes: 1 addition & 1 deletion include/util/concurrency/threadpool.h
Expand Up @@ -28,7 +28,7 @@ namespace threadpool {
* topics (worker groups).
*/

typedef std::function<void()> Task;
using Task = std::function<void()>;

enum class SchedulingResult {
SCHEDULED,
Expand Down
8 changes: 4 additions & 4 deletions include/util/sampling/isampler.h
Expand Up @@ -29,10 +29,10 @@
namespace veles {
namespace util {

typedef std::recursive_mutex SamplerMutex;
typedef std::condition_variable_any SamplerConditionVariable;
typedef std::function<void()> ResampleCallback;
typedef int ResampleCallbackId;
using SamplerMutex = std::recursive_mutex;
using SamplerConditionVariable = std::condition_variable_any;
using ResampleCallback = std::function<void()>;
using ResampleCallbackId = int;

/**
* Abstract interface for Sampler classes.
Expand Down
2 changes: 1 addition & 1 deletion include/visualization/base.h
Expand Up @@ -52,7 +52,7 @@ class VisualizationWidget : public QOpenGLWidget,
struct AdditionalResampleData {
virtual ~AdditionalResampleData() {}
};
typedef std::shared_ptr<AdditionalResampleData> AdditionalResampleDataPtr;
using AdditionalResampleDataPtr = std::shared_ptr<AdditionalResampleData>;

void refreshVisualization(
const AdditionalResampleDataPtr& ad = AdditionalResampleDataPtr());
Expand Down
2 changes: 1 addition & 1 deletion src/client/networkclient.cc
Expand Up @@ -500,7 +500,7 @@ void NetworkClient::newDataAvailable() {
}
}

void NetworkClient::socketError(QAbstractSocket::SocketError socketError) {
void NetworkClient::socketError(QAbstractSocket::SocketError /*socketError*/) {
setConnectionStatus(ConnectionStatus::NotConnected);
if (output() != nullptr && client_socket_ != nullptr) {
*output() << "NetworkClient: Socket error - "
Expand Down
4 changes: 2 additions & 2 deletions src/client/nodetree.cc
Expand Up @@ -30,9 +30,9 @@ namespace client {
/* NodeTree */
/*****************************************************************************/

NodeTree::NodeTree(NetworkClient* network_client) {}
NodeTree::NodeTree(NetworkClient* /*network_client*/) {}

void NodeTree::addRemoteNodeTreeRelatedMessage(const msg_ptr& msg) {}
void NodeTree::addRemoteNodeTreeRelatedMessage(const msg_ptr& /*msg*/) {}

} // namespace client
} // namespace veles
2 changes: 1 addition & 1 deletion src/ui/dialogs/gotoaddressdialog.cc
Expand Up @@ -53,7 +53,7 @@ void GoToAddressDialog::formatChanged(const QString& format) {

qint64 GoToAddressDialog::address() { return ui_->addrValue->value(); }

void GoToAddressDialog::showEvent(QShowEvent* event) {
void GoToAddressDialog::showEvent(QShowEvent* /*event*/) {
ui_->addrValue->setFocus(Qt::OtherFocusReason);
}

Expand Down
2 changes: 1 addition & 1 deletion src/ui/dialogs/searchdialog.cc
Expand Up @@ -227,7 +227,7 @@ qint64 SearchDialog::findPrevious(bool include_overlapping, bool interactive) {
return idx;
}

void SearchDialog::showEvent(QShowEvent* event) {
void SearchDialog::showEvent(QShowEvent* /*event*/) {
ui->cbFind->setFocus(Qt::OtherFocusReason);
}

Expand Down
8 changes: 4 additions & 4 deletions src/ui/dockwidget_native.cc
Expand Up @@ -31,7 +31,7 @@ namespace ui {
#include <windows.h>
#include <winuser.h>

void stopTabBarDragging(QTabBar* object) {
void stopTabBarDragging(QTabBar* /*object*/) {
INPUT event;
event.type = INPUT_MOUSE;
event.mi.dx = 0;
Expand All @@ -42,7 +42,7 @@ void stopTabBarDragging(QTabBar* object) {
SendInput(1, &event, sizeof(INPUT));
}

void startDockDragging(QDockWidget* object) {
void startDockDragging(QDockWidget* /*object*/) {
INPUT event;
event.type = INPUT_MOUSE;
event.mi.dx = 0;
Expand All @@ -59,8 +59,8 @@ void startDockDragging(QDockWidget* object) {
/* Other platforms - not supported yet... */
/*****************************************************************************/

void stopTabBarDragging(QTabBar* object) {}
void startDockDragging(QDockWidget* object) {}
void stopTabBarDragging(QTabBar* /*object*/) {}
void startDockDragging(QDockWidget* /*object*/) {}

#endif

Expand Down
2 changes: 1 addition & 1 deletion src/visualization/minimap_panel.cc
Expand Up @@ -28,7 +28,7 @@ namespace visualization {

const float k_minimum_auto_selection_size = 0.1f;

typedef VisualizationMinimap::MinimapMode MinimapMode;
using MinimapMode = VisualizationMinimap::MinimapMode;

MinimapPanel::MinimapPanel(QWidget* parent)
: QWidget(parent), select_range_dialog_(new SelectRangeDialog(this)) {
Expand Down
2 changes: 1 addition & 1 deletion src/visualization/panel.cc
Expand Up @@ -46,7 +46,7 @@ const std::map<QString, VisualizationPanel::ESampler>

VisualizationPanel::VisualizationPanel(
ui::MainWindowWithDetachableDockWidgets* main_window,
const QSharedPointer<ui::FileBlobModel>& data_model, QWidget* parent)
const QSharedPointer<ui::FileBlobModel>& data_model, QWidget* /*parent*/)
: veles::ui::IconAwareView("Visualization", ":/images/trigram_icon.png"),
sampler_type_(k_default_sampler),
visualization_type_(k_default_visualization),
Expand Down

0 comments on commit 392f9fc

Please sign in to comment.