changeset 13245:507592717f3a draft

(svn r17754) -Codechange: Make ExpensesList::GetHeight() return a uint.
author alberth <alberth@openttd.org>
date Sat, 10 Oct 2009 13:32:44 +0000
parents ef86ddf0e0a9
children 6ed0d462f914
files src/company_gui.cpp
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -82,15 +82,15 @@
 
 /** 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 @@
 	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 @@
 	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 @@
 			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);