summaryrefslogtreecommitdiff
path: root/src/sortlist_type.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-06-01 15:01:54 +0000
committerfrosch <frosch@openttd.org>2009-06-01 15:01:54 +0000
commit0d782b0f96f01e7d9ac02120b8e5ca84fe9bc9f2 (patch)
tree9247ff8c6b63c62820520758d14a26b3a47f973e /src/sortlist_type.h
parentda57fe63f348a1f4628b9f17df171f4c54f0d2e7 (diff)
downloadopenttd-0d782b0f96f01e7d9ac02120b8e5ca84fe9bc9f2.tar.xz
(svn r16498) -Codechange: Remove hardly used HASBITS.
Diffstat (limited to 'src/sortlist_type.h')
-rw-r--r--src/sortlist_type.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/sortlist_type.h b/src/sortlist_type.h
index 29c7cc4c3..101d11152 100644
--- a/src/sortlist_type.h
+++ b/src/sortlist_type.h
@@ -106,7 +106,7 @@ public:
Listing GetListing() const
{
Listing l;
- l.order = HASBITS(this->flags, VL_DESC);
+ l.order = (this->flags & VL_DESC) != 0;
l.criteria = this->sort_type;
return l;
@@ -159,7 +159,7 @@ public:
Filtering GetFiltering() const
{
Filtering f;
- f.state = HASBITS(this->flags, VL_FILTER);
+ f.state = (this->flags & VL_FILTER) != 0;
f.criteria = this->filter_type;
return f;
@@ -214,7 +214,7 @@ public:
*/
bool IsDescSortOrder() const
{
- return HASBITS(this->flags, VL_DESC);
+ return (this->flags & VL_DESC) != 0;
}
/**
@@ -241,7 +241,7 @@ public:
bool Sort(SortFunction *compare)
{
/* Do not sort if the resort bit is not set */
- if (!HASBITS(this->flags, VL_RESORT)) return false;
+ if (!(this->flags & VL_RESORT)) return false;
CLRBITS(this->flags, VL_RESORT);
@@ -250,9 +250,9 @@ public:
/* Do not sort when the list is not sortable */
if (!this->IsSortable()) return false;
- const bool desc = HASBITS(this->flags, VL_DESC);
+ const bool desc = (this->flags & VL_DESC) != 0;
- if (HASBITS(this->flags, VL_FIRST_SORT)) {
+ if (this->flags & VL_FIRST_SORT) {
CLRBITS(this->flags, VL_FIRST_SORT);
QSortT(this->data, this->items, compare, desc);
@@ -292,7 +292,7 @@ public:
*/
bool IsFilterEnabled() const
{
- return HASBITS(this->flags, VL_FILTER);
+ return (this->flags & VL_FILTER) != 0;
}
/**
@@ -319,7 +319,7 @@ public:
bool Filter(FilterFunction *decide, F filter_data)
{
/* Do not filter if the filter bit is not set */
- if (!HASBITS(this->flags, VL_FILTER)) return false;
+ if (!(this->flags & VL_FILTER)) return false;
bool changed = false;
for (uint iter = 0; iter < this->items;) {
@@ -363,7 +363,7 @@ public:
*/
bool NeedRebuild() const
{
- return HASBITS(this->flags, VL_REBUILD);
+ return (this->flags & VL_REBUILD) != 0;
}
/**