File tree Expand file tree Collapse file tree 5 files changed +23
-10
lines changed
Expand file tree Collapse file tree 5 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -266,13 +266,13 @@ class SmallStackString : public SmallStringBase
266266public:
267267 ALWAYS_INLINE SmallStackString () { init (); }
268268
269- ALWAYS_INLINE SmallStackString (const char * str)
269+ ALWAYS_INLINE explicit SmallStackString (const char * str)
270270 {
271271 init ();
272272 assign (str);
273273 }
274274
275- ALWAYS_INLINE SmallStackString (const char * str, u32 length)
275+ ALWAYS_INLINE explicit SmallStackString (const char * str, u32 length)
276276 {
277277 init ();
278278 assign (str, length);
@@ -290,19 +290,25 @@ class SmallStackString : public SmallStringBase
290290 assign (move);
291291 }
292292
293- ALWAYS_INLINE SmallStackString (const SmallStackString& copy)
293+ ALWAYS_INLINE explicit SmallStackString (const SmallStackString& copy)
294294 {
295295 init ();
296296 assign (copy);
297297 }
298298
299- ALWAYS_INLINE SmallStackString (SmallStackString&& move)
299+ ALWAYS_INLINE explicit SmallStackString (SmallStackString&& move)
300300 {
301301 init ();
302302 assign (move);
303303 }
304304
305- ALWAYS_INLINE SmallStackString (const std::string_view sv)
305+ ALWAYS_INLINE explicit SmallStackString (const std::string& str)
306+ {
307+ init ();
308+ assign (str);
309+ }
310+
311+ ALWAYS_INLINE explicit SmallStackString (const std::string_view sv)
306312 {
307313 init ();
308314 assign (sv);
@@ -332,6 +338,12 @@ class SmallStackString : public SmallStringBase
332338 return *this ;
333339 }
334340
341+ ALWAYS_INLINE SmallStackString& operator =(const std::string& str)
342+ {
343+ assign (str);
344+ return *this ;
345+ }
346+
335347 ALWAYS_INLINE SmallStackString& operator =(const std::string_view sv)
336348 {
337349 assign (sv);
Original file line number Diff line number Diff line change @@ -3815,7 +3815,7 @@ static TinyString GetLoginEncryptionMachineKey()
38153815 {
38163816 WARNING_LOG (" Get MachineGuid failed: {}" , error);
38173817 RegCloseKey (hKey);
3818- return 0 ;
3818+ return ret ;
38193819 }
38203820
38213821 ret.resize (machine_guid_length);
@@ -3826,7 +3826,7 @@ static TinyString GetLoginEncryptionMachineKey()
38263826 WARNING_LOG (" Read MachineGuid failed: {}" , error);
38273827 ret = {};
38283828 RegCloseKey (hKey);
3829- return 0 ;
3829+ return ret ;
38303830 }
38313831
38323832 ret.resize (machine_guid_length);
Original file line number Diff line number Diff line change @@ -6192,7 +6192,7 @@ void System::UpdateRichPresence(bool update_session_time)
61926192 rp.largeImageText = " DuckStation PS1/PSX Emulator" ;
61936193 rp.startTimestamp = s_state.discord_presence_time_epoch ;
61946194
6195- TinyString game_details = " No Game Running" ;
6195+ TinyString game_details ( " No Game Running" ) ;
61966196 if (IsValidOrInitializing ())
61976197 {
61986198 // Use disc set name if it's not a custom title.
Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ static TinyString GetCubebErrorString(int rv)
5959 C (CUBEB_ERROR_DEVICE_UNAVAILABLE);
6060
6161 default :
62- return " CUBEB_ERROR_UNKNOWN" ;
62+ ret = " CUBEB_ERROR_UNKNOWN" ;
63+ break ;
6364
6465#undef C
6566 }
Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ std::optional<VkSurfaceFormatKHR> VulkanSwapChain::SelectSurfaceFormat(VkPhysica
249249 return VkSurfaceFormatKHR{format, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR};
250250 }
251251
252- SmallString errormsg = " Failed to find a suitable format for swap chain buffers. Available formats were:" ;
252+ SmallString errormsg ( " Failed to find a suitable format for swap chain buffers. Available formats were:" ) ;
253253 for (const VkSurfaceFormatKHR& sf : surface_formats)
254254 errormsg.append_format (" {}" , static_cast <unsigned >(sf.format ));
255255 Error::SetStringView (error, errormsg);
You can’t perform that action at this time.
0 commit comments