fix INT64_MAX in C++; add some missing casts

This commit is contained in:
Rusty Sears 2013-01-30 14:07:16 -08:00
parent b11d7fb4a7
commit ed791137b1
2 changed files with 3 additions and 2 deletions

View file

@ -71,6 +71,7 @@ terms specified in this license.
#endif
#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 <sys/types.h> // for size_t
#include <dirent.h>

View file

@ -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) {
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); }
gettimeofday(val,0);
}
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);
struct timeval now;
gettimeofday(&now,0);