(svn r18204) -Codechange: introduce a type for Ticks and use it; furthermore document some related variables/functions

This commit is contained in:
rubidium
2009-11-21 12:43:09 +00:00
parent 860cb82920
commit 2e506b04aa
5 changed files with 30 additions and 19 deletions

View File

@@ -50,12 +50,13 @@ enum {
* be encoded in a single 32 bits date, about 2^31 / 366 years. */
#define MAX_YEAR 5000000
typedef int32 Date;
typedef uint16 DateFract;
typedef int32 Date; ///< The type to store our dates in
typedef uint16 DateFract; ///< The fraction of a date we're in, i.e. the number of ticks since the last date changeover
typedef int32 Ticks; ///< The type to store ticks in
typedef int32 Year;
typedef uint8 Month;
typedef uint8 Day;
typedef int32 Year; ///< Type for the year, note: 0 based, i.e. starts at the year 0.
typedef uint8 Month; ///< Type for the month, note: 0 based, i.e. 0 = January, 11 = December.
typedef uint8 Day; ///< Type for the day of the month, note: 1 based, first day of a month is 1.
/**
* Data structure to convert between Date and triplet (year, month, and day).
@@ -67,7 +68,8 @@ struct YearMonthDay {
Day day; ///< Day (1..31)
};
static const Year INVALID_YEAR = -1;
static const Date INVALID_DATE = -1;
static const Year INVALID_YEAR = -1; ///< Representation of an invalid year
static const Date INVALID_DATE = -1; ///< Representation of an invalid date
static const Ticks INVALID_TICKS = -1; ///< Representation of an invalid number of ticks
#endif /* DATE_TYPE_H */