XBMReader.st
changeset 524 2911c30d10b3
parent 493 d6392d88c552
child 550 254480517864
--- a/XBMReader.st	Fri Apr 11 16:49:54 1997 +0200
+++ b/XBMReader.st	Fri Apr 11 16:51:27 1997 +0200
@@ -116,7 +116,7 @@
 fromStream:aStream
     "read an image in xbm format from aStream"
 
-    |line 
+    |lineString 
      index    "{ Class: SmallInteger }"
      dstIndex "{ Class: SmallInteger }"
      bytesPerRow
@@ -127,50 +127,50 @@
 
     inStream := aStream.
 
-    line := aStream nextLine.
-    line isNil ifTrue:[
+    lineString := aStream nextLine.
+    lineString isNil ifTrue:[
         'XBMReader [warning]: short file' errorPrintCR.
         ^ nil
     ].
 
-    [line startsWith:'#'] whileFalse:[
-        line := aStream nextLine.
-        line isNil ifTrue:[
+    [lineString startsWith:'#'] whileFalse:[
+        lineString := aStream nextLine.
+        lineString isNil ifTrue:[
             ^ nil
         ].
     ].
 
-    (line startsWith:'#define') ifFalse:[
+    (lineString startsWith:'#define') ifFalse:[
         'XBMReader [warning]: format error (expected #define)' errorPrintCR.
         ^ nil
     ].
 
-    index := line indexOf:(Character space).
-    index := line indexOf:(Character space) startingAt:(index + 1).
+    index := lineString indexOf:(Character space).
+    index := lineString indexOf:(Character space) startingAt:(index + 1).
     (index == 0) ifTrue:[
         'XBMReader [warning]: format error' errorPrintCR.
         ^ nil
     ].
-    ((line copyTo:index - 1) endsWith:'width') ifFalse:[
+    ((lineString copyTo:index - 1) endsWith:'width') ifFalse:[
         'XBMReader [warning]: format error (expected width)' errorPrintCR.
         ^ nil
     ].
-    line := line copyFrom:(index + 1).
-    width := Number readFromString:line.
+    lineString := lineString copyFrom:(index + 1).
+    width := Number readFromString:lineString.
 
-    line := aStream nextLine.
-    index := line indexOf:(Character space).
-    index := line indexOf:(Character space) startingAt:(index + 1).
+    lineString := aStream nextLine.
+    index := lineString indexOf:(Character space).
+    index := lineString indexOf:(Character space) startingAt:(index + 1).
     (index == 0) ifTrue:[
         'XBMReader [warning]: format error' errorPrintCR.
         ^ nil
     ].
-    ((line copyTo:index - 1) endsWith:'height') ifFalse:[
+    ((lineString copyTo:index - 1) endsWith:'height') ifFalse:[
         'XBMReader [warning]: format error (expected height)' errorPrintCR.
         ^ nil
     ].
-    line := line copyFrom:(index + 1).
-    height := Number readFromString:line.
+    lineString := lineString copyFrom:(index + 1).
+    height := Number readFromString:lineString.
 
     bytesPerRow := width // 8.
     ((width \\ 8) ~~ 0) ifTrue:[
@@ -182,31 +182,31 @@
     data := ByteArray new:(bytesPerRow * height).
     dstIndex := 1.
 
-    line := aStream nextLine.
-    [line startsWith:'#'] whileTrue:[
-        line := aStream nextLine.
+    lineString := aStream nextLine.
+    [lineString startsWith:'#'] whileTrue:[
+        lineString := aStream nextLine.
     ].
 
-    [line notNil and:[(line startsWith:'static') not]] whileTrue:[
-        line := aStream nextLine.
+    [lineString notNil and:[(lineString startsWith:'static') not]] whileTrue:[
+        lineString := aStream nextLine.
     ].
-    line := aStream nextLine.
+    lineString := aStream nextLine.
 
-    [line notNil] whileTrue:[
+    [lineString notNil] whileTrue:[
         index := 1.
         [index ~~ 0] whileTrue:[
-            index := line indexOf:$x startingAt:index.
+            index := lineString indexOf:$x startingAt:index.
             (index ~~ 0) ifTrue:[
                 index := index + 1.
-                hi := (line at:index) digitValue.
+                hi := (lineString at:index) digitValue.
                 index := index + 1.
-                lo := (line at:index) digitValue.
+                lo := (lineString at:index) digitValue.
                 val := (hi bitShift:4) bitOr:lo.
                 data at:dstIndex put:(reverseBits at:(val + 1)).
                 dstIndex := dstIndex + 1
             ]
         ].
-        line := aStream nextLine
+        lineString := aStream nextLine
     ].
     photometric := #whiteIs0.
     samplesPerPixel := 1.
@@ -216,7 +216,7 @@
      XBMReader fromFile:'bitmaps/globe1.xbm'
     "
 
-    "Modified: 5.3.1997 / 21:53:28 / cg"
+    "Modified: 11.4.1997 / 16:51:21 / cg"
 ! !
 
 !XBMReader methodsFor:'writing to file'!
@@ -305,6 +305,6 @@
 !XBMReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/XBMReader.st,v 1.32 1997-03-06 00:32:24 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/XBMReader.st,v 1.33 1997-04-11 14:51:27 cg Exp $'
 ! !
 XBMReader initialize!