Commit Graph
91 Commits
Author SHA1 Message Date
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
Max Horn 20d46ab409 typo
svn-id: r24093
2006-10-03 11:33:06 +00:00
Max Horn 51010bd038 Remove BaseNodeType (it is not used anymore, we can readd it, should we ever have need for it again)
svn-id: r24079
2006-10-02 20:13:48 +00:00
Max Horn 53f73eac85 Added explicit string equals/hash functors to a new header common/hash-str.h; removed Hash functor specialization for String and char pointers; changed all code using hashmaps with string keys to explicitly specify whether they honor or ignore case
svn-id: r23634
2006-07-30 12:21:54 +00:00
Max Horn b3a66e817f Rename BaseNodeFunc to BaseNodeType
svn-id: r23627
2006-07-30 10:48:44 +00:00
Max Horn c59e7ece0a Part of the FreeMiNT patch
svn-id: r23566
2006-07-22 17:00:36 +00:00
Max Horn 5d1e4d7f09 Removed unnecessary typedef
svn-id: r22875
2006-06-03 13:56:50 +00:00
Max Horn 0e174a8adc Really remove HashMap::find(char *)
svn-id: r22874
2006-06-03 13:39:39 +00:00
Max Horn 5a1eaabceb Replaced the bogus find(const String &key) method with the proper find(const Key &key) one. Also removed the bogus find(const char *key) (which not only doesn't work correctly for non-string keys, but also usually will be *less* efficient)
svn-id: r22871
2006-06-03 13:32:53 +00:00
Eugene Sandulenko 061905c524 Plug memory leak
svn-id: r22842
2006-06-02 17:57:45 +00:00
Eugene Sandulenko 180f6c87ad Remove slipped in debug output.
svn-id: r22840
2006-06-02 16:07:40 +00:00
Eugene Sandulenko 3348c32de0 Added possibility to use (char *) as ashMap keys. For some reason it does not
work as expected. When I try to switch _aliasmap in eval.h to it, I get 
crash in String constructor on dereferencing.

svn-id: r22838
2006-06-02 15:41:48 +00:00
Max Horn 62dce81acc HashMap::size does not modify the state of the hashmap, so it can be declared const (allowing it to be used on const hashmaps, too)
svn-id: r22156
2006-04-25 19:20:57 +00:00
Max Horn 68450b31e3 cleanup
svn-id: r21919
2006-04-15 21:22:33 +00:00
Chris Apers f0d03fb52f PalmOS too
svn-id: r21802
2006-04-11 18:14:26 +00:00
Lars Persson 595a48a87e Small updates to intiate variable and member visibility.
svn-id: r21604
2006-04-04 21:32:19 +00:00
Eugene Sandulenko 8272591c8d Add size() methods to Map and HashMap classes
svn-id: r21520
2006-03-31 23:49:08 +00:00
Max Horn 05b0ed007e Disable DEBUG_HASH_COLLISIONS again (accidentally got enabled in my previous commit)
svn-id: r21518
2006-03-31 22:38:27 +00:00
Max Horn c50bfd9d34 Modify HashMap to allow client code to override the equality/hash functionality via functors that are specified as template paramaters (emulating the hash_map class which many STL implementations provide) -> this is necessary to allow e.g. HashMaps that use case insensitive strings as keys
svn-id: r21517
2006-03-31 22:19:39 +00:00
Max Horn f38d89f327 Set correct load factor for hashmap (just wanted to check if anybody is paying attention to those commit messages *cough* ;-)
svn-id: r21482
2006-03-28 16:19:18 +00:00
Max Horn 41991f88a9 Added iterator support to hashmap, as well as erase & find methods (all currently needs more testing and may be buggy)
svn-id: r21476
2006-03-28 12:34:34 +00:00
Max Horn 92437ce549 Reduce the differences between Map and HashMap some more (in the end, we should be able to easily switch between the two, e.g. in the ConfigManager class)
svn-id: r21475
2006-03-28 11:21:13 +00:00
Max Horn dae92b83f2 Increase the load factor for our hashmaps from 50% to 75%, to be slightly nicer regarding memory consumption
svn-id: r21474
2006-03-28 10:54:02 +00:00
Max Horn f4339ff6c4 - Renamed class AssocArray to HashMap to match our existing class Map (note also
that many STL implementations have a class hash_map next to class map, too)
- Changed some static File class member vars to be normal static variables, in
  yet another attempt to reduce header dependencies (in this case on hashmap.h)

svn-id: r21473
2006-03-28 10:05:25 +00:00