aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/surface
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-12-22 13:49:30 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-12-22 13:49:30 -0800
commit7536af02cf218f8dcb1368bec6d86c65db95c9b4 (patch)
treecd560e1321aed28504aca5358dabbf49692a0956 /src/core/surface
parent2d2963e5e919128929e8a62a17fbbc9f3fd684d9 (diff)
Eliminate gpr_ int types - and insist on C99 variants instead
Diffstat (limited to 'src/core/surface')
-rw-r--r--src/core/surface/byte_buffer_reader.c2
-rw-r--r--src/core/surface/call.c97
-rw-r--r--src/core/surface/call.h4
-rw-r--r--src/core/surface/call_test_only.h4
-rw-r--r--src/core/surface/channel.c12
-rw-r--r--src/core/surface/channel.h2
-rw-r--r--src/core/surface/completion_queue.c17
-rw-r--r--src/core/surface/completion_queue.h2
-rw-r--r--src/core/surface/init.c2
-rw-r--r--src/core/surface/server.c20
10 files changed, 80 insertions, 82 deletions
diff --git a/src/core/surface/byte_buffer_reader.c b/src/core/surface/byte_buffer_reader.c
index 57417f41b0..4679854227 100644
--- a/src/core/surface/byte_buffer_reader.c
+++ b/src/core/surface/byte_buffer_reader.c
@@ -110,7 +110,7 @@ gpr_slice grpc_byte_buffer_reader_readall(grpc_byte_buffer_reader *reader) {
size_t bytes_read = 0;
const size_t input_size = grpc_byte_buffer_length(reader->buffer_out);
gpr_slice out_slice = gpr_slice_malloc(input_size);
- gpr_uint8 *const outbuf = GPR_SLICE_START_PTR(out_slice); /* just an alias */
+ uint8_t *const outbuf = GPR_SLICE_START_PTR(out_slice); /* just an alias */
while (grpc_byte_buffer_reader_next(reader, &in_slice) != 0) {
const size_t slice_length = GPR_SLICE_LENGTH(in_slice);
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index 73c1996908..b1ba2afa8b 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -91,7 +91,7 @@ typedef enum {
} status_source;
typedef struct {
- gpr_uint8 is_set;
+ uint8_t is_set;
grpc_status_code code;
grpc_mdstr *details;
} received_status;
@@ -122,14 +122,14 @@ typedef struct batch_control {
void *notify_tag;
gpr_refcount steps_to_complete;
- gpr_uint8 send_initial_metadata;
- gpr_uint8 send_message;
- gpr_uint8 send_final_op;
- gpr_uint8 recv_initial_metadata;
- gpr_uint8 recv_message;
- gpr_uint8 recv_final_op;
- gpr_uint8 is_notify_tag_closure;
- gpr_uint8 success;
+ uint8_t send_initial_metadata;
+ uint8_t send_message;
+ uint8_t send_final_op;
+ uint8_t recv_initial_metadata;
+ uint8_t recv_message;
+ uint8_t recv_final_op;
+ uint8_t is_notify_tag_closure;
+ uint8_t success;
} batch_control;
struct grpc_call {
@@ -141,22 +141,22 @@ struct grpc_call {
gpr_mu mu;
/* client or server call */
- gpr_uint8 is_client;
+ uint8_t is_client;
/* is the alarm set */
- gpr_uint8 have_alarm;
+ uint8_t have_alarm;
/** has grpc_call_destroy been called */
- gpr_uint8 destroy_called;
+ uint8_t destroy_called;
/** flag indicating that cancellation is inherited */
- gpr_uint8 cancellation_is_inherited;
+ uint8_t cancellation_is_inherited;
/** bitmask of live batches */
- gpr_uint8 used_batches;
+ uint8_t used_batches;
/** which ops are in-flight */
- gpr_uint8 sent_initial_metadata;
- gpr_uint8 sending_message;
- gpr_uint8 sent_final_op;
- gpr_uint8 received_initial_metadata;
- gpr_uint8 receiving_message;
- gpr_uint8 received_final_op;
+ uint8_t sent_initial_metadata;
+ uint8_t sending_message;
+ uint8_t sent_final_op;
+ uint8_t received_initial_metadata;
+ uint8_t receiving_message;
+ uint8_t received_final_op;
batch_control active_batches[MAX_CONCURRENT_BATCHES];
@@ -173,7 +173,7 @@ struct grpc_call {
/* Compression algorithm for the call */
grpc_compression_algorithm compression_algorithm;
/* Supported encodings (compression algorithms), a bitset */
- gpr_uint32 encodings_accepted_by_peer;
+ uint32_t encodings_accepted_by_peer;
/* Contexts for various subsystems (security, tracing, ...). */
grpc_call_context_element context[GRPC_CONTEXT_COUNT];
@@ -199,7 +199,7 @@ struct grpc_call {
gpr_slice receiving_slice;
grpc_closure receiving_slice_ready;
grpc_closure receiving_stream_ready;
- gpr_uint32 test_only_last_message_flags;
+ uint32_t test_only_last_message_flags;
union {
struct {
@@ -233,7 +233,7 @@ static void receiving_slice_ready(grpc_exec_ctx *exec_ctx, void *bctlp,
int success);
grpc_call *grpc_call_create(grpc_channel *channel, grpc_call *parent_call,
- gpr_uint32 propagation_mask,
+ uint32_t propagation_mask,
grpc_completion_queue *cq,
const void *server_transport_data,
grpc_mdelem **add_initial_metadata,
@@ -386,7 +386,7 @@ static void destroy_call(grpc_exec_ctx *exec_ctx, void *call, int success) {
}
static void set_status_code(grpc_call *call, status_source source,
- gpr_uint32 status) {
+ uint32_t status) {
if (call->status[source].is_set) return;
call->status[source].is_set = 1;
@@ -409,8 +409,8 @@ grpc_compression_algorithm grpc_call_test_only_get_compression_algorithm(
return algorithm;
}
-gpr_uint32 grpc_call_test_only_get_message_flags(grpc_call *call) {
- gpr_uint32 flags;
+uint32_t grpc_call_test_only_get_message_flags(grpc_call *call) {
+ uint32_t flags;
gpr_mu_lock(&call->mu);
flags = call->test_only_last_message_flags;
gpr_mu_unlock(&call->mu);
@@ -430,7 +430,7 @@ static void set_encodings_accepted_by_peer(grpc_call *call, grpc_mdelem *mdel) {
grpc_mdelem_get_user_data(mdel, destroy_encodings_accepted_by_peer);
if (accepted_user_data != NULL) {
call->encodings_accepted_by_peer =
- (gpr_uint32)(((gpr_uintptr)accepted_user_data) - 1);
+ (uint32_t)(((uintptr_t)accepted_user_data) - 1);
return;
}
@@ -463,11 +463,11 @@ static void set_encodings_accepted_by_peer(grpc_call *call, grpc_mdelem *mdel) {
grpc_mdelem_set_user_data(
mdel, destroy_encodings_accepted_by_peer,
- (void *)(((gpr_uintptr)call->encodings_accepted_by_peer) + 1));
+ (void *)(((uintptr_t)call->encodings_accepted_by_peer) + 1));
}
-gpr_uint32 grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call *call) {
- gpr_uint32 encodings_accepted_by_peer;
+uint32_t grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call *call) {
+ uint32_t encodings_accepted_by_peer;
gpr_mu_lock(&call->mu);
encodings_accepted_by_peer = call->encodings_accepted_by_peer;
gpr_mu_unlock(&call->mu);
@@ -561,7 +561,7 @@ static int prepare_application_metadata(grpc_call *call, int count,
grpc_linked_mdelem *l = (grpc_linked_mdelem *)&md->internal_data;
GPR_ASSERT(sizeof(grpc_linked_mdelem) == sizeof(md->internal_data));
l->md = grpc_mdelem_from_string_and_buffer(
- md->key, (const gpr_uint8 *)md->value, md->value_length);
+ md->key, (const uint8_t *)md->value, md->value_length);
if (!grpc_mdstr_is_legal_header(l->md->key)) {
gpr_log(GPR_ERROR, "attempt to send invalid metadata key: %s",
grpc_mdstr_as_c_string(l->md->key));
@@ -709,7 +709,7 @@ static grpc_call_error cancel_with_status(grpc_exec_ctx *exec_ctx, grpc_call *c,
GPR_ASSERT(status != GRPC_STATUS_OK);
- set_status_code(c, STATUS_FROM_API_OVERRIDE, (gpr_uint32)status);
+ set_status_code(c, STATUS_FROM_API_OVERRIDE, (uint32_t)status);
set_status_details(c, STATUS_FROM_API_OVERRIDE, details);
grpc_closure_init(&cc->closure, send_cancel, cc);
@@ -784,15 +784,15 @@ static void set_deadline_alarm(grpc_exec_ctx *exec_ctx, grpc_call *call,
#define STATUS_OFFSET 1
static void destroy_status(void *ignored) {}
-static gpr_uint32 decode_status(grpc_mdelem *md) {
- gpr_uint32 status;
+static uint32_t decode_status(grpc_mdelem *md) {
+ uint32_t status;
void *user_data;
if (md == GRPC_MDELEM_GRPC_STATUS_0) return 0;
if (md == GRPC_MDELEM_GRPC_STATUS_1) return 1;
if (md == GRPC_MDELEM_GRPC_STATUS_2) return 2;
user_data = grpc_mdelem_get_user_data(md, destroy_status);
if (user_data != NULL) {
- status = ((gpr_uint32)(gpr_intptr)user_data) - STATUS_OFFSET;
+ status = ((uint32_t)(intptr_t)user_data) - STATUS_OFFSET;
} else {
if (!gpr_parse_bytes_to_uint32(grpc_mdstr_as_c_string(md->value),
GPR_SLICE_LENGTH(md->value->slice),
@@ -800,12 +800,12 @@ static gpr_uint32 decode_status(grpc_mdelem *md) {
status = GRPC_STATUS_UNKNOWN; /* could not parse status code */
}
grpc_mdelem_set_user_data(md, destroy_status,
- (void *)(gpr_intptr)(status + STATUS_OFFSET));
+ (void *)(intptr_t)(status + STATUS_OFFSET));
}
return status;
}
-static gpr_uint32 decode_compression(grpc_mdelem *md) {
+static uint32_t decode_compression(grpc_mdelem *md) {
grpc_compression_algorithm algorithm =
grpc_compression_algorithm_from_mdstr(md->value);
if (algorithm == GRPC_COMPRESS_ALGORITHMS_COUNT) {
@@ -895,11 +895,11 @@ static void set_cancelled_value(grpc_status_code status, void *dest) {
*(int *)dest = (status != GRPC_STATUS_OK);
}
-static int are_write_flags_valid(gpr_uint32 flags) {
+static int are_write_flags_valid(uint32_t flags) {
/* check that only bits in GRPC_WRITE_(INTERNAL?)_USED_MASK are set */
- const gpr_uint32 allowed_write_positions =
+ const uint32_t allowed_write_positions =
(GRPC_WRITE_USED_MASK | GRPC_WRITE_INTERNAL_USED_MASK);
- const gpr_uint32 invalid_positions = ~allowed_write_positions;
+ const uint32_t invalid_positions = ~allowed_write_positions;
return !(flags & invalid_positions);
}
@@ -907,8 +907,7 @@ static batch_control *allocate_batch_control(grpc_call *call) {
size_t i;
for (i = 0; i < MAX_CONCURRENT_BATCHES; i++) {
if ((call->used_batches & (1 << i)) == 0) {
- call->used_batches =
- (gpr_uint8)(call->used_batches | (gpr_uint8)(1 << i));
+ call->used_batches = (uint8_t)(call->used_batches | (uint8_t)(1 << i));
return &call->active_batches[i];
}
}
@@ -920,8 +919,8 @@ static void finish_batch_completion(grpc_exec_ctx *exec_ctx, void *user_data,
batch_control *bctl = user_data;
grpc_call *call = bctl->call;
gpr_mu_lock(&call->mu);
- call->used_batches = (gpr_uint8)(
- call->used_batches & ~(gpr_uint8)(1 << (bctl - call->active_batches)));
+ call->used_batches = (uint8_t)(
+ call->used_batches & ~(uint8_t)(1 << (bctl - call->active_batches)));
gpr_mu_unlock(&call->mu);
GRPC_CALL_INTERNAL_UNREF(exec_ctx, call, "completion");
}
@@ -933,8 +932,8 @@ static void post_batch_completion(grpc_exec_ctx *exec_ctx,
grpc_exec_ctx_enqueue(exec_ctx, bctl->notify_tag, bctl->success);
gpr_mu_lock(&call->mu);
bctl->call->used_batches =
- (gpr_uint8)(bctl->call->used_batches &
- ~(gpr_uint8)(1 << (bctl - bctl->call->active_batches)));
+ (uint8_t)(bctl->call->used_batches &
+ ~(uint8_t)(1 << (bctl - bctl->call->active_batches)));
gpr_mu_unlock(&call->mu);
GRPC_CALL_INTERNAL_UNREF(exec_ctx, call, "completion");
} else {
@@ -1123,7 +1122,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
memset(bctl, 0, sizeof(*bctl));
bctl->call = call;
bctl->notify_tag = notify_tag;
- bctl->is_notify_tag_closure = (gpr_uint8)(is_notify_tag_closure != 0);
+ bctl->is_notify_tag_closure = (uint8_t)(is_notify_tag_closure != 0);
if (nops == 0) {
GRPC_CALL_INTERNAL_REF(call, "completion");
@@ -1246,7 +1245,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
GRPC_MDSTR_REF(call->send_extra_metadata[1].md->value));
}
set_status_code(call, STATUS_FROM_API_OVERRIDE,
- (gpr_uint32)op->data.send_status_from_server.status);
+ (uint32_t)op->data.send_status_from_server.status);
if (!prepare_application_metadata(
call,
(int)op->data.send_status_from_server.trailing_metadata_count,
@@ -1426,4 +1425,4 @@ void *grpc_call_context_get(grpc_call *call, grpc_context_index elem) {
return call->context[elem].value;
}
-gpr_uint8 grpc_call_is_client(grpc_call *call) { return call->is_client; }
+uint8_t grpc_call_is_client(grpc_call *call) { return call->is_client; }
diff --git a/src/core/surface/call.h b/src/core/surface/call.h
index b53340df8e..0bbffb98ae 100644
--- a/src/core/surface/call.h
+++ b/src/core/surface/call.h
@@ -49,7 +49,7 @@ typedef void (*grpc_ioreq_completion_func)(grpc_exec_ctx *exec_ctx,
void *user_data);
grpc_call *grpc_call_create(grpc_channel *channel, grpc_call *parent_call,
- gpr_uint32 propagation_mask,
+ uint32_t propagation_mask,
grpc_completion_queue *cq,
const void *server_transport_data,
grpc_mdelem **add_initial_metadata,
@@ -100,7 +100,7 @@ void *grpc_call_context_get(grpc_call *call, grpc_context_index elem);
#define GRPC_CALL_LOG_BATCH(sev, call, ops, nops, tag) \
if (grpc_api_trace) grpc_call_log_batch(sev, call, ops, nops, tag)
-gpr_uint8 grpc_call_is_client(grpc_call *call);
+uint8_t grpc_call_is_client(grpc_call *call);
#ifdef __cplusplus
}
diff --git a/src/core/surface/call_test_only.h b/src/core/surface/call_test_only.h
index b3a2bbd6f1..b57c95c64a 100644
--- a/src/core/surface/call_test_only.h
+++ b/src/core/surface/call_test_only.h
@@ -49,13 +49,13 @@ grpc_compression_algorithm grpc_call_test_only_get_compression_algorithm(
/** Return the message flags from \a call.
*
* \warning This function should \b only be used in test code. */
-gpr_uint32 grpc_call_test_only_get_message_flags(grpc_call *call);
+uint32_t grpc_call_test_only_get_message_flags(grpc_call *call);
/** Returns a bitset for the encodings (compression algorithms) supported by \a
* call's peer.
*
* To be indexed by grpc_compression_algorithm enum values. */
-gpr_uint32 grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call *call);
+uint32_t grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call *call);
#ifdef __cplusplus
}
diff --git a/src/core/surface/channel.c b/src/core/surface/channel.c
index d0a8b0be09..001692376f 100644
--- a/src/core/surface/channel.c
+++ b/src/core/surface/channel.c
@@ -63,7 +63,7 @@ typedef struct registered_call {
struct grpc_channel {
int is_client;
- gpr_uint32 max_message_length;
+ uint32_t max_message_length;
grpc_mdelem *default_authority;
gpr_mu registered_call_mu;
@@ -108,7 +108,7 @@ grpc_channel *grpc_channel_create_from_filters(
gpr_log(GPR_ERROR, "%s ignored: it must be >= 0",
GRPC_ARG_MAX_MESSAGE_LENGTH);
} else {
- channel->max_message_length = (gpr_uint32)args->args[i].value.integer;
+ channel->max_message_length = (uint32_t)args->args[i].value.integer;
}
} else if (0 == strcmp(args->args[i].key, GRPC_ARG_DEFAULT_AUTHORITY)) {
if (args->args[i].type != GRPC_ARG_STRING) {
@@ -166,7 +166,7 @@ char *grpc_channel_get_target(grpc_channel *channel) {
}
static grpc_call *grpc_channel_create_call_internal(
- grpc_channel *channel, grpc_call *parent_call, gpr_uint32 propagation_mask,
+ grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask,
grpc_completion_queue *cq, grpc_mdelem *path_mdelem,
grpc_mdelem *authority_mdelem, gpr_timespec deadline) {
grpc_mdelem *send_metadata[2];
@@ -187,7 +187,7 @@ static grpc_call *grpc_channel_create_call_internal(
grpc_call *grpc_channel_create_call(grpc_channel *channel,
grpc_call *parent_call,
- gpr_uint32 propagation_mask,
+ uint32_t propagation_mask,
grpc_completion_queue *cq,
const char *method, const char *host,
gpr_timespec deadline, void *reserved) {
@@ -231,7 +231,7 @@ void *grpc_channel_register_call(grpc_channel *channel, const char *method,
}
grpc_call *grpc_channel_create_registered_call(
- grpc_channel *channel, grpc_call *parent_call, gpr_uint32 propagation_mask,
+ grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask,
grpc_completion_queue *completion_queue, void *registered_call_handle,
gpr_timespec deadline, void *reserved) {
registered_call *rc = registered_call_handle;
@@ -322,6 +322,6 @@ grpc_mdelem *grpc_channel_get_reffed_status_elem(grpc_channel *channel, int i) {
grpc_mdstr_from_string(tmp));
}
-gpr_uint32 grpc_channel_get_max_message_length(grpc_channel *channel) {
+uint32_t grpc_channel_get_max_message_length(grpc_channel *channel) {
return channel->max_message_length;
}
diff --git a/src/core/surface/channel.h b/src/core/surface/channel.h
index 3d2ff23542..00240c637f 100644
--- a/src/core/surface/channel.h
+++ b/src/core/surface/channel.h
@@ -51,7 +51,7 @@ grpc_channel_stack *grpc_channel_get_channel_stack(grpc_channel *channel);
The returned elem is owned by the caller. */
grpc_mdelem *grpc_channel_get_reffed_status_elem(grpc_channel *channel,
int status_code);
-gpr_uint32 grpc_channel_get_max_message_length(grpc_channel *channel);
+uint32_t grpc_channel_get_max_message_length(grpc_channel *channel);
#ifdef GRPC_STREAM_REFCOUNT_DEBUG
void grpc_channel_internal_ref(grpc_channel *channel, const char *reason);
diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c
index 848a33adc3..c0db9c508a 100644
--- a/src/core/surface/completion_queue.c
+++ b/src/core/surface/completion_queue.c
@@ -142,7 +142,7 @@ grpc_completion_queue *grpc_completion_queue_create(void *reserved) {
/* One for destroy(), one for pollset_shutdown */
gpr_ref_init(&cc->owning_refs, 2);
cc->completed_tail = &cc->completed_head;
- cc->completed_head.next = (gpr_uintptr)cc->completed_tail;
+ cc->completed_head.next = (uintptr_t)cc->completed_tail;
cc->shutdown = 0;
cc->shutdown_called = 0;
cc->is_server_cq = 0;
@@ -183,7 +183,7 @@ void grpc_cq_internal_unref(grpc_completion_queue *cc, const char *reason,
void grpc_cq_internal_unref(grpc_completion_queue *cc) {
#endif
if (gpr_unref(&cc->owning_refs)) {
- GPR_ASSERT(cc->completed_head.next == (gpr_uintptr)&cc->completed_head);
+ GPR_ASSERT(cc->completed_head.next == (uintptr_t)&cc->completed_head);
grpc_pollset_reset(&cc->pollset);
gpr_mu_lock(&g_freelist_mu);
cc->next_free = g_freelist;
@@ -229,7 +229,7 @@ void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc,
storage->done = done;
storage->done_arg = done_arg;
storage->next =
- ((gpr_uintptr)&cc->completed_head) | ((gpr_uintptr)(success != 0));
+ ((uintptr_t)&cc->completed_head) | ((uintptr_t)(success != 0));
gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset));
#ifndef NDEBUG
@@ -247,7 +247,7 @@ void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc,
shutdown = gpr_unref(&cc->pending_events);
if (!shutdown) {
cc->completed_tail->next =
- ((gpr_uintptr)storage) | (1u & (gpr_uintptr)cc->completed_tail->next);
+ ((uintptr_t)storage) | (1u & (uintptr_t)cc->completed_tail->next);
cc->completed_tail = storage;
pluck_worker = NULL;
for (i = 0; i < cc->num_pluckers; i++) {
@@ -260,7 +260,7 @@ void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc,
gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
} else {
cc->completed_tail->next =
- ((gpr_uintptr)storage) | (1u & (gpr_uintptr)cc->completed_tail->next);
+ ((uintptr_t)storage) | (1u & (uintptr_t)cc->completed_tail->next);
cc->completed_tail = storage;
GPR_ASSERT(!cc->shutdown);
GPR_ASSERT(cc->shutdown_called);
@@ -298,7 +298,7 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc,
for (;;) {
if (cc->completed_tail != &cc->completed_head) {
grpc_cq_completion *c = (grpc_cq_completion *)cc->completed_head.next;
- cc->completed_head.next = c->next & ~(gpr_uintptr)1;
+ cc->completed_head.next = c->next & ~(uintptr_t)1;
if (c == cc->completed_tail) {
cc->completed_tail = &cc->completed_head;
}
@@ -385,11 +385,10 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag,
gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset));
for (;;) {
prev = &cc->completed_head;
- while ((c = (grpc_cq_completion *)(prev->next & ~(gpr_uintptr)1)) !=
+ while ((c = (grpc_cq_completion *)(prev->next & ~(uintptr_t)1)) !=
&cc->completed_head) {
if (c->tag == tag) {
- prev->next =
- (prev->next & (gpr_uintptr)1) | (c->next & ~(gpr_uintptr)1);
+ prev->next = (prev->next & (uintptr_t)1) | (c->next & ~(uintptr_t)1);
if (c == cc->completed_tail) {
cc->completed_tail = prev;
}
diff --git a/src/core/surface/completion_queue.h b/src/core/surface/completion_queue.h
index 1e40c48bea..27ef90f2d5 100644
--- a/src/core/surface/completion_queue.h
+++ b/src/core/surface/completion_queue.h
@@ -48,7 +48,7 @@ typedef struct grpc_cq_completion {
struct grpc_cq_completion *c);
void *done_arg;
/** next pointer; low bit is used to indicate success or not */
- gpr_uintptr next;
+ uintptr_t next;
} grpc_cq_completion;
#ifdef GRPC_CQ_REF_COUNT_DEBUG
diff --git a/src/core/surface/init.c b/src/core/surface/init.c
index 81166e8ec5..ec314bd99b 100644
--- a/src/core/surface/init.c
+++ b/src/core/surface/init.c
@@ -83,7 +83,7 @@ static int g_number_of_plugins = 0;
void grpc_register_plugin(void (*init)(void), void (*destroy)(void)) {
GRPC_API_TRACE("grpc_register_plugin(init=%p, destroy=%p)", 2,
- ((void*)(gpr_intptr)init, (void*)(gpr_intptr)destroy));
+ ((void*)(intptr_t)init, (void*)(intptr_t)destroy));
GPR_ASSERT(g_number_of_plugins != MAX_PLUGINS);
g_all_of_the_plugins[g_number_of_plugins].init = init;
g_all_of_the_plugins[g_number_of_plugins].destroy = destroy;
diff --git a/src/core/surface/server.c b/src/core/surface/server.c
index 1e1cde3648..79db13810a 100644
--- a/src/core/surface/server.c
+++ b/src/core/surface/server.c
@@ -113,8 +113,8 @@ struct channel_data {
channel_data *next;
channel_data *prev;
channel_registered_method *registered_methods;
- gpr_uint32 registered_method_slots;
- gpr_uint32 registered_method_max_probes;
+ uint32_t registered_method_slots;
+ uint32_t registered_method_max_probes;
grpc_closure finish_destroy_channel_closure;
grpc_closure channel_connectivity_changed;
};
@@ -209,7 +209,7 @@ struct grpc_server {
size_t max_requested_calls;
gpr_atm shutdown_flag;
- gpr_uint8 shutdown_published;
+ uint8_t shutdown_published;
size_t num_shutdown_tags;
shutdown_tag *shutdown_tags;
@@ -450,8 +450,8 @@ static void start_new_rpc(grpc_exec_ctx *exec_ctx, grpc_call_element *elem) {
channel_data *chand = elem->channel_data;
call_data *calld = elem->call_data;
grpc_server *server = chand->server;
- gpr_uint32 i;
- gpr_uint32 hash;
+ uint32_t i;
+ uint32_t hash;
channel_registered_method *rm;
if (chand->registered_methods && calld->path && calld->host) {
@@ -901,10 +901,10 @@ void grpc_server_setup_transport(grpc_exec_ctx *exec_ctx, grpc_server *s,
channel_data *chand;
grpc_mdstr *host;
grpc_mdstr *method;
- gpr_uint32 hash;
+ uint32_t hash;
size_t slots;
- gpr_uint32 probes;
- gpr_uint32 max_probes = 0;
+ uint32_t probes;
+ uint32_t max_probes = 0;
grpc_transport_op op;
for (i = 0; i < s->channel_filter_count; i++) {
@@ -954,8 +954,8 @@ void grpc_server_setup_transport(grpc_exec_ctx *exec_ctx, grpc_server *s,
crm->host = host;
crm->method = method;
}
- GPR_ASSERT(slots <= GPR_UINT32_MAX);
- chand->registered_method_slots = (gpr_uint32)slots;
+ GPR_ASSERT(slots <= UINT32_MAX);
+ chand->registered_method_slots = (uint32_t)slots;
chand->registered_method_max_probes = max_probes;
}