[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:36:11 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=bac67ee
The following commit has been merged in the master branch:
commit bac67ee39fb46fc5e91c4e62a59b406718008872
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Sat Mar 20 05:35:10 2004 +0000
Use assert macro where appropriate
---
src/exif.cpp | 12 +++++-------
src/ifd.cpp | 20 +++++++-------------
2 files changed, 12 insertions(+), 20 deletions(-)
diff --git a/src/exif.cpp b/src/exif.cpp
index b5478eb..0f608b9 100644
--- a/src/exif.cpp
+++ b/src/exif.cpp
@@ -20,14 +20,14 @@
*/
/*
File: exif.cpp
- Version: $Name: $ $Revision: 1.29 $
+ Version: $Name: $ $Revision: 1.30 $
Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
History: 26-Jan-04, ahu: created
11-Feb-04, ahu: isolated as a component
*/
// *****************************************************************************
#include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name: $ $Revision: 1.29 $ $RCSfile: exif.cpp,v $")
+EXIV2_RCSID("@(#) $Name: $ $Revision: 1.30 $ $RCSfile: exif.cpp,v $")
// *****************************************************************************
// included header files
@@ -49,6 +49,7 @@ EXIV2_RCSID("@(#) $Name: $ $Revision: 1.29 $ $RCSfile: exif.cpp,v $")
#include <algorithm>
#include <map>
#include <cstring>
+#include <cassert>
// *****************************************************************************
// local declarations
@@ -590,9 +591,7 @@ namespace Exif {
long size = this->size();
char* buf = new char[size];
long actualSize = copy(buf);
- if (actualSize > size) {
- throw Error("Invariant violated in ExifData::write");
- }
+ assert(actualSize <= size);
JpegImage img;
img.setExifData(buf, actualSize);
delete[] buf;
@@ -953,8 +952,7 @@ std::cerr << "->>>>>> writing from metadata <<<<<<-
";
void addToIfd(Ifd& ifd, const Metadatum& metadatum, ByteOrder byteOrder)
{
- // Todo: Implement Assert (Stroustup 24.3.7.2)
- if (!ifd.alloc()) throw Error("Invariant violated in addToIfd");
+ assert(ifd.alloc());
Entry e;
e.setIfdId(metadatum.ifdId());
diff --git a/src/ifd.cpp b/src/ifd.cpp
index a276846..38136ec 100644
--- a/src/ifd.cpp
+++ b/src/ifd.cpp
@@ -20,14 +20,14 @@
*/
/*
File: ifd.cpp
- Version: $Name: $ $Revision: 1.12 $
+ Version: $Name: $ $Revision: 1.13 $
Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
History: 26-Jan-04, ahu: created
11-Feb-04, ahu: isolated as a component
*/
// *****************************************************************************
#include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name: $ $Revision: 1.12 $ $RCSfile: ifd.cpp,v $")
+EXIV2_RCSID("@(#) $Name: $ $Revision: 1.13 $ $RCSfile: ifd.cpp,v $")
// *****************************************************************************
// included header files
@@ -40,9 +40,10 @@ EXIV2_RCSID("@(#) $Name: $ $Revision: 1.12 $ $RCSfile: ifd.cpp,v $")
#include <iostream>
#include <iomanip>
#include <sstream>
+#include <vector>
#include <algorithm>
#include <cstring>
-#include <vector>
+#include <cassert>
// *****************************************************************************
// class member definitions
@@ -105,9 +106,7 @@ namespace Exif {
void Entry::setValue(uint32 data, ByteOrder byteOrder)
{
if (data_ == 0 || size_ < 4) {
- if (!alloc_) {
- throw Error("cannot allocate memory");
- }
+ assert(alloc_);
size_ = 4;
delete[] data_;
data_ = new char[size_];
@@ -327,13 +326,8 @@ namespace Exif {
void Ifd::add(const Entry& entry)
{
- // Todo: Implement Assert (Stroustup 24.3.7.2)
- if (alloc_ != entry.alloc()) {
- throw Error("Ifd::add : alloc mismatch");
- }
- if (ifdId_ != entry.ifdId()) {
- throw Error("Ifd::add : ifdId mismatch");
- }
+ assert(alloc_ == entry.alloc());
+ assert(ifdId_ == entry.ifdId());
// allow duplicates
entries_.push_back(entry);
}
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list