Debian Codegraph @

gcc/testsuite/gcc.dg/analyzer/torture/switch-5.c

raw
1 /* { dg-additional-options "-fno-analyzer-call-summaries" } */
2
3 typedef unsigned char u8;
4 typedef signed int s32;
5 typedef unsigned int u32;
6
7 enum v4l2_mpeg_video_hevc_profile {
8 V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN = 0,
9 V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE = 1,
10 V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 = 2
11 };
12 enum v4l2_buf_type {
13 V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
14 V4L2_BUF_TYPE_VIDEO_OUTPUT = 2
15 };
16 struct v4l2_fmtdesc {
17 u32 index;
18 u32 type;
19 };
20 struct v4l2_ctrl;
21 s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl);
22 struct create_channel_param {
23 u8 profile;
24 };
25
26 u8
27 hevc_profile_to_mcu_profile(enum v4l2_mpeg_video_hevc_profile profile) {
28 switch (profile) {
29 default:
30 case V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN:
31 return 1;
32 case V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10:
33 return 2;
34 case V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE:
35 return 3;
36 }
37 }
38
39 int fill_create_channel_param(struct v4l2_ctrl *ctrl,
40 struct create_channel_param *param) {
41 enum v4l2_mpeg_video_hevc_profile profile;
42 profile = v4l2_ctrl_g_ctrl(ctrl);
43 param->profile = hevc_profile_to_mcu_profile(profile);
44 return 0;
45 }
46
47 int allegro_enum_fmt_vid(struct v4l2_fmtdesc *f) {
48 switch (f->type) {
49 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
50 if (f->index >= 1)
51 return -22;
52 break;
53 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
54 if (f->index >= 2)
55 return -22;
56 break;
57 default:
58 return -22;
59 }
60 return 0;
61 }
62
63 int allegro_ioctl_streamon(struct v4l2_ctrl *ctrl,
64 struct create_channel_param *param) {
65 fill_create_channel_param(ctrl, param);
66
67 return 0;
68 }