Replace some longs with time_t. Fixes darkstat on 32-bit archs.
};
static unsigned int graph_db_size = sizeof(graph_db)/sizeof(*graph_db);
-static long start_mono, start_real, last_real;
+static time_t start_mono, start_real, last_real;
void graph_init(void) {
unsigned int i;
}
void graph_rotate(void) {
- long t, td;
+ time_t t, td;
struct tm *tm;
unsigned int i;
struct str *buf, *rf;
unsigned int i;
char start_when[100];
- long d_real, d_mono;
+ time_t d_real, d_mono;
buf = str_make();
html_open(buf, "Graphs", /*path_depth=*/0, /*want_graph_js=*/1);
static struct timespec clock_real, clock_mono;
static int now_initialized = 0;
-long now_real(void) {
+time_t now_real(void) {
assert(now_initialized);
return clock_real.tv_sec;
}
-long now_mono(void) {
+time_t now_mono(void) {
assert(now_initialized);
return clock_mono.tv_sec;
}
all_clocks_update();
}
-long mono_to_real(const long t) {
+time_t mono_to_real(const time_t t) {
assert(now_initialized);
return t - clock_mono.tv_sec + clock_real.tv_sec;
}
-long real_to_mono(const long t) {
+time_t real_to_mono(const time_t t) {
assert(now_initialized);
return t - clock_real.tv_sec + clock_mono.tv_sec;
}
void now_init(void);
void now_update(void); /* once per event loop (in darkstat.c) */
-long now_real(void);
-long now_mono(void);
+time_t now_real(void);
+time_t now_mono(void);
-long mono_to_real(const long t);
-long real_to_mono(const long t);
+time_t mono_to_real(const time_t t);
+time_t real_to_mono(const time_t t);
/* Emits warnings if a call is too slow. */
struct timespec;