1

Make classes uppercase

This commit is contained in:
2022-12-07 21:35:50 +01:00
parent bd95f86035
commit 6f3a7ae028
15 changed files with 31 additions and 31 deletions

View File

@ -20,8 +20,8 @@ namespace Device {
const IOport CGA::index_port(0x3d4);
const IOport CGA::data_port(0x3d5);
const Container::span<CGA::cga_char_t, CGA::ROWS * CGA::COLUMNS> CGA::SCREEN{reinterpret_cast<CGA::cga_char_t *>(0xb8000U)};
const Container::span<CGA::cga_line_t, CGA::ROWS> CGA::SCREEN_ROWS{reinterpret_cast<CGA::cga_line_t *>(0xb8000U)};
const Container::Span<CGA::cga_char_t, CGA::ROWS * CGA::COLUMNS> CGA::SCREEN{reinterpret_cast<CGA::cga_char_t *>(0xb8000U)};
const Container::Span<CGA::cga_line_t, CGA::ROWS> CGA::SCREEN_ROWS{reinterpret_cast<CGA::cga_line_t *>(0xb8000U)};
CGA::cga_page_t *const CGA::SCREEN_PAGE{reinterpret_cast<CGA::cga_page_t *>(0xb8000U)};
/*****************************************************************************

View File

@ -78,15 +78,15 @@ public:
struct cga_line_t {
// Can use these arrays since they don't have memory overhead (except for the methods that are elsewhere)
Container::array<cga_char_t, COLUMNS> cga_line;
Container::Array<cga_char_t, COLUMNS> cga_line;
};
struct cga_page_t {
Container::array<cga_line_t, ROWS> cga_page;
Container::Array<cga_line_t, ROWS> cga_page;
};
static const Container::span<cga_char_t, ROWS * COLUMNS> SCREEN;
static const Container::span<cga_line_t, ROWS> SCREEN_ROWS;
static const Container::Span<cga_char_t, ROWS * COLUMNS> SCREEN;
static const Container::Span<cga_line_t, ROWS> SCREEN_ROWS;
static cga_page_t *const SCREEN_PAGE; // No span because can't address anything in [0, 1]
// Setzen des Cursors in Spalte x und Zeile y.

View File

@ -28,7 +28,7 @@ private:
}; /* ns */
uint32_t timer_interval;
const Container::array<char, 4> indicator{'|', '/', '-', '\\'};
const Container::Array<char, 4> indicator{'|', '/', '-', '\\'};
uint8_t indicator_pos = 0;
uint64_t last_indicator_refresh = 0;

View File

@ -10,7 +10,7 @@ void KeyEventManager::subscribe(KeyEventListener &sub) {
void KeyEventManager::unsubscribe(KeyEventListener &unsub) {
log.debug() << "Unsubscribe, Thread ID: " << dec << unsub.tid << endl;
for (Container::vector<KeyEventListener *>::iterator it = listeners.begin(); it != listeners.end(); ++it) {
for (Container::Vector<KeyEventListener *>::iterator it = listeners.begin(); it != listeners.end(); ++it) {
if ((*it)->tid == unsub.tid) {
listeners.erase(it);
return;

View File

@ -14,7 +14,7 @@ class KeyEventManager {
private:
NamedLogger log;
Container::vector<KeyEventListener *> listeners;
Container::Vector<KeyEventListener *> listeners;
public:
KeyEventManager(const KeyEventManager &copy) = delete;

View File

@ -26,7 +26,7 @@ private:
enum {
size = 256
};
Container::array<ISR *, size> map;
Container::Array<ISR *, size> map;
public:
IntDispatcher(const IntDispatcher &copy) = delete; // Verhindere Kopieren

View File

@ -37,7 +37,7 @@ constexpr const bool INSANE_TRACE = false;
* Parameter: *
* next Thread der die CPU::erhalten soll. *
*****************************************************************************/
void Scheduler::start(Container::vector<Memory::unique_ptr<Thread>>::iterator next) {
void Scheduler::start(Container::Vector<Memory::unique_ptr<Thread>>::iterator next) {
active = next;
if (active >= ready_queue.end()) {
active = ready_queue.begin();
@ -49,7 +49,7 @@ void Scheduler::start(Container::vector<Memory::unique_ptr<Thread>>::iterator ne
(*active)->start(); // First dereference the Iterator, then the unique_ptr to get Thread
}
void Scheduler::switch_to(Thread *prev_raw, Container::vector<Memory::unique_ptr<Thread>>::iterator next) {
void Scheduler::switch_to(Thread *prev_raw, Container::Vector<Memory::unique_ptr<Thread>>::iterator next) {
active = next;
if (active >= ready_queue.end()) {
active = ready_queue.begin();
@ -139,7 +139,7 @@ void Scheduler::kill(uint32_t tid, Memory::unique_ptr<Thread> *ptr) {
uint32_t prev_tid = (*active)->tid;
// Block queue, can always kill
for (Container::vector<Memory::unique_ptr<Thread>>::iterator it = block_queue.begin(); it != block_queue.end(); ++it) {
for (Container::Vector<Memory::unique_ptr<Thread>>::iterator it = block_queue.begin(); it != block_queue.end(); ++it) {
if ((*it)->tid == tid) {
// Found thread to kill
@ -165,7 +165,7 @@ void Scheduler::kill(uint32_t tid, Memory::unique_ptr<Thread> *ptr) {
return;
}
for (Container::vector<Memory::unique_ptr<Thread>>::iterator it = ready_queue.begin(); it != ready_queue.end(); ++it) {
for (Container::Vector<Memory::unique_ptr<Thread>>::iterator it = ready_queue.begin(); it != ready_queue.end(); ++it) {
if ((*it)->tid == tid) {
// Found thread to kill
@ -322,7 +322,7 @@ void Scheduler::deblock(uint32_t tid) {
Device::CPU::disable_int();
for (Container::vector<Memory::unique_ptr<Thread>>::iterator it = block_queue.begin(); it != block_queue.end(); ++it) {
for (Container::Vector<Memory::unique_ptr<Thread>>::iterator it = block_queue.begin(); it != block_queue.end(); ++it) {
if ((*it)->tid == tid) {
// Found thread with correct tid

View File

@ -23,20 +23,20 @@ class Scheduler {
private:
NamedLogger log;
Container::vector<Memory::unique_ptr<Thread>> ready_queue;
Container::vector<Memory::unique_ptr<Thread>> block_queue;
Container::Vector<Memory::unique_ptr<Thread>> ready_queue;
Container::Vector<Memory::unique_ptr<Thread>> block_queue;
// NOTE: It makes sense to keep track of the active thread through this as it makes handling the
// unique_ptr easier and reduces the copying in the vector when cycling through the threads
Container::vector<Memory::unique_ptr<Thread>>::iterator active = nullptr;
Container::Vector<Memory::unique_ptr<Thread>>::iterator active = nullptr;
// Scheduler wird evt. von einer Unterbrechung vom Zeitgeber gerufen,
// bevor er initialisiert wurde
uint32_t idle_tid = 0U;
// Roughly the old dispatcher functionality
void start(Container::vector<Memory::unique_ptr<Thread>>::iterator next); // Start next without prev
void switch_to(Thread *prev_raw, Container::vector<Memory::unique_ptr<Thread>>::iterator next); // Switch from prev to next
void start(Container::Vector<Memory::unique_ptr<Thread>>::iterator next); // Start next without prev
void switch_to(Thread *prev_raw, Container::Vector<Memory::unique_ptr<Thread>>::iterator next); // Switch from prev to next
// Kann nur vom Idle-Thread aufgerufen werden (erster Thread der vom Scheduler gestartet wird)
void enable_preemption(uint32_t tid) { idle_tid = tid; }

View File

@ -20,7 +20,7 @@ namespace Async {
class Semaphore {
private:
// Queue fuer wartende Threads.
Container::vector<unsigned int> wait_queue;
Container::Vector<unsigned int> wait_queue;
SpinLock lock;
int counter;

View File

@ -1,8 +1,8 @@
#include "ArrayDemo.h"
void ArrayDemo::run() {
Container::array<int, 10> arr1 {};
Container::array<int, 10> arr2 {};
Container::Array<int, 10> arr1 {};
Container::Array<int, 10> arr2 {};
Kernel::kout.lock();
Kernel::kout.clear();

View File

@ -84,7 +84,7 @@ void SmartPointerDemo::run() {
{
log.info() << "Stackallocating Array<bse::unique_ptr<int>, 10>..." << endl;
Container::array<Memory::unique_ptr<int>, 10> arr;
Container::Array<Memory::unique_ptr<int>, 10> arr;
log.info() << "Populating slot 0..." << endl;
arr[0] = Memory::make_unique<int>(1);
log.info() << "Moving slot 0 to slot 1..." << endl;
@ -95,7 +95,7 @@ void SmartPointerDemo::run() {
{
log.info() << "Heapallocating Array<bse::unique_ptr<int>, 10>..." << endl;
Container::array<Memory::unique_ptr<int>, 10>* arr = new Container::array<Memory::unique_ptr<int>, 10>;
Container::Array<Memory::unique_ptr<int>, 10>* arr = new Container::Array<Memory::unique_ptr<int>, 10>;
log.info() << "Populating slot 0..." << endl;
(*arr)[0] = Memory::make_unique<int>(1);
log.info() << "Moving slot 0 to slot 1..." << endl;
@ -108,7 +108,7 @@ void SmartPointerDemo::run() {
{
log.info() << "ArrayList<bse::unique_ptr<int>>..." << endl;
Container::vector<Memory::unique_ptr<int>> vec;
Container::Vector<Memory::unique_ptr<int>> vec;
log.info() << "2x insertion" << endl;
vec.push_back(Memory::make_unique<int>(1));
vec.push_back(Memory::make_unique<int>(2));

View File

@ -42,7 +42,7 @@ void StringDemo::run() {
log.info() << "Reassign str2" << endl;
str2 = "Hello";
Container::array<char, 5> arr{};
Container::Array<char, 5> arr{};
arr[0] = 'H';
arr[1] = 'e';
arr[2] = 'l';

View File

@ -1,6 +1,6 @@
#include "VectorDemo.h"
void print(OutStream& os, const Container::vector<int>& list) {
void print(OutStream& os, const Container::Vector<int>& list) {
os << "Printing List: ";
for (const int i : list) {
os << i << " ";
@ -9,7 +9,7 @@ void print(OutStream& os, const Container::vector<int>& list) {
}
void VectorDemo::run() {
Container::vector<int> list;
Container::Vector<int> list;
Kernel::kout.lock();
Kernel::kout.clear();

View File

@ -28,7 +28,7 @@ class StringBuffer {
// werden und kann dann auch public werden.
protected:
Container::array<char, 80> buffer;
Container::Array<char, 80> buffer;
int pos;
// StringBuffer: Im Konstruktor wird der Puffer als leer markiert.

View File

@ -28,7 +28,7 @@ namespace String {
// Convert char array to string
template<std::size_t N>
explicit string(const Container::array<char, N>& arr) : len(N), buf(new char[len + 1]) {
explicit string(const Container::Array<char, N>& arr) : len(N), buf(new char[len + 1]) {
for (std::size_t i = 0; i < N; ++i) {
buf[i] = arr[i];
}