]> git.earman.xyz Git - sensor-watch.git/commitdiff
fix most warnings
authorjoeycastillo <joeycastillo@utexas.edu>
Sun, 16 Apr 2023 15:06:11 +0000 (11:06 -0400)
committerjoeycastillo <joeycastillo@utexas.edu>
Sun, 16 Apr 2023 15:06:11 +0000 (11:06 -0400)
movement/watch_faces/complication/geomancy_face.c
movement/watch_faces/complication/randonaut_face.c
movement/watch_faces/complication/toss_up_face.c

index 689d4e18baa97f3994275439c8ee7aa9a96b7234..c741b2d764dfb26db6f5e7117bb36b8b134d8e3e 100644 (file)
@@ -72,6 +72,7 @@ static void _throw_animation(geomancy_state_t *state);
 // WATCH FACE FUNCTIONS ///////////////////////////////////////////////////////
 
 void geomancy_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
+    (void) watch_face_index;
     (void) settings;
     if (*context_ptr == NULL) {
         *context_ptr = malloc(sizeof(geomancy_state_t));
@@ -112,12 +113,14 @@ bool geomancy_face_loop(movement_event_t event, movement_settings_t *settings, v
             switch ( state->mode ) {
                 case 0:
                     state->mode++;
+                    // fall through
                 case 1:
                     state->animate = true;
                     state->i_ching_hexagram = _iching_form_hexagram();
                     break;
                 case 2:
                     state->mode++;
+                    // fall through
                 case 3:
                     state->animate = true;
                     state->geomantic_figure = _geomancy_pick_figure().bits;
@@ -147,6 +150,7 @@ void geomancy_face_resign(movement_settings_t *settings, void *context) {
 // STATIC FUNCTIONS ///////////////////////////////////////////////////////////
 
 /** @brief display handler */
+static void geomancy_face_display(geomancy_state_t *state);
 static void geomancy_face_display(geomancy_state_t *state) {
     char token[7] = {0};
     nibble_t figure = *((nibble_t*) &state->geomantic_figure);
@@ -287,7 +291,7 @@ static void _throw_animation(geomancy_state_t *state) {
 
 /** @brief form a trigram from three random bit picks
  */
-static tribble_t _iching_pick_trigram() {
+static tribble_t _iching_pick_trigram(void) {
     uint8_t index = (divine_bit() << 2) | (divine_bit() << 1) | divine_bit();
     tribble_t trigram = {(bagua >> (3 * index)) & 0b111};
     return trigram;
@@ -295,7 +299,8 @@ static tribble_t _iching_pick_trigram() {
 
 /** @brief form a hexagram from two trigrams
  */
-static uint8_t _iching_form_hexagram() {
+static uint8_t _iching_form_hexagram(void);
+static uint8_t _iching_form_hexagram(void) {
     tribble_t inner = _iching_pick_trigram();
     tribble_t outer = _iching_pick_trigram();
     uint8_t hexagram = (inner.bits << 3) | outer.bits;
@@ -305,6 +310,7 @@ static uint8_t _iching_form_hexagram() {
 /** @brief display hexagram
  *  @details | for unbroken lines and Ξ for broken lines, left of display is bottom
  */
+static void _display_hexagram(uint8_t hexagram, char* str);
 static void _display_hexagram(uint8_t hexagram, char* str) {
     str[6] = '\0';  // Null-terminate the string
     for (uint8_t i = 0; i < 6; i++) {
@@ -334,7 +340,8 @@ static void _fix_broken_line(uint8_t hexagram) {
 /** @brief choose a geomantic figure from four random bits
  *  @details 0 represents · and 1 represents : counting from the bottom
  */
-static nibble_t _geomancy_pick_figure() {
+static nibble_t _geomancy_pick_figure(void);
+static nibble_t _geomancy_pick_figure(void) {
     uint8_t index = (divine_bit() << 3) | (divine_bit() << 2) | (divine_bit() << 1) | divine_bit();
     nibble_t figure = {(geomantic >> (4 * (15 - index))) & 0xF};
     return figure;
index a4ed6ec5b7dca305f9254e5839df1fec3ec0697c..3ff5162f9edae0bea7c778d39b52a9a7cf39a29d 100644 (file)
@@ -207,7 +207,7 @@ void randonaut_face_resign(movement_settings_t *settings, void *context) {
 /** @brief display handler
  */
 static void _randonaut_face_display(randonaut_state_t *state) {
-    char buf[11];
+    char buf[12];
     watch_clear_colon();
     switch ( state->face.mode ) {
         case 0: //home
index 1923302fe8530263020421c3fe900bf836379bf8..f244f3ce807429985905956006eab6a943ca3ca5 100644 (file)
@@ -45,6 +45,7 @@ static void _coin_animation(toss_up_state_t *state);
 // PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
 
 void toss_up_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
+    (void) watch_face_index;
     (void) settings;
     if (*context_ptr == NULL) {
         *context_ptr = malloc(sizeof(toss_up_state_t));
@@ -95,6 +96,7 @@ bool toss_up_face_loop(movement_event_t event, movement_settings_t *settings, vo
             switch (state->mode) {
                 case 0:
                     state->mode++;
+                    // fall through
                 case 1:
                     state->animate = true;
                     for (i = 0; i < state->coin_num; i++) {
@@ -103,6 +105,7 @@ bool toss_up_face_loop(movement_event_t event, movement_settings_t *settings, vo
                     break;
                 case 2:
                     state->mode++;
+                    // fall through
                 case 3:
                     state->animate = true;
                     for (i = 0; i < state->dice_num; i++) {