summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-15 14:26:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-16 11:12:31 +0200
commit87c90cec38c43efbbd9cbfad1f0f607f428043d4 (patch)
treeb65b6ccc78a4a922c027f98e4d8ab5251fdf33bb
parent9b34dc20b6946698ae6ce2d5d859885bfb444633 (diff)
fix some *printf which are using "%l" ie. long specifiers
which are not portable between Linux and Windows because long is not portable. In preparation for converting long -> tools::Long Change-Id: I8bf1aa1570946ca887a6c83dd5f99c024d437336 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104374 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--editeng/source/editeng/editdbg.cxx10
-rw-r--r--framework/source/fwe/xml/menudocumenthandler.cxx6
-rw-r--r--framework/source/fwe/xml/saxnamespacefilter.cxx6
-rw-r--r--framework/source/fwe/xml/statusbardocumenthandler.cxx6
-rw-r--r--framework/source/fwe/xml/toolboxdocumenthandler.cxx6
-rw-r--r--i18npool/source/localedata/LocaleNode.cxx6
-rw-r--r--i18npool/source/textconversion/genconv_dict.cxx10
-rw-r--r--idlc/source/errorhandler.cxx12
-rw-r--r--idlc/source/idlcmain.cxx9
-rw-r--r--oox/source/helper/propertymap.cxx6
-rw-r--r--sc/qa/unit/filters-test.cxx8
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx6
-rw-r--r--sd/source/filter/ppt/pptinanimations.cxx22
-rw-r--r--smoketest/libtest.cxx7
-rw-r--r--svx/source/tbxctrls/colrctrl.cxx2
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.cxx6
-rw-r--r--testtools/source/performance/ubtest.cxx2
-rw-r--r--vcl/qa/cppunit/complextext.cxx6
-rw-r--r--vcl/qa/cppunit/graphicfilter/filters-test.cxx2
-rw-r--r--vcl/unx/generic/print/common_gfx.cxx39
20 files changed, 83 insertions, 94 deletions
diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx
index 720c890d2048..cee32beafcc2 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -453,9 +453,9 @@ void EditEngine::DumpData(const EditEngine* pEE, bool bInfoBox)
fprintf( fp, "\n================================================================================" );
fprintf( fp, "\nControl: %x", unsigned( pEE->GetControlWord() ) );
fprintf( fp, "\nRefMapMode: %i", int( pEE->pImpEditEngine->pRefDev->GetMapMode().GetMapUnit() ) );
- fprintf( fp, "\nPaperSize: %li x %li", pEE->GetPaperSize().Width(), pEE->GetPaperSize().Height() );
+ fprintf( fp, "\nPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64, sal_Int64(pEE->GetPaperSize().Width()), sal_Int64(pEE->GetPaperSize().Height()) );
fprintf( fp, "\nMaxAutoPaperSize: %li x %li", pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() );
- fprintf( fp, "\nMinAutoPaperSize: %li x %li", pEE->GetMinAutoPaperSize().Width(), pEE->GetMinAutoPaperSize().Height() );
+ fprintf( fp, "\nMinAutoPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64 , sal_Int64(pEE->GetMinAutoPaperSize().Width()), sal_Int64(pEE->GetMinAutoPaperSize().Height()) );
fprintf( fp, "\nUpdate: %i", pEE->GetUpdateMode() );
fprintf( fp, "\nNumber of Views: %" SAL_PRI_SIZET "i", pEE->GetViewCount() );
for ( size_t nView = 0; nView < pEE->GetViewCount(); nView++ )
@@ -464,9 +464,11 @@ void EditEngine::DumpData(const EditEngine* pEE, bool bInfoBox)
DBG_ASSERT( pV, "View not found!" );
fprintf( fp, "\nView %zu: Focus=%i", nView, pV->GetWindow()->HasFocus() );
tools::Rectangle aR( pV->GetOutputArea() );
- fprintf( fp, "\n OutputArea: nX=%li, nY=%li, dX=%li, dY=%li, MapMode = %i", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() , int( pV->GetWindow()->GetMapMode().GetMapUnit() ) );
+ fprintf( fp, "\n OutputArea: nX=%" SAL_PRIdINT64 ", nY=%" SAL_PRIdINT64 ", dX=%" SAL_PRIdINT64 ", dY=%" SAL_PRIdINT64 ", MapMode = %i",
+ sal_Int64(aR.TopLeft().X()), sal_Int64(aR.TopLeft().Y()), sal_Int64(aR.GetSize().Width()), sal_Int64(aR.GetSize().Height()) , int( pV->GetWindow()->GetMapMode().GetMapUnit() ) );
aR = pV->GetVisArea();
- fprintf( fp, "\n VisArea: nX=%li, nY=%li, dX=%li, dY=%li", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() );
+ fprintf( fp, "\n VisArea: nX=%" SAL_PRIdINT64 ", nY=%" SAL_PRIdINT64 ", dX=%" SAL_PRIdINT64 ", dY=%" SAL_PRIdINT64,
+ sal_Int64(aR.TopLeft().X()), sal_Int64(aR.TopLeft().Y()), sal_Int64(aR.GetSize().Width()), sal_Int64(aR.GetSize().Height()) );
ESelection aSel = pV->GetSelection();
fprintf( fp, "\n Selection: Start=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ", End=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32, aSel.nStartPara, aSel.nStartPos, aSel.nEndPara, aSel.nEndPos );
}
diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx
index d6d459b01453..2509ffa981c7 100644
--- a/framework/source/fwe/xml/menudocumenthandler.cxx
+++ b/framework/source/fwe/xml/menudocumenthandler.cxx
@@ -183,11 +183,7 @@ void SAL_CALL ReadMenuDocumentHandlerBase::setDocumentLocator(
OUString ReadMenuDocumentHandlerBase::getErrorLineString()
{
if ( m_xLocator.is() )
- {
- char buffer[32];
- snprintf( buffer, sizeof(buffer), "Line: %ld - ", static_cast<long>( m_xLocator->getLineNumber() ));
- return OUString::createFromAscii( buffer );
- }
+ return "Line: " + OUString::number( m_xLocator->getLineNumber() ) + " - ";
else
return OUString();
}
diff --git a/framework/source/fwe/xml/saxnamespacefilter.cxx b/framework/source/fwe/xml/saxnamespacefilter.cxx
index 6649ed21b98d..fa66360ce334 100644
--- a/framework/source/fwe/xml/saxnamespacefilter.cxx
+++ b/framework/source/fwe/xml/saxnamespacefilter.cxx
@@ -155,11 +155,7 @@ void SAL_CALL SaxNamespaceFilter::setDocumentLocator(
OUString SaxNamespaceFilter::getErrorLineString()
{
if ( m_xLocator.is() )
- {
- char buffer[32];
- snprintf( buffer, sizeof(buffer), "Line: %ld - ", static_cast<long>( m_xLocator->getLineNumber() ));
- return OUString::createFromAscii( buffer );
- }
+ return "Line: " + OUString::number( m_xLocator->getLineNumber() ) + " - ";
else
return OUString();
}
diff --git a/framework/source/fwe/xml/statusbardocumenthandler.cxx b/framework/source/fwe/xml/statusbardocumenthandler.cxx
index 5dac16e429fd..2306f4f46737 100644
--- a/framework/source/fwe/xml/statusbardocumenthandler.cxx
+++ b/framework/source/fwe/xml/statusbardocumenthandler.cxx
@@ -465,11 +465,7 @@ OUString OReadStatusBarDocumentHandler::getErrorLineString()
SolarMutexGuard g;
if ( m_xLocator.is() )
- {
- char buffer[32];
- snprintf( buffer, sizeof(buffer), "Line: %ld - ", static_cast<long>( m_xLocator->getLineNumber() ));
- return OUString::createFromAscii( buffer );
- }
+ return "Line: " + OUString::number( m_xLocator->getLineNumber() ) + " - ";
else
return OUString();
}
diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
index 1828dc550190..02999b5cf902 100644
--- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx
+++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
@@ -566,11 +566,7 @@ OUString OReadToolBoxDocumentHandler::getErrorLineString()
SolarMutexGuard g;
if ( m_xLocator.is() )
- {
- char buffer[32];
- snprintf( buffer, sizeof(buffer), "Line: %ld - ", static_cast<long>( m_xLocator->getLineNumber() ));
- return OUString::createFromAscii( buffer );
- }
+ return "Line: " + OUString::number( m_xLocator->getLineNumber() ) + " - ";
else
return OUString();
}
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index e5123969644c..da2acce25ba4 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -156,9 +156,9 @@ OUString LocaleNode::writeParameterCheckLen( const OFileWriter &of,
if (nLen < nMinLen)
{
++nError;
- fprintf( stderr, "Error: less than %ld character%s (%ld) in %s '%s'.\n",
- sal::static_int_cast< long >(nMinLen), (nMinLen > 1 ? "s" : ""),
- sal::static_int_cast< long >(nLen),
+ fprintf( stderr, "Error: less than %" SAL_PRIdINT32 " character%s (%" SAL_PRIdINT32 ") in %s '%s'.\n",
+ nMinLen, (nMinLen > 1 ? "s" : ""),
+ nLen,
(pNode ? OSTR( pNode->getName()) : ""),
OSTR( aVal));
}
diff --git a/i18npool/source/textconversion/genconv_dict.cxx b/i18npool/source/textconversion/genconv_dict.cxx
index 5cfd458090f6..66d9c5d62d73 100644
--- a/i18npool/source/textconversion/genconv_dict.cxx
+++ b/i18npool/source/textconversion/genconv_dict.cxx
@@ -357,7 +357,7 @@ void make_stc_word(FILE *sfp, FILE *cfp)
OUString Ostr(Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8);
sal_Int32 len = Ostr.getLength();
if (char_total + len + 1 > 0xFFFF) {
- fprintf(stderr, "Word Dictionary stc_word.dic is too big (line %ld)", sal::static_int_cast< long >(line));
+ fprintf(stderr, "Word Dictionary stc_word.dic is too big (line %" SAL_PRIdINT32 ")", line);
return;
}
sal_Int32 sep=-1, eq=-1, gt=-1, lt=-1;
@@ -379,7 +379,7 @@ void make_stc_word(FILE *sfp, FILE *cfp)
STC_WordData[char_total++] = (i == sep) ? 0 : Ostr[i];
STC_WordData[char_total++] = 0;
} else {
- fprintf(stderr, "Invalid entry in stc_word.dic (line %ld)", sal::static_int_cast< long >(line));
+ fprintf(stderr, "Invalid entry in stc_word.dic (line %" SAL_PRIdINT64 ")", sal_Int64(line));
return;
}
line++;
@@ -393,7 +393,7 @@ void make_stc_word(FILE *sfp, FILE *cfp)
}
fprintf(cfp, "\n};\n");
- fprintf(cfp, "\nstatic sal_Int32 STC_WordData_Count = %ld;\n", sal::static_int_cast< long >(char_total));
+ fprintf(cfp, "\nstatic sal_Int32 STC_WordData_Count = %" SAL_PRIdINT32 ";\n", sal_Int32(char_total));
// create function to return arrays
fprintf (cfp, "\tconst sal_Unicode* getSTC_WordData(sal_Int32& count) { count = STC_WordData_Count; return STC_WordData; }\n");
@@ -428,7 +428,7 @@ void make_stc_word(FILE *sfp, FILE *cfp)
}
fprintf(cfp, "\n};\n");
- fprintf(cfp, "\nstatic sal_Int32 STC_WordIndex_S2T_Count = %ld;\n", sal::static_int_cast< long >(length));
+ fprintf(cfp, "\nstatic sal_Int32 STC_WordIndex_S2T_Count = %" SAL_PRIdINT64 ";\n", sal_Int64(length));
fprintf (cfp, "\tconst sal_uInt16* getSTC_WordEntry_S2T() { return STC_WordEntry_S2T; }\n");
fprintf (cfp, "\tconst sal_uInt16* getSTC_WordIndex_S2T(sal_Int32& count) { count = STC_WordIndex_S2T_Count; return STC_WordIndex_S2T; }\n");
} else {
@@ -461,7 +461,7 @@ void make_stc_word(FILE *sfp, FILE *cfp)
}
fprintf(cfp, "\n};\n");
- fprintf(cfp, "\nstatic sal_Int32 STC_WordIndex_T2S_Count = %ld;\n\n", sal::static_int_cast< long >(length));
+ fprintf(cfp, "\nstatic sal_Int32 STC_WordIndex_T2S_Count = %" SAL_PRIdINT64 ";\n\n", sal_Int64(length));
fprintf (cfp, "\tconst sal_uInt16* getSTC_WordEntry_T2S() { return STC_WordEntry_T2S; }\n");
fprintf (cfp, "\tconst sal_uInt16* getSTC_WordIndex_T2S(sal_Int32& count) { count = STC_WordIndex_T2S_Count; return STC_WordIndex_T2S; }\n");
} else {
diff --git a/idlc/source/errorhandler.cxx b/idlc/source/errorhandler.cxx
index 1e09bb995302..aa2de56bc969 100644
--- a/idlc/source/errorhandler.cxx
+++ b/idlc/source/errorhandler.cxx
@@ -389,10 +389,10 @@ static void errorHeader(ErrorCode eCode, sal_Int32 lineNumber, sal_uInt32 start,
else
file = idlc()->getFileName();
- fprintf(stderr, "%s:%lu [%lu:%lu] : %s", file.getStr(),
- sal::static_int_cast< unsigned long >(lineNumber),
- sal::static_int_cast< unsigned long >(start),
- sal::static_int_cast< unsigned long >(end),
+ fprintf(stderr, "%s:%" SAL_PRIdINT64 " [%" SAL_PRIdINT64 ":%" SAL_PRIdINT64 "] : %s", file.getStr(),
+ sal_Int64(lineNumber),
+ sal_Int64(start),
+ sal_Int64(end),
errorCodeToMessage(eCode));
}
@@ -416,8 +416,8 @@ static void warningHeader(WarningCode wCode)
else
file = idlc()->getFileName();
- fprintf(stderr, "%s(%lu) : WARNING, %s", file.getStr(),
- sal::static_int_cast< unsigned long >(idlc()->getLineNumber()),
+ fprintf(stderr, "%s(%" SAL_PRIdINT64 ") : WARNING, %s", file.getStr(),
+ sal_Int64(idlc()->getLineNumber()),
warningCodeToMessage(wCode));
}
diff --git a/idlc/source/idlcmain.cxx b/idlc/source/idlcmain.cxx
index 0c4ded92be10..a79a30a504e2 100644
--- a/idlc/source/idlcmain.cxx
+++ b/idlc/source/idlcmain.cxx
@@ -90,10 +90,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
nErrors = compileFile(&sysFileName);
if ( idlc()->getWarningCount() && !options.quiet() )
- fprintf(stdout, "%s: detected %lu warnings compiling file '%s'\n",
+ fprintf(stdout, "%s: detected %" SAL_PRIdINT64 " warnings compiling file '%s'\n",
options.getProgramName().getStr(),
- sal::static_int_cast< unsigned long >(
- idlc()->getWarningCount()),
+ sal_Int64(idlc()->getWarningCount()),
elem.getStr());
// prepare output file name
@@ -140,9 +139,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if ( nErrors > 0 )
{
- fprintf(stderr, "%s: detected %ld errors%s",
+ fprintf(stderr, "%s: detected %" SAL_PRIdINT64 " errors%s",
options.getProgramName().getStr(),
- sal::static_int_cast< long >(nErrors),
+ sal_Int64(nErrors),
options.prepareVersion().getStr());
} else
{
diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx
index 74351064a85a..3bc994aabc19 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -567,7 +567,7 @@ static const char* lclDumpAnyValueCode( const Any& value, int level)
sal_uInt32 uintValue;
sal_Int16 int16Value;
sal_uInt16 uint16Value;
- long longValue;
+ sal_Int64 int64Value;
float floatValue = 0;
bool boolValue;
LineSpacing spacing;
@@ -779,10 +779,10 @@ static const char* lclDumpAnyValueCode( const Any& value, int level)
lclGetEnhancedParameterType(par.Type));
return "aParameter";
}
- else if( value >>= longValue )
+ else if( value >>= int64Value )
{
printLevel (level);
- fprintf (stderr,"Any aAny ((sal_Int32) %ld);\n", longValue);
+ fprintf (stderr,"Any aAny ((sal_Int64) %" SAL_PRIdINT64 ");\n", int64Value);
return "aAny";
}
else if( value >>= intValue )
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 43c3483bb281..c537baeb53f4 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -498,13 +498,13 @@ static void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, const too
SdrObject* pObj = pPage->GetObj(0);
const tools::Rectangle& aSnap = pObj->GetSnapRect();
- printf("expected height %ld actual %ld\n", aRect.GetHeight(), aSnap.GetHeight() );
+ printf("expected height %" SAL_PRIdINT64 " actual %" SAL_PRIdINT64 "\n", sal_Int64(aRect.GetHeight()), sal_Int64(aSnap.GetHeight()) );
CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.GetHeight(), aSnap.GetHeight(), TOLERANCE ) );
- printf("expected width %ld actual %ld\n", aRect.GetWidth(), aSnap.GetWidth() );
+ printf("expected width %" SAL_PRIdINT64 " actual %" SAL_PRIdINT64 "\n", sal_Int64(aRect.GetWidth()), sal_Int64(aSnap.GetWidth()) );
CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.GetWidth(), aSnap.GetWidth(), TOLERANCE ) );
- printf("expected left %ld actual %ld\n", aRect.Left(), aSnap.Left() );
+ printf("expected left %" SAL_PRIdINT64 " actual %" SAL_PRIdINT64 "\n", sal_Int64(aRect.Left()), sal_Int64(aSnap.Left()) );
CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.Left(), aSnap.Left(), TOLERANCE ) );
- printf("expected right %ld actual %ld\n", aRect.Top(), aSnap.Top() );
+ printf("expected right %" SAL_PRIdINT64 " actual %" SAL_PRIdINT64 "\n", sal_Int64(aRect.Top()), sal_Int64(aSnap.Top()) );
CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.Top(), aSnap.Top(), TOLERANCE ) );
ScDrawObjData* pData = ScDrawLayer::GetObjData( pObj );
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index ef952278e0eb..4bf9b3a2e673 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -731,9 +731,9 @@ void VmlCommentExporter::EndShape( sal_Int32 nShapeElement )
{
char pAnchor[100];
sax_fastparser::FSHelperPtr pVmlDrawing = GetFS();
- snprintf( pAnchor, 100, "%ld, %ld, %ld, %ld, %ld, %ld, %ld, %ld",
- maFrom.Left(), maFrom.Top(), maFrom.Right(), maFrom.Bottom(),
- maTo.Left(), maTo.Top(), maTo.Right(), maTo.Bottom() );
+ snprintf( pAnchor, 100, "%" SAL_PRIdINT64 ", %" SAL_PRIdINT64 ", %" SAL_PRIdINT64 ", %" SAL_PRIdINT64 ", %" SAL_PRIdINT64 ", %" SAL_PRIdINT64 ", %" SAL_PRIdINT64 ", %" SAL_PRIdINT64,
+ sal_Int64(maFrom.Left()), sal_Int64(maFrom.Top()), sal_Int64(maFrom.Right()), sal_Int64(maFrom.Bottom()),
+ sal_Int64(maTo.Left()), sal_Int64(maTo.Top()), sal_Int64(maTo.Right()), sal_Int64(maTo.Bottom()) );
// Getting comment text alignments
const char* pVertAlign = lcl_GetVertAlignFromItemSetChar(mpCaption->GetMergedItemSet());
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index 8516b063728a..3d17237ba67b 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -970,7 +970,7 @@ int AnimationImporter::importTimeContainer( const Atom* pAtom, const Reference<
sal_uInt32 nU1, nU2;
mrStCtrl.ReadUInt32(nU1).ReadUInt32(nU2);
- fprintf( mpFile, "<unknown_0xf136 nU1=\"%ld\" nU2=\"%ld\"/>\n", nU1, nU2 );
+ fprintf( mpFile, "<unknown_0xf136 nU1=\"%" SAL_PRIdINT32 "\" nU2=\"%" SAL_PRIdINT32 "\"/>\n", nU1, nU2 );
#endif
}
break;
@@ -1971,7 +1971,7 @@ void AnimationImporter::importAnimateRotationContainer( const Atom* pAtom, const
fprintf( mpFile, " to=\"%g\"", (double)fTo );
if( nU1 )
- fprintf( mpFile, " rotation_1=\"%ld\"", nU1 );
+ fprintf( mpFile, " rotation_1=\"%" SAL_PRIdINT32 "\"", nU1 );
#endif
}
break;
@@ -2699,7 +2699,7 @@ void AnimationImporter::dump_atom( const Atom* pAtom, bool bNewLine )
if( aValue >>= nInt )
{
- fprintf(mpFile, " value=\"%ld\"", nInt );
+ fprintf(mpFile, " value=\"%" SAL_PRIdINT32 "\"", nInt );
}
else if( aValue >>= aString )
{
@@ -2858,7 +2858,7 @@ void AnimationImporter::dump( Any& rAny )
}
else if( rAny >>= nInt )
{
- fprintf( mpFile, "%ld", nInt );
+ fprintf( mpFile, "%" SAL_PRIdINT32, nInt );
}
else if( rAny >>= bBool )
{
@@ -2974,7 +2974,7 @@ void AnimationImporter::dump( const PropertySet& rSet )
sal_Int32 nPresetId ;
if( aAny >>= nPresetId )
{
- fprintf(mpFile, " presetid=\"%ld\"", nPresetId );
+ fprintf(mpFile, " presetid=\"%" SAL_PRIdINT32 "\"", nPresetId );
bKnown = true;
}
}
@@ -2985,7 +2985,7 @@ void AnimationImporter::dump( const PropertySet& rSet )
sal_Int32 nPointsType ;
if( aAny >>= nPointsType )
{
- fprintf(mpFile, " presetSubType=\"%ld\"", nPointsType );
+ fprintf(mpFile, " presetSubType=\"%" SAL_PRIdINT32 "\"", nPointsType );
bKnown = true;
}
}
@@ -3009,7 +3009,7 @@ void AnimationImporter::dump( const PropertySet& rSet )
default:
{
static char buffer[128];
- sprintf( buffer, "%ld", nPresetClass );
+ sprintf( buffer, "%" SAL_PRIdINT32, nPresetClass );
pMode = buffer;
}
break;
@@ -3038,7 +3038,7 @@ void AnimationImporter::dump( const PropertySet& rSet )
default :
{
static char buffer[128];
- sprintf( buffer, "%ld", nNodeType );
+ sprintf( buffer, "%" SAL_PRIdINT32, nNodeType );
pNode = buffer;
}
break;
@@ -3055,7 +3055,7 @@ void AnimationImporter::dump( const PropertySet& rSet )
sal_Int32 nGroupId;
if ( aAny >>= nGroupId )
{
- fprintf( mpFile, " groupId=\"%ld\"", nGroupId );
+ fprintf( mpFile, " groupId=\"%" SAL_PRIdINT32 "\"", nGroupId );
bKnown = true;
}
}
@@ -3092,7 +3092,7 @@ void AnimationImporter::dump( const PropertySet& rSet )
sal_Int32 nEndAfterSlide;
if( aAny >>= nEndAfterSlide )
{
- fprintf(mpFile, " endAfterSlide=\"%ld\"", nEndAfterSlide );
+ fprintf(mpFile, " endAfterSlide=\"%" SAL_PRIdINT32 "\"", nEndAfterSlide );
bKnown = true;
}
}
@@ -3149,7 +3149,7 @@ void AnimationImporter::dump( const PropertySet& rSet )
if( !bKnown )
{
- fprintf( mpFile, " unknown_%lu=\"", nInstance );
+ fprintf( mpFile, " unknown_%" SAL_PRIdINT32 "=\"", nInstance );
dump( aAny );
fprintf( mpFile, "\"" );
}
diff --git a/smoketest/libtest.cxx b/smoketest/libtest.cxx
index c23f1d2a992c..9a95f7faf80a 100644
--- a/smoketest/libtest.cxx
+++ b/smoketest/libtest.cxx
@@ -12,6 +12,7 @@
#include <malloc.h>
#include <assert.h>
#include <math.h>
+#include <sal/types.h>
#include <LibreOfficeKit/LibreOfficeKitInit.h>
#include <LibreOfficeKit/LibreOfficeKit.hxx>
@@ -111,7 +112,7 @@ int main (int argc, char **argv)
}
end = getTimeMS();
- fprintf( stderr, "init time: %ld ms\n", (end-start) );
+ fprintf( stderr, "init time: %" SAL_PRIdINT64 " ms\n", sal_Int64(end-start) );
start = end;
fprintf( stderr, "start to load document '%s'\n", argv[2] );
@@ -126,7 +127,7 @@ int main (int argc, char **argv)
}
end = getTimeMS();
- fprintf( stderr, "load time: %ld ms\n", (end-start) );
+ fprintf( stderr, "load time: %" SAL_PRIdINT64 " ms\n", sal_Int64(end-start) );
start = end;
if( argc > 3 )
@@ -145,7 +146,7 @@ int main (int argc, char **argv)
{
fprintf( stderr, "Save succeeded\n" );
end = getTimeMS();
- fprintf( stderr, "save time: %ld ms\n", (end-start) );
+ fprintf( stderr, "save time: %" SAL_PRIdINT64 " ms\n", sal_Int64(end-start) );
}
}
fprintf( stderr, "all tests passed.\n" );
diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx
index 069c1c871e8b..e749994b73df 100644
--- a/svx/source/tbxctrls/colrctrl.cxx
+++ b/svx/source/tbxctrls/colrctrl.cxx
@@ -228,7 +228,7 @@ SvxColorDockingWindow::SvxColorDockingWindow(SfxBindings* _pBindings, SfxChildWi
aItemSize.setHeight( aItemSize.Height() + SvxColorValueSet::getEntryEdgeLength() );
aItemSize.setHeight( aItemSize.Height() / 2 );
- fprintf(stderr, "size is %ld %ld\n", aItemSize.Width(), aItemSize.Height());
+ fprintf(stderr, "size is %" SAL_PRIdINT64 " %" SAL_PRIdINT64 "\n", sal_Int64(aItemSize.Width()), sal_Int64(aItemSize.Height()));
if (_pBindings != nullptr)
StartListening(*_pBindings, DuplicateHandling::Prevent);
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index f9c2cad6b26d..7eb51d6f287c 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -1278,7 +1278,7 @@ std::string WW8TableCellGrid::toString()
static char sBuffer[1024];
while (aTopsIt != getRowTopsEnd())
{
- sprintf(sBuffer, "<row y=\"%ld\">", *aTopsIt);
+ sprintf(sBuffer, "<row y=\"%" SAL_PRIdINT64 "\">", sal_Int64(*aTopsIt));
sResult += sBuffer;
CellInfoMultiSet::const_iterator aCellIt = getCellsBegin(*aTopsIt);
@@ -1286,8 +1286,8 @@ std::string WW8TableCellGrid::toString()
while (aCellIt != aCellsEnd)
{
- snprintf(sBuffer, sizeof(sBuffer), "<cellInfo top=\"%ld\" bottom=\"%ld\" left=\"%ld\" right=\"%ld\">",
- aCellIt->top(), aCellIt->bottom(), aCellIt->left(), aCellIt->right());
+ snprintf(sBuffer, sizeof(sBuffer), "<cellInfo top=\"%" SAL_PRIdINT64 "\" bottom=\"%" SAL_PRIdINT64 "\" left=\"%" SAL_PRIdINT64 "\" right=\"%" SAL_PRIdINT64 "\">",
+ sal_Int64(aCellIt->top()), sal_Int64(aCellIt->bottom()), sal_Int64(aCellIt->left()), sal_Int64(aCellIt->right()));
sResult += sBuffer;
WW8TableNodeInfo * pInfo = aCellIt->getTableNodeInfo();
diff --git a/testtools/source/performance/ubtest.cxx b/testtools/source/performance/ubtest.cxx
index c30f31ba7150..38950b8bda5d 100644
--- a/testtools/source/performance/ubtest.cxx
+++ b/testtools/source/performance/ubtest.cxx
@@ -153,7 +153,7 @@ static inline void out( sal_Int64 nVal, FILE * stream = stderr,
sal_Int32 nStart = -1, char cFillchar = ' ' )
{
char ar[128];
- ::snprintf( ar, sizeof(ar), "%ld", nVal );
+ ::snprintf( ar, sizeof(ar), "%" SAL_PRIdINT64, nVal );
out( ar, stream, nStart, cFillchar );
}
diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx
index 85a5b3991167..8cbe9b6c748e 100644
--- a/vcl/qa/cppunit/complextext.cxx
+++ b/vcl/qa/cppunit/complextext.cxx
@@ -109,9 +109,9 @@ void VclComplexTextTest::testArabic()
tools::Rectangle aRectRot = pOutDev->GetTextRect( aInput, aOneTwoThree );
// Check that we did do the rotation...
- fprintf( stderr, "%ld %ld %ld %ld\n",
- aRect.GetWidth(), aRect.GetHeight(),
- aRectRot.GetWidth(), aRectRot.GetHeight() );
+ fprintf( stderr, "%" SAL_PRIdINT64 " %" SAL_PRIdINT64 " %" SAL_PRIdINT64 " %" SAL_PRIdINT64 "\n",
+ sal_Int64(aRect.GetWidth()), sal_Int64(aRect.GetHeight()),
+ sal-Int64(aRectRot.GetWidth()), sal_Int64(aRectRot.GetHeight()) );
CPPUNIT_ASSERT( aRectRot.GetWidth() == aRect.GetHeight() );
CPPUNIT_ASSERT( aRectRot.GetHeight() == aRect.GetWidth() );
#endif
diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
index bc745fc530f8..b8d150b72d31 100644
--- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
@@ -94,7 +94,7 @@ void VclFiltersTest::testScaling()
fprintf( stderr, "scale with type %d\n", int( i ) );
CPPUNIT_ASSERT( aBitmapEx.Scale( 0.1937046, 0.193154, i ) );
Size aAfter( aBitmapEx.GetSizePixel() );
- fprintf( stderr, "size %ld, %ld\n", aAfter.Width(), aAfter.Height() );
+ fprintf( stderr, "size %" SAL_PRIdINT64 ", %" SAL_PRIdINT64 "\n", sal_Int64(aAfter.Width()), sal_Int64(aAfter.Height()) );
CPPUNIT_ASSERT( labs (aAfter.Height() - aAfter.Width()) <= 1 );
}
}
diff --git a/vcl/unx/generic/print/common_gfx.cxx b/vcl/unx/generic/print/common_gfx.cxx
index 3938dfdebbea..f43d38a76dbd 100644
--- a/vcl/unx/generic/print/common_gfx.cxx
+++ b/vcl/unx/generic/print/common_gfx.cxx
@@ -483,7 +483,7 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const Po
PSSetColor ();
PSSetLineWidth ();
- snprintf(pString, nBezString, "%li %li moveto\n", pPath[0].X(), pPath[0].Y());
+ snprintf(pString, nBezString, "%" SAL_PRIdINT64 " %" SAL_PRIdINT64 " moveto\n", sal_Int64(pPath[0].X()), sal_Int64(pPath[0].Y()));
WritePS(mpPageBody, pString);
// Handle the drawing of mixed lines mixed with curves
@@ -493,7 +493,7 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const Po
{
if (pFlgAry[i] != PolyFlags::Control) //If the next point is a PolyFlags::Normal, we're drawing a line
{
- snprintf(pString, nBezString, "%li %li lineto\n", pPath[i].X(), pPath[i].Y());
+ snprintf(pString, nBezString, "%" SAL_PRIdINT64 " %" SAL_PRIdINT64 " lineto\n", sal_Int64(pPath[i].X()), sal_Int64(pPath[i].Y()));
i++;
}
else //Otherwise we're drawing a spline
@@ -503,10 +503,10 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const Po
if ((pFlgAry[i] == PolyFlags::Control) && (pFlgAry[i+1] == PolyFlags::Control) &&
(pFlgAry[i+2] != PolyFlags::Control))
{
- snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n",
- pPath[i].X(), pPath[i].Y(),
- pPath[i+1].X(), pPath[i+1].Y(),
- pPath[i+2].X(), pPath[i+2].Y());
+ snprintf(pString, nBezString, "%" SAL_PRIdINT64 " %" SAL_PRIdINT64 " %" SAL_PRIdINT64 " %" SAL_PRIdINT64 " %" SAL_PRIdINT64 " %" SAL_PRIdINT64 " curveto\n",
+ sal_Int64(pPath[i].X()), sal_Int64(pPath[i].Y()),
+ sal_Int64(pPath[i+1].X()), sal_Int64(pPath[i+1].Y()),
+ sal_Int64(pPath[i+2].X()), sal_Int64(pPath[i+2].Y()));
}
else
{
@@ -530,13 +530,14 @@ PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const Pol
if (nPoints <= 0 || (pPath == nullptr) || !(maFillColor.Is() || maLineColor.Is()))
return;
- snprintf(pString, nBezString, "%li %li moveto\n", pPath[0].X(), pPath[0].Y());
+ snprintf(pString, nBezString, "%" SAL_PRIdINT64 " %" SAL_PRIdINT64 " moveto\n", sal_Int64(pPath[0].X()), sal_Int64(pPath[0].Y()));
WritePS(mpPageBody, pString); //Move to the starting point for the PolyPolygon
for (unsigned int i=1; i < nPoints;)
{
if (pFlgAry[i] != PolyFlags::Control)
{
- snprintf(pString, nBezString, "%li %li lineto\n", pPath[i].X(), pPath[i].Y());
+ snprintf(pString, nBezString, "%" SAL_PRIdINT64 " %" SAL_PRIdINT64 " lineto\n",
+ sal_Int64(pPath[i].X()), sal_Int64(pPath[i].Y()));
WritePS(mpPageBody, pString);
i++;
}
@@ -547,10 +548,10 @@ PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const Pol
if ((pFlgAry[i] == PolyFlags::Control) && (pFlgAry[i+1] == PolyFlags::Control) &&
(pFlgAry[i+2] != PolyFlags::Control))
{
- snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n",
- pPath[i].X(), pPath[i].Y(),
- pPath[i+1].X(), pPath[i+1].Y(),
- pPath[i+2].X(), pPath[i+2].Y());
+ snprintf(pString, nBezString, "%" SAL_PRIdINT64 " %" SAL_PRIdINT64 " %" SAL_PRIdINT64 " %" SAL_PRIdINT64 " %" SAL_PRIdINT64 " %" SAL_PRIdINT64 " curveto\n",
+ sal_Int64(pPath[i].X()), sal_Int64(pPath[i].Y()),
+ sal_Int64(pPath[i+1].X()), sal_Int64(pPath[i+1].Y()),
+ sal_Int64(pPath[i+2].X()), sal_Int64(pPath[i+2].Y()));
WritePS(mpPageBody, pString);
}
else
@@ -592,7 +593,8 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints,
if( nPoints == 0 || pPtAry[i] == nullptr )
continue;
- snprintf(pString, nBezString, "%li %li moveto\n", pPtAry[i][0].X(), pPtAry[i][0].Y()); //Move to the starting point
+ snprintf(pString, nBezString, "%" SAL_PRIdINT64 " %" SAL_PRIdINT64 " moveto\n",
+ sal_Int64(pPtAry[i][0].X()), sal_Int64(pPtAry[i][0].Y())); //Move to the starting point
WritePS(mpPageBody, pString);
for (unsigned int j=1; j < nPoints;)
{
@@ -600,7 +602,8 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints,
// polygon without beziers
if ( ! pFlgAry[i] || pFlgAry[i][j] != PolyFlags::Control)
{
- snprintf(pString, nBezString, "%li %li lineto\n", pPtAry[i][j].X(), pPtAry[i][j].Y());
+ snprintf(pString, nBezString, "%" SAL_PRIdINT64 " %" SAL_PRIdINT64 " lineto\n",
+ sal_Int64(pPtAry[i][j].X()), sal_Int64(pPtAry[i][j].Y()));
WritePS(mpPageBody, pString);
j++;
}
@@ -610,10 +613,10 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints,
break; //Error: wrong sequence of control/normal points somehow
if ((pFlgAry[i][j] == PolyFlags::Control) && (pFlgAry[i][j+1] == PolyFlags::Control) && (pFlgAry[i][j+2] != PolyFlags::Control))
{
- snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n",
- pPtAry[i][j].X(), pPtAry[i][j].Y(),
- pPtAry[i][j+1].X(), pPtAry[i][j+1].Y(),
- pPtAry[i][j+2].X(), pPtAry[i][j+2].Y());
+ snprintf(pString, nBezString, "%" SAL_PRIdINT64 " %" SAL_PRIdINT64 " %" SAL_PRIdINT64 " %" SAL_PRIdINT64 " %" SAL_PRIdINT64 " %" SAL_PRIdINT64 " curveto\n",
+ sal_Int64(pPtAry[i][j].X()), sal_Int64(pPtAry[i][j].Y()),
+ sal_Int64(pPtAry[i][j+1].X()), sal_Int64(pPtAry[i][j+1].Y()),
+ sal_Int64(pPtAry[i][j+2].X()), sal_Int64(pPtAry[i][j+2].Y()));
WritePS(mpPageBody, pString);
}
else