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
25e338a0
Commit
25e338a0
authored
Aug 10, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ConfigData: use FatalError() instead of MPD_ERROR()
parent
81175b07
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
Makefile.am
Makefile.am
+5
-0
ConfigData.cxx
src/ConfigData.cxx
+6
-5
No files found.
Makefile.am
View file @
25e338a0
...
@@ -1063,6 +1063,7 @@ endif
...
@@ -1063,6 +1063,7 @@ endif
test_read_conf_LDADD
=
\
test_read_conf_LDADD
=
\
libconf.a
\
libconf.a
\
libutil.a
\
libutil.a
\
libsystem.a
\
libfs.a
\
libfs.a
\
$(GLIB_LIBS)
$(GLIB_LIBS)
test_read_conf_SOURCES
=
test
/read_conf.cxx
test_read_conf_SOURCES
=
test
/read_conf.cxx
...
@@ -1076,6 +1077,7 @@ test_DumpDatabase_LDADD = \
...
@@ -1076,6 +1077,7 @@ test_DumpDatabase_LDADD = \
$(DB_LIBS)
\
$(DB_LIBS)
\
libconf.a
\
libconf.a
\
libutil.a
\
libutil.a
\
libsystem.a
\
libfs.a
\
libfs.a
\
$(GLIB_LIBS)
$(GLIB_LIBS)
test_DumpDatabase_SOURCES
=
test
/DumpDatabase.cxx
\
test_DumpDatabase_SOURCES
=
test
/DumpDatabase.cxx
\
...
@@ -1226,6 +1228,7 @@ test_run_filter_LDADD = \
...
@@ -1226,6 +1228,7 @@ test_run_filter_LDADD = \
$(FILTER_LIBS)
\
$(FILTER_LIBS)
\
libconf.a
\
libconf.a
\
libutil.a
\
libutil.a
\
libsystem.a
\
libfs.a
\
libfs.a
\
$(GLIB_LIBS)
$(GLIB_LIBS)
test_run_filter_SOURCES
=
test
/run_filter.cxx
\
test_run_filter_SOURCES
=
test
/run_filter.cxx
\
...
@@ -1259,6 +1262,7 @@ test_run_encoder_LDADD = \
...
@@ -1259,6 +1262,7 @@ test_run_encoder_LDADD = \
$(TAG_LIBS)
\
$(TAG_LIBS)
\
libconf.a
\
libconf.a
\
libpcm.a
\
libpcm.a
\
libsystem.a
\
libfs.a
\
libfs.a
\
libutil.a
\
libutil.a
\
$(GLIB_LIBS)
$(GLIB_LIBS)
...
@@ -1279,6 +1283,7 @@ test_test_vorbis_encoder_LDADD = $(MPD_LIBS) \
...
@@ -1279,6 +1283,7 @@ test_test_vorbis_encoder_LDADD = $(MPD_LIBS) \
$(ENCODER_LIBS)
\
$(ENCODER_LIBS)
\
$(PCM_LIBS)
\
$(PCM_LIBS)
\
libconf.a
\
libconf.a
\
libsystem.a
\
libfs.a
\
libfs.a
\
libutil.a
\
libutil.a
\
$(GLIB_LIBS)
$(GLIB_LIBS)
...
...
src/ConfigData.cxx
View file @
25e338a0
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include "ConfigParser.hxx"
#include "ConfigParser.hxx"
#include "ConfigPath.hxx"
#include "ConfigPath.hxx"
#include "fs/Path.hxx"
#include "fs/Path.hxx"
#include "system/FatalError.hxx"
#include "mpd_error.h"
#include "mpd_error.h"
#include <glib.h>
#include <glib.h>
...
@@ -36,10 +37,10 @@ block_param::GetUnsignedValue() const
...
@@ -36,10 +37,10 @@ block_param::GetUnsignedValue() const
char
*
endptr
;
char
*
endptr
;
long
value2
=
strtol
(
value
.
c_str
(),
&
endptr
,
0
);
long
value2
=
strtol
(
value
.
c_str
(),
&
endptr
,
0
);
if
(
*
endptr
!=
0
)
if
(
*
endptr
!=
0
)
MPD_ERROR
(
"Not a valid number in line %i"
,
line
);
FormatFatalError
(
"Not a valid number in line %i"
,
line
);
if
(
value2
<
0
)
if
(
value2
<
0
)
MPD_ERROR
(
"Not a positive number in line %i"
,
line
);
FormatFatalError
(
"Not a positive number in line %i"
,
line
);
return
(
unsigned
)
value2
;
return
(
unsigned
)
value2
;
}
}
...
@@ -49,9 +50,9 @@ block_param::GetBoolValue() const
...
@@ -49,9 +50,9 @@ block_param::GetBoolValue() const
{
{
bool
value2
;
bool
value2
;
if
(
!
get_bool
(
value
.
c_str
(),
&
value2
))
if
(
!
get_bool
(
value
.
c_str
(),
&
value2
))
MPD_ERROR
(
"%s is not a boolean value (yes, true, 1) or "
FormatFatalError
(
"%s is not a boolean value (yes, true, 1) or "
"(no, false, 0) on line %i
\n
"
,
"(no, false, 0) on line %i
\n
"
,
name
.
c_str
(),
line
);
name
.
c_str
(),
line
);
return
value2
;
return
value2
;
}
}
...
...
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