replace enums use for compile time constants

This commit is contained in:
Garux
2021-11-22 12:29:43 +03:00
parent 7be3cbda79
commit 86ba294cf4
8 changed files with 21 additions and 29 deletions

View File

@@ -23,6 +23,7 @@
#include "zlib.h"
#include "idatastream.h"
#include <vector> // std::size
/// \brief A wrapper around an InputStream of data compressed with the zlib deflate algorithm.
///
@@ -32,8 +33,7 @@ class DeflatedInputStream : public InputStream
{
InputStream& m_istream;
z_stream m_zipstream;
enum unnamed0 { m_bufsize = 1024 };
unsigned char m_buffer[m_bufsize];
unsigned char m_buffer[1024];
public:
DeflatedInputStream( InputStream& istream )
@@ -54,7 +54,7 @@ public:
{
if ( m_zipstream.avail_in == 0 ) {
m_zipstream.next_in = m_buffer;
m_zipstream.avail_in = static_cast<uInt>( m_istream.read( m_buffer, m_bufsize ) );
m_zipstream.avail_in = static_cast<uInt>( m_istream.read( m_buffer, std::size( m_buffer ) ) );
}
if ( inflate( &m_zipstream, Z_SYNC_FLUSH ) != Z_OK ) {
break;