21985 Commits

Author SHA1 Message Date
Sam Edwards
e72fab9520 dtoolutil: Add missing declaration for init_libdtoolutil() 2018-06-07 01:47:38 -06:00
rdb
4e7edf8a53 parser-inc: add missing include to <string> header 2018-06-06 12:22:31 +02:00
rdb
c166daf0f3 interrogate: fix detection of special std types 2018-06-06 12:22:23 +02:00
rdb
3a698e5a81 dtoolutil: use std:: qualification when exposing std types 2018-06-06 11:48:52 +02:00
rdb
036d2c2548 parser-inc: properly namespace iostream definitions 2018-06-06 11:27:46 +02:00
rdb
f990f816b8 maxegg: fix compilation error due to nullptr misuse 2018-06-06 11:27:11 +02:00
rdb
e27cb2dec3 parser-inc: provide various more STL headers and definitions
This cuts down on various warnings generated by interrogate.
2018-06-04 20:44:14 +02:00
rdb
5582e174b6 cppparser: fix issue with typedefs to forward declared templates
I don't know if this is the right solution, but it does fix an issue accessing std::ios::openmode caused by the ios typedef being defined before ios_base is fully specified.
2018-06-04 17:30:02 +02:00
rdb
8a9d83b604 physx: fix compile error 2018-06-04 17:28:13 +02:00
rdb
be282627a8 express: make PointerTo directly initializable from nullptr 2018-06-04 11:21:18 +02:00
Sam Edwards
9fefa1d2e6 interrogate: Fix missing namespace qualification 2018-06-03 17:40:33 -06:00
Sam Edwards
f0fc6e6d56 express: Fully qualify std::nullptr_t 2018-06-03 16:56:53 -06:00
Sam Edwards
5e82671084 general: Do away with TYPENAME macro 2018-06-03 16:36:34 -06:00
Sam Edwards
a9ffb9630b dtool: Generate code using nullptr over NULL/0 2018-06-03 16:36:07 -06:00
Sam Edwards
e2b4353800 general: Replace NULL (and 0 as pointer) with C++11 nullptr
Exceptions to this replacement are:
- .c files
- Headers included by a .c file
- stb_image.h
- dr_flac.h
- Strings
- Comments
2018-06-03 16:35:13 -06:00
Sam Edwards
92d2f5e195 general: Don't use NULL where not appropriate 2018-06-03 16:31:01 -06:00
Sam Edwards
d422d74abb general: Clean up asserts which were abusing NULL 2018-06-03 16:26:44 -06:00
Sam Edwards
ebe1b0763f express: Allow WeakPointer comparisons to nullptr
This saves us from having to do casts like:
if (foo == (const FooType *)nullptr) {
  ...
}
2018-06-03 16:26:44 -06:00
rdb
57602d750f cocoadisplay: don't crash if window/buffer fails to open 2018-06-03 22:35:37 +02:00
rdb
eb960669a5 display: fix assert when window fails to open
The assert is being triggered because the window is already being removed in open_windows.  It does not really matter if it returns false anyway, as long as the window is removed one way or another.
2018-06-03 22:33:59 +02:00
rdb
d8bf9d4b55 tests: skip display tests if pipe cannot create offscreen buffers 2018-06-03 22:33:12 +02:00
rdb
c08339e8ce ShaderGenerator: fix error with normal map and only ambient light
Closes #331
2018-06-03 22:30:40 +02:00
rdb
e0245d2777 First step towards eliminating using namespace std; (#335) 2018-06-03 20:32:23 +02:00
rdb
298147bb39 Give several additional classes constexpr constructors
This is useful because these types are created at static init time, and giving them a constexpr constructor and trivial destructor lets them be created during constant initialization, which helps to prevent static init ordering issues.
2018-06-03 10:45:58 -04:00
rdb
21d8c29645 More warning fixes 2018-06-03 06:45:35 -04:00
rdb
213ae6b029 Change some .T files to new docstring style that were missed 2018-06-01 20:44:30 +02:00
Sam Edwards
159b43e563 general: Address a few more compiler warnings 2018-06-01 02:54:13 -06:00
Sam Edwards
94c7fa30e2 makepanda: Remove a couple of unused config macros 2018-05-30 17:28:40 -06:00
rdb
283d43f988 putil: workaround macOS 10.6 compile error until #300 is fixed
[skip ci]
2018-05-30 23:29:59 +02:00
rdb
190c553c57 dtool_config.h: remove some macros for ancient C++ compilers 2018-05-30 23:15:24 +02:00
rdb
4f55e26e61 tests: add tests for BitMask*.is_all_on() 2018-05-30 23:06:47 +02:00
rdb
aa1b06f132 putil: make BitMask et al literal types 2018-05-30 23:04:43 +02:00
rdb
db5dd98d33 general: further warning fixes, use -Wno-unused-variable if NDEBUG
Disabling unused variable checking is needed in NDEBUG builds because of the heavy use of temporary variables in asserts.
2018-05-30 22:51:04 +02:00
Sam Edwards
1c6ae84cdc dtoolutil: Remove HAVE_OPEN_MASK
Rationale:
1. Per standard, fstream::open takes 2 arguments.
   If platforms add a third, they're out of spec.
2. The only platform I could find that takes a file
   mask specifically as the third argument is IRIX,
   which Panda hasn't targeted in forever.
3. The mask being requested isn't even particularly
   interesting - falling back to a platform default
   is best.
4. When USE_PANDAFILESTREAM is defined, pfstream
   is implemented as PandaFileStream, which doesn't
   have a three-argument open() and breaks immediately.
5. makepanda doesn't ever define HAVE_OPEN_MASK
6. It's been broken for so long that, if it were
   important to anybody, it would have been fixed by now.
2018-05-30 12:04:06 -06:00
Sam Edwards
00e259d4dd dtoolbase: Fixup NODEFAULT macro
1. Test for Clang before _MSC_VER (Clang defines this on Windows)
2. Use it in pdtoa.cxx
2018-05-30 11:50:09 -06:00
rdb
c17cb11dfa makepanda: enable more warnings by default 2018-05-30 11:12:15 +02:00
rdb
6b726fa697 general: fix various compiler warnings and issues exposed thereby 2018-05-30 11:09:35 +02:00
Psychotropos
3029780f88 dtoolutil: Don't assume RTLD_DI_ORIGIN and RTLD_SELF are present, fall back to using RTLD_DI_LINKMAP if necessary
Closes #334
2018-05-30 11:04:12 +02:00
Psychotropos
314cee133a dtoolbase: The bug in question is glibc-specific, treat it as such. 2018-05-30 09:07:16 +02:00
Sam Edwards
32e1ca2252 general: Fix several miscategorized EXPCL_PANDA_* macros 2018-05-29 22:49:35 -06:00
Sam Edwards
527e4840ff makepanda: Fix table alignment 2018-05-27 14:11:55 -06:00
Sam Edwards
a251c6dd8f general: Change HAVE_LOCKF to PHAVE_LOCKF
HAVE_LOCKF is already defined by pyconfig.h in
(at least) Python 3.6 - changing the macro name
here avoids warnings
2018-05-27 14:06:14 -06:00
Sam Edwards
24c8ef9887 general: Fix missing include 2018-05-27 14:06:08 -06:00
rdb
239f66cf11 makepanda: fix macOS compile error in CheckPandaVersion
See #327
2018-05-27 15:39:02 +02:00
rdb
8d84c58d73 express: explicitly declare defaulted Datagram copy/move ctor/assign
Fixes #329
2018-05-27 15:38:19 +02:00
rdb
3d49986ce2 char: fix crash during Character destructor (regression)
This was a regression in 0bb81a43c9e4fffb37cc2234c1b0fbae42020ceb which was not keeping an edge case in mind if a weak pointer is locked during object destruction.  This issue was fixed by 525a05ea2b1d00a1db901f883f1755943aeff33c, but that is not enough since it causes CharacterJointEffect::get_character() to return null now, so we need a separate method to check if a CharacterJointEffect belongs to a given character.  This is more efficient, too.

Fixes #330
2018-05-27 15:37:45 +02:00
rdb
f2d429b817 express: weakptr.lock() should return null during object destruction
This came up in #330; the Character destructor caused something to call lock() on a weak pointer to that character, which would induce a ref() and unref() pair, but since the refcount was 0, this would call the destructor and thereby create infinite recursion.

I considered instead calling mark_deleted() inside unref() so that the callbacks get to run before the object is actually deleted, and was_deleted() will become true as soon as unref() reaches 0.  However, this would require grabbing the lock in unref() to be fully thread-safe, since we would need to bring the refcount to 0 and mark the object as deleted in one atomic operation, so this would be an unacceptable general performance penalty.

Instead, WeakPointerTo::lock() now atomically increments the reference count if it is not already zero, and returns null otherwise.  This should be safe because the object cannot be deleted while the WeakReferenceList lock is held.
2018-05-27 15:37:03 +02:00
rdb
0de981d0b8 ai: make AICharacter reference counted
This lets one drop the reference to AICharacter after adding it to a flock or AIWorld without crashes.

Also replace the silly and inefficient custom-rolled linked list implementation of AICharPool with a vector, and add additional safety checks.

Fixes #318
2018-05-27 12:59:41 +02:00
Sam Edwards
0ce9dc98b1 general: Move inclusion of checkPandaVersion.h to dtoolbase
This includes it everywhere, meaning developers no longer must
remember to include it in each metalib init file.
2018-05-26 18:39:24 -06:00
Sam Edwards
35ab16d38f makepanda: Update checkPandaVersion.h
This makes it possible to include it multiple times in a single
translation unit, and/or multiple times in a single dynamic
library (and without excess code bloat, too).
2018-05-26 18:39:24 -06:00