From b9477f76ab4d9bfbd320da106756133ea8c89b81 Mon Sep 17 00:00:00 2001 From: ChUrl Date: Sun, 24 Jul 2022 16:55:53 +0200 Subject: [PATCH] nullptr instead of 0 --- c_os/kernel/interrupts/IntDispatcher.cc | 2 +- c_os/kernel/interrupts/IntDispatcher.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/c_os/kernel/interrupts/IntDispatcher.cc b/c_os/kernel/interrupts/IntDispatcher.cc index 10987b6..392d866 100755 --- a/c_os/kernel/interrupts/IntDispatcher.cc +++ b/c_os/kernel/interrupts/IntDispatcher.cc @@ -91,7 +91,7 @@ int IntDispatcher::report(unsigned int vector) { ISR* isr = this->map[vector]; - if (isr == 0) { + if (isr == nullptr) { log.error() << "No ISR registered for vector " << vector << endl; return -1; } diff --git a/c_os/kernel/interrupts/IntDispatcher.h b/c_os/kernel/interrupts/IntDispatcher.h index aa31739..a1da8ad 100755 --- a/c_os/kernel/interrupts/IntDispatcher.h +++ b/c_os/kernel/interrupts/IntDispatcher.h @@ -18,14 +18,14 @@ class IntDispatcher { private: - IntDispatcher(const IntDispatcher& copy) = delete; // Verhindere Kopieren - NamedLogger log; enum { size = 256 }; ISR* map[size]; public: + IntDispatcher(const IntDispatcher& copy) = delete; // Verhindere Kopieren + // Vektor-Nummern enum { timer = 32, @@ -35,8 +35,8 @@ public: // Initialisierung der ISR map mit einer Default-ISR. IntDispatcher() : log("IntDis") { - for (unsigned int slot = 0; slot < size; slot++) { - map[slot] = 0; + for (ISR*& slot : map) { + slot = nullptr; } }