From f37592d54f3633c0f195a10770020cbb5a732809 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Tue, 8 Jul 2014 22:03:51 +0200
Subject: Findbugs: Remove dead-code / unused [temp] storage and it's
 assignment

---
 .../graph/font/typecast/ot/mac/ResourceMap.java    | 17 ++++++------
 .../graph/font/typecast/ot/table/GposTable.java    |  8 +++---
 .../graph/font/typecast/ot/table/GsubTable.java    |  2 +-
 .../graph/font/typecast/ot/table/KernSubtable.java |  4 +--
 .../graph/font/typecast/t2/T2Interpreter.java      | 10 +++++++
 .../graph/font/typecast/tt/engine/Interpreter.java | 31 +++++++++++++---------
 6 files changed, 43 insertions(+), 29 deletions(-)

(limited to 'src/jogl/classes/jogamp/graph/font')

diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
index b22a06325..781e0adf3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
@@ -31,19 +31,19 @@ import java.io.IOException;
 public class ResourceMap {
 
     private final byte[] headerCopy = new byte[16];
-    private final int nextResourceMap;
-    private final int fileReferenceNumber;
-    private final int attributes;
+    // private final int nextResourceMap;
+    // private final int fileReferenceNumber;
+    // private final int attributes;
     private final ResourceType[] types;
 
     /** Creates new ResourceMap */
     public ResourceMap(final DataInput di) throws IOException {
         di.readFully(headerCopy);
-        nextResourceMap = di.readInt();
-        fileReferenceNumber = di.readUnsignedShort();
-        attributes = di.readUnsignedShort();
-        final int typeOffset = di.readUnsignedShort();
-        final int nameOffset = di.readUnsignedShort();
+        /* nextResourceMap = */ di.readInt();
+        /* fileReferenceNumber = */ di.readUnsignedShort();
+        /* attributes = */ di.readUnsignedShort();
+        /* final int typeOffset = */ di.readUnsignedShort();
+        /* final int nameOffset = */ di.readUnsignedShort();
         final int typeCount = di.readUnsignedShort() + 1;
 
         // Read types
@@ -65,7 +65,6 @@ public class ResourceMap {
 
     public ResourceType getResourceType(final String typeName) {
         for (int i = 0; i < types.length; i++) {
-            final String s = types[i].getTypeAsString();
             if (types[i].getTypeAsString().equals(typeName)) {
                 return types[i];
             }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
index f10d4e299..ce6f308db 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
@@ -36,10 +36,10 @@ public class GposTable implements Table {
         _de = (DirectoryEntry) de.clone();
 
         // GPOS Header
-        final int version = di.readInt();
-        final int scriptList = di.readInt();
-        final int featureList = di.readInt();
-        final int lookupList = di.readInt();
+        /* final int version = */ di.readInt();
+        /* final int scriptList = */ di.readInt();
+        /* final int featureList = */ di.readInt();
+        /* final int lookupList = */ di.readInt();
     }
 
     /** Get the table type, as a table directory value.
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
index f09973f99..3147fc8c5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
@@ -76,7 +76,7 @@ public class GsubTable implements Table, LookupSubtableFactory {
         final DataInputStream dis = new DataInputStream(new ByteArrayInputStream(buf));
 
         // GSUB Header
-        final int version = dis.readInt();
+        /* final int version = */ dis.readInt();
         final int scriptListOffset = dis.readUnsignedShort();
         final int featureListOffset = dis.readUnsignedShort();
         final int lookupListOffset = dis.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
index df5d0394f..dcf02cb2b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
@@ -28,8 +28,8 @@ public abstract class KernSubtable {
 
     public static KernSubtable read(final DataInput di) throws IOException {
         KernSubtable table = null;
-        final int version = di.readUnsignedShort();
-        final int length = di.readUnsignedShort();
+        /* final int version = */ di.readUnsignedShort();
+        /* final int length = */ di.readUnsignedShort();
         final int coverage = di.readUnsignedShort();
         final int format = coverage >> 8;
 
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java b/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
index 7bfb8cbd5..80d76a7f8 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
@@ -307,10 +307,20 @@ public class T2Interpreter {
                 dxb[count - i - 1] = popArg().intValue();
                 dya[count - i - 1] = popArg().intValue();
             }
+            /**
+             * Not using the 'popped' arguments,
+             * hence simply pop them from stack!
+             *
             final int dy3 = popArg().intValue();
             final int dy2 = popArg().intValue();
             final int dx2 = popArg().intValue();
             final int dx1 = popArg().intValue();
+            */
+            popArg();
+            popArg();
+            popArg();
+            popArg();
+
             for (int i = 0; i < count; ++i) {
                 final Point lastPoint = getLastPoint();
                 final int xa = lastPoint.x;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
index b296886cc..a7408e381 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
@@ -452,8 +452,8 @@ public class Interpreter {
     /**
      * JuMP Relative
      */
-    private int _jmpr(int instructionIndex) {
-        return instructionIndex += pop() - 1;
+    private int _jmpr(final int instructionIndex) {
+        return instructionIndex + ( pop() - 1 );
     }
 
     /**
@@ -484,7 +484,7 @@ public class Interpreter {
      * LOOP and CALL function
      */
     private void _loopcall() {
-        final int index = pop();
+        /* final int index = */ pop();
         final int count = pop();
         for (int i = 0; i < count; i++) {
             execute(functionMap[i]);
@@ -946,13 +946,13 @@ public class Interpreter {
     private void _sfvtl(final short param) {
         pop();
         pop();
-        if (param == 1) {
-            gs.freedom_vector[0] = 0x0000;
-            gs.freedom_vector[1] = 0x0000;
-        } else {
+        // if (param == 1) {
             gs.freedom_vector[0] = 0x0000;
             gs.freedom_vector[1] = 0x0000;
-        }
+        // } else {
+        //    gs.freedom_vector[0] = 0x0000;
+        //    gs.freedom_vector[1] = 0x0000;
+        //}
     }
 
     /**
@@ -1039,19 +1039,24 @@ public class Interpreter {
      */
     private void _spvtl(final short param) {
 
+        // below block is dead code, reduce to pop() calls.
+        pop();
+        pop();
+        /**
         // We'll get a copy of the line and normalize it -
         // divide the x- and y-coords by the vector's dot product.
         final Point p1 = zone[gs.zp2][pop()];
         final Point p2 = zone[gs.zp1][pop()];
         final int x = p2.x - p1.x;
         final int y = p2.y - p1.y;
-        if(param == 1) {
+         */
+        // if(param == 1) {
             gs.projection_vector[0] = 0x0000;
             gs.projection_vector[1] = 0x0000;
-        } else {
-            gs.projection_vector[0] = 0x0000;
-            gs.projection_vector[1] = 0x0000;
-        }
+        // } else {
+        //    gs.projection_vector[0] = 0x0000;
+        //    gs.projection_vector[1] = 0x0000;
+        // }
     }
 
     private void _sround() {
-- 
cgit v1.2.3