Author: weiden
Date: Sun Jan 21 21:49:10 2007
New Revision: 25563
URL:
http://svn.reactos.org/svn/reactos?rev=25563&view=rev
Log:
Convert NdisQueryPacket to an inline function (The DDK also defines it as an inline
function). Should fix some warnings with GCC4.2
Modified:
trunk/reactos/drivers/network/dd/ne2000/include/ne2000.h
trunk/reactos/include/ddk/ndis.h
Modified: trunk/reactos/drivers/network/dd/ne2000/include/ne2000.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/dd/ne2000/…
==============================================================================
--- trunk/reactos/drivers/network/dd/ne2000/include/ne2000.h (original)
+++ trunk/reactos/drivers/network/dd/ne2000/include/ne2000.h Sun Jan 21 21:49:10 2007
@@ -155,7 +155,7 @@
UINT TXFree; /* Number of free transmit buffers */
UINT TXNext; /* Next buffer to use */
/* Length of packet. 0 means buffer is unused */
- INT TXSize[DRIVER_DEFAULT_TX_BUFFER_COUNT];
+ UINT TXSize[DRIVER_DEFAULT_TX_BUFFER_COUNT];
INT TXCurrent; /* Current buffer beeing transmitted. -1 means none */
/* Head of transmit queue */
Modified: trunk/reactos/include/ddk/ndis.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ndis.h?rev=255…
==============================================================================
--- trunk/reactos/include/ddk/ndis.h (original)
+++ trunk/reactos/include/ddk/ndis.h Sun Jan 21 21:49:10 2007
@@ -2022,48 +2022,52 @@
* OUT PNDIS_BUFFER *FirstBuffer OPTIONAL,
* OUT PUINT TotalPacketLength OPTIONAL);
*/
-#define NdisQueryPacket(Packet, \
- PhysicalBufferCount, \
- BufferCount, \
- FirstBuffer, \
- TotalPacketLength) \
-{ \
- if (FirstBuffer) \
- *((PNDIS_BUFFER*)FirstBuffer) = (Packet)->Private.Head; \
- if ((TotalPacketLength) || (BufferCount) || (PhysicalBufferCount)) \
- { \
- if (!(Packet)->Private.ValidCounts) { \
- UINT _Offset; \
- UINT _PacketLength; \
- PNDIS_BUFFER _NdisBuffer; \
- UINT _PhysicalBufferCount = 0; \
- UINT _TotalPacketLength = 0; \
- UINT _Count = 0; \
- \
- for (_NdisBuffer = (Packet)->Private.Head; \
- _NdisBuffer != (PNDIS_BUFFER)NULL; \
- _NdisBuffer = _NdisBuffer->Next) \
- { \
- _PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(_NdisBuffer); \
- NdisQueryBufferOffset(_NdisBuffer, &_Offset, &_PacketLength); \
- _TotalPacketLength += _PacketLength; \
- _Count++; \
- } \
- (Packet)->Private.PhysicalCount = _PhysicalBufferCount; \
- (Packet)->Private.TotalLength = _TotalPacketLength; \
- (Packet)->Private.Count = _Count; \
- (Packet)->Private.ValidCounts = TRUE; \
- } \
- \
- if (PhysicalBufferCount) \
- *((PUINT)PhysicalBufferCount) = (Packet)->Private.PhysicalCount; \
- \
- if (BufferCount) \
- *((PUINT)BufferCount) = (Packet)->Private.Count; \
- \
- if (TotalPacketLength) \
- *((PUINT)TotalPacketLength) = (Packet)->Private.TotalLength; \
- } \
+static __inline
+VOID
+NdisQueryPacket(
+ IN PNDIS_PACKET Packet,
+ OUT PUINT PhysicalBufferCount OPTIONAL,
+ OUT PUINT BufferCount OPTIONAL,
+ OUT PNDIS_BUFFER *FirstBuffer OPTIONAL,
+ OUT PUINT TotalPacketLength OPTIONAL)
+{
+ if (FirstBuffer)
+ *((PNDIS_BUFFER*)FirstBuffer) = Packet->Private.Head;
+ if (TotalPacketLength || BufferCount || PhysicalBufferCount)
+ {
+ if (!Packet->Private.ValidCounts)
+ {
+ UINT Offset;
+ UINT PacketLength;
+ PNDIS_BUFFER NdisBuffer;
+ UINT PhysicalBufferCount = 0;
+ UINT TotalPacketLength = 0;
+ UINT Count = 0;
+
+ for (NdisBuffer = Packet->Private.Head;
+ NdisBuffer != (PNDIS_BUFFER)NULL;
+ NdisBuffer = NdisBuffer->Next)
+ {
+ PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(NdisBuffer);
+ NdisQueryBufferOffset(NdisBuffer, &Offset, &PacketLength);
+ TotalPacketLength += PacketLength;
+ Count++;
+ }
+ Packet->Private.PhysicalCount = PhysicalBufferCount;
+ Packet->Private.TotalLength = TotalPacketLength;
+ Packet->Private.Count = Count;
+ Packet->Private.ValidCounts = TRUE;
+ }
+
+ if (PhysicalBufferCount)
+ *((PUINT)PhysicalBufferCount) = Packet->Private.PhysicalCount;
+
+ if (BufferCount)
+ *((PUINT)BufferCount) = Packet->Private.Count;
+
+ if (TotalPacketLength)
+ *((PUINT)TotalPacketLength) = Packet->Private.TotalLength;
+ }
}
/*