unix, test: make NANOSEC a 64 bits unsigned int
Avoids accidental overflow / truncation when it's used in 32 bits arithmetic.
This commit is contained in:
parent
e2aa39aecf
commit
59cda86709
@ -29,7 +29,7 @@
|
||||
#include <time.h>
|
||||
|
||||
#undef NANOSEC
|
||||
#define NANOSEC 1000000000
|
||||
#define NANOSEC ((uint64_t) 1e9)
|
||||
|
||||
|
||||
uint64_t uv_hrtime() {
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
#undef NANOSEC
|
||||
#define NANOSEC 1000000000
|
||||
#define NANOSEC ((uint64_t) 1e9)
|
||||
|
||||
#ifndef CPUSTATES
|
||||
# define CPUSTATES 5U
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
#endif
|
||||
|
||||
#undef NANOSEC
|
||||
#define NANOSEC 1000000000
|
||||
#define NANOSEC ((uint64_t) 1e9)
|
||||
|
||||
/* This is rather annoying: CLOCK_BOOTTIME lives in <linux/time.h> but we can't
|
||||
* include that file because it conflicts with <time.h>. We'll just have to
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#include <time.h>
|
||||
|
||||
#undef NANOSEC
|
||||
#define NANOSEC 1000000000
|
||||
#define NANOSEC ((uint64_t) 1e9)
|
||||
|
||||
|
||||
uint64_t uv_hrtime(void) {
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#undef NANOSEC
|
||||
#define NANOSEC 1000000000
|
||||
#define NANOSEC ((uint64_t) 1e9)
|
||||
|
||||
|
||||
static char *process_title;
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
#define MAX_CONNS 1000
|
||||
|
||||
#undef NANOSEC
|
||||
#define NANOSEC ((uint64_t)10e8)
|
||||
#define NANOSEC ((uint64_t) 1e9)
|
||||
|
||||
#undef DEBUG
|
||||
#define DEBUG 0
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef NANOSEC
|
||||
# define NANOSEC 1000000000
|
||||
# define NANOSEC ((uint64_t) 1e9)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user