Skip to content

Commit

Permalink
refactor: fix missing includes in sources
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart committed Oct 17, 2024
1 parent ec29ecc commit e76a0d4
Show file tree
Hide file tree
Showing 34 changed files with 239 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/json-util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "bracket-note.h"
#include "interpret.h"
#include "json-util.h"
#include "json.hpp"
#include "jsonrpc-connection.h"
#include "machine-config.h"
#include "machine-memory-range-descr.h"
#include "machine-merkle-tree.h"
Expand Down
2 changes: 2 additions & 0 deletions src/jsonrpc-machine-c-api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
//

#include <cassert>
#include <cerrno>
#include <csignal>
#include <cstdint>
#include <cstdio>
Expand All @@ -27,6 +28,7 @@
#include <string>
#include <sys/time.h>
#include <system_error>
#include <tuple>
#include <unistd.h>

#include "access-log.h"
Expand Down
16 changes: 14 additions & 2 deletions src/jsonrpc-remote-machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <algorithm>
#include <array>
#include <cerrno>
#include <climits>
#include <csignal>
#include <cstdint>
#include <cstdio>
Expand All @@ -26,6 +27,7 @@
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
#include <stdexcept>
#include <string>
#include <string_view>
Expand All @@ -35,7 +37,9 @@
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#include <sys/socket.h>
#include <unistd.h>

#pragma GCC diagnostic push
Expand All @@ -46,17 +50,25 @@
#include <boost/beast/version.hpp>
#pragma GCC diagnostic pop

#include <json.hpp>

#include "access-log.h"
#include "base64.h"
#include "interpret.h"
#include "json-util.h"
#include "jsonrpc-connection.h"
#include "jsonrpc-discover.h"
#include "machine-config.h"
#include "machine-merkle-tree.h"
#include "machine-runtime-config.h"
#include "machine.h"
#include "os.h"
#include "uarch-interpret.h"
#include "unique-c-ptr.h"

#define SLOG_PREFIX log_prefix
#include "slog.h"

#include "os.h"

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define PROGRAM_NAME "jsonrpc-remote-cartesi-machine"

Expand Down
15 changes: 15 additions & 0 deletions src/jsonrpc-virtual-machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@
#include "jsonrpc-virtual-machine.h"

#include <csignal>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <exception>
#include <stdexcept>
#include <string>
#include <tuple>
#include <utility>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
Expand All @@ -29,10 +35,19 @@
#include <boost/beast/version.hpp>
#pragma GCC diagnostic pop

#include "access-log.h"
#include "base64.h"
#include "interpret.h"
#include "json-util.h"
#include "json.hpp"
#include "jsonrpc-connection.h"
#include "machine-config.h"
#include "machine-memory-range-descr.h"
#include "machine-merkle-tree.h"
#include "machine-runtime-config.h"
#include "os.h"
#include "semantic-version.h"
#include "uarch-interpret.h"

using namespace std::string_literals;
using json = nlohmann::json;
Expand Down
16 changes: 12 additions & 4 deletions src/machine-c-api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,35 @@
//

#include "machine-c-api.h"
#include "machine-c-api-internal.h"

#include <any>
#include <cstdint>
#include <cstring>
#include <exception>
#include <functional>
#include <memory>
#include <new>
#include <optional>
#include <regex>
#include <stdexcept>
#include <string>
#include <system_error>
#include <typeinfo>
#include <variant>

#include "access-log.h"
#include "htif.h"
#include "i-virtual-machine.h"
#include "json-util.h"
#include "machine-c-api-internal.h"
#include "machine-config.h"
#include "machine-memory-range-descr.h"
#include "machine-merkle-tree.h"
#include "machine-runtime-config.h"
#include "machine.h"
#include "os-features.h"
#include "virtual-machine.h"

#include "htif.h"
#include "pma-constants.h"
#include "virtual-machine.h"

// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
static THREAD_LOCAL std::string last_err_msg;
Expand Down
6 changes: 6 additions & 0 deletions src/machine-config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@

#include "machine-config.h"

#include <cerrno>
#include <cstdint>
#include <exception>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include <string>
#include <system_error>

#include "json-util.h"
#include "json.hpp"
#include "pma-constants.h"

static constexpr uint32_t archive_version = 5;
Expand Down
5 changes: 5 additions & 0 deletions src/machine-merkle-tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@
//

#include "machine-merkle-tree.h"
#include "i-hasher.h"
#include "pristine-merkle-tree.h"

#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <tuple>

/// \file
/// \brief Merkle tree implementation.
Expand Down
25 changes: 24 additions & 1 deletion src/machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,48 @@

#include "machine.h"

#include <algorithm>
#include <cerrno>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>

