From c533941c68b9c22fd57403229df2d60cd579bac3 Mon Sep 17 00:00:00 2001 From: Rotzbua <Rotzbua@users.noreply.github.com> Date: Mon, 19 Mar 2018 15:59:21 +0100 Subject: [PATCH] replace ~0 by UINT8_MAX --- SH1106Brzo.h | 6 +++--- SH1106Spi.h | 6 +++--- SH1106Wire.h | 6 +++--- SSD1306Brzo.h | 6 +++--- SSD1306Spi.h | 6 +++--- SSD1306Wire.h | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/SH1106Brzo.h b/SH1106Brzo.h index 56a2bb8..8ef3d5b 100644 --- a/SH1106Brzo.h +++ b/SH1106Brzo.h @@ -62,10 +62,10 @@ class SH1106Brzo : public OLEDDisplay { void display(void) { #ifdef OLEDDISPLAY_DOUBLE_BUFFER - uint8_t minBoundY = ~0; + uint8_t minBoundY = UINT8_MAX; uint8_t maxBoundY = 0; - uint8_t minBoundX = ~0; + uint8_t minBoundX = UINT8_MAX; uint8_t maxBoundX = 0; uint8_t x, y; @@ -88,7 +88,7 @@ class SH1106Brzo : public OLEDDisplay { // If the minBoundY wasn't updated // we can savely assume that buffer_back[pos] == buffer[pos] // holdes true for all values of pos - if (minBoundY == ~0) return; + if (minBoundY == UINT8_MAX) return; byte k = 0; uint8_t sendBuffer[17]; diff --git a/SH1106Spi.h b/SH1106Spi.h index 1267c07..cf8f088 100644 --- a/SH1106Spi.h +++ b/SH1106Spi.h @@ -65,10 +65,10 @@ class SH1106Spi : public OLEDDisplay { void display(void) { #ifdef OLEDDISPLAY_DOUBLE_BUFFER - uint8_t minBoundY = ~0; + uint8_t minBoundY = UINT8_MAX; uint8_t maxBoundY = 0; - uint8_t minBoundX = ~0; + uint8_t minBoundX = UINT8_MAX; uint8_t maxBoundX = 0; uint8_t x, y; @@ -92,7 +92,7 @@ class SH1106Spi : public OLEDDisplay { // If the minBoundY wasn't updated // we can savely assume that buffer_back[pos] == buffer[pos] // holdes true for all values of pos - if (minBoundY == ~0) return; + if (minBoundY == UINT8_MAX) return; // Calculate the colum offset uint8_t minBoundXp2H = (minBoundX + 2) & 0x0F; diff --git a/SH1106Wire.h b/SH1106Wire.h index d2cceb4..486ba1a 100644 --- a/SH1106Wire.h +++ b/SH1106Wire.h @@ -65,10 +65,10 @@ class SH1106Wire : public OLEDDisplay { void display(void) { #ifdef OLEDDISPLAY_DOUBLE_BUFFER - uint8_t minBoundY = ~0; + uint8_t minBoundY = UINT8_MAX; uint8_t maxBoundY = 0; - uint8_t minBoundX = ~0; + uint8_t minBoundX = UINT8_MAX; uint8_t maxBoundX = 0; uint8_t x, y; @@ -92,7 +92,7 @@ class SH1106Wire : public OLEDDisplay { // If the minBoundY wasn't updated // we can savely assume that buffer_back[pos] == buffer[pos] // holdes true for all values of pos - if (minBoundY == ~0) return; + if (minBoundY == UINT8_MAX) return; // Calculate the colum offset uint8_t minBoundXp2H = (minBoundX + 2) & 0x0F; diff --git a/SSD1306Brzo.h b/SSD1306Brzo.h index 9c0093d..e90b7b3 100644 --- a/SSD1306Brzo.h +++ b/SSD1306Brzo.h @@ -62,10 +62,10 @@ class SSD1306Brzo : public OLEDDisplay { void display(void) { #ifdef OLEDDISPLAY_DOUBLE_BUFFER - uint8_t minBoundY = ~0; + uint8_t minBoundY = UINT8_MAX; uint8_t maxBoundY = 0; - uint8_t minBoundX = ~0; + uint8_t minBoundX = UINT8_MAX; uint8_t maxBoundX = 0; uint8_t x, y; @@ -89,7 +89,7 @@ class SSD1306Brzo : public OLEDDisplay { // If the minBoundY wasn't updated // we can savely assume that buffer_back[pos] == buffer[pos] // holdes true for all values of pos - if (minBoundY == ~0) return; + if (minBoundY == UINT8_MAX) return; sendCommand(COLUMNADDR); sendCommand(minBoundX); diff --git a/SSD1306Spi.h b/SSD1306Spi.h index 5a311ba..988dc2c 100644 --- a/SSD1306Spi.h +++ b/SSD1306Spi.h @@ -74,10 +74,10 @@ class SSD1306Spi : public OLEDDisplay { void display(void) { #ifdef OLEDDISPLAY_DOUBLE_BUFFER - uint8_t minBoundY = ~0; + uint8_t minBoundY = UINT8_MAX; uint8_t maxBoundY = 0; - uint8_t minBoundX = ~0; + uint8_t minBoundX = UINT8_MAX; uint8_t maxBoundX = 0; uint8_t x, y; @@ -101,7 +101,7 @@ class SSD1306Spi : public OLEDDisplay { // If the minBoundY wasn't updated // we can savely assume that buffer_back[pos] == buffer[pos] // holdes true for all values of pos - if (minBoundY == ~0) return; + if (minBoundY == UINT8_MAX) return; sendCommand(COLUMNADDR); sendCommand(minBoundX); diff --git a/SSD1306Wire.h b/SSD1306Wire.h index 60c1d42..a3d0a05 100644 --- a/SSD1306Wire.h +++ b/SSD1306Wire.h @@ -62,10 +62,10 @@ class SSD1306Wire : public OLEDDisplay { initI2cIfNeccesary(); const int x_offset = (128 - this->width()) / 2; #ifdef OLEDDISPLAY_DOUBLE_BUFFER - uint8_t minBoundY = ~0; + uint8_t minBoundY = UINT8_MAX; uint8_t maxBoundY = 0; - uint8_t minBoundX = ~0; + uint8_t minBoundX = UINT8_MAX; uint8_t maxBoundX = 0; uint8_t x, y; @@ -89,7 +89,7 @@ class SSD1306Wire : public OLEDDisplay { // we can savely assume that buffer_back[pos] == buffer[pos] // holdes true for all values of pos - if (minBoundY == (uint8_t)(~0)) return; + if (minBoundY == UINT8_MAX) return; sendCommand(COLUMNADDR); sendCommand(x_offset + minBoundX); -- GitLab