Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mui: including missing header and fix some warnings #2414

Merged
merged 2 commits into from
Apr 14, 2024

Conversation

bradjc
Copy link
Contributor

@bradjc bradjc commented Apr 2, 2024

This includes the u8g2.h header in mui_u8g2.h. The mui_u8g2.h header relies on the u8g2_uint_t type, but without
including the header the compiler errors on unknown type.

I think this has generally been hidden because most users probably include "u8g2.h" before "mui_u8g2.h". But just re-ordering those includes can cause the build to fail.

This also fixes warnings about internal functions by adding static:

mui.c:303:5: warning: no previous prototype for 'mui_find_uif' [-Wmissing-prototypes]
  303 | int mui_find_uif(mui_t *ui, uint8_t id0, uint8_t id1)
      |     ^~~~~~~~~~~~
mui.c:463:8: warning: no previous prototype for 'mui_find_form' [-Wmissing-prototypes]
  463 | fds_t *mui_find_form(mui_t *ui, uint8_t n)
      |        ^~~~~~~~~~~~~
mui.c:490:9: warning: no previous prototype for 'mui_task_draw' [-Wmissing-prototypes]
  490 | uint8_t mui_task_draw(mui_t *ui)
      |         ^~~~~~~~~~~~~
mui.c:497:9: warning: no previous prototype for 'mui_task_form_start' [-Wmissing-prototypes]
  497 | uint8_t mui_task_form_start(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~
mui.c:503:9: warning: no previous prototype for 'mui_task_form_end' [-Wmissing-prototypes]
  503 | uint8_t mui_task_form_end(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~
mui.c:519:9: warning: no previous prototype for 'mui_task_find_prev_cursor_uif' [-Wmissing-prototypes]
  519 | uint8_t mui_task_find_prev_cursor_uif(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mui.c:534:9: warning: no previous prototype for 'mui_task_find_first_cursor_uif' [-Wmissing-prototypes]
  534 | uint8_t mui_task_find_first_cursor_uif(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mui.c:548:9: warning: no previous prototype for 'mui_task_find_last_cursor_uif' [-Wmissing-prototypes]
  548 | uint8_t mui_task_find_last_cursor_uif(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mui.c:559:9: warning: no previous prototype for 'mui_task_find_next_cursor_uif' [-Wmissing-prototypes]
  559 | uint8_t mui_task_find_next_cursor_uif(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mui.c:578:9: warning: no previous prototype for 'mui_task_get_current_cursor_focus_position' [-Wmissing-prototypes]
  578 | uint8_t mui_task_get_current_cursor_focus_position(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mui.c:590:9: warning: no previous prototype for 'mui_task_read_nth_selectable_field' [-Wmissing-prototypes]
  590 | uint8_t mui_task_read_nth_selectable_field(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mui.c:602:9: warning: no previous prototype for 'mui_task_find_execute_on_select_field' [-Wmissing-prototypes]
  602 | uint8_t mui_task_find_execute_on_select_field(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mui.c:654:6: warning: no previous prototype for 'mui_next_field' [-Wmissing-prototypes]
  654 | void mui_next_field(mui_t *ui)

bradjc added 2 commits April 2, 2024 00:26
The mui_u8g2.h header relies on the `u8g2_uint_t` type, but without
including the header the compiler errors on unknown type.

I think this has generally been hidden because most users probably
include "u8g2.h" before "mui_u8g2.h". But just re-ordering those
includes can cause the build to fail.
This fixes warnings like:

```
mui.c:303:5: warning: no previous prototype for 'mui_find_uif' [-Wmissing-prototypes]
  303 | int mui_find_uif(mui_t *ui, uint8_t id0, uint8_t id1)
      |     ^~~~~~~~~~~~
mui.c:463:8: warning: no previous prototype for 'mui_find_form' [-Wmissing-prototypes]
  463 | fds_t *mui_find_form(mui_t *ui, uint8_t n)
      |        ^~~~~~~~~~~~~
mui.c:490:9: warning: no previous prototype for 'mui_task_draw' [-Wmissing-prototypes]
  490 | uint8_t mui_task_draw(mui_t *ui)
      |         ^~~~~~~~~~~~~
mui.c:497:9: warning: no previous prototype for 'mui_task_form_start' [-Wmissing-prototypes]
  497 | uint8_t mui_task_form_start(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~
mui.c:503:9: warning: no previous prototype for 'mui_task_form_end' [-Wmissing-prototypes]
  503 | uint8_t mui_task_form_end(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~
mui.c:519:9: warning: no previous prototype for 'mui_task_find_prev_cursor_uif' [-Wmissing-prototypes]
  519 | uint8_t mui_task_find_prev_cursor_uif(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mui.c:534:9: warning: no previous prototype for 'mui_task_find_first_cursor_uif' [-Wmissing-prototypes]
  534 | uint8_t mui_task_find_first_cursor_uif(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mui.c:548:9: warning: no previous prototype for 'mui_task_find_last_cursor_uif' [-Wmissing-prototypes]
  548 | uint8_t mui_task_find_last_cursor_uif(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mui.c:559:9: warning: no previous prototype for 'mui_task_find_next_cursor_uif' [-Wmissing-prototypes]
  559 | uint8_t mui_task_find_next_cursor_uif(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mui.c:578:9: warning: no previous prototype for 'mui_task_get_current_cursor_focus_position' [-Wmissing-prototypes]
  578 | uint8_t mui_task_get_current_cursor_focus_position(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mui.c:590:9: warning: no previous prototype for 'mui_task_read_nth_selectable_field' [-Wmissing-prototypes]
  590 | uint8_t mui_task_read_nth_selectable_field(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mui.c:602:9: warning: no previous prototype for 'mui_task_find_execute_on_select_field' [-Wmissing-prototypes]
  602 | uint8_t mui_task_find_execute_on_select_field(mui_t *ui)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mui.c:654:6: warning: no previous prototype for 'mui_next_field' [-Wmissing-prototypes]
  654 | void mui_next_field(mui_t *ui)
```
@olikraus olikraus merged commit bcb1a8f into olikraus:master Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants