diff --git a/sortix/device.h b/sortix/device.h index 477d56ce..35204246 100644 --- a/sortix/device.h +++ b/sortix/device.h @@ -49,7 +49,7 @@ namespace Sortix void Unref(); public: - virtual bool IsType(unsigned type) = 0; + virtual bool IsType(unsigned type) const = 0; }; } diff --git a/sortix/directory.h b/sortix/directory.h index 8f0bd6a3..4dfa7381 100644 --- a/sortix/directory.h +++ b/sortix/directory.h @@ -50,7 +50,7 @@ namespace Sortix virtual int Read(sortix_dirent* dirent, size_t available) = 0; public: - virtual bool IsType(unsigned type) { return type == Device::DIRECTORY; } + virtual bool IsType(unsigned type) const { return type == Device::DIRECTORY; } }; diff --git a/sortix/filesystem.h b/sortix/filesystem.h index 84920f7c..e4a4a8a8 100644 --- a/sortix/filesystem.h +++ b/sortix/filesystem.h @@ -58,7 +58,7 @@ namespace Sortix virtual bool Unlink(const char* path) = 0; public: - virtual bool IsType(unsigned type) { return type == Device::FILESYSTEM; } + virtual bool IsType(unsigned type) const { return type == Device::FILESYSTEM; } }; diff --git a/sortix/fs/devfs.cpp b/sortix/fs/devfs.cpp index 3fcf9f9f..d6dde43e 100644 --- a/sortix/fs/devfs.cpp +++ b/sortix/fs/devfs.cpp @@ -163,7 +163,7 @@ namespace Sortix virtual ssize_t Write(const byte* src, size_t count); virtual bool IsReadable(); virtual bool IsWritable(); - virtual bool IsType(unsigned type); + virtual bool IsType(unsigned type) const; }; @@ -199,7 +199,7 @@ namespace Sortix return true; } - bool DevLogTTY::IsType(unsigned type) + bool DevLogTTY::IsType(unsigned type) const { return type == Device::TTY || BaseClass::IsType(type); } diff --git a/sortix/stream.h b/sortix/stream.h index d4e751bb..e5b85c17 100644 --- a/sortix/stream.h +++ b/sortix/stream.h @@ -35,7 +35,7 @@ namespace Sortix typedef Device BaseClass; public: - virtual bool IsType(unsigned type) { return type == Device::STREAM; } + virtual bool IsType(unsigned type) const { return type == Device::STREAM; } public: virtual ssize_t Read(byte* dest, size_t count) = 0; @@ -51,7 +51,7 @@ namespace Sortix typedef DevStream BaseClass; public: - virtual bool IsType(unsigned type) + virtual bool IsType(unsigned type) const { return type == Device::BUFFER || BaseClass::IsType(type); }