#include <memory>
#include <string>
#include <system_error>
#include <type_traits>
#include <utility>
#include <variant>

#include <boost/container/static_vector.hpp>
#include <boost/range/adaptor/sliced.hpp>

#include "access-log.h"
#include "bracket-note.h"
#include "clint-factory.h"
#include "dtb.h"
#include "htif-factory.h"
#include "htif.h"
#include "i-device-state-access.h"
#include "interpret.h"
#include "machine-config.h"
#include "machine-memory-range-descr.h"
#include "machine-runtime-config.h"
#include "os.h"
#include "plic-factory.h"
#include "pma-constants.h"
#include "pma-defines.h"
#include "pma.h"
#include "record-state-access.h"
#include "replay-state-access.h"
#include "riscv-constants.h"
#include "send-cmio-response.h"
#include "shadow-pmas-factory.h"
#include "shadow-state-factory.h"
#include "shadow-state.h"
#include "shadow-tlb-factory.h"
#include "shadow-tlb.h"
#include "shadow-uarch-state.h"
#include "state-access.h"
#include "strict-aliasing.h"
Expand All @@ -48,6 +70,7 @@
#include "uarch-step.h"
#include "unique-c-ptr.h"
#include "virtio-console.h"
#include "virtio-device.h"
#include "virtio-factory.h"
#include "virtio-net-carrier-slirp.h"
#include "virtio-net-carrier-tuntap.h"
Expand Down
2 changes: 2 additions & 0 deletions src/merkle-tree-hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <tuple>

#include "back-merkle-tree.h"
#include "i-hasher.h"
#include "keccak-256-hasher.h"
#include "unique-c-ptr.h"

Expand Down
5 changes: 5 additions & 0 deletions src/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@
//

#include <array>
#include <cerrno>
#include <chrono>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <exception>
#include <functional>
#include <string>
#include <system_error>
#include <tuple>
#include <vector>

#include "compiler-defines.h"
Expand Down
4 changes: 4 additions & 0 deletions src/plic-factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@

#include "plic-factory.h"

#include <cstdint>

#include "plic.h"
#include "pma-constants.h"
#include "pma.h"

namespace cartesi {

Expand Down
11 changes: 8 additions & 3 deletions src/plic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@
//

#include "plic.h"
#include "i-device-state-access.h"
#include "pma-constants.h"
#include "riscv-constants.h"

#include <cassert>
#include <cstdint>
#include <cstdio>

#include "i-device-state-access.h"
#include "interpret.h"
#include "pma-constants.h"
#include "pma-defines.h"
#include "pma-driver.h"
#include "riscv-constants.h"

// Enable these defines to debug PLIC
// #define DEBUG_PLIC
// #define DEBUG_PLIC_MMIO
Expand Down
4 changes: 4 additions & 0 deletions src/pma-driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

#include "pma-driver.h"

#include <cstdint>

#include "interpret.h"

namespace cartesi {

bool device_read_error(void * /*context*/, i_device_state_access * /*a*/, uint64_t /*offset*/, uint64_t * /*val*/,
Expand Down
7 changes: 7 additions & 0 deletions src/pma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@
#include "pma.h"

#include <cerrno>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <exception>
#include <string>
#include <system_error>
#include <tuple>

#include "os.h"
#include "pma-constants.h"
#include "pma-driver.h"
#include "unique-c-ptr.h"

namespace cartesi {
Expand Down
5 changes: 5 additions & 0 deletions src/pristine-merkle-tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@

#include "pristine-merkle-tree.h"

#include <algorithm>
#include <cassert>
#include <cstdint>
#include <stdexcept>
#include <vector>

#include "i-hasher.h"

/// \file
/// \brief Pristine Merkle tree implementation.
Expand Down
3 changes: 3 additions & 0 deletions src/send-cmio-response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#include "state-access.h"

#include "send-cmio-response.h"

#include "machine-merkle-tree.h"
#include "pma-constants.h"
#include "uarch-solidity-compat.h"

namespace cartesi {
Expand Down
3 changes: 3 additions & 0 deletions src/shadow-pmas-factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@

#include "shadow-pmas-factory.h"

#include <cstdint>
#include <cstring>

#include "machine.h"
#include "pma-constants.h"
#include "pma.h"
#include "shadow-pmas.h"

namespace cartesi {
Expand Down
3 changes: 3 additions & 0 deletions src/shadow-pmas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@

#include "shadow-pmas.h"
#include "i-device-state-access.h"
#include "pma-constants.h"
#include "pma-driver.h"

#include <cstddef>
#include <cstdint>

namespace cartesi {

Expand Down
Loading

0 comments on commit e76a0d4

Please sign in to comment.