Show
Ignore:
Timestamp:
05/17/08 11:34:28 (6 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Update to SWT 3.4M7

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/internal/image/PngChunk.d

    r212 r213  
    2222import dwt.internal.image.PngIendChunk; 
    2323import dwt.internal.image.PngTrnsChunk; 
     24import dwt.dwthelper.utils; 
    2425 
    2526import tango.core.Exception; 
    2627import tango.text.convert.Format; 
    27 import dwt.dwthelper.System; 
    28 import dwt.dwthelper.utils; 
    2928 
    3029class PngChunk { 
     
    5453    static const byte[] TYPE_tRNS = cast(byte[])"tRNS";//{(byte) 't', (byte) 'R', (byte) 'N', (byte) 'S'}; 
    5554 
    56     private static /+const+/ int[] CRC_TABLE; 
    57     private static bool static_this_completed = false; 
    58     private static void static_this() { 
    59         if( static_this_completed ){ 
    60             return; 
    61         } 
    62         synchronized { 
    63             if( static_this_completed ){ 
    64                 return; 
    65             } 
    66             CRC_TABLE = new int[256]; 
    67             for (int i = 0; i < 256; i++) { 
    68                 CRC_TABLE[i] = i; 
    69                 for (int j = 0; j < 8; j++) { 
    70                     if ((CRC_TABLE[i] & 0x1) is 0) { 
    71                         CRC_TABLE[i] = (CRC_TABLE[i] >> 1) & 0x7FFFFFFF; 
    72                     } else { 
    73                         CRC_TABLE[i] = 0xEDB88320 ^ ((CRC_TABLE[i] >> 1) & 0x7FFFFFFF); 
    74                     } 
     55    static const int[] CRC_TABLE; 
     56    //public static void static_this() { 
     57    static this() { 
     58        CRC_TABLE = new int[256]; 
     59        for (int i = 0; i < 256; i++) { 
     60            CRC_TABLE[i] = i; 
     61            for (int j = 0; j < 8; j++) { 
     62                if ((CRC_TABLE[i] & 0x1) is 0) { 
     63                    CRC_TABLE[i] = (CRC_TABLE[i] >> 1) & 0x7FFFFFFF; 
     64                } else { 
     65                    CRC_TABLE[i] = 0xEDB88320 ^ ((CRC_TABLE[i] >> 1) & 0x7FFFFFFF); 
    7566                } 
    7667            } 
    77             static_this_completed = true; 
    7868        } 
    7969    } 
     
    8676 */ 
    8777this(byte[] reference) { 
    88     static_this(); 
    8978    setReference(reference); 
    9079    if (reference.length < LENGTH_OFFSET + LENGTH_FIELD_LENGTH) DWT.error(DWT.ERROR_INVALID_IMAGE); 
     
    386375 * @return a string representation of the event 
    387376 */ 
    388 override public String toString() { 
     377public override String toString() { 
    389378    String buffer = Format( "{\n\tLength: {}\n\tType: {}{}\n\tCRC: {:X}\n}", 
    390379        getLength(),