From d4c97b50b577ea16b9ff6d9a352ab474a119310e Mon Sep 17 00:00:00 2001 From: Naveen Saini Date: Wed, 18 May 2022 15:41:24 +0800 Subject: [PATCH] fake_v4l2_device.h: fix narrowing warning Use uint32_t instead of int for IOCTLs commands. Warning log: | ../../../git/xcore/fake_v4l2_device.h: In member function 'virtual int XCam::FakeV4l2Device::io_control(int, void*)': | ../../../git/xcore/fake_v4l2_device.h:42:14: error: narrowing conversion of '3225441794' from 'long unsigned int' to 'int' [-Wnarrowing] | 42 | case VIDIOC_ENUM_FMT: | | ^~~~~~~~~~~~~~~ | make[4]: *** [Makefile:685: libgstxcamsrc_la-gstxcamsrc.lo] Error 1 Issue: https://github.com/intel/libxcam/issues/801 Upstream-Status: Submitted [https://github.com/intel/libxcam/pull/802] Signed-off-by: Naveen Saini --- xcore/base/xcam_common.h | 2 +- xcore/fake_v4l2_device.h | 2 +- xcore/v4l2_device.cpp | 2 +- xcore/v4l2_device.h | 2 +- xcore/xcam_common.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xcore/base/xcam_common.h b/xcore/base/xcam_common.h index 1f16e1e..4aa6cb9 100644 --- a/xcore/base/xcam_common.h +++ b/xcore/base/xcam_common.h @@ -75,7 +75,7 @@ void xcam_free (void *ptr); * return, 0 successfully * else, check errno */ -int xcam_device_ioctl (int fd, int cmd, void *arg); +int xcam_device_ioctl (int fd, uint32_t cmd, void *arg); const char *xcam_fourcc_to_string (uint32_t fourcc); void xcam_set_log (const char* file_name); diff --git a/xcore/fake_v4l2_device.h b/xcore/fake_v4l2_device.h index f679c19..e29787d 100644 --- a/xcore/fake_v4l2_device.h +++ b/xcore/fake_v4l2_device.h @@ -33,7 +33,7 @@ public: : V4l2Device ("/dev/null") {} - int io_control (int cmd, void *arg) + int io_control (uint32_t cmd, void *arg) { XCAM_UNUSED (arg); diff --git a/xcore/v4l2_device.cpp b/xcore/v4l2_device.cpp index 395461e..66a8ac6 100644 --- a/xcore/v4l2_device.cpp +++ b/xcore/v4l2_device.cpp @@ -185,7 +185,7 @@ V4l2Device::close () } int -V4l2Device::io_control (int cmd, void *arg) +V4l2Device::io_control (uint32_t cmd, void *arg) { if (_fd <= 0) diff --git a/xcore/v4l2_device.h b/xcore/v4l2_device.h index b4ad7ad..2551a92 100644 --- a/xcore/v4l2_device.h +++ b/xcore/v4l2_device.h @@ -104,7 +104,7 @@ public: XCamReturn queue_buffer (SmartPtr &buf); // use as less as possible - virtual int io_control (int cmd, void *arg); + virtual int io_control (uint32_t cmd, void *arg); protected: diff --git a/xcore/xcam_common.cpp b/xcore/xcam_common.cpp index 848884d..d4d5093 100644 --- a/xcore/xcam_common.cpp +++ b/xcore/xcam_common.cpp @@ -53,7 +53,7 @@ void xcam_free(void *ptr) free (ptr); } -int xcam_device_ioctl (int fd, int cmd, void *arg) +int xcam_device_ioctl (int fd, uint32_t cmd, void *arg) { int ret = 0; int tried_time = 0; -- 2.25.1