ImageReader.st
changeset 4401 7db2b162388d
parent 4177 7c3612e35974
child 4714 3ea57c207759
--- a/ImageReader.st	Fri Jul 08 12:15:55 2005 +0200
+++ b/ImageReader.st	Fri Jul 08 21:37:35 2005 +0200
@@ -28,6 +28,10 @@
 # include <stdio.h>
 # define _STDIO_H_INCLUDED_
 #endif
+#ifndef _MALLOC_H_INCLUDED_
+# include <malloc.h>
+# define _MALLOC_H_INCLUDED_
+#endif
 
 
 %}
@@ -391,7 +395,27 @@
 		    }
 		}
 		if (cnt > 256) {
-		    while ((int)to & 3) {
+		    while ((INT)to & 3) {
+			*to++ = 0xFF;
+			cnt -= 8;
+		    }
+#if __POINTER_SIZE__ == 8
+		    while ((INT)to & 7) {
+			*to++ = 0xFF;
+			cnt -= 8;
+		    }
+		    while (cnt >= 64) {
+			(*(INT *)to) = 0xFFFFFFFFFFFFFFFF;
+			to += 8;
+			cnt -= 64;
+		    }
+		    if (cnt >= 32) {
+			(*(long *)to) = 0xFFFFFFFF;
+			to += 4;
+			cnt -= 32;
+		    }
+#else
+		    while ((INT)to & 3) {
 			*to++ = 0xFF;
 			cnt -= 8;
 		    }
@@ -400,6 +424,7 @@
 			to += 4;
 			cnt -= 32;
 		    }
+#endif
 		}
 		while (cnt >= 8) {
 		    *to++ = 0xFF;
@@ -2280,5 +2305,5 @@
 !ImageReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.89 2004-05-13 19:13:35 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.90 2005-07-08 19:37:35 cg Exp $'
 ! !