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
1187a57b
Commit
1187a57b
authored
Jul 14, 2009
by
JP Dinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unneeded casts and intermediaries in va_arg()-using boilerplate.
parent
8f556b71
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
77 deletions
+30
-77
modules/access/alsa.c
modules/access/alsa.c
+4
-9
modules/access/cdda.c
modules/access/cdda.c
+3
-7
modules/access/dc1394.c
modules/access/dc1394.c
+3
-9
modules/access/directory.c
modules/access/directory.c
+3
-9
modules/access/mmap.c
modules/access/mmap.c
+2
-2
modules/access/smb.c
modules/access/smb.c
+3
-7
modules/access/v4l2.c
modules/access/v4l2.c
+5
-22
modules/access/vcd/vcd.c
modules/access/vcd/vcd.c
+7
-12
No files found.
modules/access/alsa.c
View file @
1187a57b
...
...
@@ -263,8 +263,6 @@ static void DemuxClose( vlc_object_t *p_this )
static
int
DemuxControl
(
demux_t
*
p_demux
,
int
i_query
,
va_list
args
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
bool
*
pb
;
int64_t
*
pi64
;
switch
(
i_query
)
{
...
...
@@ -273,22 +271,19 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
case
DEMUX_CAN_SEEK
:
case
DEMUX_SET_PAUSE_STATE
:
case
DEMUX_CAN_CONTROL_PACE
:
pb
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
*
pb
=
false
;
*
va_arg
(
args
,
bool
*
)
=
true
;
return
VLC_SUCCESS
;
case
DEMUX_GET_PTS_DELAY
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi64
=
(
int64_t
)
p_sys
->
i_cache
*
1000
;
*
va_arg
(
args
,
int64_t
*
)
=
(
int64_t
)
p_sys
->
i_cache
*
1000
;
return
VLC_SUCCESS
;
case
DEMUX_GET_TIME
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi64
=
mdate
();
*
va_arg
(
args
,
int64_t
*
)
=
mdate
();
return
VLC_SUCCESS
;
case
DEMUX_SET_NEXT_DEMUX_TIME
:
p_sys
->
i_next_demux_date
=
(
int64_t
)
va_arg
(
args
,
int64_t
);
p_sys
->
i_next_demux_date
=
va_arg
(
args
,
int64_t
);
return
VLC_SUCCESS
;
/* TODO implement others */
...
...
modules/access/cdda.c
View file @
1187a57b
...
...
@@ -338,22 +338,18 @@ static int Seek( access_t *p_access, int64_t i_pos )
*****************************************************************************/
static
int
Control
(
access_t
*
p_access
,
int
i_query
,
va_list
args
)
{
bool
*
pb_bool
;
int64_t
*
pi_64
;
switch
(
i_query
)
{
case
ACCESS_CAN_SEEK
:
case
ACCESS_CAN_FASTSEEK
:
case
ACCESS_CAN_PAUSE
:
case
ACCESS_CAN_CONTROL_PACE
:
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
*
pb_bool
=
true
;
*
va_arg
(
args
,
bool
*
)
=
true
;
break
;
case
ACCESS_GET_PTS_DELAY
:
pi_64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi_64
=
var_GetInteger
(
p_access
,
"cdda-caching"
)
*
INT64_C
(
1000
);
*
va_arg
(
args
,
int64_t
*
)
=
var_GetInteger
(
p_access
,
"cdda-caching"
)
*
INT64_C
(
1000
);
break
;
case
ACCESS_SET_PAUSE_STATE
:
...
...
modules/access/dc1394.c
View file @
1187a57b
...
...
@@ -799,9 +799,6 @@ static int Demux( demux_t *p_demux )
*****************************************************************************/
static
int
Control
(
demux_t
*
p_demux
,
int
i_query
,
va_list
args
)
{
bool
*
pb
;
int64_t
*
pi64
;
switch
(
i_query
)
{
/* Special for access_demux */
...
...
@@ -809,18 +806,15 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case
DEMUX_CAN_SEEK
:
case
DEMUX_SET_PAUSE_STATE
:
case
DEMUX_CAN_CONTROL_PACE
:
pb
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
*
pb
=
false
;
*
va_arg
(
args
,
bool
*
)
=
false
;
return
VLC_SUCCESS
;
case
DEMUX_GET_PTS_DELAY
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi64
=
(
int64_t
)
DEFAULT_PTS_DELAY
;
*
va_arg
(
args
,
int64_t
*
)
=
(
int64_t
)
DEFAULT_PTS_DELAY
;
return
VLC_SUCCESS
;
case
DEMUX_GET_TIME
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi64
=
mdate
();
*
va_arg
(
args
,
int64_t
*
)
=
mdate
();
return
VLC_SUCCESS
;
/* TODO implement others */
...
...
modules/access/directory.c
View file @
1187a57b
...
...
@@ -467,28 +467,22 @@ fatal:
*****************************************************************************/
static
int
Control
(
access_t
*
p_access
,
int
i_query
,
va_list
args
)
{
bool
*
pb_bool
;
int64_t
*
pi_64
;
switch
(
i_query
)
{
/* */
case
ACCESS_CAN_SEEK
:
case
ACCESS_CAN_FASTSEEK
:
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
*
pb_bool
=
false
;
*
va_arg
(
args
,
bool
*
)
=
false
;
break
;
case
ACCESS_CAN_PAUSE
:
case
ACCESS_CAN_CONTROL_PACE
:
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
*
pb_bool
=
true
;
*
va_arg
(
args
,
bool
*
)
=
true
;
break
;
/* */
case
ACCESS_GET_PTS_DELAY
:
pi_64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi_64
=
DEFAULT_PTS_DELAY
*
1000
;
*
va_arg
(
args
,
int64_t
*
)
=
DEFAULT_PTS_DELAY
*
1000
;
break
;
/* */
...
...
modules/access/mmap.c
View file @
1187a57b
...
...
@@ -286,13 +286,13 @@ static int Control (access_t *p_access, int query, va_list args)
case
ACCESS_CAN_FASTSEEK
:
case
ACCESS_CAN_PAUSE
:
case
ACCESS_CAN_CONTROL_PACE
:
*
((
bool
*
)
va_arg
(
args
,
bool
*
)
)
=
true
;
*
va_arg
(
args
,
bool
*
)
=
true
;
return
VLC_SUCCESS
;
case
ACCESS_GET_PTS_DELAY
:
{
int
delay_ms
=
var_CreateGetInteger
(
p_access
,
"file-caching"
);
*
((
int64_t
*
)
va_arg
(
args
,
int64_t
*
)
)
=
delay_ms
*
INT64_C
(
1000
);
*
va_arg
(
args
,
int64_t
*
)
=
delay_ms
*
INT64_C
(
1000
);
return
VLC_SUCCESS
;
}
...
...
modules/access/smb.c
View file @
1187a57b
...
...
@@ -312,22 +312,18 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
*****************************************************************************/
static
int
Control
(
access_t
*
p_access
,
int
i_query
,
va_list
args
)
{
bool
*
pb_bool
;
int64_t
*
pi_64
;
switch
(
i_query
)
{
case
ACCESS_CAN_SEEK
:
case
ACCESS_CAN_FASTSEEK
:
case
ACCESS_CAN_PAUSE
:
case
ACCESS_CAN_CONTROL_PACE
:
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
*
pb_bool
=
true
;
*
va_arg
(
args
,
bool
*
)
=
true
;
break
;
case
ACCESS_GET_PTS_DELAY
:
pi_64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi_64
=
(
int64_t
)
var_GetInteger
(
p_access
,
"smb-caching"
)
*
1000
;
*
va_arg
(
args
,
int64_t
*
)
=
(
int64_t
)
var_GetInteger
(
p_access
,
"smb-caching"
)
*
1000
;
break
;
case
ACCESS_SET_PAUSE_STATE
:
...
...
modules/access/v4l2.c
View file @
1187a57b
...
...
@@ -1087,10 +1087,6 @@ static int AccessOpen( vlc_object_t * p_this )
*****************************************************************************/
static
int
DemuxControl
(
demux_t
*
p_demux
,
int
i_query
,
va_list
args
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
bool
*
pb
;
int64_t
*
pi64
;
switch
(
i_query
)
{
/* Special for access_demux */
...
...
@@ -1098,18 +1094,15 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
case
DEMUX_CAN_SEEK
:
case
DEMUX_SET_PAUSE_STATE
:
case
DEMUX_CAN_CONTROL_PACE
:
pb
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
*
pb
=
false
;
*
va_arg
(
args
,
bool
*
)
=
false
;
return
VLC_SUCCESS
;
case
DEMUX_GET_PTS_DELAY
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi64
=
(
int64_t
)
p_sys
->
i_cache
*
1000
;
*
va_arg
(
args
,
int64_t
*
)
=
(
int64_t
)
p_demux
->
p_sys
->
i_cache
*
1000
;
return
VLC_SUCCESS
;
case
DEMUX_GET_TIME
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi64
=
mdate
();
*
va_arg
(
args
,
int64_t
*
)
=
mdate
();
return
VLC_SUCCESS
;
/* TODO implement others */
...
...
@@ -1125,8 +1118,6 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
*****************************************************************************/
static
int
AccessControl
(
access_t
*
p_access
,
int
i_query
,
va_list
args
)
{
bool
*
pb_bool
;
int64_t
*
pi_64
;
demux_sys_t
*
p_sys
=
(
demux_sys_t
*
)
p_access
->
p_sys
;
switch
(
i_query
)
...
...
@@ -1134,22 +1125,14 @@ static int AccessControl( access_t *p_access, int i_query, va_list args )
/* */
case
ACCESS_CAN_SEEK
:
case
ACCESS_CAN_FASTSEEK
:
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
*
pb_bool
=
false
;
break
;
case
ACCESS_CAN_PAUSE
:
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
*
pb_bool
=
false
;
break
;
case
ACCESS_CAN_CONTROL_PACE
:
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
*
pb_bool
=
false
;
*
va_arg
(
args
,
bool
*
)
=
false
;
break
;
/* */
case
ACCESS_GET_PTS_DELAY
:
pi_64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi_64
=
(
int64_t
)
p_sys
->
i_cache
*
1000
;
*
va_arg
(
args
,
int64_t
*
)
=
(
int64_t
)
p_sys
->
i_cache
*
1000
;
break
;
/* */
...
...
modules/access/vcd/vcd.c
View file @
1187a57b
...
...
@@ -241,9 +241,6 @@ static void Close( vlc_object_t *p_this )
static
int
Control
(
access_t
*
p_access
,
int
i_query
,
va_list
args
)
{
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
bool
*
pb_bool
;
int
*
pi_int
;
int64_t
*
pi_64
;
input_title_t
***
ppp_title
;
int
i
;
...
...
@@ -254,14 +251,13 @@ static int Control( access_t *p_access, int i_query, va_list args )
case
ACCESS_CAN_FASTSEEK
:
case
ACCESS_CAN_PAUSE
:
case
ACCESS_CAN_CONTROL_PACE
:
pb_bool
=
(
bool
*
)
va_arg
(
args
,
bool
*
);
*
pb_bool
=
true
;
*
va_arg
(
args
,
bool
*
)
=
true
;
break
;
/* */
case
ACCESS_GET_PTS_DELAY
:
pi_64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi_64
=
(
int64_t
)
var_GetInteger
(
p_access
,
"vcd-caching"
)
*
1000
;
*
va_arg
(
args
,
int64_t
*
)
=
(
int64_t
)
var_GetInteger
(
p_access
,
"vcd-caching"
)
*
1000
;
break
;
/* */
...
...
@@ -269,11 +265,10 @@ static int Control( access_t *p_access, int i_query, va_list args )
break
;
case
ACCESS_GET_TITLE_INFO
:
ppp_title
=
(
input_title_t
***
)
va_arg
(
args
,
input_title_t
***
);
pi_int
=
(
int
*
)
va_arg
(
args
,
int
*
)
;
ppp_title
=
va_arg
(
args
,
input_title_t
***
);
*
va_arg
(
args
,
int
*
)
=
p_sys
->
i_titles
;
/* Duplicate title infos */
*
pi_int
=
p_sys
->
i_titles
;
*
ppp_title
=
malloc
(
sizeof
(
input_title_t
**
)
*
p_sys
->
i_titles
);
for
(
i
=
0
;
i
<
p_sys
->
i_titles
;
i
++
)
{
...
...
@@ -282,7 +277,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
break
;
case
ACCESS_SET_TITLE
:
i
=
(
int
)
va_arg
(
args
,
int
);
i
=
va_arg
(
args
,
int
);
if
(
i
!=
p_access
->
info
.
i_title
)
{
/* Update info */
...
...
@@ -301,7 +296,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case
ACCESS_SET_SEEKPOINT
:
{
input_title_t
*
t
=
p_sys
->
title
[
p_access
->
info
.
i_title
];
i
=
(
int
)
va_arg
(
args
,
int
);
i
=
va_arg
(
args
,
int
);
if
(
t
->
i_seekpoint
>
0
)
{
p_access
->
info
.
i_update
|=
INPUT_UPDATE_SEEKPOINT
;
...
...
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