<feed xmlns='http://www.w3.org/2005/Atom'>
<title>yuzu/src/common/misc.cpp, branch main</title>
<subtitle>Nintendo Switch emulator</subtitle>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/'/>
<entry>
<title>common: Move error handling to error.cpp/h</title>
<updated>2021-09-11T21:19:14+00:00</updated>
<author>
<name>Morph</name>
<email>39850852+Morph1984@users.noreply.github.com</email>
</author>
<published>2021-09-08T18:36:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=290afc00d36bbdcdc67d66a4586fd2f188734ad3'/>
<id>290afc00d36bbdcdc67d66a4586fd2f188734ad3</id>
<content type='text'>
This allows us to avoid implicitly including &lt;string&gt; every time common_funcs.h is included.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows us to avoid implicitly including &lt;string&gt; every time common_funcs.h is included.
</pre>
</div>
</content>
</entry>
<entry>
<title>[network] Error handling reform</title>
<updated>2021-02-28T22:25:31+00:00</updated>
<author>
<name>comex</name>
<email>comexk@gmail.com</email>
</author>
<published>2021-01-24T20:17:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=2910aa77b2feea39fc0618598e275b138a346e71'/>
<id>2910aa77b2feea39fc0618598e275b138a346e71</id>
<content type='text'>
`network.cpp` has several error paths which either:
- report "Unhandled host socket error=n" and return `SUCCESS`, or
- switch on a few possible errors, log them, and translate them to
  Errno; the same switch statement is copied and pasted in multiple
  places in the code

Convert these paths to use a helper function `GetAndLogLastError`, which
is roughly the equivalent of one of the switch statements, but:
- handling more cases (both ones that were already in `Errno`, and a few
  more I added), and
- using OS functions to convert the error to a string when logging, so
  it'll describe the error even if it's not one of the ones in the
  switch statement.
  - To handle this, refactor the logic in `GetLastErrorMsg` to expose a
    new function `NativeErrorToString` which takes the error number
    explicitly as an argument.  And improve the Windows version a bit.

Also, add a test which exercises two random error paths.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`network.cpp` has several error paths which either:
- report "Unhandled host socket error=n" and return `SUCCESS`, or
- switch on a few possible errors, log them, and translate them to
  Errno; the same switch statement is copied and pasted in multiple
  places in the code

Convert these paths to use a helper function `GetAndLogLastError`, which
is roughly the equivalent of one of the switch statements, but:
- handling more cases (both ones that were already in `Errno`, and a few
  more I added), and
- using OS functions to convert the error to a string when logging, so
  it'll describe the error even if it's not one of the ones in the
  switch statement.
  - To handle this, refactor the logic in `GetLastErrorMsg` to expose a
    new function `NativeErrorToString` which takes the error number
    explicitly as an argument.  And improve the Windows version a bit.

Also, add a test which exercises two random error paths.
</pre>
</div>
</content>
</entry>
<entry>
<title>General: Make ignoring a discarded return value an error</title>
<updated>2020-10-30T04:13:21+00:00</updated>
<author>
<name>Lioncash</name>
<email>mathew1800@gmail.com</email>
</author>
<published>2020-10-30T03:30:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=26547d3e3be403047445fd39e671d7ef3b88dabb'/>
<id>26547d3e3be403047445fd39e671d7ef3b88dabb</id>
<content type='text'>
Allows our CI to catch more potential bugs. This also removes the
[[nodiscard]] attribute of IOFile's Open member function. There are
cases where a file may want to be opened, but have the status of it
checked at a later time.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allows our CI to catch more potential bugs. This also removes the
[[nodiscard]] attribute of IOFile's Open member function. There are
cases where a file may want to be opened, but have the status of it
checked at a later time.
</pre>
</div>
</content>
</entry>
<entry>
<title>Port #4182 from Citra: "Prefix all size_t with std::"</title>
<updated>2018-09-15T13:21:06+00:00</updated>
<author>
<name>fearlessTobi</name>
<email>thm.frey@gmail.com</email>
</author>
<published>2018-09-15T13:21:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=63c2e32e207d31ecadd9022e1d7cd705c9febac8'/>
<id>63c2e32e207d31ecadd9022e1d7cd705c9febac8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>common/misc: use windows.h</title>
<updated>2018-08-13T20:28:24+00:00</updated>
<author>
<name>Zhu PengFei</name>
<email>zhupengfei321@sina.cn</email>
</author>
<published>2018-08-13T20:28:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=59d18ef55b40930c1708e9a6f79cf12e125f2a1e'/>
<id>59d18ef55b40930c1708e9a6f79cf12e125f2a1e</id>
<content type='text'>
linux-mingw does not really like this.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
linux-mingw does not really like this.</pre>
</div>
</content>
</entry>
<entry>
<title>common/misc: Deduplicate code in GetLastErrorMsg()</title>
<updated>2018-07-19T13:15:38+00:00</updated>
<author>
<name>Lioncash</name>
<email>mathew1800@gmail.com</email>
</author>
<published>2018-07-19T13:03:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=e0b8a35937e5c93ce661e9a947bd2b5f68aa810f'/>
<id>e0b8a35937e5c93ce661e9a947bd2b5f68aa810f</id>
<content type='text'>
Android and macOS have supported thread_local for quite a while, but
most importantly is that we don't even really need it. Instead of using
a thread-local buffer, we can just return a non-static buffer as a
std::string, avoiding the need for that quality entirely.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Android and macOS have supported thread_local for quite a while, but
most importantly is that we don't even really need it. Instead of using
a thread-local buffer, we can just return a non-static buffer as a
std::string, avoiding the need for that quality entirely.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove empty newlines in #include blocks.</title>
<updated>2016-09-21T02:15:47+00:00</updated>
<author>
<name>Emmanuel Gil Peyrot</name>
<email>linkmauve@linkmauve.fr</email>
</author>
<published>2016-09-20T15:21:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=ebdae19fd226104baec712b9da9939ff82ef3c3a'/>
<id>ebdae19fd226104baec712b9da9939ff82ef3c3a</id>
<content type='text'>
This makes clang-format useful on those.

Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes clang-format useful on those.

Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
</pre>
</div>
</content>
</entry>
<entry>
<title>Sources: Run clang-format on everything.</title>
<updated>2016-09-18T00:38:01+00:00</updated>
<author>
<name>Emmanuel Gil Peyrot</name>
<email>linkmauve@linkmauve.fr</email>
</author>
<published>2016-09-18T00:38:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=dc8479928c5aee4c6ad6fe4f59006fb604cee701'/>
<id>dc8479928c5aee4c6ad6fe4f59006fb604cee701</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Common: Cleanup memory and misc includes.</title>
<updated>2015-06-27T23:36:54+00:00</updated>
<author>
<name>Emmanuel Gil Peyrot</name>
<email>linkmauve@linkmauve.fr</email>
</author>
<published>2015-06-21T12:12:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=2d044a67c932403b81fdde6f81d461c6e7c11efe'/>
<id>2d044a67c932403b81fdde6f81d461c6e7c11efe</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Common: Remove common.h</title>
<updated>2015-05-07T18:45:22+00:00</updated>
<author>
<name>Yuri Kunde Schlesner</name>
<email>yuriks@yuriks.net</email>
</author>
<published>2015-05-06T07:06:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=e1fbac3ca13d37d2625c11d30cfdece4327b446b'/>
<id>e1fbac3ca13d37d2625c11d30cfdece4327b446b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
