From ffe95ec86647a343c333f756dcd6f0fd1e0348fb Mon Sep 17 00:00:00 2001 From: Lode Date: Wed, 19 Feb 2020 22:32:48 +0100 Subject: fix potential compiler warning for enum value not handled in switch --- lodepng.cpp | 6 ++++-- lodepng.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lodepng.cpp b/lodepng.cpp index a7564e7..2ef6766 100644 --- a/lodepng.cpp +++ b/lodepng.cpp @@ -1,5 +1,5 @@ /* -LodePNG version 20200215 +LodePNG version 20200219 Copyright (c) 2005-2020 Lode Vandevenne @@ -44,7 +44,7 @@ Rename this file to lodepng.cpp to use it for C++, or to lodepng.c to use it for #pragma warning( disable : 4996 ) /*VS does not like fopen, but fopen_s is not standard C so unusable here*/ #endif /*_MSC_VER */ -const char* LODEPNG_VERSION_STRING = "20200215"; +const char* LODEPNG_VERSION_STRING = "20200219"; /* This source file is built up in the following large parts. The code sections @@ -2606,6 +2606,7 @@ static unsigned checkColorValidity(LodePNGColorType colortype, unsigned bd) { case LCT_PALETTE: if(!(bd == 1 || bd == 2 || bd == 4 || bd == 8 )) return 37; break; case LCT_GREY_ALPHA: if(!( bd == 8 || bd == 16)) return 37; break; case LCT_RGBA: if(!( bd == 8 || bd == 16)) return 37; break; + case LCT_MAX_OCTET_VALUE: return 31; /* invalid color type */ default: return 31; /* invalid color type */ } return 0; /*allowed color type / bits combination*/ @@ -2618,6 +2619,7 @@ static unsigned getNumColorChannels(LodePNGColorType colortype) { case LCT_PALETTE: return 1; case LCT_GREY_ALPHA: return 2; case LCT_RGBA: return 4; + case LCT_MAX_OCTET_VALUE: return 0; /* invalid color type */ default: return 0; /*invalid color type*/ } } diff --git a/lodepng.h b/lodepng.h index 6ce3976..86634d6 100644 --- a/lodepng.h +++ b/lodepng.h @@ -1,5 +1,5 @@ /* -LodePNG version 20200215 +LodePNG version 20200219 Copyright (c) 2005-2020 Lode Vandevenne -- cgit v1.2.3