diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-18 11:10:53 +0200 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-18 11:10:53 +0200 |
commit | c19415d2ffb6f063f91983ff505e2530ab500908 (patch) | |
tree | 021263be30daa438387ce3a12453a7719bc8dccf /src/kernel/ui | |
parent | 593bf4df3d8db49286c1a7ae4ef75c887b629930 (diff) | |
download | TCE-c19415d2ffb6f063f91983ff505e2530ab500908.tar.gz TCE-c19415d2ffb6f063f91983ff505e2530ab500908.zip |
Minor changes.
Diffstat (limited to 'src/kernel/ui')
-rw-r--r-- | src/kernel/ui/vt.cpp | 6 | ||||
-rw-r--r-- | src/kernel/ui/vt.h | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/kernel/ui/vt.cpp b/src/kernel/ui/vt.cpp index 4675cdc..683d484 100644 --- a/src/kernel/ui/vt.cpp +++ b/src/kernel/ui/vt.cpp @@ -91,11 +91,15 @@ void vt::writeHex(uint32_t v) { } } -void vt::writeDec(uint32_t v) { +void vt::writeDec(int v) { if (v == 0) { put('0'); return; } + if (v < 0) { + put ('-'); + v = -v; + } char numbers[] = "0123456789"; while (v > 0) { diff --git a/src/kernel/ui/vt.h b/src/kernel/ui/vt.h index b4f3672..ebafe5f 100644 --- a/src/kernel/ui/vt.h +++ b/src/kernel/ui/vt.h @@ -28,7 +28,12 @@ class vt : public node { void clear(); void writeStr(char* str); void writeHex(uint32_t v); - void writeDec(uint32_t v); + void writeDec(int v); + // shortcuts + vt& operator<< (char* str) { writeStr(str); return *this; } + vt& operator<< (uint32_t t) { writeHex(t); return *this; } + vt& operator<< (int i) { writeDec(i); return *this; } + int outputTo(display *display); |