From: DRC Date: Fri, 19 Aug 2011 03:13:47 +0000 (+0000) Subject: Make rawBytesEquivalent an unsigned 64-bit integer. Otherwise, it will overflow... X-Git-Tag: v1.1.90~168 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=887c5fd86e052f31a4cd039b5634a16af7c8e780;p=tigervnc.git Make rawBytesEquivalent an unsigned 64-bit integer. Otherwise, it will overflow in less than a minute if using a full-screen video or 3D application. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4639 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/common/rdr/types.h b/common/rdr/types.h index 458a13e6..05d27773 100644 --- a/common/rdr/types.h +++ b/common/rdr/types.h @@ -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; diff --git a/common/rfb/SMsgWriter.cxx b/common/rfb/SMsgWriter.cxx index f0a97c59..07ae37d5 100644 --- a/common/rfb/SMsgWriter.cxx +++ b/common/rfb/SMsgWriter.cxx @@ -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; } diff --git a/common/rfb/SMsgWriter.h b/common/rfb/SMsgWriter.h index 8112d010..d7926880 100644 --- a/common/rfb/SMsgWriter.h +++ b/common/rfb/SMsgWriter.h @@ -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;