mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Move variable declarations at the start of functions
svn path=/trunk/; revision=14494
This commit is contained in:
parent
f4a430511e
commit
04bbda156c
2 changed files with 3 additions and 2 deletions
|
@ -47,9 +47,10 @@ PushCircularBufferEntry(
|
||||||
IN PCIRCULAR_BUFFER pBuffer,
|
IN PCIRCULAR_BUFFER pBuffer,
|
||||||
IN UCHAR Entry)
|
IN UCHAR Entry)
|
||||||
{
|
{
|
||||||
|
ULONG NextPosition;
|
||||||
DPRINT("Serial: PushCircularBufferEntry(pBuffer %p, Entry 0x%x)\n", pBuffer, Entry);
|
DPRINT("Serial: PushCircularBufferEntry(pBuffer %p, Entry 0x%x)\n", pBuffer, Entry);
|
||||||
ASSERT(pBuffer->Length);
|
ASSERT(pBuffer->Length);
|
||||||
ULONG NextPosition = (pBuffer->WritePosition + 1) % pBuffer->Length;
|
NextPosition = (pBuffer->WritePosition + 1) % pBuffer->Length;
|
||||||
if (NextPosition == pBuffer->ReadPosition)
|
if (NextPosition == pBuffer->ReadPosition)
|
||||||
return STATUS_BUFFER_TOO_SMALL;
|
return STATUS_BUFFER_TOO_SMALL;
|
||||||
pBuffer->Buffer[pBuffer->WritePosition] = Entry;
|
pBuffer->Buffer[pBuffer->WritePosition] = Entry;
|
||||||
|
|
|
@ -26,6 +26,7 @@ DriverEntry(
|
||||||
IN PUNICODE_STRING RegPath)
|
IN PUNICODE_STRING RegPath)
|
||||||
{
|
{
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
static BOOLEAN FirstTime = TRUE;
|
||||||
|
|
||||||
DriverObject->DriverUnload = DriverUnload;
|
DriverObject->DriverUnload = DriverUnload;
|
||||||
DriverObject->DriverExtension->AddDevice = SerialAddDevice;
|
DriverObject->DriverExtension->AddDevice = SerialAddDevice;
|
||||||
|
@ -44,7 +45,6 @@ DriverEntry(
|
||||||
|
|
||||||
/* FIXME: It seems that DriverEntry function may be called more
|
/* FIXME: It seems that DriverEntry function may be called more
|
||||||
* than once. Do only legacy detection the first time. */
|
* than once. Do only legacy detection the first time. */
|
||||||
static BOOLEAN FirstTime = TRUE;
|
|
||||||
if (FirstTime)
|
if (FirstTime)
|
||||||
{
|
{
|
||||||
FirstTime = FALSE;
|
FirstTime = FALSE;
|
||||||
|
|
Loading…
Reference in a new issue