]> source.dussan.org Git - tigervnc.git/commitdiff
Remove unused bufSize argument from streams
authorPierre Ossman <ossman@cendio.se>
Tue, 19 May 2020 17:49:41 +0000 (19:49 +0200)
committerPierre Ossman <ossman@cendio.se>
Thu, 21 May 2020 09:34:22 +0000 (11:34 +0200)
17 files changed:
common/rdr/BufferedInStream.cxx
common/rdr/BufferedInStream.h
common/rdr/BufferedOutStream.cxx
common/rdr/BufferedOutStream.h
common/rdr/FdInStream.cxx
common/rdr/FdInStream.h
common/rdr/FdOutStream.cxx
common/rdr/FdOutStream.h
common/rdr/HexInStream.cxx
common/rdr/HexInStream.h
common/rdr/HexOutStream.cxx
common/rdr/HexOutStream.h
common/rdr/ZlibInStream.cxx
common/rdr/ZlibInStream.h
common/rdr/ZlibOutStream.cxx
common/rdr/ZlibOutStream.h
common/rfb/ZRLEEncoder.cxx

index 5db3953a50285c61c5788baf483e8e5c6ef8530b..64cdb667c3041f590ada4c120ce9c52dc3b78a9c 100644 (file)
@@ -28,8 +28,8 @@ using namespace rdr;
 
 static const size_t DEFAULT_BUF_SIZE = 8192;
 
-BufferedInStream::BufferedInStream(size_t bufSize_)
-  : bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)
+BufferedInStream::BufferedInStream()
+  : bufSize(DEFAULT_BUF_SIZE), offset(0)
 {
   ptr = end = start = new U8[bufSize];
 }
index 61e57d6555e5daec5c9e7feea5bf5265c7b34354..acf2b92796afd3bf0eb440521d798b9be512a2fc 100644 (file)
@@ -46,7 +46,7 @@ namespace rdr {
     U8* start;
 
   protected:
-    BufferedInStream(size_t bufSize=0);
+    BufferedInStream();
   };
 
 } // end of namespace rdr
index 69e877adf47acfcf814d06b01f296a22a71f0ec4..ac76f6a7800536b9fef05ba3c74198f7b0eeb190 100644 (file)
@@ -30,8 +30,8 @@ using namespace rdr;
 
 static const size_t DEFAULT_BUF_SIZE = 16384;
 
-BufferedOutStream::BufferedOutStream(size_t bufSize_)
-  : bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)
+BufferedOutStream::BufferedOutStream()
+  : bufSize(DEFAULT_BUF_SIZE), offset(0)
 {
   ptr = start = sentUpTo = new U8[bufSize];
   end = start + bufSize;
index c33621b68cc9140059924d999b69f44cb700565d..8e3229d52cce09005ad6d4d538be86c0f14d6c1f 100644 (file)
@@ -57,7 +57,7 @@ namespace rdr {
     U8* sentUpTo;
 
   protected:
-    BufferedOutStream(size_t bufSize=0);
+    BufferedOutStream();
   };
 
 }
index c9d2241c186102c346b7c8384fc2179d8386df1e..d27533884bad7965089e7f93fd0a1022d17297ca 100644 (file)
@@ -48,19 +48,16 @@ using namespace rdr;
 
 enum { DEFAULT_BUF_SIZE = 8192 };
 
