Avoid passing float argument for "%f" printf specifier

"%f" takes a double. Eliminates some -Wdouble-promotion warnings.
This commit is contained in:
Paul Cornett
2020-04-21 11:59:36 -07:00
parent 62372d4337
commit c5faf9cfac
10 changed files with 21 additions and 21 deletions

View File

@@ -146,8 +146,8 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
text_output << d << "\n";
std_file_output << d << "\n";
float f = (float)0.00001;
tmp.Printf( "Float: %f\n", f );
float f = 0.00001f;
tmp.Printf( "Float: %f\n", double(f) );
textCtrl.WriteText( tmp );
text_output << f << "\n";
std_file_output << f << "\n";
@@ -177,7 +177,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( tmp );
std_file_input >> f;
tmp.Printf( "Float: %f\n", f );
tmp.Printf( "Float: %f\n", double(f) );
textCtrl.WriteText( tmp );
char std_buf[200];
@@ -207,7 +207,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( tmp );
text_input >> f;
tmp.Printf( "Float: %f\n", f );
tmp.Printf( "Float: %f\n", double(f) );
textCtrl.WriteText( tmp );
text_input >> str;