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
15939fd8
Commit
15939fd8
authored
Sep 04, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
archive/bzip2: fold Open() into constructor
parent
f63c343f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
20 deletions
+12
-20
Bzip2ArchivePlugin.cxx
src/archive/plugins/Bzip2ArchivePlugin.cxx
+12
-20
No files found.
src/archive/plugins/Bzip2ArchivePlugin.cxx
View file @
15939fd8
...
@@ -79,25 +79,6 @@ private:
...
@@ -79,25 +79,6 @@ private:
bool
FillBuffer
();
bool
FillBuffer
();
};
};
/* single archive handling allocation helpers */
inline
void
Bzip2InputStream
::
Open
()
{
bzstream
.
bzalloc
=
nullptr
;
bzstream
.
bzfree
=
nullptr
;
bzstream
.
opaque
=
nullptr
;
bzstream
.
next_in
=
(
char
*
)
buffer
;
bzstream
.
avail_in
=
0
;
int
ret
=
BZ2_bzDecompressInit
(
&
bzstream
,
0
,
0
);
if
(
ret
!=
BZ_OK
)
throw
std
::
runtime_error
(
"BZ2_bzDecompressInit() has failed"
);
SetReady
();
}
/* archive open && listing routine */
/* archive open && listing routine */
static
std
::
unique_ptr
<
ArchiveFile
>
static
std
::
unique_ptr
<
ArchiveFile
>
...
@@ -116,7 +97,18 @@ Bzip2InputStream::Bzip2InputStream(const std::shared_ptr<InputStream> &_input,
...
@@ -116,7 +97,18 @@ Bzip2InputStream::Bzip2InputStream(const std::shared_ptr<InputStream> &_input,
:
InputStream
(
_uri
,
_mutex
),
:
InputStream
(
_uri
,
_mutex
),
input
(
_input
)
input
(
_input
)
{
{
Open
();
bzstream
.
bzalloc
=
nullptr
;
bzstream
.
bzfree
=
nullptr
;
bzstream
.
opaque
=
nullptr
;
bzstream
.
next_in
=
(
char
*
)
buffer
;
bzstream
.
avail_in
=
0
;
int
ret
=
BZ2_bzDecompressInit
(
&
bzstream
,
0
,
0
);
if
(
ret
!=
BZ_OK
)
throw
std
::
runtime_error
(
"BZ2_bzDecompressInit() has failed"
);
SetReady
();
}
}
Bzip2InputStream
::~
Bzip2InputStream
()
noexcept
Bzip2InputStream
::~
Bzip2InputStream
()
noexcept
...
...
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