summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorConstantin Kaplinsky <const@tightvnc.com>2008-01-18 14:33:05 +0000
committerConstantin Kaplinsky <const@tightvnc.com>2008-01-18 14:33:05 +0000
commitadebffbd8b5005b0ae388525612ffb990118d4e0 (patch)
treef2647f4960a6d25d6400a149a261a2447292b4d9 /unix
parentec45c48753517707dcedaf298c11180af0d8637b (diff)
downloadtigervnc-adebffbd8b5005b0ae388525612ffb990118d4e0.tar.gz
tigervnc-adebffbd8b5005b0ae388525612ffb990118d4e0.zip
Made a number of member variables constants.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2410 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix')
-rw-r--r--unix/x0vncserver/PollingManager.cxx15
-rw-r--r--unix/x0vncserver/PollingManager.h16
2 files changed, 13 insertions, 18 deletions
diff --git a/unix/x0vncserver/PollingManager.cxx b/unix/x0vncserver/PollingManager.cxx
index 9ae8d159..91407784 100644
--- a/unix/x0vncserver/PollingManager.cxx
+++ b/unix/x0vncserver/PollingManager.cxx
@@ -63,19 +63,14 @@ PollingManager::PollingManager(Display *dpy, Image *image,
m_offsetLeft(offsetLeft),
m_offsetTop(offsetTop),
m_width(image->xim->width),
- m_height(m_image->xim->height),
+ m_height(image->xim->height),
+ m_widthTiles((image->xim->width + 31) / 32),
+ m_heightTiles((image->xim->height + 31) / 32),
+ m_numTiles(((image->xim->width + 31) / 32) *
+ ((image->xim->height + 31) / 32)),
m_numVideoPasses(0),
m_pollingStep(0)
{
- // Save width and height of the screen (and the image).
- m_width = m_image->xim->width;
- m_height = m_image->xim->height;
-
- // Compute width and height in 32x32 tiles.
- m_widthTiles = (m_width + 31) / 32;
- m_heightTiles = (m_height + 31) / 32;
- m_numTiles = m_widthTiles * m_heightTiles;
-
// Get initial screen image.
m_image->get(DefaultRootWindow(m_dpy), m_offsetLeft, m_offsetTop);
diff --git a/unix/x0vncserver/PollingManager.h b/unix/x0vncserver/PollingManager.h
index 25323b57..9f3ff883 100644
--- a/unix/x0vncserver/PollingManager.h
+++ b/unix/x0vncserver/PollingManager.h
@@ -64,12 +64,12 @@ protected:
VNCServer *m_server;
Image *m_image;
- int m_bytesPerPixel;
+ const int m_bytesPerPixel;
- int m_offsetLeft;
- int m_offsetTop;
- int m_width;
- int m_height;
+ const int m_offsetLeft;
+ const int m_offsetTop;
+ const int m_width;
+ const int m_height;
private:
@@ -120,9 +120,9 @@ private:
Image *m_rowImage; // one row of the framebuffer
Image *m_columnImage; // one column of the framebuffer
- int m_widthTiles; // shortcut for ((m_width + 31) / 32)
- int m_heightTiles; // shortcut for ((m_height + 31) / 32)
- int m_numTiles; // shortcut for (m_widthTiles * m_heightTiles)
+ const int m_widthTiles; // shortcut for ((m_width + 31) / 32)
+ const int m_heightTiles; // shortcut for ((m_height + 31) / 32)
+ const int m_numTiles; // shortcut for (m_widthTiles * m_heightTiles)
// m_changeFlags[] array will hold boolean values corresponding to
// each 32x32 tile. If a value is true, then we've detected a change