Skip to content

Commit

Permalink
core: pass VIDIOC_QUERYCAP as unsigned long
Browse files Browse the repository at this point in the history
VIDIOC_QUARYCAP is an unsigned long and should be passed as one.

Get rid of the following error:
core/libcamera_app.cpp:33:22: error: overflow in conversion from 'long unsigned int' to 'int' changes value from '2154321408' to '-2140645888' [-Werror=overflow]
   33 |  int ret = ioctl(fd, VIDIOC_QUERYCAP, &caps);

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
  • Loading branch information
marcusfolkesson authored and naushir committed Jan 31, 2023
1 parent 9f08463 commit a65682a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/libcamera_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ static void check_camera_stack()
return;

v4l2_capability caps;
int ret = ioctl(fd, VIDIOC_QUERYCAP, &caps);
unsigned long request = VIDIOC_QUERYCAP;

int ret = ioctl(fd, request, &caps);
close(fd);

if (ret < 0 || strcmp((char *)caps.driver, "bm2835 mmal"))
Expand Down

0 comments on commit a65682a

Please sign in to comment.