diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-05-01 15:34:26 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-05-01 15:34:26 +0300 |
commit | 309a2f9fbd82f5acdcd969dac089b06aa5ad86a6 (patch) | |
tree | 58f918a2786a1b2d4715a9535cf728edca35c1f0 /um | |
parent | README updates (diff) | |
download | windows7-drivers-309a2f9fbd82f5acdcd969dac089b06aa5ad86a6.tar.gz windows7-drivers-309a2f9fbd82f5acdcd969dac089b06aa5ad86a6.zip |
service: code style
Diffstat (limited to '')
-rw-r--r-- | um/service/include/libservice/device.hpp | 14 | ||||
-rw-r--r-- | um/service/include/libservice/handle.hpp | 12 | ||||
-rw-r--r-- | um/service/include/libservice/service.hpp | 14 | ||||
-rw-r--r-- | um/service/include/libservice/service_handle.hpp | 14 | ||||
-rw-r--r-- | um/service/include/libservice/service_manager.hpp | 14 | ||||
-rw-r--r-- | um/service/src/device.cpp | 17 | ||||
-rw-r--r-- | um/service/src/handle.cpp | 27 | ||||
-rw-r--r-- | um/service/src/service.cpp | 18 | ||||
-rw-r--r-- | um/service/src/service_handle.cpp | 27 | ||||
-rw-r--r-- | um/service/src/service_manager.cpp | 19 |
10 files changed, 50 insertions, 126 deletions
diff --git a/um/service/include/libservice/device.hpp b/um/service/include/libservice/device.hpp index ac292c8..f61c59a 100644 --- a/um/service/include/libservice/device.hpp +++ b/um/service/include/libservice/device.hpp @@ -63,13 +63,19 @@ namespace libservice Device(const Device&) = delete; }; - void swap(Device&, Device&) LIBSERVICE_NOEXCEPT; + inline void swap(Device& a, Device& b) LIBSERVICE_NOEXCEPT + { + a.swap(b); + } } namespace std { template <> - void swap<libservice::Device>( - libservice::Device&, - libservice::Device&) LIBSERVICE_NOEXCEPT; + inline void swap<libservice::Device>( + libservice::Device& a, + libservice::Device& b) LIBSERVICE_NOEXCEPT + { + a.swap(b); + } } diff --git a/um/service/include/libservice/handle.hpp b/um/service/include/libservice/handle.hpp index 5e351d2..abd1d5a 100644 --- a/um/service/include/libservice/handle.hpp +++ b/um/service/include/libservice/handle.hpp @@ -65,13 +65,19 @@ namespace libservice Handle(const Handle&) = delete; }; - void swap(Handle& a, Handle& b) LIBSERVICE_NOEXCEPT; + inline void swap(Handle& a, Handle& b) LIBSERVICE_NOEXCEPT + { + a.swap(b); + } } namespace std { template <> - void swap<libservice::Handle>( + inline void swap<libservice::Handle>( libservice::Handle& a, - libservice::Handle& b) LIBSERVICE_NOEXCEPT; + libservice::Handle& b) LIBSERVICE_NOEXCEPT + { + a.swap(b); + } } diff --git a/um/service/include/libservice/service.hpp b/um/service/include/libservice/service.hpp index 089f790..ca01ab4 100644 --- a/um/service/include/libservice/service.hpp +++ b/um/service/include/libservice/service.hpp @@ -61,13 +61,19 @@ namespace libservice Service(const Service&) = delete; }; - void swap(Service&, Service&) LIBSERVICE_NOEXCEPT; + inline void swap(Service& a, Service& b) LIBSERVICE_NOEXCEPT + { + a.swap(b); + } } namespace std { template <> - void swap<libservice::Service>( - libservice::Service&, - libservice::Service&) LIBSERVICE_NOEXCEPT; + inline void swap<libservice::Service>( + libservice::Service& a, + libservice::Service& b) LIBSERVICE_NOEXCEPT + { + a.swap(b); + } } diff --git a/um/service/include/libservice/service_handle.hpp b/um/service/include/libservice/service_handle.hpp index 2883ff3..52e37f4 100644 --- a/um/service/include/libservice/service_handle.hpp +++ b/um/service/include/libservice/service_handle.hpp @@ -64,13 +64,19 @@ namespace libservice ServiceHandle(const ServiceHandle&) = delete; }; - void swap(ServiceHandle&, ServiceHandle&) LIBSERVICE_NOEXCEPT; + inline void swap(ServiceHandle& a, ServiceHandle& b) LIBSERVICE_NOEXCEPT + { + a.swap(b); + } } namespace std { template <> - void swap<libservice::ServiceHandle>( - libservice::ServiceHandle&, - libservice::ServiceHandle&) LIBSERVICE_NOEXCEPT; + inline void swap<libservice::ServiceHandle>( + libservice::ServiceHandle& a, + libservice::ServiceHandle& b) LIBSERVICE_NOEXCEPT + { + a.swap(b); + } } diff --git a/um/service/include/libservice/service_manager.hpp b/um/service/include/libservice/service_manager.hpp index 80e6f12..3d4fe3a 100644 --- a/um/service/include/libservice/service_manager.hpp +++ b/um/service/include/libservice/service_manager.hpp @@ -51,13 +51,19 @@ namespace libservice ServiceManager(const ServiceManager&) = delete; }; - void swap(ServiceManager& a, ServiceManager& b) LIBSERVICE_NOEXCEPT; + inline void swap(ServiceManager& a, ServiceManager& b) LIBSERVICE_NOEXCEPT + { + a.swap(b); + } } namespace std { template <> - void swap<libservice::ServiceManager>( - libservice::ServiceManager&, - libservice::ServiceManager&) LIBSERVICE_NOEXCEPT; + inline void swap<libservice::ServiceManager>( + libservice::ServiceManager& a, + libservice::ServiceManager& b) LIBSERVICE_NOEXCEPT + { + a.swap(b); + } } diff --git a/um/service/src/device.cpp b/um/service/src/device.cpp index 1bdb42f..f1ecccb 100644 --- a/um/service/src/device.cpp +++ b/um/service/src/device.cpp @@ -13,7 +13,6 @@ #include <stdexcept> #include <string> #include <system_error> -#include <utility> namespace libservice { @@ -117,20 +116,4 @@ namespace libservice return nbwritten; } - - void swap(Device& a, Device& b) LIBSERVICE_NOEXCEPT - { - a.swap(b); - } -} - -namespace std -{ - template <> - void swap<libservice::Device>( - libservice::Device& a, - libservice::Device& b) LIBSERVICE_NOEXCEPT - { - a.swap(b); - } } diff --git a/um/service/src/handle.cpp b/um/service/src/handle.cpp deleted file mode 100644 index 7567781..0000000 --- a/um/service/src/handle.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2015 Egor Tensin <Egor.Tensin@gmail.com> -// This file is part of the "Windows 7 drivers" project. -// For details, see https://github.com/egor-tensin/windows7-drivers. -// Distributed under the MIT License. - -#include "libservice/all.hpp" - -#include <utility> - -namespace libservice -{ - void swap(Handle& a, Handle& b) LIBSERVICE_NOEXCEPT - { - a.swap(b); - } -} - -namespace std -{ - template <> - void swap<libservice::Handle>( - libservice::Handle& a, - libservice::Handle& b) LIBSERVICE_NOEXCEPT - { - a.swap(b); - } -} diff --git a/um/service/src/service.cpp b/um/service/src/service.cpp index 8b5e043..1cdfe71 100644 --- a/um/service/src/service.cpp +++ b/um/service/src/service.cpp @@ -9,8 +9,6 @@ #include <string> #include <system_error> -#include <utility> -#include <vector> namespace libservice { @@ -257,20 +255,4 @@ namespace libservice stop(); uninstall_service(handle); } - - void swap(Service& a, Service& b) LIBSERVICE_NOEXCEPT - { - a.swap(b); - } -} - -namespace std -{ - template <> - void swap<libservice::Service>( - libservice::Service& a, - libservice::Service& b) LIBSERVICE_NOEXCEPT - { - a.swap(b); - } } diff --git a/um/service/src/service_handle.cpp b/um/service/src/service_handle.cpp deleted file mode 100644 index adce7f0..0000000 --- a/um/service/src/service_handle.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2015 Egor Tensin <Egor.Tensin@gmail.com> -// This file is part of the "Windows 7 drivers" project. -// For details, see https://github.com/egor-tensin/windows7-drivers. -// Distributed under the MIT License. - -#include "libservice/all.hpp" - -#include <utility> - -namespace libservice -{ - void swap(ServiceHandle& a, ServiceHandle& b) LIBSERVICE_NOEXCEPT - { - a.swap(b); - } -} - -namespace std -{ - template <> - void swap<libservice::ServiceHandle>( - libservice::ServiceHandle& a, - libservice::ServiceHandle& b) LIBSERVICE_NOEXCEPT - { - a.swap(b); - } -} diff --git a/um/service/src/service_manager.cpp b/um/service/src/service_manager.cpp index 61662de..530976c 100644 --- a/um/service/src/service_manager.cpp +++ b/um/service/src/service_manager.cpp @@ -8,13 +8,12 @@ #include <Windows.h> #include <system_error> -#include <utility> namespace libservice { ServiceManager ServiceManager::open() { - SC_HANDLE raw = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); + const auto raw = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if (NULL == raw) { @@ -25,20 +24,4 @@ namespace libservice return ServiceHandle(raw); } - - void swap(ServiceManager& a, ServiceManager& b) LIBSERVICE_NOEXCEPT - { - a.swap(b); - } -} - -namespace std -{ - template <> - void swap<libservice::ServiceManager>( - libservice::ServiceManager& a, - libservice::ServiceManager& b) LIBSERVICE_NOEXCEPT - { - a.swap(b); - } } |