diff --git a/src/Makefile b/src/Makefile index bb1ddf95..a42ba907 100644 --- a/src/Makefile +++ b/src/Makefile @@ -231,7 +231,7 @@ lib: $(OBJ) @touch lib $(EXIV2BIN): lib $(EXIV2OBJ) $(EXIV2COBJ) - -mkdir ../bin >/dev/null 2>&1 + -mkdir -p ../bin >/dev/null 2>&1 @$(LIBTOOL) --mode=link $(LINK.cc) -o $@ $(LIBRARY) $(EXIV2OBJ) $(EXIV2COBJ) -rpath $(libdir) install-header: diff --git a/src/futils.cpp b/src/futils.cpp index fbd718ea..b6305c50 100644 --- a/src/futils.cpp +++ b/src/futils.cpp @@ -86,23 +86,25 @@ namespace Exiv2 { } // fileExists #endif + +#define UNUSED(x) (void)(x) + std::string strError() { - int error = errno; + int error = errno; std::ostringstream os; -#ifdef EXV_HAVE_STRERROR_R +#ifdef EXV_HAVE_STRERROR_R const size_t n = 1024; -// _GNU_SOURCE: See Debian bug #485135 -# if defined EXV_STRERROR_R_CHAR_P && defined _GNU_SOURCE - char *buf = 0; - char buf2[n]; - std::memset(buf2, 0x0, n); - buf = strerror_r(error, buf2, n); -# else - char buf[n]; - std::memset(buf, 0x0, n); - strerror_r(error, buf, n); -# endif + char buff[n]; + std::memset(buff, 0x0, n); + // _GNU_SOURCE: See Debian bug #485135 +#ifdef STRERROR_R_CHAR_P + char* buf = strerror_r(error, buff, n); +#else + char* buf = buff; + int dummy = strerror_r(error, buff, n); + UNUSED(dummy); +#endif os << buf; // Issue# 908. // report strerror() if strerror_r() returns empty diff --git a/src/makernote.cpp b/src/makernote.cpp index f6be4f91..31f6e2ec 100644 --- a/src/makernote.cpp +++ b/src/makernote.cpp @@ -1026,10 +1026,10 @@ namespace Exiv2 { TiffComponent* newCasioMn(uint16_t tag, IfdId group, - IfdId mnGroup, + IfdId /* mnGroup*/, const byte* pData, uint32_t size, - ByteOrder byteOrder) + ByteOrder/* byteOrder */ ) { if (size > 6 && std::string(reinterpret_cast(pData), 6) == std::string("QVC\0\0\0", 6)) { diff --git a/src/tiffvisitor.cpp b/src/tiffvisitor.cpp index af519ad6..6bd076d3 100644 --- a/src/tiffvisitor.cpp +++ b/src/tiffvisitor.cpp @@ -101,13 +101,13 @@ namespace Exiv2 { void TiffVisitor::setGo(GoEvent event, bool go) { - assert(event >= 0 && event < events_); + assert(event >= 0 && static_cast(event) < events_); go_[event] = go; } bool TiffVisitor::go(GoEvent event) const { - assert(event >= 0 && event < events_); + assert(event >= 0 && static_cast(event) < events_); return go_[event]; } diff --git a/xmpsdk/include/XMP_Environment.h b/xmpsdk/include/XMP_Environment.h index 9180d231..bfaa5a83 100644 --- a/xmpsdk/include/XMP_Environment.h +++ b/xmpsdk/include/XMP_Environment.h @@ -128,6 +128,8 @@ #endif #endif +#define UNUSED(x) (void)(x) + // ================================================================================================= // Macintosh Specific Settings // =========================== diff --git a/xmpsdk/src/MD5.cpp b/xmpsdk/src/MD5.cpp index a6e2e822..f162b728 100644 --- a/xmpsdk/src/MD5.cpp +++ b/xmpsdk/src/MD5.cpp @@ -130,7 +130,7 @@ MD5Final(md5byte digest[16], struct MD5_CTX *ctx) byteSwap(ctx->buf, 4); memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ } /* The four core functions - F1 is optimized somewhat */ diff --git a/xmpsdk/src/XMPIterator.cpp b/xmpsdk/src/XMPIterator.cpp index 8ae756d8..71702bd5 100644 --- a/xmpsdk/src/XMPIterator.cpp +++ b/xmpsdk/src/XMPIterator.cpp @@ -46,7 +46,7 @@ static XMP_Node * sDummySchema = 0; // ! Used for some ugliness with aliases. static void AddSchemaProps ( IterInfo & info, IterNode & iterSchema, const XMP_Node * xmpSchema ) { - info = info; // Avoid unused parameter warning. + UNUSED(info); #if TraceIterators printf ( " Adding properties of %s\n", xmpSchema->name.c_str() ); #endif @@ -399,7 +399,7 @@ XMPIterator::Terminate() RELEASE_NO_THROW void XMPIterator::Unlock ( XMP_OptionBits options ) { - options = options; // Avoid unused parameter warning. + UNUSED(options); XMPMeta::Unlock ( 0 ); @@ -727,7 +727,7 @@ XMPIterator::Skip ( XMP_OptionBits iterOptions ) void XMPIterator::UnlockIter ( XMP_OptionBits options ) { - options = options; // Avoid unused parameter warning. + UNUSED(options); XMPMeta::Unlock ( 0 ); diff --git a/xmpsdk/src/XMPMeta-GetSet.cpp b/xmpsdk/src/XMPMeta-GetSet.cpp index 992539b8..9972f9e6 100644 --- a/xmpsdk/src/XMPMeta-GetSet.cpp +++ b/xmpsdk/src/XMPMeta-GetSet.cpp @@ -840,7 +840,7 @@ XMPMeta::SetLocalizedText ( XMP_StringPtr schemaNS, XMP_StringPtr itemValue, XMP_OptionBits options ) { - options = options; // Avoid unused parameter warning. + UNUSED(options); // Avoid unused parameter warning. XMP_Assert ( (schemaNS != 0) && (arrayName != 0) && (_genericLang != 0) && (_specificLang != 0) ); // Enforced by wrapper. diff --git a/xmpsdk/src/XMPMeta.cpp b/xmpsdk/src/XMPMeta.cpp index f55a3b98..67b9b0a1 100644 --- a/xmpsdk/src/XMPMeta.cpp +++ b/xmpsdk/src/XMPMeta.cpp @@ -838,7 +838,7 @@ XMPMeta::Terminate() RELEASE_NO_THROW /* class-static */ void XMPMeta::Unlock ( XMP_OptionBits options ) { - options = options; // Avoid unused parameter warning. // *** Need IgnoreParam macro. + UNUSED(options); #if TraceXMPLocking fprintf ( xmpOut, " Unlocking XMP toolkit, count = %d\n", sLockCount ); fflush ( xmpOut ); @@ -857,7 +857,7 @@ XMPMeta::Unlock ( XMP_OptionBits options ) void XMPMeta::UnlockObject ( XMP_OptionBits options ) const { - options = options; // Avoid unused parameter warning. + UNUSED(options); XMPMeta::Unlock ( 0 ); diff --git a/xmpsdk/src/XMPUtils-FileInfo.cpp b/xmpsdk/src/XMPUtils-FileInfo.cpp index 159b542e..0c0279fe 100644 --- a/xmpsdk/src/XMPUtils-FileInfo.cpp +++ b/xmpsdk/src/XMPUtils-FileInfo.cpp @@ -1202,7 +1202,7 @@ XMPUtils::DuplicateSubtree ( const XMPMeta & source, XMP_StringPtr destRoot, XMP_OptionBits options ) { - options = options; // Avoid unused parameter warning. + UNUSED(options); bool fullSourceTree = false; bool fullDestTree = false; diff --git a/xmpsdk/src/XMPUtils.cpp b/xmpsdk/src/XMPUtils.cpp index 2458b3b9..b5c152e8 100644 --- a/xmpsdk/src/XMPUtils.cpp +++ b/xmpsdk/src/XMPUtils.cpp @@ -670,7 +670,7 @@ XMPUtils::Terminate() RELEASE_NO_THROW /* class static */ void XMPUtils::Unlock ( XMP_OptionBits options ) { - options = options; // Avoid unused parameter warning. + UNUSED(options); XMPMeta::Unlock ( 0 );