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 --- video/video-widget.cpp | 5 ++--- video/video-widget.hpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'video') 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