Fixed compiler warnings (amd64)

This commit is contained in:
Andreas Huggel 2008-05-13 09:28:28 +00:00
parent de323d73e0
commit 576d53e34f
2 changed files with 3 additions and 3 deletions

View File

@ -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), "[%u]", 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 ) );

View File

@ -76,7 +76,7 @@ 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), "%lX", (num) ); /* AUDIT: Using sizeof for snprintf length is safe */ \
@ -214,7 +214,7 @@ DumpPropertyTree ( const XMP_Node * currNode,
OutProcString ( currNode->name );
} else {
OutProcNChars ( "[", 1 );
OutProcDecInt ( itemIndex );
OutProcULong ( static_cast<unsigned long>(itemIndex) );
OutProcNChars ( "]", 1 );
}