diff --git a/cscore/src/main/native/linux/NetworkListener.cpp b/cscore/src/main/native/linux/NetworkListener.cpp index ed3d966589..1cfc6cea17 100644 --- a/cscore/src/main/native/linux/NetworkListener.cpp +++ b/cscore/src/main/native/linux/NetworkListener.cpp @@ -132,8 +132,9 @@ void NetworkListener::Impl::Thread::Main() { break; // XXX: is this the right thing to do here? } if (len == 0) continue; // EOF? + unsigned int ulen = static_cast(len); for (struct nlmsghdr* nh = reinterpret_cast(buf); - NLMSG_OK(nh, len); nh = NLMSG_NEXT(nh, len)) { + NLMSG_OK(nh, ulen); nh = NLMSG_NEXT(nh, ulen)) { if (nh->nlmsg_type == NLMSG_DONE) break; if (nh->nlmsg_type == RTM_NEWLINK || nh->nlmsg_type == RTM_DELLINK || nh->nlmsg_type == RTM_NEWADDR || nh->nlmsg_type == RTM_DELADDR) { diff --git a/cscore/src/main/native/linux/UsbCameraImpl.cpp b/cscore/src/main/native/linux/UsbCameraImpl.cpp index 9b54a00abb..4cd55f90bb 100644 --- a/cscore/src/main/native/linux/UsbCameraImpl.cpp +++ b/cscore/src/main/native/linux/UsbCameraImpl.cpp @@ -448,7 +448,7 @@ void UsbCameraImpl::DeviceDisconnect() { // Unmap buffers for (int i = 0; i < kNumBuffers; ++i) - m_buffers[i] = std::move(UsbCameraBuffer{}); + m_buffers[i] = UsbCameraBuffer{}; // Close device close(fd); @@ -534,11 +534,11 @@ void UsbCameraImpl::DeviceConnect() { SDEBUG4("buf " << i << " length=" << buf.length << " offset=" << buf.m.offset); - m_buffers[i] = std::move(UsbCameraBuffer(fd, buf.length, buf.m.offset)); + m_buffers[i] = UsbCameraBuffer(fd, buf.length, buf.m.offset); if (!m_buffers[i].m_data) { SWARNING("could not map buffer " << i); // release other buffers - for (int j = 0; j < i; ++j) m_buffers[j] = std::move(UsbCameraBuffer{}); + for (int j = 0; j < i; ++j) m_buffers[j] = UsbCameraBuffer{}; close(fd); m_fd = -1; return; diff --git a/wpiutil/src/main/native/cpp/json_serializer.h b/wpiutil/src/main/native/cpp/json_serializer.h index a9b36d2b49..6983920fdd 100644 --- a/wpiutil/src/main/native/cpp/json_serializer.h +++ b/wpiutil/src/main/native/cpp/json_serializer.h @@ -52,10 +52,8 @@ class json::serializer @param[in] ichar indentation character to use */ serializer(raw_ostream& s, const char ichar) - : o(s), loc(std::localeconv()), - thousands_sep(loc->thousands_sep == nullptr ? '\0' : * (loc->thousands_sep)), - decimal_point(loc->decimal_point == nullptr ? '\0' : * (loc->decimal_point)), - indent_char(ichar), indent_string(512, indent_char) + : o(s), loc(std::localeconv()), indent_char(ichar), + indent_string(512, indent_char) {} // delete because of pointer members @@ -189,13 +187,6 @@ class json::serializer /// the locale const std::lconv* loc = nullptr; - /// the locale's thousand separator character - const char thousands_sep = '\0'; - /// the locale's decimal point character - const char decimal_point = '\0'; - - /// string buffer - std::array string_buffer{{}}; /// the indentation character const char indent_char;