[ros-diffs] [tkreuzer] 47496: [CMIDRIVER] - Fix a number of warnings, no actual code change - Patch by Love Nystrom, improvements by me See issue #5336 for more details.

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Mon May 31 16:58:44 CEST 2010


Author: tkreuzer
Date: Mon May 31 16:58:43 2010
New Revision: 47496

URL: http://svn.reactos.org/svn/reactos?rev=47496&view=rev
Log:
[CMIDRIVER]
- Fix a number of warnings, no actual code change
- Patch by Love Nystrom, improvements by me

See issue #5336 for more details.

Modified:
    trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/adapter.cpp
    trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/common.cpp
    trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/mintopo.cpp
    trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/mintopotables.hpp
    trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/minwave.cpp
    trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/minwavetables.hpp

Modified: trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/adapter.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/adapter.cpp?rev=47496&r1=47495&r2=47496&view=diff
==============================================================================
--- trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/adapter.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/adapter.cpp [iso-8859-1] Mon May 31 16:58:43 2010
@@ -29,7 +29,9 @@
 #include <initguid.h>
 #include "adapter.hpp"
 
-//#pragma code_seg("PAGE")
+#ifdef _MSC_VER
+//#pragma code_seg("PAGE") // GCC ignores pragma code_seg
+#endif
 
 const GUID KSNODETYPE_DAC = {0x507AE360L, 0xC554, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}};
 const GUID KSNODETYPE_ADC = {0x4D837FE0L, 0xC555, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}};
@@ -267,7 +269,9 @@
 	PUNKNOWN unknownTopology = NULL;
 
 	// install the topology miniport.
