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

stella: revert Convert stringstream::view() to stringstream::str() for ventura builds #1064

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions src/cheat/CheatManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void CheatManager::saveCheats(string_view md5sum)
cheats << ",";
}

const bool changed = cheats.view() != myCurrentCheat;
const bool changed = cheats.str() != myCurrentCheat;

// Only update the list if absolutely necessary
if(changed)
Expand All @@ -310,8 +310,8 @@ void CheatManager::saveCheats(string_view md5sum)
myCheatMap.erase(iter);

// Add new entry only if there are any cheats defined
if(!cheats.view().empty())
myCheatMap.emplace(md5sum, cheats.view());
if(!cheats.str().empty())
myCheatMap.emplace(md5sum, cheats.str());
}

// Update the dirty flag
Expand Down
4 changes: 2 additions & 2 deletions src/common/EventHandlerSDL2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ EventHandlerSDL2::EventHandlerSDL2(OSystem& osystem)
myQwertz = int{'y'} == static_cast<int>
(SDL_GetKeyFromScancode(static_cast<SDL_Scancode>(KBDK_Z)));
buf << "Keyboard: " << (myQwertz ? "QWERTZ" : "QWERTY");
Logger::debug(buf.view());
Logger::debug(buf.str());
}
#endif

Expand All @@ -43,7 +43,7 @@ EventHandlerSDL2::EventHandlerSDL2(OSystem& osystem)
ostringstream buf;
buf << "ERROR: Couldn't initialize SDL joystick support: "
<< SDL_GetError() << '\n';
Logger::error(buf.view());
Logger::error(buf.str());
}
Logger::debug("EventHandlerSDL2::EventHandlerSDL2 SDL_INIT_JOYSTICK");
#endif
Expand Down
10 changes: 5 additions & 5 deletions src/common/FBBackendSDL2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ void FBBackendSDL2::queryHardware(vector<Common::Size>& fullscreenRes,
SDL_GetDisplayMode(i, m, &mode);
res << std::setw(4) << mode.w << "x" << std::setw(4) << mode.h;

if(lastRes != res.view())
if(lastRes != res.str())
{
Logger::debug(s.view());
Logger::debug(s.str());
s.str("");
lastRes = res.view();
lastRes = res.str();
s << " " << lastRes << ": ";
}
s << mode.refresh_rate << "Hz";
Expand All @@ -118,7 +118,7 @@ void FBBackendSDL2::queryHardware(vector<Common::Size>& fullscreenRes,
else
s << " ";
}
Logger::debug(s.view());
Logger::debug(s.str());
}

// Now get the maximum windowed desktop resolution
Expand Down Expand Up @@ -332,7 +332,7 @@ bool FBBackendSDL2::setVideoMode(const VideoModeHandler::Mode& mode,

msg << "Display refresh rate changed to "
<< adaptedSdlMode.refresh_rate << " Hz " << "(" << adaptedSdlMode.w << "x" << adaptedSdlMode.h << ")";
Logger::info(msg.view());
Logger::info(msg.str());

SDL_DisplayMode setSdlMode;
SDL_GetWindowDisplayMode(myWindow, &setSdlMode);
Expand Down
6 changes: 3 additions & 3 deletions src/common/HighScoresManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ string HighScoresManager::md5Props() const

buf << specialAddress(jprops) << specialBCD(jprops) << specialZeroBased(jprops);

return MD5::hash(buf.view());
return MD5::hash(buf.str());
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down Expand Up @@ -569,7 +569,7 @@ string HighScoresManager::hash(const ScoresData& data) const
<< data.scores[r].date;
}

