changeset 101:523269b36711

Update to dmd 2.050
author David Bryant <bagnose@gmail.com>
date Thu, 28 Oct 2010 16:35:11 +1030
parents a274d16ab6ce
children d04c3fe1822c
files doodle/core/logging.d doodle/dia/icanvas.d doodle/fig/diagram_layer.d doodle/tk/color.d doodle/tk/events.d nobuild/dot-hgrc
diffstat 6 files changed, 21 insertions(+), 115 deletions(-) [+]
line wrap: on
line diff
--- a/doodle/core/logging.d	Mon Oct 18 18:10:02 2010 +1030
+++ b/doodle/core/logging.d	Thu Oct 28 16:35:11 2010 +1030
@@ -2,7 +2,6 @@
 
 private {
     import std.stdio;
-    import std.typecons;
     import std.traits;
 }
 
@@ -52,8 +51,7 @@
 }
 
 private {
-    mixin(defineEnum!("Severity",
-                      "TRACE", "INFO", "MESSAGE", "WARNING", "ERROR", "FATAL"));
+    enum Severity { TRACE, INFO, MESSAGE, WARNING, ERROR, FATAL }
 
     string severityString(in Severity s) {
         switch (s) {
--- a/doodle/dia/icanvas.d	Mon Oct 18 18:10:02 2010 +1030
+++ b/doodle/dia/icanvas.d	Thu Oct 28 16:35:11 2010 +1030
@@ -7,12 +7,7 @@
     import doodle.tk.screen_model;
 }
 
-private {
-    import std.typecons;
-}
-
-mixin(defineEnum!("Cursor",
-                  "DEFAULT", "HAND", "CROSSHAIR", "PENCIL"));
+enum Cursor { DEFAULT, HAND, CROSSHAIR, PENCIL }
 
 interface IViewport2 {
     void damageModel(in Rectangle area);
--- a/doodle/fig/diagram_layer.d	Mon Oct 18 18:10:02 2010 +1030
+++ b/doodle/fig/diagram_layer.d	Thu Oct 28 16:35:11 2010 +1030
@@ -22,7 +22,7 @@
     override Rectangle bounds() const {
         // Take the union of all diagram element bounds
         /*
-        Rectangle bounds = Rectangle.DEFAULT;
+        Rectangle bounds;
         foreach (element; _elements) { bounds = bounds | element.bounds; }
         */
         return Rectangle();
--- a/doodle/tk/color.d	Mon Oct 18 18:10:02 2010 +1030
+++ b/doodle/tk/color.d	Thu Oct 28 16:35:11 2010 +1030
@@ -1,8 +1,6 @@
 module doodle.tk.color;
 
 struct Color {
-    static immutable Color DEFAULT = Color(0.0, 0.0, 0.0, 1.0);
-
     this(in double r, in double g, in double b, in double a) {
         // XXX how to deal with out of range? Clamp/assert
         _r = r;
@@ -20,6 +18,6 @@
     double a() const { return _a; }
 
     private {
-        double _r, _g, _b, _a;
+        double _r = 0.0, _g = 0.0, _b = 0.0, _a = 1.0;
     }
 }
--- a/doodle/tk/events.d	Mon Oct 18 18:10:02 2010 +1030
+++ b/doodle/tk/events.d	Thu Oct 28 16:35:11 2010 +1030
@@ -7,25 +7,16 @@
 }
 
 private {
-    import std.typecons;
+    import std.conv;
 }
 
-mixin(defineEnum!("ButtonAction",
-                  "SINGLE_PRESS", "DOUBLE_PRESS", "TRIPLE_PRESS", "RELEASE"));
-
-mixin(defineEnum!("ButtonName",
-                  "LEFT", "MIDDLE", "RIGHT", "FOUR", "FIVE"));
+enum ButtonAction { SINGLE_PRESS, DOUBLE_PRESS, TRIPLE_PRESS, RELEASE }
+enum ButtonName { LEFT, MIDDLE, RIGHT, FOUR, FIVE }
+enum ScrollDirection { UP, DOWN, LEFT, RIGHT }
+enum Modifier { SHIFT, CAPS_LOCK, CONTROL, ALT, NUM_LOCK, META, SCROLL_LOCK, LEFT_BUTTON, MIDDLE_BUTTON, RIGHT_BUTTON, UNUSED_BUTTON_1, UNUSED_BUTTON_2 }
 
-mixin(defineEnum!("ScrollDirection",
-                  "UP", "DOWN", "LEFT", "RIGHT"));
-
-mixin(defineEnum!("Modifier",
-                  "SHIFT", "CAPS_LOCK", "CONTROL", "ALT", "NUM_LOCK", "META",
-                  "SCROLL_LOCK", "LEFT_BUTTON", "MIDDLE_BUTTON", "RIGHT_BUTTON",
-                  "UNUSED_BUTTON_1", "UNUSED_BUTTON_2"));
-
-mixin(defineEnum!("CrossingMode",           // FIXME what to do about GRAB2/UNGRAB2
-                  "NORMAL", "GRAB", "UNGRAB", "GRAB2", "UNGRAB2", "STATE_CHANGED"));
+// FIXME what to do about GRAB2/UNGRAB2
+enum CrossingMode { NORMAL, GRAB, UNGRAB, GRAB2, UNGRAB2, STATE_CHANGED }
 
 struct Mask {
     this(in Modifier[] modifiers) {
@@ -44,7 +35,7 @@
             for (int i = 0; i < _bits.sizeof * 8; ++i) {
                 if (_bits & (1 << i)) {
                     if (s.length != 0) s ~= "|";
-                    s ~= enumToString(cast(Modifier)i);
+                    s ~= to!string(cast(Modifier)i);
                 }
             }
 
@@ -85,7 +76,8 @@
     uint value() const { return _value; }
 
     override string toString() const {
-        return std.string.format("Key event: %s, %d, %s", _str, _value, _mask);
+        return std.string.format("Key event: %s, %d, %s",
+                                 _str, _value, _mask);
     }
 
     private {
@@ -122,7 +114,8 @@
     CrossingMode crossingMode() const { return _crossingMode; }
 
     override string toString() const {
-        return std.string.format("Crossing event: %s, %s, %s, %s", enumToString(_crossingMode), screenPoint, modelPoint, mask);
+        return std.string.format("Crossing event: %s, %s, %s, %s",
+                                 to!string(_crossingMode), screenPoint, modelPoint, mask);
     }
 
     private {
@@ -143,8 +136,7 @@
 
     override string toString() const {
         return std.string.format("Button event: %s, %s, %s, %s, %s",
-                                 enumToString(_buttonAction), enumToString(_buttonName),
-                                 _screenPoint, _modelPoint, _mask);
+                                 to!string(_buttonAction), to!string(_buttonName), _screenPoint, _modelPoint, _mask);
     }
 
     ButtonAction buttonAction() const { return _buttonAction; }
@@ -180,7 +172,7 @@
 
     override string toString() const {
         return std.string.format("Scroll event: %s, %s, %s, %s",
-                                 enumToString(_scrollDirection), _screenPoint, _modelPoint, _mask);
+                                 to!string(_scrollDirection), _screenPoint, _modelPoint, _mask);
     }
 
     ScrollDirection scrollDirection() const { return _scrollDirection; }
--- a/nobuild/dot-hgrc	Mon Oct 18 18:10:02 2010 +1030
+++ b/nobuild/dot-hgrc	Thu Oct 28 16:35:11 2010 +1030
@@ -1,6 +1,3 @@
-# --- Sample .hgrc file. Customize and drop as ~/.hgrc --- #
-
-# --- Mercurial's internal format --- #
 [revlog]
 # format = 0 for revlog; format = 1 for revlogng
 format = 1
@@ -9,87 +6,13 @@
 # revlogng needs flags = inline
 flags = inline
 
-# --- User interface --- #
 [ui]
 # show changed files and be a bit more verbose if True
 verbose = True
-# username data to appear in comits
-# it usually takes the form: "Joe User <joe.user at host.com>"
 username = David Bryant <bagnose@gmail.com>
 
-# --- Active Extensions --- #
-# each extension has its own 'extension_name = path' line
-# the default python library path is used when path is left blank
-# the hgext dir is used when 'hgext.extension_name = ' is written
+[diff]
+ignorews=True
+
 [extensions]
 hgk =
-# acl - Access control lists
-# hg help acl
-# hgext.acl =
-# ---
-# bisect - binary search changesets to detect (mis)features
-# hg help bisect
-# hgext.hbisect =
-# ---
-# bugzilla - update bugzilla bugs when changesets mention them
-# hg help bugzilla
-# hgext.bugzilla =
-# ---
-# extdiff - Use external diff application instead of builtin one
-# hgext.extdiff =
-# ---
-# gpg - GPG checks and signing
-# hg help gpg
-# hgext.gpg =
-# ---
-# hgk - GUI repository browser
-# hg help view
-# hgk = /home/pachi/program/hg/hg/contrib/hgk.py
-# ---
-# mq - Mercurial patch queues
-# hg help mq
-# hgext.mq =
-# ---
-# notify - Template driven e-mail notifications
-# hg help notify
-# hgext.notify =
-# ---
-# patchbomb - send changesets as a series of patch emails
-# hg help email
-# hgext.patchbomb =
-# ---
-# win32text - line ending conversion filters for the Windows platform
-# hgext.win32text =
-
-# --- hgk additional configuration --- #
-# set executable path
-#[hgk]
-#path = /home/pachi/program/hg/hg/contrib/hgk
-
-# Hook to Mercurial actions - See hgrc man page for avaliable hooks
-[hooks]
-#Example notify hooks
-#incoming.notify = python:hgext.notify.hook
-#changegroup.notify = python:hgext.notify.hook
-
-# --- notify extension configuration --- #
-# Email information for the notify extension
-[email]
-#from = your at email.address
-
-# smtp sever to send notifications to
-[smtp]
-#host = localhost
-
-# base url, or dummy value if repo isn't available via http
-[web]
-#baseurl = http://hgserver/...
-
-[notify]
-# multiple sources can be specified as a whitespace separated list
-#sources = serve push pull bundle
-# set this to False when you're ready for mail to start sending
-#test = True
-#config = /path/to/subscription/file
-
-# --- end of file --- #