Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2f63502a4322
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 326bf4ca225c
Choose a head ref
  • 3 commits
  • 15 files changed
  • 1 contributor

Commits on Nov 23, 2021

  1. Fix warnings found by Clang.

    pleroy committed Nov 23, 2021
    Copy the full SHA
    7c4faef View commit details
  2. Cleanup.

    pleroy committed Nov 23, 2021
    Copy the full SHA
    4e66456 View commit details
  3. Merge pull request #3217 from pleroy/Warnings

    Fix warnings found by Clang
    pleroy authored Nov 23, 2021
    Copy the full SHA
    326bf4c View commit details
1 change: 0 additions & 1 deletion astronomy/date_time_body.hpp
Original file line number Diff line number Diff line change
@@ -112,7 +112,6 @@ constexpr Date Date::YYYYMMDD(
constexpr Date Date::YYYYDDD(
std::int64_t const digits,
std::optional<date_time::Calendar> const calendar) {
auto const abs_digits = digits < 0 ? -digits : digits;
auto const sign = digits < 0 ? -1 : 1;
CONSTEXPR_CHECK(digits <= 9999'999);
return Date::Ordinal(sign * digit_range(digits, 3, 7),
2 changes: 0 additions & 2 deletions base/recurring_thread_test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#pragma once

#include "base/recurring_thread.hpp"

#include "gtest/gtest.h"
2 changes: 0 additions & 2 deletions geometry/symmetric_bilinear_form_body.hpp
Original file line number Diff line number Diff line change
@@ -184,8 +184,6 @@ typename SymmetricBilinearForm<Scalar, Frame, Multivector>::
static constexpr int max_iterations = 16;
static constexpr double ε = std::numeric_limits<double>::epsilon() / 128;

static Scalar const zero{};

// [GV13], Algorithm 8.5.2.
R3x3Matrix<Scalar> A = matrix_;
Scalar const A_frobenius_norm = A.FrobeniusNorm();
4 changes: 0 additions & 4 deletions ksp_plugin/pile_up.hpp
Original file line number Diff line number Diff line change
@@ -102,10 +102,6 @@ class PileUp {

virtual ~PileUp();

// This class is moveable.
PileUp(PileUp&& pile_up) = default;
PileUp& operator=(PileUp&& pile_up) = default;

std::list<not_null<Part*>> const& parts() const;

// Set the rigid motion for the given |part|. This rigid motion is *apparent*
12 changes: 5 additions & 7 deletions ksp_plugin/vessel.cpp
Original file line number Diff line number Diff line change
@@ -63,17 +63,15 @@ Vessel::Vessel(GUID guid,
std::move(prediction_adaptive_step_parameters)),
parent_(parent),
ephemeris_(ephemeris),
history_(trajectory_.segments().begin()),
psychohistory_(trajectory_.segments().end()),
prediction_(trajectory_.segments().end()),
prognosticator_(
[this](PrognosticatorParameters const& parameters) {
return FlowPrognostication(parameters);
},
20ms), // 50 Hz.
history_(trajectory_.segments().begin()),
psychohistory_(trajectory_.segments().end()),
prediction_(trajectory_.segments().end()) {
// Can't create the |psychohistory_| and |prediction_| here because |history_|
// is empty;
}
20ms) // 50 Hz.
{}

Vessel::~Vessel() {
LOG(INFO) << "Destroying vessel " << ShortDebugString();
1 change: 0 additions & 1 deletion ksp_plugin_test/plugin_test.cpp
Original file line number Diff line number Diff line change
@@ -322,7 +322,6 @@ TEST_F(PluginDeathTest, SerializationError) {
TEST_F(PluginTest, Serialization) {
GUID const satellite = "satellite";
PartId const part_id = 666;
Time const step = DefaultHistoryParameters().step();

// We need an actual |Plugin| here rather than a |TestablePlugin|, since
// that's what |ReadFromMessage| returns.
1 change: 0 additions & 1 deletion numerics/cbrt.cpp
Original file line number Diff line number Diff line change
@@ -212,7 +212,6 @@ double Cbrt(double const y) {
_mm_and_pd(_mm_set_sd(ξ), masks::round_toward_zero_17_bits));

// Step 4, the Lagny–Schröder rational method of order 5.
double const x² = x * x;
double const x³ = x * x * x; // Exact.
double const y² = y * y;
double const x_sign_y = _mm_cvtsd_f64(_mm_or_pd(_mm_set_sd(x), sign));
4 changes: 2 additions & 2 deletions numerics/frequency_analysis_test.cpp
Original file line number Diff line number Diff line change
@@ -433,7 +433,7 @@ TEST_F(FrequencyAnalysisTest, PoissonSeriesIncrementalProjectionNoSecular) {
// A perfect calculator for the frequencies of the series.
int ω_index = 0;
auto angular_frequency_calculator =
[&series, t_min, t_max, &ω_index, &ωs](
[t_min, t_max, &ω_index, &ωs](
auto const& residual) -> std::optional<AngularFrequency> {
for (int i = 0; i <= 100; ++i) {
EXPECT_THAT(
@@ -503,7 +503,7 @@ TEST_F(FrequencyAnalysisTest, PoissonSeriesIncrementalProjectionSecular) {
// A perfect calculator for the frequencies of the series.
int ω_index = 0;
auto angular_frequency_calculator =
[&series, t_min, t_max, &ω_index, &ωs](
[t_min, t_max, &ω_index, &ωs](
auto const& residual) -> std::optional<AngularFrequency> {
for (int i = 0; i <= 100; ++i) {
EXPECT_THAT(Abs(residual(t_min + i * (t_max - t_min) / 100)),
4 changes: 2 additions & 2 deletions numerics/newhall_test.cpp
Original file line number Diff line number Diff line change
@@ -777,10 +777,10 @@ TEST_F(NewhallTest, ApproximationInMonomialBasis_2_17) {
}

TEST_F(NewhallTest, Affine) {
auto instant_function = [this](Instant const t) -> Instant {
auto instant_function = [](Instant const t) -> Instant {
return t;
};
auto double_function = [this](Instant const t) -> double {
auto double_function = [](Instant const t) -> double {
return 1;
};

2 changes: 1 addition & 1 deletion numerics/pid_test.cpp
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ TEST_F(PIDTest, Geometry) {

// Merely a compilation test.
FunkyPID pid(kp, ki, kd);
auto i = pid.ComputeControlVariable(F::origin, F::origin, Instant());
pid.ComputeControlVariable(F::origin, F::origin, Instant());
}

} // namespace numerics
2 changes: 0 additions & 2 deletions numerics/poisson_series_basis_test.cpp
Original file line number Diff line number Diff line change
@@ -54,8 +54,6 @@ TEST_F(PoissonSeriesBasisTest, AperiodicScalar) {
/*degree=*/2>::Basis(t1_, t2_);
EXPECT_EQ(3, aperiodic.size());

Instant const t1 = t0_ + 2 * Second;

EXPECT_EQ(1, aperiodic[0](t2_));
EXPECT_EQ(1, aperiodic[1](t2_));
EXPECT_EQ(1, aperiodic[2](t2_));
2 changes: 1 addition & 1 deletion physics/discrete_trajectory_body.hpp
Original file line number Diff line number Diff line change
@@ -158,7 +158,7 @@ typename DiscreteTrajectory<Frame>::SegmentIterator
DiscreteTrajectory<Frame>::NewSegment() {
auto& last_segment = segments_->back();

auto const& new_segment = segments_->emplace_back();
segments_->emplace_back();
auto const new_segment_sit = --segments_->end();
auto const new_self = SegmentIterator(segments_.get(), new_segment_sit);
*new_segment_sit = DiscreteTrajectorySegment<Frame>(new_self);
1 change: 0 additions & 1 deletion physics/discrete_trajectory_segment_test.cpp
Original file line number Diff line number Diff line change
@@ -464,7 +464,6 @@ TEST_F(DiscreteTrajectorySegmentTest, SerializationRoundTrip) {
AppendTrajectoryTimeline(
NewCircularTrajectoryTimeline<World>(ω, r, Δt, t1, t2),
/*to=*/circle);
auto const circle_t_max = circle.t_max();

serialization::DiscreteTrajectorySegment message1;
circle.WriteToMessage(
3 changes: 1 addition & 2 deletions testing_utilities/discrete_trajectory_factories_test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once


#include "testing_utilities/discrete_trajectory_factories.hpp"

#include "geometry/frame.hpp"
1 change: 0 additions & 1 deletion tools/journal_proto_processor.cpp
Original file line number Diff line number Diff line change
@@ -199,7 +199,6 @@ void JournalProtoProcessor::ProcessRepeatedMessageField(
Descriptor const* message_type = descriptor->message_type();
std::string const& message_type_name = message_type->name();

FieldOptions const& options = descriptor->options();
field_cs_type_[descriptor] = message_type_name + "[]";
if (Contains(cs_custom_marshaler_name_, message_type)) {
field_cs_custom_marshaler_[descriptor] =