-	ntStatus = InstallSubdevice(DeviceObject, Irp, L"Topology", CLSID_PortTopology, CLSID_PortTopology, CreateMiniportTopologyCMI, pCMIAdapter, NULL, GUID_NULL, &unknownTopology);
+	ntStatus = InstallSubdevice( DeviceObject, Irp, (PWCHAR) L"Topology",
+		CLSID_PortTopology, CLSID_PortTopology, CreateMiniportTopologyCMI,
+		pCMIAdapter, NULL, GUID_NULL, &unknownTopology );
 	if (!NT_SUCCESS (ntStatus)) {
 		DBGPRINT(("Topology miniport installation failed"));
 		return ntStatus;
@@ -277,7 +281,7 @@
 	// install the UART miniport - execution order important
 	ntStatus = STATUS_UNSUCCESSFUL;
 	MPUBase = 0;
-	for (int i=0;i<ResourceList->NumberOfPorts();i++) {
+	for ( UINT i=0; i < ResourceList->NumberOfPorts(); i++ ) {
 		if (ResourceList->FindTranslatedPort(i)->u.Port.Length == 2) {
 			MPUBase = (UInt32*)ResourceList->FindTranslatedPort(i)->u.Port.Start.QuadPart;
 		}
@@ -285,7 +289,10 @@
 	if (MPUBase != 0) {
 		ntStatus = pCMIAdapter->activateMPU(MPUBase);
 		if (NT_SUCCESS(ntStatus)) {
-			ntStatus = InstallSubdevice(DeviceObject, Irp, L"Uart", CLSID_PortDMus, CLSID_MiniportDriverDMusUART, NULL, pCMIAdapter->getInterruptSync(), UartResourceList, IID_IPortDMus, NULL);
+			ntStatus = InstallSubdevice( DeviceObject, Irp, (PWCHAR) L"Uart",
+				CLSID_PortDMus, CLSID_MiniportDriverDMusUART, NULL,
+				pCMIAdapter->getInterruptSync(), UartResourceList,
+				IID_IPortDMus, NULL );
 		}
 	}
 	if (!NT_SUCCESS(ntStatus)) {
@@ -300,9 +307,13 @@
 
 	// install the wave miniport - the order matters here
 #ifdef WAVERT
-	ntStatus = InstallSubdevice(DeviceObject, Irp, L"Wave", CLSID_PortWaveRT, CLSID_PortWaveRT, CreateMiniportWaveCMI, pCMIAdapter, ResourceList, IID_IPortWaveRT, &unknownWave);
+	ntStatus = InstallSubdevice(DeviceObject, Irp, (PWCHAR) L"Wave",
+		CLSID_PortWaveRT, CLSID_PortWaveRT, CreateMiniportWaveCMI,
+		pCMIAdapter, ResourceList, IID_IPortWaveRT, &unknownWave );
 #else
-	ntStatus = InstallSubdevice(DeviceObject, Irp, L"Wave", CLSID_PortWaveCyclic, CLSID_PortWaveCyclic, CreateMiniportWaveCMI, pCMIAdapter, ResourceList, IID_IPortWaveCyclic, &unknownWave);
+	ntStatus = InstallSubdevice(DeviceObject, Irp, (PWCHAR) L"Wave",
+		CLSID_PortWaveCyclic, CLSID_PortWaveCyclic, CreateMiniportWaveCMI,
+		pCMIAdapter, ResourceList, IID_IPortWaveCyclic, &unknownWave );
 #endif
 	if (!NT_SUCCESS(ntStatus)) {
 		DBGPRINT(("Wave miniport installation failed"));
@@ -449,8 +460,10 @@
 		resourceList->List[0].Count    = 0;
 
 		// copy the resources which have already been assigned
-		for (int i=0;i<list->List[0].Count;i++) {
-			if (CopyResourceDescriptor(&list->List[0].Descriptors[i], &resourceList->List[0].Descriptors[resourceList->List[0].Count])) {
+		for ( UINT i=0; i < list->List[0].Count; i++ ) {
+			if (CopyResourceDescriptor( &list->List[0].Descriptors[i],
+				&resourceList->List[0].Descriptors[resourceList->List[0].Count] ))
+			{
 				resourceList->List[0].Count++;
 			}
 		}

Modified: trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/common.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/common.cpp?rev=47496&r1=47495&r2=47496&view=diff
==============================================================================
--- trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/common.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/common.cpp [iso-8859-1] Mon May 31 16:58:43 2010
@@ -27,7 +27,9 @@
 
 #include "common.hpp"
 
-#pragma code_seg("PAGE")
+#ifdef _MSC_VER
+#pragma code_seg("PAGE") /* warning - ignored by GCC compiler */
+#endif
 
 NTSTATUS
 NewCMIAdapter(
@@ -63,7 +65,7 @@
 	DeviceObject = aDeviceObject;
 
 	cm.IOBase = 0;
-	for (int i=0;i<ResourceList->NumberOfPorts();i++) {
+	for ( UINT i=0; i < ResourceList->NumberOfPorts(); i++ ) {
 		if (ResourceList->FindTranslatedPort(i)->u.Port.Length == 0x100) {
 			cm.IOBase = (UInt32*)ResourceList->FindTranslatedPort(i)->u.Port.Start.QuadPart;
 		}
@@ -357,7 +359,7 @@
 	//PAGED_CODE();
 	DBGPRINT(("CCMIAdapter[%p]::loadSBMixerFromMemory()", this));
 #endif
-	for (int i = 0; i<(sizeof(sbIndex)/sizeof(sbIndex[0]));i++) {
+	for ( UINT i = 0; i < (sizeof(sbIndex)/sizeof(sbIndex[0])); i++ ) {
 		writeUInt8(REG_SBINDEX, sbIndex[i]);
 		writeUInt8(REG_SBDATA, mixerCache[i]);
 	}
@@ -368,7 +370,9 @@
 /*
 ** non-paged code below
 */
-#pragma code_seg()
+#ifdef _MSC_VER
+#pragma code_seg() /* warning - ignored by GCC compiler */
+#endif
 
 STDMETHODIMP_(UInt8) CCMIAdapter::readUInt8(UInt8 reg)
 {

Modified: trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/mintopo.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/mintopo.cpp?rev=47496&r1=47495&r2=47496&view=diff
==============================================================================
--- trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/mintopo.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/mintopo.cpp [iso-8859-1] Mon May 31 16:58:43 2010
@@ -31,7 +31,9 @@
 #define NTSTRSAFE_LIB //for Windows 2000 compatibility
 #include "ntstrsafe.h"
 
-#pragma code_seg("PAGE")
+#ifdef _MSC_VER
+#pragma code_seg("PAGE") /* warning - ignored by GCC compiler */
+#endif
 
 const GUID KSPROPSETID_CMI = {0x2B81CDBB, 0xEE6C, 0x4ECC, {0x8A, 0xA5, 0x9A, 0x18, 0x8B, 0x02, 0x3D, 0xFF}};
 
@@ -173,7 +175,7 @@
 	PropertyRequest.ValueSize    = sizeof(DWORD);
 	PropertyRequest.PropertyItem = &PropertyItem;
 
-	for (int i=0;i < SIZEOF_ARRAY(TopologyNodes); i++) {
+	for ( UINT i=0; i < SIZEOF_ARRAY(TopologyNodes); i++ ) {
 		PropertyRequest.Node = i;
 
 		Channel = CHAN_LEFT;
@@ -310,7 +312,7 @@
 	PropertyRequest.ValueSize    = sizeof(DWORD);
 	PropertyRequest.PropertyItem = &PropertyItem;
 
-	for (int i=0;i < SIZEOF_ARRAY(TopologyNodes); i++) {
+	for ( UINT i=0; i < SIZEOF_ARRAY(TopologyNodes); i++ ) {
 		PropertyRequest.Node = i;
 		if (IsEqualGUIDAligned(*(TopologyNodes[i].Type), KSNODETYPE_VOLUME)) {
 			PropertyRequest.Node = i;
@@ -473,7 +475,8 @@
 	CCMITopology *that = (CCMITopology *) ((PMINIPORTTOPOLOGY) PropertyRequest->MajorTarget);
 
 	NTSTATUS  ntStatus = STATUS_INVALID_PARAMETER;
-	UInt8     data, mask, reg;
+	//UInt8     data, mask, reg;
+	UInt8     mask, reg;
 	LONG      channel;
 
 	if (PropertyRequest->Node == ULONG(-1)) {
@@ -1042,7 +1045,7 @@
 
 			PKSPROPERTY_STEPPING_LONG Range = PKSPROPERTY_STEPPING_LONG(Members + 1);
 
-			for (int i=0;i<SIZEOF_ARRAY(VolTable);i++) {
+			for ( UINT i=0; i < SIZEOF_ARRAY(VolTable); i++ ) {
 				if (VolTable[i].node == PropertyRequest->Node) {
 					Range->Bounds.SignedMaximum = (VolTable[i].max << 16);
 					Range->Bounds.SignedMinimum = (VolTable[i].min << 16);
@@ -1110,7 +1113,7 @@
 
 			PLONG Level = (PLONG)PropertyRequest->Value;
 
-			for (int i=0;i<SIZEOF_ARRAY(VolTable);i++)
+			for ( UINT i=0; i <SIZEOF_ARRAY(VolTable); i++ )
 			{
 				if (VolTable[i].node == PropertyRequest->Node) {
 					if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET) {

Modified: trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/mintopotables.hpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/mintopotables.hpp?rev=47496&r1=47495&r2=47496&view=diff
==============================================================================
--- trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/mintopotables.hpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/mintopotables.hpp [iso-8859-1] Mon May 31 16:58:43 2010
@@ -35,7 +35,8 @@
 #define STATIC_KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF\
     DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_DOLBY_AC3_SPDIF)
 DEFINE_GUIDSTRUCT("00000092-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF);
-#define KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF)
+#define KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF  DEFINE_GUIDNAMED( KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF )
+/* Warning - Recursive #define for KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF */
 #endif
 #endif
 
@@ -47,15 +48,17 @@
 
 static KSDATARANGE PinDataRangesBridge[] =
 {
-   {
-      sizeof(KSDATARANGE),
-      0,
-      0,
-      0,
-      STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
-      STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG),
-      STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
-   }
+    {
+        {
+            sizeof(KSDATARANGE),
+            0,
+            0,
+            0,
+            { STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO) },
+            { STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG) },
+            { STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE) }
+        }
+    }
 };
 
 static PKSDATARANGE PinDataRangePointersBridge[] =
@@ -65,14 +68,16 @@
 
 static KSDATARANGE WavePinDataRangesAC3Bridge[] =
 {
-	{
-        sizeof(KSDATARANGE),
-        0,
-        0,
-        0,
-        STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
-        STATICGUIDOF(KSDATAFORMAT_SUBTYPE_AC3_AUDIO),
-        STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
+    {
+        {
+            sizeof(KSDATARANGE),
+            0,
+            0,
+            0,
+            { STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO) },
+            { STATICGUIDOF(KSDATAFORMAT_SUBTYPE_AC3_AUDIO) },
+            { STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE) }
+        }
     }
 };
 
@@ -98,7 +103,7 @@
             KSPIN_COMMUNICATION_NONE,                   // Communication
             &KSCATEGORY_AUDIO,                          // Category
             NULL,                                       // Name
-            0                                           // Reserved
+            { 0 }                                       // Reserved
         }
     },
 
@@ -117,7 +122,7 @@
             KSPIN_COMMUNICATION_NONE,                   // Communication
             &KSNODETYPE_SPDIF_INTERFACE,                // Category
             NULL,                                       // Name
-            0                                           // Reserved
+            { 0 }                                       // Reserved
         }
     },
 
@@ -136,7 +141,7 @@
 			KSPIN_COMMUNICATION_NONE,					// Communication
 			&KSNODETYPE_MICROPHONE,						// Category
 			NULL,										// Name
-			0											// Reserved
+            { 0 }                                       // Reserved
 		}
 	},
 
@@ -155,7 +160,7 @@
 			KSPIN_COMMUNICATION_NONE,					// Communication
 			&KSNODETYPE_CD_PLAYER,						// Category
 			NULL,										// Name
-			0											// Reserved
+            { 0 }                                       // Reserved
 		}
 	},
 
@@ -174,7 +179,7 @@
 			KSPIN_COMMUNICATION_NONE,					// Communication
 			&KSNODETYPE_LINE_CONNECTOR,					// Category
 			NULL,										// Name
-			0											// Reserved
+            { 0 }                                       // Reserved
 		}
 	},
 
@@ -193,7 +198,7 @@
 			KSPIN_COMMUNICATION_NONE,					// Communication
 			&KSNODETYPE_ANALOG_CONNECTOR,				// Category
 			NULL,										// Name
-			0											// Reserved
+            { 0 }                                       // Reserved
 		}
 	},
 
@@ -212,7 +217,7 @@
 			KSPIN_COMMUNICATION_NONE,					// Communication
 			&KSNODETYPE_ANALOG_CONNECTOR,				// Category
 			&CMINAME_DAC,								// Name
-			0											// Reserved
+            { 0 }                                       // Reserved
 		}
 	},
 
@@ -231,7 +236,7 @@
             KSPIN_COMMUNICATION_NONE,                   // Communication
             &KSNODETYPE_SPEAKER,                        // Category
             NULL,                                       // Name
-            0                                           // Reserved
+            { 0 }                                       // Reserved
         }
     },
 
@@ -250,7 +255,7 @@
             KSPIN_COMMUNICATION_NONE,                   // Communication
             &KSCATEGORY_AUDIO,                          // Category
             NULL,                                       // Name
-            0                                           // Reserved
+            { 0 }                                       // Reserved
         }
     },
 
