fix INT64_MAX in C++; add some missing casts
This commit is contained in:
parent
b11d7fb4a7
commit
ed791137b1
2 changed files with 3 additions and 2 deletions
|
@ -71,6 +71,7 @@ terms specified in this license.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
|
#define __STDC_LIMIT_MACROS // to get stdint.h to define the *_MAX and *_MIN macros under C++.
|
||||||
#include <stdint.h> // uint32, et. al. (has to be before sys/types.h for mcpp atop some broken gcc headers)
|
#include <stdint.h> // uint32, et. al. (has to be before sys/types.h for mcpp atop some broken gcc headers)
|
||||||
#include <sys/types.h> // for size_t
|
#include <sys/types.h> // for size_t
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
|
@ -65,12 +65,12 @@ static inline void stasis_histogram_insert_log_timeval(stasis_histogram_64_t* hi
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void stasis_histogram_tick(stasis_histogram_64_t* hist) {
|
static inline void stasis_histogram_tick(stasis_histogram_64_t* hist) {
|
||||||
struct timeval * val = pthread_getspecific(hist->tls);
|
struct timeval * val = (struct timeval *)pthread_getspecific(hist->tls);
|
||||||
if(!val) { val = stasis_alloc(struct timeval); pthread_setspecific(hist->tls, val); }
|
if(!val) { val = stasis_alloc(struct timeval); pthread_setspecific(hist->tls, val); }
|
||||||
gettimeofday(val,0);
|
gettimeofday(val,0);
|
||||||
}
|
}
|
||||||
static inline void stasis_histogram_tock(stasis_histogram_64_t* hist) {
|
static inline void stasis_histogram_tock(stasis_histogram_64_t* hist) {
|
||||||
struct timeval * val = pthread_getspecific(hist->tls);
|
struct timeval * val = (struct timeval *)pthread_getspecific(hist->tls);
|
||||||
assert(val);
|
assert(val);
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
gettimeofday(&now,0);
|
gettimeofday(&now,0);
|
||||||
|
|
Loading…
Reference in a new issue