Various changes to get this mostly compiling, with the exception of a template issue I don't yet completely understand.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33213 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent 2009-09-21 03:38:46 +00:00
parent 47e4e5b32b
commit 20d8499530
13 changed files with 38 additions and 33 deletions

View File

@ -146,7 +146,7 @@ AllocationDescriptorList<Accessor>::FindExtent(off_t start,
template<class Accessor>
AllocationDescriptorList<Accessor>::Descriptor*
AllocationDescriptorList<class Accessor>::Descriptor*
AllocationDescriptorList<Accessor>::_CurrentDescriptor() const
{
TRACE(("AllocationDescriptorList<>::_CurrentDescriptor:\n"

View File

@ -57,7 +57,7 @@ DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id)
} else {
UdfString string(entry->id(), entry->id_length());
TRACE(("DirectoryIterator::GetNextEntry: UfdString id == `%s', "
"length = %d\n", string.Utf8(), string.Utf8Length()));
"length = %lu\n", string.Utf8(), string.Utf8Length()));
DUMP(entry->icb());
sprintf(name, "%s", string.Utf8());
*length = string.Utf8Length();

View File

@ -114,7 +114,8 @@ public:
private:
AbstractFileEntry *_AbstractEntry() { return (_Tag().id()
== TAGID_EXTENDED_FILE_ENTRY)
? &fExtendedEntry : &fFileEntry; }
? (AbstractFileEntry *)&fExtendedEntry
: (AbstractFileEntry *)&fFileEntry; }
descriptor_tag &_Tag() { return ((icb_header *)fData.Block())->tag(); }
icb_entry_tag &_IcbTag() { return ((icb_header *)fData.Block())->icb_tag(); }

View File

