aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'wear_ui.cpp')
-rw-r--r--wear_ui.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/wear_ui.cpp b/wear_ui.cpp
index 2502313f..5451ed1a 100644
--- a/wear_ui.cpp
+++ b/wear_ui.cpp
@@ -277,7 +277,7 @@ void WearRecoveryUI::progress_loop() {
277 // minimum of 20ms delay between frames 277 // minimum of 20ms delay between frames
278 double delay = interval - (end-start); 278 double delay = interval - (end-start);
279 if (delay < 0.02) delay = 0.02; 279 if (delay < 0.02) delay = 0.02;
280 usleep((long)(delay * 1000000)); 280 usleep(static_cast<useconds_t>(delay * 1000000));
281 } 281 }
282} 282}
283 283
@@ -500,8 +500,8 @@ void WearRecoveryUI::Redraw()
500} 500}
501 501
502void WearRecoveryUI::ShowFile(FILE* fp) { 502void WearRecoveryUI::ShowFile(FILE* fp) {
503 std::vector<long> offsets; 503 std::vector<off_t> offsets;
504 offsets.push_back(ftell(fp)); 504 offsets.push_back(ftello(fp));
505 ClearText(); 505 ClearText();
506 506
507 struct stat sb; 507 struct stat sb;
@@ -511,7 +511,7 @@ void WearRecoveryUI::ShowFile(FILE* fp) {
511 while (true) { 511 while (true) {
512 if (show_prompt) { 512 if (show_prompt) {
513 Print("--(%d%% of %d bytes)--", 513 Print("--(%d%% of %d bytes)--",
514 static_cast<int>(100 * (double(ftell(fp)) / double(sb.st_size))), 514 static_cast<int>(100 * (double(ftello(fp)) / double(sb.st_size))),
515 static_cast<int>(sb.st_size)); 515 static_cast<int>(sb.st_size));
516 Redraw(); 516 Redraw();
517 while (show_prompt) { 517 while (show_prompt) {
@@ -530,7 +530,7 @@ void WearRecoveryUI::ShowFile(FILE* fp) {
530 if (feof(fp)) { 530 if (feof(fp)) {
531 return; 531 return;
532 } 532 }
533 offsets.push_back(ftell(fp)); 533 offsets.push_back(ftello(fp));
534 } 534 }
535 } 535 }
536 ClearText(); 536 ClearText();