Skip to content

Commit

Permalink
getting rid of gzstream namespace
Browse files Browse the repository at this point in the history
Co-authored-by: Oleg Antipin <60584843+olanti-p@users.noreply.github.com>
  • Loading branch information
int-ua and olanti-p committed Sep 15, 2020
1 parent 57d170d commit da14ad9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/cata_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ bool read_from_file( const std::string &path, const std::function<void( std::ist
fin.read( header, 2 );
if( ( header[0] == '\x1f' ) && ( header[1] == '\x8b' ) ) {
const char *cstr_path = path.c_str();
GZSTREAM_NAMESPACE::igzstream fingz( cstr_path, std::ios::binary );
igzstream fingz( cstr_path, std::ios::binary );
reader( fingz );
} else {
fin.clear();
Expand Down
9 changes: 0 additions & 9 deletions src/gzstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
#include <iostream>
#include <cstring> // for memcpy

#define GZSTREAM_NAMESPACE
namespace GZSTREAM_NAMESPACE
{
#endif

// ----------------------------------------------------------------------------
// Internal classes to implement gzstream. See header file for user classes.
// ----------------------------------------------------------------------------
Expand Down Expand Up @@ -183,9 +178,5 @@ void gzstreambase::close()
}
}

#ifdef GZSTREAM_NAMESPACE
} // namespace GZSTREAM_NAMESPACE
#endif

// ============================================================================
// EOF //
12 changes: 4 additions & 8 deletions src/gzstream.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#pragma once
#ifndef CATA_SRC_GZSTREAM_H
#define CATA_SRC_GZSTREAM_H
// ============================================================================
// gzstream, C++ iostream classes wrapping the zlib compression library.
// Copyright (C) 2001 Deepak Bandyopadhyay, Lutz Kettner
Expand Down Expand Up @@ -26,16 +29,11 @@
// Standard C++ Library".
// ============================================================================

#define GZSTREAM_H 1

// standard C++ with new header file names and std:: namespace
#include <iostream>
#include <fstream>
#include <zlib.h>

namespace GZSTREAM_NAMESPACE
{

// ----------------------------------------------------------------------------
// Internal classes to implement gzstream. See below for user classes.
// ----------------------------------------------------------------------------
Expand Down Expand Up @@ -125,8 +123,6 @@ class ogzstream : public gzstreambase, public std::ostream
}
};

} // namespace GZSTREAM_NAMESPACE

// ============================================================================
// EOF //

#endif // CATA_SRC_GZSTREAM_H

0 comments on commit da14ad9

Please sign in to comment.