Patch by Bryce Groff: Style cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31907 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-07-29 13:15:12 +00:00
parent 53ef70a0df
commit 2ea893b2a0
3 changed files with 77 additions and 77 deletions
@@ -27,7 +27,7 @@ public:
partition_id PartitionId() const; partition_id PartitionId() const;
protected: protected:
const disk_device_data *fDevice; const disk_device_data* fDevice;
private: private:
partition_id fPartitionID; partition_id fPartitionID;
@@ -58,7 +58,7 @@ using std::nothrow;
#ifdef _BOOT_MODE #ifdef _BOOT_MODE
inline int32 inline int32
atomic_add(int32 *a, int32 num) atomic_add(int32* a, int32 num)
{ {
int32 oldA = *a; int32 oldA = *a;
*a += num; *a += num;
@@ -72,7 +72,7 @@ atomic_add(int32 *a, int32 num)
// get_type_for_content_type (for both pm_* and ep_*) // get_type_for_content_type (for both pm_* and ep_*)
static status_t static status_t
get_type_for_content_type(const char *contentType, char *type) get_type_for_content_type(const char* contentType, char* type)
{ {
TRACE(("intel: get_type_for_content_type(%s)\n", TRACE(("intel: get_type_for_content_type(%s)\n",
contentType)); contentType));
@@ -111,7 +111,7 @@ pm_std_ops(int32 op, ...)
// pm_identify_partition // pm_identify_partition
static float static float
pm_identify_partition(int fd, partition_data *partition, void **cookie) pm_identify_partition(int fd, partition_data* partition, void** cookie)
{ {
// check parameters // check parameters
if (fd < 0 || !partition || !cookie) if (fd < 0 || !partition || !cookie)
@@ -127,7 +127,7 @@ pm_identify_partition(int fd, partition_data *partition, void **cookie)
} }
// allocate a PartitionMap // allocate a PartitionMap
PartitionMapCookie *map = new(nothrow) PartitionMapCookie; PartitionMapCookie* map = new(nothrow) PartitionMapCookie;
if (!map) if (!map)
return -1; return -1;
@@ -176,7 +176,7 @@ pm_identify_partition(int fd, partition_data *partition, void **cookie)
// pm_scan_partition // pm_scan_partition
static status_t static status_t
pm_scan_partition(int fd, partition_data *partition, void *cookie) pm_scan_partition(int fd, partition_data* partition, void* cookie)
{ {
// check parameters // check parameters
if (fd < 0 || !partition || !cookie) if (fd < 0 || !partition || !cookie)
@@ -186,7 +186,7 @@ pm_scan_partition(int fd, partition_data *partition, void *cookie)
partition->id, partition->offset, partition->size, partition->id, partition->offset, partition->size,
partition->block_size)); partition->block_size));
PartitionMapCookie *map = (PartitionMapCookie*)cookie; PartitionMapCookie* map = (PartitionMapCookie*)cookie;
// fill in the partition_data structure // fill in the partition_data structure
partition->status = B_PARTITION_VALID; partition->status = B_PARTITION_VALID;
partition->flags |= B_PARTITION_PARTITIONING_SYSTEM; partition->flags |= B_PARTITION_PARTITIONING_SYSTEM;
@@ -199,9 +199,9 @@ pm_scan_partition(int fd, partition_data *partition, void *cookie)
status_t error = B_OK; status_t error = B_OK;
int32 index = 0; int32 index = 0;
for (int32 i = 0; i < 4; i++) { for (int32 i = 0; i < 4; i++) {
PrimaryPartition *primary = map->PrimaryPartitionAt(i); PrimaryPartition* primary = map->PrimaryPartitionAt(i);
if (!primary->IsEmpty()) { if (!primary->IsEmpty()) {
partition_data *child = create_child_partition(partition->id, partition_data* child = create_child_partition(partition->id,
index, partition->offset + primary->Offset(), primary->Size(), index, partition->offset + primary->Offset(), primary->Size(),
-1); -1);
index++; index++;
@@ -237,7 +237,7 @@ pm_scan_partition(int fd, partition_data *partition, void *cookie)
} else { } else {
partition->content_cookie = NULL; partition->content_cookie = NULL;
for (int32 i = 0; i < partition->child_count; i++) { for (int32 i = 0; i < partition->child_count; i++) {
if (partition_data *child = get_child_partition(partition->id, i)) if (partition_data* child = get_child_partition(partition->id, i))
child->cookie = NULL; child->cookie = NULL;
} }
} }
@@ -248,10 +248,10 @@ pm_scan_partition(int fd, partition_data *partition, void *cookie)
// pm_free_identify_partition_cookie // pm_free_identify_partition_cookie
static void static void
pm_free_identify_partition_cookie(partition_data */*partition*/, void *cookie) pm_free_identify_partition_cookie(partition_data*/* partition*/, void* cookie)
{ {
if (cookie) { if (cookie) {
PartitionMapCookie *map = (PartitionMapCookie*)cookie; PartitionMapCookie* map = (PartitionMapCookie*)cookie;
if (atomic_add(&map->ref_count, -1) == 1) if (atomic_add(&map->ref_count, -1) == 1)
delete map; delete map;
} }
@@ -260,7 +260,7 @@ pm_free_identify_partition_cookie(partition_data */*partition*/, void *cookie)
// pm_free_partition_cookie // pm_free_partition_cookie
static void static void
pm_free_partition_cookie(partition_data *partition) pm_free_partition_cookie(partition_data* partition)
{ {
// called for the primary partitions: the PrimaryPartition is allocated // called for the primary partitions: the PrimaryPartition is allocated
// by the partition containing the partition map // by the partition containing the partition map
@@ -271,7 +271,7 @@ pm_free_partition_cookie(partition_data *partition)
// pm_free_partition_content_cookie // pm_free_partition_content_cookie
static void static void
pm_free_partition_content_cookie(partition_data *partition) pm_free_partition_content_cookie(partition_data* partition)
{ {
if (partition && partition->content_cookie) { if (partition && partition->content_cookie) {
pm_free_identify_partition_cookie(partition, partition->content_cookie); pm_free_identify_partition_cookie(partition, partition->content_cookie);
@@ -299,7 +299,7 @@ ep_std_ops(int32 op, ...)
// ep_identify_partition // ep_identify_partition
static float static float
ep_identify_partition(int fd, partition_data *partition, void **cookie) ep_identify_partition(int fd, partition_data* partition, void** cookie)
{ {
// check parameters // check parameters
if (fd < 0 || !partition || !cookie || !partition->cookie) if (fd < 0 || !partition || !cookie || !partition->cookie)
@@ -314,7 +314,7 @@ ep_identify_partition(int fd, partition_data *partition, void **cookie)
|| strcmp(partition->type, kPartitionTypeIntelExtended)) { || strcmp(partition->type, kPartitionTypeIntelExtended)) {
return -1; return -1;
} }
partition_data *parent = get_parent_partition(partition->id); partition_data* parent = get_parent_partition(partition->id);
if (!parent || !parent->content_type if (!parent || !parent->content_type
|| strcmp(parent->content_type, kPartitionTypeIntel)) { || strcmp(parent->content_type, kPartitionTypeIntel)) {
return -1; return -1;
@@ -327,7 +327,7 @@ ep_identify_partition(int fd, partition_data *partition, void **cookie)
// ep_scan_partition // ep_scan_partition
static status_t static status_t
ep_scan_partition(int fd, partition_data *partition, void *cookie) ep_scan_partition(int fd, partition_data* partition, void* cookie)
{ {
// check parameters // check parameters
if (fd < 0 || !partition || !partition->cookie) if (fd < 0 || !partition || !partition->cookie)
@@ -336,10 +336,10 @@ ep_scan_partition(int fd, partition_data *partition, void *cookie)
TRACE(("intel: ep_scan_partition(%d, %lld, %lld, %ld)\n", fd, TRACE(("intel: ep_scan_partition(%d, %lld, %lld, %ld)\n", fd,
partition->offset, partition->size, partition->block_size)); partition->offset, partition->size, partition->block_size));
partition_data *parent = get_parent_partition(partition->id); partition_data* parent = get_parent_partition(partition->id);
if (!parent) if (!parent)
return B_ERROR; return B_ERROR;
PrimaryPartition *primary = (PrimaryPartition*)partition->cookie; PrimaryPartition* primary = (PrimaryPartition*)partition->cookie;
// fill in the partition_data structure // fill in the partition_data structure
partition->status = B_PARTITION_VALID; partition->status = B_PARTITION_VALID;
partition->flags |= B_PARTITION_PARTITIONING_SYSTEM; partition->flags |= B_PARTITION_PARTITIONING_SYSTEM;
@@ -352,8 +352,8 @@ ep_scan_partition(int fd, partition_data *partition, void *cookie)
status_t error = B_OK; status_t error = B_OK;
int32 index = 0; int32 index = 0;
for (int32 i = 0; i < primary->CountLogicalPartitions(); i++) { for (int32 i = 0; i < primary->CountLogicalPartitions(); i++) {
LogicalPartition *logical = primary->LogicalPartitionAt(i); LogicalPartition* logical = primary->LogicalPartitionAt(i);
partition_data *child = create_child_partition(partition->id, index, partition_data* child = create_child_partition(partition->id, index,
parent->offset + logical->Offset(), logical->Size(), -1); parent->offset + logical->Offset(), logical->Size(), -1);
index++; index++;
if (!child) { if (!child) {
@@ -389,7 +389,7 @@ ep_scan_partition(int fd, partition_data *partition, void *cookie)
if (error != B_OK) { if (error != B_OK) {
partition->content_cookie = NULL; partition->content_cookie = NULL;
for (int32 i = 0; i < partition->child_count; i++) { for (int32 i = 0; i < partition->child_count; i++) {
if (partition_data *child = get_child_partition(partition->id, i)) if (partition_data* child = get_child_partition(partition->id, i))
child->cookie = NULL; child->cookie = NULL;
} }
} }
@@ -399,7 +399,7 @@ ep_scan_partition(int fd, partition_data *partition, void *cookie)
// ep_free_identify_partition_cookie // ep_free_identify_partition_cookie
static void static void
ep_free_identify_partition_cookie(partition_data *partition, void *cookie) ep_free_identify_partition_cookie(partition_data* partition, void* cookie)
{ {
// nothing to do // nothing to do
} }
@@ -407,7 +407,7 @@ ep_free_identify_partition_cookie(partition_data *partition, void *cookie)
// ep_free_partition_cookie // ep_free_partition_cookie
static void static void
ep_free_partition_cookie(partition_data *partition) ep_free_partition_cookie(partition_data* partition)
{ {
// the logical partition's cookie belongs to the partition map partition // the logical partition's cookie belongs to the partition map partition
if (partition) if (partition)
@@ -417,7 +417,7 @@ ep_free_partition_cookie(partition_data *partition)
// ep_free_partition_content_cookie // ep_free_partition_content_cookie
static void static void
ep_free_partition_content_cookie(partition_data *partition) ep_free_partition_content_cookie(partition_data* partition)
{ {
// the extended partition's cookie belongs to the partition map partition // the extended partition's cookie belongs to the partition map partition
if (partition) if (partition)
@@ -603,8 +603,8 @@ static partition_module_info intel_extended_partition_module =
#ifndef _BOOT_MODE #ifndef _BOOT_MODE
extern "C" partition_module_info *modules[]; extern "C" partition_module_info* modules[];
_EXPORT partition_module_info *modules[] = _EXPORT partition_module_info* modules[] =
{ {
&intel_partition_map_module, &intel_partition_map_module,
&intel_extended_partition_module, &intel_extended_partition_module,
@@ -13,27 +13,27 @@ uint32 pm_get_supported_operations(partition_data* partition,
uint32 mask = ~0); uint32 mask = ~0);
uint32 pm_get_supported_child_operations(partition_data* partition, uint32 pm_get_supported_child_operations(partition_data* partition,
partition_data* child, uint32 mask = ~0); partition_data* child, uint32 mask = ~0);
bool pm_is_sub_system_for(partition_data *partition); bool pm_is_sub_system_for(partition_data* partition);
bool pm_validate_resize(partition_data *partition, off_t *size); bool pm_validate_resize(partition_data* partition, off_t* size);
bool pm_validate_resize_child(partition_data *partition, bool pm_validate_resize_child(partition_data* partition,
partition_data *child, off_t *size); partition_data* child, off_t* size);
bool pm_validate_move(partition_data *partition, off_t *start); bool pm_validate_move(partition_data* partition, off_t* start);
bool pm_validate_move_child(partition_data *partition, bool pm_validate_move_child(partition_data* partition,
partition_data *child, off_t *start); partition_data* child, off_t* start);
bool pm_validate_set_type(partition_data *partition, const char *type); bool pm_validate_set_type(partition_data* partition, const char* type);
bool pm_validate_initialize(partition_data *partition, char *name, bool pm_validate_initialize(partition_data* partition, char* name,
const char *parameters); const char* parameters);
bool pm_validate_create_child(partition_data *partition, off_t *start, bool pm_validate_create_child(partition_data* partition, off_t* start,
off_t *size, const char *type, const char *name, off_t* size, const char* type, const char* name,
const char *parameters, int32 *index); const char* parameters, int32* index);
status_t pm_get_partitionable_spaces(partition_data *partition, status_t pm_get_partitionable_spaces(partition_data* partition,
partitionable_space_data *buffer, int32 count, partitionable_space_data* buffer, int32 count,
int32 *actualCount); int32* actualCount);
status_t pm_get_next_supported_type(partition_data *partition, int32 *cookie, status_t pm_get_next_supported_type(partition_data* partition,
char *_type); int32* cookie, char* _type);
status_t pm_shadow_changed(partition_data *partition, partition_data *child, status_t pm_shadow_changed(partition_data* partition, partition_data* child,
uint32 operation); uint32 operation);
status_t pm_resize(int fd, partition_id partitionID, off_t size, status_t pm_resize(int fd, partition_id partitionID, off_t size,
@@ -44,14 +44,14 @@ status_t pm_move(int fd, partition_id partitionID, off_t offset,
disk_job_id job); disk_job_id job);
status_t pm_move_child(int fd, partition_id partitionID, status_t pm_move_child(int fd, partition_id partitionID,
partition_id childID, off_t offset, disk_job_id job); partition_id childID, off_t offset, disk_job_id job);
status_t pm_set_type(int fd, partition_id partitionID, const char *type, status_t pm_set_type(int fd, partition_id partitionID, const char* type,
disk_job_id job); disk_job_id job);
status_t pm_initialize(int fd, partition_id partitionID, const char *name, status_t pm_initialize(int fd, partition_id partitionID, const char* name,
const char *parameters, off_t partitionSize, disk_job_id job); const char* parameters, off_t partitionSize, disk_job_id job);
status_t pm_create_child(int fd, partition_id partitionID, off_t offset, status_t pm_create_child(int fd, partition_id partitionID, off_t offset,
off_t size, const char *type, const char *name, off_t size, const char* type, const char* name,
const char *parameters, disk_job_id job, const char* parameters, disk_job_id job,
partition_id *childID); partition_id* childID);
status_t pm_delete_child(int fd, partition_id partitionID, status_t pm_delete_child(int fd, partition_id partitionID,
partition_id childID, disk_job_id job); partition_id childID, disk_job_id job);
@@ -60,26 +60,26 @@ uint32 ep_get_supported_operations(partition_data* partition,
uint32 mask = ~0); uint32 mask = ~0);
uint32 ep_get_supported_child_operations(partition_data* partition, uint32 ep_get_supported_child_operations(partition_data* partition,
partition_data* child, uint32 mask = ~0); partition_data* child, uint32 mask = ~0);
bool ep_is_sub_system_for(partition_data *partition); bool ep_is_sub_system_for(partition_data* partition);
bool ep_validate_resize(partition_data *partition, off_t *size); bool ep_validate_resize(partition_data* partition, off_t* size);
bool ep_validate_resize_child(partition_data *partition, bool ep_validate_resize_child(partition_data* partition,
partition_data *child, off_t *_size); partition_data* child, off_t* _size);
bool ep_validate_move(partition_data *partition, off_t *start); bool ep_validate_move(partition_data* partition, off_t* start);
bool ep_validate_move_child(partition_data *partition, bool ep_validate_move_child(partition_data* partition,
partition_data *child, off_t *_start); partition_data* child, off_t* _start);
bool ep_validate_set_type(partition_data *partition, const char *type); bool ep_validate_set_type(partition_data* partition, const char* type);
bool ep_validate_initialize(partition_data *partition, char *name, bool ep_validate_initialize(partition_data* partition, char* name,
const char *parameters); const char* parameters);
bool ep_validate_create_child(partition_data *partition, off_t *_start, bool ep_validate_create_child(partition_data* partition, off_t* _start,
off_t *_size, const char *type, const char* name, off_t* _size, const char* type, const char* name,
const char *parameters, int32 *index); const char* parameters, int32* index);
status_t ep_get_partitionable_spaces(partition_data *partition, status_t ep_get_partitionable_spaces(partition_data* partition,
partitionable_space_data *buffer, int32 count, partitionable_space_data* buffer, int32 count,
int32 *actualCount); int32* actualCount);
status_t ep_get_next_supported_type(partition_data *partition, int32 *cookie, status_t ep_get_next_supported_type(partition_data* partition,
char *_type); int32* cookie, char* _type);
status_t ep_shadow_changed(partition_data *partition, partition_data *child, status_t ep_shadow_changed(partition_data* partition, partition_data* child,
uint32 operation); uint32 operation);
status_t ep_resize(int fd, partition_id partitionID, off_t size, status_t ep_resize(int fd, partition_id partitionID, off_t size,
@@ -90,14 +90,14 @@ status_t ep_move(int fd, partition_id partitionID, off_t offset,
disk_job_id job); disk_job_id job);
status_t ep_move_child(int fd, partition_id partitionID, status_t ep_move_child(int fd, partition_id partitionID,
partition_id childID, off_t offset, disk_job_id job); partition_id childID, off_t offset, disk_job_id job);
status_t ep_set_type(int fd, partition_id partitionID, const char *type, status_t ep_set_type(int fd, partition_id partitionID, const char* type,
disk_job_id job); disk_job_id job);
status_t ep_initialize(int fd, partition_id partitionID, const char *name, status_t ep_initialize(int fd, partition_id partitionID, const char* name,
const char *parameters, off_t partitionSize, disk_job_id job); const char* parameters, off_t partitionSize, disk_job_id job);
status_t ep_create_child(int fd, partition_id partitionID, off_t offset, status_t ep_create_child(int fd, partition_id partitionID, off_t offset,
off_t size, const char *type, const char *name, off_t size, const char* type, const char* name,
const char *parameters, disk_job_id job, const char* parameters, disk_job_id job,
partition_id *childID); partition_id* childID);
status_t ep_delete_child(int fd, partition_id partitionID, status_t ep_delete_child(int fd, partition_id partitionID,
partition_id childID, disk_job_id job); partition_id childID, disk_job_id job);