[Scummvm-cvs-logs] SF.net SVN: scummvm: [21424] scummvm/trunk/common/assocarray.h
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Fri Mar 24 06:16:05 CET 2006
Revision: 21424
Author: fingolfin
Date: 2006-03-24 06:14:29 -0800 (Fri, 24 Mar 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21424&view=rev
Log Message:
-----------
Using NULL as a default value is not working in general (e.g. for Common::String) -- force explicit definition of a default value
Modified Paths:
--------------
scummvm/trunk/common/assocarray.h
Modified: scummvm/trunk/common/assocarray.h
===================================================================
--- scummvm/trunk/common/assocarray.h 2006-03-24 03:33:47 UTC (rev 21423)
+++ scummvm/trunk/common/assocarray.h 2006-03-24 14:14:29 UTC (rev 21424)
@@ -107,12 +107,13 @@
inline void expand_array(void);
inline Val &subscript_helper(Key &index); // like [], but never expands array
-public:
inline int nele_val(void) const { return _nele; }
- inline Val defaultValue_val(void) const { return _default_value; }
+public:
+
inline Val &operator [](const Key &index);
- inline AssocArray(Val default_value = NULL);
+// inline AssocArray(Val default_value = Val());
+ inline AssocArray(Val default_value);
inline ~AssocArray();
inline int contains(const Key &index) const;
inline Key *new_all_keys(void) const;
@@ -198,19 +199,17 @@
template <class Key, class Val>
inline AssocArray <Key, Val>::AssocArray(Val default_value) : _default_value(default_value) {
- int ctr;
+// int ctr;
_arr = new aa_ref_t <Key, Val> *[INIT_SIZE];
- for (ctr = 0; ctr < INIT_SIZE; ctr++)
- _arr[ctr] = NULL;
+// for (ctr = 0; ctr < INIT_SIZE; ctr++)
+// _arr[ctr] = NULL;
- assert(_arr != NULL);
+// assert(_arr != NULL);
_arrsize = INIT_SIZE;
_nele = 0;
-
- return;
}
template <class Key, class Val>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list