Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
cc5fb824
Commit
cc5fb824
authored
Jan 31, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use static_assert()
parent
351690f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
modules/access/v4l2/video.c
modules/access/v4l2/video.c
+6
-2
src/misc/threads.c
src/misc/threads.c
+3
-5
No files found.
modules/access/v4l2/video.c
View file @
cc5fb824
...
...
@@ -915,8 +915,12 @@ static int InitVideo( vlc_object_t *p_obj, int i_fd, demux_sys_t *p_sys,
if
(
std
==
0
)
{
const
size_t
n
=
sizeof
(
standards_vlc
)
/
sizeof
(
*
standards_vlc
);
assert
(
n
==
sizeof
(
standards_v4l2
)
/
sizeof
(
*
standards_v4l2
)
);
assert
(
n
==
sizeof
(
standards_user
)
/
sizeof
(
*
standards_user
)
);
static_assert
(
n
==
sizeof
(
standards_v4l2
)
/
sizeof
(
*
standards_v4l2
),
"Inconsistent standards tables"
);
static_assert
(
n
==
sizeof
(
standards_user
)
/
sizeof
(
*
standards_user
),
"Inconsistent standards tables"
);
for
(
size_t
i
=
0
;
i
<
n
;
i
++
)
if
(
strcasecmp
(
stdname
,
standards_vlc
[
i
]
)
==
0
)
{
...
...
src/misc/threads.c
View file @
cc5fb824
...
...
@@ -43,15 +43,13 @@ void vlc_global_mutex (unsigned n, bool acquire)
VLC_STATIC_MUTEX
,
VLC_STATIC_MUTEX
,
};
static_assert
(
VLC_MAX_MUTEX
==
(
sizeof
(
locks
)
/
sizeof
(
locks
[
0
])),
"Wrong number of global mutexes"
);
assert
(
n
<
(
sizeof
(
locks
)
/
sizeof
(
locks
[
0
])));
vlc_mutex_t
*
lock
=
locks
+
n
;
vlc_mutex_t
*
lock
=
locks
+
n
;
if
(
acquire
)
vlc_mutex_lock
(
lock
);
else
vlc_mutex_unlock
(
lock
);
/* Compile-time assertion ;-) */
char
enough_locks
[(
sizeof
(
locks
)
/
sizeof
(
locks
[
0
]))
-
VLC_MAX_MUTEX
];
(
void
)
enough_locks
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment