From 19ee097f0a422ff2c48cb7a1e44572e21c8a8e73 Mon Sep 17 00:00:00 2001 From: John Zhao Date: Tue, 10 Apr 2018 21:15:00 +0800 Subject: [PATCH] Fix warnings compile with clang --- src/internal/channels.cc | 4 ++-- src/internal/types.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/internal/channels.cc b/src/internal/channels.cc index 21a15da..55b200a 100644 --- a/src/internal/channels.cc +++ b/src/internal/channels.cc @@ -323,8 +323,8 @@ void Channels::XuCamCtrlSet(Option option, std::int32_t value) const { bool Channels::XuHalfDuplexSet(Option option, xu_cmd_t cmd) const { int id = XuHalfDuplexId(option); - std::uint8_t data[3] = {// must be 3 now - static_cast(id & 0xFF), cmd}; + std::uint8_t data[3] = {static_cast(id & 0xFF), + static_cast(cmd)}; if (XuControlQuery(CHANNEL_HALF_DUPLEX, uvc::XU_QUERY_SET, 3, data)) { VLOG(2) << "XuHalfDuplexSet value (0x" << std::hex << std::uppercase << cmd << ") of " << option << " success"; diff --git a/src/internal/types.h b/src/internal/types.h index 82c3994..63306c5 100644 --- a/src/internal/types.h +++ b/src/internal/types.h @@ -172,10 +172,10 @@ struct ImuReqPacket { : header(header), serial_number(serial_number) {} std::array to_data() const { - return {header, static_cast((serial_number >> 24) & 0xFF), - static_cast((serial_number >> 16) & 0xFF), - static_cast((serial_number >> 8) & 0xFF), - static_cast(serial_number & 0xFF)}; + return {{header, static_cast((serial_number >> 24) & 0xFF), + static_cast((serial_number >> 16) & 0xFF), + static_cast((serial_number >> 8) & 0xFF), + static_cast(serial_number & 0xFF)}}; } }; #pragma pack(pop)