Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecated <strstream> (depricated since C++98) #402

Merged
merged 3 commits into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Src/Orbiter/MfdUser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "Psys.h"
#include "Nav.h"
#include <stdio.h>
#include <strstream>
#include <sstream>
#include <iomanip>
#include "Log.h"
#include "Util.h"
Expand Down Expand Up @@ -397,11 +397,11 @@ void GraphMFD::Plot (HDC hDC, int g, int h0, int h1, const char *title)
}
}
if (gf.absc_title[0]) {
ostrstream oss(cbuf, 64);
ostringstream oss(cbuf, 64);
oss << gf.absc_title;
if (gf.absc_tickscale != 1.0f) oss << " x " << 1.0/gf.absc_tickscale;
oss << '\0';
TextOut (hDC, (x0+x1)/2, y0+(3*ch)/4, oss.str(), strlen(oss.str()));
TextOut (hDC, (x0+x1)/2, y0+(3*ch)/4, oss.str().c_str(), strlen(oss.str().c_str()));
}

// ordinate ticks/labels
Expand Down Expand Up @@ -430,11 +430,11 @@ void GraphMFD::Plot (HDC hDC, int g, int h0, int h1, const char *title)
SetTextAlign (hDC, TA_CENTER);
if (gf.data_title[0]) {
SelectDefaultFont (hDC, 2);
ostrstream oss(cbuf, 64);
ostringstream oss(cbuf, 64);
oss << gf.data_title;
if (gf.data_tickscale != 1.0f) oss << " x " << 1.0/gf.data_tickscale;
oss << '\0';
TextOut (hDC, 0, (y0+y1)/2, oss.str(), strlen(oss.str()));
TextOut (hDC, 0, (y0+y1)/2, oss.str().c_str(), strlen(oss.str().c_str()));
}

// plot frame
Expand Down
1 change: 0 additions & 1 deletion Src/Orbiter/Orbiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <stdio.h>
#include <time.h>
#include <fstream>
#include <strstream>
#include <iomanip>
#include <io.h>
#include "cmdline.h"
Expand Down
10 changes: 5 additions & 5 deletions Src/Orbiter/Vessel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5554,10 +5554,10 @@ bool Vessel::VCRedrawEvent (int id, int event, SURFHANDLE surf) const

bool Vessel::VCMouseEvent (int id, int event, Vector &p) const
{
if (modIntf.v && modIntf.v->Version() >= 1) {
VECTOR3 v = _V(p.x,p.y,p.z);
return ((VESSEL2*)modIntf.v)->clbkVCMouseEvent (id, event, v);
}
if (modIntf.v && modIntf.v->Version() >= 1) {
VECTOR3 v = _V(p.x,p.y,p.z);
return ((VESSEL2*)modIntf.v)->clbkVCMouseEvent (id, event, v);
}
else
return false;
}
Expand Down Expand Up @@ -8851,4 +8851,4 @@ bool VESSEL4::UnregisterMFDMode (int mode)
int VESSEL4::clbkNavProcess (int mode)
{
return mode;
}
}
6 changes: 3 additions & 3 deletions Src/Plugin/Common/Dialog/Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "Graph.h"
#include <stdio.h>
#include <math.h>
#include <strstream>
#include <sstream>
#include "orbitersdk.h"

static COLORREF plotcol[MAXPLOT] = { 0x0000ff, 0xff0000, 0x00ff00 };
Expand Down Expand Up @@ -232,12 +232,12 @@ void Graph::Refresh (HDC hDC, int w, int h)
}

SelectObject (hDC, gdi.font[1]);
std::ostrstream oss(cbuf,64);
std::ostringstream oss(cbuf,64);
if (m_ylabel.size()) {
oss << m_ylabel;
if (m_tickscale && m_tickscale != 1.0f) oss << " x " << 1.0/m_tickscale;
oss << '\0';
TextOut (hDC, 0, (y0+y1)/2, oss.str(), strlen(oss.str()));
TextOut (hDC, 0, (y0+y1)/2, oss.str().c_str(), strlen(oss.str().c_str()));
}

SelectObject (hDC, pfont);
Expand Down