aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortholdawa <[email protected]>2014-01-14 23:28:58 +0000
committertholdawa <[email protected]>2014-01-14 23:28:58 +0000
commitd4c5386556fe7cb4b301fc79210dde47962c96b7 (patch)
tree0eb23a3911c660f3afb30ce737ef8474d06c9d04
parentReset line length after encoding a hard line break in QP encoding. (diff)
downloadvmime-d4c5386556fe7cb4b301fc79210dde47962c96b7.tar.gz
vmime-d4c5386556fe7cb4b301fc79210dde47962c96b7.zip
C++11 std::shared_ptr fixes:
Test for C++11 std::shared_ptr was always failing because std::make_shared was calling a constructor of 1 argument which did not exist for the struct A. Changed test code snippet to call default no argument constructor of A. Once C++11 std::shared_ptr support was fixed, contentDispositionField.cpp and contentTypeField.cpp would not compile because std::shared_ptr cannot be implicitly cast to bool (i.e. in a return statement). Added explicit cast to bool.
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/vmime/contentDispositionField.cpp10
-rw-r--r--src/vmime/contentTypeField.cpp6
3 files changed, 9 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e20d00d1..25f74e64 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -815,7 +815,7 @@ CHECK_CXX_SOURCE_COMPILES(
#include <memory>
struct A { int foo; };
int main() {
- std::shared_ptr <A> a = std::make_shared <A>(a);
+ std::shared_ptr <A> a = std::make_shared <A>();
return 0;
}
"
diff --git a/src/vmime/contentDispositionField.cpp b/src/vmime/contentDispositionField.cpp
index 5a9c1212..33234be8 100644
--- a/src/vmime/contentDispositionField.cpp
+++ b/src/vmime/contentDispositionField.cpp
@@ -42,7 +42,7 @@ contentDispositionField::contentDispositionField(contentDispositionField&)
bool contentDispositionField::hasCreationDate() const
{
- return findParameter("creation-date");
+ return bool(findParameter("creation-date"));
}
@@ -65,7 +65,7 @@ void contentDispositionField::setCreationDate(const datetime& creationDate)
bool contentDispositionField::hasModificationDate() const
{
- return findParameter("modification-date");
+ return bool(findParameter("modification-date"));
}
@@ -88,7 +88,7 @@ void contentDispositionField::setModificationDate(const datetime& modificationDa
bool contentDispositionField::hasReadDate() const
{
- return findParameter("read-date");
+ return bool(findParameter("read-date"));
}
@@ -111,7 +111,7 @@ void contentDispositionField::setReadDate(const datetime& readDate)
bool contentDispositionField::hasFilename() const
{
- return findParameter("filename");
+ return bool(findParameter("filename"));
}
@@ -134,7 +134,7 @@ void contentDispositionField::setFilename(const word& filename)
bool contentDispositionField::hasSize() const
{
- return findParameter("size");
+ return bool(findParameter("size"));
}
diff --git a/src/vmime/contentTypeField.cpp b/src/vmime/contentTypeField.cpp
index 9f38294a..c36535f3 100644
--- a/src/vmime/contentTypeField.cpp
+++ b/src/vmime/contentTypeField.cpp
@@ -42,7 +42,7 @@ contentTypeField::contentTypeField(contentTypeField&)
bool contentTypeField::hasBoundary() const
{
- return findParameter("boundary");
+ return bool(findParameter("boundary"));
}
@@ -65,7 +65,7 @@ void contentTypeField::setBoundary(const string& boundary)
bool contentTypeField::hasCharset() const
{
- return findParameter("charset");
+ return bool(findParameter("charset"));
}
@@ -88,7 +88,7 @@ void contentTypeField::setCharset(const charset& ch)
bool contentTypeField::hasReportType() const
{
- return findParameter("report-type");
+ return bool(findParameter("report-type"));
}