[vlc-devel] commit: Cosmetics; shore up long winded code a bit in the activex plugin. ( JP Dinger )

git version control git at videolan.org
Mon May 25 19:42:27 CEST 2009


vlc | branch: master | JP Dinger <jpd at videolan.org> | Thu May 21 22:19:45 2009 +0200| [31f958462d36a3d945210106a20182df09df699e] | committer: JP Dinger 

Cosmetics; shore up long winded code a bit in the activex plugin.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=31f958462d36a3d945210106a20182df09df699e
---

 projects/activex/utils.cpp |   30 +++++++++---------------------
 1 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/projects/activex/utils.cpp b/projects/activex/utils.cpp
index b96ea8f..9c469db 100644
--- a/projects/activex/utils.cpp
+++ b/projects/activex/utils.cpp
@@ -111,37 +111,25 @@ HRESULT GetObjectProperty(LPUNKNOWN object, DISPID dispID, VARIANT& v)
 
 HDC CreateDevDC(DVTARGETDEVICE *ptd)
 {
-    HDC hdc=NULL;
+    HDC hdc;
     if( NULL == ptd )
     {
         hdc = CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);
     }
     else
     {
-        LPDEVNAMES lpDevNames;
-        LPDEVMODE lpDevMode;
-        LPTSTR lpszDriverName;
-        LPTSTR lpszDeviceName;
-        LPTSTR lpszPortName;
+        LPDEVNAMES lpDevNames = (LPDEVNAMES) ptd; // offset for size field
+        LPDEVMODE  lpDevMode  = NULL;
 
-        lpDevNames = (LPDEVNAMES) ptd; // offset for size field
-
-        if (ptd->tdExtDevmodeOffset == 0)
-        {
-            lpDevMode = NULL;
-        }
-        else
-        {
+        if (ptd->tdExtDevmodeOffset != 0)
             lpDevMode  = (LPDEVMODE) ((LPTSTR)ptd + ptd->tdExtDevmodeOffset);
-        }
-
-        lpszDriverName = (LPTSTR) lpDevNames + ptd->tdDriverNameOffset;
-        lpszDeviceName = (LPTSTR) lpDevNames + ptd->tdDeviceNameOffset;
-        lpszPortName   = (LPTSTR) lpDevNames + ptd->tdPortNameOffset;
 
-        hdc = CreateDC(lpszDriverName, lpszDeviceName, lpszPortName, lpDevMode);
+        hdc = CreateDC( (LPTSTR) lpDevNames + ptd->tdDriverNameOffset,
+                        (LPTSTR) lpDevNames + ptd->tdDeviceNameOffset,
+                        (LPTSTR) lpDevNames + ptd->tdPortNameOffset,
+                        lpDevMode );
     }
-        return hdc;
+    return hdc;
 };
 
 #define HIMETRIC_PER_INCH 2540




More information about the vlc-devel mailing list