diff options
author | 2016-02-05 11:30:00 -0800 | |
---|---|---|
committer | 2016-02-05 11:30:00 -0800 | |
commit | 309830f6b8c09347db305acf3b05fca333030989 (patch) | |
tree | f2eb8c7cc20f3320cee8221f2ebd0190c05f8671 /src/core/support | |
parent | b59b142799fe28482162bc192d6205fcb749c6c4 (diff) |
Replace 'long' with 'int64_t' in public core headers
Diffstat (limited to 'src/core/support')
-rw-r--r-- | src/core/support/avl.c | 10 | ||||
-rw-r--r-- | src/core/support/time.c | 36 |
2 files changed, 23 insertions, 23 deletions
diff --git a/src/core/support/avl.c b/src/core/support/avl.c index 9734c9987f..1767fc12b5 100644 --- a/src/core/support/avl.c +++ b/src/core/support/avl.c @@ -67,12 +67,12 @@ static void unref_node(const gpr_avl_vtable *vtable, gpr_avl_node *node) { } } -static long node_height(gpr_avl_node *node) { +static int64_t node_height(gpr_avl_node *node) { return node == NULL ? 0 : node->height; } #ifndef NDEBUG -static long calculate_height(gpr_avl_node *node) { +static int64_t calculate_height(gpr_avl_node *node) { return node == NULL ? 0 : 1 + GPR_MAX(calculate_height(node->left), calculate_height(node->right)); } @@ -103,7 +103,7 @@ gpr_avl_node *new_node(void *key, void *value, gpr_avl_node *left, static gpr_avl_node *get(const gpr_avl_vtable *vtable, gpr_avl_node *node, void *key) { - long cmp; + int64_t cmp; if (node == NULL) { return NULL; @@ -198,7 +198,7 @@ static gpr_avl_node *rebalance(const gpr_avl_vtable *vtable, void *key, static gpr_avl_node *add(const gpr_avl_vtable *vtable, gpr_avl_node *node, void *key, void *value) { - long cmp; + int64_t cmp; if (node == NULL) { return new_node(key, value, NULL, NULL); } @@ -240,7 +240,7 @@ static gpr_avl_node *in_order_tail(gpr_avl_node *node) { static gpr_avl_node *remove(const gpr_avl_vtable *vtable, gpr_avl_node *node, void *key) { - long cmp; + int64_t cmp; if (node == NULL) { return NULL; } diff --git a/src/core/support/time.c b/src/core/support/time.c index ac8c3bcde5..2a1e40c633 100644 --- a/src/core/support/time.c +++ b/src/core/support/time.c @@ -83,12 +83,12 @@ gpr_timespec gpr_inf_past(gpr_clock_type type) { /* TODO(ctiller): consider merging _nanos, _micros, _millis into a single function for maintainability. Similarly for _seconds, _minutes, and _hours */ -gpr_timespec gpr_time_from_nanos(long ns, gpr_clock_type type) { +gpr_timespec gpr_time_from_nanos(int64_t ns, gpr_clock_type type) { gpr_timespec result; result.clock_type = type; - if (ns == LONG_MAX) { + if (ns == INT64_MAX) { result = gpr_inf_future(type); - } else if (ns == LONG_MIN) { + } else if (ns == INT64_MIN) { result = gpr_inf_past(type); } else if (ns >= 0) { result.tv_sec = ns / GPR_NS_PER_SEC; @@ -101,12 +101,12 @@ gpr_timespec gpr_time_from_nanos(long ns, gpr_clock_type type) { return result; } -gpr_timespec gpr_time_from_micros(long us, gpr_clock_type type) { +gpr_timespec gpr_time_from_micros(int64_t us, gpr_clock_type type) { gpr_timespec result; result.clock_type = type; - if (us == LONG_MAX) { + if (us == INT64_MAX) { result = gpr_inf_future(type); - } else if (us == LONG_MIN) { + } else if (us == INT64_MIN) { result = gpr_inf_past(type); } else if (us >= 0) { result.tv_sec = us / 1000000; @@ -119,12 +119,12 @@ gpr_timespec gpr_time_from_micros(long us, gpr_clock_type type) { return result; } -gpr_timespec gpr_time_from_millis(long ms, gpr_clock_type type) { +gpr_timespec gpr_time_from_millis(int64_t ms, gpr_clock_type type) { gpr_timespec result; result.clock_type = type; - if (ms == LONG_MAX) { + if (ms == INT64_MAX) { result = gpr_inf_future(type); - } else if (ms == LONG_MIN) { + } else if (ms == INT64_MIN) { result = gpr_inf_past(type); } else if (ms >= 0) { result.tv_sec = ms / 1000; @@ -137,12 +137,12 @@ gpr_timespec gpr_time_from_millis(long ms, gpr_clock_type type) { return result; } -gpr_timespec gpr_time_from_seconds(long s, gpr_clock_type type) { +gpr_timespec gpr_time_from_seconds(int64_t s, gpr_clock_type type) { gpr_timespec result; result.clock_type = type; - if (s == LONG_MAX) { + if (s == INT64_MAX) { result = gpr_inf_future(type); - } else if (s == LONG_MIN) { + } else if (s == INT64_MIN) { result = gpr_inf_past(type); } else { result.tv_sec = s; @@ -151,12 +151,12 @@ gpr_timespec gpr_time_from_seconds(long s, gpr_clock_type type) { return result; } -gpr_timespec gpr_time_from_minutes(long m, gpr_clock_type type) { +gpr_timespec gpr_time_from_minutes(int64_t m, gpr_clock_type type) { gpr_timespec result; result.clock_type = type; - if (m >= LONG_MAX / 60) { + if (m >= INT64_MAX / 60) { result = gpr_inf_future(type); - } else if (m <= LONG_MIN / 60) { + } else if (m <= INT64_MIN / 60) { result = gpr_inf_past(type); } else { result.tv_sec = m * 60; @@ -165,12 +165,12 @@ gpr_timespec gpr_time_from_minutes(long m, gpr_clock_type type) { return result; } -gpr_timespec gpr_time_from_hours(long h, gpr_clock_type type) { +gpr_timespec gpr_time_from_hours(int64_t h, gpr_clock_type type) { gpr_timespec result; result.clock_type = type; - if (h >= LONG_MAX / 3600) { + if (h >= INT64_MAX / 3600) { result = gpr_inf_future(type); - } else if (h <= LONG_MIN / 3600) { + } else if (h <= INT64_MIN / 3600) { result = gpr_inf_past(type); } else { result.tv_sec = h * 3600; |