Missed some cppcheck items.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
diff --git a/ChangeLog b/ChangeLog
index a8d2e03..6201e36 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 26118ed..dff60e3 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 d214806..a161428 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 d1dec7e..49d927e 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;