Code style fixes.

This commit is contained in:
Alex Smith 2012-06-22 11:56:55 +01:00
parent 17e407e945
commit 6b87898af5
4 changed files with 21 additions and 17 deletions

View File

@ -30,23 +30,23 @@ public:
return (addr_t)fValue;
}
Type &operator*() const
Type& operator*() const
{
return *(Type *)*this;
}
Type *operator->() const
Type* operator->() const
{
return *this;
}
FixedWidthPointer &operator=(const FixedWidthPointer &p)
FixedWidthPointer& operator=(const FixedWidthPointer& p)
{
fValue = p.fValue;
return *this;
}
FixedWidthPointer &operator=(Type *p)
FixedWidthPointer& operator=(Type* p)
{
fValue = (addr_t)p;
return *this;
@ -69,6 +69,7 @@ public:
{
fValue = addr;
}
private:
uint64 fValue;
} _PACKED;
@ -80,13 +81,13 @@ class FixedWidthPointer<void> {
public:
operator void*() const
{
return (void *)(addr_t)fValue;
return (void*)(addr_t)fValue;
}
template<typename OtherType>
operator OtherType*() const
{
return (OtherType *)(addr_t)fValue;
return (OtherType*)(addr_t)fValue;
}
operator addr_t() const
@ -94,13 +95,13 @@ public:
return (addr_t)fValue;
}
FixedWidthPointer &operator=(const FixedWidthPointer &p)
FixedWidthPointer& operator=(const FixedWidthPointer& p)
{
fValue = p.fValue;
return *this;
}
FixedWidthPointer &operator=(void *p)
FixedWidthPointer& operator=(void* p)
{
fValue = (addr_t)p;
return *this;
@ -115,6 +116,7 @@ public:
{
fValue = addr;
}
private:
uint64 fValue;
} _PACKED;

View File

@ -261,8 +261,8 @@ find_free_physical_range(size_t size)
}
for (uint32 i = 0; i < gKernelArgs.num_physical_allocated_ranges; i++) {
void *address =
(void *)(addr_t)(gKernelArgs.physical_allocated_range[i].start
void *address
= (void *)(addr_t)(gKernelArgs.physical_allocated_range[i].start
+ gKernelArgs.physical_allocated_range[i].size);
if (!is_physical_allocated(address, size)
&& is_physical_memory(address, size))
@ -281,8 +281,9 @@ find_free_virtual_range(void *base, size_t size)
void *firstFound = NULL;
void *firstBaseFound = NULL;
for (uint32 i = 0; i < gKernelArgs.num_virtual_allocated_ranges; i++) {
void *address = (void *)(addr_t)(gKernelArgs.virtual_allocated_range[i].start
+ gKernelArgs.virtual_allocated_range[i].size);
void *address
= (void *)(addr_t)(gKernelArgs.virtual_allocated_range[i].start
+ gKernelArgs.virtual_allocated_range[i].size);
if (!is_virtual_allocated(address, size)) {
if (!base)
return address;

View File

@ -442,8 +442,8 @@ find_free_physical_range(size_t size)
}
for (uint32 i = 0; i < gKernelArgs.num_physical_allocated_ranges; i++) {
void *address =
(void *)(addr_t)(gKernelArgs.physical_allocated_range[i].start
void *address
= (void *)(addr_t)(gKernelArgs.physical_allocated_range[i].start
+ gKernelArgs.physical_allocated_range[i].size);
if (!is_physical_allocated(address, size)
&& is_physical_memory(address, size))
@ -462,8 +462,9 @@ find_free_virtual_range(void *base, size_t size)
void *firstFound = NULL;
void *firstBaseFound = NULL;
for (uint32 i = 0; i < gKernelArgs.num_virtual_allocated_ranges; i++) {
void *address = (void *)(addr_t)(gKernelArgs.virtual_allocated_range[i].start
+ gKernelArgs.virtual_allocated_range[i].size);
void *address
= (void *)(addr_t)(gKernelArgs.virtual_allocated_range[i].start
+ gKernelArgs.virtual_allocated_range[i].size);
if (!is_virtual_allocated(address, size)) {
if (!base)
return address;

View File

@ -320,7 +320,7 @@ DiskBootMethod::SortPartitions(KPartition** partitions, int32 count)
The boot code should then just try them one by one.
*/
static status_t
get_boot_partitions(KMessage &bootVolume, PartitionStack& partitions)
get_boot_partitions(KMessage& bootVolume, PartitionStack& partitions)
{
dprintf("get_boot_partitions(): boot volume message:\n");
bootVolume.Dump(&dprintf);