diff --git a/src/add-ons/kernel/file_systems/udf/Array.h b/src/add-ons/kernel/file_systems/udf/Array.h index 5a48e1371a..2f2f6ee1e2 100644 --- a/src/add-ons/kernel/file_systems/udf/Array.h +++ b/src/add-ons/kernel/file_systems/udf/Array.h @@ -10,8 +10,6 @@ #include "SupportDefs.h" #include "UdfDebug.h" -#include - /*! \brief Slightly more typesafe static array type than built-in arrays, with array length information stored implicitly (i.e. consuming no physical space in the actual struct) via the \c arrayLength template diff --git a/src/add-ons/kernel/file_systems/udf/UdfDebug.cpp b/src/add-ons/kernel/file_systems/udf/UdfDebug.cpp index 601c4c67da..e60233074e 100644 --- a/src/add-ons/kernel/file_systems/udf/UdfDebug.cpp +++ b/src/add-ons/kernel/file_systems/udf/UdfDebug.cpp @@ -158,7 +158,7 @@ static void unindent(uint8 tabCount); #endif //! Used to keep the tls handle from being allocated more than once. -vint32 tls_spinlock = 0; +int32 tls_spinlock = 0; /*! \brief Used to flag whether the tls handle has been allocated yet. diff --git a/src/add-ons/kernel/file_systems/udf/UdfDebug.h b/src/add-ons/kernel/file_systems/udf/UdfDebug.h index d4a2db95c6..2af84c9f8a 100644 --- a/src/add-ons/kernel/file_systems/udf/UdfDebug.h +++ b/src/add-ons/kernel/file_systems/udf/UdfDebug.h @@ -47,8 +47,6 @@ extern "C" int vsprintf(char *s, const char *format, va_list arg); //# define __out printf #endif -#include - class DebugHelper; int32 _get_debug_indent_level(); @@ -229,7 +227,12 @@ private: #endif // ifdef DEBUG else #define TRACE(x) /*dprintf x*/ -#define TRACE_ERROR(x) dprintf x + +#ifdef TEST_HAIKU + #define TRACE_ERROR(x) printf x +#else + #define TRACE_ERROR(x) dprintf x +#endif // These macros turn on or off extensive and generally unnecessary // debugging output regarding table of contents parsing diff --git a/src/add-ons/kernel/file_systems/udf/UdfString.h b/src/add-ons/kernel/file_systems/udf/UdfString.h index 4d64fb36d1..bf9eead4bc 100644 --- a/src/add-ons/kernel/file_systems/udf/UdfString.h +++ b/src/add-ons/kernel/file_systems/udf/UdfString.h @@ -10,13 +10,13 @@ #include - #include "Array.h" #include "UdfDebug.h" +#include #include -#include + /*! \brief UdfString class that takes as input either a UTF8 string or a CS0 unicode string and then provides access to said string in both formats. diff --git a/src/add-ons/kernel/file_systems/udf/UdfStructures.h b/src/add-ons/kernel/file_systems/udf/UdfStructures.h index 05d7baff46..3d319fba3b 100644 --- a/src/add-ons/kernel/file_systems/udf/UdfStructures.h +++ b/src/add-ons/kernel/file_systems/udf/UdfStructures.h @@ -16,8 +16,6 @@ #include "Array.h" -#include - /*! \file UdfStructures.h \brief UDF on-disk data structure declarations diff --git a/src/bin/makeudfimage/Allocator.cpp b/src/bin/makeudfimage/Allocator.cpp index 1eb0d6ed64..edf62eee52 100644 --- a/src/bin/makeudfimage/Allocator.cpp +++ b/src/bin/makeudfimage/Allocator.cpp @@ -24,7 +24,7 @@ Allocator::Allocator(uint32 blockSize) , fBlockShift(0) , fInitStatus(B_NO_INIT) { - status_t error = Udf::get_block_shift(BlockSize(), fBlockShift); + status_t error = get_block_shift(BlockSize(), fBlockShift); if (!error) fInitStatus = B_OK; } @@ -44,7 +44,7 @@ Allocator::InitCheck() const status_t Allocator::GetBlock(uint32 block) { - Udf::extent_address extent(block, BlockSize()); + extent_address extent(block, BlockSize()); return GetExtent(extent); } @@ -56,7 +56,7 @@ Allocator::GetBlock(uint32 block) been allocated. */ status_t -Allocator::GetExtent(Udf::extent_address extent) +Allocator::GetExtent(extent_address extent) { status_t error = InitCheck(); if (!error) { @@ -68,7 +68,7 @@ Allocator::GetExtent(Udf::extent_address extent) // Add a new chunk to the end of the chunk list if // necessary if (offset > Length()) { - Udf::extent_address chunk(Length(), (offset-Length())<::iterator i = fChunkList.begin(); + for (list::iterator i = fChunkList.begin(); i != fChunkList.end(); i++) { @@ -88,7 +88,7 @@ Allocator::GetExtent(Udf::extent_address extent) if (chunkOffset < offset) { // Orhpan before; add a new chunk in front // of the current one - Udf::extent_address chunk(chunkOffset, (offset-chunkOffset)<::iterator i = fChunkList.begin(); + for (list::iterator i = fChunkList.begin(); i != fChunkList.end(); i++) { @@ -180,7 +180,7 @@ Allocator::GetNextExtent(uint32 _length, bool contiguous, uint32 newLength = chunkLength-difference; if (length <= newLength) { // new chunk is still long enough - Udf::extent_address newExtent(newOffset, _length); + extent_address newExtent(newOffset, _length); if (GetExtent(newExtent) == B_OK) { extent = newExtent; return B_OK; @@ -188,7 +188,7 @@ Allocator::GetNextExtent(uint32 _length, bool contiguous, } else if (!contiguous) { // new chunk is too short, but we're allowed to // allocate a shorter extent, so we'll do it. - Udf::extent_address newExtent(newOffset, newLength< fChunkList; + list fChunkList; uint32 fLength; //!< Length of allocation so far, in blocks. uint32 fBlockSize; uint32 fBlockShift; diff --git a/src/bin/makeudfimage/PhysicalPartitionAllocator.cpp b/src/bin/makeudfimage/PhysicalPartitionAllocator.cpp index ebcefbe8b1..e4d32f259c 100644 --- a/src/bin/makeudfimage/PhysicalPartitionAllocator.cpp +++ b/src/bin/makeudfimage/PhysicalPartitionAllocator.cpp @@ -12,7 +12,7 @@ #include "PhysicalPartitionAllocator.h" -Udf::extent_address PhysicalPartitionAllocator::dummyExtent; +extent_address PhysicalPartitionAllocator::dummyExtent; PhysicalPartitionAllocator::PhysicalPartitionAllocator(uint16 number, uint32 offset, @@ -70,8 +70,8 @@ PhysicalPartitionAllocator::GetNextBlock(uint32 &block, uint32 &physicalBlock) status_t PhysicalPartitionAllocator::GetNextExtent(uint32 length, bool contiguous, - Udf::long_address &extent, - Udf::extent_address &physicalExtent) + long_address &extent, + extent_address &physicalExtent) { status_t error = fAllocator.GetNextExtent(length, contiguous, physicalExtent, fOffset); if (!error) { @@ -96,8 +96,8 @@ PhysicalPartitionAllocator::GetNextExtent(uint32 length, - error code: Failure. */ status_t -PhysicalPartitionAllocator::GetNextExtents(off_t length, std::list &extents, - std::list &physicalExtents) +PhysicalPartitionAllocator::GetNextExtents(off_t length, std::list &extents, + std::list &physicalExtents) { DEBUG_INIT_ETC("PhysicalPartitionAllocator", ("length: %lld", length)); extents.empty(); @@ -106,8 +106,8 @@ PhysicalPartitionAllocator::GetNextExtents(off_t length, std::list &extents, - std::list &physicalExtents); + status_t GetNextExtent(uint32 length, bool contiguous, long_address &extent, + extent_address &physicalExtent = dummyExtent); + status_t GetNextExtents(off_t length, std::list &extents, + std::list &physicalExtents); uint16 PartitionNumber() const { return fNumber; } uint32 Length() const; private: - static Udf::extent_address dummyExtent; + static extent_address dummyExtent; uint16 fNumber; //!< The partition number of this partition uint32 fOffset; //!< The offset of the start of this partition in physical space Allocator &fAllocator; diff --git a/src/tests/bin/makeudfimage/AllocatorTest.cpp b/src/tests/bin/makeudfimage/AllocatorTest.cpp index aabf2d9e51..013263fc01 100644 --- a/src/tests/bin/makeudfimage/AllocatorTest.cpp +++ b/src/tests/bin/makeudfimage/AllocatorTest.cpp @@ -22,8 +22,8 @@ AllocatorTest::Suite() { CppUnit::TestSuite *suite = new CppUnit::TestSuite("Yo"); // And our tests - suite->addTest(new CppUnit::TestCaller("Udf::Allocator::BlockSize Test", &AllocatorTest::BlockSizeTest)); - suite->addTest(new CppUnit::TestCaller("Udf::Allocator::Partition Full Test", &AllocatorTest::PartitionFullTest)); + suite->addTest(new CppUnit::TestCaller("Allocator::BlockSize Test", &AllocatorTest::BlockSizeTest)); + suite->addTest(new CppUnit::TestCaller("Allocator::Partition Full Test", &AllocatorTest::PartitionFullTest)); return suite; } @@ -85,7 +85,7 @@ AllocatorTest::BlockSizeTest() { void AllocatorTest::PartitionFullTest() { { - Udf::extent_address extent; + extent_address extent; const uint32 blockSize = 2048; Allocator allocator(blockSize); CHK(allocator.InitCheck() == B_OK); @@ -100,7 +100,7 @@ AllocatorTest::PartitionFullTest() { } NextSubTest(); { - Udf::extent_address extent; + extent_address extent; Allocator allocator(2048); CHK(allocator.InitCheck() == B_OK); CHK(allocator.GetNextExtent(ULONG_MAX-1, true, extent) == B_OK); @@ -112,7 +112,7 @@ AllocatorTest::PartitionFullTest() { } NextSubTest(); { - Udf::extent_address extent; + extent_address extent; const uint32 blockSize = 2048; Allocator allocator(blockSize); CHK(allocator.InitCheck() == B_OK); @@ -123,20 +123,20 @@ AllocatorTest::PartitionFullTest() { CHK(allocator.GetExtent(extent) != B_OK); CHK(allocator.GetBlock(13) != B_OK); PhysicalPartitionAllocator partition(0, 0, allocator); - std::list extents; - std::list physicalExtents; + std::list extents; + std::list physicalExtents; CHK(partition.GetNextExtents(1, extents, physicalExtents) == B_OK); } NextSubTest(); { - Udf::extent_address extent; + extent_address extent; const uint32 blockSize = 2048; Allocator allocator(blockSize); CHK(allocator.InitCheck() == B_OK); CHK(allocator.GetNextExtent(ULONG_MAX, true, extent) == B_OK); PhysicalPartitionAllocator partition(0, 0, allocator); - std::list extents; - std::list physicalExtents; + std::list extents; + std::list physicalExtents; CHK(partition.GetNextExtents(1, extents, physicalExtents) != B_OK); } NextSubTest(); diff --git a/src/tests/bin/makeudfimage/Jamfile b/src/tests/bin/makeudfimage/Jamfile index d165d7a448..5be2f67d58 100644 --- a/src/tests/bin/makeudfimage/Jamfile +++ b/src/tests/bin/makeudfimage/Jamfile @@ -5,6 +5,7 @@ AddSubDirSupportedPlatforms libbe_test ; UsePublicHeaders add-ons/file_system ; # For fsproto.h UsePrivateHeaders [ FDirName kernel util ] ; # For kernel_cpp.h +UsePrivateHeaders private shared ; SubDirHdrs [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems udf ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) src bin makeudfimage ] ;