diff options
author | Casimir666 <casimir666@users.sourceforge.net> | 2009-04-18 21:39:19 +0400 |
---|---|---|
committer | Casimir666 <casimir666@users.sourceforge.net> | 2009-04-18 21:39:19 +0400 |
commit | 530c6354edabdd19d45d883fee88793664170adf (patch) | |
tree | d1fcf2a4b371465f0c20201a52f33db6367688e7 /src/filters/BaseClasses | |
parent | f39d30c0b2eba6db09f1d3f66be6fd1eb2d7f5a5 (diff) |
Changed : merge with Beliyaal branch
Added : support for madVR (new Video Renderer)
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1048 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/BaseClasses')
-rw-r--r-- | src/filters/BaseClasses/baseclasses.vcproj | 3 | ||||
-rw-r--r-- | src/filters/BaseClasses/cprop.cpp | 7 | ||||
-rw-r--r-- | src/filters/BaseClasses/streams.h | 23 | ||||
-rw-r--r-- | src/filters/BaseClasses/winutil.cpp | 8 | ||||
-rw-r--r-- | src/filters/BaseClasses/wxutil.h | 6 |
5 files changed, 41 insertions, 6 deletions
diff --git a/src/filters/BaseClasses/baseclasses.vcproj b/src/filters/BaseClasses/baseclasses.vcproj index 50eeb3f58..dfae4ec21 100644 --- a/src/filters/BaseClasses/baseclasses.vcproj +++ b/src/filters/BaseClasses/baseclasses.vcproj @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="9,00"
+ Version="9.00"
Name="BaseClasses"
ProjectGUID="{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}"
RootNamespace="BaseClasses"
@@ -44,6 +44,7 @@ />
<Tool
Name="VCCLCompilerTool"
+ AdditionalOptions="/MP"
Optimization="0"
AdditionalIncludeDirectories="."
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
diff --git a/src/filters/BaseClasses/cprop.cpp b/src/filters/BaseClasses/cprop.cpp index c4705b80d..7bd76b4e3 100644 --- a/src/filters/BaseClasses/cprop.cpp +++ b/src/filters/BaseClasses/cprop.cpp @@ -136,7 +136,7 @@ INT_PTR CALLBACK CBasePropertyPage::DialogProc(HWND hwnd, case WM_INITDIALOG:
- SetWindowLongPtr(hwnd, DWLP_USER, lParam);
+ _SetWindowLongPtr(hwnd, DWLP_USER, lParam);
// This pointer may be NULL when calculating size
@@ -149,7 +149,7 @@ INT_PTR CALLBACK CBasePropertyPage::DialogProc(HWND hwnd, // This pointer may be NULL when calculating size
- pPropertyPage = (CBasePropertyPage *) GetWindowLongPtr(hwnd, DWLP_USER);
+ pPropertyPage = _GetWindowLongPtr<CBasePropertyPage*>(hwnd, DWLP_USER);
if (pPropertyPage == NULL) {
return (LRESULT) 1;
}
@@ -363,7 +363,8 @@ INT_PTR CBasePropertyPage::OnReceiveMessage(HWND hwnd,UINT uMsg,WPARAM wParam,LP CBasePropertyPage *pPropertyPage;
{
- pPropertyPage = (CBasePropertyPage *) GetWindowLongPtr(hwnd, DWLP_USER);
+ pPropertyPage = _GetWindowLongPtr<CBasePropertyPage*>(hwnd, DWLP_USER);
+
if (pPropertyPage->m_hwnd == NULL) {
return 0;
}
diff --git a/src/filters/BaseClasses/streams.h b/src/filters/BaseClasses/streams.h index e224980cb..1926321df 100644 --- a/src/filters/BaseClasses/streams.h +++ b/src/filters/BaseClasses/streams.h @@ -123,6 +123,27 @@ typedef struct { #ifndef DWLP_USER
#define DWLP_USER DWLP_DLGPROC + sizeof(DLGPROC)
#endif
+
+
+#pragma warning(push)
+#pragma warning(disable: 4312 4244)
+// _GetWindowLongPtr
+// Templated version of GetWindowLongPtr, to suppress spurious compiler warning.
+template <class T>
+T _GetWindowLongPtr(HWND hwnd, int nIndex)
+{
+ return (T)GetWindowLongPtr(hwnd, nIndex);
+}
+
+// _SetWindowLongPtr
+// Templated version of SetWindowLongPtr, to suppress spurious compiler warning.
+template <class T>
+LONG_PTR _SetWindowLongPtr(HWND hwnd, int nIndex, T p)
+{
+ return SetWindowLongPtr(hwnd, nIndex, (LONG_PTR)p);
+}
+#pragma warning(pop)
+
///////////////////////////////////////////////////////////////////////////
// End Platform SDK definitions
///////////////////////////////////////////////////////////////////////////
@@ -171,6 +192,8 @@ typedef struct { #include <edevdefs.h> // External device control interface defines
#include <audevcod.h> // audio filter device error event codes
+
+
#else
#ifdef DEBUG
#pragma message("STREAMS.H included TWICE")
diff --git a/src/filters/BaseClasses/winutil.cpp b/src/filters/BaseClasses/winutil.cpp index c222b8262..6653f4570 100644 --- a/src/filters/BaseClasses/winutil.cpp +++ b/src/filters/BaseClasses/winutil.cpp @@ -425,7 +425,8 @@ LRESULT CALLBACK WndProc(HWND hwnd, // Window handle // structure. IF we get any messages before WM_NCCREATE we will
// pass them to DefWindowProc.
- CBaseWindow *pBaseWindow = (CBaseWindow *)GetWindowLongPtr(hwnd,0);
+ CBaseWindow *pBaseWindow = _GetWindowLongPtr<CBaseWindow*>(hwnd,0);
+
if (pBaseWindow == NULL) {
// Get the structure pointer from the create struct.
@@ -451,7 +452,10 @@ LRESULT CALLBACK WndProc(HWND hwnd, // Window handle #ifdef DEBUG
SetLastError(0); // because of the way SetWindowLong works
#endif
- LONG_PTR rc = SetWindowLongPtr(hwnd, (DWORD) 0, (LONG_PTR) pBaseWindow);
+
+ LONG_PTR rc = _SetWindowLongPtr(hwnd, (DWORD) 0, pBaseWindow);
+
+
#ifdef DEBUG
if (0 == rc) {
// SetWindowLong MIGHT have failed. (Read the docs which admit
diff --git a/src/filters/BaseClasses/wxutil.h b/src/filters/BaseClasses/wxutil.h index 0f171394e..305974a5f 100644 --- a/src/filters/BaseClasses/wxutil.h +++ b/src/filters/BaseClasses/wxutil.h @@ -196,7 +196,13 @@ public: // accessor thread calls this when done with thread (having told thread
// to exit)
void Close() {
+
+ // Disable warning: Conversion from LONG to PVOID of greater size
+#pragma warning(push)
+#pragma warning(disable: 4312)
HANDLE hThread = (HANDLE)InterlockedExchangePointer(&m_hThread, 0);
+#pragma warning(pop)
+
if (hThread) {
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
|