Skip to content
Draft
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
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ RUN apt-get -y update \
&& apt-get install -y ccache

RUN if [ -n "$USE_CLANG" ]; then \
apt-get -y install clang; \
apt-get -y install clang-22; \
else \
apt-get -y install gcc-15 g++-15 \
&& update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-15 100 \
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-15 100 \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-15 100 \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-15 100; \
apt-get -y install gcc-16 g++-16 \
&& update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-16 100 \
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-16 100 \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-16 100 \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-16 100; \
fi

RUN wget -q https://archives.boost.io/release/1.90.0/source/boost_1_90_0.tar.gz \
Expand Down
3 changes: 1 addition & 2 deletions src/login/Survey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ void Survey::add_data(const grunt::Platform platform, const grunt::System os, co
data_.insert_or_assign(key, std::move(buffer));
}

std::optional<std::reference_wrapper<const FileMeta>>
Survey::meta(const grunt::Platform platform, const grunt::System os) const {
std::optional<const FileMeta&> Survey::meta(const grunt::Platform platform, const grunt::System os) const {
if(auto it = meta_.find({ platform, os }); it != meta_.end()) {
return it->second;
}
Expand Down
3 changes: 1 addition & 2 deletions src/login/Survey.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ class Survey final {
void add_data(grunt::Platform platform, grunt::System os, const std::string& path);

[[nodiscard]]
std::optional<std::reference_wrapper<const FileMeta>>
meta(grunt::Platform platform, grunt::System os) const;
std::optional<const FileMeta&> meta(grunt::Platform platform, grunt::System os) const;

[[nodiscard]]
std::optional<std::span<const std::byte>>
Expand Down
3 changes: 1 addition & 2 deletions src/login/grunt/Handler.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 - 2024 Ember
* Copyright (c) 2015 - 2026 Ember
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -11,7 +11,6 @@
#include "Packets.h"
#include <spark/buffers/pmr/Buffer.h>
#include <logger/LoggerFwd.h>
#include <functional>
#include <optional>
#include <type_traits>
#include <variant>
Expand Down
8 changes: 3 additions & 5 deletions src/tools/dbcparser/Validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace ember::dbc {
* Searches DBC definitions for the given foreign key.
* Only child structs of the root node are considered for matches.
*/
std::optional<std::reference_wrapper<const types::Field>> Validator::locate_fk_parent(const std::string_view parent) {
std::optional<const types::Field&> Validator::locate_fk_parent(const std::string_view parent) {
LOG_TRACE_GLOB << log_func << LOG_ASYNC;

for(auto& def : *definitions_) {
Expand Down Expand Up @@ -63,13 +63,11 @@ void Validator::check_foreign_keys(const types::Field& field) {
std::format("{} references a primary key in {} that does not exist", field.name, key.parent)
);
}

const auto& pk_ref = pk->get();

if(!key.ignore_type_mismatch && pk_ref.underlying_type != components.first) {
if(!key.ignore_type_mismatch && pk->underlying_type != components.first) {
throw exception(
std::format(":{} => {} types do not match. Expected {}, found {}",
field.name, key.parent, components.first, pk_ref.underlying_type)
field.name, key.parent, components.first, pk->underlying_type)
);
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/tools/dbcparser/Validator.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "Types.h"
#include "TypeUtils.h"
#include "TreeNode.h"
#include <functional>
#include <format>
#include <optional>
#include <string>
Expand Down Expand Up @@ -67,7 +66,7 @@ class Validator final {
void check_multiple_definitions(const types::Base* def);
void check_key_types(const types::Field& def);
void check_foreign_keys(const types::Field& def);
std::optional<std::reference_wrapper<const types::Field>> locate_fk_parent(const std::string_view parent);
std::optional<const types::Field&> locate_fk_parent(const std::string_view parent);

void build_type_tree();
void recursive_type_parse(TreeNode<std::string>* parent, const types::Base* def);
Expand Down
Loading