summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-09-28 11:56:03 +0200
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2016-10-02 08:20:44 +0000
commitd866c3af42bb32a328ce2fd7e460744e28efd08d (patch)
tree9e06c5d2b131d7b54d552c9655abf944882d0b3a
parentadd default cases (diff)
downloadcore-d866c3af42bb32a328ce2fd7e460744e28efd08d.tar.gz
core-d866c3af42bb32a328ce2fd7e460744e28efd08d.zip
cppcheck invalidPrintfArgType
signedness and long vs int corrections Change-Id: I67c6b9e05b16f5d8d4693879f1656db50dc7ec48 Reviewed-on: https://gerrit.libreoffice.org/29355 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
-rw-r--r--extensions/test/ole/AxTestComponents/Basic.cpp14
-rw-r--r--setup_native/source/win32/wintools/makecab/parseddf.c4
-rw-r--r--solenv/bin/concat-deps.c2
-rw-r--r--vcl/source/fontsubset/sft.cxx2
-rw-r--r--winaccessibility/source/UAccCOM/AccTextBase.cxx2
5 files changed, 12 insertions, 12 deletions
diff --git a/extensions/test/ole/AxTestComponents/Basic.cpp b/extensions/test/ole/AxTestComponents/Basic.cpp
index d35469e3f611..2406ba12f0c7 100644
--- a/extensions/test/ole/AxTestComponents/Basic.cpp
+++ b/extensions/test/ole/AxTestComponents/Basic.cpp
@@ -545,7 +545,7 @@ void CBasic::printArray( LPSAFEARRAY val, BSTR message, VARTYPE type)
case VT_I4:
case VT_ERROR:
hr= SafeArrayGetElement( val, &i, (void*)&data);
- sprintf( tmp, "%d \n", *(long*)&data);
+ sprintf( tmp, "%ld \n", *(long*)&data);
break;
case VT_BSTR:
hr= SafeArrayGetElement( val, &i, (void*)&data);
@@ -803,15 +803,15 @@ void CBasic::printMulArray( SAFEARRAY* val, VARTYPE type)
{
case VT_I4:
hr= SafeArrayGetElement( val, index, &longVal);
- sprintf( tmpBuf, "(%d,%d): %d\n", index[1], index[0], longVal);
+ sprintf( tmpBuf, "(%ld,%ld): %ld\n", index[1], index[0], longVal);
break;
case VT_UI1:
hr= SafeArrayGetElement( val, index, &longVal);
- sprintf( tmpBuf, "(%d,%d): %d\n", index[1], index[0], (unsigned char)longVal);
+ sprintf( tmpBuf, "(%ld,%ld): %d\n", index[1], index[0], (unsigned char)longVal);
break;
case VT_VARIANT:
hr= SafeArrayGetElement( val, index, &var );
- sprintf( tmpBuf, "(%d,%d): %d (vartype %d)\n", index[1], index[0], var.byref, var.vt);
+ sprintf( tmpBuf, "(%ld,%ld): %d (vartype %d)\n", index[1], index[0], var.byref, var.vt);
break;
}
strcat( buff,tmpBuf);
@@ -852,16 +852,16 @@ void CBasic::printMulArray( SAFEARRAY* val, VARTYPE type)
{
case VT_I4:
hr= SafeArrayGetElement( val, index, &longVal);
- sprintf( tmpBuf, "(%d,%d,%d): %d\n", index[2], index[1], index[0], longVal);
+ sprintf( tmpBuf, "(%ld,%ld,%ld): %ld\n", index[2], index[1], index[0], longVal);
break;
case VT_UI1:
hr= SafeArrayGetElement( val, index, &longVal);
- sprintf( tmpBuf, "(%d,%d,%d): %d\n", index[2], index[1], index[0], (unsigned char)longVal);
+ sprintf( tmpBuf, "(%ld,%ld,%ld): %d\n", index[2], index[1], index[0], (unsigned char)longVal);
break;
case VT_VARIANT:
hr= SafeArrayGetElement( val, index, &var );
- sprintf( tmpBuf, "(%d,%d,%d): %d (vartype %d)\n", index[2], index[1], index[0], var.byref, var.vt);
+ sprintf( tmpBuf, "(%ld,%ld,%ld): %d (vartype %d)\n", index[2], index[1], index[0], var.byref, var.vt);
break;
}
strcat( buff,tmpBuf);
diff --git a/setup_native/source/win32/wintools/makecab/parseddf.c b/setup_native/source/win32/wintools/makecab/parseddf.c
index 98dfaa1d9bcd..bde5be4a9a9f 100644
--- a/setup_native/source/win32/wintools/makecab/parseddf.c
+++ b/setup_native/source/win32/wintools/makecab/parseddf.c
@@ -47,8 +47,8 @@ void trim(char * str)
void ddfLogProgress(DDFLOGLEVEL lvl, char * desc, unsigned int progress)
{
if (DdfVerb < lvl) return;
- if (progress == 0) printf(" %s: %3d%%", desc, progress);
- else if (progress > 0 && progress < 100) printf("\r %s: %3d%%", desc, progress);
+ if (progress == 0) printf(" %s: %3u%%", desc, progress);
+ else if (progress > 0 && progress < 100) printf("\r %s: %3u%%", desc, progress);
else if (progress == 100) printf("\r %s: 100%%\n", desc);
fflush(stdout);
}
diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c
index bb419baa71f4..064492ae8c5d 100644
--- a/solenv/bin/concat-deps.c
+++ b/solenv/bin/concat-deps.c
@@ -481,7 +481,7 @@ unsigned int i;
hash->size = (old_size << 1) + 1;
/* we really should avoid to get there... so print a message to alert of the condition */
- fprintf(stderr, "resize hash %d -> %d\n", old_size, hash->size);
+ fprintf(stderr, "resize hash %u -> %u\n", old_size, hash->size);
if(hash->size == old_size)
{
hash->flags |= HASH_F_NO_RESIZE;
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 2385d2676033..6962712a6caf 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2338,7 +2338,7 @@ int CreateT42FromTTGlyphs(TrueTypeFont *ttf,
for (i = 1; i<nGlyphs; i++) {
fprintf(outf, "Encoding %d /glyph%u put\n", encoding[i], gID[i]);
}
- fprintf(outf, "/XUID [103 0 1 16#%08X %d 16#%08X 16#%08X] def\n", (unsigned int)rtl_crc32(0, ttf->ptr, ttf->fsize), (unsigned int)nGlyphs, (unsigned int)rtl_crc32(0, glyphArray, nGlyphs * 2), (unsigned int)rtl_crc32(0, encoding, nGlyphs));
+ fprintf(outf, "/XUID [103 0 1 16#%08X %u 16#%08X 16#%08X] def\n", (unsigned int)rtl_crc32(0, ttf->ptr, ttf->fsize), (unsigned int)nGlyphs, (unsigned int)rtl_crc32(0, glyphArray, nGlyphs * 2), (unsigned int)rtl_crc32(0, encoding, nGlyphs));
DumpSfnts(outf, sfntP, sfntLen);
diff --git a/winaccessibility/source/UAccCOM/AccTextBase.cxx b/winaccessibility/source/UAccCOM/AccTextBase.cxx
index 705e968b293e..fed8aee406c9 100644
--- a/winaccessibility/source/UAccCOM/AccTextBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccTextBase.cxx
@@ -175,7 +175,7 @@ STDMETHODIMP CAccTextBase::get_attributes(long offset, long * startOffset, long
unsigned long nColor;
pValue.Value >>= nColor;
OLECHAR pBuf[64];
- swprintf( pBuf, L"%08X", nColor );
+ swprintf( pBuf, L"%08lX", nColor );
pTemp[0]=L'#';
wcscat( pTemp, pBuf );