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
Max Horn
a7397ecfcc
Patch #1837119 (COMMON: Common::HashMap iterator rework) with workaroud for Mac OS X compiler bug
...
svn-id: r30004
2007-12-26 21:40:32 +00:00
Nicola Mettifogo
258901bab9
Merged common/stdafx.h into common/scummsys.h. All referencing files have been updated.
...
svn-id: r28966
2007-09-19 08:40:12 +00:00
Max Horn
218e132e37
Updated legal headers in source files, based on what Pidgin (the IM client formerly knowns as Gaim) does; added new (incomplete) COPYRIGHT file; updated copyright dates in a few spots
...
svn-id: r27024
2007-05-30 21:56:52 +00:00
Max Horn
30e975f9db
Protect Array<> and HashMap<> instances against self assignments
...
svn-id: r26115
2007-03-12 22:34:29 +00:00
Max Horn
6d9cb5498f
Avoid double frees in HashMap::erase
...
svn-id: r26040
2007-03-09 16:19:50 +00:00
Max Horn
43cd428355
Some HashMap cleanup:
...
* Removed the odd return value of method erase()
* Stopped erase() from leaking (oops!)
* Added a (paranoia) consistency check to assign()
svn-id: r25967
2007-03-04 09:58:04 +00:00
Max Horn
b25c7933a5
Paranoia: a hashmap node must never ever change its key after its creation
...
svn-id: r25965
2007-03-04 09:27:28 +00:00
Max Horn
8b7fdca4ac
Return a default value in the const-variant of HashMap::getVal, instead of asserting out -- this way, we get less unexpected asserts, and both getVal variants behave comparably diff. The drawback is that now all HashMap instances carry one extra Value object around with them.
...
svn-id: r25245
2007-01-28 13:30:26 +00:00
Max Horn
0c148fc44e
Added non-const variant of HashMap::getVal
...
svn-id: r25136
2007-01-21 00:11:45 +00:00
Max Horn
12476efb58
Added some new HashMap methods: lookupAndCreateIfMissing (internal only), setVal and getVal (which actually is just the old queryVal renamed for consistency)
...
svn-id: r25135
2007-01-21 00:06:50 +00:00
Max Horn
d1b97e6786
Added copy constructor and assignment operator to class HashMap
...
svn-id: r25125
2007-01-19 21:55:45 +00:00
Chris Apers
efe466040a
Still doesn't work with PalmOS compiler
...
svn-id: r25079
2007-01-14 11:06:34 +00:00
Max Horn
5c8de9b3b0
Replaced #ifdef hack in the HashMap code by a much nicer and cleaner 'friend class' statement (a similar change might be possible in class List)
...
svn-id: r24791
2006-11-26 22:39:34 +00:00