Merge pull request #771 from raybellis/macos_fixes

Fixes for compilation under macOS / GCC 13.3.1
patch-ci-custom-gcc
Philip Howard 2023-05-09 13:48:05 +01:00 zatwierdzone przez GitHub
commit ecbd1e66de
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -64,8 +64,8 @@ namespace pimoroni {
}
void LTP305::set_character(uint8_t x, uint16_t ch) {
uint8_t *data = nullptr;
for(auto c : dotfont) {
const uint8_t *data = nullptr;
for(const auto& c : dotfont) {
if(c.code == ch) {
data = &c.data[0];
break;
@ -128,4 +128,4 @@ namespace pimoroni {
i2c->reg_write_uint8(address, CMD_BRIGHTNESS, brightness);
i2c->reg_write_uint8(address, CMD_UPDATE, 0x01);
}
}
}

Wyświetl plik

@ -217,7 +217,7 @@ namespace pimoroni {
i2c->read_blocking(address, (uint8_t *)&value, 4, false);
// TODO do we need to bswap this return value?
return __bswap32(value);
return __builtin_bswap32(value);
}
// set distance mode to Short, Medium, or Long

Wyświetl plik

@ -1,6 +1,7 @@
#include <map>
#include <string>
#include <functional>
#include <cstdint>
namespace hershey {
struct font_glyph_t {
@ -50,4 +51,4 @@ namespace hershey {
bool has_font(std::string_view font);
const font_t* font(std::string_view font);
}
}