Skip to content

Commit

Permalink
Fix type warning, 1e9 is a dobule type
Browse files Browse the repository at this point in the history
  • Loading branch information
ligewei authored and chenshuo committed Dec 8, 2017
1 parent 9386d35 commit 00f5bc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion muduo/base/Condition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bool muduo::Condition::waitForSeconds(double seconds)
// FIXME: use CLOCK_MONOTONIC or CLOCK_MONOTONIC_RAW to prevent time rewind.
clock_gettime(CLOCK_REALTIME, &abstime);

const int64_t kNanoSecondsPerSecond = 1e9;
const int64_t kNanoSecondsPerSecond = 1000000000;
int64_t nanoseconds = static_cast<int64_t>(seconds * kNanoSecondsPerSecond);

abstime.tv_sec += static_cast<time_t>((abstime.tv_nsec + nanoseconds) / kNanoSecondsPerSecond);
Expand Down
4 changes: 2 additions & 2 deletions muduo/net/tests/Channel_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ class PeriodicTimer
{
struct timespec ts;
bzero(&ts, sizeof ts);
const int64_t kNanoSecondsPerSecond = 1e9;
const int kMinInterval = 1e5;
const int64_t kNanoSecondsPerSecond = 1000000000;
const int kMinInterval = 100000;
int64_t nanoseconds = static_cast<int64_t>(seconds * kNanoSecondsPerSecond);
if (nanoseconds < kMinInterval)
nanoseconds = kMinInterval;
Expand Down

0 comments on commit 00f5bc2

Please sign in to comment.