From 37b79b74c33a303ec0c19cf9c169211d4d16e7d1 Mon Sep 17 00:00:00 2001 From: Hans Dembinski Date: Tue, 10 Jan 2017 20:35:17 +0100 Subject: [PATCH] fixing case hole --- include/boost/histogram/dynamic_storage.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/histogram/dynamic_storage.hpp b/include/boost/histogram/dynamic_storage.hpp index 561cc0cc..ad00025b 100644 --- a/include/boost/histogram/dynamic_storage.hpp +++ b/include/boost/histogram/dynamic_storage.hpp @@ -181,13 +181,14 @@ dynamic_storage& dynamic_storage::operator+=(const dynamic_storage& o) while (i--) { uint64_t n = 0; switch (o.depth()) { + case 0: /* nothing to do */ break; case sizeof(uint8_t) : n = o.buffer_.at (i); break; case sizeof(uint16_t): n = o.buffer_.at(i); break; case sizeof(uint32_t): n = o.buffer_.at(i); break; case sizeof(uint64_t): n = o.buffer_.at(i); break; } switch (buffer_.depth()) { - case 0: buffer_.depth(sizeof(uint8_t)); // fall through + case 0: buffer_.depth(sizeof(uint8_t)); // and fall through case sizeof(uint8_t) : add_impl (buffer_, i, n); break; case sizeof(uint16_t): add_impl(buffer_, i, n); break; case sizeof(uint32_t): add_impl(buffer_, i, n); break;