Minor portability oversights in XMP code


hi,

this isn't question, rather comment adobe developers. in working code noticed 2 minor portability oversights thought i'd mention. (but should code nicely portable, these quibbles saw.)

first, in xmpgizmos.cpp source (part of samples/xapdumper), there's macro provided @ beginning take account pre-standard stl implementations (such provided gcc 2.95.3, still ships conservative releases of few open source oses), attendant iosbase macro isn't used consistently in code, causing compile errors. extremely trivial fix, i've attached unified diff below.

--- xmpgizmos.cpp~ tue may 20 14:36:10 2003
+++ xmpgizmos.cpp sat nov 13 18:39:36 2004
@@ -292,9 +292,9 @@
cout << " = \"" << value << "\"";
if ( features != 0 ) {
cout << ", features = 0x";
- cout.setf ( ios_base::hex, ios_base::basefield );
+ cout.setf ( iosbase::hex, iosbase::basefield );
cout << features;
- cout.setf ( ios_base::dec, ios_base::basefield );
+ cout.setf ( iosbase::dec, iosbase::basefield );
}
if ( meta.get ( ns, prop+"/@xml:lang", value, features ) ) {
langitem = "/*[@xml:lang='" + value + "']"; // lang might in xpath.
@@ -358,9 +358,9 @@
cout << " = \"" << value << "\"";
if ( features != 0 ) {
cout << ", features = 0x";
- cout.setf ( ios_base::hex, ios_base::basefield );
+ cout.setf ( iosbase::hex, iosbase::basefield );
cout << features;
- cout.setf ( ios_base::dec, ios_base::basefield );
+ cout.setf ( iosbase::dec, iosbase::basefield );
}
if ( meta.get ( ns, childpath+"/@xml:lang", value, features ) ) {
if ( prop != "*[@xml:lang='"+value+"']" ) { // lang might in xpath.
@@ -417,9 +417,9 @@
cout << " = \"" << value << "\"";
if ( features != 0 ) {
cout << ", features = 0x";
- cout.setf ( ios_base::hex, ios_base::basefield );
+ cout.setf ( iosbase::hex, iosbase::basefield );
cout << features;
- cout.setf ( ios_base::dec, ios_base::basefield );
+ cout.setf ( iosbase::dec, iosbase::basefield );
}
if ( meta.get ( ns, prop+"/@xml:lang", value, features ) ) {
cout << ", xml:lang = '" << value << '\'';

second, in xmlpacketscanner.cpp code (packetscanner/source), string lengths stored unsigned long rather size_t (e.g. in packetscanner constructor). know, incorrect windows 64-bit implementations, long remains 32-bits. granted, imagine files containing embedded xmp several gigabytes in size rare, , it's sample code, i'm being nit-picky.

apologies if either of these have been mentioned, couldn't see in forums or knowledge base. they're pretty obscure, doubt have been.

regards,

david gutteridge



More discussions in XMP SDK


adobe

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code