From 8d8508e4d25eee31eef9c39bf790320bfd429d08 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Tue, 4 Jun 2013 13:09:01 +0200 Subject: [PATCH] Missed some cppcheck items. --- ChangeLog | 12 +++++++++++- src/base/ftobjs.c | 2 +- src/raster/ftraster.c | 2 +- src/tools/test_trig.c | 10 +++------- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8d2e0315..6201e362f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,8 +4,18 @@ http://cppcheck.sourceforge.net/ + The call was (from the top-level of the FreeType tree): + + cppcheck --force \ + --enable=all \ + -I include \ + -I include/freetype/ \ + -I include/freetype/config/ \ + -I include/freetype/internal/ \ + . &> cppcheck.log + Note that the current version heavily chokes on FreeType, delivering - even wrong results. I will report those issues to the cppcheck team + many wrong results. I will report those issues to the cppcheck team so that a newer version gives improved results hopefully. */* Improve variable scopes. diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 26118ed9a..dff60e3ed 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -3188,7 +3188,7 @@ { FT_CMap_Class clazz = cmap->clazz; FT_Face face = cmap->charmap.face; - FT_Memory memory = FT_FACE_MEMORY(face); + FT_Memory memory = FT_FACE_MEMORY( face ); if ( clazz->done ) diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c index d21480689..a16142843 100644 --- a/src/raster/ftraster.c +++ b/src/raster/ftraster.c @@ -2532,7 +2532,6 @@ if ( x2 - x1 < ras.precision ) { Long e1, e2; - Byte f1; e1 = CEILING( x1 ); @@ -2540,6 +2539,7 @@ if ( e1 == e2 ) { + Byte f1; PByte bits; diff --git a/src/tools/test_trig.c b/src/tools/test_trig.c index d1dec7e01..49d927e36 100644 --- a/src/tools/test_trig.c +++ b/src/tools/test_trig.c @@ -23,11 +23,10 @@ for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) { FT_Fixed f1, f2; - double d1, d2; + double d2; f1 = FT_Cos(i); - d1 = f1/65536.0; d2 = cos( i*SPI ); f2 = (FT_Fixed)(d2*65536.0); @@ -50,11 +49,10 @@ for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) { FT_Fixed f1, f2; - double d1, d2; + double d2; f1 = FT_Sin(i); - d1 = f1/65536.0; d2 = sin( i*SPI ); f2 = (FT_Fixed)(d2*65536.0); @@ -77,11 +75,10 @@ for ( i = 0; i < FT_ANGLE_PI2-0x2000000; i += 0x10000 ) { FT_Fixed f1, f2; - double d1, d2; + double d2; f1 = FT_Tan(i); - d1 = f1/65536.0; d2 = tan( i*SPI ); f2 = (FT_Fixed)(d2*65536.0); @@ -211,7 +208,6 @@ FT_Fixed c2, s2, c4, s4; FT_Vector v; double l, a, c1, s1, c3, s3; - int j; l = 500.0;