Avoid passing float argument for "%f" printf specifier
"%f" takes a double. Eliminates some -Wdouble-promotion warnings.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user