Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
455
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
6a51c0a2
Commit
6a51c0a2
authored
13 years ago
by
Rémi Denis-Courmont
Browse files
Options
Downloads
Patches
Plain Diff
Improve access initialization macro safety
parent
b6c4de7c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/vlc_access.h
+23
-17
23 additions, 17 deletions
include/vlc_access.h
with
23 additions
and
17 deletions
include/vlc_access.h
+
23
−
17
View file @
6a51c0a2
...
...
@@ -153,23 +153,29 @@ static inline void access_InitFields( access_t *p_a )
*/
VLC_API
input_thread_t
*
access_GetParentInput
(
access_t
*
p_access
)
VLC_USED
;
#define ACCESS_SET_CALLBACKS( read, block, control, seek ) \
p_access->pf_read = read; \
p_access->pf_block = block; \
p_access->pf_control = control; \
p_access->pf_seek = seek;
#define STANDARD_READ_ACCESS_INIT \
access_InitFields( p_access ); \
ACCESS_SET_CALLBACKS( Read, NULL, Control, Seek ); \
p_sys = p_access->p_sys = calloc( 1, sizeof( access_sys_t )); \
if( !p_sys ) return VLC_ENOMEM;
#define STANDARD_BLOCK_ACCESS_INIT \
access_InitFields( p_access ); \
ACCESS_SET_CALLBACKS( NULL, Block, Control, Seek ); \
p_sys = p_access->p_sys = calloc( 1, sizeof( access_sys_t ) ); \
if( !p_sys ) return VLC_ENOMEM;
#define ACCESS_SET_CALLBACKS( read, block, control, seek ) \
do { \
p_access->pf_read = (read); \
p_access->pf_block = (block); \
p_access->pf_control = (control); \
p_access->pf_seek = (seek); \
} while(0)
#define STANDARD_READ_ACCESS_INIT \
do { \
access_InitFields( p_access ); \
ACCESS_SET_CALLBACKS( Read, NULL, Control, Seek ); \
p_sys = p_access->p_sys = calloc( 1, sizeof( access_sys_t ) ); \
if( !p_sys ) return VLC_ENOMEM;\
} while(0);
#define STANDARD_BLOCK_ACCESS_INIT \
do { \
access_InitFields( p_access ); \
ACCESS_SET_CALLBACKS( NULL, Block, Control, Seek ); \
p_sys = p_access->p_sys = calloc( 1, sizeof( access_sys_t ) ); \
if( !p_sys ) return VLC_ENOMEM; \
} while(0);
/**
* @}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment