summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/pickle.hpp2
-rw-r--r--common/trace_writer.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/cli/pickle.hpp b/cli/pickle.hpp
index 753cd6f1..20dbb13d 100644
--- a/cli/pickle.hpp
+++ b/cli/pickle.hpp
@@ -300,7 +300,7 @@ public:
char c[8];
} u;
- assert(sizeof u.f == sizeof u.c);
+ static_assert(sizeof u.f == sizeof u.c, "double is not 8 bytes");
u.f = f;
os.put(BINFLOAT);
diff --git a/common/trace_writer.cpp b/common/trace_writer.cpp
index 37a6320b..fb3ff9ba 100644
--- a/common/trace_writer.cpp
+++ b/common/trace_writer.cpp
@@ -109,13 +109,13 @@ Writer::_writeUInt(unsigned long long value) {
void inline
Writer::_writeFloat(float value) {
- assert(sizeof value == 4);
+ static_assert(sizeof value == 4, "float is not 4 bytes");
_write((const char *)&value, sizeof value);
}
void inline
Writer::_writeDouble(double value) {
- assert(sizeof value == 8);
+ static_assert(sizeof value == 8, "double is not 8 bytes");
_write((const char *)&value, sizeof value);
}