Commit Graph

86 Commits

Author SHA1 Message Date
Johannes Schickel
b4d0a8ba66 JANITORIAL: Enforce "} // End of namespace" with a single space after }. 2013-01-26 19:38:02 +01:00
Johannes Schickel
dac6ac66ad COMMON: Add a size_type to HashMap. 2012-02-22 20:13:33 +01:00
Johannes Schickel
7e4224e52a COMMON: Fix compilation when USE_HASHMAP_MEMORY_POOL is not defined. 2011-07-03 00:16:07 +02:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Max Horn
c4ae3b90db COMMON: Fix (harmless) int <-> uint mismatch 2011-04-04 09:53:26 +02:00
Johannes Schickel
867c0d9645 COMMON: Add an erase method which takes an iterator to HashMap.
Currently there is no iterator returned from this method, to have some
similarity to associative containers of the STL.

I also "added" one unit test for this method, which is basically just
a copy of the HashMap::erase(const Key &) test with the required adaptions.

svn-id: r55661
2011-01-30 17:28:35 +00:00
Max Horn
963cf0b08a COMMON: Disable DEBUG_HASH_COLLISIONS (oops)
svn-id: r54013
2010-11-01 16:42:31 +00:00
Max Horn
7a85365004 COMMON: Change some (f)printf to debug calls; clenaup hashmap.h
svn-id: r54003
2010-11-01 16:00:53 +00:00
Johannes Schickel
08afc68df0 COMMON: Extend workaround in HashMap code for sgi IRIX MIPSpro to also apply for Intel's C++ compiler.
svn-id: r53507
2010-10-15 18:20:21 +00:00
Max Horn
0b48a71c99 Remove PalmOS port
svn-id: r50964
2010-07-17 18:41:38 +00:00
Joost Peters
dd0c1fd6f0 Restrict MIPSpro workaround to non-gcc compilers -- fixes compilation with gcc on irix.
svn-id: r49060
2010-05-17 16:50:10 +00:00
Johannes Schickel
aed02365ec Strip trailing spaces/tabs.
svn-id: r47541
2010-01-25 01:39:44 +00:00
Willem Jan Palenstijn
f9909bfbf5 Remove superfluous checks
svn-id: r44258
2009-09-22 12:39:07 +00:00
Johannes Schickel
4f65994267 Fix regression in 44236, which caused iterators to see dummy node entries as valid entries.
svn-id: r44256
2009-09-22 11:58:59 +00:00
Max Horn
537c886aeb Stop confusing doxygen :)
svn-id: r44237
2009-09-21 21:37:12 +00:00
Max Horn
2bf7969f95 COMMON: Remove Common::HashMap::_dummyNode, instead use HASHMAP_DUMMY_NODE (this saves memory and should still be safe)
svn-id: r44236
2009-09-21 21:36:35 +00:00
Max Horn
ae16d496b9 COMMON: HashMap::getVal now allows specifying a default value.
A new variant of HashMap::getVal with a second 'default value' parameter
has been added. This helps avoid many contains() + getVal() combos
(which incur double lookup penalty), and is much lighter than using
find() (which has to create an iterator).

svn-id: r43983
2009-09-06 12:59:07 +00:00
Joost Peters
edaa4a0422 MIPSpro compilation fixes / workarounds (from a patch by Rainer Canavan)
The hashmap.h change is ugly, but so far the only thing found to work. Suggestions for a better "fix" appreciated!

svn-id: r43380
2009-08-14 17:18:03 +00:00
Max Horn
9b3074d929 If NDEBUG is #defined, then assert does nothing, leading to warnings about 'old_size' not being used -> fix that
svn-id: r42056
2009-07-03 11:05:59 +00:00
Willem Jan Palenstijn
6eed461c94 Fix erase() sometimes hiding other hash elements.
Like CPython, we now use a dummy node to mark nodes as erased,
so that lookup() can skip over it. All tests should now pass again.

