diff options
author | Ian Lepore <ian@FreeBSD.org> | 2018-02-06 22:17:01 +0000 |
---|---|---|
committer | Ian Lepore <ian@FreeBSD.org> | 2018-02-06 22:17:01 +0000 |
commit | ce75945d3cc13f2c9e5bf10e1500fc9934b364f7 (patch) | |
tree | 2f1bdf4646a4e115b6fee208dd3beb35fb5c3463 /sys/sys | |
parent | d2be4a1e4f0607c35964b20a873ddaeb234d6d17 (diff) | |
download | src-ce75945d3cc13f2c9e5bf10e1500fc9934b364f7.tar.gz src-ce75945d3cc13f2c9e5bf10e1500fc9934b364f7.zip |
Use const pointers for input data not modified by clock utility functions.
Notes
Notes:
svn path=/head/; revision=328956
Diffstat (limited to 'sys/sys')
-rw-r--r-- | sys/sys/clock.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/sys/clock.h b/sys/sys/clock.h index 1a59950761c9..cb7503497c57 100644 --- a/sys/sys/clock.h +++ b/sys/sys/clock.h @@ -88,8 +88,8 @@ struct clocktime { long nsec; /* nano seconds */ }; -int clock_ct_to_ts(struct clocktime *, struct timespec *); -void clock_ts_to_ct(struct timespec *, struct clocktime *); +int clock_ct_to_ts(const struct clocktime *, struct timespec *); +void clock_ts_to_ct(const struct timespec *, struct clocktime *); /* * Structure to hold the values typically reported by time-of-day clocks, @@ -125,8 +125,8 @@ struct bcd_clocktime { bool ispm; /* true if hour represents pm time */ }; -int clock_bcd_to_ts(struct bcd_clocktime *, struct timespec *, bool ampm); -void clock_ts_to_bcd(struct timespec *, struct bcd_clocktime *, bool ampm); +int clock_bcd_to_ts(const struct bcd_clocktime *, struct timespec *, bool ampm); +void clock_ts_to_bcd(const struct timespec *, struct bcd_clocktime *, bool ampm); /* * Time-of-day clock functions and flags. These functions might sleep. @@ -177,8 +177,10 @@ void clock_unregister(device_t _clockdev); /* Traditional POSIX base year */ #define POSIX_BASE_YEAR 1970 -void timespec2fattime(struct timespec *tsp, int utc, u_int16_t *ddp, u_int16_t *dtp, u_int8_t *dhp); -void fattime2timespec(unsigned dd, unsigned dt, unsigned dh, int utc, struct timespec *tsp); +void timespec2fattime(const struct timespec *tsp, int utc, u_int16_t *ddp, + u_int16_t *dtp, u_int8_t *dhp); +void fattime2timespec(unsigned dd, unsigned dt, unsigned dh, int utc, + struct timespec *tsp); #endif /* _KERNEL */ |