changeset 87:2212285f714c

Added a workaround for a dmd bug. For some reason the bug showed up after upgrading dsss.
author Diggory Hardy <diggory.hardy@gmail.com>
date Tue, 23 Sep 2008 12:31:48 +0100
parents 79d816b3e2d2
children 01f4f5f1acc9
files codeDoc/jobs.txt mde/file/mergetag/Reader.d mde/input/Config.d mde/workaround2371.d
diffstat 4 files changed, 34 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/codeDoc/jobs.txt	Fri Sep 12 17:36:14 2008 +0100
+++ b/codeDoc/jobs.txt	Tue Sep 23 12:31:48 2008 +0100
@@ -15,6 +15,7 @@
 4   Try to correlate names of option sections more. (i.e. symbol name, class name, name of i18n translation file)
 4   Not guaranteed to catch up-click ending callback! Appears not to be a problem...
 4   OutOfMemoryException is not currently checked for − it should be at least in critical places (use high-level catching of all errors?).
+3   Use of dtors - don't rely on them? Or what happens when init throws during creation - relying on undefined behaviour.
 3   Fonts from Options. Get yMax for font not all glyphs on line?
 3   glBindTexture not working with non-0 index (??)
 3   on-event draw support (mde.events and GUI need to tell mde.mde)
--- a/mde/file/mergetag/Reader.d	Fri Sep 12 17:36:14 2008 +0100
+++ b/mde/file/mergetag/Reader.d	Tue Sep 23 12:31:48 2008 +0100
@@ -32,7 +32,8 @@
 import tango.io.UnicodeFile;
 import Util = tango.text.Util;
 import ConvInt = tango.text.convert.Integer;
-import tango.util.container.HashSet;
+//import tango.util.container.HashSet;
+import mde.workaround2371;
 import tango.util.log.Log : Log, Logger;
 
 private Logger logger;
@@ -262,8 +263,8 @@
     *
     * If secSet is provided, reading is restricted to sections given in secSet, otherwise all
     * sections are read. Sections given in secSet but not found in the file are not reported as an
-    * error. Suggested: supply a HashSet!(uint) as the View!(ID). An ArrayBag!(ID) as used is not a
-    * good choice, except that in this case it's empty.
+    * error. Suggested: supply a HashSet!(ID) as the container. If an ID[] is passed this is
+    * converted to a HashSet!(ID) to speed up lookups.
     *
     * Merging:
     * Where a section already exists in the DataSet (when either the section is given more than
@@ -299,7 +300,7 @@
     }
     /** ditto */
     public void read (ID[] secSet) {
-        HashSet!(ID) hs = new HashSet!(ID);
+        myStringHS hs = new myStringHS; // FIXME: workaround2371
         foreach (id; secSet) hs.add(id);
         read (hs);
     }
--- a/mde/input/Config.d	Fri Sep 12 17:36:14 2008 +0100
+++ b/mde/input/Config.d	Tue Sep 23 12:31:48 2008 +0100
@@ -24,7 +24,8 @@
 debug import mde.file.serialize;
 
 import tango.util.log.Log : Log, Logger;
-import tango.util.container.HashSet;
+//import tango.util.container.HashSet;
+import mde.workaround2371;
 
 /** Class to hold the configuration for the input system. Thus loading and switching between
  *  multiple configurations should be easy.
@@ -115,13 +116,14 @@
     uint[] inheritants;		/// Other profiles to inherit.
     
     static Config[char[]] configs;	/// All configs loaded by load().
-    private static HashSet!(char[]) loadedFiles;	// all filenames load tried to read
+    // FIXME: workaround2371
+    private static myStringHS loadedFiles;	// all filenames load tried to read
     private static Logger logger;
     
 //BEGIN File loading/saving code
     static this () {
         logger = Log.getLogger ("mde.input.Config");
-        loadedFiles = new HashSet!(char[]);
+        loadedFiles = new myStringHS;
     }
     
     // Load all configs from a file.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mde/workaround2371.d	Tue Sep 23 12:31:48 2008 +0100
@@ -0,0 +1,23 @@
+/* LICENSE BLOCK
+Part of mde: a Modular D game-oriented Engine
+Copyright © 2007-2008 Diggory Hardy
+
+This program is free software: you can redistribute it and/or modify it under the terms
+of the GNU General Public License as published by the Free Software Foundation, either
+version 2 of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+
+/**************************************************************************************************
+ * NOTE: Workaround for this bug: http://d.puremagic.com/issues/show_bug.cgi?id=2371
+ *************************************************************************************************/
+module mde.workaround2371;
+
+public import tango.util.container.HashSet;
+
+alias HashSet!(char[]) myStringHS;