Skip to content

Commit ecbd1e6

Browse files
authored
Merge pull request #771 from raybellis/macos_fixes
Fixes for compilation under macOS / GCC 13.3.1
2 parents 302d6ae + bfb6490 commit ecbd1e6

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

drivers/ltp305/ltp305.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ namespace pimoroni {
6464
}
6565

6666
void LTP305::set_character(uint8_t x, uint16_t ch) {
67-
uint8_t *data = nullptr;
68-
for(auto c : dotfont) {
67+
const uint8_t *data = nullptr;
68+
for(const auto& c : dotfont) {
6969
if(c.code == ch) {
7070
data = &c.data[0];
7171
break;
@@ -128,4 +128,4 @@ namespace pimoroni {
128128
i2c->reg_write_uint8(address, CMD_BRIGHTNESS, brightness);
129129
i2c->reg_write_uint8(address, CMD_UPDATE, 0x01);
130130
}
131-
}
131+
}

drivers/vl53l1x/vl53l1x.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ namespace pimoroni {
217217
i2c->read_blocking(address, (uint8_t *)&value, 4, false);
218218

219219
// TODO do we need to bswap this return value?
220-
return __bswap32(value);
220+
return __builtin_bswap32(value);
221221
}
222222

223223
// set distance mode to Short, Medium, or Long

libraries/hershey_fonts/hershey_fonts.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <map>
22
#include <string>
33
#include <functional>
4+
#include <cstdint>
45

56
namespace hershey {
67
struct font_glyph_t {
@@ -50,4 +51,4 @@ namespace hershey {
5051

5152
bool has_font(std::string_view font);
5253
const font_t* font(std::string_view font);
53-
}
54+
}

0 commit comments

Comments
 (0)