[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:40:39 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=4359702
The following commit has been merged in the master branch:
commit 4359702117e856a1786f0a3e6172b17f405d95ee
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Tue Jul 7 14:13:03 2009 +0000
#600: Upgrading XMP-Toolkit to version 4.4; re-applied the changes done previously. (STILL DOESN'T COMPILE)
---
xmpsdk/include/TXMPIterator.hpp | 2 +-
xmpsdk/include/TXMPMeta.hpp | 2 +-
xmpsdk/include/TXMPUtils.hpp | 2 +-
xmpsdk/include/XMP.incl_cpp | 6 +--
xmpsdk/include/XMPSDK.hpp | 11 +-----
xmpsdk/include/XMP_Environment.h | 17 +++++++++
xmpsdk/include/XMP_Version.h | 2 +-
xmpsdk/include/client-glue/TXMPIterator.incl_cpp | 2 +-
xmpsdk/include/client-glue/TXMPMeta.incl_cpp | 2 +-
xmpsdk/include/client-glue/TXMPUtils.incl_cpp | 2 +-
xmpsdk/src/ParseRDF.cpp | 48 ------------------------
xmpsdk/src/XMPCore_Impl.cpp | 4 +-
xmpsdk/src/XMPCore_Impl.hpp | 3 +-
xmpsdk/src/XMPIterator.cpp | 6 +--
xmpsdk/src/XMPMeta-Parse.cpp | 2 +-
xmpsdk/src/XMPMeta-Serialize.cpp | 11 ------
xmpsdk/src/XMPMeta.cpp | 15 +++++---
xmpsdk/src/XMPMeta.hpp | 2 +-
xmpsdk/src/XMPUtils.cpp | 28 ++++++++------
19 files changed, 61 insertions(+), 106 deletions(-)
diff --git a/xmpsdk/include/TXMPIterator.hpp b/xmpsdk/include/TXMPIterator.hpp
index c347cf0..c3d396d 100644
--- a/xmpsdk/include/TXMPIterator.hpp
+++ b/xmpsdk/include/TXMPIterator.hpp
@@ -2,7 +2,7 @@
#define __TXMPIterator_hpp__ 1
#if ( ! __XMP_hpp__ )
- #error "Do not directly include, use XMP.hpp"
+ #error "Do not directly include, use XMPSDK.hpp"
#endif
// =================================================================================================
diff --git a/xmpsdk/include/TXMPMeta.hpp b/xmpsdk/include/TXMPMeta.hpp
index 209548c..341f7f3 100644
--- a/xmpsdk/include/TXMPMeta.hpp
+++ b/xmpsdk/include/TXMPMeta.hpp
@@ -2,7 +2,7 @@
#define __TXMPMeta_hpp__ 1
#if ( ! __XMP_hpp__ )
- #error "Do not directly include, use XMP.hpp"
+ #error "Do not directly include, use XMPSDK.hpp"
#endif
// =================================================================================================
diff --git a/xmpsdk/include/TXMPUtils.hpp b/xmpsdk/include/TXMPUtils.hpp
index 4c69edd..95258bd 100644
--- a/xmpsdk/include/TXMPUtils.hpp
+++ b/xmpsdk/include/TXMPUtils.hpp
@@ -2,7 +2,7 @@
#define __TXMPUtils_hpp__ 1
#if ( ! __XMP_hpp__ )
- #error "Do not directly include, use XMP.hpp"
+ #error "Do not directly include, use XMPSDK.hpp"
#endif
// =================================================================================================
diff --git a/xmpsdk/include/XMP.incl_cpp b/xmpsdk/include/XMP.incl_cpp
index 79655be..28eddea 100644
--- a/xmpsdk/include/XMP.incl_cpp
+++ b/xmpsdk/include/XMP.incl_cpp
@@ -28,7 +28,7 @@
/// \endcode
-#include "XMP.hpp" // ! This must be the first include!
+#include "XMPSDK.hpp" // ! This must be the first include!
#define XMP_ClientBuild 1
@@ -53,10 +53,6 @@
template class TXMPMeta <TXMP_STRING_TYPE>;
template class TXMPIterator <TXMP_STRING_TYPE>;
template class TXMPUtils <TXMP_STRING_TYPE>;
- #if XMP_INCLUDE_XMPFILES
- #include "client-glue/TXMPFiles.incl_cpp"
- template class TXMPFiles <TXMP_STRING_TYPE>;
- #endif
#endif
diff --git a/xmpsdk/include/XMPSDK.hpp b/xmpsdk/include/XMPSDK.hpp
index 62e230d..3306352 100644
--- a/xmpsdk/include/XMPSDK.hpp
+++ b/xmpsdk/include/XMPSDK.hpp
@@ -10,7 +10,7 @@
// =================================================================================================
// ================================================================================================
-///
ile XMP.hpp
+///
ile XMPSDK.hpp
/// rief Overall header file for the XMP Toolkit
///
/// This is an overall header file, the only one that C++ clients should include.
@@ -76,17 +76,8 @@
#include "client-glue/TXMPMeta.incl_cpp"
#include "client-glue/TXMPIterator.incl_cpp"
#include "client-glue/TXMPUtils.incl_cpp"
- #include "client-glue/TXMPFiles.incl_cpp"
#endif
- #if XMP_INCLUDE_XMPFILES
- #include "TXMPFiles.hpp" // ! Needs typedef for SXMPMeta.
- typedef class TXMPFiles <TXMP_STRING_TYPE> SXMPFiles;
- #if TXMP_EXPAND_INLINE
- #include "client-glue/TXMPFiles.incl_cpp"
- #endif
- #endif
-
#endif // TXMP_STRING_TYPE
#if XMP_WinBuild
diff --git a/xmpsdk/include/XMP_Environment.h b/xmpsdk/include/XMP_Environment.h
index 8a77e2c..a6b6c6c 100644
--- a/xmpsdk/include/XMP_Environment.h
+++ b/xmpsdk/include/XMP_Environment.h
@@ -26,6 +26,23 @@
// requires these to be defined without values, they are only used here to define XMP-specific
// macros with 0 or 1 values.
+/* 20-Oct-07, ahu: Determine the platform, set the above defines accordingly. */
+#define _FILE_OFFSET_BITS 64
+#if defined __CYGWIN32__ && !defined __CYGWIN__
+ /* For backwards compatibility with Cygwin b19 and
+ earlier, we define __CYGWIN__ here, so that
+ we can rely on checking just for that macro. */
+# define __CYGWIN__ __CYGWIN32__
+#endif
+#if defined WIN32 && !defined __CYGWIN__
+# define WIN_ENV 1
+/* Todo: How to correctly recognize a Mac platform? */
+#elif defined macintosh || defined MACOS_CLASSIC || defined MACOS_X_UNIX || defined MACOS_X || defined MACOS
+# define MAC_ENV 1
+#else
+# define UNIX_ENV 1
+#endif
+
// ! Tempting though it might be to have a standard macro for big or little endian, there seems to
// ! be no decent way to do that on our own in UNIX. Forcing it on the client isn't acceptable.
diff --git a/xmpsdk/include/XMP_Version.h b/xmpsdk/include/XMP_Version.h
index 0c842d0..f8b0ea8 100644
--- a/xmpsdk/include/XMP_Version.h
+++ b/xmpsdk/include/XMP_Version.h
@@ -38,7 +38,7 @@ versions.
#define XMP_API_VERSION_MICRO 0
#define XMP_API_VERSION 4.4
-#define XMP_API_VERSION_STRING "4.4.0"
+#define XMP_API_VERSION_STRING "4.4.0-Exiv2"
/* ============================================================================================= */
diff --git a/xmpsdk/include/client-glue/TXMPIterator.incl_cpp b/xmpsdk/include/client-glue/TXMPIterator.incl_cpp
index 318fa66..672203e 100644
--- a/xmpsdk/include/client-glue/TXMPIterator.incl_cpp
+++ b/xmpsdk/include/client-glue/TXMPIterator.incl_cpp
@@ -11,7 +11,7 @@
///
ile TXMPIterator.incl_cpp
/// rief The implementation of the TXMPIterator template class.
-#include "XMP.hpp"
+#include "XMPSDK.hpp"
#include "client-glue/WXMP_Common.hpp"
#include "client-glue/WXMPIterator.hpp"
diff --git a/xmpsdk/include/client-glue/TXMPMeta.incl_cpp b/xmpsdk/include/client-glue/TXMPMeta.incl_cpp
index 624198b..d9b77a6 100644
--- a/xmpsdk/include/client-glue/TXMPMeta.incl_cpp
+++ b/xmpsdk/include/client-glue/TXMPMeta.incl_cpp
@@ -11,7 +11,7 @@
///
ile TXMPMeta.incl_cpp
/// rief The implementation of the TXMPMeta template class.
-#include "XMP.hpp"
+#include "XMPSDK.hpp"
#include "client-glue/WXMP_Common.hpp"
#include "client-glue/WXMPMeta.hpp"
diff --git a/xmpsdk/include/client-glue/TXMPUtils.incl_cpp b/xmpsdk/include/client-glue/TXMPUtils.incl_cpp
index 2ab5745..6898be7 100644
--- a/xmpsdk/include/client-glue/TXMPUtils.incl_cpp
+++ b/xmpsdk/include/client-glue/TXMPUtils.incl_cpp
@@ -11,7 +11,7 @@
///
ile TXMPUtils.incl_cpp
/// rief The implementation of the TXMPUtils template class.
-#include "XMP.hpp"
+#include "XMPSDK.hpp"
#include "client-glue/WXMP_Common.hpp"
#include "client-glue/WXMPUtils.hpp"
diff --git a/xmpsdk/src/ParseRDF.cpp b/xmpsdk/src/ParseRDF.cpp
index 31fb2b9..330080a 100644
--- a/xmpsdk/src/ParseRDF.cpp
+++ b/xmpsdk/src/ParseRDF.cpp
@@ -318,21 +318,6 @@ IsCoreSyntaxTerm ( RDFTermKind term )
} // IsCoreSyntaxTerm
-// -------------------------------------------------------------------------------------------------
-// IsSyntaxTerm
-// ------------
-//
-// 7.2.3 syntaxTerms
-// coreSyntaxTerms | rdf:Description | rdf:li
-
-static bool
-IsSyntaxTerm ( RDFTermKind term )
-{
-
- if ( (kRDFTerm_FirstSyntax <= term) && (term <= kRDFTerm_LastSyntax) ) return true;
- return false;
-
-} // IsSyntaxTerm
// -------------------------------------------------------------------------------------------------
// IsOldTerm
@@ -351,22 +336,6 @@ IsOldTerm ( RDFTermKind term )
} // IsOldTerm
// -------------------------------------------------------------------------------------------------
-// IsNodeElementName
-// -----------------
-//
-// 7.2.5 nodeElementURIs
-// anyURI - ( coreSyntaxTerms | rdf:li | oldTerms )
-
-static bool
-IsNodeElementName ( RDFTermKind term )
-{
-
- if ( (term == kRDFTerm_li) || IsOldTerm ( term ) ) return false;
- return (! IsCoreSyntaxTerm ( term ));
-
-} // IsNodeElementName
-
-// -------------------------------------------------------------------------------------------------
// IsPropertyElementName
// ---------------------
//
@@ -382,23 +351,6 @@ IsPropertyElementName ( RDFTermKind term )
} // IsPropertyElementName
-// -------------------------------------------------------------------------------------------------
-// IsPropertyAttributeName
-// -----------------------
-//
-// 7.2.7 propertyAttributeURIs
-// anyURI - ( coreSyntaxTerms | rdf:Description | rdf:li | oldTerms )
-
-static bool
-IsPropertyAttributeName ( RDFTermKind term )
-{
-
- if ( (term == kRDFTerm_Description) || (term == kRDFTerm_li) || IsOldTerm ( term ) ) return false;
- return (! IsCoreSyntaxTerm ( term ));
-
-} // IsPropertyAttributeName
-
-
// =================================================================================================
// AddChildNode
// ============
diff --git a/xmpsdk/src/XMPCore_Impl.cpp b/xmpsdk/src/XMPCore_Impl.cpp
index 1cf92c6..4f7152a 100644
--- a/xmpsdk/src/XMPCore_Impl.cpp
+++ b/xmpsdk/src/XMPCore_Impl.cpp
@@ -664,6 +664,7 @@ ExpandXPath ( XMP_StringPtr schemaNS,
XMP_StringPtr qualName, nameEnd;
XMP_VarString currStep;
+ qualName = nameEnd = NULL;
size_t resCount = 2; // Guess at the number of steps. At least 2, plus 1 for each '/' or '['.
for ( stepEnd = propPath; *stepEnd != 0; ++stepEnd ) {
if ( (*stepEnd == '/') || (*stepEnd == '[') ) ++resCount;
@@ -1412,7 +1413,8 @@ NormalizeLangArray ( XMP_Node * array )
array->children[itemNum] = temp;
}
- if ( itemLim == 2 ) array->children[1]->value = array->children[0]->value;
+// 09-Oct-07, ahu: disabled to avoid unexpected behaviour
+// if ( itemLim == 2 ) array->children[1]->value = array->children[0]->value;
}
diff --git a/xmpsdk/src/XMPCore_Impl.hpp b/xmpsdk/src/XMPCore_Impl.hpp
index d1be1c3..b3a8e6b 100644
--- a/xmpsdk/src/XMPCore_Impl.hpp
+++ b/xmpsdk/src/XMPCore_Impl.hpp
@@ -20,9 +20,10 @@
#include <map>
#include <cassert>
+#include <cstring>
#if XMP_WinBuild
- #include <Windows.h>
+ #include <windows.h>
#else
// Use pthread for both Mac and generic UNIX.
#include <pthread.h>
diff --git a/xmpsdk/src/XMPIterator.cpp b/xmpsdk/src/XMPIterator.cpp
index 8032bfa..3054af4 100644
--- a/xmpsdk/src/XMPIterator.cpp
+++ b/xmpsdk/src/XMPIterator.cpp
@@ -156,7 +156,7 @@ AddNodeOffspring ( IterInfo & info, IterNode & iterParent, const XMP_Node * xmpP
currPath += xmpChild->name;
} else {
char buffer [32]; // AUDIT: Using sizeof(buffer) below for snprintf length is safe.
- snprintf ( buffer, sizeof(buffer), "[%d]", childNum+1 ); // ! XPath indices are one-based.
+ snprintf ( buffer, sizeof(buffer), "[%lu]", static_cast<unsigned long>(childNum+1) ); // ! XPath indices are one-based.
currPath += buffer;
}
iterParent.children.push_back ( IterNode ( xmpChild->options, currPath, leafOffset ) );
@@ -422,7 +422,7 @@ XMPIterator::Unlock ( XMP_OptionBits options )
XMPIterator::XMPIterator ( const XMPMeta & xmpObj,
XMP_StringPtr schemaNS,
XMP_StringPtr propName,
- XMP_OptionBits options ) : info(IterInfo(options,&xmpObj)), clientRefs(0)
+ XMP_OptionBits options ) : clientRefs(0), info(IterInfo(options,&xmpObj))
{
if ( (options & kXMP_IterClassMask) != kXMP_IterProperties ) {
XMP_Throw ( "Unsupported iteration kind", kXMPErr_BadOptions );
@@ -574,7 +574,7 @@ XMPIterator::XMPIterator ( const XMPMeta & xmpObj,
XMPIterator::XMPIterator ( XMP_StringPtr schemaNS,
XMP_StringPtr propName,
- XMP_OptionBits options ) : info(IterInfo(options,0)), clientRefs(0)
+ XMP_OptionBits options ) : clientRefs(0), info(IterInfo(options,0))
{
XMP_Throw ( "Unimplemented XMPIterator constructor for global tables", kXMPErr_Unimplemented );
diff --git a/xmpsdk/src/XMPMeta-Parse.cpp b/xmpsdk/src/XMPMeta-Parse.cpp
index 5ff64f4..249a855 100644
--- a/xmpsdk/src/XMPMeta-Parse.cpp
+++ b/xmpsdk/src/XMPMeta-Parse.cpp
@@ -706,7 +706,7 @@ TouchUpDataModel ( XMPMeta * xmp )
// Do a special case fix for dc:subject, make sure it is an unordered array.
XMP_Node * dcSubject = FindChildNode ( currSchema, "dc:subject", kXMP_ExistingOnly );
if ( dcSubject != 0 ) {
- XMP_OptionBits keepMask = ~(kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText);
+ XMP_OptionBits keepMask = static_cast<XMP_OptionBits>(~(kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText));
dcSubject->options &= keepMask; // Make sure any ordered array bits are clear.
}
}
diff --git a/xmpsdk/src/XMPMeta-Serialize.cpp b/xmpsdk/src/XMPMeta-Serialize.cpp
index 0aa75ae..00d3200 100644
--- a/xmpsdk/src/XMPMeta-Serialize.cpp
+++ b/xmpsdk/src/XMPMeta-Serialize.cpp
@@ -43,8 +43,6 @@ using namespace std;
static const char * kPacketHeader = "<?xpacket begin=\"\xEF\xBB\xBF\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>";
static const char * kPacketTrailer = "<?xpacket end=\"w\"?>"; // ! The w/r is at [size-4].
-static const char * kPXMP_SchemaGroup = "XMP_SchemaGroup";
-
static const char * kRDF_XMPMetaStart = "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"";
static const char * kRDF_XMPMetaEnd = "</x:xmpmeta>";
@@ -58,19 +56,10 @@ static const char * kRDF_StructStart = "<rdf:Description>";
static const char * kRDF_StructEnd = "</rdf:Description>";
static const char * kRDF_BagStart = "<rdf:Bag>";
-static const char * kRDF_BagEnd = "</rdf:Bag>";
-
-static const char * kRDF_SeqStart = "<rdf:Seq>";
-static const char * kRDF_SeqEnd = "</rdf:Seq>";
-
-static const char * kRDF_AltStart = "<rdf:Alt>";
-static const char * kRDF_AltEnd = "</rdf:Alt>";
static const char * kRDF_ItemStart = "<rdf:li>";
-static const char * kRDF_ItemEnd = "</rdf:li>";
static const char * kRDF_ValueStart = "<rdf:value>";
-static const char * kRDF_ValueEnd = "</rdf:value>";
// =================================================================================================
diff --git a/xmpsdk/src/XMPMeta.cpp b/xmpsdk/src/XMPMeta.cpp
index c5def31..50eacb7 100644
--- a/xmpsdk/src/XMPMeta.cpp
+++ b/xmpsdk/src/XMPMeta.cpp
@@ -24,6 +24,8 @@
#include <algorithm> // For sort and stable_sort.
#include <stdio.h> // For snprintf.
+#include <cstdio>
+
#if XMP_DebugBuild
#include <iostream>
#endif
@@ -80,10 +82,10 @@ static const char * kTenSpaces = " ";
#define OutProcString(str) { status = (*outProc) ( refCon, (str).c_str(), (str).size() ); if ( status != 0 ) goto EXIT; }
-#define OutProcDecInt(num) { snprintf ( buffer, sizeof(buffer), "%d", (num) ); /* AUDIT: Using sizeof for snprintf length is safe */ \
+#define OutProcULong(num) { snprintf ( buffer, sizeof(buffer), "%lu", (num) ); /* AUDIT: Using sizeof for snprintf length is safe */ \
status = (*outProc) ( refCon, buffer, strlen(buffer) ); if ( status != 0 ) goto EXIT; }
-#define OutProcHexInt(num) { snprintf ( buffer, sizeof(buffer), "%X", (num) ); /* AUDIT: Using sizeof for snprintf length is safe */ \
+#define OutProcHexInt(num) { snprintf ( buffer, sizeof(buffer), "%lX", (num) ); /* AUDIT: Using sizeof for snprintf length is safe */ \
status = (*outProc) ( refCon, buffer, strlen(buffer) ); if ( status != 0 ) goto EXIT; }
#define OutProcHexByte(num) { snprintf ( buffer, sizeof(buffer), "%.2X", (num) ); /* AUDIT: Using sizeof for snprintf length is safe */ \
@@ -273,7 +275,7 @@ DumpPropertyTree ( const XMP_Node * currNode,
DumpClearString ( currNode->name, outProc, refCon );
} else {
OutProcNChars ( "[", 1 );
- OutProcDecInt ( itemIndex );
+ OutProcULong ( static_cast<unsigned long>(itemIndex) );
OutProcNChars ( "]", 1 );
}
@@ -580,7 +582,7 @@ SortWithinOffspring ( XMP_NodeOffspring & nodeVec )
// ============
-XMPMeta::XMPMeta() : tree(XMP_Node(0,"",0)), clientRefs(0), prevTkVer(0), xmlParser(0)
+XMPMeta::XMPMeta() : clientRefs(0), prevTkVer(0), tree(XMP_Node(0,"",0)), xmlParser(0)
{
// Nothing more to do, clientRefs is incremented in wrapper.
#if XMP_TraceCTorDTor
@@ -722,8 +724,9 @@ XMPMeta::Initialize()
(void) RegisterNamespace ( "adobe:ns:meta/", "x", &voidPtr, &voidLen );
(void) RegisterNamespace ( "http://ns.adobe.com/iX/1.0/", "iX", &voidPtr, &voidLen );
-
- XMPMeta::RegisterStandardAliases ( "" );
+
+// 06-Oct-07, ahu: Do not use aliases. They result in unexpected behaviour.
+// XMPMeta::RegisterStandardAliases ( "" );
// Initialize the other core classes.
diff --git a/xmpsdk/src/XMPMeta.hpp b/xmpsdk/src/XMPMeta.hpp
index dca2c2a..454692e 100644
--- a/xmpsdk/src/XMPMeta.hpp
+++ b/xmpsdk/src/XMPMeta.hpp
@@ -407,7 +407,7 @@ public:
private:
// ! These are hidden on purpose:
- XMPMeta ( const XMPMeta & /* original */ ) : tree(XMP_Node(0,"",0)), clientRefs(0), prevTkVer(0), xmlParser(0)
+ XMPMeta ( const XMPMeta & /* original */ ) : clientRefs(0), prevTkVer(0), tree(XMP_Node(0,"",0)), xmlParser(0)
{ XMP_Throw ( "Call to hidden constructor", kXMPErr_InternalFailure ); };
void operator= ( const XMPMeta & /* rhs */ )
{ XMP_Throw ( "Call to hidden operator=", kXMPErr_InternalFailure ); };
diff --git a/xmpsdk/src/XMPUtils.cpp b/xmpsdk/src/XMPUtils.cpp
index 0cfe497..e6a8bd8 100644
--- a/xmpsdk/src/XMPUtils.cpp
+++ b/xmpsdk/src/XMPUtils.cpp
@@ -389,21 +389,21 @@ static void FormatFullDateTime ( XMP_DateTime & tempDate, char * buffer, size_t
// Output YYYY-MM-DDThh:mmTZD.
snprintf ( buffer, bufferLen, "%.4d-%02d-%02dT%02d:%02d", // AUDIT: Callers pass sizeof(buffer).
- tempDate.year, tempDate.month, tempDate.day, tempDate.hour, tempDate.minute );
+ static_cast<int>(tempDate.year), static_cast<int>(tempDate.month), static_cast<int>(tempDate.day), static_cast<int>(tempDate.hour), static_cast<int>(tempDate.minute) );
} else if ( tempDate.nanoSecond == 0 ) {
// Output YYYY-MM-DDThh:mm:ssTZD.
snprintf ( buffer, bufferLen, "%.4d-%02d-%02dT%02d:%02d:%02d", // AUDIT: Callers pass sizeof(buffer).
- tempDate.year, tempDate.month, tempDate.day,
- tempDate.hour, tempDate.minute, tempDate.second );
+ static_cast<int>(tempDate.year), static_cast<int>(tempDate.month), static_cast<int>(tempDate.day),
+ static_cast<int>(tempDate.hour), static_cast<int>(tempDate.minute), static_cast<int>(tempDate.second) );
} else {
// Output YYYY-MM-DDThh:mm:ss.sTZD.
snprintf ( buffer, bufferLen, "%.4d-%02d-%02dT%02d:%02d:%02d.%09d", // AUDIT: Callers pass sizeof(buffer).
- tempDate.year, tempDate.month, tempDate.day,
- tempDate.hour, tempDate.minute, tempDate.second, tempDate.nanoSecond );
+ static_cast<int>(tempDate.year), static_cast<int>(tempDate.month), static_cast<int>(tempDate.day),
+ static_cast<int>(tempDate.hour), static_cast<int>(tempDate.minute), static_cast<int>(tempDate.second), static_cast<int>(tempDate.nanoSecond) );
for ( size_t i = strlen(buffer)-1; buffer[i] == '0'; --i ) buffer[i] = 0; // Trim excess digits.
}
@@ -600,7 +600,7 @@ static size_t MoveLargestProperty ( XMPMeta & stdXMP, XMPMeta * extXMP, PropSize
printf ( " Move %s, %d bytes
", propName, propSize );
#endif
- bool moved = MoveOneProperty ( stdXMP, extXMP, schemaURI, propName );
+ bool moved = MoveOneProperty ( stdXMP, extXMP, schemaURI, propName );
XMP_Assert ( moved );
propSizes.erase ( lastPos );
@@ -703,7 +703,7 @@ XMPUtils::ComposeArrayItemPath ( XMP_StringPtr schemaNS,
if ( itemIndex != kXMP_ArrayLastItem ) {
// AUDIT: Using string->size() for the snprintf length is safe.
- snprintf ( const_cast<char*>(sComposedPath->c_str()), sComposedPath->size(), "%s[%d]", arrayName, itemIndex );
+ snprintf ( const_cast<char*>(sComposedPath->c_str()), sComposedPath->size(), "%s[%d]", arrayName, static_cast<int>(itemIndex) );
} else {
*sComposedPath = arrayName;
*sComposedPath += "[last()] ";
@@ -1063,7 +1063,7 @@ XMPUtils::ConvertFromDate ( const XMP_DateTime & binValue,
if ( (tempDate.day == 0) && (tempDate.hour == 0) && (tempDate.minute == 0) &&
(tempDate.second == 0) && (tempDate.nanoSecond == 0) &&
(tempDate.tzSign == 0) && (tempDate.tzHour == 0) && (tempDate.tzMinute == 0) ) {
- snprintf ( buffer, sizeof(buffer), "%.4d", tempDate.year ); // AUDIT: Using sizeof for snprintf length is safe.
+ snprintf ( buffer, sizeof(buffer), "%.4d", static_cast<int>(tempDate.year) ); // AUDIT: Using sizeof for snprintf length is safe.
} else if ( (tempDate.year == 0) && (tempDate.day == 0) ) {
FormatFullDateTime ( tempDate, buffer, sizeof(buffer) );
addTimeZone = true;
@@ -1080,7 +1080,7 @@ XMPUtils::ConvertFromDate ( const XMP_DateTime & binValue,
(tempDate.tzSign != 0) || (tempDate.tzHour != 0) || (tempDate.tzMinute != 0) ) {
XMP_Throw ( "Invalid partial date, non-zeros after zero month and day", kXMPErr_BadParam);
}
- snprintf ( buffer, sizeof(buffer), "%.4d-%02d", tempDate.year, tempDate.month ); // AUDIT: Using sizeof for snprintf length is safe.
+ snprintf ( buffer, sizeof(buffer), "%.4d-%02d", static_cast<int>(tempDate.year), static_cast<int>(tempDate.month) ); // AUDIT: Using sizeof for snprintf length is safe.
} else if ( (tempDate.hour == 0) && (tempDate.minute == 0) &&
(tempDate.second == 0) && (tempDate.nanoSecond == 0) &&
@@ -1089,7 +1089,7 @@ XMPUtils::ConvertFromDate ( const XMP_DateTime & binValue,
// Output YYYY-MM-DD.
if ( (tempDate.month < 1) || (tempDate.month > 12) ) XMP_Throw ( "Month is out of range", kXMPErr_BadParam);
if ( (tempDate.day < 1) || (tempDate.day > 31) ) XMP_Throw ( "Day is out of range", kXMPErr_BadParam);
- snprintf ( buffer, sizeof(buffer), "%.4d-%02d-%02d", tempDate.year, tempDate.month, tempDate.day ); // AUDIT: Using sizeof for snprintf length is safe.
+ snprintf ( buffer, sizeof(buffer), "%.4d-%02d-%02d", static_cast<int>(tempDate.year), static_cast<int>(tempDate.month), static_cast<int>(tempDate.day) ); // AUDIT: Using sizeof for snprintf length is safe.
} else {
@@ -1113,7 +1113,7 @@ XMPUtils::ConvertFromDate ( const XMP_DateTime & binValue,
if ( tempDate.tzSign == 0 ) {
*sConvertedValue += 'Z';
} else {
- snprintf ( buffer, sizeof(buffer), "+%02d:%02d", tempDate.tzHour, tempDate.tzMinute ); // AUDIT: Using sizeof for snprintf length is safe.
+ snprintf ( buffer, sizeof(buffer), "+%02d:%02d", static_cast<int>(tempDate.tzHour), static_cast<int>(tempDate.tzMinute) ); // AUDIT: Using sizeof for snprintf length is safe.
if ( tempDate.tzSign < 0 ) buffer[0] = '-';
*sConvertedValue += buffer;
}
@@ -1262,7 +1262,7 @@ XMPUtils::ConvertToFloat ( XMP_StringPtr strValue )
// Note that ISO 8601 does not seem to allow years less than 1000 or greater than 9999. We allow
// any year, even negative ones. The year is formatted as "%.4d".
-// ! Tolerate missing TZD, assume is UTC. Photoshop 8 writes dates like this for exif:GPSTimeStamp.
+// ! Tolerate missing TZD, assume the time is in local time
// ! Tolerate missing date portion, in case someone foolishly writes a time-only value that way.
// *** Put the ISO format comments in the header documentation.
@@ -1397,6 +1397,10 @@ XMPUtils::ConvertToDate ( XMP_StringPtr strValue,
if ( temp > 59 ) XMP_Throw ( "Time zone minute is out of range", kXMPErr_BadParam );
binValue->tzMinute = temp;
+ } else {
+
+ XMPUtils::SetTimeZone( binValue );
+
}
if ( strValue[pos] != 0 ) XMP_Throw ( "Invalid date string, extra chars at end", kXMPErr_BadParam );
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list