Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
643650db
Commit
643650db
authored
Oct 21, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audio_parser: renamed parameter "error" to "error_r"
It's a double pointer.
parent
8cb6854d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
audio_parser.c
src/audio_parser.c
+9
-8
audio_parser.h
src/audio_parser.h
+3
-2
No files found.
src/audio_parser.c
View file @
643650db
...
...
@@ -37,7 +37,8 @@ audio_parser_quark(void)
}
bool
audio_format_parse
(
struct
audio_format
*
dest
,
const
char
*
src
,
GError
**
error
)
audio_format_parse
(
struct
audio_format
*
dest
,
const
char
*
src
,
GError
**
error_r
)
{
char
*
endptr
;
unsigned
long
value
;
...
...
@@ -50,15 +51,15 @@ audio_format_parse(struct audio_format *dest, const char *src, GError **error)
value
=
strtoul
(
src
,
&
endptr
,
10
);
if
(
endptr
==
src
)
{
g_set_error
(
error
,
audio_parser_quark
(),
0
,
g_set_error
(
error
_r
,
audio_parser_quark
(),
0
,
"Sample rate missing"
);
return
false
;
}
else
if
(
*
endptr
!=
':'
)
{
g_set_error
(
error
,
audio_parser_quark
(),
0
,
g_set_error
(
error
_r
,
audio_parser_quark
(),
0
,
"Sample format missing"
);
return
false
;
}
else
if
(
!
audio_valid_sample_rate
(
value
))
{
g_set_error
(
error
,
audio_parser_quark
(),
0
,
g_set_error
(
error
_r
,
audio_parser_quark
(),
0
,
"Invalid sample rate: %lu"
,
value
);
return
false
;
}
...
...
@@ -70,15 +71,15 @@ audio_format_parse(struct audio_format *dest, const char *src, GError **error)
src
=
endptr
+
1
;
value
=
strtoul
(
src
,
&
endptr
,
10
);
if
(
endptr
==
src
)
{
g_set_error
(
error
,
audio_parser_quark
(),
0
,
g_set_error
(
error
_r
,
audio_parser_quark
(),
0
,
"Sample format missing"
);
return
false
;
}
else
if
(
*
endptr
!=
':'
)
{
g_set_error
(
error
,
audio_parser_quark
(),
0
,
g_set_error
(
error
_r
,
audio_parser_quark
(),
0
,
"Channel count missing"
);
return
false
;
}
else
if
(
!
audio_valid_sample_format
(
value
))
{
g_set_error
(
error
,
audio_parser_quark
(),
0
,
g_set_error
(
error
_r
,
audio_parser_quark
(),
0
,
"Invalid sample format: %lu"
,
value
);
return
false
;
}
...
...
@@ -90,7 +91,7 @@ audio_format_parse(struct audio_format *dest, const char *src, GError **error)
src
=
endptr
+
1
;
value
=
strtoul
(
src
,
&
endptr
,
10
);
if
(
*
endptr
!=
0
||
!
audio_valid_channel_count
(
value
))
{
g_set_error
(
error
,
audio_parser_quark
(),
0
,
g_set_error
(
error
_r
,
audio_parser_quark
(),
0
,
"Invalid channel count: %s"
,
src
);
return
false
;
}
...
...
src/audio_parser.h
View file @
643650db
...
...
@@ -37,11 +37,12 @@ struct audio_format;
*
* @param dest the destination #audio_format struct
* @param src the input string
* @param error location to store the error occuring, or NULL to
* @param error
_r
location to store the error occuring, or NULL to
* ignore errors
* @return true on success
*/
bool
audio_format_parse
(
struct
audio_format
*
dest
,
const
char
*
src
,
GError
**
error
);
audio_format_parse
(
struct
audio_format
*
dest
,
const
char
*
src
,
GError
**
error_r
);
#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