aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2016-02-05 15:51:47 -0800
committerGravatar murgatroid99 <mlumish@google.com>2016-02-05 15:51:47 -0800
commit85474df7b3f4ba2060d2c9a9debfb3829b2131d9 (patch)
tree3e423e3584ce65e3895193b6ba65bc9acb39c424
parentb3ac991d9e0f27141718b3e44daa071feba5fc4e (diff)
Reverse changes to AVL code
-rw-r--r--include/grpc/support/avl.h4
-rw-r--r--src/core/support/avl.c12
-rw-r--r--test/core/support/avl_test.c2
3 files changed, 9 insertions, 9 deletions
diff --git a/include/grpc/support/avl.h b/include/grpc/support/avl.h
index 623da6698c..3433124c6f 100644
--- a/include/grpc/support/avl.h
+++ b/include/grpc/support/avl.h
@@ -43,7 +43,7 @@ typedef struct gpr_avl_node {
void *value;
struct gpr_avl_node *left;
struct gpr_avl_node *right;
- int64_t height;
+ long height;
} gpr_avl_node;
typedef struct gpr_avl_vtable {
@@ -53,7 +53,7 @@ typedef struct gpr_avl_vtable {
void *(*copy_key)(void *key);
/** compare key1, key2; return <0 if key1 < key2,
>0 if key1 > key2, 0 if key1 == key2 */
- int64_t (*compare_keys)(void *key1, void *key2);
+ long (*compare_keys)(void *key1, void *key2);
/** destroy a value */
void (*destroy_value)(void *value);
/** copy a value */
diff --git a/src/core/support/avl.c b/src/core/support/avl.c
index 78746588f0..9734c9987f 100644
--- a/src/core/support/avl.c
+++ b/src/core/support/avl.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015-2016, Google Inc.
+ * Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -67,12 +67,12 @@ static void unref_node(const gpr_avl_vtable *vtable, gpr_avl_node *node) {
}
}
-static int64_t node_height(gpr_avl_node *node) {
+static long node_height(gpr_avl_node *node) {
return node == NULL ? 0 : node->height;
}
#ifndef NDEBUG
-static int64_t calculate_height(gpr_avl_node *node) {
+static long 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) {
- int64_t cmp;
+ long 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) {
- int64_t cmp;
+ long 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) {
- int64_t cmp;
+ long cmp;
if (node == NULL) {
return NULL;
}
diff --git a/test/core/support/avl_test.c b/test/core/support/avl_test.c
index 6dae53c1df..d8d8b36806 100644
--- a/test/core/support/avl_test.c
+++ b/test/core/support/avl_test.c
@@ -48,7 +48,7 @@ static int *box(int x) {
return b;
}
-static int64_t int_compare(void *int1, void *int2) {
+static long int_compare(void *int1, void *int2) {
return (*(int *)int1) - (*(int *)int2);
}
static void *int_copy(void *p) { return box(*(int *)p); }