projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r439: no message
[ctsim.git]
/
libctsupport
/
fnetorderstream.cpp
diff --git
a/libctsupport/fnetorderstream.cpp
b/libctsupport/fnetorderstream.cpp
index 7fff7a3623966e9a32553e0cc776b7bf409607ff..41d1ead4e27c29e8f251a16b7f7429767dc600de 100644
(file)
--- a/
libctsupport/fnetorderstream.cpp
+++ b/
libctsupport/fnetorderstream.cpp
@@
-48,133
+48,133
@@
ConvertReverseNetworkOrder (void* buffer, size_t bytes)
#endif
}
#endif
}
-fnetorderstream& fnetorderstream::writeInt16 (kuint16 n) {
+void
+fnetorderstream::writeInt16 (kuint16 n) {
#ifndef WORDS_BIGENDIAN
SwapBytes2 (&n);
#endif
#ifndef WORDS_BIGENDIAN
SwapBytes2 (&n);
#endif
- write (&n, 2);
- return (*this);
+ write (reinterpret_cast<const char*>(&n), 2);
}
}
-fnetorderstream& fnetorderstream::writeInt32 (kuint32 n) {
+void
+fnetorderstream::writeInt32 (kuint32 n) {
#ifndef WORDS_BIGENDIAN
SwapBytes4(&n);
#endif
#ifndef WORDS_BIGENDIAN
SwapBytes4(&n);
#endif
- write (&n, 4);
- return (*this);
+ write (reinterpret_cast<const char*>(&n), 4);
}
}
-fnetorderstream& fnetorderstream::writeFloat32 (kfloat32 n) {
+void
+fnetorderstream::writeFloat32 (kfloat32 n) {
#ifndef WORDS_BIGENDIAN
SwapBytes4 (&n);
#endif
#ifndef WORDS_BIGENDIAN
SwapBytes4 (&n);
#endif
- write (&n, 4);
- return (*this);
+ write (reinterpret_cast<const char*>(&n), 4);
}
}
-fnetorderstream& fnetorderstream::writeFloat64 (kfloat64 n) {
+void
+fnetorderstream::writeFloat64 (kfloat64 n) {
#ifndef WORDS_BIGENDIAN
SwapBytes8 (&n);
#endif
#ifndef WORDS_BIGENDIAN
SwapBytes8 (&n);
#endif
- write (&n, 8);
- return (*this);
+ write (reinterpret_cast<const char*>(&n), 8);
}
}
-fnetorderstream& fnetorderstream::readInt16 (kuint16& n) {
- read (&n, 2);
+void
+fnetorderstream::readInt16 (kuint16& n) {
+ read (reinterpret_cast<char*>(&n), 2);
#ifndef WORDS_BIGENDIAN
SwapBytes2 (&n);
#endif
#ifndef WORDS_BIGENDIAN
SwapBytes2 (&n);
#endif
- return (*this);
}
}
-fnetorderstream& fnetorderstream::readInt32 (kuint32& n) {
- read (&n, 4);
+void
+fnetorderstream::readInt32 (kuint32& n) {
+ read (reinterpret_cast<char*>(&n), 4);
#ifndef WORDS_BIGENDIAN
SwapBytes4 (&n);
#endif
#ifndef WORDS_BIGENDIAN
SwapBytes4 (&n);
#endif
- return (*this);
}
}
-fnetorderstream& fnetorderstream::readFloat32 (kfloat32& n) {
- read (&n, 4);
+void
+fnetorderstream::readFloat32 (kfloat32& n) {
+ read (reinterpret_cast<char*>(&n), 4);
#ifndef WORDS_BIGENDIAN
SwapBytes4 (&n);
#endif
#ifndef WORDS_BIGENDIAN
SwapBytes4 (&n);
#endif
- return (*this);
}
}
-fnetorderstream& fnetorderstream::readFloat64 (kfloat64& n) {
- read (&n, 8);
+void
+fnetorderstream::readFloat64 (kfloat64& n) {
+ read (reinterpret_cast<char*>(&n), 8);
#ifndef WORDS_BIGENDIAN
SwapBytes8 (&n);
#endif
#ifndef WORDS_BIGENDIAN
SwapBytes8 (&n);
#endif
- return (*this);
}
}
-frnetorderstream& frnetorderstream::writeInt16 (kuint16 n) {
+void
+frnetorderstream::writeInt16 (kuint16 n) {
#ifdef WORDS_BIGENDIAN
SwapBytes2 (&n);
#endif
#ifdef WORDS_BIGENDIAN
SwapBytes2 (&n);
#endif
- write (&n, 2);
- return (*this);
+ write (reinterpret_cast<char*>(&n), 2);
}
}
-frnetorderstream& frnetorderstream::writeInt32 (kuint32 n) {
+void
+frnetorderstream::writeInt32 (kuint32 n) {
#ifdef WORDS_BIGENDIAN
SwapBytes4(&n);
#endif
#ifdef WORDS_BIGENDIAN
SwapBytes4(&n);
#endif
- write (&n, 4);
- return (*this);
+ write (reinterpret_cast<char*>(&n), 4);
}
}
-frnetorderstream& frnetorderstream::writeFloat32 (kfloat32 n) {
+void
+frnetorderstream::writeFloat32 (kfloat32 n) {
#ifdef WORDS_BIGENDIAN
SwapBytes4 (&n);
#endif
#ifdef WORDS_BIGENDIAN
SwapBytes4 (&n);
#endif
- write (&n, 4);
- return (*this);
+ write (reinterpret_cast<char*>(&n), 4);
}
}
-frnetorderstream& frnetorderstream::writeFloat64 (kfloat64 n) {
+void
+frnetorderstream::writeFloat64 (kfloat64 n) {
#ifdef WORDS_BIGENDIAN
SwapBytes8 (&n);
#endif
#ifdef WORDS_BIGENDIAN
SwapBytes8 (&n);
#endif
- write (&n, 8);
- return (*this);
+ write (reinterpret_cast<char*>(&n), 8);
}
}
-frnetorderstream& frnetorderstream::readInt16 (kuint16& n) {
- read (&n, 2);
+void
+frnetorderstream::readInt16 (kuint16& n) {
+ read (reinterpret_cast<char*>(&n), 2);
#ifdef WORDS_BIGENDIAN
SwapBytes2 (&n);
#endif
#ifdef WORDS_BIGENDIAN
SwapBytes2 (&n);
#endif
- return (*this);
}
}
-frnetorderstream& frnetorderstream::readInt32 (kuint32& n) {
- read (&n, 4);
+void
+frnetorderstream::readInt32 (kuint32& n) {
+ read (reinterpret_cast<char*>(&n), 4);
#ifdef WORDS_BIGENDIAN
SwapBytes4 (&n);
#endif
#ifdef WORDS_BIGENDIAN
SwapBytes4 (&n);
#endif
- return (*this);
}
}
-frnetorderstream& frnetorderstream::readFloat32 (kfloat32& n) {
- read (&n, 4);
+void
+frnetorderstream::readFloat32 (kfloat32& n) {
+ read (reinterpret_cast<char*>(&n), 4);
#ifdef WORDS_BIGENDIAN
SwapBytes4 (&n);
#endif
#ifdef WORDS_BIGENDIAN
SwapBytes4 (&n);
#endif
- return (*this);
}
}
-frnetorderstream& frnetorderstream::readFloat64 (kfloat64& n) {
- read (&n, 8);
+void
+frnetorderstream::readFloat64 (kfloat64& n) {
+ read (reinterpret_cast<char*>(&n), 8);
#ifdef WORDS_BIGENDIAN
SwapBytes8 (&n);
#endif
#ifdef WORDS_BIGENDIAN
SwapBytes8 (&n);
#endif
- return (*this);
}
}