Skip to content
Snippets Groups Projects
Unverified Commit dbaa5fdc authored by Dan Church's avatar Dan Church
Browse files

Fix more compiler warnings

Fixes the following warnings when compiling using GCC 5.4:

    CXX OLEDDisplayUi.o
    ./OLEDDisplayUi.cpp: In member function 'void OLEDDisplayUi::drawFrame()':
    ./OLEDDisplayUi.cpp:284:48: error: 'y1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
	    x *= dir; y *= dir; x1 *= dir; y1 *= dir;
						    ^
    ./OLEDDisplayUi.cpp:284:37: error: 'x1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
	    x *= dir; y *= dir; x1 *= dir; y1 *= dir;
					 ^
    ./OLEDDisplayUi.cpp:284:26: error: 'y' may be used uninitialized in this function [-Werror=maybe-uninitialized]
	    x *= dir; y *= dir; x1 *= dir; y1 *= dir;
			      ^
    ./OLEDDisplayUi.cpp:284:16: error: 'x' may be used uninitialized in this function [-Werror=maybe-uninitialized]
	    x *= dir; y *= dir; x1 *= dir; y1 *= dir;
		    ^
    ./OLEDDisplayUi.cpp: In member function 'void OLEDDisplayUi::drawIndicator()':
    ./OLEDDisplayUi.cpp:393:35: error: 'y' may be used uninitialized in this function [-Werror=maybe-uninitialized]
	   this->display->drawFastImage(x, y, 8, 8, image);
				       ^
    ./OLEDDisplayUi.cpp:393:35: error: 'x' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    ./OLEDDisplayUi.cpp:387:7: error: 'posOfHighlightFrame' may be used uninitialized in this function [-Werror=maybe-uninitialized]
	   if (posOfHighlightFrame == i) {
	   ^
    cc1plus: some warnings being treated as errors
parent 4ebb6ec7
No related branches found
No related tags found
No related merge requests found
......@@ -272,6 +272,7 @@ void OLEDDisplayUi::drawFrame(){
y1 = y + 64;
break;
case SLIDE_DOWN:
default:
x = 0;
y = 64 * progress;
x1 = 0;
......@@ -345,6 +346,7 @@ void OLEDDisplayUi::drawIndicator() {
posOfHighlightFrame = frameToHighlight;
break;
case RIGHT_LEFT:
default:
posOfHighlightFrame = this->frameCount - frameToHighlight;
break;
}
......@@ -379,6 +381,7 @@ void OLEDDisplayUi::drawIndicator() {
y = 32 - frameStartPos + 2 + 12 * i;
break;
case LEFT:
default:
x = 0 - (8 * indicatorFadeProgress);
y = 32 - frameStartPos + 2 + 12 * i;
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment