Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
7efe05ab
Commit
7efe05ab
authored
Aug 28, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmdutils: declare only one pointer type in OptionDef
This will be useful in the following commit.
parent
cac651c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
cmdutils.c
cmdutils.c
+7
-5
cmdutils.h
cmdutils.h
+1
-4
No files found.
cmdutils.c
View file @
7efe05ab
...
...
@@ -216,6 +216,7 @@ void parse_options(int argc, char **argv, const OptionDef *options,
/* parse options */
optindex
=
1
;
while
(
optindex
<
argc
)
{
void
*
dst
;
opt
=
argv
[
optindex
++
];
if
(
handleoptions
&&
opt
[
0
]
==
'-'
&&
opt
[
1
]
!=
'\0'
)
{
...
...
@@ -248,18 +249,19 @@ unknown_opt:
exit_program
(
1
);
}
}
dst
=
po
->
u
.
dst_ptr
;
if
(
po
->
flags
&
OPT_STRING
)
{
char
*
str
;
str
=
av_strdup
(
arg
);
*
po
->
u
.
str_arg
=
str
;
*
(
char
**
)
dst
=
str
;
}
else
if
(
po
->
flags
&
OPT_BOOL
)
{
*
po
->
u
.
int_arg
=
bool_val
;
*
(
int
*
)
dst
=
bool_val
;
}
else
if
(
po
->
flags
&
OPT_INT
)
{
*
po
->
u
.
int_arg
=
parse_number_or_die
(
opt
,
arg
,
OPT_INT64
,
INT_MIN
,
INT_MAX
);
*
(
int
*
)
dst
=
parse_number_or_die
(
opt
,
arg
,
OPT_INT64
,
INT_MIN
,
INT_MAX
);
}
else
if
(
po
->
flags
&
OPT_INT64
)
{
*
po
->
u
.
int64_arg
=
parse_number_or_die
(
opt
,
arg
,
OPT_INT64
,
INT64_MIN
,
INT64_MAX
);
*
(
int64_t
*
)
dst
=
parse_number_or_die
(
opt
,
arg
,
OPT_INT64
,
INT64_MIN
,
INT64_MAX
);
}
else
if
(
po
->
flags
&
OPT_FLOAT
)
{
*
po
->
u
.
float_arg
=
parse_number_or_die
(
opt
,
arg
,
OPT_FLOAT
,
-
INFINITY
,
INFINITY
);
*
(
float
*
)
dst
=
parse_number_or_die
(
opt
,
arg
,
OPT_FLOAT
,
-
INFINITY
,
INFINITY
);
}
else
if
(
po
->
u
.
func_arg
)
{
if
(
po
->
u
.
func_arg
(
opt
,
arg
)
<
0
)
{
fprintf
(
stderr
,
"%s: failed to set value '%s' for option '%s'
\n
"
,
argv
[
0
],
arg
,
opt
);
...
...
cmdutils.h
View file @
7efe05ab
...
...
@@ -125,11 +125,8 @@ typedef struct {
#define OPT_EXIT 0x0800
#define OPT_DATA 0x1000
union
{
int
*
int_arg
;
char
**
str_arg
;
float
*
float_arg
;
void
*
dst_ptr
;
int
(
*
func_arg
)(
const
char
*
,
const
char
*
);
int64_t
*
int64_arg
;
}
u
;
const
char
*
help
;
const
char
*
argname
;
...
...
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