From e71f7af1d619d02667c2bfb9f5fd0d925e534230 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 1 Aug 2019 11:20:44 +0200 Subject: spline, video: get rid of needless casts --- spline/spline-widget.cpp | 3 +-- video/video-widget.cpp | 5 ++--- video/video-widget.hpp | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/spline/spline-widget.cpp b/spline/spline-widget.cpp index 96a22d95..0ae3766d 100644 --- a/spline/spline-widget.cpp +++ b/spline/spline-widget.cpp @@ -155,8 +155,7 @@ void spline_widget::drawFunction() moving_control_point_idx < points.size()) { const QPen pen(Qt::white, 1, Qt::SolidLine, Qt::FlatCap); - const QPointF prev_ = point_to_pixel({}); - QPointF prev(iround(prev_.x()), iround(prev_.y())); + QPointF prev = point_to_pixel({}); for (const auto& point : points) { const QPointF tmp = point_to_pixel(point); diff --git a/video/video-widget.cpp b/video/video-widget.cpp index 4394fec7..9100e0ea 100644 --- a/video/video-widget.cpp +++ b/video/video-widget.cpp @@ -33,13 +33,12 @@ void video_widget::update_image(const QImage& img) set_fresh(true); } -void video_widget::set_image(const unsigned char* src, int width, int height, - unsigned stride, QImage::Format fmt) +void video_widget::set_image(const unsigned char* src, int width, int height, int stride, QImage::Format fmt) { QMutexLocker l(&mtx); texture = QImage(); - unsigned nbytes = stride * height; + unsigned nbytes = (unsigned)(stride * height); vec.resize(nbytes); vec.shrink_to_fit(); std::memcpy(vec.data(), src, nbytes); texture = QImage((const unsigned char*)vec.data(), width, height, stride, fmt); diff --git a/video/video-widget.hpp b/video/video-widget.hpp index ab5d42d2..bb218c69 100644 --- a/video/video-widget.hpp +++ b/video/video-widget.hpp @@ -36,7 +36,7 @@ protected: std::vector vec; bool fresh() const; void set_fresh(bool x); - void set_image(const unsigned char* src, int width, int height, unsigned stride, QImage::Format fmt); + void set_image(const unsigned char* src, int width, int height, int stride, QImage::Format fmt); private: void init_image_nolock(); -- cgit v1.2.3