Fixed compiler warning in MicroViewSlider.

In drawFace, majorLine could be left uninitialised if style was invalid
(although this couldn't happen with the current code).
Also cleaned up the WIDGETSTYLE tests.
>This line caused the compiler warning. If the last *else if* failed, it
would fall through and leave majorLine uninitialised.

Thanks. I should probably have coded more defensively here! I tried to code
so that sensible things happened even if undefined styles were passed in/to
set a good example for coders adding future styles, but missed this one.

I also thought about changing the cascading if/else if to a switch
statement -- if we ever get to more than 4 styles, that's probably worth
doing.

--CZ



On Sun, Aug 3, 2014 at 5:42 PM, Scott Allen <notifications@github.com>
wrote:

> In MicroView.cpp:
>
> >  			majorLine=3;
> > -		else if (style==3)
>
> This line caused the compiler warning. If the last *else if* failed, it
> would fall through and leave majorLine uninitialised.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/geekammo/MicroView-Arduino-Library/pull/6/files#r15736685>
> .
>



-- 

The contents of this message represent the
personal opinion of Carl Zetie and do not
reflect the opinions of his employer