Commit graph

29 commits

Author SHA1 Message Date
Kp 4a742e3fc4 Parenthesize static_assert expression
When static_assert is a macro, it must have two arguments as seen by the
preprocessor.  Add an identity mapping to the native case to enforce
this, and fix up all the sites that break with the new rule.
2015-07-09 03:12:45 +00:00
Kp 8358dfcd0b Support biased pointers to help memory debuggers 2015-06-13 22:42:15 +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 9a36b82d5d Disallow implicit pointer conversion from rvalue smart pointers 2015-01-29 00:58:53 +00:00
Kp e25446a15a Fix Windows build for RAIIdmem index conversion 2015-01-28 03:42:53 +00:00
Kp ff4a0ccd70 Fix RAIIdmem array usage
Some RAIIdmem instances managed a T[], but were declared to manage a T.
2015-01-28 03:42:53 +00:00
Kp 3952c64ffc Fix PHYSFSX_check_* for RAIIdmem<T[]> 2015-01-28 03:42:53 +00:00
Kp fd309ee728 Fix size truncation in mem_malloc 2015-01-23 03:55:05 +00:00
Kp 9c58fd23f4 Use RAIIdmem for jukebox_songs list_buf 2015-01-23 03:55:05 +00:00
Kp d3e657222e Use RAIIdmem for height_array 2015-01-23 03:55:04 +00:00
Kp 7fccbe2d0d Use std::unique_ptr for RAIIdmem 2015-01-23 03:55:04 +00:00
Kp 84e3a03451 Remove unused parameters 2015-01-18 01:58:33 +00:00
Kp c704cc9fc9 Add const void* conversion to various types
Add operator const void*() to prevent accidental use of pointer
comparison.  With the overload present, comparing two objects triggers
an ambiguous conversion to pointer, instead of comparing the pointer
values.
2014-10-12 22:11:28 +00:00
Kp 0387a2c771 Disallow using RAIIdmem::operator T* on rvalues 2014-09-07 23:56:37 +00:00
Kp 7d166a70e0 Prevent accidental RAIIdmem construction 2014-09-07 23:56:37 +00:00
Kp c85819ac94 Forbid d_free on non-POD 2014-08-16 04:18:58 +00:00
Kp ba05b20c3c Forbid MALLOC of non-POD types 2014-07-25 01:47:21 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp fbf1f8a658 Annotate mem_malloc/calloc/realloc as __attribute__((alloc_size)) 2013-12-20 03:33:32 +00:00
Kp 737fe73dd7 Annotate mem_malloc/mem_calloc as __attribute__((malloc)) 2013-12-20 03:24:39 +00:00
Kp b7fe431979 Use RAII for playsave strings 2013-12-08 21:02:10 +00:00
Kp 3b9b5ebfb0 Use RAII to manage function-local heap objects 2013-12-08 19:04:52 +00:00
Kp 9de54cfa74 Switch to C++ linkage
import fileinput
guard = 0
cxxguard = '#ifdef __cplusplus\n'
for line in fileinput.input(inplace=True):
	if line == cxxguard:
		guard = 1
		continue
	if guard:
		if line == 'extern "C" {\n':
			guard = 2
			continue
		if line == '}\n':
			guard = 0
			continue
		if guard == 2:
			assert(line == '#endif\n')
			guard = 0
			print cxxguard,
			continue
	print line,
2013-12-06 03:35:32 +00:00
Kp 69535df7fd Compile out memory checker if not enabled 2013-07-28 23:20:33 +00:00
Kp e961be1c14 u_mem: split memory debugging from NDEBUG 2013-07-28 23:18:44 +00:00
Kp f7a030483f Move common/2d/bitmap.c -> common/2d/bitmap.cpp 2013-07-27 22:30:53 +00:00
Kp 4577dd3977 Merge branch 'd2x-rebirth/master' into unification/master 2013-07-21 21:34:46 +00:00
Kp a1ba420031 Mark various parameters and variables as const 2013-07-20 23:12:24 +00:00
Kp a05d292255 Move */include/u_mem.h -> common/include/u_mem.h
The Descent I reference to virtual_memory_on is unused, so drop it.
2013-03-03 01:03:33 +00:00
Renamed from d2x-rebirth/include/u_mem.h (Browse further)