Commit Graph
196 Commits
Author SHA1 Message Date
Vasily e7e7272d52 Fix memory leaks as result of missing delete[]
The delete keyword only calls a single destructor, delete[] calls as
many as there are members in the array.
2018-12-27 14:23:54 +01:00
Vasily d9a4da5f5d Change C style cast to reinterpret_cast
static_cast won't cast between pointer types, reinterpret_cast will.
2018-12-27 14:18:03 +01:00
Vasily b452e68456 Fix minor memory leaks
The delete keyword only calls a single destructor, the delete[] keyword
calls as many destructors as there are members of the array.
2018-12-27 14:14:49 +01:00
Vasily 450bf91db6 Resolve implicit unsigned/signed casts 2018-12-27 14:13:27 +01:00
Vasily 6c4541018d Change NULL to nullptr 2018-12-27 14:05:37 +01:00
Vasily 0d6917566e Add clang switch to ignore third party warnings
The --system-header-prefix=third-party treats all includes with a path
matching third-party as system files, meaning they won't show warnings.
2018-12-27 14:04:14 +01:00
Vasily f32c91fe03 Fix GCC warning about unused value
Casting to void should shut up GCC about

error: statement has no effect [-Werror=unused-value]

static_cast<void>() is possible for all current types. Supposedly an old
C style cast could also be used, but they should not be used in modern
C++ code.
2018-12-27 13:09:17 +01:00
Vasily 9a2c388a1c Solve initialization bug in MOveCenterTabController
GCC gave error

../src/tabcontrollers/MoveCenterTabController.cpp:57:67: error:
operation on
‘((advsettings::MoveCenterTabController*)this)->advsettings::MoveCenterTabController::lastMoveButtonClick[0]’
may be undefined [-Werror=sequence-point]

Because assigning a value to itself twice is undefined behavior. It is
highly likely that intended behavior was to initialize both array
members to the same value at once.
2018-12-27 12:14:07 +01:00
Vasily e54f244508 Fix warnings in AudioTabController
Mostly casts and unsigned to signed comparisons.

Testing to ensure that the int isn't below 0. If it is, it can't be used
in the array later anyway. After we're sure it isn't below 0 it's safe
to static_cast<size_t>().
2018-12-27 01:55:49 +01:00
Vasily f4feafaa03 Add parens around statement to banish warning 2018-12-27 01:26:13 +01:00
Vasily 4904ccaa35 Move variables to .cpp file to prevent unused var warning message 2018-12-27 01:17:02 +01:00
Vasily 5252efcd59 Merge branch 'master' into eliminate-warnings 2018-12-27 01:00:31 +01:00
Vasily 087d242664 Add compiler switches for warnings as errors
Currently with /W3 on MSVC there are no warnings. Clang and g++ are not
tested.

The "QMAKE_CFLAGS_WARN_ON -= -W3" and "QMAKE_CXXFLAGS_WARN_ON -= -W3"
are necessary because if they are not removed in the config, the
compiler will give D9025: overriding '/W4' with '/W3' error warnings and
not actually use /W4.
2018-12-27 00:58:28 +01:00
Vasily 629c956618 Change variable being shadowed
apperror was shadowing another variable in the scope outside of the if
statement, leading to a warning.

Adding an underscore changes the var name without changing the meaning.
In the future a different structure should probably be chosen for the
statements.
2018-12-27 00:29:08 +01:00
Vasily 6d3b5fdf63 Remove warnings for unreferenced parameters
The warnings in dummy functions are preventing the project from being
compiled with warnings as errors.

There were two options:

* Using a define to create a noop (chosen option).

* Commenting out the variable name, leaving only the type.

The first option was chosen because the second option would leave out
information from the IDE and compiler, while the first option wouldn't.

The intent is also clearer with the first option, otherwise it would
likely be necessary to leave comments with every single parameter that
was commented out.
2018-12-26 23:01:11 +01:00
Vasily 1a043b6672 Remove code path that would never be executed 2018-12-26 22:33:26 +01:00
Robin Appelman acec93f624 Merge pull request #10 from OpenVR-Advanced-Settings/new-windows-build
Add new windows build scripts
2018-12-26 22:32:35 +01:00
Vasily 62489ed642 Move global level strings into scope of main 2018-12-26 22:32:21 +01:00
Vasily b5877cd4e7 Update documentation for building on windows 2018-12-26 22:08:45 +01:00
Vasily 2aa32bafad Change variable expansion in build scripts
Currently the variable expansion sometimes doesn't work when done over
two variables. Inlining the ~dp0 call along with \..\..\ seems to work.

