aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-09-11 13:33:26 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-09-11 13:33:26 -0700
commit1701b093339fc124bd9c7f08eb7d8511799281ec (patch)
tree5fba7871d124fb784a87df8850daff146b48a9ae /tools
parent8664ca6463e8387b711f32fe283e0115e79c4c54 (diff)
parent35fea62432d7a41b5b3bc96d9af7975310553fe7 (diff)
Merge github.com:grpc/grpc into shindig
Diffstat (limited to 'tools')
-rw-r--r--tools/codegen/core/gen_hpack_tables.c41
-rw-r--r--tools/codegen/core/gen_legal_metadata_characters.c2
-rwxr-xr-xtools/distrib/python/docgen.py2
-rw-r--r--tools/dockerfile/grpc_build_deb/Dockerfile51
-rw-r--r--tools/dockerfile/grpc_build_deb/version.txt1
-rw-r--r--tools/dockerfile/grpc_ruby_deb/Dockerfile60
-rw-r--r--tools/dockerfile/grpc_ruby_deb/README.md5
-rw-r--r--tools/doxygen/Doxyfile.core.internal4
-rw-r--r--tools/run_tests/sources_and_headers.json12
9 files changed, 40 insertions, 138 deletions
diff --git a/tools/codegen/core/gen_hpack_tables.c b/tools/codegen/core/gen_hpack_tables.c
index 555f1e71c5..d924aba602 100644
--- a/tools/codegen/core/gen_hpack_tables.c
+++ b/tools/codegen/core/gen_hpack_tables.c
@@ -71,13 +71,13 @@ static unsigned char prefix_mask(unsigned char prefix_len) {
unsigned char i;
unsigned char out = 0;
for (i = 0; i < prefix_len; i++) {
- out |= 1 << (7 - i);
+ out |= (unsigned char)(1 << (7 - i));
}
return out;
}
static unsigned char suffix_mask(unsigned char prefix_len) {
- return ~prefix_mask(prefix_len);
+ return (unsigned char)~prefix_mask(prefix_len);
}
static void generate_first_byte_lut(void) {
@@ -92,7 +92,7 @@ static void generate_first_byte_lut(void) {
chrspec = NULL;
for (j = 0; j < num_fields; j++) {
if ((prefix_mask(fields[j].prefix_length) & i) == fields[j].prefix) {
- suffix = suffix_mask(fields[j].prefix_length) & i;
+ suffix = suffix_mask(fields[j].prefix_length) & (unsigned char)i;
if (suffix == suffix_mask(fields[j].prefix_length)) {
if (fields[j].index != 2) continue;
} else if (suffix == 0) {
@@ -127,7 +127,9 @@ static void generate_first_byte_lut(void) {
/* represents a set of symbols as an array of booleans indicating inclusion */
typedef struct { char included[GRPC_CHTTP2_NUM_HUFFSYMS]; } symset;
/* represents a lookup table indexed by a nibble */
-typedef struct { int values[16]; } nibblelut;
+typedef struct { unsigned values[16]; } nibblelut;
+
+#define NOT_SET (~(unsigned)0)
/* returns a symset that includes all possible symbols */
static symset symset_all(void) {
@@ -148,7 +150,7 @@ static nibblelut nibblelut_empty(void) {
nibblelut x;
int i;
for (i = 0; i < 16; i++) {
- x.values[i] = -1;
+ x.values[i] = NOT_SET;
}
return x;
}
@@ -168,7 +170,7 @@ static int nsyms(symset s) {
/* global table of discovered huffman decoding states */
static struct {
/* the bit offset that this state starts at */
- int bitofs;
+ unsigned bitofs;
/* the set of symbols that this state started with */
symset syms;
@@ -177,13 +179,13 @@ static struct {
/* lookup table for what to emit */
nibblelut emit;
} huffstates[MAXHUFFSTATES];
-static int nhuffstates = 0;
+static unsigned nhuffstates = 0;
/* given a number of decoded bits and a set of symbols that are live,
return the index into the decoder table for this state.
set isnew to 1 if this state was previously undiscovered */
-static int state_index(int bitofs, symset syms, int *isnew) {
- int i;
+static unsigned state_index(unsigned bitofs, symset syms, unsigned *isnew) {
+ unsigned i;
for (i = 0; i < nhuffstates; i++) {
if (huffstates[i].bitofs != bitofs) continue;
if (0 != memcmp(huffstates[i].syms.included, syms.included,
@@ -211,24 +213,24 @@ static int state_index(int bitofs, symset syms, int *isnew) {
emit - the symbol to emit on this nibble (or -1 if no symbol has been
found)
syms - the set of symbols that could be matched */
-static void build_dec_tbl(int state, int nibble, int nibbits, unsigned bitofs,
- int emit, symset syms) {
- int i;
+static void build_dec_tbl(unsigned state, unsigned nibble, int nibbits,
+ unsigned bitofs, unsigned emit, symset syms) {
+ unsigned i;
unsigned bit;
/* If we have four bits in the nibble we're looking at, then we can fill in
a slot in the lookup tables. */
if (nibbits == 4) {
- int isnew;
+ unsigned isnew;
/* Find the state that we are in: this may be a new state, in which case
we recurse to fill it in, or we may have already seen this state, in
which case the recursion terminates */
- int st = state_index(bitofs, syms, &isnew);
- GPR_ASSERT(huffstates[state].next.values[nibble] == -1);
+ unsigned st = state_index(bitofs, syms, &isnew);
+ GPR_ASSERT(huffstates[state].next.values[nibble] == NOT_SET);
huffstates[state].next.values[nibble] = st;
huffstates[state].emit.values[nibble] = emit;
if (isnew) {
- build_dec_tbl(st, 0, 0, bitofs, -1, syms);
+ build_dec_tbl(st, 0, 0, bitofs, NOT_SET, syms);
}
return;
}
@@ -290,8 +292,9 @@ static void dump_ctbl(const char *name) {
}
static void generate_huff_tables(void) {
- int i;
- build_dec_tbl(state_index(0, symset_all(), &i), 0, 0, 0, -1, symset_all());
+ unsigned i;
+ build_dec_tbl(state_index(0, symset_all(), &i), 0, 0, 0, NOT_SET,
+ symset_all());
nctbl = 0;
printf("static const gpr_uint8 next_tbl[%d] = {", nhuffstates);
@@ -333,7 +336,7 @@ static void generate_base64_inverse_table(void) {
memset(inverse, 255, sizeof(inverse));
for (i = 0; i < strlen(alphabet); i++) {
- inverse[(unsigned char)alphabet[i]] = i;
+ inverse[(unsigned char)alphabet[i]] = (unsigned char)i;
}
printf("static const gpr_uint8 inverse_base64[256] = {");
diff --git a/tools/codegen/core/gen_legal_metadata_characters.c b/tools/codegen/core/gen_legal_metadata_characters.c
index 0fbc545d8d..2ffda54a21 100644
--- a/tools/codegen/core/gen_legal_metadata_characters.c
+++ b/tools/codegen/core/gen_legal_metadata_characters.c
@@ -41,7 +41,7 @@ static unsigned char legal_bits[256 / 8];
static void legal(int x) {
int byte = x / 8;
int bit = x % 8;
- legal_bits[byte] |= 1 << bit;
+ legal_bits[byte] |= (unsigned char)(1 << bit);
}
static void dump(void) {
diff --git a/tools/distrib/python/docgen.py b/tools/distrib/python/docgen.py
index d76792c56f..2acd3cc12f 100755
--- a/tools/distrib/python/docgen.py
+++ b/tools/distrib/python/docgen.py
@@ -81,7 +81,7 @@ if args.submit:
assert args.doc_branch
github_user = args.gh_user
github_repository_owner = (
- args.gh_repo_owner if args.gh_repo_owner else gh_user)
+ args.gh_repo_owner if args.gh_repo_owner else args.gh_user)
# Create a temporary directory out of tree, checkout gh-pages from the
# specified repository, edit it, and push it. It's up to the user to then go
# onto GitHub and make a PR against grpc/grpc:gh-pages.
diff --git a/tools/dockerfile/grpc_build_deb/Dockerfile b/tools/dockerfile/grpc_build_deb/Dockerfile
deleted file mode 100644
index 7f025b6712..0000000000
--- a/tools/dockerfile/grpc_build_deb/Dockerfile
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright 2015, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Dockerfile to build Debian packages for gRPC C core.
-FROM grpc/base
-
-# Add the file containing the gRPC version
-ADD version.txt version.txt
-
-# Add the update-to-date distpackages folder
-ADD distpackages distpackages
-
-# Install dependencies
-RUN echo 'deb http://http.debian.net/debian experimental main contrib non-free' >> /etc/apt/sources.list
-RUN apt-get update \
- && apt-get -t experimental install -y openssl=1.0.2-1 \
- && apt-get install -y lintian
-
-# Get the source from GitHub
-RUN git clone https://github.com/grpc/grpc.git /var/local/git/grpc
-RUN cd /var/local/git/grpc && \
- git pull --recurse-submodules && \
- git submodule update --init --recursive
-
-RUN /bin/bash -l -c 'cd /distpackages && ./build_deb_packages.sh'
diff --git a/tools/dockerfile/grpc_build_deb/version.txt b/tools/dockerfile/grpc_build_deb/version.txt
deleted file mode 100644
index a918a2aa18..0000000000
--- a/tools/dockerfile/grpc_build_deb/version.txt
+++ /dev/null
@@ -1 +0,0 @@
-0.6.0
diff --git a/tools/dockerfile/grpc_ruby_deb/Dockerfile b/tools/dockerfile/grpc_ruby_deb/Dockerfile
deleted file mode 100644
index 679fa51f5d..0000000000
--- a/tools/dockerfile/grpc_ruby_deb/Dockerfile
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright 2015, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Dockerfile for gRPC Ruby, but using Debian packages for gRPC C core.
-FROM grpc/ruby_base
-
-# Pull the latest sources
-RUN cd /var/local/git/grpc \
- && git pull --recurse-submodules \
- && git submodule update --init --recursive
-
-# Make sure we don't rely on things that shouldn't be there.
-RUN make clean -C /var/local/git/grpc
-
-# Debian packages need to be supplied externally
-ADD libgrpc_amd64.deb libgrpc_amd64.deb
-ADD libgrpc-dev_amd64.deb libgrpc-dev_amd64.deb
-
-# Install the C core .deb packages
-RUN /bin/bash -l -c 'dpkg -i libgrpc_amd64.deb libgrpc-dev_amd64.deb'
-
-# Build ruby gRPC and run its tests
-RUN /bin/bash -l -c 'cd /var/local/git/grpc/src/ruby && bundle && rake'
-
-# Add a cacerts directory containing the Google root pem file, allowing the
-# ruby client to access the production test instance
-ADD cacerts cacerts
-
-# Add a service_account directory containing the auth creds file
-ADD service_account service_account
-
-# Specify the default command such that the interop server runs on its known
-# testing port
-CMD ["/bin/bash", "-l", "-c", "ruby /var/local/git/grpc/src/ruby/bin/interop/interop_server.rb --use_tls --port 8060"]
diff --git a/tools/dockerfile/grpc_ruby_deb/README.md b/tools/dockerfile/grpc_ruby_deb/README.md
deleted file mode 100644
index 0a3716b938..0000000000
--- a/tools/dockerfile/grpc_ruby_deb/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-GRPC RUBY Base Dockerfile (Debian package version)
-========================
-
-Dockerfile for creating the Ruby gRPC development Docker instance.
-Uses gRPC C core Debian packages instead of installing it using make.
diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal
index 50defad096..eaeaf2a7a8 100644
--- a/tools/doxygen/Doxyfile.core.internal
+++ b/tools/doxygen/Doxyfile.core.internal
@@ -794,6 +794,8 @@ src/core/client_config/client_config.h \
src/core/client_config/connector.h \
src/core/client_config/lb_policies/pick_first.h \
src/core/client_config/lb_policy.h \
+src/core/client_config/lb_policy_factory.h \
+src/core/client_config/lb_policy_registry.h \
src/core/client_config/resolver.h \
src/core/client_config/resolver_factory.h \
src/core/client_config/resolver_registry.h \
@@ -922,6 +924,8 @@ src/core/client_config/client_config.c \
src/core/client_config/connector.c \
src/core/client_config/lb_policies/pick_first.c \
src/core/client_config/lb_policy.c \
+src/core/client_config/lb_policy_factory.c \
+src/core/client_config/lb_policy_registry.c \
src/core/client_config/resolver.c \
src/core/client_config/resolver_factory.c \
src/core/client_config/resolver_registry.c \
diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json
index d7e7e2b808..798306b845 100644
--- a/tools/run_tests/sources_and_headers.json
+++ b/tools/run_tests/sources_and_headers.json
@@ -12290,6 +12290,8 @@
"src/core/client_config/connector.h",
"src/core/client_config/lb_policies/pick_first.h",
"src/core/client_config/lb_policy.h",
+ "src/core/client_config/lb_policy_factory.h",
+ "src/core/client_config/lb_policy_registry.h",
"src/core/client_config/resolver.h",
"src/core/client_config/resolver_factory.h",
"src/core/client_config/resolver_registry.h",
@@ -12439,6 +12441,10 @@
"src/core/client_config/lb_policies/pick_first.h",
"src/core/client_config/lb_policy.c",
"src/core/client_config/lb_policy.h",
+ "src/core/client_config/lb_policy_factory.c",
+ "src/core/client_config/lb_policy_factory.h",
+ "src/core/client_config/lb_policy_registry.c",
+ "src/core/client_config/lb_policy_registry.h",
"src/core/client_config/resolver.c",
"src/core/client_config/resolver.h",
"src/core/client_config/resolver_factory.c",
@@ -12778,6 +12784,8 @@
"src/core/client_config/connector.h",
"src/core/client_config/lb_policies/pick_first.h",
"src/core/client_config/lb_policy.h",
+ "src/core/client_config/lb_policy_factory.h",
+ "src/core/client_config/lb_policy_registry.h",
"src/core/client_config/resolver.h",
"src/core/client_config/resolver_factory.h",
"src/core/client_config/resolver_registry.h",
@@ -12913,6 +12921,10 @@
"src/core/client_config/lb_policies/pick_first.h",
"src/core/client_config/lb_policy.c",
"src/core/client_config/lb_policy.h",
+ "src/core/client_config/lb_policy_factory.c",
+ "src/core/client_config/lb_policy_factory.h",
+ "src/core/client_config/lb_policy_registry.c",
+ "src/core/client_config/lb_policy_registry.h",
"src/core/client_config/resolver.c",
"src/core/client_config/resolver.h",
"src/core/client_config/resolver_factory.c",