From 2cff50d7a805c028a5dce2d71e4dcdf782731892 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 3 Mar 2020 14:01:51 -0800 Subject: [PATCH] Fix return value for new plugin Even when we throw, we still need to provide a default return value that will never be reached for MSVC Fixes #3982 | https://gitlab.com/kicad/code/kicad/issues/3982 --- eeschema/sch_legacy_plugin.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/eeschema/sch_legacy_plugin.cpp b/eeschema/sch_legacy_plugin.cpp index 6d680df29d..8ca4f87b6a 100644 --- a/eeschema/sch_legacy_plugin.cpp +++ b/eeschema/sch_legacy_plugin.cpp @@ -3178,13 +3178,20 @@ void SCH_LEGACY_PLUGIN_CACHE::loadDrawEntries( std::unique_ptr& aPart, FILL_T SCH_LEGACY_PLUGIN_CACHE::parseFillMode( LINE_READER& aReader, const char* aLine, const char** aOutput ) { - switch( parseChar( aReader, aLine, aOutput ) ) + switch ( parseChar( aReader, aLine, aOutput ) ) { - case 'F': return FILLED_SHAPE; - case 'f': return FILLED_WITH_BG_BODYCOLOR; - case 'N': return NO_FILL; - default: SCH_PARSE_ERROR( "invalid fill type, expected f, F, or N", aReader, aLine ); + case 'F': + return FILLED_SHAPE; + case 'f': + return FILLED_WITH_BG_BODYCOLOR; + case 'N': + return NO_FILL; + default: + SCH_PARSE_ERROR( "invalid fill type, expected f, F, or N", aReader, aLine ); } + + // This will never be reached but quiets the compiler warnings + return NO_FILL; }