From: Josh Durgin Date: Wed, 9 Apr 2014 21:04:49 +0000 (-0700) Subject: utime: declare is_zero(), ceph_timespec(), and sleep() as const X-Git-Tag: v0.80-rc1~70^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=75948357ceb246ee34eccc17001c671349fdc7cb;p=ceph.git utime: declare is_zero(), ceph_timespec(), and sleep() as const Signed-off-by: Josh Durgin --- diff --git a/src/include/utime.h b/src/include/utime.h index 5bebc70a342..3108ecd5a35 100644 --- a/src/include/utime.h +++ b/src/include/utime.h @@ -36,7 +36,7 @@ public: friend class Clock; public: - bool is_zero() { + bool is_zero() const { return (tv.tv_sec == 0) && (tv.tv_nsec == 0); } void normalize() { @@ -130,14 +130,14 @@ public: operator double() const { return (double)sec() + ((double)nsec() / 1000000000.0L); } - operator ceph_timespec() { + operator ceph_timespec() const { ceph_timespec ts; ts.tv_sec = sec(); ts.tv_nsec = nsec(); return ts; } - void sleep() { + void sleep() const { struct timespec ts; to_timespec(&ts); nanosleep(&ts, NULL);