Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
3f615499
Commit
3f615499
authored
Feb 26, 2007
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing const qualifier to vod_MediaControl.
Improved TAB_* protection and added TAB_INIT/CLEAN.
parent
bca93013
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
21 deletions
+32
-21
include/vlc_arrays.h
include/vlc_arrays.h
+25
-14
include/vlc_vod.h
include/vlc_vod.h
+7
-7
No files found.
include/vlc_arrays.h
View file @
3f615499
...
@@ -73,40 +73,50 @@
...
@@ -73,40 +73,50 @@
} \
} \
while( 0 )
while( 0 )
#define TAB_INIT( count, tab ) \
do { \
(count) = 0; \
(tab) = NULL; \
} while(0)
#define TAB_CLEAN( count, tab ) \
do { \
if( tab ) free( tab ); \
(count)= 0; \
(tab)= NULL; \
} while(0)
#define TAB_APPEND( count, tab, p ) \
#define TAB_APPEND( count, tab, p ) \
do { \
if( (count) > 0 ) \
if( (count) > 0 ) \
{ \
(tab) = realloc( tab, sizeof( void ** ) * ( (count) + 1 ) ); \
(tab) = realloc( tab, sizeof( void ** ) * ( (count) + 1 ) ); \
} \
else \
else \
{ \
(tab) = malloc( sizeof( void ** ) ); \
(tab) = malloc( sizeof( void ** ) ); \
}
\
(tab)[count] = (p);
\
(
tab)[count] = (p);
\
(
count)++;
\
(count)++
} while(0)
#define TAB_FIND( count, tab, p, index ) \
#define TAB_FIND( count, tab, p, index ) \
{
\
do {
\
int _i_; \
int _i_; \
(index) = -1; \
(index) = -1; \
for( _i_ = 0; _i_ < (count); _i_++ ) \
for( _i_ = 0; _i_ < (count); _i_++ ) \
{ \
{ \
if( (tab)[_i_] == (p) ) \
if( (tab)[_i_] == (p) )
\
{ \
{ \
(index) = _i_; \
(index) = _i_; \
break; \
break; \
} \
} \
} \
} \
}
} while(0)
#define TAB_REMOVE( count, tab, p ) \
#define TAB_REMOVE( count, tab, p ) \
{
\
do {
\
int _i_index_; \
int _i_index_; \
TAB_FIND( count, tab, p, _i_index_ ); \
TAB_FIND( count, tab, p, _i_index_ ); \
if( _i_index_ >= 0 ) \
if( _i_index_ >= 0 ) \
{ \
{ \
if( (count) > 1 )
\
if( (count) > 1 ) \
{ \
{ \
memmove( ((void**)(tab) + _i_index_), \
memmove( ((void**)(tab) + _i_index_), \
((void**)(tab) + _i_index_+1), \
((void**)(tab) + _i_index_+1), \
...
@@ -119,7 +129,7 @@
...
@@ -119,7 +129,7 @@
(tab) = NULL; \
(tab) = NULL; \
} \
} \
} \
} \
}
} while(0)
/**
/**
* Binary search in a sorted array. The key must be comparable by < and >
* Binary search in a sorted array. The key must be comparable by < and >
...
@@ -130,7 +140,8 @@
...
@@ -130,7 +140,8 @@
* \param key value of the key
* \param key value of the key
* \param answer index of answer within the array. -1 if not found
* \param answer index of answer within the array. -1 if not found
*/
*/
#define BSEARCH( entries, count, elem, zetype, key, answer ) { \
#define BSEARCH( entries, count, elem, zetype, key, answer ) \
do { \
int low = 0, high = count - 1; \
int low = 0, high = count - 1; \
answer = -1; \
answer = -1; \
while( low <= high ) {\
while( low <= high ) {\
...
@@ -145,7 +156,7 @@
...
@@ -145,7 +156,7 @@
answer = mid; break; \
answer = mid; break; \
}\
}\
} \
} \
}
} while(0)
/************************************************************************
/************************************************************************
* Dictionaries
* Dictionaries
...
...
include/vlc_vod.h
View file @
3f615499
...
@@ -47,7 +47,7 @@ struct vod_t
...
@@ -47,7 +47,7 @@ struct vod_t
};
};
static
inline
int
vod_MediaControl
(
vod_t
*
p_vod
,
vod_media_t
*
p_media
,
static
inline
int
vod_MediaControl
(
vod_t
*
p_vod
,
vod_media_t
*
p_media
,
char
*
psz_id
,
int
i_query
,
...
)
c
onst
c
har
*
psz_id
,
int
i_query
,
...
)
{
{
va_list
args
;
va_list
args
;
int
i_result
;
int
i_result
;
...
@@ -63,12 +63,12 @@ static inline int vod_MediaControl( vod_t *p_vod, vod_media_t *p_media,
...
@@ -63,12 +63,12 @@ static inline int vod_MediaControl( vod_t *p_vod, vod_media_t *p_media,
enum
vod_query_e
enum
vod_query_e
{
{
VOD_MEDIA_PLAY
,
/* arg1=
double *
res= */
VOD_MEDIA_PLAY
,
/* arg1=
char *
res= */
VOD_MEDIA_PAUSE
,
/* arg1=
double *
res= */
VOD_MEDIA_PAUSE
,
/* arg1=
res= */
VOD_MEDIA_STOP
,
/* arg1=
double
res=can fail */
VOD_MEDIA_STOP
,
/* arg1=
res=can fail */
VOD_MEDIA_SEEK
,
/* arg1= double
*
res= */
VOD_MEDIA_SEEK
,
/* arg1= double
res= */
VOD_MEDIA_REWIND
,
/* arg1= double
*
res= */
VOD_MEDIA_REWIND
,
/* arg1= double
res= */
VOD_MEDIA_FORWARD
,
/* arg1= double
*
res= */
VOD_MEDIA_FORWARD
,
/* arg1= double
res= */
};
};
#endif
#endif
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