diff org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/image/PngChunk.d @ 112:9f4c18c268b2

Update to compile and execute with dmd 2.052.
author kntroh
date Wed, 16 Mar 2011 21:53:53 +0900
parents 0ecb2b338560
children 536e43f63c81
line wrap: on
line diff
--- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/image/PngChunk.d	Sat Nov 13 14:15:51 2010 +0100
+++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/image/PngChunk.d	Wed Mar 16 21:53:53 2011 +0900
@@ -50,17 +50,21 @@
     static /*const*/ byte[] TYPE_IEND = cast(byte[])"IEND";//{(byte) 'I', (byte) 'E', (byte) 'N', (byte) 'D'};
     static /*const*/ byte[] TYPE_tRNS = cast(byte[])"tRNS";//{(byte) 't', (byte) 'R', (byte) 'N', (byte) 'S'};
 
-    static int[] CRC_TABLE;
+    private static int[] _CRC_TABLE = null;
+    static int[] CRC_TABLE() {
+        if (!_CRC_TABLE) static_this();
+        return _CRC_TABLE;
+    }
     //public static void static_this() {
-    static this() {
-        CRC_TABLE = new int[256];
+    private static void static_this() {
+        _CRC_TABLE = new int[256];
         for (int i = 0; i < 256; i++) {
-            CRC_TABLE[i] = i;
+            _CRC_TABLE[i] = i;
             for (int j = 0; j < 8; j++) {
-                if ((CRC_TABLE[i] & 0x1) is 0) {
-                    CRC_TABLE[i] = (CRC_TABLE[i] >> 1) & 0x7FFFFFFF;
+                if ((_CRC_TABLE[i] & 0x1) is 0) {
+                    _CRC_TABLE[i] = (_CRC_TABLE[i] >> 1) & 0x7FFFFFFF;
                 } else {
-                    CRC_TABLE[i] = 0xEDB88320 ^ ((CRC_TABLE[i] >> 1) & 0x7FFFFFFF);
+                    _CRC_TABLE[i] = 0xEDB88320 ^ ((_CRC_TABLE[i] >> 1) & 0x7FFFFFFF);
                 }
             }
         }