diff --git a/kernel/src/include/kobject.hpp b/kernel/src/include/kobject.hpp index 5c14d5d..bace557 100644 --- a/kernel/src/include/kobject.hpp +++ b/kernel/src/include/kobject.hpp @@ -9,25 +9,25 @@ class Kref { kobjectType type; void *ptr; unsigned int refctr; - bool set; - Kobject(kobjectType type) { + bool mset; + Kref(kobjectType type) { this->type = type; refctr = 1; - set = false; + mset = false; } template - auto set(T *data) -> Kobject & { - if(set) + auto set(T *data) -> Kref & { + if(mset) return *this; ptr = (void*)data; - set=true; + mset=true; return *this; } template T *get() { return (T*)ptr; } - auto operator++(int) -> Kobject & { + auto operator++(int) -> Kref & { unsigned int old = refctr; refctr++; if(old > refctr) { @@ -37,11 +37,11 @@ class Kref { } return *this; } - auto operator--(int) -> Kobject & { + auto operator--(int) -> Kref & { refctr--; if(!refctr) { //delete ptr; - set = false; + mset = false; ptr = nullptr; } return *this; @@ -49,9 +49,9 @@ class Kref { }; class Kobject { public: - KobjectType type; + kobjectType type; unsigned int refctr; - Kobject(KobjectType type):type(type),refctr(1) {} + Kobject(kobjectType type):type(type),refctr(1) {} virtual ~Kobject() { refctr=0; } @@ -72,4 +72,4 @@ class Kobject { } return *this; } -} +}; diff --git a/kernel/src/include/tty.hpp b/kernel/src/include/tty.hpp index 769b96c..68c4d3a 100644 --- a/kernel/src/include/tty.hpp +++ b/kernel/src/include/tty.hpp @@ -1,5 +1,5 @@ #pragma once -#include +#include enum Color { BLACK, BLUE, diff --git a/kernel/src/tty.cpp b/kernel/src/tty.cpp index b0d1110..2fc74a3 100644 --- a/kernel/src/tty.cpp +++ b/kernel/src/tty.cpp @@ -1,5 +1,5 @@ #include -TTY::TTY(int width, int height): x(0), y(0), width(width), height(height), curColor(WHITE), rgbColor(0xFFFFFF), useRGB(false), Kobject(KobjectType::TTY) {} +TTY::TTY(int width, int height): x(0), y(0), width(width), height(height), curColor(WHITE), rgbColor(0xFFFFFF), useRGB(false), Kobject(kobjectType::TTY) {} TTY::~TTY() {} auto TTY::plotChar(int x, int y, int c) -> void {} auto TTY::rgbSupport() -> bool {return true;}