Testing leads me to believe that the Windows command prompt caches
things in a weird way.
2018-12-26 21:58:03 +01:00
Vasily 759bd859bb Merge remote-tracking branch 'origin/master' into new-windows-build 2018-12-26 20:37:10 +01:00
Vasily de8dffe40f Add extra checks for environment vars 2018-12-26 20:23:16 +01:00
Vasily 8d0277f6cf Add quotes to all env vars in appveyor 2018-12-26 20:11:02 +01:00
Vasily fc103633fe Update package script to consider path vars 2018-12-26 20:04:55 +01:00
Vasily 2085d0716b Update appveyor, .gitignore and master build script 2018-12-26 19:38:50 +01:00
username223 afd79cd3e4 Merge pull request #9 from OpenVR-Advanced-Settings/keyboard-alt-tab
Add option to send Alt-Tab as keyboard input
2018-12-26 18:34:11 +01:00
Vasily 43eafba7a7 Add error handling to master 2018-12-26 18:21:11 +01:00
Vasily eee7148c00 New build_windows.cmd
Change names of build scripts
2018-12-26 18:21:02 +01:00
Vasily 8bec43d01e Add new build scripts for windows
The old build scripts used hard coded directory paths, didn't check if
the paths actually existed and didn't differentiate between compiling,
deploying libraries and packaging for release.

The new build scripts are split into three different files. They are all
longer than the old build scripts, but most of the extra lines are
error checking, which the old one lacked.

It was considered writing the build scripts in another language like
Python or Powershell, but the relatively small size of the project and
unlikelihood of the build systems needing to grow massively means that a
very simple imperative language like the Microsoft scripting language is
fine.
2018-12-26 18:10:10 +01:00
ykeara 18d9d7b67e Merge branch 'master' into keyboard-alt-tab 2018-12-26 11:03:27 -06:00
ykeara 46c547b93c Merge pull request #8 from OpenVR-Advanced-Settings/require-56
specify dependency on qt >=5.6
2018-12-26 11:03:05 -06:00
Robin Appelman 8e2ca3602a Add option to send Alt-Tab as keyboard input 2018-12-26 16:32:38 +01:00
Robin Appelman c57b9bc62d specify dependency on qt >5.6 2018-12-26 15:26:59 +01:00
Robin Appelman 192e315f9f add qtcreator's .pro.user.* to gitignore 2018-12-26 15:10:03 +01:00
ykeara 835c51e937 Merge pull request #7 from OpenVR-Advanced-Settings/travis-ci
add travis config for linux ci build
2018-12-25 22:41:20 -06:00
Robin Appelman f383fe081e switch to cmath and std::isnan 2018-12-26 02:09:50 +01:00
Robin Appelman 32fd633588 use kubuntu backports in travis for qt 5.6 2018-12-26 01:56:33 +01:00
Robin Appelman d8044803c3 specify c++11 2018-12-26 01:55:58 +01:00
Robin Appelman 1e7f2a5bad add travis config for linux ci build 2018-12-26 01:35:40 +01:00
username223 940355c168 Merge pull request #5 from OpenVR-Advanced-Settings/cleanup-pro
cleanup .pro file
2018-12-26 00:30:15 +01:00
username223 c3d1ba3e24 Merge branch 'master' into cleanup-pro 2018-12-26 00:24:05 +01:00
Robin Appelman 1df8bd88ae Merge pull request #6 from OpenVR-Advanced-Settings/improve-docs
Add table of contents to readme, improve docs for building on windows and command line args
2018-12-25 22:25:17 +01:00
Vasily f9784ec62c Resolved merge conflict 2018-12-25 22:00:03 +01:00
Robin Appelman 30fe09c5ea cleanup .pro file 2018-12-25 21:50:44 +01:00
Vasily 4438f4cd28 Add table of contents, docs on command line args and building for windows
The current readme lacks a table of contents, which makes finding what
you're looking for difficult because of the large amount of images and
text.

The current documentation on building for windows doesn't mention the
fact that package.cmd also has to be run to create a full build. It is
also lacking in other areas, such as the packaging programs required.

The current documentation doesn't reflect the fact that you can pass
command line arguments to the program.
2018-12-25 21:44:26 +01:00
Robin Appelman f085abedc9 Merge pull request #4 from ykeara/master
Audio Profiles and Refactoring
2018-12-25 21:41:21 +01:00
ykeara b009cfa3e7 updated Docs for merge to Org 2018-12-25 14:05:05 -06:00
ykeara 8564d41d70 Merge pull request #4 from username223/master
Refactor arg parsing and remove/install manifest logic
2018-12-23 15:32:21 -06:00
Vasily 921d1ae828 Refactor manifest remove/install logic in main
The install/remove manifest logic in main is currently duplicated. This
bloats up main and creates unnecessarily large indented logic. The only
thing that is different between the two large if blocks is a single
function call.

Refactoring to test for which function to call at the latest possible
stage reduces code duplication.
2018-12-22 14:45:49 +01:00
Vasily 3935ebcbb4 Refactor command line argument parsing into function
The command line argument parsing is done in a giant for loop in the
main function. This presents readability and extension problems.

Refactor the big for loop into smaller loops inside the function.

In theory this will affect performance slightly at startup, but when considering
the very low amount of possible command line arguments (5, currently) and the low
amount of arguments being passed on a typical launch (0 or 1, mostly),
the readability improvements are very much worth it.

The string literals have also been moved to the "argument" namespace as
constexpr, in order to avoid potential typos in string literals.

Should the amount of command line arguments increase severely, it might
be necessary to create a structure with only one pass through the
argument loop, but such a situation is very unlikely.
2018-12-22 13:33:13 +01:00