]> source.dussan.org Git - tigervnc.git/commitdiff
Make rawBytesEquivalent an unsigned 64-bit integer. Otherwise, it will overflow...
authorDRC <dcommander@users.sourceforge.net>
Fri, 19 Aug 2011 03:33:18 +0000 (03:33 +0000)
committerDRC <dcommander@users.sourceforge.net>
Fri, 19 Aug 2011 03:33:18 +0000 (03:33 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/1_1@4640 3789f03b-4d11-0410-bbf8-ca57d06f2519

common/rdr/types.h
common/rfb/SMsgWriter.cxx
common/rfb/SMsgWriter.h

index 458a13e689b52b97a067aa963ca8234a46eccff3..05d27773bf04951a19bc66a30d6a0b1ac245fdd2 100644 (file)
@@ -24,6 +24,7 @@ namespace rdr {
   typedef unsigned char U8;
   typedef unsigned short U16;
   typedef unsigned int U32;
+  typedef unsigned long long U64;
   typedef signed char S8;
   typedef signed short S16;
   typedef signed int S32;
index 2262be09dccfb99f6f3013e660443e2ae059c2bd..38d53e90dfe8c84d474f107cf4b549c150e3fc47 100644 (file)
@@ -53,7 +53,7 @@ SMsgWriter::~SMsgWriter()
       vlog.info("  %s rects %d, bytes %d",
                 encodingName(i), rectsSent[i], bytesSent[i]);
   }
-  vlog.info("  raw bytes equivalent %d, compression ratio %f",
+  vlog.info("  raw bytes equivalent %llu, compression ratio %f",
           rawBytesEquivalent, (double)rawBytesEquivalent / bytes);
   delete [] imageBuf;
 }
index 007d7580b410526c5432fe5f397194b0f69da681..c5ff0202fda2ec9e1c4112a16bcafa1c8e6d8a06 100644 (file)
@@ -161,7 +161,7 @@ namespace rfb {
     int getUpdatesSent()           { return updatesSent; }
     int getRectsSent(int encoding) { return rectsSent[encoding]; }
     int getBytesSent(int encoding) { return bytesSent[encoding]; }
-    int getRawBytesEquivalent()    { return rawBytesEquivalent; }
+    rdr::U64 getRawBytesEquivalent()    { return rawBytesEquivalent; }
 
     int imageBufIdealSize;
 
@@ -180,7 +180,7 @@ namespace rfb {
     int updatesSent;
     int bytesSent[encodingMax+1];
     int rectsSent[encodingMax+1];
-    int rawBytesEquivalent;
+    rdr::U64 rawBytesEquivalent;
 
     rdr::U8* imageBuf;
     int imageBufSize;