Kaydet (Commit) c74a6e6b authored tarafından Fridrich Štrba's avatar Fridrich Štrba

mingw64: use the right format for writing out pointer-sized integers

Change-Id: I7961ffd978cb02c62be176a0afe931959b7d8f1f
üst a2a34249
......@@ -93,6 +93,10 @@ void WriterHelper::writeFormatAttribute( const char* attribute, const char* form
va_end( va );
}
// Hack: somehow conversion from "..." to va_list does
// bomb on two string litterals in the format.
static const char* TMP_FORMAT = "%" SAL_PRIuUINTPTR;
}
void SwDoc::dumpAsXml( xmlTextWriterPtr w )
......@@ -117,9 +121,9 @@ void MarkManager::dumpAsXml( xmlTextWriterPtr w )
{
pMark_t pMark = *it;
writer.startElement("fieldmark");
writer.writeFormatAttribute("startNode", "%lu", pMark->GetMarkStart().nNode.GetIndex());
writer.writeFormatAttribute("startNode", TMP_FORMAT, pMark->GetMarkStart().nNode.GetIndex());
writer.writeFormatAttribute("startOffset", "%d", pMark->GetMarkStart().nContent.GetIndex());
writer.writeFormatAttribute("endNode", "%lu", pMark->GetMarkEnd().nNode.GetIndex());
writer.writeFormatAttribute("endNode", TMP_FORMAT, pMark->GetMarkEnd().nNode.GetIndex());
writer.writeFormatAttribute("endOffset", "%d", pMark->GetMarkEnd().nContent.GetIndex());
OString txt8 = OUStringToOString(pMark->GetName(), RTL_TEXTENCODING_UTF8);
writer.writeFormatAttribute("name", "%s", BAD_CAST( txt8.getStr()));
......@@ -206,7 +210,7 @@ void SwNode::dumpAsXml( xmlTextWriterPtr w )
}
writer.startElement( name );
writer.writeFormatAttribute( "ptr", "%p", this );
writer.writeFormatAttribute( "index", "%lu", GetIndex() );
writer.writeFormatAttribute( "index", TMP_FORMAT, GetIndex() );
writer.endElement();
if( GetNodeType() == ND_ENDNODE )
writer.endElement(); // end start node
......@@ -239,7 +243,7 @@ void SwStartNode::dumpAsXml( xmlTextWriterPtr w )
}
writer.startElement( name );
writer.writeFormatAttribute( "ptr", "%p", this );
writer.writeFormatAttribute( "index", "%lu", GetIndex() );
writer.writeFormatAttribute( "index", TMP_FORMAT, GetIndex() );
// writer.endElement(); - it is a start node, so don't end, will make xml better nested
}
......@@ -248,7 +252,7 @@ void SwTxtNode::dumpAsXml( xmlTextWriterPtr w )
WriterHelper writer( w );
writer.startElement( "text" );
writer.writeFormatAttribute( "ptr", "%p", this );
writer.writeFormatAttribute( "index", "%lu", GetIndex() );
writer.writeFormatAttribute( "index", TMP_FORMAT, GetIndex() );
OUString txt = GetTxt();
for( int i = 0; i < 32; ++i )
txt = txt.replace( i, '*' );
......
......@@ -348,6 +348,10 @@ void SwFrm::dumpInfosAsXml( xmlTextWriterPtr writer )
xmlTextWriterEndElement( writer );
}
// Hack: somehow conversion from "..." to va_list does
// bomb on two string litterals in the format.
static const char* TMP_FORMAT = "%" SAL_PRIuUINTPTR;
void SwFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
{
xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ptr" ), "%p", this );
......@@ -365,7 +369,7 @@ void SwFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
{
SwTxtFrm *pTxtFrm = ( SwTxtFrm * ) this;
SwTxtNode *pTxtNode = pTxtFrm->GetTxtNode();
xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "txtNodeIndex" ), "%lu", pTxtNode->GetIndex() );
xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "txtNodeIndex" ), TMP_FORMAT, pTxtNode->GetIndex() );
}
if (IsHeaderFrm() || IsFooterFrm())
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment