added inline initialization support to aos::time::Time and used it
diff --git a/aos/common/time.cc b/aos/common/time.cc
index bc3ffe2..c4f77a8 100644
--- a/aos/common/time.cc
+++ b/aos/common/time.cc
@@ -68,13 +68,13 @@
}
}
-void Time::Check() {
- if (nsec_ >= kNSecInSec || nsec_ < 0) {
- LOG(FATAL, "0 <= nsec_(%" PRId32 ") < %" PRId32 " isn't true.\n",
- nsec_, kNSecInSec);
- }
+void Time::CheckImpl(int32_t nsec) {
static_assert(aos::shm_ok<Time>::value,
"it should be able to go through shared memory");
+ if (nsec >= kNSecInSec || nsec < 0) {
+ LOG(FATAL, "0 <= nsec(%" PRId32 ") < %" PRId32 " isn't true.\n",
+ nsec, kNSecInSec);
+ }
}
Time &Time::operator+=(const Time &rhs) {