diff options
| author | a1xd <[email protected]> | 2021-03-30 18:27:02 -0400 |
|---|---|---|
| committer | a1xd <[email protected]> | 2021-03-30 18:27:02 -0400 |
| commit | fa3ebfb1eb054ba88824a908c996094bb98e85c5 (patch) | |
| tree | bf52cf6d5de16714dba11e96719ce1434a686779 /common/rawaccel-io.hpp | |
| parent | put utility in namespace (diff) | |
| download | rawaccel-fa3ebfb1eb054ba88824a908c996094bb98e85c5.tar.xz rawaccel-fa3ebfb1eb054ba88824a908c996094bb98e85c5.zip | |
refactor lut/motivity
Diffstat (limited to 'common/rawaccel-io.hpp')
| -rw-r--r-- | common/rawaccel-io.hpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/common/rawaccel-io.hpp b/common/rawaccel-io.hpp index 0d3ddee..da496fa 100644 --- a/common/rawaccel-io.hpp +++ b/common/rawaccel-io.hpp @@ -1,14 +1,15 @@ #pragma once -#include <system_error> +#include "rawaccel-io-def.h" +#include "rawaccel.hpp" +#include "rawaccel-version.h" +#include "rawaccel-error.hpp" #define NOMINMAX +#define WIN32_LEAN_AND_MEAN #include <Windows.h> -#include "rawaccel-io-def.h" -#include "rawaccel-base.hpp" -#include "rawaccel-version.h" -#include "rawaccel-error.hpp" +#include <system_error> #pragma warning(push) #pragma warning(disable:4245) // int -> DWORD conversion while passing CTL_CODE @@ -45,18 +46,14 @@ namespace rawaccel { } } - inline settings read() + inline void read(io_t& args) { - settings args; - io_control(RA_READ, NULL, 0, &args, sizeof(settings)); - return args; + io_control(RA_READ, NULL, 0, &args, sizeof(io_t)); } - - inline void write(const settings& args) + inline void write(const io_t& args) { - auto in_ptr = const_cast<settings*>(&args); - io_control(RA_WRITE, in_ptr, sizeof(settings), NULL, 0); + io_control(RA_WRITE, const_cast<io_t*>(&args), sizeof(io_t), NULL, 0); } inline version_t get_version() |