From 04bbda156c4987c200bf01ef48d1c2c601d29c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Mon, 4 Apr 2005 23:12:21 +0000 Subject: [PATCH] Move variable declarations at the start of functions svn path=/trunk/; revision=14494 --- reactos/drivers/dd/serial/circularbuffer.c | 3 ++- reactos/drivers/dd/serial/serial.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/dd/serial/circularbuffer.c b/reactos/drivers/dd/serial/circularbuffer.c index 0b533b8db01..0c908f3bd07 100644 --- a/reactos/drivers/dd/serial/circularbuffer.c +++ b/reactos/drivers/dd/serial/circularbuffer.c @@ -47,9 +47,10 @@ PushCircularBufferEntry( 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; diff --git a/reactos/drivers/dd/serial/serial.c b/reactos/drivers/dd/serial/serial.c index 6fc66e56b2f..7d66d153ca9 100644 --- a/reactos/drivers/dd/serial/serial.c +++ b/reactos/drivers/dd/serial/serial.c @@ -26,6 +26,7 @@ DriverEntry( IN PUNICODE_STRING RegPath) { ULONG i; + static BOOLEAN FirstTime = TRUE; DriverObject->DriverUnload = DriverUnload; DriverObject->DriverExtension->AddDevice = SerialAddDevice; @@ -44,7 +45,6 @@ DriverEntry( /* 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;