-FdInStream::FdInStream(int fd_, int timeoutms_, size_t bufSize_,
+FdInStream::FdInStream(int fd_, int timeoutms_,
                        bool closeWhenDone_)
-  : BufferedInStream(bufSize_),
-    fd(fd_), closeWhenDone(closeWhenDone_),
+  : fd(fd_), closeWhenDone(closeWhenDone_),
     timeoutms(timeoutms_), blockCallback(0),
     timing(false), timeWaitedIn100us(5), timedKbits(0)
 {
 }
 
-FdInStream::FdInStream(int fd_, FdInStreamBlockCallback* blockCallback_,
-                       size_t bufSize_)
-  : BufferedInStream(bufSize_),
-    fd(fd_), timeoutms(0), blockCallback(blockCallback_),
+FdInStream::FdInStream(int fd_, FdInStreamBlockCallback* blockCallback_)
+  : fd(fd_), timeoutms(0), blockCallback(blockCallback_),
     timing(false), timeWaitedIn100us(5), timedKbits(0)
 {
 }
index f7a52baf8bd7fc67830cb778aac586e97780c4c3..82280f9f1bc1834addfde1540145051ec29840e7 100644 (file)
@@ -37,10 +37,8 @@ namespace rdr {
 
   public:
 
-    FdInStream(int fd, int timeoutms=-1, size_t bufSize=0,
-               bool closeWhenDone_=false);
-    FdInStream(int fd, FdInStreamBlockCallback* blockCallback,
-               size_t bufSize=0);
+    FdInStream(int fd, int timeoutms=-1, bool closeWhenDone_=false);
+    FdInStream(int fd, FdInStreamBlockCallback* blockCallback);
     virtual ~FdInStream();
 
     void setTimeout(int timeoutms);
index 4fc74671107e0a539b3780466ba52466cbf70a7d..d7da71038b2b99d3bd578d9177e3e1c91dcdd116 100644 (file)
@@ -49,9 +49,8 @@
 
 using namespace rdr;
 
-FdOutStream::FdOutStream(int fd_, bool blocking_, int timeoutms_, size_t bufSize_)
-  : BufferedOutStream(bufSize_),
-    fd(fd_), blocking(blocking_), timeoutms(timeoutms_)
+FdOutStream::FdOutStream(int fd_, bool blocking_, int timeoutms_)
+  : fd(fd_), blocking(blocking_), timeoutms(timeoutms_)
 {
   gettimeofday(&lastWrite, NULL);
 }
index b1ecbd5698c05b750ea3ebaa507df51e62f56bcf..24327972817fb0e8637e7d5b988e7b8a8e5afc78 100644 (file)
@@ -34,7 +34,7 @@ namespace rdr {
 
   public:
 
-    FdOutStream(int fd, bool blocking=true, int timeoutms=-1, size_t bufSize=0);
+    FdOutStream(int fd, bool blocking=true, int timeoutms=-1);
     virtual ~FdOutStream();
 
     void setTimeout(int timeoutms);
index ab98298fd3e1dc2447a3bc4d2a4795c930c606c9..3800961d5a07314f7dec7e8ec37bad6b0efcee30 100644 (file)
@@ -26,8 +26,8 @@ using namespace rdr;
 
 static inline int min(int a, int b) {return a<b ? a : b;}
 
-HexInStream::HexInStream(InStream& is, size_t bufSize_)
-: BufferedInStream(bufSize_), in_stream(is)
+HexInStream::HexInStream(InStream& is)
+: in_stream(is)
 {
 }
 
index 87c050a95a1efb89f335e28762f4b752d0daa522..5142a655151fe90b085dc4f98666699ff3af43ae 100644 (file)
@@ -26,7 +26,7 @@ namespace rdr {
   class HexInStream : public BufferedInStream {
   public:
 
-    HexInStream(InStream& is, size_t bufSize=0);
+    HexInStream(InStream& is);
     virtual ~HexInStream();
 
     static bool readHexAndShift(char c, int* v);
index a44c3998c54ea139f3f719f55461274071d2b09d..19c66851e24325bc800c601c542c46ec7ada651c 100644 (file)
@@ -25,8 +25,8 @@ const int DEFAULT_BUF_LEN = 16384;
 
 static inline size_t min(size_t a, size_t b) {return a<b ? a : b;}
 
-HexOutStream::HexOutStream(OutStream& os, size_t buflen)
-: out_stream(os), offset(0), bufSize(buflen ? buflen : DEFAULT_BUF_LEN)
+HexOutStream::HexOutStream(OutStream& os)
+  : out_stream(os), offset(0), bufSize(DEFAULT_BUF_LEN)
 {
   if (bufSize % 2)
     bufSize--;
index 2982768958b4731098f2828f11cdc36c4fe962d5..02366478807e92ea9f0633ec52b2752b1eed6561 100644 (file)
@@ -26,7 +26,7 @@ namespace rdr {
   class HexOutStream : public OutStream {
   public:
 
-    HexOutStream(OutStream& os, size_t buflen=0);
+    HexOutStream(OutStream& os);
     virtual ~HexOutStream();
 
     void flush();
index 2e4e080ba3c8a7529b83cbd80f8dfe6f140fa7be..b9e772d544610e3d0cf308992537c07071d7fd84 100644 (file)
@@ -24,9 +24,8 @@
 
 using namespace rdr;
 
-ZlibInStream::ZlibInStream(size_t bufSize_)
-  : BufferedInStream(bufSize_),
-    underlying(0), zs(NULL), bytesIn(0)
+ZlibInStream::ZlibInStream()
+  : underlying(0), zs(NULL), bytesIn(0)
 {
   init();
 }
index 04416756667130325c4dcd4834a6faa62a3d73fa..1597b54a546f4ee228e4d49093311ca1e431feab 100644 (file)
@@ -33,7 +33,7 @@ namespace rdr {
   class ZlibInStream : public BufferedInStream {
 
   public:
-    ZlibInStream(size_t bufSize=0);
+    ZlibInStream();
     virtual ~ZlibInStream();
 
     void setUnderlying(InStream* is, size_t bytesIn);
index 78abfc4914017337e599db109893d8c5d7c17be7..8f7170dae9b568257409c7fa33b09677cab2e339 100644 (file)
@@ -33,9 +33,9 @@ using namespace rdr;
 
 enum { DEFAULT_BUF_SIZE = 16384 };
 
-ZlibOutStream::ZlibOutStream(OutStream* os, size_t bufSize_, int compressLevel)
+ZlibOutStream::ZlibOutStream(OutStream* os, int compressLevel)
   : underlying(os), compressionLevel(compressLevel), newLevel(compressLevel),
-    bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)
+    bufSize(DEFAULT_BUF_SIZE), offset(0)
 {
   zs = new z_stream;
   zs->zalloc    = Z_NULL;
index aa1875c30f2b7bd7ff1d79e8da022f931a422c89..2b08f8d5de60f27a9303938e2509e521d744aa24 100644 (file)
@@ -35,7 +35,7 @@ namespace rdr {
 
   public:
 
-    ZlibOutStream(OutStream* os=0, size_t bufSize=0, int compressionLevel=-1);
+    ZlibOutStream(OutStream* os=0, int compressionLevel=-1);
     virtual ~ZlibOutStream();
 
     void setUnderlying(OutStream* os);
index 92fd13d1cebc75c7a9ebe263258f08891c12b740..c055c5270e5c172bf4959204a9fb40667cd27e1a 100644 (file)
@@ -30,7 +30,7 @@ IntParameter zlibLevel("ZlibLevel","Zlib compression level",-1);
 
 ZRLEEncoder::ZRLEEncoder(SConnection* conn)
   : Encoder(conn, encodingZRLE, EncoderPlain, 127),
-  zos(0,0,zlibLevel), mos(129*1024)
+  zos(0,zlibLevel), mos(129*1024)
 {
   zos.setUnderlying(&mos);
 }