Michael Stefaniuc : taskmgr: HGDIOBJ is interchangeable with other handle types; no casts are needed.

Alexandre Julliard julliard at winehq.org
Mon Oct 27 08:03:14 CDT 2008


Module: wine
Branch: master
Commit: 2d90c85adadc1facccace5f12e6e4efbb3d82d54
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2d90c85adadc1facccace5f12e6e4efbb3d82d54

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Sat Oct 25 23:39:55 2008 +0200

taskmgr: HGDIOBJ is interchangeable with other handle types; no casts are needed.

---

 programs/taskmgr/graphctl.c |   14 +++++++-------
 programs/taskmgr/taskmgr.c  |    2 +-
 programs/taskmgr/trayicon.c |    2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/programs/taskmgr/graphctl.c b/programs/taskmgr/graphctl.c
index 38156fe..7b5db77 100644
--- a/programs/taskmgr/graphctl.c
+++ b/programs/taskmgr/graphctl.c
@@ -210,7 +210,7 @@ void GraphCtrl_InvalidateCtrl(TGraphCtrl* this)
     {
         this->m_dcGrid = CreateCompatibleDC(dc);
         this->m_bitmapGrid = CreateCompatibleBitmap(dc, this->m_nClientWidth, this->m_nClientHeight);
-        this->m_bitmapOldGrid = (HBITMAP)SelectObject(this->m_dcGrid, this->m_bitmapGrid);
+        this->m_bitmapOldGrid = SelectObject(this->m_dcGrid, this->m_bitmapGrid);
     }
   
     SetBkColor(this->m_dcGrid, this->m_crBackColor);
@@ -234,7 +234,7 @@ void GraphCtrl_InvalidateCtrl(TGraphCtrl* this)
     this->m_nPlotWidth    = this->m_rectPlot.right - this->m_rectPlot.left;/* m_rectPlot.Width(); */
 
     /*  draw the plot rectangle */
-    oldPen = (HPEN)SelectObject(this->m_dcGrid, solidPen); 
+    oldPen = SelectObject(this->m_dcGrid, solidPen);
     MoveToEx(this->m_dcGrid, this->m_rectPlot.left, this->m_rectPlot.top, NULL);
     LineTo(this->m_dcGrid, this->m_rectPlot.right+1, this->m_rectPlot.top);
     LineTo(this->m_dcGrid, this->m_rectPlot.right+1, this->m_rectPlot.bottom+1);
@@ -286,7 +286,7 @@ void GraphCtrl_InvalidateCtrl(TGraphCtrl* this)
                             DEFAULT_PITCH|FF_SWISS, "Arial");
   
     /*  grab the horizontal font */
-    oldFont = (HFONT)SelectObject(m_dcGrid, axisFont);
+    oldFont = SelectObject(m_dcGrid, axisFont);
   
     /*  y max */
     SetTextColor(m_dcGrid, m_crGridColor);
@@ -317,7 +317,7 @@ void GraphCtrl_InvalidateCtrl(TGraphCtrl* this)
     SelectObject(m_dcGrid, oldFont);
 
     /*  y units */
-    oldFont = (HFONT)SelectObject(m_dcGrid, yUnitFont);
+    oldFont = SelectObject(m_dcGrid, yUnitFont);
     SetTextAlign(m_dcGrid, TA_CENTER|TA_BASELINE);
     TextOut(m_dcGrid, (m_rectClient.left+m_rectPlot.left)/2, 
             (m_rectPlot.bottom+m_rectPlot.top)/2, m_strYUnitsString, _tcslen(m_strYUnitsString));
@@ -331,7 +331,7 @@ void GraphCtrl_InvalidateCtrl(TGraphCtrl* this)
     {
         this->m_dcPlot = CreateCompatibleDC(dc);
         this->m_bitmapPlot = CreateCompatibleBitmap(dc, this->m_nClientWidth, this->m_nClientHeight);
-        this->m_bitmapOldPlot = (HBITMAP)SelectObject(this->m_dcPlot, this->m_bitmapPlot);
+        this->m_bitmapOldPlot = SelectObject(this->m_dcPlot, this->m_bitmapPlot);
     }
 
     /*  make sure the plot bitmap is cleared */
@@ -379,7 +379,7 @@ void GraphCtrl_Paint(TGraphCtrl* this, HWND hWnd, HDC dc)
     /*  and then BitBlt it to the client */
     memDC = CreateCompatibleDC(dc);
     memBitmap = (HBITMAP)CreateCompatibleBitmap(dc, this->m_nClientWidth, this->m_nClientHeight);
-    oldBitmap = (HBITMAP)SelectObject(memDC, memBitmap);
+    oldBitmap = SelectObject(memDC, memBitmap);
 
     if (memDC != NULL) 
     {
@@ -434,7 +434,7 @@ void GraphCtrl_DrawPoint(TGraphCtrl* this)
         for (i = 0; i < MAX_PLOTS; i++) 
         {
             /*  grab the plotting pen */
-            oldPen = (HPEN)SelectObject(this->m_dcPlot, this->m_penPlot[i]);
+            oldPen = SelectObject(this->m_dcPlot, this->m_penPlot[i]);
 
             /*  move to the previous point */
             prevX = this->m_rectPlot.right-this->m_nPlotShiftPixels;
diff --git a/programs/taskmgr/taskmgr.c b/programs/taskmgr/taskmgr.c
index 70f3bfc..d2f88ec 100644
--- a/programs/taskmgr/taskmgr.c
+++ b/programs/taskmgr/taskmgr.c
@@ -97,7 +97,7 @@ void Font_DrawText(HDC hDC, LPWSTR lpwszText, int x, int y)
 
     hFontDC = CreateCompatibleDC(hDC);
     hFontBitmap = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_FONT));
-    hOldBitmap = (HBITMAP)SelectObject(hFontDC, hFontBitmap);
+    hOldBitmap = SelectObject(hFontDC, hFontBitmap);
 
     for (i = 0; lpwszText[i]; i++) {
         if ((lpwszText[i] >= '0') && (lpwszText[i] <= '9')) {
diff --git a/programs/taskmgr/trayicon.c b/programs/taskmgr/trayicon.c
index 25a5121..90705ec 100644
--- a/programs/taskmgr/trayicon.c
+++ b/programs/taskmgr/trayicon.c
@@ -78,7 +78,7 @@ HICON TrayIcon_GetProcessorUsageIcon(void)
      * Select the bitmap into our device context
      * so we can draw on it.
      */
-    hOldBitmap = (HBITMAP) SelectObject(hDC, hBitmap);
+    hOldBitmap = SelectObject(hDC, hBitmap);
 
     /*
      * Get the cpu usage




More information about the wine-cvs mailing list