Skip to content

Commit f8e9621

Browse files
Fixes -Wshadow "error: declaration of 'buffer' shadows a member of 'GFXcanvas1'"
No need to declare local buffer variable for getBuffer() since it already exists.
1 parent 976bfb3 commit f8e9621

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Adafruit_GFX.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,8 +1867,7 @@ bool GFXcanvas1::getPixel(int16_t x, int16_t y) const {
18671867
bool GFXcanvas1::getRawPixel(int16_t x, int16_t y) const {
18681868
if ((x < 0) || (y < 0) || (x >= WIDTH) || (y >= HEIGHT))
18691869
return 0;
1870-
if (this->getBuffer()) {
1871-
uint8_t *buffer = this->getBuffer();
1870+
if (buffer) {
18721871
uint8_t *ptr = &buffer[(x / 8) + y * ((WIDTH + 7) / 8)];
18731872

18741873
#ifdef __AVR__
@@ -2017,7 +2016,6 @@ void GFXcanvas1::drawFastRawVLine(int16_t x, int16_t y, int16_t h,
20172016
uint16_t color) {
20182017
// x & y already in raw (rotation 0) coordinates, no need to transform.
20192018
int16_t row_bytes = ((WIDTH + 7) / 8);
2020-
uint8_t *buffer = this->getBuffer();
20212019
uint8_t *ptr = &buffer[(x / 8) + y * row_bytes];
20222020

20232021
if (color > 0) {
@@ -2056,7 +2054,6 @@ void GFXcanvas1::drawFastRawHLine(int16_t x, int16_t y, int16_t w,
20562054
uint16_t color) {
20572055
// x & y already in raw (rotation 0) coordinates, no need to transform.
20582056
int16_t rowBytes = ((WIDTH + 7) / 8);
2059-
uint8_t *buffer = this->getBuffer();
20602057
uint8_t *ptr = &buffer[(x / 8) + y * rowBytes];
20612058
size_t remainingWidthBits = w;
20622059

0 commit comments

Comments
 (0)