Skip to content

Commit

Permalink
Ignored some strict compiler warnings in this module
Browse files Browse the repository at this point in the history
  • Loading branch information
ClutchplateDude committed May 24, 2024
1 parent c3a8e20 commit 4f596c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/OLEDDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuseless-cast"
#pragma GCC diagnostic ignored "-Wsign-compare"

#include "OLEDDisplay.h"

Expand Down Expand Up @@ -580,8 +581,8 @@ uint16_t OLEDDisplay::drawStringInternal(int16_t xMove, int16_t yMove, const cha
}

// Don't draw anything if it is not on the screen.
if (xMove + textWidth < 0 || xMove >= this->width() ) {return 0;}
if (yMove + textHeight < 0 || yMove >= this->height()) {return 0;}
if ((xMove + (int16_t)textWidth) < 0 || xMove >= this->width() ) {return 0;}
if ((yMove + textHeight) < 0 || yMove >= this->height()) {return 0;}

for (uint16_t j = 0; j < textLength; j++) {
int16_t xPos = xMove + cursorX;
Expand Down

0 comments on commit 4f596c7

Please sign in to comment.