Commit Graph

300 Commits (d35f1d3d06f270d607aafa39b0f25232b0964936)

Author SHA1 Message Date
Michael Lutz 4e85ccf3c0 Codechange: Replace SmallStackSafeStackAlloc with std::array.
The only port that ever used it to make heap allocations instead of stack ones was the NDS port, which got thrown out some time ago.
5 years ago
glx 410b81537c Fix 801cbea9c: operator< is not always the best idea
Also removes unused and anyway broken SmallMap::SortByKey() function.
5 years ago
glx 801cbea9cc Codechange: use std::sort() for all std::vector types 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Michael Lutz 8b1880187a Remove: AutoFreeSmallVector.
The last use was for storing a list of memory blocks. As the way these lists are accessed is very
specific, it is easier to just write an explicit destructor instead of trying to exactly match the behaviour.
5 years ago
Michael Lutz e804173595 Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector. 5 years ago
Michael Lutz c7b9987d08 Codechange: Switch DropDownList to directly use std::vector, thus making AutoDeleteSmallVector obsolete.
DropDownListItem are strongly managed using std::unique_ptr to ensure leak-free handling. Appropriate use
of move-semantics make intent a lot clearer than parameter comments and allows the compiler to generate
copy-free code for most situations.
5 years ago
Michael Lutz 05f4e73608 Codechange: Replace custom mutex code with C++11 mutex'es.
A conforming compiler with a valid <mutex>-header is expected.
Most parts of the code assume that locking a mutex will never fail unexpectedly,
which is generally true on all common platforms that don't just pretend to
be C++11. The use of condition variables in driver code is checked.
5 years ago
Michael Lutz 21d9e87b46 Fix #7165: Const overload SmallMap::Contains(key) compared wrong types.
Const and non-const Find() have different return types.
5 years ago
stormcone ee260e4704 Fix #7165: SmallMap::Erase(key) does not work correctly 5 years ago
glx22 66dd7c3879
Fix: MSVC warnings (#7423) 5 years ago
Charles Pigott ed9005690a Fix #7421: Don't (directly) dereference std::vector::end() in SmallMap 5 years ago
Henry Wilson 03ca3190c9 Codechange: Use range-based for-loop in Auto[Free|Delete]SmallVector 5 years ago
Henry Wilson cc62f4163f Cleanup: Remove unused size template parameters from SmallMap and Auto[Free|Delete]SmallVector 5 years ago
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 5 years ago
Henry Wilson 6570f7989f Codechange: Declare SmallVector as an alias for std::vector 5 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 5 years ago
Henry Wilson 297fd3dda3 Codechange: Replaced SmallVector::Include() with include() 5 years ago
Henry Wilson 2bc2de9034 Codechange: Replaced SmallVector::Find() with std::find() 5 years ago
Henry Wilson e0c58bf5ee Codechange: Removed SmallVector::Insert() 5 years ago
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 5 years ago
Henry Wilson ca2f33c6d0 Codechange: Replaced SmallVector::Erase() with std::vector::erase() 5 years ago
Henry Wilson 097328c3d7 Codechange: Replaced SmallVector::Get() const with std alternatives 5 years ago
Henry Wilson aa7ca7fe64 Codechange: Replaced SmallVector::Get(n) non-const with std::vector::data() + n 5 years ago
Henry Wilson bc7dcaffca Codechange: Removed SmallVector::Assign() 5 years ago
Henry Wilson 5795f66d2e Codechange: Replaced SmallVector::Contains() with std::find() pattern 5 years ago
Henry Wilson b1f5119d3a Codechange: Replaced SmallVector::ErasePreservingOrder(pos, count) with std::vector::erase() 5 years ago
Henry Wilson 9b5cc73f3e Codechange: Replaced SmallVector::ErasePreservingOrder(it, count) with std::vector::erase() 5 years ago
Henry Wilson 8460952240 Codechange: Replaced SmallVector::Find() const with suitable alternatives
The use of std::none_of in network/core/host.cpp is driven by the non-const
comparison operator use by NetworkAddress. A future commit should address
the const_casts in that class to ensure const-correctness.
5 years ago
Henry Wilson 81315939b9 Codechange: Replaced SmallVector::Find() non-const with std::find() 5 years ago
Henry Wilson f3938fdb83 Codechange: Replaced SmallVector::Reset() with std::vector::clear() + shrink_to_fit() 5 years ago
Henry Wilson bad2c2154b Codechange: Replaced SmallVector::Resize() with std::vector::resize() 5 years ago
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 5 years ago
Henry Wilson 56ae855dc2 Codechange: Removed SmallVector::operator[] 5 years ago
Henry Wilson 9cba6f7193 Codechange: Replaced SmallVector::Compact() with std::vector::shrink_to_fit() 5 years ago
Henry Wilson bfd79e59dc Codechange: Replace SmallVector::Clear() with std::vector::clear() 5 years ago
Henry Wilson 4b349c0f90 Codechange: [core] Implement SmallVector using std::vector
The public and protected interface to SmallVector are unchanged
SmallVector now requires that items be default constructible
This isn't an issue since some contained items were previously created
uninitialized.

Temporary default constructors are added to the following structs
- SmallPair
- SmallStackItem
- GRFPresence

Where vector<bool> is required, transition immediately to std::vector
to avoid returning proxy object references.
5 years ago
Patric Stout 72c5f2b3ee Remove: DOS support
In 10 years there was no active development on DOS. Although it
turned out to still work, the FPS was very bad. There is little
interest in the current community to look into this.

Further more, we like to switch to c++11 functions for threads,
which are not implemented by DJGPP, the only current compiler
for DOS.

Additionally, DOS is the only platform which does not support
networking. It is the reason we have tons of #ifdefs to support
disabling networking.

By removing DOS support, we can both use c++11 functions for threads,
and remove all the code related to disabling network. Sadly, this
means we have to see DOS go.

Of course, if you feel up for the task, simply revert this commit,
and implement stub c++11 functions for threads and stub functions
for networking. We are more than happy to accept such Pull Request.
5 years ago
Niels Martin Hansen d7522e5e8f Codechange: Add a k-d tree generic data structure 5 years ago
Patric Stout f52e5a4d61 Fix: warnings when compiling with DJGPP
This was most likely broken for months, if not years.
5 years ago
Patric Stout 1c5ea33099 Fix: warnings when compiling for a recent version of Haiku
This might break older Haiku versions, but it is hard to tell.
5 years ago
Patric Stout ad30d04b5e Codechange: removed some left-behind __NDS__ references 5 years ago
Patric Stout 7784d77713 Remove: MorphOS / AmigaOS support
In 10 years there is no commit to change how MorphOS works, and we
have no active maintainer for it. It is unlikely it works in its
current state (but not impossible).

With the arrival of SDL2 (and removal of SDL), MorphOS is no longer
support. There is an SDL2 port for MorphOS, but it is not maintained
by upstream SDL2, and nobody can currently test it out.

If anyone wants to re-add MorphOS, please do (revert this patch,
fix the problems, and create a Pull Request). If you need any help
doing so, let us know! It is not that we don't like MorphOS, it is
that we don't have anyone fixing the problems :(
5 years ago
PeterN c0c8fb25fb
Change: Use SlErrorCorrupt() on pool index error when loading a savegame, instead of terminating. (#7219) 5 years ago
btzy 9d75600ac0 Fix: Round up deltas for smooth scrolling, so target will be reached 6 years ago
nikolas 4fc1b2baae Fix: Grammar in a bunch of comments (#7054) 6 years ago
glx c540d72445 Fix: [Win32] WIN32 may not be defined, always prefer the compiler predefined macro _WIN32 6 years ago
frosch 18ca3e8660 Fix: [NewGRF] Make VA2 operator 11 (ror) behave well-defined when rotating by 0 bits. 6 years ago
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 6 years ago
Charles Pigott 5f86e1a390 Codechange: Silence -Wclass-memaccess warnings with GCC8 6 years ago
Michael Lutz 9959cd9522 Fix 0165fe1: Native OSX doesn't have a __BYTE_ORDER macro but defines a differently named macro. 6 years ago
Matthijs Kooijman fa87212a76 Fix: Some spelling errors in printed messages 6 years ago
Patric Stout 0165fe1283
Codechange: remove endian_check in favour of __BYTE_ORDER macro (Rubidium) (#6762) 6 years ago
Charles Pigott 86012e10ea Fix: Remove need to instantiate SmallStack's pool object by making it a singleton method 6 years ago
Michael Lutz 4851feb102 Codechange: Add functions to insert and extract an element at a specific position in a SmallVec. 6 years ago
alberth bc08fe7c5f (svn r27641) -Codechange: Fold the _fios_items file list vector into its own class. 8 years ago
michi_cc 2b8bb12d62 (svn r27381) -Fix: Warnings due to C++11 requirements for explicit narrowing conversions in initializer lists. 9 years ago
peter1138 cea2c3490a (svn r27049) -Fix (r26482): Fix compilation with --enable-desync-debug. 10 years ago
alberth 8fe8765aaa (svn r26685) -Fix: Tighten parameter bound checks on GSCargoMonitor functions, and return -1 on out-of-bound parameters. 10 years ago
rubidium ab964a6cee (svn r26651) -Fix: make sure an abs is used that supports int64 when using abs on those variables 10 years ago
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
fonsinchen 46590e112e (svn r26343) -Fix: Rewrite SmallStack so that it doesn't use a pool and is reentrant. 11 years ago
frosch 858e80f3dd (svn r26333) -Fix: Compilation without static_assert. 11 years ago
fonsinchen e37656f2e5 (svn r26331) -Fix: some inconsistencies regarding link graph (job) IDs. 11 years ago
rubidium b3e93d6520 (svn r26057) -Fix: a number of possibly uninitialised variables 11 years ago
fonsinchen fe550c2db3 (svn r25893) -Fix: Document RandomRange and change misleading parameter name 'max' in random functions. 11 years ago
fonsinchen 1ed478d433 (svn r25889) -Codechange: Add forgotten file. 11 years ago
fonsinchen e21ae34878 (svn r25887) -Fix: Ignore NULL pointers in delete operator of PoolItem. 11 years ago
rubidium 13855f0a09 (svn r25705) -Fix: a number of typos (inspired by 90c920601c84975acb694f3673e2beb08b013753) 11 years ago
michi_cc de097dd989 (svn r25685) -Codechange: [OSX] Use non-deprecated functions for byte swapping. 11 years ago
frosch 18ae9c78bc (svn r25402) -Fix-ish: Prevent copying of BasePool and WindowDesc, since they register in static vectors. 11 years ago
fonsinchen 4fd57501bb (svn r25348) -Add: multimap implementation with guaranteed order between equal keys 11 years ago
fonsinchen dfad8317aa (svn r25347) -Add: function for deterministic approximate division 11 years ago
rubidium b0a2818ed0 (svn r25256) -Add: small matrix type (like vector, but for matrices) (fonsinchen) 11 years ago
frosch 5cd5aca98c (svn r25043) -Change [FS#3764]: Only display subtypes in the refit GUI which are available for all selected vehicles. Also add a generic list item to refit while keeping the subtypes of individual vehicles. 12 years ago
rubidium 6be79c424d (svn r24959) -Doc [FS#5459]: that certain parameters need to be within certain boundaries 12 years ago
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
alberth 732e073261 (svn r24776) -Doc: Typo fixes, additions, and additional dots collected from various sources (including Eagle_rainbow, MinchinWeb) 12 years ago
frosch dcfb2af871 (svn r24741) -Add: Const-methods to SmallMap. 12 years ago
frosch f9819c6645 (svn r24448) -Fix [FS#5255]: Copy constructor and assignment operator cannot be implicit template specialisations. (adf88) 12 years ago
frosch e1617a3d10 (svn r24275) -Codechange: Make SmallVector::FindIndex() const. 12 years ago
smatz b5525fd33d (svn r23941) -Add: support for clang 13 years ago
michi_cc 9d72b47984 (svn r23880) -Add: A simple smart pointer. 13 years ago
rubidium a48e3cb891 (svn r23854) -Codechange: make it easier to put random debug stuff into the random log 13 years ago
rubidium 2a0754b678 (svn r23814) -Codechange: write the random-debug output directly to a file 13 years ago
alberth 4af8c2d5e1 (svn r23704) -Doc: Doxygen comment fixes and additions. 13 years ago
truebrain 1c9bec1999 (svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC) 13 years ago
truebrain 2ae87e7213 (svn r23634) -Add: support language files for GameScript (Rubidium) 13 years ago
rubidium 6153dc57f5 (svn r23466) -Fix [FS#4871, FS#4874]: assertion triggered when resizing a window during ReInit by an amount that's not a multiple of the resize interval 13 years ago
michi_cc d3b7b89493 (svn r23415) -Feature: Infrastructure maintenance costs. 13 years ago
glx 2c20738067 (svn r22898) -Codechange: use MSVC compiler intrinsics for byte swapping 13 years ago
frosch 5ccd091fd1 (svn r22881) -Fix (r22875): GCC warnings on 64bit systems. 13 years ago
michi_cc f227e90c24 (svn r22875) -Codechange: Add some asserts and checks to better prevent overflow of the argument to malloc. (monoid) 13 years ago
rubidium fb5ecb9499 (svn r22411) -Document: another bunch of bits 13 years ago
rubidium 59e42ea178 (svn r22177) -Fix: make sure the right endianness is chosen with cross-compiling, and strndup is available in the binary for more exotic platforms 14 years ago
planetmaker ac0700c564 (svn r22136) -Fix (r22112): Silence compiler warning about non-virtual destructor 14 years ago
smatz 756cc6cf65 (svn r22116) -Codechange: use PoolBase::Clean() at more places 14 years ago
smatz 642fb19d4f (svn r22115) -Fix (r22114): some comments and code ordering were wrong 14 years ago
smatz 5fd13843f7 (svn r22112) -Codechange: register all pools in a pool vector 14 years ago
smatz fbfb0ffbf2 (svn r22041) -Codechange: add a check that we called PoolItem::CanAllocateItem() before actually allocating it 14 years ago