return MD5::hash(buf.view());
return MD5::hash(buf.str());
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down Expand Up @@ -656,7 +656,7 @@ void HighScoresManager::loadHighScores(ScoresData& data)
clearHighScores(data);
buf << "Error: Invalid high scores data for variation " << data.variation << ".";
}
myOSystem.frameBuffer().showTextMessage(buf.view());
myOSystem.frameBuffer().showTextMessage(buf.str());
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down
2 changes: 1 addition & 1 deletion src/common/JoyMap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ string JoyMap::getEventMappingDesc(int stick, Event::Type event,
{
if (_event == event && _mapping.mode == mode)
{
if(!buf.view().empty())
if(!buf.str().empty())
buf << ", ";
buf << "C" << stick << getDesc(event, _mapping);
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/KeyMap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ string KeyMap::getEventMappingDesc(Event::Type event, EventMode mode) const
{
if (_event == event && _mapping.mode == mode)
{
if(!buf.view().empty())
if(!buf.str().empty())
buf << ", ";
buf << getDesc(_mapping);
}
Expand Down
10 changes: 5 additions & 5 deletions src/common/MouseControl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ MouseControl::MouseControl(Console& console, string_view mode)
msg << ", Y-axis is ";
MControlToController(yaxis, ytype, yid);

myModeList.emplace_back(xtype, xid, ytype, yid, msg.view());
myModeList.emplace_back(xtype, xid, ytype, yid, msg.str());
}

// Now consider the possible modes for the mouse based on the left
Expand Down Expand Up @@ -174,7 +174,7 @@ void MouseControl::addLeftControllerModes(bool noswap)
msg << "Mouse is left " << myLeftController.name() << " controller";
const Controller::Type type = myLeftController.type();
const int id = noswap ? 0 : 1;
myModeList.emplace_back(type, id, type, id, msg.view());
myModeList.emplace_back(type, id, type, id, msg.str());
}
}
}
Expand All @@ -195,7 +195,7 @@ void MouseControl::addRightControllerModes(bool noswap)
msg << "Mouse is right " << myRightController.name() << " controller";
const Controller::Type type = myRightController.type();
const int id = noswap ? 1 : 0;
myModeList.emplace_back(type, id, type, id, msg.view());
myModeList.emplace_back(type, id, type, id, msg.str());
}
}
}
Expand All @@ -206,11 +206,11 @@ void MouseControl::addPaddleModes(int lport, int rport, int lname, int rname)
const Controller::Type type = Controller::Type::Paddles;
ostringstream msg;
msg << "Mouse is Paddle " << lname << " controller";
const MouseMode mode0(type, lport, type, lport, msg.view());
const MouseMode mode0(type, lport, type, lport, msg.str());

msg.str("");
msg << "Mouse is Paddle " << rname << " controller";
const MouseMode mode1(type, rport, type, rport, msg.view());
const MouseMode mode1(type, rport, type, rport, msg.str());

if(BSPF::equalsIgnoreCase(myProps.get(PropType::Controller_SwapPaddles), "NO"))
{
Expand Down
30 changes: 15 additions & 15 deletions src/common/PJoystickHandler.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int PhysicalJoystickHandler::add(const PhysicalJoystickPtr& stick)
{
ostringstream name;
name << stick->name << " #" << count+1;
stick->name = name.view();
stick->name = name.str();
}
stick->type = PhysicalJoystick::Type::REGULAR;
}
Expand Down Expand Up @@ -175,7 +175,7 @@ void PhysicalJoystickHandler::addToDatabase(const PhysicalJoystickPtr& stick)
ostringstream buf;
buf << "Added joystick " << stick->ID << ":\n"
<< " " << stick->about() << '\n';
Logger::info(buf.view());
Logger::info(buf.str());
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand All @@ -196,7 +196,7 @@ bool PhysicalJoystickHandler::remove(int id)
ostringstream buf;
buf << "Removed joystick " << mySticks[id]->ID << ":\n"
<< " " << mySticks[id]->about() << '\n';
Logger::info(buf.view());
Logger::info(buf.str());

// Remove joystick, but remember mapping
it->second.mapping = stick->getMap();
Expand Down Expand Up @@ -264,7 +264,7 @@ bool PhysicalJoystickHandler::mapStelladaptors(string_view saport, int ID)
ostringstream buf;
buf << "Erased joystick " << _stick->ID << ":\n"
<< " " << _stick->about() << '\n';
Logger::info(buf.view());
Logger::info(buf.str());

_stick->name.erase(pos);
erased = true;
Expand Down Expand Up @@ -808,7 +808,7 @@ string PhysicalJoystickHandler::getMappingDesc(Event::Type event, EventMode mode
//Joystick mapping / labeling
if(!_joyptr->joyMap.getEventMapping(event, evMode).empty())
{
if(!buf.view().empty())
if(!buf.str().empty())
buf << ", ";
buf << _joyptr->joyMap.getEventMappingDesc(_id, event, evMode);
}
Expand Down Expand Up @@ -1134,7 +1134,7 @@ void PhysicalJoystickHandler::changeDigitalDeadZone(int direction)
ss << std::round(Controller::digitalDeadZoneValue(deadZone) * 100.F / 32768) << "%";

myOSystem.frameBuffer().showGaugeMessage(
"Digital controller dead zone", ss.view(), deadZone,
"Digital controller dead zone", ss. str(), deadZone,
Controller::MIN_DIGITAL_DEADZONE, Controller::MAX_DIGITAL_DEADZONE);
}

