aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-10-21 04:35:46 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-10-21 04:44:47 +0300
commitbe45a2c1596d4cb748e0afbdc1c46ad36ad198b6 (patch)
treef8be68e9c566eb83b30ab9f02c6072eb8a2d5853 /src
parentadd Shared{Memory,Object} classes (diff)
downloadwinapi-common-be45a2c1596d4cb748e0afbdc1c46ad36ad198b6.tar.gz
winapi-common-be45a2c1596d4cb748e0afbdc1c46ad36ad198b6.zip
code style
Diffstat (limited to 'src')
-rw-r--r--src/pipe.cpp10
-rw-r--r--src/shmem.cpp12
2 files changed, 11 insertions, 11 deletions
diff --git a/src/pipe.cpp b/src/pipe.cpp
index a00a8f6..f809995 100644
--- a/src/pipe.cpp
+++ b/src/pipe.cpp
@@ -17,8 +17,8 @@ namespace winapi {
namespace {
void create_pipe(Handle& read_end, Handle& write_end) {
- HANDLE h_read_end = INVALID_HANDLE_VALUE;
- HANDLE h_write_end = INVALID_HANDLE_VALUE;
+ HANDLE read_end_impl = INVALID_HANDLE_VALUE;
+ HANDLE write_end_impl = INVALID_HANDLE_VALUE;
SECURITY_ATTRIBUTES attributes;
std::memset(&attributes, 0, sizeof(attributes));
@@ -27,14 +27,14 @@ void create_pipe(Handle& read_end, Handle& write_end) {
BOOST_STATIC_CONSTEXPR DWORD buffer_size = 16 * 1024;
- const auto ret = ::CreatePipe(&h_read_end, &h_write_end, &attributes, buffer_size);
+ const auto ret = ::CreatePipe(&read_end_impl, &write_end_impl, &attributes, buffer_size);
if (!ret) {
throw error::windows(GetLastError(), "CreatePipe");
}
- read_end = Handle{h_read_end};
- write_end = Handle{h_write_end};
+ read_end = Handle{read_end_impl};
+ write_end = Handle{write_end_impl};
}
} // namespace
diff --git a/src/shmem.cpp b/src/shmem.cpp
index 552351d..c1f3757 100644
--- a/src/shmem.cpp
+++ b/src/shmem.cpp
@@ -46,26 +46,26 @@ SharedMemory SharedMemory::create(const std::string& name, std::size_t nb) {
const auto nb_low = static_cast<DWORD>(nb64);
const auto nb_high = static_cast<DWORD>(nb64 >> 32);
- const auto h_mapping = ::CreateFileMappingW(
+ const auto mapping_impl = ::CreateFileMappingW(
INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, nb_high, nb_low, widen(name).c_str());
- if (h_mapping == NULL) {
+ if (mapping_impl == NULL) {
throw error::windows(GetLastError(), "CreateFileMappingW");
}
- Handle mapping{h_mapping};
+ Handle mapping{mapping_impl};
const auto addr = do_map(mapping);
return {std::move(mapping), addr};
}
SharedMemory SharedMemory::open(const std::string& name) {
- const auto h_mapping = ::OpenFileMappingW(FILE_MAP_ALL_ACCESS, FALSE, widen(name).c_str());
+ const auto mapping_impl = ::OpenFileMappingW(FILE_MAP_ALL_ACCESS, FALSE, widen(name).c_str());
- if (h_mapping == NULL) {
+ if (mapping_impl == NULL) {
throw error::windows(GetLastError(), "OpenFileMappingW");
}
- Handle mapping{h_mapping};
+ Handle mapping{mapping_impl};
const auto addr = do_map(mapping);
return {std::move(mapping), addr};
}