/* gregorian calendar date */
struct calendar {
- u_short year; /* year (A.D.) */
- u_short yearday; /* day of year, 1 = January 1 */
- u_char month; /* month, 1 = January */
- u_char monthday; /* day of month */
- u_char hour; /* hour of day, midnight = 0 */
- u_char minute; /* minute of hour */
- u_char second; /* second of minute */
- u_char weekday; /* 0..7, 0=Sunday */
+ uint16_t year; /* year (A.D.) */
+ uint16_t yearday; /* day of year, 1 = January 1 */
+ uint8_t month; /* month, 1 = January */
+ uint8_t monthday; /* day of month */
+ uint8_t hour; /* hour of day, midnight = 0 */
+ uint8_t minute; /* minute of hour */
+ uint8_t second; /* second of minute */
+ uint8_t weekday; /* 0..7, 0=Sunday */
};
/* ISO week calendar date */
struct isodate {
- u_short year; /* year (A.D.) */
- u_char week; /* 1..53, week in year */
- u_char weekday; /* 1..7, 1=Monday */
- u_char hour; /* hour of day, midnight = 0 */
- u_char minute; /* minute of hour */
- u_char second; /* second of minute */
+ uint16_t year; /* year (A.D.) */
+ uint8_t week; /* 1..53, week in year */
+ uint8_t weekday; /* 1..7, 1=Monday */
+ uint8_t hour; /* hour of day, midnight = 0 */
+ uint8_t minute; /* minute of hour */
+ uint8_t second; /* second of minute */
};
/* general split representation */
/*
* ntp_types.h - defines how int32 and u_int32 are treated.
+ *
+ * New style: Make sure C99 fixed width integer types are available:
+ * intN_t and uintN_t
+
+ * Old style: defines how int32 and u_int32 are treated.
* For 64 bit systems like the DEC Alpha, they have to be defined
* as int and u_int.
* For 32 bit systems, define them as long and u_long
typedef union {
# ifdef WORDS_BIGENDIAN
struct {
- short hh; u_short hl; u_short lh; u_short ll;
+ int16_t hh; uint16_t hl; uint16_t lh; uint16_t ll;
} w_s;
struct {
- u_short hh; u_short hl; u_short lh; u_short ll;
+ uint16_t hh; uint16_t hl; uint16_t lh; uint16_t ll;
} W_s;
struct {
int32 hi; u_int32 lo;
} D_s;
# else
struct {
- u_short ll; u_short lh; u_short hl; short hh;
+ uint16_t ll; uint16_t lh; uint16_t hl; int16_t hh;
} w_s;
struct {
- u_short ll; u_short lh; u_short hl; u_short hh;
+ uint16_t ll; uint16_t lh; uint16_t hl; uint16_t hh;
} W_s;
struct {
u_int32 lo; int32 hi;
} vint64; /* variant int 64 */
-typedef u_char ntp_u_int8_t;
-typedef u_short ntp_u_int16_t;
-typedef u_int32 ntp_u_int32_t;
+typedef uint8_t ntp_u_int8_t;
+typedef uint16_t ntp_u_int16_t;
+typedef uint32_t ntp_u_int32_t;
typedef struct ntp_uint64_t { u_int32 val[2]; } ntp_uint64_t;
-typedef u_short associd_t; /* association ID */
+typedef uint16_t associd_t; /* association ID */
#define ASSOCID_MAX USHRT_MAX
typedef u_int32 keyid_t; /* cryptographic key ID */
#define KEYID_T_MAX (0xffffffff)