summaryrefslogtreecommitdiff
path: root/src/kernel/ui
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-18 11:10:53 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-18 11:10:53 +0200
commitc19415d2ffb6f063f91983ff505e2530ab500908 (patch)
tree021263be30daa438387ce3a12453a7719bc8dccf /src/kernel/ui
parent593bf4df3d8db49286c1a7ae4ef75c887b629930 (diff)
downloadTCE-c19415d2ffb6f063f91983ff505e2530ab500908.tar.gz
TCE-c19415d2ffb6f063f91983ff505e2530ab500908.zip
Minor changes.
Diffstat (limited to 'src/kernel/ui')
-rw-r--r--src/kernel/ui/vt.cpp6
-rw-r--r--src/kernel/ui/vt.h7
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);