diff options
| author | 2016-03-21 11:19:18 -0400 | |
|---|---|---|
| committer | 2016-03-21 11:19:18 -0400 | |
| commit | 446d7c7e55a6ab00af606d0c712e00d4b792f9f7 (patch) | |
| tree | 31ae3e0b490cfa6da389bdb9e28997bac6baf46e /src | |
| parent | Merge pull request #1562 from lioncash/constexpr (diff) | |
| parent | soc_u: Get rid of explicit delete and new (diff) | |
| download | yuzu-446d7c7e55a6ab00af606d0c712e00d4b792f9f7.tar.gz yuzu-446d7c7e55a6ab00af606d0c712e00d4b792f9f7.tar.xz yuzu-446d7c7e55a6ab00af606d0c712e00d4b792f9f7.zip | |
Merge pull request #1559 from lioncash/vec
soc_u: Get rid of explicit delete and new
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/soc_u.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp index b52e52d4a..ff0af8f12 100644 --- a/src/core/hle/service/soc_u.cpp +++ b/src/core/hle/service/soc_u.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <cstring> | 6 | #include <cstring> |
| 7 | #include <unordered_map> | 7 | #include <unordered_map> |
| 8 | #include <vector> | ||
| 8 | 9 | ||
| 9 | #include "common/assert.h" | 10 | #include "common/assert.h" |
| 10 | #include "common/bit_field.h" | 11 | #include "common/bit_field.h" |
| @@ -593,17 +594,13 @@ static void Poll(Service::Interface* self) { | |||
| 593 | 594 | ||
| 594 | // The 3ds_pollfd and the pollfd structures may be different (Windows/Linux have different sizes) | 595 | // The 3ds_pollfd and the pollfd structures may be different (Windows/Linux have different sizes) |
| 595 | // so we have to copy the data | 596 | // so we have to copy the data |
| 596 | pollfd* platform_pollfd = new pollfd[nfds]; | 597 | std::vector<pollfd> platform_pollfd(nfds); |
| 597 | for (unsigned current_fds = 0; current_fds < nfds; ++current_fds) | 598 | std::transform(input_fds, input_fds + nfds, platform_pollfd.begin(), CTRPollFD::ToPlatform); |
| 598 | platform_pollfd[current_fds] = CTRPollFD::ToPlatform(input_fds[current_fds]); | ||
| 599 | 599 | ||
| 600 | int ret = ::poll(platform_pollfd, nfds, timeout); | 600 | const int ret = ::poll(platform_pollfd.data(), nfds, timeout); |
| 601 | 601 | ||
| 602 | // Now update the output pollfd structure | 602 | // Now update the output pollfd structure |
| 603 | for (unsigned current_fds = 0; current_fds < nfds; ++current_fds) | 603 | std::transform(platform_pollfd.begin(), platform_pollfd.end(), output_fds, CTRPollFD::FromPlatform); |
| 604 | output_fds[current_fds] = CTRPollFD::FromPlatform(platform_pollfd[current_fds]); | ||
| 605 | |||
| 606 | delete[] platform_pollfd; | ||
| 607 | 604 | ||
| 608 | int result = 0; | 605 | int result = 0; |
| 609 | if (ret == SOCKET_ERROR_VALUE) | 606 | if (ret == SOCKET_ERROR_VALUE) |