summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2015-03-09 07:56:22 +0000
committerJose Fonseca <jfonseca@vmware.com>2015-03-09 07:56:22 +0000
commit684771c0c8079015721ab36a5b06cd9ee8136324 (patch)
tree18e516c8eb64b5c6880043c15d29406a5e85dbc6 /common
parent5d861fe673b5904fe2c219a4ebe71820a65181c5 (diff)
cli,common: Use static_assert where appropriate.
Diffstat (limited to 'common')
-rw-r--r--common/trace_writer.cpp4
1 files changed, 2 insertions, 2 deletions
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);
}