@@ -59,7 +59,7 @@ void full_window_clear() {
5959 while (g_display.nextPage ());
6060}
6161
62- void display_printf (char *format, ...) {
62+ void display_printf (const char *format, ...) {
6363 char buff[1024 ];
6464 va_list args;
6565 va_start (args, format);
@@ -129,7 +129,7 @@ void self_test() {
129129 size_t numtests = selftest_numtests ();
130130 // Loop, once for each test. Need an extra trip at the end in
131131 // case we failed the last test.
132- for (int ndx = 0 ; ndx < numtests+1 ; ++ndx) {
132+ for (size_t ndx = 0 ; ndx < numtests+1 ; ++ndx) {
133133
134134 // If any key is pressed, skip remaining self test.
135135 if (g_keypad.getKey () != NO_KEY)
@@ -718,7 +718,7 @@ void display_slip39() {
718718 yy = Y_MAX - (H_FSB9) + 2 ;
719719 g_display.setFont (&FreeSansBold9pt7b);
720720 g_display.setCursor (xx, yy);
721- if (sharendx < (g_slip39_generate->numshares ()-1 ))
721+ if (sharendx < (int )( g_slip39_generate->numshares ()-1 ))
722722 g_display.println (" 1,7-Up,Down #-Next" );
723723 else
724724 g_display.println (" 1,7-Up,Down #-Done" );
@@ -746,7 +746,7 @@ void display_slip39() {
746746 }
747747 break ;
748748 case ' #' : // next / done
749- if (sharendx < (g_slip39_generate->numshares ()-1 )) {
749+ if (sharendx < (int )( g_slip39_generate->numshares ()-1 )) {
750750 ++sharendx;
751751 scroll = 0 ;
752752 } else {
@@ -829,7 +829,7 @@ struct WordListState {
829829 }
830830
831831 void cursor_right () {
832- if (pos < strlen (refword (wordndx[selected])) - 1 )
832+ if (pos < ( int ) strlen (refword (wordndx[selected])) - 1 )
833833 ++pos;
834834 }
835835
@@ -1035,7 +1035,7 @@ void restore_bip39() {
10351035 case ' #' : // done
10361036 {
10371037 uint16_t bip39_words[BIP39Seq::WORD_COUNT];
1038- for (int ii = 0 ; ii < BIP39Seq::WORD_COUNT; ++ii)
1038+ for (size_t ii = 0 ; ii < BIP39Seq::WORD_COUNT; ++ii)
10391039 bip39_words[ii] = state.wordndx [ii];
10401040 BIP39Seq * bip39 = BIP39Seq::from_words (bip39_words);
10411041 Seed * seed = bip39->restore_seed ();
@@ -1090,7 +1090,7 @@ void restore_slip39() {
10901090 // Adjust the scroll to center the selection.
10911091 if (selected < 2 )
10921092 scroll = 0 ;
1093- else if (selected > g_slip39_restore->numshares ())
1093+ else if (selected > ( int ) g_slip39_restore->numshares ())
10941094 scroll = g_slip39_restore->numshares () + 2 - disprows;
10951095 else
10961096 scroll = selected - 2 ;
@@ -1117,9 +1117,9 @@ void restore_slip39() {
11171117 for (int rr = 0 ; rr < disprows; ++rr) {
11181118 int sharendx = scroll + rr;
11191119 char buffer[32 ];
1120- if (sharendx < g_slip39_restore->numshares ()) {
1120+ if (sharendx < ( int ) g_slip39_restore->numshares ()) {
11211121 sprintf (buffer, " Share %d" , sharendx+1 );
1122- } else if (sharendx == g_slip39_restore->numshares ()) {
1122+ } else if (sharendx == ( int ) g_slip39_restore->numshares ()) {
11231123 sprintf (buffer, " Add Share" );
11241124 } else {
11251125 sprintf (buffer, " Restore" );
@@ -1162,19 +1162,19 @@ void restore_slip39() {
11621162 selected -= 1 ;
11631163 break ;
11641164 case ' 7' :
1165- if (selected < g_slip39_restore->numshares () + 1 + showrestore - 1 )
1165+ if (selected < ( int ) g_slip39_restore->numshares () + 1 + showrestore - 1 )
11661166 selected += 1 ;
11671167 break ;
11681168 case ' *' :
11691169 g_uistate = SEEDLESS_MENU;
11701170 return ;
11711171 case ' #' :
1172- if (selected < g_slip39_restore->numshares ()) {
1172+ if (selected < ( int ) g_slip39_restore->numshares ()) {
11731173 // Edit existing share
11741174 g_restore_slip39_selected = selected;
11751175 g_uistate = ENTER_SHARE;
11761176 return ;
1177- } else if (selected == g_slip39_restore->numshares ()) {
1177+ } else if (selected == ( int ) g_slip39_restore->numshares ()) {
11781178 // Add new (zeroed) share
11791179 uint16_t share[SLIP39ShareSeq::WORDS_PER_SHARE] =
11801180 { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
@@ -1190,7 +1190,7 @@ void restore_slip39() {
11901190 // happening ..
11911191 full_window_clear ();
11921192
1193- for (int ii = 0 ; ii < g_slip39_restore->numshares (); ++ii) {
1193+ for (size_t ii = 0 ; ii < g_slip39_restore->numshares (); ++ii) {
11941194 char * strings =
11951195 g_slip39_restore->get_share_strings (ii);
11961196 serial_printf (" %d %s\n " , ii+1 , strings);
0 commit comments