summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-10-10 13:32:44 +0000
committeralberth <alberth@openttd.org>2009-10-10 13:32:44 +0000
commit402d0d05c920f6066d7052f1222d04dad651fcb1 (patch)
tree08e92c9674a0c9b94ce30da7b6f0fb14756de7ce
parent2e2f3b1502ed5a0ea0339a047800a43e4f096f98 (diff)
downloadopenttd-402d0d05c920f6066d7052f1222d04dad651fcb1.tar.xz
(svn r17754) -Codechange: Make ExpensesList::GetHeight() return a uint.
-rw-r--r--src/company_gui.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index f907115fc..9e77ac61b 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -82,15 +82,15 @@ static ExpensesType _expenses_list_2[] = {
/** Expense list container. */
struct ExpensesList {
- const ExpensesType *et; ///< Expenses items.
- const int length; ///< Number of items in list.
- const int num_subtotals; ///< Number of sub-totals in the list.
+ const ExpensesType *et; ///< Expenses items.
+ const uint length; ///< Number of items in list.
+ const uint num_subtotals; ///< Number of sub-totals in the list.
ExpensesList(ExpensesType *et, int length, int num_subtotals) : et(et), length(length), num_subtotals(num_subtotals)
{
}
- int GetHeight() const
+ uint GetHeight() const
{
/* top spacing + heading + line + texts of expenses + sub-totals + total line + total text + bottom spacing. */
return WD_FRAMERECT_TOP + FONT_HEIGHT_NORMAL + EXP_LINESPACE +
@@ -134,7 +134,7 @@ static int DrawCategories(const Rect &r)
y += FONT_HEIGHT_NORMAL + EXP_LINESPACE;
int type = _settings_client.gui.expenses_layout;
- for (int i = 0; i < _expenses_list_types[type].length; i++) {
+ for (uint i = 0; i < _expenses_list_types[type].length; i++) {
const ExpensesType et = _expenses_list_types[type].et[i];
if (et == INVALID_EXPENSES) {
y += EXP_LINESPACE;
@@ -184,7 +184,7 @@ static void DrawYearColumn(const Rect &r, int year, const Money (*tbl)[EXPENSES_
Money sum = 0;
Money subtotal = 0;
int type = _settings_client.gui.expenses_layout;
- for (int i = 0; i < _expenses_list_types[type].length; i++) {
+ for (uint i = 0; i < _expenses_list_types[type].length; i++) {
const ExpensesType et = _expenses_list_types[type].et[i];
if (et == INVALID_EXPENSES) {
Money cost = subtotal;
@@ -387,7 +387,7 @@ struct CompanyFinancesWindow : Window {
if (this->widget[CFW_EXPS_PANEL].bottom < this->widget[CFW_EXPS_PANEL].top) {
this->widget[CFW_EXPS_PANEL].bottom = this->widget[CFW_EXPS_PANEL].top;
}
- int height = this->widget[CFW_EXPS_PANEL].bottom - this->widget[CFW_EXPS_PANEL].top + 1;
+ uint height = this->widget[CFW_EXPS_PANEL].bottom - this->widget[CFW_EXPS_PANEL].top + 1;
if (_expenses_list_types[type].GetHeight() != height) {
this->SetDirty();
ResizeWindowForWidget(this, CFW_EXPS_PANEL, 0, _expenses_list_types[type].GetHeight() - height);