Patch or suppress warnings

The upstream MicroPython rp2 port has re-enabled -Werror so we need to either fix warnings or,
in the case of those generated by C++/C MicroPython binding weirdness, suppress them.
pull/101/head
Phil Howard 2021-03-22 20:43:23 +00:00
rodzic 48994c177f
commit 675106ece4
6 zmienionych plików z 39 dodań i 9 usunięć

Wyświetl plik

@ -67,7 +67,7 @@ namespace pimoroni {
Pen *dest = ptr(clipped);
while(clipped.h--) {
// draw span of pixels for this row
for(uint32_t i = 0; i < clipped.w; i++) {
for(int32_t i = 0; i < clipped.w; i++) {
*dest++ = pen;
}
@ -141,7 +141,7 @@ namespace pimoroni {
// if this word would exceed the wrap limit then
// move to the next line
if(co != 0 && co + word_width > wrap) {
if(co != 0 && co + word_width > (uint32_t)wrap) {
co = 0;
lo += 7 * scale;
}
@ -203,13 +203,13 @@ namespace pimoroni {
int32_t w1row = orient2d(p3, p1, tl) + bias1;
int32_t w2row = orient2d(p1, p2, tl) + bias2;
for (uint32_t y = 0; y < triangle_bounds.h; y++) {
for (int32_t y = 0; y < triangle_bounds.h; y++) {
int32_t w0 = w0row;
int32_t w1 = w1row;
int32_t w2 = w2row;
Pen *dest = ptr(triangle_bounds.x, triangle_bounds.y + y);
for (uint32_t x = 0; x < triangle_bounds.w; x++) {
for (int32_t x = 0; x < triangle_bounds.w; x++) {
if ((w0 | w1 | w2) >= 0) {
*dest = pen;
}

Wyświetl plik

@ -18,4 +18,10 @@ target_compile_definitions(usermod_pico_display INTERFACE
-DMODULE_PICODISPLAY_ENABLED=1
)
target_link_libraries(usermod INTERFACE usermod_pico_display)
target_link_libraries(usermod INTERFACE usermod_pico_display)
set_source_files_properties(
${CMAKE_CURRENT_LIST_DIR}/pico_display.c
PROPERTIES COMPILE_FLAGS
"-Wno-discarded-qualifiers -Wno-implicit-int"
)

Wyświetl plik

@ -18,4 +18,10 @@ target_compile_definitions(usermod_pico_explorer INTERFACE
-DMODULE_PICOEXPLORER_ENABLED=1
)
target_link_libraries(usermod INTERFACE usermod_pico_explorer)
target_link_libraries(usermod INTERFACE usermod_pico_explorer)
set_source_files_properties(
${CMAKE_CURRENT_LIST_DIR}/pico_explorer.c
PROPERTIES COMPILE_FLAGS
"-Wno-discarded-qualifiers -Wno-implicit-int"
)

Wyświetl plik

@ -14,4 +14,10 @@ target_compile_definitions(usermod_pico_rgb_keypad INTERFACE
-DMODULE_PICOKEYPAD_ENABLED=1
)
target_link_libraries(usermod INTERFACE usermod_pico_rgb_keypad)
target_link_libraries(usermod INTERFACE usermod_pico_rgb_keypad)
set_source_files_properties(
${CMAKE_CURRENT_LIST_DIR}/pico_rgb_keypad.c
PROPERTIES COMPILE_FLAGS
"-Wno-discarded-qualifiers -Wno-implicit-int"
)

Wyświetl plik

@ -14,4 +14,10 @@ target_compile_definitions(usermod_pico_scroll INTERFACE
-DMODULE_PICOSCROLL_ENABLED=1
)
target_link_libraries(usermod INTERFACE usermod_pico_scroll)
target_link_libraries(usermod INTERFACE usermod_pico_scroll)
set_source_files_properties(
${CMAKE_CURRENT_LIST_DIR}/pico_scroll.c
PROPERTIES COMPILE_FLAGS
"-Wno-discarded-qualifiers -Wno-implicit-int"
)

Wyświetl plik

@ -16,4 +16,10 @@ target_compile_definitions(usermod_pico_unicorn INTERFACE
-DMODULE_PICOUNICORN_ENABLED=1
)
target_link_libraries(usermod INTERFACE usermod_pico_unicorn)
target_link_libraries(usermod INTERFACE usermod_pico_unicorn)
set_source_files_properties(
${CMAKE_CURRENT_LIST_DIR}/pico_unicorn.c
PROPERTIES COMPILE_FLAGS
"-Wno-discarded-qualifiers -Wno-implicit-int"
)