Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Swiftb0y <[email protected]>
  • Loading branch information
acolombier and Swiftb0y authored Oct 10, 2024
1 parent 6aa11ac commit 1c2e7bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/controllers/bulk/bulkcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#include "util/trace.h"

namespace {
constexpr int kBulkSendTimeout = 5000; // In milliseconds
using namespace std::literals;
constexpr std::seconds kBulkSendTimeout = 5s;

Check failure on line 14 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04

‘seconds’ in namespace ‘std’ does not name a type; did you mean ‘ends’?

Check failure on line 14 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / macOS 12 x64

no type named 'seconds' in namespace 'std'; did you mean 'std::chrono::seconds'?

Check failure on line 14 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / macOS 12 arm64

no type named 'seconds' in namespace 'std'; did you mean 'std::chrono::seconds'?

Check failure on line 14 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / coverage

‘seconds’ in namespace ‘std’ does not name a type; did you mean ‘ends’?

Check failure on line 14 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'seconds': is not a member of 'std'

Check failure on line 14 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

missing type specifier - int assumed. Note: C++ does not support default-int

Check failure on line 14 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'`anonymous-namespace'::seconds': constexpr object must be initialized

Check failure on line 14 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'`anonymous-namespace'::seconds': constexpr object must be initialized

Check failure on line 14 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

syntax error: missing ';' before identifier 'kBulkSendTimeout'

Check failure on line 14 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

missing type specifier - int assumed. Note: C++ does not support default-int

Check failure on line 14 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'initializing': cannot convert from 'std::chrono::seconds' to 'int'
}

BulkReader::BulkReader(libusb_device_handle *handle, unsigned char in_epaddr)
Expand Down Expand Up @@ -304,11 +305,10 @@ void BulkController::sendBytes(const QByteArray& data) {
(unsigned char*)data.constData(),
data.size(),
&transferred,
kBulkSendTimeout);
std::milliseconds(kBulkSendTimeout).count();

Check failure on line 308 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04

‘milliseconds’ is not a member of ‘std’; did you mean ‘std::chrono::milliseconds’?

Check failure on line 308 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04

‘kBulkSendTimeout’ was not declared in this scope

Check failure on line 308 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / macOS 12 x64

no member named 'milliseconds' in namespace 'std'

Check failure on line 308 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / macOS 12 arm64

no member named 'milliseconds' in namespace 'std'

Check failure on line 308 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / coverage

‘milliseconds’ is not a member of ‘std’; did you mean ‘std::chrono::milliseconds’?

Check failure on line 308 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / coverage

‘kBulkSendTimeout’ was not declared in this scope

Check failure on line 308 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'milliseconds': is not a member of 'std'

Check failure on line 308 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'milliseconds': identifier not found

Check failure on line 308 in src/controllers/bulk/bulkcontroller.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

syntax error: missing ')' before ';'
if (ret < 0) {
qCWarning(m_logOutput) << "Unable to send data to" << getName()
<< "serial #" << m_sUID << "-" << libusb_error_name(ret);
;
} else if (CmdlineArgs::Instance().getControllerDebug()) {
qCDebug(m_logOutput) << transferred << "bytes sent to" << getName()
<< "serial #" << m_sUID;
Expand Down

0 comments on commit 1c2e7bc

Please sign in to comment.