summaryrefslogtreecommitdiff
path: root/XMPCore
diff options
context:
space:
mode:
authorHubert Figuière <hub@figuiere.net>2014-09-01 17:00:01 -0400
committerHubert Figuière <hub@figuiere.net>2014-09-01 17:00:01 -0400
commit6fe1a0d7e3bcb01efd1094dc1d5198540c1d7e18 (patch)
treead564e12a1407c03cd8c4bd24e3519dcdfdae098 /XMPCore
parent3cc479d6c3bef6d1d42fd94c44d9dee2c2bab229 (diff)
Fix a boatload of compile in the XMP SDK.
Diffstat (limited to 'XMPCore')
-rw-r--r--XMPCore/source/ParseRDF.cpp52
-rw-r--r--XMPCore/source/XMPCore_Impl.cpp5
-rw-r--r--XMPCore/source/XMPIterator.cpp5
-rw-r--r--XMPCore/source/XMPMeta-GetSet.cpp2
-rw-r--r--XMPCore/source/XMPMeta-Serialize.cpp18
-rw-r--r--XMPCore/source/XMPMeta.cpp8
-rw-r--r--XMPCore/source/XMPUtils.cpp7
7 files changed, 24 insertions, 73 deletions
diff --git a/XMPCore/source/ParseRDF.cpp b/XMPCore/source/ParseRDF.cpp
index 7eeecb3..d14768f 100644
--- a/XMPCore/source/ParseRDF.cpp
+++ b/XMPCore/source/ParseRDF.cpp
@@ -311,16 +311,6 @@ GetRDFTermKind ( const XMP_VarString & name )
// =================================================================================================
static void
-RemoveChild ( XMP_Node * xmpParent, size_t index )
-{
- XMP_Node * child = xmpParent->children[index];
- xmpParent->children.erase ( xmpParent->children.begin() + index );
- delete child;
-}
-
-// -------------------------------------------------------------------------------------------------
-
-static void
RemoveQualifier ( XMP_Node * xmpParent, size_t index )
{
XMP_Node * qualifier = xmpParent->qualifiers[index];
@@ -355,20 +345,6 @@ IsCoreSyntaxTerm ( RDFTermKind term )
}
// -------------------------------------------------------------------------------------------------
-// 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;
-}
-
-// -------------------------------------------------------------------------------------------------
// IsOldTerm
// ---------
//
@@ -383,20 +359,6 @@ IsOldTerm ( RDFTermKind term )
}
// -------------------------------------------------------------------------------------------------
-// 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 ));
-}
-
-// -------------------------------------------------------------------------------------------------
// IsPropertyElementName
// ---------------------
//
@@ -411,20 +373,6 @@ IsPropertyElementName ( RDFTermKind term )
}
// -------------------------------------------------------------------------------------------------
-// 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 ));
-}
-
-// -------------------------------------------------------------------------------------------------
// IsNumberedArrayItemName
// -----------------------
//
diff --git a/XMPCore/source/XMPCore_Impl.cpp b/XMPCore/source/XMPCore_Impl.cpp
index 5d18bba..4da130d 100644
--- a/XMPCore/source/XMPCore_Impl.cpp
+++ b/XMPCore/source/XMPCore_Impl.cpp
@@ -772,7 +772,10 @@ FindSchemaNode ( XMP_Node * xmpTree,
try {
XMP_StringPtr prefixPtr;
XMP_StringLen prefixLen;
- bool found = XMPMeta::GetNamespacePrefix ( nsURI, &prefixPtr, &prefixLen ); // *** Use map directly?
+#if XMP_DebugBuild
+ bool found =
+#endif
+ XMPMeta::GetNamespacePrefix ( nsURI, &prefixPtr, &prefixLen ); // *** Use map directly?
XMP_Assert ( found );
schemaNode->value.assign ( prefixPtr, prefixLen );
} catch (...) { // Don't leak schemaNode in case of an exception before adding it to the children vector.
diff --git a/XMPCore/source/XMPIterator.cpp b/XMPCore/source/XMPIterator.cpp
index 53f9de0..b857365 100644
--- a/XMPCore/source/XMPIterator.cpp
+++ b/XMPCore/source/XMPIterator.cpp
@@ -485,13 +485,12 @@ XMPIterator::XMPIterator ( const XMPMeta & xmpObj,
//
// Constructor for iterations over global tables such as registered namespaces or aliases.
-XMPIterator::XMPIterator ( XMP_StringPtr schemaNS,
- XMP_StringPtr propName,
+XMPIterator::XMPIterator ( XMP_StringPtr /*schemaNS*/,
+ XMP_StringPtr /*propName*/,
XMP_OptionBits options ) : clientRefs(0), info(IterInfo(options,0))
{
XMP_Throw ( "Unimplemented XMPIterator constructor for global tables", kXMPErr_Unimplemented );
- void * p; p = &schemaNS; p = &propName; p = &options; // Avoid unused param warnings.
} // XMPIterator for global tables
diff --git a/XMPCore/source/XMPMeta-GetSet.cpp b/XMPCore/source/XMPMeta-GetSet.cpp
index ed982de..ac85bd2 100644
--- a/XMPCore/source/XMPMeta-GetSet.cpp
+++ b/XMPCore/source/XMPMeta-GetSet.cpp
@@ -1032,7 +1032,6 @@ XMPMeta::DeleteLocalizedText ( XMP_StringPtr schemaNS,
XMP_Node * assocNode = 0;
size_t assocIndex;
- size_t assocIsXDefault = false;
if ( itemIsXDefault ) {
@@ -1051,7 +1050,6 @@ XMPMeta::DeleteLocalizedText ( XMP_StringPtr schemaNS,
if ( (qualNode->name == "xml:lang") && (qualNode->value == "x-default") ) {
assocNode = arrayNode->children[0];
assocIndex = 0;
- assocIsXDefault = true;
}
}
diff --git a/XMPCore/source/XMPMeta-Serialize.cpp b/XMPCore/source/XMPMeta-Serialize.cpp
index b7373c9..6608258 100644
--- a/XMPCore/source/XMPMeta-Serialize.cpp
+++ b/XMPCore/source/XMPMeta-Serialize.cpp
@@ -43,7 +43,7 @@ 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 * kTXMP_SchemaGroup = "XMP_SchemaGroup";
+//static const char * kTXMP_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 +58,19 @@ 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_BagEnd = "</rdf:Bag>";
-static const char * kRDF_SeqStart = "<rdf:Seq>";
-static const char * kRDF_SeqEnd = "</rdf:Seq>";
+//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_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_ItemEnd = "</rdf:li>";
static const char * kRDF_ValueStart = "<rdf:value>";
-static const char * kRDF_ValueEnd = "</rdf:value>";
+//static const char * kRDF_ValueEnd = "</rdf:value>";
// =================================================================================================
@@ -1315,11 +1315,9 @@ XMPMeta::SerializeToBuffer ( XMP_VarString * rdfString,
} else {
std::string padStr ( " " ); padStr[0] = padStr[1] = padStr[2] = 0; // Assume big endian.
- UTF8_to_UTF32_Proc Converter = UTF8_to_UTF32BE;
if ( charEncoding & _XMP_LittleEndian_Bit ) {
padStr[0] = ' '; padStr[1] = padStr[2] = padStr[3] = 0;
- Converter = UTF8_to_UTF32LE;
}
utf8Str.swap ( *rdfString );
diff --git a/XMPCore/source/XMPMeta.cpp b/XMPCore/source/XMPMeta.cpp
index 132a8ce..bf28d01 100644
--- a/XMPCore/source/XMPMeta.cpp
+++ b/XMPCore/source/XMPMeta.cpp
@@ -822,7 +822,9 @@ XMPMeta::Initialize()
XMP_Assert ( sizeof(XMP_Bool) == 1 );
XMP_Assert ( sizeof(XMP_OptionBits) == 4 ); // Check that option masking work on all 32 bits.
+#if XMP_DebugBuild
XMP_OptionBits flag = (XMP_OptionBits) (~0UL);
+#endif
XMP_Assert ( flag == (XMP_OptionBits)(-1L) );
XMP_Assert ( (flag ^ kXMP_PropHasLang) == 0xFFFFFFBFUL );
XMP_Assert ( (flag & ~kXMP_PropHasLang) == 0xFFFFFFBFUL );
@@ -949,11 +951,10 @@ XMPMeta::GetGlobalOptions()
// ----------------
/* class-static */ void
-XMPMeta::SetGlobalOptions ( XMP_OptionBits options )
+XMPMeta::SetGlobalOptions ( XMP_OptionBits /*options*/ )
{
XMP_Throw ( "Unimplemented method XMPMeta::SetGlobalOptions", kXMPErr_Unimplemented );
- void * p; p = &options; // Avoid unused param warnings.
} // SetGlobalOptions
@@ -1176,11 +1177,10 @@ XMPMeta::GetObjectOptions() const
// ----------------
void
-XMPMeta::SetObjectOptions ( XMP_OptionBits options )
+XMPMeta::SetObjectOptions ( XMP_OptionBits /*options*/ )
{
XMP_Throw ( "Unimplemented method XMPMeta::SetObjectOptions", kXMPErr_Unimplemented );
- void * p; p = &options; // Avoid unused param warnings.
} // SetObjectOptions
diff --git a/XMPCore/source/XMPUtils.cpp b/XMPCore/source/XMPUtils.cpp
index 8d7e043..c00c02c 100644
--- a/XMPCore/source/XMPUtils.cpp
+++ b/XMPCore/source/XMPUtils.cpp
@@ -537,7 +537,10 @@ static size_t MoveLargestProperty ( XMPMeta & stdXMP, XMPMeta * extXMP, PropSize
printf ( " Move %s, %d bytes\n", propName, propSize );
#endif
- bool moved = MoveOneProperty ( stdXMP, extXMP, schemaURI, propName );
+#if XMP_DebugBuild
+ bool moved =
+#endif
+ MoveOneProperty ( stdXMP, extXMP, schemaURI, propName );
XMP_Assert ( moved );
propSizes.erase ( lastPos );
@@ -1660,9 +1663,11 @@ XMPUtils::PackageForJPEG ( const XMPMeta & origXMP,
// Adjust the standard XMP padding to be up to 2KB.
+#if XMP_DebugBuild
XMP_Assert ( (stdStr->size() > kTrailerLen) && (stdStr->size() <= kStdXMPLimit) );
const char * packetEnd = stdStr->c_str() + stdStr->size() - kTrailerLen;
XMP_Assert ( XMP_LitMatch ( packetEnd, kPacketTrailer ) );
+#endif
size_t extraPadding = kStdXMPLimit - stdStr->size(); // ! Do this before erasing the trailer.
if ( extraPadding > 2047 ) extraPadding = 2047;