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
4964ad78
Commit
4964ad78
authored
Aug 10, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/sidplay: sidplay_load_songlength_db() throws on error
parent
a7976cd0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
SidplayDecoderPlugin.cxx
src/decoder/plugins/SidplayDecoderPlugin.cxx
+8
-8
No files found.
src/decoder/plugins/SidplayDecoderPlugin.cxx
View file @
4964ad78
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
#include "util/AllocatedString.hxx"
#include "util/AllocatedString.hxx"
#include "util/CharUtil.hxx"
#include "util/CharUtil.hxx"
#include "util/ByteOrder.hxx"
#include "util/ByteOrder.hxx"
#include "util/
Manual
.hxx"
#include "util/
RuntimeError
.hxx"
#include "Log.hxx"
#include "Log.hxx"
#ifdef HAVE_SIDPLAYFP
#ifdef HAVE_SIDPLAYFP
...
@@ -101,8 +101,11 @@ static void loadRom(const Path rom_path, uint8_t *dump)
...
@@ -101,8 +101,11 @@ static void loadRom(const Path rom_path, uint8_t *dump)
}
}
#endif
#endif
/**
* Throws on error.
*/
static
std
::
unique_ptr
<
SidDatabase
>
static
std
::
unique_ptr
<
SidDatabase
>
sidplay_load_songlength_db
(
const
Path
path
)
noexcept
sidplay_load_songlength_db
(
const
Path
path
)
{
{
auto
db
=
std
::
make_unique
<
SidDatabase
>
();
auto
db
=
std
::
make_unique
<
SidDatabase
>
();
#ifdef HAVE_SIDPLAYFP
#ifdef HAVE_SIDPLAYFP
...
@@ -110,12 +113,9 @@ sidplay_load_songlength_db(const Path path) noexcept
...
@@ -110,12 +113,9 @@ sidplay_load_songlength_db(const Path path) noexcept
#else
#else
bool
error
=
db
->
open
(
path
.
c_str
())
<
0
;
bool
error
=
db
->
open
(
path
.
c_str
())
<
0
;
#endif
#endif
if
(
error
)
{
if
(
error
)
FormatError
(
sidplay_domain
,
throw
FormatRuntimeError
(
"unable to read songlengths file %s: %s"
,
"unable to read songlengths file %s: %s"
,
path
.
c_str
(),
db
->
error
());
path
.
c_str
(),
db
->
error
());
return
nullptr
;
}
return
db
;
return
db
;
}
}
...
...
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