Expand All @@ -1152,7 +1152,7 @@ void PhysicalJoystickHandler::changeAnalogPaddleDeadZone(int direction)
ss << std::round(Controller::analogDeadZoneValue(deadZone) * 100.F / 32768) << "%";

myOSystem.frameBuffer().showGaugeMessage(
"Analog controller dead zone", ss.view(), deadZone,
"Analog controller dead zone", ss.str(), deadZone,
Controller::MIN_ANALOG_DEADZONE, Controller::MAX_ANALOG_DEADZONE);
}

Expand All @@ -1170,7 +1170,7 @@ void PhysicalJoystickHandler::changeAnalogPaddleSensitivity(int direction)
ss << std::round(Paddles::analogSensitivityValue(sense) * 100.F) << "%";

myOSystem.frameBuffer().showGaugeMessage(
"Analog paddle sensitivity", ss.view(), sense,
"Analog paddle sensitivity", ss.str(), sense,
Paddles::MIN_ANALOG_SENSE, Paddles::MAX_ANALOG_SENSE);
}

Expand All @@ -1191,7 +1191,7 @@ void PhysicalJoystickHandler::changeAnalogPaddleLinearity(int direction)
ss << "Off";

myOSystem.frameBuffer().showGaugeMessage(
"Analog paddle linearity", ss.view(), linear,
"Analog paddle linearity", ss.str(), linear,
Paddles::MIN_ANALOG_LINEARITY, Paddles::MAX_ANALOG_LINEARITY);
}

Expand All @@ -1212,7 +1212,7 @@ void PhysicalJoystickHandler::changePaddleDejitterAveraging(int direction)
ss << "Off";

myOSystem.frameBuffer().showGaugeMessage(
"Analog paddle dejitter averaging", ss.view(), dejitter,
"Analog paddle dejitter averaging", ss.str(), dejitter,
Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER);
}

Expand All @@ -1233,7 +1233,7 @@ void PhysicalJoystickHandler::changePaddleDejitterReaction(int direction)
ss << "Off";

myOSystem.frameBuffer().showGaugeMessage(
"Analog paddle dejitter reaction", ss.view(), dejitter,
"Analog paddle dejitter reaction", ss.str(), dejitter,
Paddles::MIN_DEJITTER, Paddles::MAX_DEJITTER);
}

Expand All @@ -1254,7 +1254,7 @@ void PhysicalJoystickHandler::changeDigitalPaddleSensitivity(int direction)
ss << "Off";

myOSystem.frameBuffer().showGaugeMessage(
"Digital sensitivity", ss.view(), sense,
"Digital sensitivity", ss.str(), sense,
Paddles::MIN_DIGITAL_SENSE, Paddles::MAX_DIGITAL_SENSE);
}

Expand All @@ -1272,7 +1272,7 @@ void PhysicalJoystickHandler::changeMousePaddleSensitivity(int direction)
ss << sense * 10 << "%";

myOSystem.frameBuffer().showGaugeMessage(
"Mouse paddle sensitivity", ss.view(), sense,
"Mouse paddle sensitivity", ss.str(), sense,
Controller::MIN_MOUSE_SENSE, Controller::MAX_MOUSE_SENSE);
}

Expand All @@ -1290,7 +1290,7 @@ void PhysicalJoystickHandler::changeMouseTrackballSensitivity(int direction)
ss << sense * 10 << "%";

myOSystem.frameBuffer().showGaugeMessage(
"Mouse trackball sensitivity", ss.view(), sense,
"Mouse trackball sensitivity", ss.str(), sense,
PointingDevice::MIN_SENSE, PointingDevice::MAX_SENSE);
}

Expand All @@ -1308,7 +1308,7 @@ void PhysicalJoystickHandler::changeDrivingSensitivity(int direction)
ss << sense * 10 << "%";

