Commit graph

86 commits

Author SHA1 Message Date
Kp 72c5221e0b Use if constexpr instead of std::enable_if
This reduces the size of the generated debug information, but produces
the same code.
2020-05-17 23:35:25 +00:00
Kp db7b4b3f88 Refer to <memory> directly, not through "compiler-make_unique.h" 2020-05-02 21:18:43 +00:00
Kp cc38cdf4b8 Qualify uses of std::make_unique 2020-05-02 21:18:42 +00:00
Kp 8839f538e0 Refer to <array> directly, not through "compiler-array.h" 2020-05-02 21:18:42 +00:00
Kp 3170b11997 Modernize typedefs for std::array types
Use `using x = y;` instead of `typedef y x;`.
2020-05-02 21:18:42 +00:00
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +00:00
Kp 12b57e84e6 Switch most in-tree http:// links to https://
For each link given as http://, verify that the site is accessible over
https:// and, if so, switch to it.  These domains were converted:

* llvm.org
* clang.llvm.org
* en.cppreference.com
* www.dxx-rebirth.com
* www.libsdl.org
* www.scons.org
2018-09-02 00:57:29 +00:00
Kp 6a8930cef0 Remove unnecessary inclusions of compiler-static_assert.h
Various files included compiler-static_assert.h to use the compatibility
macros for compilers that lacked a working C++11 static_assert.
However, some source files used static_assert without this inclusion,
and no one ever reported problems.  From this, assume that no one uses a
compiler which lacks C++11 static_assert.  Remove the inclusions that
were only for the compatibility macro.  Keep the inclusions that use the
assert_equal helper.
2018-05-05 22:33:55 +00:00
Kp 9421c31b5a Replace "compiler-type_traits.h" with <type_traits>
Delete stub "compiler-type_traits.h" header.  Redirect all uses to the
standard <type_traits> header.

