Description: remove deprecated throw specification
 Just remove those.
Author: Laszlo Boszormenyi (GCS) <gcs@debian.org>
Bug-Debian: https://bugs.debian.org/984415
Forwarded: no
Last-Update: 2021-11-07

---

--- zbackup-1.5.orig/file.cc
+++ zbackup-1.5/file.cc
@@ -24,7 +24,7 @@ enum
   WriteBufferSize = 65536
 };
 
-bool File::exists( char const * filename ) throw()
+bool File::exists( char const * filename )
 {
 #ifdef __WIN32
   struct _stat buf;
@@ -37,7 +37,7 @@ bool File::exists( char const * filename
 #endif
 }
 
-bool File::special( string const & filename ) throw()
+bool File::special( string const & filename )
 {
   bool special = false;
 #ifndef __WIN32
@@ -56,15 +56,14 @@ bool File::special( string const & filen
   return special;
 }
 
-void File::erase( std::string const & filename ) throw( exCantErase )
+void File::erase( std::string const & filename )
 {
   if ( remove( filename.c_str() ) != 0 )
     throw exCantErase( filename );
 }
 
 void File::rename( std::string const & from,
-                   std::string const & to ) throw( exCantRename,
-                                                   exCantErase )
+                   std::string const & to )
 {
   int res = 0;
   res = ::rename( from.c_str(), to.c_str() );
@@ -115,7 +114,7 @@ void File::rename( std::string const & f
   }
 }
 
-void File::open( char const * filename, OpenMode mode ) throw( exCantOpen )
+void File::open( char const * filename, OpenMode mode )
 {
   char const * m;
 
@@ -137,7 +136,7 @@ void File::open( char const * filename,
     throw exCantOpen( std::string( filename ) + ": " + strerror( errno ) );
 }
 
-void File::open( int fd, OpenMode mode ) throw( exCantOpen )
+void File::open( int fd, OpenMode mode )
 {
   char const * m;
 
@@ -159,25 +158,23 @@ void File::open( int fd, OpenMode mode )
     throw exCantOpen( "fd#" + Utils::numberToString( fd ) + ": " + strerror( errno ) );
 }
 
-File::File( char const * filename, OpenMode mode ) throw( exCantOpen ):
+File::File( char const * filename, OpenMode mode ):
   writeBuffer( 0 )
 {
   open( filename, mode );
 }
 
 File::File( std::string const & filename, OpenMode mode )
-  throw( exCantOpen ): writeBuffer( 0 )
 {
   open( filename.c_str(), mode );
 }
 
 File::File( int fd, OpenMode mode )
-  throw( exCantOpen ): writeBuffer( 0 )
 {
   open( fd, mode );
 }
 
-void File::read( void * buf, size_t size ) throw( exReadError, exWriteError )
+void File::read( void * buf, size_t size )
 {
   if ( !size )
     return;
@@ -196,7 +193,7 @@ void File::read( void * buf, size_t size
   }
 }
 
-size_t File::readRecords( void * buf, size_t size, size_t count ) throw( exWriteError )
+size_t File::readRecords( void * buf, size_t size, size_t count )
 {
   if ( writeBuffer )
     flushWriteBuffer();
@@ -204,7 +201,7 @@ size_t File::readRecords( void * buf, si
   return fread( buf, size, count, f );
 }
 
-void File::write( void const * buf, size_t size ) throw( exWriteError )
+void File::write( void const * buf, size_t size )
 {
   if ( !size )
     return;
@@ -250,7 +247,6 @@ void File::write( void const * buf, size
 }
 
 size_t File::writeRecords( void const * buf, size_t size, size_t count )
-  throw( exWriteError )
 {
   flushWriteBuffer();
 
@@ -258,7 +254,6 @@ size_t File::writeRecords( void const *
 }
 
 char * File::gets( char * s, int size, bool stripNl )
-  throw( exWriteError )
 {
   if ( writeBuffer )
     flushWriteBuffer();
@@ -285,7 +280,7 @@ char * File::gets( char * s, int size, b
   return result;
 }
 
-std::string File::gets( bool stripNl ) throw( exReadError, exWriteError )
+std::string File::gets( bool stripNl )
 {
   char buf[ 1024 ];
 
@@ -300,7 +295,7 @@ std::string File::gets( bool stripNl ) t
   return std::string( buf );
 }
 
-void File::seek( long offset ) throw( exSeekError, exWriteError )
+void File::seek( long offset )
 {
   if ( writeBuffer )
     flushWriteBuffer();
@@ -309,7 +304,7 @@ void File::seek( long offset ) throw( ex
     throw exSeekError();
 }
 
-void File::seekCur( long offset ) throw( exSeekError, exWriteError )
+void File::seekCur( long offset )
 {
   if ( writeBuffer )
     flushWriteBuffer();
@@ -318,7 +313,7 @@ void File::seekCur( long offset ) throw(
     throw exSeekError();
 }
 
-void File::seekEnd( long offset ) throw( exSeekError, exWriteError )
+void File::seekEnd( long offset )
 {
   if ( writeBuffer )
     flushWriteBuffer();
@@ -327,12 +322,12 @@ void File::seekEnd( long offset ) throw(
     throw exSeekError();
 }
 
-void File::rewind() throw( exSeekError, exWriteError )
+void File::rewind()
 {
   seek( 0 );
 }
 
-size_t File::tell() throw( exSeekError )
+size_t File::tell()
 {
   long result = ftell( f );
 
@@ -345,7 +340,7 @@ size_t File::tell() throw( exSeekError )
   return ( size_t ) result;
 }
 
-size_t File::size() throw( exSeekError, exWriteError )
+size_t File::size()
 {
   size_t cur = tell();
   seekEnd( 0 );
@@ -355,7 +350,7 @@ size_t File::size() throw( exSeekError,
   return result;
 }
 
-bool File::eof() throw( exWriteError )
+bool File::eof()
 {
   if ( writeBuffer )
     flushWriteBuffer();
@@ -363,21 +358,21 @@ bool File::eof() throw( exWriteError )
   return feof( f );
 }
 
-int File::error() throw( exReadError )
+int File::error()
 {
   int result = ferror( f );
 
   return result;
 }
 
-FILE * File::file() throw( exWriteError )
+FILE * File::file()
 {
   flushWriteBuffer();
 
   return f;
 }
 
-FILE * File::release() throw( exWriteError )
+FILE * File::release()
 {
   releaseWriteBuffer();
 
@@ -388,12 +383,12 @@ FILE * File::release() throw( exWriteErr
   return c;
 }
 
-void File::close() throw( exWriteError )
+void File::close()
 {
   fclose( release() );
 }
 
-File::~File() throw()
+File::~File()
 {
   if ( f )
   {
@@ -408,7 +403,7 @@ File::~File() throw()
   }
 }
 
-void File::flushWriteBuffer() throw( exWriteError )
+void File::flushWriteBuffer()
 {
   if ( writeBuffer && writeBufferLeft != WriteBufferSize )
   {
@@ -421,7 +416,7 @@ void File::flushWriteBuffer() throw( exW
   }
 }
 
-void File::releaseWriteBuffer() throw( exWriteError )
+void File::releaseWriteBuffer()
 {
   flushWriteBuffer();
 
@@ -459,11 +454,11 @@ void File::exReadErrorDetailed::buildDes
     description.append( path, pathChars );
 }
 
-const char * File::exReadErrorDetailed::what() const throw()
+const char * File::exReadErrorDetailed::what()
 {
   return description.c_str();
 }
 
-File::exReadErrorDetailed::~exReadErrorDetailed() throw ()
+File::exReadErrorDetailed::~exReadErrorDetailed()
 {
 }
--- zbackup-1.5.orig/file.hh
+++ zbackup-1.5/file.hh
@@ -39,30 +39,27 @@ public:
 
   typedef long Offset;
 
-  File( char const * filename, OpenMode )
-    throw( exCantOpen );
+  File( char const * filename, OpenMode );
 
-  File( std::string const & filename, OpenMode )
-    throw( exCantOpen );
+  File( std::string const & filename, OpenMode );
 
-  File( int fd, OpenMode )
-    throw( exCantOpen );
+  File( int fd, OpenMode );
 
   /// Reads the number of bytes to the buffer, throws an error if it
   /// failed to fill the whole buffer (short read, i/o error etc)
-  void read( void * buf, size_t size ) throw( exReadError, exWriteError );
+  void read( void * buf, size_t size );
 
   template< typename T >
-  void read( T & value ) throw( exReadError, exWriteError )
+  void read( T & value )
   { read( &value, sizeof( value ) ); }
 
   template< typename T >
-  T read() throw( exReadError, exWriteError )
+  T read()
   { T value; read( value ); return value; }
 
   /// Attempts reading at most 'count' records sized 'size'. Returns
   /// the number of records it managed to read, up to 'count'
-  size_t readRecords( void * buf, size_t size, size_t count ) throw( exWriteError );
+  size_t readRecords( void * buf, size_t size, size_t count );
 
   /// Writes the number of bytes from the buffer, throws an error if it
   /// failed to write the whole buffer (short write, i/o error etc).
@@ -70,81 +67,79 @@ public:
   /// end up on disk immediately, or a short write may occur later
   /// than it really did. If you don't want write buffering, use
   /// writeRecords() function instead
-  void write( void const * buf, size_t size ) throw( exWriteError );
+  void write( void const * buf, size_t size );
 
   template< typename T >
-  void write( T const & value ) throw( exWriteError )
+  void write( T const & value )
   { write( &value, sizeof( value ) ); }
 
   /// Attempts writing at most 'count' records sized 'size'. Returns
   /// the number of records it managed to write, up to 'count'.
   /// This function does not employ buffering, but flushes the buffer if it
   /// was used before
-  size_t writeRecords( void const * buf, size_t size, size_t count )
-    throw( exWriteError );
+  size_t writeRecords( void const * buf, size_t size, size_t count );
 
   /// Reads a string from the file. Unlike the normal fgets(), this one
   /// can strip the trailing newline character, if this was requested.
   /// Returns either s or 0 if no characters were read
-  char * gets( char * s, int size, bool stripNl = false ) throw( exWriteError );
+  char * gets( char * s, int size, bool stripNl = false );
 
   /// Like the above, but uses its own local internal buffer (1024 bytes
   /// currently), and strips newlines by default
-  std::string gets( bool stripNl = true ) throw( exReadError, exWriteError );
+  std::string gets( bool stripNl = true );
 
   /// Seeks in the file, relative to its beginning
-  void seek( long offset ) throw( exSeekError, exWriteError );
+  void seek( long offset );
   /// Seeks in the file, relative to the current position
-  void seekCur( long offset ) throw( exSeekError, exWriteError );
+  void seekCur( long offset );
   /// Seeks in the file, relative to the end of file
-  void seekEnd( long offset = 0 ) throw( exSeekError, exWriteError );
+  void seekEnd( long offset = 0 );
 
   /// Seeks to the beginning of file
-  void rewind() throw( exSeekError, exWriteError );
+  void rewind();
 
   /// Tells the current position within the file, relative to its beginning
-  size_t tell() throw( exSeekError );
+  size_t tell();
 
   /// Returns file size
-  size_t size() throw( exSeekError, exWriteError );
+  size_t size();
 
   /// Returns true if end-of-file condition is set
-  bool eof() throw( exWriteError );
+  bool eof();
 
   /// Returns ferror
-  int error() throw( exReadError );
+  int error();
 
   /// Returns the underlying FILE * record, so other operations can be
   /// performed on it
-  FILE * file() throw( exWriteError );
+  FILE * file();
 
   /// Releases the file handle out of the control of the class. No further
   /// operations are valid. The file will not be closed on destruction
-  FILE * release() throw( exWriteError );
+  FILE * release();
 
   /// Closes the file. No further operations are valid
-  void close() throw( exWriteError );
+  void close();
 
   /// Checks if the file exists or not
-  static bool exists( char const * filename ) throw();
+  static bool exists( char const * filename );
 
-  static bool exists( std::string const & filename ) throw()
+  static bool exists( std::string const & filename )
   { return exists( filename.c_str() ); }
 
   /// Returns false when lstat returns stat::st_mode having 
   /// S_IFREG (filename is a file, or softlink to a file, and
   /// is not a socket, fifo, device node, etc.
-  static bool special( std::string const & filename ) throw();
+  static bool special( std::string const & filename );
 
-  ~File() throw();
+  ~File();
 
   /// Erases the given file
-  static void erase( std::string const & ) throw( exCantErase );
+  static void erase( std::string const & );
 
   /// Renames the given file
   static void rename( std::string const & from,
-                      std::string const & to ) throw( exCantRename,
-                                                      exCantErase );
+                      std::string const & to );
 
   /// Throwing this class instead of exReadError will make the description
   /// include the file name
@@ -155,8 +150,8 @@ public:
   public:
     exReadErrorDetailed( int fd );
     exReadErrorDetailed( FILE * f );
-    virtual const char * what() const throw();
-    virtual ~exReadErrorDetailed() throw ();
+    virtual const char * what();
+    virtual ~exReadErrorDetailed();
 
   private:
     void buildDescription( int fd );
@@ -164,10 +159,10 @@ public:
 
 private:
 
-  void open( char const * filename, OpenMode ) throw( exCantOpen );
-  void open( int fd, OpenMode ) throw( exCantOpen );
-  void flushWriteBuffer() throw( exWriteError );
-  void releaseWriteBuffer() throw( exWriteError );
+  void open( char const * filename, OpenMode );
+  void open( int fd, OpenMode );
+  void flushWriteBuffer();
+  void releaseWriteBuffer();
 };
 
 #endif
--- zbackup-1.5.orig/unbuffered_file.cc
+++ zbackup-1.5/unbuffered_file.cc
@@ -19,7 +19,6 @@
 
 
 UnbufferedFile::UnbufferedFile( char const * fileName, Mode mode )
-  throw( exCantOpen )
 {
 
   int flags = ( mode == ReadWrite ? ( O_RDWR | O_CREAT ) :
@@ -33,7 +32,6 @@ UnbufferedFile::UnbufferedFile( char con
 }
 
 size_t UnbufferedFile::read( void * buf, size_t size )
-  throw( exReadError )
 {
   char * next = ( char * ) buf;
   size_t left = size;
@@ -61,7 +59,6 @@ size_t UnbufferedFile::read( void * buf,
 }
 
 void UnbufferedFile::write( void const * buf, size_t size )
-  throw( exWriteError )
 {
   char const * next = ( char const * ) buf;
   size_t left = size;
@@ -83,7 +80,7 @@ void UnbufferedFile::write( void const *
   }
 }
 
-UnbufferedFile::Offset UnbufferedFile::size() throw( exSeekError )
+UnbufferedFile::Offset UnbufferedFile::size()
 {
   Offset cur = lseek64( fd, 0, SEEK_CUR );
   if ( cur < 0 )
@@ -94,19 +91,19 @@ UnbufferedFile::Offset UnbufferedFile::s
   return result;
 }
 
-void UnbufferedFile::seekCur( Offset offset ) throw( exSeekError )
+void UnbufferedFile::seekCur( Offset offset )
 {
   if ( lseek64( fd, offset, SEEK_CUR ) < 0 )
     throw exSeekError();
 }
 
-void UnbufferedFile::seek( Offset offset ) throw( exSeekError )
+void UnbufferedFile::seek( Offset offset )
 {
   if ( lseek64( fd, offset, SEEK_SET ) < 0 )
     throw exSeekError();
 }
 
-UnbufferedFile::~UnbufferedFile() throw()
+UnbufferedFile::~UnbufferedFile()
 {
   close( fd );
 }
--- zbackup-1.5.orig/unbuffered_file.hh
+++ zbackup-1.5/unbuffered_file.hh
@@ -38,26 +38,26 @@ public:
   typedef int64_t Offset;
 
   /// Opens the given file
-  UnbufferedFile( char const * fileName, Mode ) throw( exCantOpen );
+  UnbufferedFile( char const * fileName, Mode );
 
   /// Reads up to 'size' bytes into the buffer. Returns the number of bytes
   /// read. If the value returned is less than the 'size' provided, the end of
   /// file was reached
-  size_t read( void * buf, size_t size ) throw( exReadError );
+  size_t read( void * buf, size_t size );
 
   /// Writes 'size' bytes
-  void write( void const * buf, size_t size ) throw( exWriteError );
+  void write( void const * buf, size_t size );
 
   /// Returns file size
-  Offset size() throw( exSeekError );
+  Offset size();
 
   /// Seeks to the given offset, relative to the current file offset
-  void seekCur( Offset ) throw( exSeekError );
+  void seekCur( Offset );
 
   /// Seeks to the given offset, relative to the beginning
-  void seek( Offset ) throw( exSeekError );
+  void seek( Offset );
 
-  ~UnbufferedFile() throw();
+  ~UnbufferedFile();
 
 private:
   int fd;
