From 8395ac8852b90d3fb1b3f97e4507680acaf6e79f Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 8 Mar 2001 02:34:27 +0000 Subject: [PATCH] Open C++ iostreams as ios::binary. --- src/Cockpit/hud.cxx | 4 ++-- src/Cockpit/panel_io.cxx | 2 +- src/GUI/gui.cxx | 4 ++-- src/Main/keyboard.cxx | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Cockpit/hud.cxx b/src/Cockpit/hud.cxx index fa6f25f4d..4888030f8 100644 --- a/src/Cockpit/hud.cxx +++ b/src/Cockpit/hud.cxx @@ -717,7 +717,7 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ ) FGPath path(globals->get_fg_root()); path.append(hud_path); - ifstream input(path.c_str()); + ifstream input(path.c_str(), ios::binary); if (!input.good()) { FG_LOG(FG_INPUT, FG_ALERT, @@ -747,7 +747,7 @@ int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ ) path.append("Huds/Minimal/default.xml"); - ifstream input(path.c_str()); + ifstream input(path.c_str(), ios::binary); if (!input.good()) { FG_LOG(FG_INPUT, FG_ALERT, "Cannot read Hud configuration from " << path.str()); diff --git a/src/Cockpit/panel_io.cxx b/src/Cockpit/panel_io.cxx index 0e395a31c..6c148fe48 100644 --- a/src/Cockpit/panel_io.cxx +++ b/src/Cockpit/panel_io.cxx @@ -817,7 +817,7 @@ fgReadPanel (const string &relative_path) FGPanel * panel = 0; FGPath path(globals->get_fg_root()); path.append(relative_path); - ifstream input(path.c_str()); + ifstream input(path.c_str(), ios::binary); if (!input.good()) { FG_LOG(FG_INPUT, FG_ALERT, "Cannot read panel configuration from " << path.str()); diff --git a/src/GUI/gui.cxx b/src/GUI/gui.cxx index c1b86e36e..75854866d 100644 --- a/src/GUI/gui.cxx +++ b/src/GUI/gui.cxx @@ -210,7 +210,7 @@ void SaveDialogOk(puObject*) { char *s; SaveDialogInput->getValue(&s); - ofstream output(s); + ofstream output(s, ios::binary); cout << saveFile << endl; if (output.good() && fgSaveFlight(output)) { output.close(); @@ -270,7 +270,7 @@ void LoadDialogOk(puObject *) { char *l; LoadDialogInput->getValue(&l); - ifstream input(l); + ifstream input(l, ios::binary); if (input.good() && fgLoadFlight(input)) { input.close(); mkDialog("Loaded flight"); diff --git a/src/Main/keyboard.cxx b/src/Main/keyboard.cxx index b7a994c85..3380755b1 100644 --- a/src/Main/keyboard.cxx +++ b/src/Main/keyboard.cxx @@ -426,7 +426,7 @@ void GLUTspecialkey(int k, int x, int y) { FG_LOG( FG_INPUT, FG_DEBUG, " SHIFTED" ); switch (k) { case GLUT_KEY_F1: { - ifstream input("fgfs.sav"); + ifstream input("fgfs.sav", ios::binary); if (input.good() && fgLoadFlight(input)) { input.close(); FG_LOG(FG_INPUT, FG_INFO, "Restored flight from fgfs.sav"); @@ -438,7 +438,7 @@ void GLUTspecialkey(int k, int x, int y) { case GLUT_KEY_F2: { FG_LOG(FG_INPUT, FG_INFO, "Saving flight"); cerr << "Opening output stream" << endl; - ofstream output("fgfs.sav"); + ofstream output("fgfs.sav", ios::binary); cerr << "output stream opened" << endl; if (output.good() && fgSaveFlight(output)) { output.close(); -- 2.39.5