svn-id: r41496
2009-06-13 21:07:05 +00:00
Max Horn
9a971c7d80 fixed a typo
svn-id: r40171
2009-04-28 10:23:08 +00:00
Max Lingua
ccf9dedecb Modified HashMap ctr to skip _defaultVal() on PS2 to avoid gcc 3.2.2 ICE
svn-id: r39174
2009-03-07 05:01:56 +00:00
Max Horn
6098cadde3 More paranoia checks
svn-id: r38339
2009-02-16 01:58:20 +00:00
Jordi Vilalta Prat
b1999a2a16 Fixed indentation and removed whitespaces at the end of line
svn-id: r35481
2008-12-22 11:22:15 +00:00
Max Horn
95474b048a COMMON: Added a new ObjectPool class, with matching operator new/delete overloads
svn-id: r34785
2008-10-12 22:05:26 +00:00
Max Horn
31ce5eb496 Revised HashMap implementation
svn-id: r34273
2008-09-02 11:34:12 +00:00
Max Horn
a79e9385a1 Unified member names in container/storage classes Array, HashMap and String: _storage, _size, _capacity
svn-id: r34052
2008-08-20 11:07:16 +00:00
Max Horn
47429f2197 Extended HashMap debug output
svn-id: r34051
2008-08-20 10:18:59 +00:00
Lars Persson
476e5bbb10 List the correct engines in about,
updated actions with Lure (from WinCE). 
Increased min heap size to 5MB

svn-id: r33618
2008-08-04 18:14:17 +00:00
Lars Persson
c296869108 Disable hashmemory pool for Symbian OS
svn-id: r33212
2008-07-22 19:09:10 +00:00
Willem Jan Palenstijn
90bf3de2d6 Decrement _nele when erasing an element from hashmap, and add a test-case for this bug.
svn-id: r32343
2008-05-28 18:32:05 +00:00
Johannes Schickel
db04dd427d Formatting.
svn-id: r31852
2008-05-03 23:02:05 +00:00
Johannes Schickel
8436943bfd Committed patch #1929274 "HashMap: Iterator rework".
svn-id: r31356
2008-04-02 02:01:31 +00:00
Johannes Schickel
39995e29ad Added fixme regarding header 'new'.
svn-id: r31339
2008-03-30 18:59:24 +00:00
Bertrand Augereau
5f3529ce78 Whitespacing fixes
svn-id: r31330
2008-03-30 14:07:34 +00:00
Bertrand Augereau
a84d1ea78b The hashmap uses the memorypool for allocating/deallocating its Nodes
(It is faster and it saves approximately 70kB the DS or other small devices will appreciate having)

svn-id: r31321
2008-03-30 06:02:34 +00:00
Johannes Schickel
ff5743ba8f Cleanup.
svn-id: r31316
2008-03-30 02:43:18 +00:00
Johannes Schickel
dcc385f3de Fixed hashmap code. (please make a better check next time when changing code in common/, this was a really bad one :-/)
svn-id: r31314
2008-03-30 02:36:23 +00:00
Johannes Schickel
6a5ae22368 Formatting.
svn-id: r31308
2008-03-30 00:54:46 +00:00
Bertrand Augereau
7b295995dc Centralized the way the hashmaps allocate and free nodes (in order to instrument and maybe use a pool allocator later)
svn-id: r31305
2008-03-29 23:04:10 +00:00
Johannes Schickel
56c5d86431 Fix bug preventing compilation in iterator code.
svn-id: r30818
2008-02-07 21:28:51 +00:00
Eugene Sandulenko
0ae9fe7467 Second part of patch #1880781: "BeOS port for scummvm"
svn-id: r30720
2008-01-31 21:19:09 +00:00
Max Horn
0728aa0d7f Forward declare HashMap::ConstIterator (this might fix compile errors with some old GCC versions)
svn-id: r30670
2008-01-28 08:40:30 +00:00
Jordi Vilalta Prat
66e9d4f5e8 Removed trailing spaces.
svn-id: r30664
2008-01-27 19:47:41 +00:00
Max Horn
465356ed08 assert if hashmap iterator is out of bounds (e.g. happens when derefing end()
svn-id: r30623
2008-01-23 17:19:58 +00:00
Max Horn
79e1579cb3 Fix warnings HashMap causes on some compilers (notably, GCC 3.x used for various cross compilers)
svn-id: r30472
2008-01-13 14:44:29 +00:00
Max Horn
1eeaaab15d Fix hashmap.h properly (this is not a bug in GCC 4.0 etc., rather it's a bug in newer GCC versions that they *accepted* the old code...)
svn-id: r30022
2007-12-28 00:08:29 +00:00
Kostas Nakos
1312d4b3fd same bug on arm-wince-gcc 4.1.0
svn-id: r30014
2007-12-27 16:40:58 +00:00
Johannes Schickel
e36f79fcdf Fix for bug #1858824 "AMIGAOS4: Build Process breaks due to regression".
svn-id: r30013
2007-12-27 16:01:59 +00:00