summaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-12-08 18:19:13 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-12-08 18:19:13 +0100
commit812899797d6d8ea773bf960cd74680d20043c5a4 (patch)
tree470bb05de36285e9f8b86fa34daebd163e3860ed /src/os
parente1526bb2c84b315c72a089dbb50447183d4b1685 (diff)
add licensing information
Diffstat (limited to 'src/os')
-rw-r--r--src/os/object/cpp_helpers.cc5
-rw-r--r--src/os/object/outputstream.cc12
-rw-r--r--src/os/object/xdr16input.cc5
-rw-r--r--src/os/object/xdr16stream.cc7
-rw-r--r--src/os/object/xdrinput.cc9
-rw-r--r--src/os/object/xdrstream.cc9
6 files changed, 33 insertions, 14 deletions
diff --git a/src/os/object/cpp_helpers.cc b/src/os/object/cpp_helpers.cc
index aad8020..59e1e97 100644
--- a/src/os/object/cpp_helpers.cc
+++ b/src/os/object/cpp_helpers.cc
@@ -1,3 +1,8 @@
+/*
+ * Copyright 2020 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
extern "C" void __cxa_pure_virtual()
{
//while (1);
diff --git a/src/os/object/outputstream.cc b/src/os/object/outputstream.cc
index d97f0d9..c509b07 100644
--- a/src/os/object/outputstream.cc
+++ b/src/os/object/outputstream.cc
@@ -1,3 +1,8 @@
+/*
+ * Copyright 2020 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
#include "object/outputstream.h"
OutputStream & OutputStream::operator<<(unsigned char c)
@@ -192,14 +197,12 @@ void OutputStream::printf_float(float num)
put('0' + ((unsigned int)(num * 100) % 10));
}
-// FLUSH
OutputStream & flush(OutputStream & os)
{
os.flush();
return os;
}
-// ENDL: fuegt einen Zeilenumbruch in die Ausgabe ein.
OutputStream & endl(OutputStream & os)
{
os.put('\n');
@@ -207,35 +210,30 @@ OutputStream & endl(OutputStream & os)
return os;
}
-// BIN: print numbers in binary form
OutputStream & bin(OutputStream & os)
{
os.setBase(2);
return os;
}
-// OCT: print numbers in octal form.
OutputStream & oct(OutputStream & os)
{
os.setBase(8);
return os;
}
-// DEC: print numbers in decimal form.
OutputStream & dec(OutputStream & os)
{
os.setBase(10);
return os;
}
-// HEX: print numbers in hexadecimal form.
OutputStream & hex(OutputStream & os)
{
os.setBase(16);
return os;
}
-// TERM: null-termination
OutputStream & term(OutputStream & os)
{
os.put('\0');
diff --git a/src/os/object/xdr16input.cc b/src/os/object/xdr16input.cc
index 407f6ea..2247c29 100644
--- a/src/os/object/xdr16input.cc
+++ b/src/os/object/xdr16input.cc
@@ -1,3 +1,8 @@
+/*
+ * Copyright 2020 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
#include "object/xdr16input.h"
uint16_t XDRInput::get_uint16()
diff --git a/src/os/object/xdr16stream.cc b/src/os/object/xdr16stream.cc
index 082b2a3..7f2a414 100644
--- a/src/os/object/xdr16stream.cc
+++ b/src/os/object/xdr16stream.cc
@@ -1,3 +1,8 @@
+/*
+ * Copyright 2020 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
#include "object/xdr16stream.h"
XDRStream & XDRStream::operator<<(unsigned char c)
@@ -126,14 +131,12 @@ XDRStream & XDRStream::operator<<(XDRStream & (*fkt) (XDRStream &))
return fkt(*this);
}
-// FLUSH
XDRStream & flush(XDRStream & os)
{
os.flush();
return os;
}
-// TERM: null-termination
XDRStream & term(XDRStream & os)
{
os.put('\0');
diff --git a/src/os/object/xdrinput.cc b/src/os/object/xdrinput.cc
index e722fdd..c98c110 100644
--- a/src/os/object/xdrinput.cc
+++ b/src/os/object/xdrinput.cc
@@ -1,3 +1,8 @@
+/*
+ * Copyright 2020 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
#include "object/xdrinput.h"
uint32_t XDRInput::get_uint32()
@@ -41,7 +46,7 @@ float XDRInput::get_float()
uint32_t i;
float f;
} v;
- // Setting one member of a struct and then reading another is undefined
+ // Setting one member of a union and then reading another is undefined
// behaviour, but works as intended in nearly any (embedded) compiler
v.i = get_uint32();
return v.f;
@@ -53,7 +58,7 @@ double XDRInput::get_double()
uint64_t i;
double d;
} v;
- // Setting one member of a struct and then reading another is undefined
+ // Setting one member of a union and then reading another is undefined
// behaviour, but works as intended in nearly any (embedded) compiler
v.i = get_uint64();
return v.d;
diff --git a/src/os/object/xdrstream.cc b/src/os/object/xdrstream.cc
index f0c9365..9dc5a1b 100644
--- a/src/os/object/xdrstream.cc
+++ b/src/os/object/xdrstream.cc
@@ -1,3 +1,8 @@
+/*
+ * Copyright 2020 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
#include "object/xdrstream.h"
XDRStream & XDRStream::operator<<(unsigned char c)
@@ -87,7 +92,7 @@ XDRStream & XDRStream::operator<<(double number)
uint64_t i;
double d;
} v;
- // Setting one member of a struct and then reading another is undefined
+ // Setting one member of a union and then reading another is undefined
// behaviour, but works as intended in nearly any (embedded) compiler
v.d = number;
*this << v.i;
@@ -128,14 +133,12 @@ XDRStream & XDRStream::operator<<(XDRStream & (*fkt) (XDRStream &))
return fkt(*this);
}
-// FLUSH
XDRStream & flush(XDRStream & os)
{
os.flush();
return os;
}
-// TERM: null-termination
XDRStream & term(XDRStream & os)
{
os.put('\0');