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.
Hi Scott,

re:
>No use checking for style 0 at the beginning of the tests and then
defaulting
>to it at the end. Just test for other values and let style 0 be set by the
default.

You are right, but (sometimes) I like to code defensively. While it doesn't
matter now, I wanted to be careful about what might happen if somebody adds
future modifications. Of course, it does add a few bytes, which can
matter...

--CZ



On Sun, Aug 3, 2014 at 5:38 PM, Scott Allen <notifications@github.com>
wrote:

> In MicroView.cpp:
>
> > @@ -1422,11 +1422,7 @@ size_t MicroView::write(uint8_t c) {
> >      Initialise the MicroViewSlider widget with style WIDGETSTYLE0 or WIDGETSTYLE1 or WIDGETSTYLE2 (like 0, but vertical) or WIDGETSTYLE3 (like 1, but vertical). If this list gets any longer, it might be better as a switch/case statement.
> >  */
> >  	MicroViewSlider::MicroViewSlider(uint8_t newx, uint8_t newy, int16_t min, int16_t max, uint8_t sty):MicroViewWidget(newx, newy, min, max) {
> > -		if (sty==WIDGETSTYLE0) {
>
> No use checking for style 0 at the beginning of the tests and then
> defaulting to it at the end. Just test for other values and let style 0 be
> set by the default.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/geekammo/MicroView-Arduino-Library/pull/6/files#r15736670>
> .
>



-- 

The contents of this message represent the
personal opinion of Carl Zetie and do not
reflect the opinions of his employer