myOSystem.frameBuffer().showGaugeMessage(
"Driving controller sensitivity", ss.view(), sense,
"Driving controller sensitivity", ss.str(), sense,
Driving::MIN_SENSE, Driving::MAX_SENSE);
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/PKeyboardHandler.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ void PhysicalKeyboardHandler::toggleModKeys(bool toggle)
ostringstream ss;
ss << "Modifier key combos ";
ss << (modCombo ? "enabled" : "disabled");
myOSystem.frameBuffer().showTextMessage(ss.view());
myOSystem.frameBuffer().showTextMessage(ss.str());
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down
12 changes: 6 additions & 6 deletions src/common/PNGLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void PNGLibrary::toggleContinuousSnapshots(bool perFrame)
buf << "Enabling snapshots in " << interval << " second intervals";
interval *= static_cast<uInt32>(myOSystem.frameRate());
}
myOSystem.frameBuffer().showTextMessage(buf.view());
myOSystem.frameBuffer().showTextMessage(buf.str());
setContinuousSnapInterval(interval);
}
else
Expand All @@ -282,7 +282,7 @@ void PNGLibrary::toggleContinuousSnapshots(bool perFrame)
buf << "Disabling snapshots, generated "
<< (mySnapCounter / mySnapInterval)
<< " files";
myOSystem.frameBuffer().showTextMessage(buf.view());
myOSystem.frameBuffer().showTextMessage(buf.str());
setContinuousSnapInterval(0);
}
}
Expand Down Expand Up @@ -313,7 +313,7 @@ void PNGLibrary::takeSnapshot(uInt32 number)
ostringstream buf;
buf << sspath << "_" << std::hex << std::setw(8) << std::setfill('0')
<< number << ".png";
filename = buf.view();
filename = buf.str();
}
else if(!myOSystem.settings().getBool("sssingle"))
{
Expand All @@ -328,11 +328,11 @@ void PNGLibrary::takeSnapshot(uInt32 number)
{
buf.str("");
buf << sspath << "_" << i << ".png";
const FSNode next(buf.view());
const FSNode next(buf.str());
if(!next.exists())
break;
}
filename = buf.view();
filename = buf.str();
}
}
else
Expand All @@ -344,7 +344,7 @@ void PNGLibrary::takeSnapshot(uInt32 number)
VarList::push_back(metaData, "Title", "Snapshot");
version << "Stella " << STELLA_VERSION << " (Build " << STELLA_BUILD << ") ["
<< BSPF::ARCH << "]";
VarList::push_back(metaData, "Software", version.view());
VarList::push_back(metaData, "Software", version.str());
const string& name = (myOSystem.settings().getString("snapname") == "int")
? myOSystem.console().properties().get(PropType::Cart_Name)
: myOSystem.romFile().getName();
Expand Down
6 changes: 3 additions & 3 deletions src/common/PaletteHandler.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void PaletteHandler::showAdjustableMessage()
myOSystem.console().timing() == ConsoleTiming::pal ? myPhasePAL : myPhaseNTSC;
buf << std::fixed << std::setprecision(1) << value << DEGREE;
myOSystem.frameBuffer().showGaugeMessage(
"Palette phase shift", buf.view(), value,
"Palette phase shift", buf.str(), value,
(isNTSC ? DEF_NTSC_SHIFT : DEF_PAL_SHIFT) - MAX_PHASE_SHIFT,
(isNTSC ? DEF_NTSC_SHIFT : DEF_PAL_SHIFT) + MAX_PHASE_SHIFT);
}
Expand All @@ -122,7 +122,7 @@ void PaletteHandler::showAdjustableMessage()

buf << std::fixed << std::setprecision(1) << value << DEGREE;
myOSystem.frameBuffer().showGaugeMessage(
msg.view(), buf.view(), value, -MAX_RGB_SHIFT, +MAX_RGB_SHIFT);
msg.str(), buf.str(), value, -MAX_RGB_SHIFT, +MAX_RGB_SHIFT);
}
else
{
Expand All @@ -131,7 +131,7 @@ void PaletteHandler::showAdjustableMessage()
: scaleTo100(*myAdjustables[myCurrentAdjustable].value);
buf << value << "%";
myOSystem.frameBuffer().showGaugeMessage(
msg.view(), buf.view(), value);
msg.str(), buf.str(), value);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/common/RewindManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ string RewindManager::saveAllStates()
<< myOSystem.console().properties().get(PropType::Cart_Name)
<< ".sta";

Serializer out(buf.view(), Serializer::Mode::ReadWriteTrunc);
Serializer out(buf.str(), Serializer::Mode::ReadWriteTrunc);
if (!out)
return "Can't save to all states file";

Expand Down Expand Up @@ -296,7 +296,7 @@ string RewindManager::loadAllStates()
<< ".sta";

// Make sure the file can be opened for reading
const Serializer in(buf.view(), Serializer::Mode::ReadOnly);
const Serializer in(buf.str(), Serializer::Mode::ReadOnly);
if (!in)
return "Can't load from all states file";

Expand Down
Loading