Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clang warning on clang14 #172

Merged
merged 2 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/absl/strings/internal/str_format/parser.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "cpp-compat.h"
// Copyright 2020 The Abseil Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -80,7 +81,7 @@ bool CheckFastPathSetting(const UnboundConversion& conv) {
(conv.width.value() == -1) &&
(conv.precision.value() == -1);
if (should_be_basic != conv.flags.basic) {
fprintf(stderr,
cpp_compat_printf(
"basic=%d left=%d show_pos=%d sign_col=%d alt=%d zero=%d "
"width=%d precision=%d\n",
conv.flags.basic, conv.flags.left, conv.flags.show_pos,
Expand Down
4 changes: 3 additions & 1 deletion src/s2/s2edge_distances.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ S1Angle GetDistance(const S2Point& x, const S2Point& a, const S2Point& b) {
return min_dist.ToAngle();
}

bool UpdateMinDistance(const S2Point& x, const S2Point& a, const S2Point& b,
// dd: changed return type to int because on new clang we get:
// s2/s2edge_distances.cc:282:11: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
int UpdateMinDistance(const S2Point& x, const S2Point& a, const S2Point& b,
S1ChordAngle* min_dist) {
return AlwaysUpdateMinDistance<false>(x, a, b, min_dist);
}
Expand Down
4 changes: 2 additions & 2 deletions src/s2/s2edge_distances.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ bool IsDistanceLess(const S2Point& x, const S2Point& a, const S2Point& b,
// because (1) using S1ChordAngle is much faster than S1Angle, and (2) it
// can save a lot of work by not actually computing the distance when it is
// obviously larger than the current minimum.
bool UpdateMinDistance(const S2Point& x, const S2Point& a, const S2Point& b,
S1ChordAngle* min_dist);
int UpdateMinDistance(const S2Point& x, const S2Point& a, const S2Point& b,
S1ChordAngle* min_dist);

// If the maximum distance from X to the edge AB is greater than "max_dist",
// this method updates "max_dist" and returns true. Otherwise it returns false.
Expand Down