Skip to content

Commit f5b0186

Browse files
authored
Maintenance: tidy up header includes (r-lib#231)
1 parent 9c28f0d commit f5b0186

File tree

5 files changed

+6
-13
lines changed

5 files changed

+6
-13
lines changed

src/later.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "later.h"
22
#include <Rcpp.h>
3-
#include <map>
43
#include <queue>
54
#include <memory>
65
#include "debug.h"

src/threadutils.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define _THREADUTILS_H_
33

44
#include <stdexcept>
5-
#include <sys/time.h>
65
#include <type_traits>
76

87
#include "tinycthread.h"

src/timeconv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef _LATER_TIMECONV_H_
22
#define _LATER_TIMECONV_H_
33

4-
#include <sys/time.h>
54
// Some platforms (Win32, previously some Mac versions) use
65
// tinycthread.h to provide timespec. Whether tinycthread
76
// defines timespec or not, we want it to be consistent for

src/timer_posix.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#ifndef _WIN32
22

3-
#include <errno.h>
4-
#include <sys/time.h>
5-
63
#include "timer_posix.h"
74

85
int Timer::bg_main_func(void* data) {

src/timestamp_unix.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#ifndef _WIN32
22

3-
#include <sys/time.h>
43
#include "timestamp.h"
54
#include "timeconv.h"
65

@@ -18,32 +17,32 @@ class TimestampImplPosix : public TimestampImpl {
1817
TimestampImplPosix() {
1918
get_current_time(&this->time);
2019
}
21-
20+
2221
TimestampImplPosix(double secs) {
2322
get_current_time(&this->time);
24-
23+
2524
this->time = addSeconds(this->time, secs);
2625
}
27-
26+
2827
virtual bool future() const {
2928
timespec now;
3029
get_current_time(&now);
3130
return this->time.tv_sec > now.tv_sec ||
3231
(this->time.tv_sec == now.tv_sec && this->time.tv_nsec > now.tv_nsec);
3332
}
34-
33+
3534
virtual bool less(const TimestampImpl* other) const {
3635
const TimestampImplPosix* other_impl = dynamic_cast<const TimestampImplPosix*>(other);
3736
return this->time.tv_sec < other_impl->time.tv_sec ||
3837
(this->time.tv_sec == other_impl->time.tv_sec && this->time.tv_nsec < other_impl->time.tv_nsec);
3938
}
40-
39+
4140
virtual bool greater(const TimestampImpl* other) const {
4241
const TimestampImplPosix* other_impl = dynamic_cast<const TimestampImplPosix*>(other);
4342
return this->time.tv_sec > other_impl->time.tv_sec ||
4443
(this->time.tv_sec == other_impl->time.tv_sec && this->time.tv_nsec > other_impl->time.tv_nsec);
4544
}
46-
45+
4746
virtual double diff_secs(const TimestampImpl* other) const {
4847
const TimestampImplPosix* other_impl = dynamic_cast<const TimestampImplPosix*>(other);
4948
double sec_diff = this->time.tv_sec - other_impl->time.tv_sec;

0 commit comments

Comments
 (0)