]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
utime: declare is_zero(), ceph_timespec(), and sleep() as const
authorJosh Durgin <josh.durgin@inktank.com>
Wed, 9 Apr 2014 21:04:49 +0000 (14:04 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Wed, 9 Apr 2014 21:31:36 +0000 (14:31 -0700)
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/include/utime.h

index 5bebc70a3422c671e71dc97454196ea8cd5be638..3108ecd5a35a143635f77e76bfb3345332100fe1 100644 (file)
@@ -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);