From 2e39d2c54f729d8a2e153012f5e4b42cbb3323e6 Mon Sep 17 00:00:00 2001 From: Salvatore Benedetto Date: Fri, 22 Aug 2008 19:07:21 +0000 Subject: [PATCH] * Clean up. Not functional changes. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27158 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../udf/AllocationDescriptorList.h | 6 ++-- src/add-ons/kernel/file_systems/udf/Array.h | 32 +++++++++---------- .../kernel/file_systems/udf/CachedBlock.h | 1 + 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/add-ons/kernel/file_systems/udf/AllocationDescriptorList.h b/src/add-ons/kernel/file_systems/udf/AllocationDescriptorList.h index 8730170f0a..3238bef0ca 100644 --- a/src/add-ons/kernel/file_systems/udf/AllocationDescriptorList.h +++ b/src/add-ons/kernel/file_systems/udf/AllocationDescriptorList.h @@ -85,6 +85,7 @@ AllocationDescriptorList::AllocationDescriptorList(Icb *icb, _WalkContinuationChain(_CurrentDescriptor()); } + /*! \brief Finds the extent for the given address in the stream, returning it in the address pointed to by \a blockRun. @@ -130,7 +131,7 @@ AllocationDescriptorList::FindExtent(off_t start, _MoveToNextDescriptor(); } } else { - TRACE_ERROR(("UDF: AllocationDescriptorList<>::FindExtent: " + TRACE_ERROR(("AllocationDescriptorList<>::FindExtent: " "Descriptor #%ld found NULL\n", _DescriptorNumber())); status = B_ERROR; break; @@ -143,6 +144,7 @@ AllocationDescriptorList::FindExtent(off_t start, // #pragma - Private methods + template AllocationDescriptorList::Descriptor* AllocationDescriptorList::_CurrentDescriptor() const @@ -242,6 +244,7 @@ AllocationDescriptorList::_DescriptorArraySize() const // pragma - Accessors + class ShortDescriptorAccessor { public: ShortDescriptorAccessor(uint16 partition) @@ -303,4 +306,3 @@ public: }; #endif // _UDF_ALLOCATION_DESCRIPTOR_LIST_H - diff --git a/src/add-ons/kernel/file_systems/udf/Array.h b/src/add-ons/kernel/file_systems/udf/Array.h index 40f3f1ef03..5a48e1371a 100644 --- a/src/add-ons/kernel/file_systems/udf/Array.h +++ b/src/add-ons/kernel/file_systems/udf/Array.h @@ -1,9 +1,7 @@ -//---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered -// by the OpenBeOS license. -// -// Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net -//--------------------------------------------------------------------- +/* + * Copyright, 2003, Tyler Dauwalder, tyler@dauwalder.net. + * Distributed under the terms of the MIT License. + */ #ifndef _UDF_ARRAY_H #define _UDF_ARRAY_H @@ -36,8 +34,8 @@ public: DataType data[arrayLength]; }; -/*! \brief \c uint8 specialization of the \c array template struct. -*/ + +/*! \brief \c uint8 specialization of the \c array template struct. */ template struct array { void dump() const @@ -50,19 +48,20 @@ struct array { for (uint32 i = 0; i < arrayLength; i++) { if (i % bytesPerRow == 0) - PRINT(("[%ld:%ld]: ", i, i+bytesPerRow-1)); + PRINT(("[%ld:%ld]: ", i, i + bytesPerRow - 1)); SIMPLE_PRINT(("0x%.2x ", data[i])); - if ((i+1) % bytesPerRow == 0 || i+1 == arrayLength) + if ((i + 1) % bytesPerRow == 0 || i + 1 == arrayLength) SIMPLE_PRINT(("\n")); } } + uint32 length() const { return arrayLength; } uint32 size() const { return arrayLength; } uint8 data[arrayLength]; }; -/*! \brief \c char specialization of the \c array template struct. -*/ + +/*! \brief \c char specialization of the \c array template struct. */ template struct array { void dump() const @@ -70,17 +69,18 @@ struct array { const uint8 bytesPerRow = 8; char classname[40]; sprintf(classname, "array", arrayLength); - + DUMP_INIT(classname); - + for (uint32 i = 0; i < arrayLength; i++) { if (i % bytesPerRow == 0) - PRINT(("[%ld:%ld]: ", i, i+bytesPerRow-1)); + PRINT(("[%ld:%ld]: ", i, i + bytesPerRow - 1)); SIMPLE_PRINT(("0x%.2x ", data[i])); - if ((i+1) % bytesPerRow == 0 || i+1 == arrayLength) + if ((i + 1) % bytesPerRow == 0 || i + 1 == arrayLength) SIMPLE_PRINT(("\n")); } } + uint32 length() const { return arrayLength; } uint32 size() const { return arrayLength; } uint8 data[arrayLength]; diff --git a/src/add-ons/kernel/file_systems/udf/CachedBlock.h b/src/add-ons/kernel/file_systems/udf/CachedBlock.h index e1dfd18008..80513525a0 100644 --- a/src/add-ons/kernel/file_systems/udf/CachedBlock.h +++ b/src/add-ons/kernel/file_systems/udf/CachedBlock.h @@ -131,6 +131,7 @@ CachedBlock::SetTo(long_address address) return NULL; } + template inline uint8* CachedBlock::SetTo(Accessor &accessor, Descriptor &descriptor)