Skip to content

Commit

Permalink
Merge branch 'shush-chaos' into shush-tsan
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiller committed Jan 23, 2024
2 parents ec7db0d + 2113a86 commit 1ae70c7
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 23 deletions.
7 changes: 7 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
# - bugprone-not-null-terminated-result
# - bugprone-signed-char-misuse
# - bugprone-sizeof-expression
# - bugprone-switch-missing-default-case
# - bugprone-too-small-loop-variable
# - bugprone-unchecked-optional-access
# - clang-diagnostic-deprecated-declarations
Expand All @@ -50,8 +51,10 @@
# - modernize-use-equals-default
# - modernize-use-equals-delete
# - modernize-use-using
# - performance-avoid-endl
# - performance-no-automatic-move
# - performance-no-int-to-ptr
# - performance-noexcept-swap
# - performance-unnecessary-copy-initialization
# - performance-unnecessary-value-param
# - readability-else-after-return
Expand All @@ -67,6 +70,7 @@ Checks: '-*,
-bugprone-assignment-in-if-condition,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-bugprone-empty-catch,
-bugprone-exception-escape,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-infinite-loop,
Expand All @@ -75,15 +79,18 @@ Checks: '-*,
-bugprone-reserved-identifier,
-bugprone-signed-char-misuse,
-bugprone-sizeof-expression,
-bugprone-switch-missing-default-case,
-bugprone-too-small-loop-variable,
-bugprone-unchecked-optional-access,
google-*,
-google-readability-casting,
-google-runtime-int,
-google-runtime-references,
performance-*,
-performance-avoid-endl,
-performance-no-automatic-move,
-performance-no-int-to-ptr,
-performance-noexcept-swap,
-performance-unnecessary-copy-initialization,
-performance-unnecessary-value-param,
clang-diagnostic-deprecated-declarations,
Expand Down
4 changes: 2 additions & 2 deletions src/core/lib/gprpp/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
uint64_t now = grpc_core::Timestamp::FromTimespecRoundDown( \
gpr_now(GPR_CLOCK_MONOTONIC)) \
.milliseconds_after_process_epoch(); \
if (prev == 0 || now - prev > (n)*1000) { \
if (prev == 0 || now - prev > (n) * 1000) { \
prev = now; \
gpr_log(severity, format, __VA_ARGS__); \
} \
Expand All @@ -50,7 +50,7 @@
gpr_now(GPR_CLOCK_MONOTONIC)) \
.milliseconds_after_process_epoch(); \
uint64_t prev_tsamp = prev.exchange(now); \
if (now - prev_tsamp > (n)*1000) { \
if (now - prev_tsamp > (n) * 1000) { \
gpr_log(severity, format, __VA_ARGS__); \
} \
} while (0)
Expand Down
2 changes: 1 addition & 1 deletion src/core/lib/iomgr/combiner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ bool grpc_combiner_continue_exec_ctx() {
// Define a macro to ease readability of the following switch statement.
#define OLD_STATE_WAS(orphaned, elem_count) \
(((orphaned) ? 0 : STATE_UNORPHANED) | \
((elem_count)*STATE_ELEM_COUNT_LOW_BIT))
((elem_count) * STATE_ELEM_COUNT_LOW_BIT))
// Depending on what the previous state was, we need to perform different
// actions.
switch (old_state) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/lib/json/json_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void JsonWriter::EscapeUtf16(uint16_t utf16) {
OutputChar(hex[(utf16 >> 12) & 0x0f]);
OutputChar(hex[(utf16 >> 8) & 0x0f]);
OutputChar(hex[(utf16 >> 4) & 0x0f]);
OutputChar(hex[(utf16)&0x0f]);
OutputChar(hex[(utf16) & 0x0f]);
}

void JsonWriter::EscapeString(const std::string& string) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/tsi/fake_transport_security.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static void store32_little_endian(uint32_t value, unsigned char* buf) {
buf[3] = static_cast<unsigned char>((value >> 24) & 0xFF);
buf[2] = static_cast<unsigned char>((value >> 16) & 0xFF);
buf[1] = static_cast<unsigned char>((value >> 8) & 0xFF);
buf[0] = static_cast<unsigned char>((value)&0xFF);
buf[0] = static_cast<unsigned char>((value) & 0xFF);
}

