[BugFix] Negative statistics (pixel data, update rectangles etc). Fixed by replacing statistics variables type from int to long.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3457 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/java/src/com/tightvnc/decoder/TightDecoder.java b/java/src/com/tightvnc/decoder/TightDecoder.java
index 33ba7db..ef07f9c 100644
--- a/java/src/com/tightvnc/decoder/TightDecoder.java
+++ b/java/src/com/tightvnc/decoder/TightDecoder.java
@@ -57,7 +57,7 @@
   // JPEG processing statistic methods
   //
 
-  public int getNumJPEGRects() {
+  public long getNumJPEGRects() {
     return statNumRectsTightJPEG;
   }
 
@@ -69,7 +69,7 @@
   // Tight processing statistic methods
   //
 
-  public int getNumTightRects() {
+  public long getNumTightRects() {
     return statNumRectsTight;
   }
 
@@ -489,7 +489,7 @@
   private Rectangle jpegRect;
   private Repaintable repainatableControl = null;
   // Jpeg decoding statistics
-  private int statNumRectsTightJPEG = 0;
+  private long statNumRectsTightJPEG = 0;
   // Tight decoding statistics
-  private int statNumRectsTight = 0;
+  private long statNumRectsTight = 0;
 }
diff --git a/java/src/com/tightvnc/vncviewer/VncCanvas.java b/java/src/com/tightvnc/vncviewer/VncCanvas.java
index 32d709a..823f899 100644
--- a/java/src/com/tightvnc/vncviewer/VncCanvas.java
+++ b/java/src/com/tightvnc/vncviewer/VncCanvas.java
@@ -76,17 +76,17 @@
 
   // Update statistics.
   long statStartTime;           // time on first framebufferUpdateRequest
-  int statNumUpdates;           // counter for FramebufferUpdate messages
-  int statNumTotalRects;        // rectangles in FramebufferUpdate messages
-  int statNumPixelRects;        // the same, but excluding pseudo-rectangles
-  int statNumRectsTight;        // Tight-encoded rectangles (including JPEG)
-  int statNumRectsTightJPEG;    // JPEG-compressed Tight-encoded rectangles
-  int statNumRectsZRLE;         // ZRLE-encoded rectangles
-  int statNumRectsHextile;      // Hextile-encoded rectangles
-  int statNumRectsRaw;          // Raw-encoded rectangles
-  int statNumRectsCopy;         // CopyRect rectangles
-  int statNumBytesEncoded;      // number of bytes in updates, as received
-  int statNumBytesDecoded;      // number of bytes, as if Raw encoding was used
+  long statNumUpdates;           // counter for FramebufferUpdate messages
+  long statNumTotalRects;        // rectangles in FramebufferUpdate messages
+  long statNumPixelRects;        // the same, but excluding pseudo-rectangles
+  long statNumRectsTight;        // Tight-encoded rectangles (including JPEG)
+  long statNumRectsTightJPEG;    // JPEG-compressed Tight-encoded rectangles
+  long statNumRectsZRLE;         // ZRLE-encoded rectangles
+  long statNumRectsHextile;      // Hextile-encoded rectangles
+  long statNumRectsRaw;          // Raw-encoded rectangles
+  long statNumRectsCopy;         // CopyRect rectangles
+  long statNumBytesEncoded;      // number of bytes in updates, as received
+  long statNumBytesDecoded;      // number of bytes, as if Raw encoding was used
 
   // True if we process keyboard and mouse events.
   boolean inputEnabled;
diff --git a/java/src/com/tightvnc/vncviewer/VncViewer.java b/java/src/com/tightvnc/vncviewer/VncViewer.java
index 7b913b3..4ff85ff 100644
--- a/java/src/com/tightvnc/vncviewer/VncViewer.java
+++ b/java/src/com/tightvnc/vncviewer/VncViewer.java
@@ -838,12 +838,12 @@
     if (vc != null) {
       double sec = (System.currentTimeMillis() - vc.statStartTime) / 1000.0;
       double rate = Math.round(vc.statNumUpdates / sec * 100) / 100.0;
-      int nRealRects = vc.statNumPixelRects;
-      int nPseudoRects = vc.statNumTotalRects - vc.statNumPixelRects;
+      long nRealRects = vc.statNumPixelRects;
+      long nPseudoRects = vc.statNumTotalRects - vc.statNumPixelRects;
       System.out.println("Updates received: " + vc.statNumUpdates + " (" +
                          nRealRects + " rectangles + " + nPseudoRects +
                          " pseudo), " + rate + " updates/sec");
-      int numRectsOther = nRealRects - vc.statNumRectsTight
+      long numRectsOther = nRealRects - vc.statNumRectsTight
         - vc.statNumRectsZRLE - vc.statNumRectsHextile
         - vc.statNumRectsRaw - vc.statNumRectsCopy;
       System.out.println("Rectangles:" +
@@ -855,8 +855,8 @@
                          " CopyRect=" + vc.statNumRectsCopy +
                          " other=" + numRectsOther);
 
-      int raw = vc.statNumBytesDecoded;
-      int compressed = vc.statNumBytesEncoded;
+      long raw = vc.statNumBytesDecoded;
+      long compressed = vc.statNumBytesEncoded;
       if (compressed > 0) {
           double ratio = Math.round((double)raw / compressed * 1000) / 1000.0;
           System.out.println("Pixel data: " + vc.statNumBytesDecoded +