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: 1143705ab413
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f9d1326d0876
Choose a head ref
  • 4 commits
  • 3 files changed
  • 1 contributor

Commits on Feb 22, 2020

  1. libc++ version.

    pleroy committed Feb 22, 2020
    Copy the full SHA
    492cdbd View commit details
  2. Revert #2344.

    pleroy committed Feb 22, 2020
    Copy the full SHA
    4b5be04 View commit details
  3. More reverting of #2344.

    pleroy committed Feb 22, 2020
    Copy the full SHA
    250cca9 View commit details
  4. Merge pull request #2479 from pleroy/2345

    Upgrade to Xcode 11 and revert #2344
    pleroy authored Feb 22, 2020
    Copy the full SHA
    f9d1326 View commit details
Showing with 16 additions and 34 deletions.
  1. +1 −1 Makefile
  2. +10 −18 ksp_plugin/pile_up.cpp
  3. +5 −15 ksp_plugin/plugin.cpp
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ ifeq ($(UNAME_S),Linux)
endif
ifeq ($(UNAME_S),Darwin)
INCLUDES += -I$(DEP_DIR)compatibility/filesystem -I$(DEP_DIR)compatibility/optional -I$(DEP_DIR)Optional
SHARED_ARGS += -mmacosx-version-min=10.12 -arch x86_64
SHARED_ARGS += -mmacosx-version-min=10.12 -arch x86_64 -D_LIBCPP_STD_VER=16
MDTOOL ?= "/Applications/Xamarin Studio.app/Contents/MacOS/mdtool"
SHAREDFLAG := -dynamiclib
endif
28 changes: 10 additions & 18 deletions ksp_plugin/pile_up.cpp
Original file line number Diff line number Diff line change
@@ -146,15 +146,11 @@ void PileUp::WriteToMessage(not_null<serialization::PileUp*> message) const {
}
history_->WriteToMessage(message->mutable_history(),
/*forks=*/{psychohistory_});
for (auto const& pair : actual_part_rigid_motion_) {
auto const part = pair.first;
auto const& rigid_motion = pair.second;
for (auto const& [part, rigid_motion] : actual_part_rigid_motion_) {
rigid_motion.WriteToMessage(&(
(*message->mutable_actual_part_rigid_motion())[part->part_id()]));
}
for (auto const& pair : apparent_part_rigid_motion_) {
auto const part = pair.first;
auto const& rigid_motion = pair.second;
for (auto const& [part, rigid_motion] : apparent_part_rigid_motion_) {
rigid_motion.WriteToMessage(&(
(*message->mutable_apparent_part_rigid_motion())[part->part_id()]));
}
@@ -237,36 +233,32 @@ not_null<std::unique_ptr<PileUp>> PileUp::ReadFromMessage(
}

if (is_pre_frege) {
for (auto const& pair : message.actual_part_degrees_of_freedom()) {
std::uint32_t const part_id = pair.first;
serialization::Pair const& degrees_of_freedom = pair.second;
for (auto const& [part_id, degrees_of_freedom] :
message.actual_part_degrees_of_freedom()) {
pile_up->actual_part_rigid_motion_.emplace(
part_id_to_part(part_id),
RigidMotion<RigidPart, NonRotatingPileUp>::MakeNonRotatingMotion(
DegreesOfFreedom<NonRotatingPileUp>::ReadFromMessage(
degrees_of_freedom)));
}
for (auto const& pair : message.apparent_part_degrees_of_freedom()) {
std::uint32_t const part_id = pair.first;
serialization::Pair const& degrees_of_freedom = pair.second;
for (auto const& [part_id, degrees_of_freedom] :
message.apparent_part_degrees_of_freedom()) {
pile_up->apparent_part_rigid_motion_.emplace(
part_id_to_part(part_id),
RigidMotion<RigidPart, ApparentBubble>::MakeNonRotatingMotion(
DegreesOfFreedom<ApparentBubble>::ReadFromMessage(
degrees_of_freedom)));
}
} else {
for (auto const& pair : message.actual_part_rigid_motion()) {
std::uint32_t const part_id = pair.first;
serialization::RigidMotion const& rigid_motion = pair.second;
for (auto const& [part_id, rigid_motion] :
message.actual_part_rigid_motion()) {
pile_up->actual_part_rigid_motion_.emplace(
part_id_to_part(part_id),
RigidMotion<RigidPart, NonRotatingPileUp>::ReadFromMessage(
rigid_motion));
}
for (auto const& pair : message.apparent_part_rigid_motion()) {
std::uint32_t const part_id = pair.first;
serialization::RigidMotion const& rigid_motion = pair.second;
for (auto const& [part_id, rigid_motion] :
message.apparent_part_rigid_motion()) {
pile_up->apparent_part_rigid_motion_.emplace(
part_id_to_part(part_id),
RigidMotion<RigidPart, ApparentBubble>::ReadFromMessage(
20 changes: 5 additions & 15 deletions ksp_plugin/plugin.cpp
Original file line number Diff line number Diff line change
@@ -244,9 +244,7 @@ void Plugin::EndInitialization() {
}

// Establish the parent relationships between the celestials.
for (auto const& pair : celestials_) {
Index const celestial_index = pair.first;
auto const& celestial = pair.second;
for (auto const& [celestial_index, celestial] : celestials_) {
auto const& parent_index = FindOrDie(parents_, celestial_index);
if (parent_index) {
not_null<Celestial const*> parent =
@@ -1267,14 +1265,10 @@ void Plugin::WriteToMessage(
CHECK(!initializing_);
ephemeris_->Prolong(current_time_);
std::map<not_null<Celestial const*>, Index const> celestial_to_index;
for (auto const& pair : celestials_) {
Index const index = pair.first;
auto const& owned_celestial = pair.second;
for (auto const& [index, owned_celestial] : celestials_) {
celestial_to_index.emplace(owned_celestial.get(), index);
}
for (auto const& pair : celestials_) {
Index const index = pair.first;
auto const& owned_celestial = pair.second.get();
for (auto const& [index, owned_celestial] : celestials_) {
auto* const celestial_message = message->add_celestial();
celestial_message->set_index(index);
if (owned_celestial->has_parent()) {
@@ -1309,9 +1303,7 @@ void Plugin::WriteToMessage(
vessel_message->set_loaded(Contains(loaded_vessels_, vessel.get()));
vessel_message->set_kept(Contains(kept_vessels_, vessel.get()));
}
for (auto const& pair : part_id_to_vessel_) {
PartId const part_id = pair.first;
not_null<Vessel*> const vessel = pair.second;
for (auto const& [part_id, vessel] : part_id_to_vessel_) {
(*message->mutable_part_id_to_vessel())[part_id] = vessel_to_guid[vessel];
}
for (auto const& [guid, parameters] :
@@ -1393,9 +1385,7 @@ not_null<std::unique_ptr<Plugin>> Plugin::ReadFromMessage(
CHECK(inserted);
}

for (auto const& pair : message.part_id_to_vessel()) {
PartId const part_id = pair.first;
GUID const guid = pair.second;
for (auto const& [part_id, guid] : message.part_id_to_vessel()) {
auto const& vessel = FindOrDie(plugin->vessels_, guid);
plugin->part_id_to_vessel_.emplace(part_id, vessel.get());
}