summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoeycastillo <joeycastillo@utexas.edu>2023-04-16 11:06:11 -0400
committerjoeycastillo <joeycastillo@utexas.edu>2023-04-16 11:06:11 -0400
commit00541bd9c51101d58dfb8e88ae59b968a4094d4e (patch)
tree88329f6a10f9d8b958916a559f2a3b5e3f4e511f
parentc4da02ca2c3197b31d030e75c88df66c8e468b74 (diff)
downloadSensor-Watch-00541bd9c51101d58dfb8e88ae59b968a4094d4e.tar.gz
Sensor-Watch-00541bd9c51101d58dfb8e88ae59b968a4094d4e.tar.bz2
Sensor-Watch-00541bd9c51101d58dfb8e88ae59b968a4094d4e.zip
fix most warnings
-rw-r--r--movement/watch_faces/complication/geomancy_face.c13
-rw-r--r--movement/watch_faces/complication/randonaut_face.c2
-rw-r--r--movement/watch_faces/complication/toss_up_face.c3
3 files changed, 14 insertions, 4 deletions
diff --git a/movement/watch_faces/complication/geomancy_face.c b/movement/watch_faces/complication/geomancy_face.c
index 689d4e18..c741b2d7 100644
--- a/movement/watch_faces/complication/geomancy_face.c
+++ b/movement/watch_faces/complication/geomancy_face.c
@@ -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;
diff --git a/movement/watch_faces/complication/randonaut_face.c b/movement/watch_faces/complication/randonaut_face.c
index a4ed6ec5..3ff5162f 100644
--- a/movement/watch_faces/complication/randonaut_face.c
+++ b/movement/watch_faces/complication/randonaut_face.c
@@ -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
diff --git a/movement/watch_faces/complication/toss_up_face.c b/movement/watch_faces/complication/toss_up_face.c
index 1923302f..f244f3ce 100644
--- a/movement/watch_faces/complication/toss_up_face.c
+++ b/movement/watch_faces/complication/toss_up_face.c
@@ -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++) {