changeset 34:b1d9be1b3a34

Added additional overrides to Adler32 and CRC32 in dcrypt.misc.checksums in further hopes of D2 compatibility.
author Thomas Dixon <reikon@reikon.us>
date Thu, 14 May 2009 05:31:58 -0400
parents b9f8aa42a547
children 6b2c35b84186
files dcrypt/misc/checksums/Adler32.d dcrypt/misc/checksums/CRC32.d
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dcrypt/misc/checksums/Adler32.d	Thu May 14 01:33:11 2009 -0400
+++ b/dcrypt/misc/checksums/Adler32.d	Thu May 14 05:31:58 2009 -0400
@@ -36,6 +36,15 @@
         return (s2 << 16) + s1;
     }
     
+    /** Play nice with D2's idea of const. */
+    version (D_Version2)
+    {
+        uint compute(string input)
+        {
+            return compute(cast(ubyte[])input);
+        }
+    }
+    
     string name()
     {
         return "Adler32";
--- a/dcrypt/misc/checksums/CRC32.d	Thu May 14 01:33:11 2009 -0400
+++ b/dcrypt/misc/checksums/CRC32.d	Thu May 14 05:31:58 2009 -0400
@@ -79,6 +79,15 @@
         return (crc ^ 0xffffffff);
     }
     
+    /** Play nice with D2's idea of const. */
+    version (D_Version2)
+    {
+        uint compute(string input)
+        {
+            return compute(cast(ubyte[])input);
+        }
+    }
+    
     string name()
     {
         return "CRC32";