[Libreoffice-commits] core.git: 2 commits - extensions/test setup_native/source solenv/bin vcl/source vcl/unx winaccessibility/source
Jochen Nitschke
j.nitschke+logerrit at ok.de
Sun Oct 2 08:29:32 UTC 2016
extensions/test/ole/AxTestComponents/Basic.cpp | 14 +++++++-------
setup_native/source/win32/wintools/makecab/parseddf.c | 4 ++--
solenv/bin/concat-deps.c | 2 +-
vcl/source/fontsubset/sft.cxx | 2 +-
vcl/unx/kde/salnativewidgets-kde.cxx | 14 +++++++++++++-
winaccessibility/source/UAccCOM/AccTextBase.cxx | 2 +-
6 files changed, 25 insertions(+), 13 deletions(-)
New commits:
commit d866c3af42bb32a328ce2fd7e460744e28efd08d
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date: Wed Sep 28 11:56:03 2016 +0200
cppcheck invalidPrintfArgType
signedness and long vs int corrections
Change-Id: I67c6b9e05b16f5d8d4693879f1656db50dc7ec48
Reviewed-on: https://gerrit.libreoffice.org/29355
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit at ok.de>
diff --git a/extensions/test/ole/AxTestComponents/Basic.cpp b/extensions/test/ole/AxTestComponents/Basic.cpp
index d35469e..2406ba1 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 98dfaa1..bde5be4 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 bb419ba..064492a 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 2385d26..6962712 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 705e968..fed8aee 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 );
commit a9483f7105b58b6d78c06aa5b3e6e4a3466ae8dc
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date: Fri Sep 23 13:11:43 2016 +0200
add default cases
mutes over 150 warnings on kde build environments
'enumeration value ´...´ not handled in switch [-Wswitch]'
Change-Id: Iefc8cd3bc820b1d8e039db6fc188533ceffb9d39
Reviewed-on: https://gerrit.libreoffice.org/29225
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit at ok.de>
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index 77fd622..07b9bf8 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -1559,6 +1559,8 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
bReturn = true;
}
break;
+ default:
+ break;
}
break;
@@ -1610,6 +1612,9 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
bReturn = true;
break;
+
+ default:
+ break;
}
break;
@@ -1638,6 +1643,9 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
qRect.moveBy( qBoundingRect.left(), qBoundingRect.top() );
bReturn = true;
break;
+
+ default:
+ break;
}
break;
@@ -1701,8 +1709,12 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
bReturn = true;
break;
- }
+ default:
break;
+ }
+ break;
+ default:
+ break;
}
// Fill rNativeBoundingRegion and rNativeContentRegion
More information about the Libreoffice-commits
mailing list