static uint32_t read_frame_size(const grpc_slice_buffer* sb) {
Expand Down
2 changes: 1 addition & 1 deletion src/objective-c/tests/InteropTests/InteropTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ - (void)concurrentRPCsWithErrors {
[call setResponseDispatchQueue:dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL)];
[call start];
}
while (completedCallCount<kNumRpcs && [waitUntil timeIntervalSinceNow]> 0) {
while (completedCallCount < kNumRpcs && [waitUntil timeIntervalSinceNow] > 0) {
[cv waitUntilDate:waitUntil];
}
[cv unlock];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM silkeh/clang:16-bullseye
FROM silkeh/clang:17-bullseye

ADD clang_format_all_the_things.sh /

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM silkeh/clang:16-bullseye
FROM silkeh/clang:17-bullseye

# Install prerequisites for the clang-tidy script
RUN apt-get update && apt-get install -y python3 jq git && apt-get clean
Expand Down
7 changes: 2 additions & 5 deletions templates/tools/dockerfile/test/sanity/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM silkeh/clang:16-bullseye
FROM silkeh/clang:17-bullseye

<%include file="../../apt_get_basic.include"/>

Expand Down Expand Up @@ -52,10 +52,7 @@
RUN python3 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user

# Install prerequisites for the clang-tidy script
RUN apt-get update && apt-get install -y jq git

# Install prerequisites for the iwyu script
RUN apt-get update && apt-get install -y jq git cmake zlib1g-dev libtinfo-dev libclang-16-dev && apt-get clean
RUN apt-get update && apt-get install -y jq git && apt-get clean

<%include file="../../bazel.include"/>
<%include file="../../buildifier.include"/>
Expand Down
2 changes: 1 addition & 1 deletion test/core/util/osa_distance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ size_t OsaDistance(absl::string_view s1, absl::string_view s2) {
const auto height = s2.size() + 1;
std::vector<size_t> matrix(width * height,
std::numeric_limits<size_t>::max());
#define MATRIX_CELL(x, y) matrix[(y)*width + (x)]
#define MATRIX_CELL(x, y) matrix[(y) * width + (x)]

MATRIX_CELL(0, 0) = 0;
for (size_t i = 1; i <= s1.size(); ++i) {
Expand Down
2 changes: 1 addition & 1 deletion tools/bazelify_tests/dockerimage_current_versions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@ DOCKERIMAGE_CURRENT_VERSIONS = {
"tools/dockerfile/test/rbe_ubuntu2004.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_ubuntu2004@sha256:d3951aeadf43e3bee6adc5b86d26cdaf0b9d1b5baf790d7b2530d1c197adc9f8",
"tools/dockerfile/test/ruby_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64@sha256:7e77cf17e2e8657f4cc23ac9f93630bf13213fff961799e0f16dae17cd45cf6d",
"tools/dockerfile/test/ruby_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64@sha256:e4cb502caccf2db733268ce2ddc951fda8a9df2f7f53d6b74523c33d40c83006",
"tools/dockerfile/test/sanity.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/sanity@sha256:f1f5ca30491698f793cae75d5989cb53887d159800aef662cf7e6c3df6f86a88",
"tools/dockerfile/test/sanity.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/sanity@sha256:ca65b29302e8e381aabf9deb1952281f4e9963654e19c3d681148b5aa972c8a2",
}
2 changes: 1 addition & 1 deletion tools/dockerfile/grpc_clang_format/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM silkeh/clang:16-bullseye
FROM silkeh/clang:17-bullseye

ADD clang_format_all_the_things.sh /

Expand Down
2 changes: 1 addition & 1 deletion tools/dockerfile/grpc_clang_tidy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM silkeh/clang:16-bullseye
FROM silkeh/clang:17-bullseye

# Install prerequisites for the clang-tidy script
RUN apt-get update && apt-get install -y python3 jq git && apt-get clean
Expand Down
2 changes: 1 addition & 1 deletion tools/dockerfile/test/sanity.current_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/sanity:091d8e85bebb7b9f089178ae96435926cdc82fb8@sha256:f1f5ca30491698f793cae75d5989cb53887d159800aef662cf7e6c3df6f86a88
us-docker.pkg.dev/grpc-testing/testing-images-public/sanity:2d20232b40465f3487deef87274f4bfd7122b201@sha256:ca65b29302e8e381aabf9deb1952281f4e9963654e19c3d681148b5aa972c8a2
7 changes: 2 additions & 5 deletions tools/dockerfile/test/sanity/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM silkeh/clang:16-bullseye
FROM silkeh/clang:17-bullseye

#=================
# Basic C core dependencies
Expand Down Expand Up @@ -102,10 +102,7 @@ RUN python3 -m pip install simplejson mako virtualenv==16.7.9 lxml six
RUN python3 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user

# Install prerequisites for the clang-tidy script
RUN apt-get update && apt-get install -y jq git

# Install prerequisites for the iwyu script
RUN apt-get update && apt-get install -y jq git cmake zlib1g-dev libtinfo-dev libclang-16-dev && apt-get clean
RUN apt-get update && apt-get install -y jq git && apt-get clean

#========================
# Bazel installation
Expand Down

0 comments on commit 1ae70c7

Please sign in to comment.