git grep -wlz 'compiler-type_traits.h' -- '*.cpp' '*.h' | xargs -0 perl -p -i <<EOF
    BEGIN {
	    $i = 0;
    }
    if (($i == 1 && $_ eq "\n") || ($i < 2 && /^#include "/)) {
	    # First blank line or first user-include after a system-include.
	    # Print, then never again for this file.
	    print "#include <type_traits>\n";
	    $i = 2;
    } elsif ($i == 0) {
	    $i = 1 if (/^#include </);
    } elsif ($_ eq "#include \"compiler-type_traits.h\"\n") {
	    # Remove this line if found.
	    $_ = '';
    }
    # Reset state machine when moving to next file.
    $i = 0 if eof;
EOF
2017-06-25 20:46:03 +00:00
Kp adcf02e454 Expand tt:: indirection to std::
All supported compilers have an acceptable <type_traits>.  Commit
4cb3d46148 ("Move <type_traits> test to Cxx11RequiredFeature") made
<type_traits> support mandatory in August and no one has objected.
Remove the indirection and use namespace std directly for type_traits
members.
2017-06-25 20:46:03 +00:00
Kp 9a45534ccc Require support for reference qualified methods 2016-12-10 17:51:07 +00:00
Kp 0cc020c217 Prefer DXX_CONSTANT_TRUE over DXX_HAVE_BUILTIN_CONSTANT_P 2016-11-12 18:10:09 +00:00
Kp 7e936df9c8 Mark PHYSFSX_read_helper_report_error cold 2016-10-28 03:39:40 +00:00
Kp c006d068d8 Restructure PHYSFSX read helpers into template function 2016-10-17 03:49:31 +00:00
Kp 03dbc96103 Switch DXX_HAVE_POISON to 0/1 instead of undef/defined 2016-10-08 23:24:21 +00:00
Kp a09dce6ead Remove char[N] overload for PHYSFSX_getRealPath 2016-08-06 19:55:25 +00:00
Kp 53deef077a Prefer make_unique over raw new 2016-08-06 19:55:24 +00:00
Kp 27cef20eb3 Move namespace dsx handling to dsx-ns.h 2016-03-19 19:08:10 +00:00
Kp ff67afd440 Propagate partial_range up into PHYSFSX_findFiles family 2016-01-29 04:05:47 +00:00
Kp 8e86a3586d Use #ifdef dsx to guard dsx namespace 2016-01-09 16:38:15 +00:00
Kp 86709f547b Fix capitalization of PHYSFS_File
Per comment in physfs.h, the spelling PHYSFS_file is deprecated.
Replace all instances with PHYSFS_File.
2016-01-09 16:38:14 +00:00
Kp 26e948d5f1 Uninline namespace dsx 2015-12-13 18:00:49 +00:00
Kp dc8c0323d8 Uninline namespace dcx 2015-12-13 18:00:49 +00:00
Kp 8109379fdd Use inline namespace dsx for similar/misc/ 2015-12-13 18:00:48 +00:00
Kp ed2fa6f76a Remove unused PHYSFSX_getFreeDiskSpace 2015-11-24 04:05:35 +00:00
Kp a37bae4b4f Track output size for PHYSFSX_getRealPath 2015-10-11 22:21:00 +00:00
Kp 3ceefb4189 Pass filename to Error 2015-10-11 22:21:00 +00:00
Kp cb5c0186b3 Remove obsolete PHYSFSX_check_read/PHYSFSX_check_write overloads 2015-10-09 02:46:10 +00:00
Kp be3ab3bd81 Use range_for in PHYSFSX_checkMatchingExtension 2015-08-14 03:02:04 +00:00
Kp 4d8ae44794 Add helper macro DXX_CONSTANT_TRUE 2015-07-29 03:05:28 +00:00
Kp 29f239d6b1 Raise PHYSFSX_exists bool check to caller
All callers use a constant value, so raise the check into the caller to
let the optimizer delete the unnecessary branch.
2015-05-09 17:39:02 +00:00
Kp 9dc22b1ee6 Expand DXX_CXX11_EXPLICIT_DELETE
Various functions use the non-macro form, so support for =delete is
already mandatory.  Remove the remnants of support for compilers which
lack =delete and replace it with a hard stop when the compiler rejects
declaring explicitly deleted functions.
2015-05-01 02:18:33 +00:00
Kp 5d0a640449 Always inline PHYSFS check functions
The checking is done at compile time, so force them inline to ensure
the optimizer recognizes constants.
2015-04-26 20:15:50 +00:00
Kp 84c638ed64 Move PHYSFS_list_t to separate header 2015-04-19 04:18:49 +00:00
Kp f900d4a5ee Remove RAIIdmem::operator pointer
Mac OS X defines uint_fast32_t to unsigned int, causing ambiguous
overloads between RAIIdmem::operator[](std::size_t) and
RAIIdmem::operator[](int).  Adding a disambiguating overload for OS X
breaks Windows.  Remove operator pointer and operator[].  Rely on the
inherited operator[] for indexing.  Require users to call ->get() to
convert to a simple pointer.

First btb ambiguity reported: https://github.com/dxx-rebirth/dxx-rebirth/pull/34
Second btb ambiguity reported: https://github.com/dxx-rebirth/dxx-rebirth/pull/43
2015-02-17 03:52:59 +00:00
Kp 03576a28c2 Pass PHYSFSX_* file extensions as counted array 2015-02-14 22:48:28 +00:00
Kp 4c8f3a47b5 Convert frequently used casts to C++ casts 2015-02-05 03:03:49 +00:00
Kp 93589368c9 Move PHYSFSX_putc to the one file that uses it 2015-01-29 04:27:36 +00:00
Kp 9a36b82d5d Disallow implicit pointer conversion from rvalue smart pointers 2015-01-29 00:58:53 +00:00
Kp 3952c64ffc Fix PHYSFSX_check_* for RAIIdmem<T[]> 2015-01-28 03:42:53 +00:00
Kp d2f0bdc867 Exit cleanly on bad command line arguments 2015-01-28 03:42:53 +00:00
Kp 18a64e4281 Use RAII for PHYSFS_enumerateFiles result 2015-01-23 03:55:05 +00:00
Kp f7815810e8 Use RAIIPHYSFS_File to manage PHYSFS_File
Fixes a few leaks on error paths.
2015-01-17 18:31:42 +00:00
Kp 8c27a7d68e Require known size for PHYSFSX_fgets 2015-01-12 00:26:03 +00:00
Kp 12770802ab Use ntstring for guidebot name 2015-01-12 00:26:02 +00:00
Kp dc35b0ad88 Fix Win32 build 2015-01-03 23:44:32 +00:00
Kp 180999eed1 Fix crash loading player.ngp with bare equal 2014-12-22 04:35:48 +00:00
Kp 2766114959 Make PHYSFSX_gets_line_t::line_t be array<> 2014-12-20 04:36:10 +00:00
Kp 137746e442 List initialize credits to zero 2014-12-18 04:12:38 +00:00
Kp b8b81ba5fc Move PHYSFSX_writeAngleVec to gamesave.cpp 2014-10-26 22:56:50 +00:00