Move variable declarations at the start of functions
Modified: trunk/reactos/drivers/dd/serial/circularbuffer.c
Modified: trunk/reactos/drivers/dd/serial/serial.c
_____
Modified: trunk/reactos/drivers/dd/serial/circularbuffer.c
--- trunk/reactos/drivers/dd/serial/circularbuffer.c 2005-04-04
23:11:19 UTC (rev 14493)
+++ trunk/reactos/drivers/dd/serial/circularbuffer.c 2005-04-04
23:12:21 UTC (rev 14494)
@@ -47,9 +47,10 @@
IN PCIRCULAR_BUFFER pBuffer,
IN UCHAR Entry)
{
+ ULONG NextPosition;
DPRINT("Serial: PushCircularBufferEntry(pBuffer %p, Entry
0x%x)\n", pBuffer, Entry);
ASSERT(pBuffer->Length);
- ULONG NextPosition = (pBuffer->WritePosition + 1) %
pBuffer->Length;
+ NextPosition = (pBuffer->WritePosition + 1) % pBuffer->Length;
if (NextPosition == pBuffer->ReadPosition)
return STATUS_BUFFER_TOO_SMALL;
pBuffer->Buffer[pBuffer->WritePosition] = Entry;
_____
Modified: trunk/reactos/drivers/dd/serial/serial.c
--- trunk/reactos/drivers/dd/serial/serial.c 2005-04-04 23:11:19 UTC
(rev 14493)
+++ trunk/reactos/drivers/dd/serial/serial.c 2005-04-04 23:12:21 UTC
(rev 14494)
@@ -26,6 +26,7 @@
IN PUNICODE_STRING RegPath)
{
ULONG i;
+ static BOOLEAN FirstTime = TRUE;
DriverObject->DriverUnload = DriverUnload;
DriverObject->DriverExtension->AddDevice = SerialAddDevice;
@@ -44,7 +45,6 @@
/* FIXME: It seems that DriverEntry function may be called more
* than once. Do only legacy detection the first time. */
- static BOOLEAN FirstTime = TRUE;
if (FirstTime)
{
FirstTime = FALSE;