Merge pull request #101 from pimoroni/patch-fix-or-suppress-warnings

Fix or suppress warnings
This commit is contained in:
Philip Howard 2021-03-22 20:48:42 +00:00 committed by GitHub
commit d3dd3096e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 9 deletions

View File

@ -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;
}

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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"
)