summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRitt Konstantin <ritt.ks@gmail.com>2011-06-06 11:52:10 (GMT)
committerHarald Fernengel <harald.fernengel@nokia.com>2011-06-06 11:52:10 (GMT)
commiteb1932b45e91108c67de7164d07415c1df87e33b (patch)
treef9bf84468054cc2da2dbe633ddf9b7e9dbfceca0
parentafafb37b7ef6130ab0545c9d12c7995e85dfb9b0 (diff)
downloadQt-eb1932b45e91108c67de7164d07415c1df87e33b.zip
Qt-eb1932b45e91108c67de7164d07415c1df87e33b.tar.gz
Qt-eb1932b45e91108c67de7164d07415c1df87e33b.tar.bz2
minor code simplification
there is no need in non-const object as we don't change it anyways Merge-request: 2627 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
-rw-r--r--src/gui/painting/qwindowsurface_qws.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gui/painting/qwindowsurface_qws.cpp b/src/gui/painting/qwindowsurface_qws.cpp
index 88d7d27..7e8cf9b 100644
--- a/src/gui/painting/qwindowsurface_qws.cpp
+++ b/src/gui/painting/qwindowsurface_qws.cpp
@@ -1079,17 +1079,15 @@ bool QWSSharedMemSurface::setMemory(int memId)
void QWSSharedMemSurface::setDirectRegion(const QRegion &r, int id)
{
QWSMemorySurface::setDirectRegion(r, id);
- if(mem.address())
+ if (mem.address())
*(uint *)mem.address() = id;
}
const QRegion QWSSharedMemSurface::directRegion() const
{
- QWSSharedMemory *cmem = const_cast<QWSSharedMemory *>(&mem);
- if (cmem->address() && ((int*)cmem->address())[0] == directRegionId())
+ if (mem.address() && *(uint *)mem.address() == uint(directRegionId())
return QWSMemorySurface::directRegion();
- else
- return QRegion();
+ return QRegion();
}
#endif