diff --git a/src/futils.cpp b/src/futils.cpp index b6305c50..e12251f3 100644 --- a/src/futils.cpp +++ b/src/futils.cpp @@ -89,6 +89,17 @@ namespace Exiv2 { #define UNUSED(x) (void)(x) +#if EXV_HAVE_STRERROR_R +#ifndef STRERROR_R_CHAR_P +// man 3 sterror_r +#if ( _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 ) && ! _GNU_SOURCE +// XSI-compliant version of strerror_r() is provided +#else +#define STRERROR_R_CHAR_P +#endif +#endif +#endif + std::string strError() { int error = errno; diff --git a/xmpsdk/src/XMPCore_Impl.cpp b/xmpsdk/src/XMPCore_Impl.cpp index 60a7194b..e3632b98 100644 --- a/xmpsdk/src/XMPCore_Impl.cpp +++ b/xmpsdk/src/XMPCore_Impl.cpp @@ -845,9 +845,9 @@ FindSchemaNode ( XMP_Node * xmpTree, schemaNode = new XMP_Node ( xmpTree, nsURI, (kXMP_SchemaNode | kXMP_NewImplicitNode) ); XMP_StringPtr prefixPtr; XMP_StringLen prefixLen; - bool found = false; - found = XMPMeta::GetNamespacePrefix ( nsURI, &prefixPtr, &prefixLen ); // *** Use map directly? + bool found = XMPMeta::GetNamespacePrefix ( nsURI, &prefixPtr, &prefixLen ); // *** Use map directly? XMP_Assert ( found ); + UNUSED(found); schemaNode->value.assign ( prefixPtr, prefixLen ); xmpTree->children.push_back ( schemaNode ); diff --git a/xmpsdk/src/XMPMeta.cpp b/xmpsdk/src/XMPMeta.cpp index 67b9b0a1..2720cf25 100644 --- a/xmpsdk/src/XMPMeta.cpp +++ b/xmpsdk/src/XMPMeta.cpp @@ -739,14 +739,14 @@ XMPMeta::Initialize() XMP_Assert ( sizeof(XMP_Uns64) == 8 ); XMP_Assert ( sizeof(XMP_OptionBits) == 4 ); // Check that option masking work on all 32 bits. - XMP_OptionBits flag; - flag = ~0UL; + XMP_OptionBits flag = ~0UL; + XMP_Assert ( flag == (XMP_OptionBits)(-1L) ); XMP_Assert ( (flag ^ kXMP_PropHasLang) == 0xFFFFFFBFUL ); XMP_Assert ( (flag & ~kXMP_PropHasLang) == 0xFFFFFFBFUL ); XMP_OptionBits opt1 = 0; // Check the general option bit macros. - XMP_OptionBits opt2 = ~0UL; + XMP_OptionBits opt2 = flag; XMP_SetOption ( opt1, kXMP_PropValueIsArray ); XMP_ClearOption ( opt2, kXMP_PropValueIsArray ); XMP_Assert ( opt1 == ~opt2 ); diff --git a/xmpsdk/src/XMPUtils.cpp b/xmpsdk/src/XMPUtils.cpp index b5c152e8..1cdab478 100644 --- a/xmpsdk/src/XMPUtils.cpp +++ b/xmpsdk/src/XMPUtils.cpp @@ -602,9 +602,9 @@ static size_t MoveLargestProperty ( XMPMeta & stdXMP, XMPMeta * extXMP, PropSize printf ( " Move %s, %d bytes\n", propName, propSize ); #endif - bool moved = false; - moved = MoveOneProperty ( stdXMP, extXMP, schemaURI, propName ); + bool moved = MoveOneProperty ( stdXMP, extXMP, schemaURI, propName ); XMP_Assert ( moved ); + UNUSED(moved); propSizes.erase ( lastPos ); return propSize; @@ -1845,6 +1845,7 @@ XMPUtils::PackageForJPEG ( const XMPMeta & origXMP, const char * packetEnd = 0; packetEnd = sStandardXMP->c_str() + sStandardXMP->size() - kTrailerLen; XMP_Assert ( XMP_LitMatch ( packetEnd, kPacketTrailer ) ); + UNUSED(packetEnd); size_t extraPadding = kStdXMPLimit - sStandardXMP->size(); // ! Do this before erasing the trailer. if ( extraPadding > 2047 ) extraPadding = 2047;