* Cleaned up pointer style

* Added new line that was missing from previous commit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32298 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Bryce Groff 2009-08-13 08:38:58 +00:00
parent 04e24ee5ba
commit 6f0f2e9ecd

View File

@ -18,11 +18,11 @@
// write_lock_disk_device // write_lock_disk_device
disk_device_data * disk_device_data*
write_lock_disk_device(partition_id partitionID) write_lock_disk_device(partition_id partitionID)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
if (KDiskDevice *device = manager->RegisterDevice(partitionID, false)) { if (KDiskDevice* device = manager->RegisterDevice(partitionID, false)) {
if (device->WriteLock()) if (device->WriteLock())
return device->DeviceData(); return device->DeviceData();
// Only unregister, when the locking fails. The guarantees, that the // Only unregister, when the locking fails. The guarantees, that the
@ -37,8 +37,8 @@ write_lock_disk_device(partition_id partitionID)
void void
write_unlock_disk_device(partition_id partitionID) write_unlock_disk_device(partition_id partitionID)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
if (KDiskDevice *device = manager->RegisterDevice(partitionID, false)) { if (KDiskDevice* device = manager->RegisterDevice(partitionID, false)) {
bool isLocked = device->IsWriteLocked(); bool isLocked = device->IsWriteLocked();
if (isLocked) { if (isLocked) {
device->WriteUnlock(); device->WriteUnlock();
@ -50,11 +50,11 @@ write_unlock_disk_device(partition_id partitionID)
// read_lock_disk_device // read_lock_disk_device
disk_device_data * disk_device_data*
read_lock_disk_device(partition_id partitionID) read_lock_disk_device(partition_id partitionID)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
if (KDiskDevice *device = manager->RegisterDevice(partitionID, false)) { if (KDiskDevice* device = manager->RegisterDevice(partitionID, false)) {
if (device->ReadLock()) if (device->ReadLock())
return device->DeviceData(); return device->DeviceData();
// Only unregister, when the locking fails. The guarantees, that the // Only unregister, when the locking fails. The guarantees, that the
@ -69,8 +69,8 @@ read_lock_disk_device(partition_id partitionID)
void void
read_unlock_disk_device(partition_id partitionID) read_unlock_disk_device(partition_id partitionID)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
if (KDiskDevice *device = manager->RegisterDevice(partitionID, false)) { if (KDiskDevice* device = manager->RegisterDevice(partitionID, false)) {
bool isLocked = device->IsReadLocked(false); bool isLocked = device->IsReadLocked(false);
if (isLocked) { if (isLocked) {
device->ReadUnlock(); device->ReadUnlock();
@ -83,11 +83,11 @@ read_unlock_disk_device(partition_id partitionID)
// find_disk_device // find_disk_device
int32 int32
find_disk_device(const char *path) find_disk_device(const char* path)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
partition_id id = -1; partition_id id = -1;
if (KDiskDevice *device = manager->RegisterDevice(path)) { if (KDiskDevice* device = manager->RegisterDevice(path)) {
id = device->ID(); id = device->ID();
device->Unregister(); device->Unregister();
} }
@ -97,11 +97,11 @@ find_disk_device(const char *path)
// find_partition // find_partition
int32 int32
find_partition(const char *path) find_partition(const char* path)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
partition_id id = -1; partition_id id = -1;
if (KPartition *partition = manager->RegisterPartition(path)) { if (KPartition* partition = manager->RegisterPartition(path)) {
id = partition->ID(); id = partition->ID();
partition->Unregister(); partition->Unregister();
} }
@ -110,31 +110,31 @@ find_partition(const char *path)
// get_disk_device // get_disk_device
disk_device_data * disk_device_data*
get_disk_device(partition_id partitionID) get_disk_device(partition_id partitionID)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
KDiskDevice *device = manager->FindDevice(partitionID, false); KDiskDevice* device = manager->FindDevice(partitionID, false);
return (device ? device->DeviceData() : NULL); return (device ? device->DeviceData() : NULL);
} }
// get_partition // get_partition
partition_data * partition_data*
get_partition(partition_id partitionID) get_partition(partition_id partitionID)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
KPartition *partition = manager->FindPartition(partitionID); KPartition* partition = manager->FindPartition(partitionID);
return (partition ? partition->PartitionData() : NULL); return (partition ? partition->PartitionData() : NULL);
} }
// get_parent_partition // get_parent_partition
partition_data * partition_data*
get_parent_partition(partition_id partitionID) get_parent_partition(partition_id partitionID)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
KPartition *partition = manager->FindPartition(partitionID); KPartition* partition = manager->FindPartition(partitionID);
if (partition && partition->Parent()) if (partition && partition->Parent())
return partition->Parent()->PartitionData(); return partition->Parent()->PartitionData();
return NULL; return NULL;
@ -142,12 +142,12 @@ get_parent_partition(partition_id partitionID)
// get_child_partition // get_child_partition
partition_data * partition_data*
get_child_partition(partition_id partitionID, int32 index) get_child_partition(partition_id partitionID, int32 index)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
if (KPartition *partition = manager->FindPartition(partitionID)) { if (KPartition* partition = manager->FindPartition(partitionID)) {
if (KPartition *child = partition->ChildAt(index)) if (KPartition* child = partition->ChildAt(index))
return child->PartitionData(); return child->PartitionData();
} }
return NULL; return NULL;
@ -157,8 +157,8 @@ get_child_partition(partition_id partitionID, int32 index)
int int
open_partition(partition_id partitionID, int openMode) open_partition(partition_id partitionID, int openMode)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
KPartition *partition = manager->FindPartition(partitionID); KPartition* partition = manager->FindPartition(partitionID);
if (partition == NULL) if (partition == NULL)
return B_BAD_VALUE; return B_BAD_VALUE;
@ -170,14 +170,15 @@ open_partition(partition_id partitionID, int openMode)
return fd; return fd;
} }
// create_child_partition // create_child_partition
partition_data * partition_data*
create_child_partition(partition_id partitionID, int32 index, off_t offset, create_child_partition(partition_id partitionID, int32 index, off_t offset,
off_t size, partition_id childID) off_t size, partition_id childID)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
if (KPartition *partition = manager->FindPartition(partitionID)) { if (KPartition* partition = manager->FindPartition(partitionID)) {
KPartition *child = NULL; KPartition* child = NULL;
if (partition->CreateChild(childID, index, offset, size, &child) if (partition->CreateChild(childID, index, offset, size, &child)
== B_OK) { == B_OK) {
return child->PartitionData(); return child->PartitionData();
@ -196,9 +197,9 @@ create_child_partition(partition_id partitionID, int32 index, off_t offset,
bool bool
delete_partition(partition_id partitionID) delete_partition(partition_id partitionID)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
if (KPartition *partition = manager->FindPartition(partitionID)) { if (KPartition* partition = manager->FindPartition(partitionID)) {
if (KPartition *parent = partition->Parent()) if (KPartition* parent = partition->Parent())
return parent->RemoveChild(partition); return parent->RemoveChild(partition);
} }
return false; return false;
@ -234,8 +235,8 @@ status_t
get_default_partition_content_name(partition_id partitionID, get_default_partition_content_name(partition_id partitionID,
const char* fileSystemName, char* buffer, size_t bufferSize) const char* fileSystemName, char* buffer, size_t bufferSize)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
KPartition *partition = manager->RegisterPartition(partitionID); KPartition* partition = manager->RegisterPartition(partitionID);
if (partition == NULL) if (partition == NULL)
return B_ENTRY_NOT_FOUND; return B_ENTRY_NOT_FOUND;
@ -265,11 +266,11 @@ get_default_partition_content_name(partition_id partitionID,
// find_disk_system // find_disk_system
disk_system_id disk_system_id
find_disk_system(const char *name) find_disk_system(const char* name)
{ {
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
if (ManagerLocker locker = manager) { if (ManagerLocker locker = manager) {
if (KDiskSystem *diskSystem = manager->FindDiskSystem(name)) if (KDiskSystem* diskSystem = manager->FindDiskSystem(name))
return diskSystem->ID(); return diskSystem->ID();
} }
return -1; return -1;
@ -281,9 +282,9 @@ bool
update_disk_device_job_progress(disk_job_id jobID, float progress) update_disk_device_job_progress(disk_job_id jobID, float progress)
{ {
#if 0 #if 0
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
if (ManagerLocker locker = manager) { if (ManagerLocker locker = manager) {
if (KDiskDeviceJob *job = manager->FindJob(jobID)) { if (KDiskDeviceJob* job = manager->FindJob(jobID)) {
job->UpdateProgress(progress); job->UpdateProgress(progress);
return true; return true;
} }
@ -295,12 +296,12 @@ update_disk_device_job_progress(disk_job_id jobID, float progress)
// update_disk_device_job_extra_progress // update_disk_device_job_extra_progress
bool bool
update_disk_device_job_extra_progress(disk_job_id jobID, const char *info) update_disk_device_job_extra_progress(disk_job_id jobID, const char* info)
{ {
#if 0 #if 0
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
if (ManagerLocker locker = manager) { if (ManagerLocker locker = manager) {
if (KDiskDeviceJob *job = manager->FindJob(jobID)) { if (KDiskDeviceJob* job = manager->FindJob(jobID)) {
job->UpdateExtraProgress(info); job->UpdateExtraProgress(info);
return true; return true;
} }
@ -312,12 +313,12 @@ update_disk_device_job_extra_progress(disk_job_id jobID, const char *info)
// set_disk_device_job_error_message // set_disk_device_job_error_message
bool bool
set_disk_device_job_error_message(disk_job_id jobID, const char *message) set_disk_device_job_error_message(disk_job_id jobID, const char* message)
{ {
#if 0 #if 0
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
if (ManagerLocker locker = manager) { if (ManagerLocker locker = manager) {
if (KDiskDeviceJob *job = manager->FindJob(jobID)) { if (KDiskDeviceJob* job = manager->FindJob(jobID)) {
job->SetErrorMessage(message); job->SetErrorMessage(message);
return true; return true;
} }
@ -334,13 +335,13 @@ update_disk_device_job_interrupt_properties(disk_job_id jobID,
{ {
#if 0 #if 0
bool paused = false; bool paused = false;
KDiskDeviceManager *manager = KDiskDeviceManager::Default(); KDiskDeviceManager* manager = KDiskDeviceManager::Default();
do { do {
sem_id pauseSemaphore = -1; sem_id pauseSemaphore = -1;
if (ManagerLocker locker = manager) { if (ManagerLocker locker = manager) {
// get the job and the respective job queue // get the job and the respective job queue
if (KDiskDeviceJob *job = manager->FindJob(jobID)) { if (KDiskDeviceJob* job = manager->FindJob(jobID)) {
if (KDiskDeviceJobQueue *jobQueue = job->JobQueue()) { if (KDiskDeviceJobQueue* jobQueue = job->JobQueue()) {
// terminate if canceled. // terminate if canceled.
if (jobQueue->IsCanceled()) { if (jobQueue->IsCanceled()) {
if (jobQueue->ShallReverse()) if (jobQueue->ShallReverse())