Be more liberal with const in places where write access isn't needed.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4840 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/JpegCompressor.cxx b/common/rfb/JpegCompressor.cxx
index f4b6ed1..b3c5f7c 100644
--- a/common/rfb/JpegCompressor.cxx
+++ b/common/rfb/JpegCompressor.cxx
@@ -141,7 +141,7 @@
   delete cinfo;
 }
 
-void JpegCompressor::compress(rdr::U8 *buf, int pitch, const Rect& r,
+void JpegCompressor::compress(const rdr::U8 *buf, int pitch, const Rect& r,
   const PixelFormat& pf, int quality, JPEG_SUBSAMP subsamp)
 {
   int w = r.width();
diff --git a/common/rfb/JpegCompressor.h b/common/rfb/JpegCompressor.h
index 798572e..d50e587 100644
--- a/common/rfb/JpegCompressor.h
+++ b/common/rfb/JpegCompressor.h
@@ -51,7 +51,7 @@
     JpegCompressor(int bufferLen = 128*1024);
     virtual ~JpegCompressor();
 
-    void compress(rdr::U8 *, int, const Rect&, const PixelFormat&, int,
+    void compress(const rdr::U8 *, int, const Rect&, const PixelFormat&, int,
       JPEG_SUBSAMP);
 
     void writeBytes(const void*, int);
diff --git a/common/rfb/PixelTransformer.cxx b/common/rfb/PixelTransformer.cxx
index ce799ac..cedf900 100644
--- a/common/rfb/PixelTransformer.cxx
+++ b/common/rfb/PixelTransformer.cxx
@@ -31,7 +31,7 @@
 using namespace rfb;
 
 static void noTransFn(void* table_,
-                      const PixelFormat& inPF, void* inPtr, int inStride,
+                      const PixelFormat& inPF, const void* inPtr, int inStride,
                       const PixelFormat& outPF, void* outPtr, int outStride,
                       int width, int height)
 {
@@ -289,7 +289,7 @@
   }
 }
 
-void PixelTransformer::translatePixels(void* inPtr, void* outPtr,
+void PixelTransformer::translatePixels(const void* inPtr, void* outPtr,
                                        int nPixels) const
 {
   if (!transFn)
@@ -299,7 +299,7 @@
              outPF, outPtr, nPixels, nPixels, 1);
 }
 
-void PixelTransformer::translateRect(void* inPtr, int inStride,
+void PixelTransformer::translateRect(const void* inPtr, int inStride,
                                      Rect inRect,
                                      void* outPtr, int outStride,
                                      Point outCoord) const
diff --git a/common/rfb/PixelTransformer.h b/common/rfb/PixelTransformer.h
index a368b63..88ec7c4 100644
--- a/common/rfb/PixelTransformer.h
+++ b/common/rfb/PixelTransformer.h
@@ -27,7 +27,7 @@
 
 namespace rfb {
   typedef void (*transFnType)(void* table_,
-                              const PixelFormat& inPF, void* inPtr,
+                              const PixelFormat& inPF, const void* inPtr,
                               int inStride,
                               const PixelFormat& outPF, void* outPtr,
                               int outStride, int width, int height);
@@ -78,11 +78,11 @@
     // putting it into the buffer pointed to by outPtr.  The pixels at inPtr
     // should be in the format given by inPF to init(), and the translated
     // pixels will be in the format given by the outPF argument to init().
-    void translatePixels(void* inPtr, void* outPtr, int nPixels) const;
+    void translatePixels(const void* inPtr, void* outPtr, int nPixels) const;
 
     // Similar to translatePixels() but handles an arbitrary region of
     // two pixel buffers.
-    void translateRect(void* inPtr, int inStride, Rect inRect,
+    void translateRect(const void* inPtr, int inStride, Rect inRect,
                        void* outPtr, int outStride, Point outCoord) const;
 
     bool willTransform(void);
diff --git a/common/rfb/transTempl.h b/common/rfb/transTempl.h
index 09dc7f9..b133e86 100644
--- a/common/rfb/transTempl.h
+++ b/common/rfb/transTempl.h
@@ -51,7 +51,7 @@
 // large (for 16bpp, the table needs 64K entries).
 
 void transSimpleINtoOUT (void* table_,
-                         const PixelFormat& inPF, void* inPtr, int inStride,
+                         const PixelFormat& inPF, const void* inPtr, int inStride,
                          const PixelFormat& outPF, void* outPtr, int outStride,
                          int width, int height)
 {
@@ -85,7 +85,7 @@
 // into two different functions for efficiency.
 
 void transRGBINtoOUT (void* table,
-                      const PixelFormat& inPF, void* inPtr, int inStride,
+                      const PixelFormat& inPF, const void* inPtr, int inStride,
                       const PixelFormat& outPF, void* outPtr, int outStride,
                       int width, int height)
 {
@@ -115,7 +115,7 @@
 // colour cube index in a fourth table to yield a pixel value.
 
 void transRGBCubeINtoOUT (void* table,
-                          const PixelFormat& inPF, void* inPtr, int inStride,
+                          const PixelFormat& inPF, const void* inPtr, int inStride,
                           const PixelFormat& outPF, void* outPtr,
                           int outStride, int width, int height)
 {