Clean up various whitespace and fix one header guard.
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
#define CACHE_MODULES_NAME "file_cache"
|
#define CACHE_MODULES_NAME "file_cache"
|
||||||
|
|
||||||
#define FILE_CACHE_SEQUENTIAL_ACCESS 0x01
|
#define FILE_CACHE_SEQUENTIAL_ACCESS 0x01
|
||||||
#define FILE_CACHE_LOADED_COMPLETELY 0x02
|
#define FILE_CACHE_LOADED_COMPLETELY 0x02
|
||||||
#define FILE_CACHE_NO_IO 0x04
|
#define FILE_CACHE_NO_IO 0x04
|
||||||
|
|
||||||
struct cache_module_info {
|
struct cache_module_info {
|
||||||
|
|||||||
@@ -56,5 +56,5 @@ log2(uint32 v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // KERNEL_UTIL_RANDOM_H
|
#endif // KERNEL_UTIL_BITUTIL_H
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public:
|
|||||||
typedef const DataType* ConstPointer;
|
typedef const DataType* ConstPointer;
|
||||||
typedef DataType& Reference;
|
typedef DataType& Reference;
|
||||||
typedef const DataType& ConstReference;
|
typedef const DataType& ConstReference;
|
||||||
|
|
||||||
/*! Constructs the object pointed to by \a object via a
|
/*! Constructs the object pointed to by \a object via a
|
||||||
zero-parameter constructor.
|
zero-parameter constructor.
|
||||||
*/
|
*/
|
||||||
@@ -19,7 +19,7 @@ public:
|
|||||||
if (object)
|
if (object)
|
||||||
new(reinterpret_cast<void*>(object)) DataType();
|
new(reinterpret_cast<void*>(object)) DataType();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Constructs the object pointed to by \a object via a
|
/*! Constructs the object pointed to by \a object via a
|
||||||
one-parameter constructor using the given argument.
|
one-parameter constructor using the given argument.
|
||||||
*/
|
*/
|
||||||
@@ -29,7 +29,7 @@ public:
|
|||||||
if (object)
|
if (object)
|
||||||
new(reinterpret_cast<void*>(object)) DataType(arg1);
|
new(reinterpret_cast<void*>(object)) DataType(arg1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Constructs the object pointed to by \a object via a
|
/*! Constructs the object pointed to by \a object via a
|
||||||
two-parameter constructor using the given arguments.
|
two-parameter constructor using the given arguments.
|
||||||
*/
|
*/
|
||||||
@@ -39,7 +39,7 @@ public:
|
|||||||
if (object)
|
if (object)
|
||||||
new(reinterpret_cast<void*>(object)) DataType(arg1, arg2);
|
new(reinterpret_cast<void*>(object)) DataType(arg1, arg2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Constructs the object pointed to by \a object via a
|
/*! Constructs the object pointed to by \a object via a
|
||||||
three-parameter constructor using the given arguments.
|
three-parameter constructor using the given arguments.
|
||||||
*/
|
*/
|
||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
if (object)
|
if (object)
|
||||||
new(reinterpret_cast<void*>(object)) DataType(arg1, arg2, arg3);
|
new(reinterpret_cast<void*>(object)) DataType(arg1, arg2, arg3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Constructs the object pointed to by \a object via a
|
/*! Constructs the object pointed to by \a object via a
|
||||||
four-parameter constructor using the given arguments.
|
four-parameter constructor using the given arguments.
|
||||||
*/
|
*/
|
||||||
@@ -60,7 +60,7 @@ public:
|
|||||||
ArgType4 arg4) {
|
ArgType4 arg4) {
|
||||||
if (object)
|
if (object)
|
||||||
new(reinterpret_cast<void*>(object)) DataType(arg1, arg2, arg3, arg4);
|
new(reinterpret_cast<void*>(object)) DataType(arg1, arg2, arg3, arg4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Calls the destructor for the object pointed to be \a object.
|
/*! Calls the destructor for the object pointed to be \a object.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ public:
|
|||||||
typedef const DataType* ConstPointer;
|
typedef const DataType* ConstPointer;
|
||||||
typedef DataType& Reference;
|
typedef DataType& Reference;
|
||||||
typedef const DataType& ConstReference;
|
typedef const DataType& ConstReference;
|
||||||
|
|
||||||
/*! malloc()'s an object of type \c DataType and returns a
|
/*! malloc()'s an object of type \c DataType and returns a
|
||||||
pointer to it.
|
pointer to it.
|
||||||
*/
|
*/
|
||||||
Pointer Allocate() {
|
Pointer Allocate() {
|
||||||
return reinterpret_cast<Pointer>(malloc(sizeof(DataType)));
|
return reinterpret_cast<Pointer>(malloc(sizeof(DataType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! free()'s the given object.
|
/*! free()'s the given object.
|
||||||
*/
|
*/
|
||||||
void Deallocate(Pointer object) {
|
void Deallocate(Pointer object) {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ struct MallocAllocator {
|
|||||||
* stored in a linked list. The table may be made to adjust its number of slots
|
* stored in a linked list. The table may be made to adjust its number of slots
|
||||||
* depending on the load factor (this should be enabled unless the object is to
|
* depending on the load factor (this should be enabled unless the object is to
|
||||||
* be used at times where memory allocations aren't possible, such as code
|
* be used at times where memory allocations aren't possible, such as code
|
||||||
* called byt he memory allocator).
|
* called by the memory allocator).
|
||||||
*
|
*
|
||||||
* The link between entries is part of the ValueType stored items, which makes
|
* The link between entries is part of the ValueType stored items, which makes
|
||||||
* sure the table can always accept new items and will never fail because it is
|
* sure the table can always accept new items and will never fail because it is
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Remove from the tree.
|
Remove from the tree.
|
||||||
@@ -143,7 +143,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Find the smallest item in the tree.
|
Find the smallest item in the tree.
|
||||||
@@ -163,9 +163,9 @@ public:
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Find the largest item in the tree.
|
Find the largest item in the tree.
|
||||||
*/
|
*/
|
||||||
Node* FindMax()
|
Node* FindMax()
|
||||||
{
|
{
|
||||||
if (fRoot == NULL)
|
if (fRoot == NULL)
|
||||||
@@ -179,9 +179,9 @@ public:
|
|||||||
_Splay(Definition::GetKey(node));
|
_Splay(Definition::GetKey(node));
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Find an item in the tree.
|
Find an item in the tree.
|
||||||
*/
|
*/
|
||||||
Node* Lookup(const Key& key)
|
Node* Lookup(const Key& key)
|
||||||
@@ -192,14 +192,14 @@ public:
|
|||||||
_Splay(key);
|
_Splay(key);
|
||||||
|
|
||||||
return Definition::Compare(key, fRoot) == 0 ? fRoot : NULL;
|
return Definition::Compare(key, fRoot) == 0 ? fRoot : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node* Root() const
|
Node* Root() const
|
||||||
{
|
{
|
||||||
return fRoot;
|
return fRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Test if the tree is logically empty.
|
Test if the tree is logically empty.
|
||||||
\return true if empty, false otherwise.
|
\return true if empty, false otherwise.
|
||||||
*/
|
*/
|
||||||
@@ -267,16 +267,16 @@ private:
|
|||||||
|
|
||||||
_Splay(key) does the splay operation on the given key.
|
_Splay(key) does the splay operation on the given key.
|
||||||
If key is in the tree, then the node containing
|
If key is in the tree, then the node containing
|
||||||
that key becomes the root. If key is not in the tree,
|
that key becomes the root. If key is not in the tree,
|
||||||
then after the splay, key.root is either the greatest key
|
then after the splay, key.root is either the greatest key
|
||||||
< key in the tree, or the least key > key in the tree.
|
< key in the tree, or the least key > key in the tree.
|
||||||
|
|
||||||
This means, among other things, that if you splay with
|
This means, among other things, that if you splay with
|
||||||
a key that's larger than any in the tree, the rightmost
|
a key that's larger than any in the tree, the rightmost
|
||||||
node of the tree becomes the root. This property is used
|
node of the tree becomes the root. This property is used
|
||||||
in the Remove() method.
|
in the Remove() method.
|
||||||
*/
|
*/
|
||||||
void _Splay(const Key& key) {
|
void _Splay(const Key& key) {
|
||||||
Link headerLink;
|
Link headerLink;
|
||||||
headerLink.left = headerLink.right = NULL;
|
headerLink.left = headerLink.right = NULL;
|
||||||
|
|
||||||
@@ -554,7 +554,7 @@ public:
|
|||||||
return fTree.Root();
|
return fTree.Root();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Test if the tree is logically empty.
|
Test if the tree is logically empty.
|
||||||
\return true if empty, false otherwise.
|
\return true if empty, false otherwise.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ SEARCH_SOURCE += [ FDirName $(posixSources) unistd ] ;
|
|||||||
|
|
||||||
KernelMergeObject kernel_lib_posix.o :
|
KernelMergeObject kernel_lib_posix.o :
|
||||||
# main
|
# main
|
||||||
kernel_errno.cpp
|
kernel_errno.cpp
|
||||||
dirent.c
|
dirent.c
|
||||||
fcntl.cpp
|
fcntl.cpp
|
||||||
poll.c
|
poll.c
|
||||||
utime.c
|
utime.c
|
||||||
# locale
|
# locale
|
||||||
ctype.cpp
|
ctype.cpp
|
||||||
localeconv.cpp
|
localeconv.cpp
|
||||||
LocaleData.cpp
|
LocaleData.cpp
|
||||||
@@ -76,7 +76,7 @@ KernelMergeObject kernel_lib_posix.o :
|
|||||||
mkdir.c
|
mkdir.c
|
||||||
select.c
|
select.c
|
||||||
gettimeofday.c
|
gettimeofday.c
|
||||||
uio.c
|
uio.c
|
||||||
# time
|
# time
|
||||||
time.c
|
time.c
|
||||||
# unistd
|
# unistd
|
||||||
|
|||||||
Reference in New Issue
Block a user