summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2023-06-21 08:31:07 -0400
committerBenji Dial <benji@benjidial.net>2023-06-21 08:31:07 -0400
commit04b25f18f457e3864f271d6c2f0f03a93d78bd1d (patch)
tree381f7d3dca169780a82d2766b4de6d7b0a7cf072
parent1940ef130528e58cdfe0dd1589091947f6d8b8c7 (diff)
downloadlib94-04b25f18f457e3864f271d6c2f0f03a93d78bd1d.tar.gz
cleaning up includes and a couple comments
-rw-r--r--bench/bench_window.hpp2
-rw-r--r--bench/core_widget.hpp2
-rw-r--r--include/lib94/lib94.hpp4
-rw-r--r--lib94/core.cpp5
-rw-r--r--lib94/executors.cpp2
-rw-r--r--lib94/warrior.cpp4
-rw-r--r--tabulator-mpi/head.cpp1
-rw-r--r--tabulator-mpi/worker.cpp1
8 files changed, 10 insertions, 11 deletions
diff --git a/bench/bench_window.hpp b/bench/bench_window.hpp
index ae75e51..8f0124e 100644
--- a/bench/bench_window.hpp
+++ b/bench/bench_window.hpp
@@ -1,8 +1,10 @@
#ifndef LIB94_BENCH_BENCH_WINDOW_HPP
#define LIB94_BENCH_BENCH_WINDOW_HPP
+#include <lib94/lib94.hpp>
#include <gtkmm.h>
#include <thread>
+#include <set>
#include "core_widget.hpp"
diff --git a/bench/core_widget.hpp b/bench/core_widget.hpp
index 78797c9..cb60ec1 100644
--- a/bench/core_widget.hpp
+++ b/bench/core_widget.hpp
@@ -3,6 +3,8 @@
#include <lib94/lib94.hpp>
#include <gtkmm.h>
+#include <mutex>
+#include <set>
class core_widget : public Gtk::Widget {
public:
diff --git a/include/lib94/lib94.hpp b/include/lib94/lib94.hpp
index b3898d2..b8da8a8 100644
--- a/include/lib94/lib94.hpp
+++ b/include/lib94/lib94.hpp
@@ -1,11 +1,9 @@
#ifndef LIB94_LIB94_HPP
#define LIB94_LIB94_HPP
-#include <filesystem>
#include <optional>
-#include <variant>
+#include <cstdint>
#include <string>
-#include <random>
#include <vector>
#include <deque>
#include <set>
diff --git a/lib94/core.cpp b/lib94/core.cpp
index a19e6b7..db1a911 100644
--- a/lib94/core.cpp
+++ b/lib94/core.cpp
@@ -1,9 +1,8 @@
#include <lib94/lib94.hpp>
#include <functional>
+#include <algorithm>
#include <cassert>
#include <random>
-#include <deque>
-#include <set>
namespace lib94 {
@@ -70,7 +69,7 @@ namespace lib94 {
new_place_at:
number_t place_at = i == 0 ? 0 : number(prng);
- for (std::pair<number_t, number_t> &other : placements)
+ for (const std::pair<number_t, number_t> &other : placements)
//there has to be a better way
for (number_t i = 0; i < (number_t)w->instructions.size(); ++i)
if (((place_at + i) % LIB94_CORE_SIZE >= other.first && (place_at + i) % LIB94_CORE_SIZE < other.first + other.second) ||
diff --git a/lib94/executors.cpp b/lib94/executors.cpp
index 12b371c..0e75cfa 100644
--- a/lib94/executors.cpp
+++ b/lib94/executors.cpp
@@ -2,8 +2,6 @@
#include <functional>
#include <cassert>
-#include <cstdio>
-
namespace lib94 {
void enqueue_process(number_t pc);
diff --git a/lib94/warrior.cpp b/lib94/warrior.cpp
index 7c4d67e..95c61a0 100644
--- a/lib94/warrior.cpp
+++ b/lib94/warrior.cpp
@@ -3,7 +3,6 @@
#include <cassert>
#include <fstream>
#include <cctype>
-#include <cstdio>
#include <memory>
#include <map>
@@ -78,7 +77,7 @@ namespace lib94 {
unsigned source_line_number;
};
- //internal stage used by stage 1. also records the name and author outputs.
+ //internal state used by stage 1. also records some information passed to later stages.
struct preprocessor_state {
std::optional<std::string> name;
std::optional<std::string> author;
@@ -515,6 +514,7 @@ namespace lib94 {
}
+ //some information collected in stage 2
struct parser_state {
label_offset_set label_offsets;
std::unique_ptr<expr> org_expr;
diff --git a/tabulator-mpi/head.cpp b/tabulator-mpi/head.cpp
index 7026746..38fcde6 100644
--- a/tabulator-mpi/head.cpp
+++ b/tabulator-mpi/head.cpp
@@ -1,5 +1,4 @@
#include <lib94/lib94.hpp>
-#include <csignal>
#include <cstdio>
#include <mpi.h>
diff --git a/tabulator-mpi/worker.cpp b/tabulator-mpi/worker.cpp
index 55121aa..511a27a 100644
--- a/tabulator-mpi/worker.cpp
+++ b/tabulator-mpi/worker.cpp
@@ -1,4 +1,5 @@
#include <lib94/lib94.hpp>
+#include <ctime>
#include <mpi.h>
#include "constants.hpp"