@@ -718,16 +718,16 @@ void Adafruit_GFX::drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
718718 int16_t w, int16_t h, uint16_t color) {
719719
720720 int16_t byteWidth = (w + 7 ) / 8 ; // Bitmap scanline pad = whole byte
721- uint8_t byte = 0 ;
721+ uint8_t b = 0 ;
722722
723723 startWrite ();
724724 for (int16_t j = 0 ; j < h; j++, y++) {
725725 for (int16_t i = 0 ; i < w; i++) {
726726 if (i & 7 )
727- byte <<= 1 ;
727+ b <<= 1 ;
728728 else
729- byte = pgm_read_byte (&bitmap[j * byteWidth + i / 8 ]);
730- if (byte & 0x80 )
729+ b = pgm_read_byte (&bitmap[j * byteWidth + i / 8 ]);
730+ if (b & 0x80 )
731731 writePixel (x + i, y, color);
732732 }
733733 }
@@ -753,16 +753,16 @@ void Adafruit_GFX::drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
753753 uint16_t bg) {
754754
755755 int16_t byteWidth = (w + 7 ) / 8 ; // Bitmap scanline pad = whole byte
756- uint8_t byte = 0 ;
756+ uint8_t b = 0 ;
757757
758758 startWrite ();
759759 for (int16_t j = 0 ; j < h; j++, y++) {
760760 for (int16_t i = 0 ; i < w; i++) {
761761 if (i & 7 )
762- byte <<= 1 ;
762+ b <<= 1 ;
763763 else
764- byte = pgm_read_byte (&bitmap[j * byteWidth + i / 8 ]);
765- writePixel (x + i, y, (byte & 0x80 ) ? color : bg);
764+ b = pgm_read_byte (&bitmap[j * byteWidth + i / 8 ]);
765+ writePixel (x + i, y, (b & 0x80 ) ? color : bg);
766766 }
767767 }
768768 endWrite ();
@@ -784,16 +784,16 @@ void Adafruit_GFX::drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w,
784784 int16_t h, uint16_t color) {
785785
786786 int16_t byteWidth = (w + 7 ) / 8 ; // Bitmap scanline pad = whole byte
787- uint8_t byte = 0 ;
787+ uint8_t b = 0 ;
788788
789789 startWrite ();
790790 for (int16_t j = 0 ; j < h; j++, y++) {
791791 for (int16_t i = 0 ; i < w; i++) {
792792 if (i & 7 )
793- byte <<= 1 ;
793+ b <<= 1 ;
794794 else
795- byte = bitmap[j * byteWidth + i / 8 ];
796- if (byte & 0x80 )
795+ b = bitmap[j * byteWidth + i / 8 ];
796+ if (b & 0x80 )
797797 writePixel (x + i, y, color);
798798 }
799799 }
@@ -818,16 +818,16 @@ void Adafruit_GFX::drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w,
818818 int16_t h, uint16_t color, uint16_t bg) {
819819
820820 int16_t byteWidth = (w + 7 ) / 8 ; // Bitmap scanline pad = whole byte
821- uint8_t byte = 0 ;
821+ uint8_t b = 0 ;
822822
823823 startWrite ();
824824 for (int16_t j = 0 ; j < h; j++, y++) {
825825 for (int16_t i = 0 ; i < w; i++) {
826826 if (i & 7 )
827- byte <<= 1 ;
827+ b <<= 1 ;
828828 else
829- byte = bitmap[j * byteWidth + i / 8 ];
830- writePixel (x + i, y, (byte & 0x80 ) ? color : bg);
829+ b = bitmap[j * byteWidth + i / 8 ];
830+ writePixel (x + i, y, (b & 0x80 ) ? color : bg);
831831 }
832832 }
833833 endWrite ();
@@ -852,18 +852,18 @@ void Adafruit_GFX::drawXBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
852852 int16_t w, int16_t h, uint16_t color) {
853853
854854 int16_t byteWidth = (w + 7 ) / 8 ; // Bitmap scanline pad = whole byte
855- uint8_t byte = 0 ;
855+ uint8_t b = 0 ;
856856
857857 startWrite ();
858858 for (int16_t j = 0 ; j < h; j++, y++) {
859859 for (int16_t i = 0 ; i < w; i++) {
860860 if (i & 7 )
861- byte >>= 1 ;
861+ b >>= 1 ;
862862 else
863- byte = pgm_read_byte (&bitmap[j * byteWidth + i / 8 ]);
863+ b = pgm_read_byte (&bitmap[j * byteWidth + i / 8 ]);
864864 // Nearly identical to drawBitmap(), only the bit order
865865 // is reversed here (left-to-right = LSB to MSB):
866- if (byte & 0x01 )
866+ if (b & 0x01 )
867867 writePixel (x + i, y, color);
868868 }
869869 }
@@ -937,15 +937,15 @@ void Adafruit_GFX::drawGrayscaleBitmap(int16_t x, int16_t y,
937937 const uint8_t mask[], int16_t w,
938938 int16_t h) {
939939 int16_t bw = (w + 7 ) / 8 ; // Bitmask scanline pad = whole byte
940- uint8_t byte = 0 ;
940+ uint8_t b = 0 ;
941941 startWrite ();
942942 for (int16_t j = 0 ; j < h; j++, y++) {
943943 for (int16_t i = 0 ; i < w; i++) {
944944 if (i & 7 )
945- byte <<= 1 ;
945+ b <<= 1 ;
946946 else
947- byte = pgm_read_byte (&mask[j * bw + i / 8 ]);
948- if (byte & 0x80 ) {
947+ b = pgm_read_byte (&mask[j * bw + i / 8 ]);
948+ if (b & 0x80 ) {
949949 writePixel (x + i, y, (uint8_t )pgm_read_byte (&bitmap[j * w + i]));
950950 }
951951 }
@@ -971,15 +971,15 @@ void Adafruit_GFX::drawGrayscaleBitmap(int16_t x, int16_t y,
971971void Adafruit_GFX::drawGrayscaleBitmap (int16_t x, int16_t y, uint8_t *bitmap,
972972 uint8_t *mask, int16_t w, int16_t h) {
973973 int16_t bw = (w + 7 ) / 8 ; // Bitmask scanline pad = whole byte
974- uint8_t byte = 0 ;
974+ uint8_t b = 0 ;
975975 startWrite ();
976976 for (int16_t j = 0 ; j < h; j++, y++) {
977977 for (int16_t i = 0 ; i < w; i++) {
978978 if (i & 7 )
979- byte <<= 1 ;
979+ b <<= 1 ;
980980 else
981- byte = mask[j * bw + i / 8 ];
982- if (byte & 0x80 ) {
981+ b = mask[j * bw + i / 8 ];
982+ if (b & 0x80 ) {
983983 writePixel (x + i, y, bitmap[j * w + i]);
984984 }
985985 }
@@ -1048,15 +1048,15 @@ void Adafruit_GFX::drawRGBBitmap(int16_t x, int16_t y, uint16_t *bitmap,
10481048void Adafruit_GFX::drawRGBBitmap (int16_t x, int16_t y, const uint16_t bitmap[],
10491049 const uint8_t mask[], int16_t w, int16_t h) {
10501050 int16_t bw = (w + 7 ) / 8 ; // Bitmask scanline pad = whole byte
1051- uint8_t byte = 0 ;
1051+ uint8_t b = 0 ;
10521052 startWrite ();
10531053 for (int16_t j = 0 ; j < h; j++, y++) {
10541054 for (int16_t i = 0 ; i < w; i++) {
10551055 if (i & 7 )
1056- byte <<= 1 ;
1056+ b <<= 1 ;
10571057 else
1058- byte = pgm_read_byte (&mask[j * bw + i / 8 ]);
1059- if (byte & 0x80 ) {
1058+ b = pgm_read_byte (&mask[j * bw + i / 8 ]);
1059+ if (b & 0x80 ) {
10601060 writePixel (x + i, y, pgm_read_word (&bitmap[j * w + i]));
10611061 }
10621062 }
@@ -1081,15 +1081,15 @@ void Adafruit_GFX::drawRGBBitmap(int16_t x, int16_t y, const uint16_t bitmap[],
10811081void Adafruit_GFX::drawRGBBitmap (int16_t x, int16_t y, uint16_t *bitmap,
10821082 uint8_t *mask, int16_t w, int16_t h) {
10831083 int16_t bw = (w + 7 ) / 8 ; // Bitmask scanline pad = whole byte
1084- uint8_t byte = 0 ;
1084+ uint8_t b = 0 ;
10851085 startWrite ();
10861086 for (int16_t j = 0 ; j < h; j++, y++) {
10871087 for (int16_t i = 0 ; i < w; i++) {
10881088 if (i & 7 )
1089- byte <<= 1 ;
1089+ b <<= 1 ;
10901090 else
1091- byte = mask[j * bw + i / 8 ];
1092- if (byte & 0x80 ) {
1091+ b = mask[j * bw + i / 8 ];
1092+ if (b & 0x80 ) {
10931093 writePixel (x + i, y, bitmap[j * w + i]);
10941094 }
10951095 }
@@ -1867,8 +1867,7 @@ bool GFXcanvas1::getPixel(int16_t x, int16_t y) const {
18671867bool 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