2002/10/04 02:09:24
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:50:42 +0000 (06:50 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:50:42 +0000 (06:50 +0000)
darcs-hash:20040130065042-2ba56-6f74afcc29fdd99f7af316df46ab74cbc7504b16.gz

ant
src/org/xwt/GIF.java
src/org/xwt/HTTP.java

diff --git a/ant b/ant
index b22db95..f8ebbb9 100755 (executable)
--- a/ant
+++ b/ant
@@ -11,6 +11,7 @@ cd `dirname $0`
 export CLASSPATH
 for A in $XWT_HOME/lib/*.jar; do CLASSPATH=$CLASSPATH:$A; done
 
+test "$JAVA_HOME" == "" && test -d /usr/lib/j2sdk1.4 && export JAVA_HOME=/usr/lib/j2sdk1.4
 if [ "$JAVA_HOME" == "" ] ; then
     echo "Error: you must set your \$JAVA_HOME variable"
     exit -1
index 75ae93a..48c6f11 100644 (file)
@@ -152,10 +152,10 @@ public class GIF implements ImageDecoder {
 
         /* Initialize the decoder */
         /* Set values for "special" numbers:
-         * clear code  reset the decoder
-         * end code            stop decoding
-         * code size   size of the next code to retrieve
-         * max code            next available table position
+         * clear code   reset the decoder
+         * end code     stop decoding
+         * code size    size of the next code to retrieve
+         * max code     next available table position
          */
         clearCode   = 1 << initialCodeSize;
         endCode     = clearCode + 1;
@@ -364,15 +364,15 @@ public class GIF implements ImageDecoder {
         int label = _buf[0];
         int count = -1;
         switch (label) {
-           case 0x01:      // Plain Text Extension
-           case 0xff:      // Application Extension
-           case 0xfe:      // Comment Extension
+        case 0x01:      // Plain Text Extension
+        case 0xff:      // Application Extension
+        case 0xfe:      // Comment Extension
             break;
-           case 0xf9:      // Graphic Control Extension
-               count = getDataBlock();
-               if (count < 0) return true;
+        case 0xf9:      // Graphic Control Extension
+            count = getDataBlock();
+            if (count < 0) return true;
             // Check for transparency setting.
-               if ((_buf[0] & HASTRANSPARENCY) != 0) trans_idx = _buf[3];
+            if ((_buf[0] & HASTRANSPARENCY) != 0) trans_idx = _buf[3];
             else trans_idx = -1;
         }
         do { count = getDataBlock(); } while (count > 0);
@@ -429,14 +429,14 @@ public class GIF implements ImageDecoder {
     private int     bitsInWindow = 0;
 
     // Class-wide constants.
-    private static final int INTERLACE                 = 0x40;
-    private static final int GLOBALCOLORMAP    = 0x80;
-    private static final int LOCALCOLORMAP     = 0x80;
-    private static final int HASTRANSPARENCY   = 0x01;
-    private static final int MAX_LWZ_BITS      = 12;
-    private static final int BUFSIZE           = 280;
-    private static final int[] _interlaceStep  = { 8, 8, 4, 2 };
-    private static final int[] _interlaceStart = { 0, 4, 2, 1 };
+    private static final int INTERLACE      = 0x40;
+    private static final int GLOBALCOLORMAP = 0x80;
+    private static final int LOCALCOLORMAP  = 0x80;
+    private static final int HASTRANSPARENCY    = 0x01;
+    private static final int MAX_LWZ_BITS   = 12;
+    private static final int BUFSIZE        = 280;
+    private static final int[] _interlaceStep   = { 8, 8, 4, 2 };
+    private static final int[] _interlaceStart  = { 0, 4, 2, 1 };
 }
 
 
index e29d31b..22a0761 100644 (file)
@@ -363,9 +363,9 @@ public class HTTP {
         PrintWriter pw = new PrintWriter(new OutputStreamWriter(sock.getOutputStream()));
         if (content != null) {
             pw.print("POST " + path + " HTTP/1.1\r\n");
-           int contentLength = content.substring(0, 2).equals("\r\n") ?
-               content.length() - 2 :
-               (content.length() - content.indexOf("\r\n\r\n") - 4);
+        int contentLength = content.substring(0, 2).equals("\r\n") ?
+        content.length() - 2 :
+        (content.length() - content.indexOf("\r\n\r\n") - 4);
             pw.print("Content-Length: " + contentLength + "\r\n");
             if (contentType != null) pw.print("Content-Type: " + contentType + "\r\n");
         } else {