summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2006-08-15 16:55:40 +0000
committerrubidium <rubidium@openttd.org>2006-08-15 16:55:40 +0000
commita0b4a29a575b3bf8e3a7573924fa917603d26abc (patch)
tree01a9595835d95746ba82d0ce12e16c393bd99f4e
parent1cc6e186f06f98c76b43f94a787abaec7f024cd7 (diff)
downloadopenttd-a0b4a29a575b3bf8e3a7573924fa917603d26abc.tar.xz
(svn r5919) -Cleanup: use the type Date when the variable really is a date
-rw-r--r--engine.h6
-rw-r--r--network.h6
-rw-r--r--news.h2
-rw-r--r--player.h2
-rw-r--r--station.h2
-rw-r--r--strings.c12
-rw-r--r--vehicle.h4
-rw-r--r--waypoint.h2
8 files changed, 18 insertions, 18 deletions
diff --git a/engine.h b/engine.h
index ba58d9567..c62c1900a 100644
--- a/engine.h
+++ b/engine.h
@@ -74,7 +74,7 @@ typedef struct RoadVehicleInfo {
* @see table/engines.h
*/
typedef struct EngineInfo {
- uint16 base_intro;
+ Date base_intro;
byte unk2; ///< Carriages have the highest bit set in this one
byte lifelength;
byte base_life;
@@ -87,8 +87,8 @@ typedef struct EngineInfo {
} EngineInfo;
typedef struct Engine {
- uint16 intro_date;
- uint16 age;
+ Date intro_date;
+ Date age;
uint16 reliability;
uint16 reliability_spd_dec;
uint16 reliability_start, reliability_max, reliability_final;
diff --git a/network.h b/network.h
index 5a564107b..150cbf16e 100644
--- a/network.h
+++ b/network.h
@@ -76,8 +76,8 @@ typedef struct NetworkGameInfo {
byte companies_on; // How many started companies do we have (XXX - disabled for server atm, use ActivePlayerCount())
byte spectators_max; // Max spectators allowed on server
byte spectators_on; // How many spectators do we have? (XXX - disabled for server atm, use NetworkSpectatorCount())
- uint16 game_date; // Current date
- uint16 start_date; // When the game started
+ Date game_date; // Current date
+ Date start_date; // When the game started
char map_name[NETWORK_NAME_LENGTH]; // Map which is played ["random" for a randomized map]
uint16 map_width; // Map width
uint16 map_height; // Map height
@@ -107,7 +107,7 @@ typedef struct NetworkClientInfo {
byte client_lang; /// The language of the client
byte client_playas; /// As which player is this client playing (PlayerID)
uint32 client_ip; /// IP-address of the client (so he can be banned)
- uint16 join_date; /// Gamedate the player has joined
+ Date join_date; /// Gamedate the player has joined
char unique_id[NETWORK_NAME_LENGTH]; /// Every play sends an unique id so we can indentify him
} NetworkClientInfo;
diff --git a/news.h b/news.h
index 26cfa107e..17f89a2c8 100644
--- a/news.h
+++ b/news.h
@@ -6,7 +6,7 @@
struct NewsItem {
StringID string_id;
uint16 duration;
- uint16 date;
+ Date date;
byte flags;
byte display_mode;
byte type;
diff --git a/player.h b/player.h
index 9739d6179..8dcbbd6b8 100644
--- a/player.h
+++ b/player.h
@@ -118,7 +118,7 @@ typedef struct PlayerAiNew {
byte action;
int last_id; // here is stored the last id of the searched city/industry
- uint last_vehiclecheck_date; // Used in CheckVehicle
+ Date last_vehiclecheck_date; // Used in CheckVehicle
Ai_SpecialVehicle special_vehicles[AI_MAX_SPECIAL_VEHICLES]; // Some vehicles have some special flags
TileIndex from_tile;
diff --git a/station.h b/station.h
index 805a57369..96b64cd4e 100644
--- a/station.h
+++ b/station.h
@@ -76,7 +76,7 @@ struct Station {
uint8 num_specs;
StationSpecList *speclist;
- uint16 build_date;
+ Date build_date;
//uint16 airport_flags;
uint32 airport_flags;
diff --git a/strings.c b/strings.c
index e93e846d0..f8324ef7f 100644
--- a/strings.c
+++ b/strings.c
@@ -326,12 +326,12 @@ static char *FormatNoCommaNumber(char *buff, int32 number)
}
-static char *FormatYmdString(char *buff, uint16 number)
+static char *FormatYmdString(char *buff, Date date)
{
const char *src;
YearMonthDay ymd;
- ConvertDateToYMD(number, &ymd);
+ ConvertDateToYMD(date, &ymd);
for (src = GetStringPtr(ymd.day + STR_01AC_1ST - 1); (*buff++ = *src++) != '\0';) {}
buff[-1] = ' ';
@@ -342,12 +342,12 @@ static char *FormatYmdString(char *buff, uint16 number)
return FormatNoCommaNumber(buff, BASE_YEAR + ymd.year);
}
-static char *FormatMonthAndYear(char *buff, uint16 number)
+static char *FormatMonthAndYear(char *buff, Date date)
{
const char *src;
YearMonthDay ymd;
- ConvertDateToYMD(number, &ymd);
+ ConvertDateToYMD(date, &ymd);
for (src = GetStringPtr(STR_MONTH_JAN + ymd.month); (*buff++ = *src++) != '\0';) {}
buff[-1] = ' ';
@@ -355,11 +355,11 @@ static char *FormatMonthAndYear(char *buff, uint16 number)
return FormatNoCommaNumber(buff, BASE_YEAR + ymd.year);
}
-static char *FormatTinyDate(char *buff, uint16 number)
+static char *FormatTinyDate(char *buff, Date date)
{
YearMonthDay ymd;
- ConvertDateToYMD(number, &ymd);
+ ConvertDateToYMD(date, &ymd);
buff += sprintf(buff, " %02i-%02i-%04i", ymd.day, ymd.month + 1, BASE_YEAR + ymd.year);
return buff;
diff --git a/vehicle.h b/vehicle.h
index f9279fc1e..26750e35f 100644
--- a/vehicle.h
+++ b/vehicle.h
@@ -210,8 +210,8 @@ struct Vehicle {
// Related to age and service time
uint16 age; // Age in days
uint16 max_age; // Maximum age
- uint16 date_of_last_service;
- uint16 service_interval;
+ Date date_of_last_service;
+ Date service_interval;
uint16 reliability;
uint16 reliability_spd_dec;
byte breakdown_ctr;
diff --git a/waypoint.h b/waypoint.h
index 207b46027..aa3cf8cf8 100644
--- a/waypoint.h
+++ b/waypoint.h
@@ -15,7 +15,7 @@ struct Waypoint {
StringID string; ///< If this is zero (i.e. no custom name), town + town_cn is used for naming
ViewportSign sign; ///< Dimensions of sign (not saved)
- uint16 build_date; ///< Date of construction
+ Date build_date; ///< Date of construction
byte stat_id; ///< ID of waypoint within the waypoint class (not saved)
uint32 grfid; ///< ID of GRF file