From 78ef4b9499200d9c55e5ed537f7f037538583367 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Wed, 2 Oct 2019 06:12:38 +0100 Subject: COMMON: Add Default Cases to Switch Statements in Memstream Classes These are flagged by GCC if -Wswitch-default is enabled. This avoids possible hard to diagnose bugs if the whence int parameter is accidently set to an unexpected value. --- common/memstream.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/memstream.h b/common/memstream.h index 991268ce10..68cfdce97c 100644 --- a/common/memstream.h +++ b/common/memstream.h @@ -137,6 +137,8 @@ public: offset = size() + offset; // Fall through case SEEK_SET: + // Fall through + default: _ptr = _ptrOrig + offset; _pos = offset; break; @@ -219,6 +221,8 @@ public: offs = _size + offs; // Fall through case SEEK_SET: + // Fall through + default: _ptr = _data + offs; _pos = offs; break; -- cgit v1.2.3