From: Arvin Schnell Date: Tue, 2 Oct 2018 17:57:27 +0000 (+0200) Subject: - added compile time check X-Git-Tag: v0.6.0~2^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7dc4cba6cf76603ced2013299b93dc56b531c96f;p=thirdparty%2Fsnapper.git - added compile time check --- diff --git a/client/utils/HumanString.cc b/client/utils/HumanString.cc index 6abd3ce2..ebf53ee9 100644 --- a/client/utils/HumanString.cc +++ b/client/utils/HumanString.cc @@ -112,6 +112,8 @@ namespace snapper // Calculate the index of the suffix to use. The index increases by 1 // when the number of leading zeros decreases by 10. + static_assert(sizeof(size) == 8, "unsigned long long not 64 bit"); + int i = size > 0 ? (64 - (clz(size) + 1)) / 10 : 0; if (i == 0)