Addressing comments
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h
index 5180424..b7d14a5 100644
--- a/include/grpc/grpc.h
+++ b/include/grpc/grpc.h
@@ -191,7 +191,7 @@
There is no need to initialize them, and they will be set to garbage during
calls to grpc. */
struct {
- void *some_random_pointers[3];
+ void *obfuscated[3];
} internal_data;
} grpc_metadata;
diff --git a/src/core/channel/call_op_string.c b/src/core/channel/call_op_string.c
index ae36b68..5f7e1be 100644
--- a/src/core/channel/call_op_string.c
+++ b/src/core/channel/call_op_string.c
@@ -55,7 +55,7 @@
static void put_metadata_list(gpr_strvec *b, grpc_metadata_batch md) {
grpc_linked_mdelem *m;
- for (m = md.list.head; m; m = m->next) {
+ for (m = md.list.head; m != NULL; m = m->next) {
put_metadata(b, m->md);
}
if (gpr_time_cmp(md.deadline, gpr_inf_future) != 0) {
diff --git a/src/core/channel/census_filter.c b/src/core/channel/census_filter.c
index 6eeba36..9c0c20a 100644
--- a/src/core/channel/census_filter.c
+++ b/src/core/channel/census_filter.c
@@ -63,9 +63,9 @@
static void extract_and_annotate_method_tag(grpc_call_op* op, call_data* calld,
channel_data* chand) {
grpc_linked_mdelem* m;
- for (m = op->data.metadata.list.head; m; m = m->next) {
+ for (m = op->data.metadata.list.head; m != NULL; m = m->next) {
if (m->md->key == chand->path_str) {
- gpr_log(GPR_DEBUG, (const char*)GPR_SLICE_START_PTR(m->md->value->slice));
+ gpr_log(GPR_DEBUG, "%s", (const char*)GPR_SLICE_START_PTR(m->md->value->slice));
census_add_method_tag(
calld->op_id, (const char*)GPR_SLICE_START_PTR(m->md->value->slice));
}
diff --git a/src/core/channel/http_server_filter.c b/src/core/channel/http_server_filter.c
index e47fa06..85224f2 100644
--- a/src/core/channel/http_server_filter.c
+++ b/src/core/channel/http_server_filter.c
@@ -101,8 +101,7 @@
if (strncmp(grpc_mdstr_as_c_string(md->value), "application/grpc+", 17) ==
0) {
/* Although the C implementation doesn't (currently) generate them,
- any
- custom +-suffix is explicitly valid. */
+ any custom +-suffix is explicitly valid. */
/* TODO(klempner): We should consider preallocating common values such
as +proto or +json, or at least stashing them if we see them. */
/* TODO(klempner): Should we be surfacing this to application code? */
diff --git a/src/core/security/auth.c b/src/core/security/auth.c
index 1db29f2..d99e559 100644
--- a/src/core/security/auth.c
+++ b/src/core/security/auth.c
@@ -44,7 +44,7 @@
#include "src/core/security/credentials.h"
#include "src/core/surface/call.h"
-#define MAX_CREDENTIAL_METADATA_COUNT 4
+#define MAX_CREDENTIALS_METADATA_COUNT 4
/* We can have a per-call credentials. */
typedef struct {
@@ -52,7 +52,7 @@
grpc_mdstr *host;
grpc_mdstr *method;
grpc_call_op op;
- grpc_linked_mdelem md_links[MAX_CREDENTIAL_METADATA_COUNT];
+ grpc_linked_mdelem md_links[MAX_CREDENTIALS_METADATA_COUNT];
} call_data;
/* We can have a per-channel credentials. */
@@ -77,7 +77,7 @@
call_data *calld = elem->call_data;
grpc_call_op op = calld->op;
size_t i;
- GPR_ASSERT(num_md <= MAX_CREDENTIAL_METADATA_COUNT);
+ GPR_ASSERT(num_md <= MAX_CREDENTIALS_METADATA_COUNT);
for (i = 0; i < num_md; i++) {
grpc_metadata_batch_add_tail(&op.data.metadata, &calld->md_links[i],
grpc_mdelem_ref(md_elems[i]));