From 217745c949a46b8aa80aba8e21797c20aa07ac2a Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Wed, 4 Feb 2009 06:04:24 +0000 Subject: [PATCH] fix formatting (again) svn path=/trunk/; revision=39377 --- reactos/drivers/filesystems/cdfs/dirctl.c | 8 +- reactos/drivers/filesystems/cdfs/fcb.c | 12 +-- reactos/drivers/filesystems/cdfs/misc.c | 106 +++++++++++----------- 3 files changed, 63 insertions(+), 63 deletions(-) diff --git a/reactos/drivers/filesystems/cdfs/dirctl.c b/reactos/drivers/filesystems/cdfs/dirctl.c index bf43c518f35..700508ef9f1 100644 --- a/reactos/drivers/filesystems/cdfs/dirctl.c +++ b/reactos/drivers/filesystems/cdfs/dirctl.c @@ -275,8 +275,8 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt, Record->RecordLength, Record->ExtAttrRecordLength, Record->FileIdLength); Status = CdfsGetEntryName - (DeviceExt, &Context, &Block, &StreamOffset, - DirSize, (PVOID*)&Record, name, &DirIndex, &Offset); + (DeviceExt, &Context, &Block, &StreamOffset, + DirSize, (PVOID*)&Record, name, &DirIndex, &Offset); if (Status == STATUS_NO_MORE_ENTRIES) { @@ -295,8 +295,8 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt, ShortName.MaximumLength = 26; ShortName.Buffer = ShortNameBuffer; - OffsetOfEntry.QuadPart = StreamOffset.QuadPart + Offset; - CdfsShortNameCacheGet(Parent, &OffsetOfEntry, &LongName, &ShortName); + OffsetOfEntry.QuadPart = StreamOffset.QuadPart + Offset; + CdfsShortNameCacheGet(Parent, &OffsetOfEntry, &LongName, &ShortName); DPRINT("ShortName '%wZ'\n", &ShortName); diff --git a/reactos/drivers/filesystems/cdfs/fcb.c b/reactos/drivers/filesystems/cdfs/fcb.c index 39102b4455d..dfdac4c4f16 100644 --- a/reactos/drivers/filesystems/cdfs/fcb.c +++ b/reactos/drivers/filesystems/cdfs/fcb.c @@ -106,15 +106,15 @@ VOID CdfsDestroyFCB(PFCB Fcb) { PLIST_ENTRY Entry; - + ExDeleteResourceLite(&Fcb->PagingIoResource); ExDeleteResourceLite(&Fcb->MainResource); while (!IsListEmpty(&Fcb->ShortNameList)) { - Entry = Fcb->ShortNameList.Flink; - RemoveEntryList(Entry); - ExFreePool(Entry); + Entry = Fcb->ShortNameList.Flink; + RemoveEntryList(Entry); + ExFreePool(Entry); } ExFreePool(Fcb); @@ -541,8 +541,8 @@ CdfsDirFindFile(PDEVICE_EXTENSION DeviceExt, ShortName.Buffer = ShortNameBuffer; memset(ShortNameBuffer, 0, 26); - OffsetOfEntry.QuadPart = StreamOffset.QuadPart + Offset; - CdfsShortNameCacheGet(DirectoryFcb, &OffsetOfEntry, &LongName, &ShortName); + OffsetOfEntry.QuadPart = StreamOffset.QuadPart + Offset; + CdfsShortNameCacheGet(DirectoryFcb, &OffsetOfEntry, &LongName, &ShortName); DPRINT("ShortName '%wZ'\n", &ShortName); diff --git a/reactos/drivers/filesystems/cdfs/misc.c b/reactos/drivers/filesystems/cdfs/misc.c index 1aa700fcf8e..7faf06798f2 100644 --- a/reactos/drivers/filesystems/cdfs/misc.c +++ b/reactos/drivers/filesystems/cdfs/misc.c @@ -103,9 +103,9 @@ CdfsWriteNumberInShortName { while (Number) { - *EndOfNumberTarget = '0' + (Number % 10); - EndOfNumberTarget--; - Number /= 10; + *EndOfNumberTarget = '0' + (Number % 10); + EndOfNumberTarget--; + Number /= 10; } return EndOfNumberTarget; } @@ -131,86 +131,86 @@ CdfsShortNameCacheGet /* Try to find the name in our cache */ for (Entry = DirectoryFcb->ShortNameList.Flink; - Entry != &DirectoryFcb->ShortNameList; - Entry = Entry->Flink) + Entry != &DirectoryFcb->ShortNameList; + Entry = Entry->Flink) { - ShortNameEntry = CONTAINING_RECORD(Entry, CDFS_SHORT_NAME, Entry); - if (ShortNameEntry->StreamOffset.QuadPart == StreamOffset->QuadPart) - { - /* Cache hit */ - RtlCopyMemory - (ShortName->Buffer, ShortNameEntry->Name.Buffer, - ShortNameEntry->Name.Length); - ShortName->Length = ShortNameEntry->Name.Length; - ExReleaseResourceLite(&DirectoryFcb->NameListResource); - DPRINT("Yield short name %wZ from cache\n", ShortName); - return; - } + ShortNameEntry = CONTAINING_RECORD(Entry, CDFS_SHORT_NAME, Entry); + if (ShortNameEntry->StreamOffset.QuadPart == StreamOffset->QuadPart) + { + /* Cache hit */ + RtlCopyMemory + (ShortName->Buffer, ShortNameEntry->Name.Buffer, + ShortNameEntry->Name.Length); + ShortName->Length = ShortNameEntry->Name.Length; + ExReleaseResourceLite(&DirectoryFcb->NameListResource); + DPRINT("Yield short name %wZ from cache\n", ShortName); + return; + } } - + /* Cache miss */ if ((RtlIsNameLegalDOS8Dot3(LongName, NULL, &HasSpaces) == FALSE) || - (HasSpaces == TRUE)) + (HasSpaces == TRUE)) { - RtlGenerate8dot3Name(LongName, FALSE, &Context, ShortName); + RtlGenerate8dot3Name(LongName, FALSE, &Context, ShortName); } else { - /* copy short name */ - RtlUpcaseUnicodeString - (ShortName, - LongName, - FALSE); + /* copy short name */ + RtlUpcaseUnicodeString + (ShortName, + LongName, + FALSE); } DPRINT("Initial Guess %wZ\n", ShortName); - + /* Find the part that'll be numberified */ LastDot = &ShortName->Buffer[(ShortName->Length / sizeof(WCHAR)) - 1]; for (Scan = ShortName->Buffer; - Scan - ShortName->Buffer < ShortName->Length; - Scan++) - if (*Scan == '.') LastDot = Scan - 1; - + Scan - ShortName->Buffer < ShortName->Length; + Scan++) + if (*Scan == '.') LastDot = Scan - 1; + /* Make it unique by scanning the cache and bumping */ /* Note that incrementing the ambiguous name is enough, since we add new - * entries at the tail. We'll scan over all collisions. */ + * entries at the tail. We'll scan over all collisions. */ /* XXX could perform better. */ for (Entry = DirectoryFcb->ShortNameList.Flink; - Entry != &DirectoryFcb->ShortNameList; - Entry = Entry->Flink) + Entry != &DirectoryFcb->ShortNameList; + Entry = Entry->Flink) { - ShortNameEntry = CONTAINING_RECORD(Entry, CDFS_SHORT_NAME, Entry); - if (RtlCompareUnicodeString - (ShortName, - &ShortNameEntry->Name, - TRUE) == 0) /* Match */ - { - Scan = CdfsWriteNumberInShortName(LastDot, ++Number); - *Scan = '~'; - DPRINT("Collide; try %wZ\n", ShortName); - } + ShortNameEntry = CONTAINING_RECORD(Entry, CDFS_SHORT_NAME, Entry); + if (RtlCompareUnicodeString + (ShortName, + &ShortNameEntry->Name, + TRUE) == 0) /* Match */ + { + Scan = CdfsWriteNumberInShortName(LastDot, ++Number); + *Scan = '~'; + DPRINT("Collide; try %wZ\n", ShortName); + } } - + /* We've scanned over all entries and now have a unique one. Cache it. */ ShortNameEntry = ExAllocatePool(PagedPool, sizeof(CDFS_SHORT_NAME)); if (!ShortNameEntry) { - /* We couldn't cache it, but we can return it. We run the risk of - * generating a non-unique name later. */ - ExReleaseResourceLite(&DirectoryFcb->NameListResource); - DPRINT1("Couldn't cache potentially clashing 8.3 name %wZ\n", ShortName); - return; + /* We couldn't cache it, but we can return it. We run the risk of + * generating a non-unique name later. */ + ExReleaseResourceLite(&DirectoryFcb->NameListResource); + DPRINT1("Couldn't cache potentially clashing 8.3 name %wZ\n", ShortName); + return; } - + ShortNameEntry->StreamOffset = *StreamOffset; ShortNameEntry->Name.Buffer = ShortNameEntry->NameBuffer; ShortNameEntry->Name.Length = ShortName->Length; ShortNameEntry->Name.MaximumLength = sizeof(ShortNameEntry->NameBuffer); RtlCopyMemory - (ShortNameEntry->NameBuffer, - ShortName->Buffer, - ShortName->Length); + (ShortNameEntry->NameBuffer, + ShortName->Buffer, + ShortName->Length); InsertTailList(&DirectoryFcb->ShortNameList, &ShortNameEntry->Entry); ExReleaseResourceLite(&DirectoryFcb->NameListResource);