@ -11,8 +11,8 @@ PhysicalPartition::PhysicalPartition(uint16 number, uint32 start, uint32 length)
fStart(start),
fLength(length)
{
TRACE(("PhysicalPartition::PhysicalPartition: number = %d, start = %d,
length = %d\n", number, start, length));
TRACE(("PhysicalPartition::PhysicalPartition: number = %d, start = %lu,"
"length = %lu\n", number, start, length));
}
@ -33,8 +33,8 @@ PhysicalPartition::MapBlock(uint32 logicalBlock, off_t &physicalBlock)
{
TRACE(("PhysicalPartition::MapBlock: %ld\n", logicalBlock));
if (logicalBlock >= fLength) {
TRACE_ERROR(("PhysicalPartition::MapBlock: block %ld invalid,
length = %ld\n", logicalBlock, fLength));
TRACE_ERROR(("PhysicalPartition::MapBlock: block %ld invalid,"
"length = %ld\n", logicalBlock, fLength));
return B_BAD_ADDRESS;
} else {
physicalBlock = fStart + logicalBlock;

View File

@ -60,7 +60,7 @@ udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
status = walk_volume_recognition_sequence(device, offset, blockSize,
blockShift);
if (status != B_OK) {
TRACE_ERROR(("udf_recognize: Invalid sequence. status = %d\n", status));
TRACE_ERROR(("udf_recognize: Invalid sequence. status = %ld\n", status));
return status;
}
// Now hunt down a volume descriptor sequence from one of
@ -69,7 +69,7 @@ udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
blockSize, blockShift, logicalVolumeDescriptor, partitionDescriptors,
partitionDescriptorCount);
if (status != B_OK) {
TRACE_ERROR(("udf_recognize: cannot find volume descriptor. status = %d\n",
TRACE_ERROR(("udf_recognize: cannot find volume descriptor. status = %ld\n",
status));
return status;
}
@ -79,7 +79,7 @@ udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
logicalVolumeDescriptor.integrity_sequence_extent());
if (status != B_OK) {
TRACE_ERROR(("udf_recognize: last integrity descriptor not closed. "
"status = %d\n", status));
"status = %ld\n", status));
return status;
}
@ -96,7 +96,7 @@ walk_volume_recognition_sequence(int device, off_t offset, uint32 blockSize,
uint32 blockShift)
{
TRACE(("walk_volume_recognition_sequence: device = %d, offset = %Ld, "
"blockSize = %ld, blockShift = %d\n", device, offset, blockSize,
"blockSize = %ld, blockShift = %lu\n", device, offset, blockSize,
blockShift));
// vrs starts at block 16. Each volume structure descriptor (vsd)
@ -117,7 +117,7 @@ walk_volume_recognition_sequence(int device, off_t offset, uint32 blockSize,
for (uint32 block = 16; true; block++) {
off_t address = (offset + block) << blockShift;
TRACE(("walk_volume_recognition_sequence: block = %ld, "
"address = %d, ", block, address));
"address = %Ld, ", block, address));
ssize_t bytesRead = read_pos(device, address, chunk.Data(), blockSize);
if (bytesRead == (ssize_t)blockSize) {
volume_structure_descriptor_header* descriptor

View File

@ -19,8 +19,8 @@ SparablePartition::SparablePartition(uint16 number, uint32 start, uint32 length,
fTableCount(tableCount),
fInitStatus(B_NO_INIT)
{
TRACE(("SparablePartition::SparablePartition: number = %d, start = %d,
length = %d, packetLength = %d\n", number, start, length, packetLength));
TRACE(("SparablePartition::SparablePartition: number = %d, start = %lu,"
"length = %lu, packetLength = %d\n", number, start, length, packetLength));
status_t status = (0 < TableCount() && TableCount() <= kMaxSparingTableCount)
? B_OK : B_BAD_VALUE;

View File

@ -226,7 +226,6 @@ private:
#define RETURN(status) return status;
#define FATAL(x) { __out("udf: fatal error: "); __out x; }
#define DBG(x) ;
#define DUMP(x) ;
#endif // ifdef DEBUG else
#define TRACE(x) dprintf x

View File

@ -359,7 +359,7 @@ domain_id_suffix::domain_id_suffix(uint16 udfRevision, uint8 domainFlags)
// entity_id
//----------------------------------------------------------------------
entity_id::entity_id(uint8 flags, char *identifier, uint8 *identifier_suffix)
entity_id::entity_id(uint8 flags, const char *identifier, uint8 *identifier_suffix)
: _flags(flags)
{
memset(_identifier, 0, kIdentifierLength);
@ -371,7 +371,7 @@ entity_id::entity_id(uint8 flags, char *identifier, uint8 *identifier_suffix)
memset(_identifier_suffix.data, 0, kIdentifierSuffixLength);
}
entity_id::entity_id(uint8 flags, char *identifier,
entity_id::entity_id(uint8 flags, const char *identifier,
const udf_id_suffix &suffix)
: _flags(flags)
{
@ -381,7 +381,7 @@ entity_id::entity_id(uint8 flags, char *identifier,
memcpy(_identifier_suffix.data, &suffix, kIdentifierSuffixLength);
}
entity_id::entity_id(uint8 flags, char *identifier,
entity_id::entity_id(uint8 flags, const char *identifier,
const implementation_id_suffix &suffix)
: _flags(flags)
{
@ -391,7 +391,7 @@ entity_id::entity_id(uint8 flags, char *identifier,
memcpy(_identifier_suffix.data, &suffix, kIdentifierSuffixLength);
}
entity_id::entity_id(uint8 flags, char *identifier,
entity_id::entity_id(uint8 flags, const char *identifier,
const domain_id_suffix &suffix)
: _flags(flags)
{

View File

@ -13,6 +13,7 @@
#include <SupportDefs.h>
#include "UdfDebug.h"
#include "Utils.h"
#include "Array.h"
@ -265,13 +266,13 @@ public:
static const int kIdentifierLength = 23;
static const int kIdentifierSuffixLength = 8;
entity_id(uint8 flags = 0, char *identifier = NULL,
entity_id(uint8 flags = 0, const char *identifier = NULL,
uint8 *identifier_suffix = NULL);
entity_id(uint8 flags, char *identifier,
entity_id(uint8 flags, const char *identifier,
const udf_id_suffix &suffix);
entity_id(uint8 flags, char *identifier,
entity_id(uint8 flags, const char *identifier,
const implementation_id_suffix &suffix);
entity_id(uint8 flags, char *identifier,
entity_id(uint8 flags, const char *identifier,
const domain_id_suffix &suffix);
void dump() const;

View File

@ -5,6 +5,7 @@
/*! \file Utils.cpp - Miscellaneous Udf utility functions. */
#include "UdfStructures.h"
#include "Utils.h"
extern "C" {

View File

@ -5,9 +5,12 @@
#ifndef _UDF_UTILS_H
#define _UDF_UTILS_H
#include <SupportDefs.h>
/*! \file Utils.h - Miscellaneous Udf utility functions. */
#include "UdfStructures.h"
class timestamp;
struct long_address;
const char *bool_to_string(bool value);
uint16 calculate_crc(uint8 *data, uint16 length);

View File

@ -203,8 +203,8 @@ Volume::Mount(const char *deviceName, off_t offset, off_t length,
fBlockSize = blockSize;
fBlockShift = blockShift;
}
TRACE(("Volume::Mount: device = %d, offset = %d, length = %ld, "
"blockSize = %d, blockShift = %d\n", device, offset, length,
TRACE(("Volume::Mount: device = %d, offset = %Ld, length = %Ld, "
"blockSize = %ld, blockShift = %ld\n", device, offset, length,
blockSize, blockShift));
// At this point we've found a valid set of volume descriptors and
// our partitions are all set up. We now need to investigate the file
@ -248,7 +248,7 @@ Volume::Mount(const char *deviceName, off_t offset, off_t length,
return B_NO_MEMORY;
}
TRACE(("Volume::Mount: Root Node id = %d\n", fRootIcb->Id()));
TRACE(("Volume::Mount: Root Node id = %Ld\n", fRootIcb->Id()));
if (!status) {
status = publish_vnode(fFSVolume, fRootIcb->Id(), fRootIcb,
&gUDFVnodeOps, fRootIcb->Mode(), 0);
@ -261,7 +261,7 @@ Volume::Mount(const char *deviceName, off_t offset, off_t length,
delete fRootIcb;
fRootIcb = NULL;
}
TRACE(("Volume::Mount: Root vnode published. Id = %d\n",
TRACE(("Volume::Mount: Root vnode published. Id = %Ld\n",
fRootIcb->Id()));
}
}

View File

@ -43,8 +43,8 @@ extern fs_vnode_ops gUDFVnodeOps;
static float
udf_identify_partition(int fd, partition_data *partition, void **_cookie)
{
TRACE(("udf_identify_partition: fd = %d, id = %d, offset = %d, size = %d "
"content_size = %d, block_size = %d\n", fd, partition->id,
TRACE(("udf_identify_partition: fd = %d, id = %ld, offset = %Ld, size = %Ld "
"content_size = %Ld, block_size = %lu\n", fd, partition->id,
partition->offset, partition->size, partition->content_size,
partition->block_size));
@ -123,7 +123,7 @@ udf_get_vnode(fs_volume *_volume, ino_t id, fs_vnode *_node, int *_type,
// Convert the given vnode id to an address, and create
// and return a corresponding Icb object for it.
TRACE(("udf_get_vnode: id = %d, blockSize = %d\n", id, volume->BlockSize()));
TRACE(("udf_get_vnode: id = %Ld, blockSize = %lu\n", id, volume->BlockSize()));
Icb *icb = new(std::nothrow) Icb(volume,
to_long_address(id, volume->BlockSize()));
if (icb) {
@ -224,7 +224,7 @@ udf_read_stat(fs_volume *_volume, fs_vnode *node, struct stat *stat)
stat->st_nlink = icb->FileLinkCount();
stat->st_blksize = volume->BlockSize();
TRACE(("udf_read_stat: st_dev = %d, st_ino = %d, st_blksize = %d\n",
TRACE(("udf_read_stat: st_dev = %ld, st_ino = %Ld, st_blksize = %d\n",
stat->st_dev, stat->st_ino, stat->st_blksize));
stat->st_uid = icb->Uid();
@ -240,7 +240,7 @@ udf_read_stat(fs_volume *_volume, fs_vnode *node, struct stat *stat)
stat->st_atime = icb->AccessTime();
stat->st_mtime = stat->st_ctime = stat->st_crtime = icb->ModificationTime();
TRACE(("udf_read_stat: mode = 0x%lx, st_ino: %Ld\n", stat->st_mode,
TRACE(("udf_read_stat: mode = 0x%x, st_ino: %Ld\n", stat->st_mode,
stat->st_ino));
return B_OK;