@@ -269,7 +274,7 @@
             KSPIN_COMMUNICATION_NONE,                   // Communication
             &KSCATEGORY_AUDIO,                          // Category
             NULL,                                       // Name
-            0                                           // Reserved
+            { 0 }                                       // Reserved
         }
     },
 
@@ -288,7 +293,7 @@
             KSPIN_COMMUNICATION_NONE,                   // Communication
             NULL,                                       // Category
             NULL,                                       // Name
-            0                                           // Reserved
+            { 0 }                                       // Reserved
         }
     }
 };

Modified: trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/minwave.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/minwave.cpp?rev=47496&r1=47495&r2=47496&view=diff
==============================================================================
--- trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/minwave.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/minwave.cpp [iso-8859-1] Mon May 31 16:58:43 2010
@@ -29,7 +29,9 @@
 #include "minwavetables.hpp"
 #include "ntddk.h"
 
-#pragma code_seg("PAGE")
+#ifdef _MSC_VER
+#pragma code_seg("PAGE") /* warning - ignored by GCC compiler */
+#endif
 
 HRESULT NTAPI CreateMiniportWaveCMI(PUNKNOWN *Unknown, REFCLSID, PUNKNOWN UnknownOuter, POOL_TYPE PoolType)
 {
@@ -233,7 +235,8 @@
 	PREGISTRYKEY       DriverKey;
 	PREGISTRYKEY       SettingsKey;
     UNICODE_STRING     KeyName;
-    DWORD              Value, ResultLength;
+    //DWORD              Value, ResultLength;
+    DWORD              ResultLength;
 	PVOID              KeyInfo;
 
     DBGPRINT(("CMiniportWaveCMI::loadChannelConfigFromRegistry()"));
@@ -418,12 +421,12 @@
 	DBGPRINT(("---channels: %d, resolution: %d, sample rate: %d, pin: %d, formatMask: %x", waveFormat->nChannels, waveFormat->wBitsPerSample, waveFormat->nSamplesPerSec, PinID, cm->formatMask));
 
 //WaveFormatEx
-	if  ( ( format->FormatSize >= sizeof(KSDATAFORMAT_WAVEFORMATEX))
+	if  ( ( (size_t) format->FormatSize >= sizeof(KSDATAFORMAT_WAVEFORMATEX))
 	  && IsEqualGUIDAligned(format->MajorFormat,KSDATAFORMAT_TYPE_AUDIO)
 	  && IsEqualGUIDAligned(format->Specifier,KSDATAFORMAT_SPECIFIER_WAVEFORMATEX) ) {
 		switch (EXTRACT_WAVEFORMATEX_ID(&format->SubFormat)) {
 			case WAVE_FORMAT_PCM:
-				if ((PinID != PIN_WAVE_RENDER_SINK) && (PinID != PIN_WAVE_CAPTURE_SOURCE) && (PinID != -1)) {
+				if ((PinID != PIN_WAVE_RENDER_SINK) && (PinID != PIN_WAVE_CAPTURE_SOURCE) && ((int)PinID != -1)) {
 					if ((PinID == PIN_WAVE_AC3_RENDER_SINK) && !IoIsWdmVersionAvailable(6,0)) {
 						return STATUS_INVALID_PARAMETER;
 					}
@@ -438,10 +441,10 @@
 					return isFormatAllowed(waveFormat->nSamplesPerSec, FALSE, FALSE);
 				}
 				if ( (waveFormat->wBitsPerSample == 16)
-				  && ((waveFormat->nChannels >= 4) && (waveFormat->nChannels <= cm->maxChannels))
+				  && ((waveFormat->nChannels >= 4) && (waveFormat->nChannels <= (WORD) cm->maxChannels))
 				  && ((waveFormat->nSamplesPerSec == 44100) || (waveFormat->nSamplesPerSec == 48000)) ) {
 #if OUT_CHANNEL == 1
-					if ((PinID == PIN_WAVE_RENDER_SINK) || (PinID == -1)) {
+					if ((PinID == PIN_WAVE_RENDER_SINK) || ((int)PinID == -1)) {
 						return isFormatAllowed(waveFormat->nSamplesPerSec, TRUE, FALSE);
 					}
 #else
@@ -450,7 +453,7 @@
 				}
 				break;
 			case WAVE_FORMAT_DOLBY_AC3_SPDIF:
-				if ((PinID != PIN_WAVE_AC3_RENDER_SINK) && (PinID != -1)) {
+				if ((PinID != PIN_WAVE_AC3_RENDER_SINK) && ((int)PinID != -1)) {
 					return STATUS_INVALID_PARAMETER;
 				}
 				if ( ((waveFormat->wBitsPerSample >= MIN_BITS_PER_SAMPLE_AC3) && (waveFormat->wBitsPerSample <= MAX_BITS_PER_SAMPLE_AC3))
@@ -907,7 +910,7 @@
 	DBGPRINT(("---streamIndex: %d, channelNumber: %d", streamIndex, channelNumber));
 
 	NTSTATUS ntStatus;
-	UInt8    reg;
+	//UInt8    reg;
 	UInt32   val;
 
 	if (state == KSSTATE_RUN) {
@@ -990,7 +993,7 @@
 	NTSTATUS ntStatus = STATUS_SUCCESS;
 
 	if (currentChannelCount > 2) {
-		if (Miniport->cm->maxChannels < currentChannelCount) {
+		if ((WORD) Miniport->cm->maxChannels < currentChannelCount ) {
 			return STATUS_INVALID_DEVICE_REQUEST;
 		}
 		if ((currentResolution != 16) || (currentChannelCount < 2)) {
@@ -1052,7 +1055,7 @@
 	//PAGED_CODE();
 	DBGPRINT(("CMiniportWaveStreamCMI[%p]::setupSPDIFPlayback(%d)", this, enableSPDIF));
 
-	NTSTATUS ntStatus;
+	//NTSTATUS ntStatus;
 
 	KeWaitForSingleObject(&Miniport->mutex, Executive, KernelMode, false, NULL);
 
@@ -1434,7 +1437,9 @@
 /*
 ** non-paged code below
 */
-#pragma code_seg()
+#ifdef _MSC_VER
+#pragma code_seg() /* warning - ignored by GCC compiler */
+#endif
 
 STDMETHODIMP CMiniportWaveStreamCMI::SetState(KSSTATE NewState)
 {
@@ -1461,7 +1466,9 @@
 
 	// STOP -> ACQUIRE -> PAUSE -> PLAY -> PAUSE -> ACQUIRE -> STOP
 	if (state != NewState) {
-		switch (NewState) {
+		switch ((UINT) NewState) {
+			// LN: The cast on NewState is to satisfy the compiler about
+			// KSSTATE_STOP_AC3, which is not in the original enum KSSTATE.
 			case KSSTATE_ACQUIRE:
 				DBGPRINT(("---KSSTATE_ACQUIRE: previous state: %d", state));
 				if (state == KSSTATE_PAUSE) {

Modified: trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/minwavetables.hpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/minwavetables.hpp?rev=47496&r1=47495&r2=47496&view=diff
==============================================================================
--- trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/minwavetables.hpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/drivers/CMIDriver/minwavetables.hpp [iso-8859-1] Mon May 31 16:58:43 2010
@@ -31,23 +31,23 @@
 #define STATIC_KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF\
     DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_DOLBY_AC3_SPDIF)
 DEFINE_GUIDSTRUCT("00000092-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF);
-#define KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF)
+#define KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF  DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF)
+/* Warning - Recursive #define for KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF */
 
 NTSTATUS NTAPI PropertyHandler_ChannelConfig(PPCPROPERTY_REQUEST PropertyRequest);
 
-
 static KSDATARANGE_AUDIO WavePinDataRangesPCMStream[] =
 {
     {
-        {
+        {{
             sizeof(KSDATARANGE_AUDIO),
             0,
             0,
             0,
-            STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
-            STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
-            STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
-        },
+            { STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO) },
+            { STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM) },
+            { STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX) }
+        }},
         MAX_CHANNELS_PCM,
         MIN_BITS_PER_SAMPLE_PCM,
         MAX_BITS_PER_SAMPLE_PCM,
@@ -59,15 +59,15 @@
 static KSDATARANGE_AUDIO WavePinDataRangesAC3Stream[] =
 {
     {
-        {
+        {{
             sizeof(KSDATARANGE_AUDIO),
             0,
             0,
             0,
-            STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
-            STATICGUIDOF(KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF),
-            STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
-        },
+            { STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO) },
+            { STATICGUIDOF(KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF) },
+            { STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX) }
+        }},
         MAX_CHANNELS_AC3,
         MIN_BITS_PER_SAMPLE_AC3,
         MAX_BITS_PER_SAMPLE_AC3,
@@ -75,15 +75,15 @@
         MAX_SAMPLE_RATE_AC3
     },
     {
-        {
+        {{
             sizeof(KSDATARANGE_AUDIO),
             0,
             0,
             0,
-            STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
-            STATICGUIDOF(KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF),
-            STATICGUIDOF(KSDATAFORMAT_SPECIFIER_DSOUND)
-        },
+            { STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO) },
+            { STATICGUIDOF(KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF) },
+            { STATICGUIDOF(KSDATAFORMAT_SPECIFIER_DSOUND) }
+        }},
         MAX_CHANNELS_AC3,
         MIN_BITS_PER_SAMPLE_AC3,
         MAX_BITS_PER_SAMPLE_AC3,
@@ -107,28 +107,28 @@
 
 static KSDATARANGE WavePinDataRangesPCMBridge[] =
 {
-    {
+    {{
         sizeof(KSDATARANGE),
         0,
         0,
         0,
-        STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
-        STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG),
-        STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
-    }
+        { STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO) },
+		{ STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG) },
+        { STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE) }
+    }}
 };
 
 static KSDATARANGE WavePinDataRangesAC3Bridge[] =
 {
-	{
+	{{
         sizeof(KSDATARANGE),
         0,
         0,
         0,
-        STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
-        STATICGUIDOF(KSDATAFORMAT_SUBTYPE_AC3_AUDIO),
-        STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
-    }
+        { STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO) },
+        { STATICGUIDOF(KSDATAFORMAT_SUBTYPE_AC3_AUDIO) },
+        { STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE) }
+    }}
 };
 
 static PKSDATARANGE WavePinDataRangePointersPCMBridge[] =
@@ -160,7 +160,7 @@
             KSPIN_COMMUNICATION_SINK,
             &KSCATEGORY_AUDIO,
             &KSAUDFNAME_RECORDING_CONTROL,
-            0
+            { 0 }
         }
     },
 
@@ -181,7 +181,7 @@
             KSPIN_COMMUNICATION_NONE,
             &KSCATEGORY_AUDIO,
             NULL,
-            0
+            { 0 }
         }
     },
 
@@ -202,7 +202,7 @@
             KSPIN_COMMUNICATION_SINK,
             &KSCATEGORY_AUDIO,
             &KSAUDFNAME_VOLUME_CONTROL,
-            0
+            { 0 }
         }
     },
 
@@ -223,7 +223,7 @@
             KSPIN_COMMUNICATION_NONE,
             &KSNODETYPE_SPEAKER,
             NULL,
-            0
+            { 0 }
         }
     },
 
@@ -244,7 +244,7 @@
             KSPIN_COMMUNICATION_SINK,
             &KSCATEGORY_AUDIO,
             NULL,
-            0
+            { 0 }
         }
     },
 
@@ -266,7 +266,7 @@
             KSPIN_COMMUNICATION_NONE,
             &KSNODETYPE_SPDIF_INTERFACE,
             NULL,
-            0
+            { 0 }
         }
     }
 };




More information about the Ros-diffs mailing list