Skip to content

Commit 5cf5c71

Browse files
author
Kirk
committed
fix compiler whines found during cross platform testing
1 parent ea7e4b4 commit 5cf5c71

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/qwiic_grbuffer.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@ void QwGrBufferDevice::draw_circle_filled(uint8_t x0, uint8_t y0, uint8_t radius
484484
int8_t ddF_y = -2 * radius;
485485
int8_t x = 0;
486486
int8_t y = radius;
487-
int8_t i;
488487

489488

490489
(*_idraw.draw_line_vert)(this, x0, y0-radius, x0, y0+radius, clr);
@@ -538,7 +537,7 @@ void QwGrBufferDevice::bitmap(uint8_t x0, uint8_t y0, QwBitmap& theBMP){
538537

539538
void QwGrBufferDevice::text(uint8_t x0, uint8_t y0, const char * text, uint8_t clr){
540539

541-
if(!text, x0 >= _viewport.width || y0 >= _viewport.height )
540+
if(x0 >= _viewport.width || y0 >= _viewport.height )
542541
return;
543542

544543
(_idraw.draw_text)(this, x0, y0, text, clr);

src/qwiic_grssd1306.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@
177177
typedef void (*rasterOPsFn)(uint8_t * dest, uint8_t src, uint8_t mask);
178178

179179
static const rasterOPsFn _rasterOps[] ={
180-
[](uint8_t *dst, uint8_t src, uint8_t mask)->void { *dst = (~mask & *dst) | src & mask;}, // COPY
181-
[](uint8_t *dst, uint8_t src, uint8_t mask)->void { *dst = (~mask & *dst) | !src & mask;}, // NOT COPY
182-
[](uint8_t *dst, uint8_t src, uint8_t mask)->void { *dst = (~mask & *dst) | !(*dst) & mask;}, // NOT DEST
183-
[](uint8_t *dst, uint8_t src, uint8_t mask)->void { *dst = (~mask & *dst) | (*dst ^ src) & mask;}, // XOR
180+
[](uint8_t *dst, uint8_t src, uint8_t mask)->void { *dst = (~mask & *dst) | (src & mask);}, // COPY
181+
[](uint8_t *dst, uint8_t src, uint8_t mask)->void { *dst = (~mask & *dst) | ((!src) & mask);}, // NOT COPY
182+
[](uint8_t *dst, uint8_t src, uint8_t mask)->void { *dst = (~mask & *dst) | ((!(*dst)) & mask);}, // NOT DEST
183+
[](uint8_t *dst, uint8_t src, uint8_t mask)->void { *dst = (~mask & *dst) | ((*dst ^ src) & mask);}, // XOR
184184
[](uint8_t *dst, uint8_t src, uint8_t mask)->void { *dst = ~mask & *dst;}, // Always Black
185185
[](uint8_t *dst, uint8_t src, uint8_t mask)->void { *dst = mask | *dst;}, // Always White
186186
};
@@ -191,16 +191,16 @@ static const rasterOPsFn _rasterOps[] ={
191191
// Just a bunch of member variable inits
192192

193193
QwGrSSD1306::QwGrSSD1306():
194+
default_address{0},
194195
_pBuffer{nullptr},
196+
_color{1},
197+
_rop{grROPCopy},
195198
_i2cBus{nullptr},
196199
_i2c_address{0},
197200
_initHWComPins{kDefaultPinConfig},
198201
_initPreCharge{kDefaultPreCharge},
199202
_initVCOMDeselect{kDefaultVCOMDeselect},
200203
_initContrast{kDefaultContrast},
201-
default_address{0},
202-
_color{1},
203-
_rop{grROPCopy},
204204
_isInit{false}
205205
{}
206206

@@ -658,7 +658,7 @@ void QwGrSSD1306::draw_line_vert(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1,
658658
endBit = y0 + kByteNBits - startBit > y1 ? mod_byte(y1) : kByteNBits-1;
659659

660660
// Set the bits from startBit to endBit
661-
setBits = (0xFF >> (kByteNBits - endBit)-1) << startBit; // what bits are being set in this byte
661+
setBits = (0xFF >> ((kByteNBits - endBit)-1)) << startBit; // what bits are being set in this byte
662662

663663
// set the bits in the graphics buffer using the current byte operator function
664664

0 commit comments

Comments
 (0)