printf
authorClaus Gittinger <cg@exept.de>
Thu, 15 Sep 2011 14:22:19 +0200
changeset 13704 584a655c9b5e
parent 13703 b1778b468963
child 13705 c12d7a798ddb
printf
ExternalBytes.st
--- a/ExternalBytes.st	Thu Sep 15 14:20:36 2011 +0200
+++ b/ExternalBytes.st	Thu Sep 15 14:22:19 2011 +0200
@@ -56,7 +56,7 @@
 	    }
 	}
 	if (! found) {
-	    printf("EXTBYTES [warning]: **** free: alien %lx (allocated somewhere else ?))\n", (long)ptr);
+	    console_printf("ExternalBytes [warning]: **** free: alien %lx (allocated somewhere else ?))\n", (long)ptr);
 	}
     }
 }
@@ -75,7 +75,7 @@
 	found = 0;
 	for (this=mallocList; this; this=this->next) {
 	    if (this->chunk == ptr) {
-		printf("EXTBYTES [warning]: **** %016lx already allocated (freed somewhere else ?)\n", (long)ptr);
+		console_printf("ExternalBytes [warning]: **** %016lx already allocated (freed somewhere else ?)\n", (long)ptr);
 		found++;
 	    }
 	}
@@ -98,7 +98,7 @@
 	ptr = malloc(nBytes);
 
 	if (@global(TraceMalloc) == true) {
-	    printf("EXTBYTES [info]: allocated %d bytes at: %016lx\n", nBytes, (long)ptr);
+	    console_printf("ExternalBytes [info]: allocated %d bytes at: %016lx\n", nBytes, (long)ptr);
 	}
 
 	addToMallocList(ptr, nBytes);
@@ -129,7 +129,7 @@
 	addToMallocList(newPtr, nBytes);
 
 	if (@global(TraceMalloc) == true) {
-	    printf("EXTBYTES [info]: realloc %d bytes for %016lx at: %016lx\n", nBytes, (long)ptr, (long)newPtr);
+	    console_printf("ExternalBytes [info]: realloc %d bytes for %016lx at: %016lx\n", nBytes, (long)ptr, (long)newPtr);
 	}
 	return newPtr;
 }
@@ -138,7 +138,7 @@
     char *ptr;
 {
 	if (@global(TraceMalloc) == true) {
-	    printf("EXTBYTES: free bytes at: %08x\n", ptr);
+	    console_printf("ExternalBytes: free bytes at: %08x\n", ptr);
 	}
 	removeFromMallocList(ptr);
 
@@ -154,7 +154,7 @@
 	    n++;
 	    amount += this->size;
 	}
-	printf("EXTBYTES [info]: allocated %d blocks with %d bytes overall\n", n, amount);
+	console_printf("ExternalBytes [info]: allocated %d blocks with %d bytes overall\n", n, amount);
 }
 
 %}
@@ -483,7 +483,7 @@
     struct mallocList *entry;
 
     for (entry = mallocList; entry; entry=entry->next) {
-        printf("  %lx (%d)\n", (long)entry->chunk, entry->size);
+	console_printf("  %lx (%d)\n", (long)entry->chunk, entry->size);
     }
 %}
     "
@@ -508,10 +508,10 @@
     struct mallocList *entry;
 
     while ((entry = mallocList) != (struct mallocList *)0) {
-        if (@global(TraceMalloc) == true ) {
-            printf("EXTBYTES [info]: **** forced free of %lx (%d)\n", (long)entry->chunk, entry->size);
-        }
-        __stx_free(entry->chunk);
+	if (@global(TraceMalloc) == true ) {
+	    console_printf("ExternalBytes [info]: **** forced free of %lx (%d)\n", (long)entry->chunk, entry->size);
+	}
+	__stx_free(entry->chunk);
     }
 %}
 !
@@ -752,8 +752,8 @@
     idx := 1.
     s := WriteStream on:String new.
     [(byte := self at:idx) ~~ 0] whileTrue:[
-        s nextPut:(Character value:byte).
-        idx := idx + 1.
+	s nextPut:(Character value:byte).
+	idx := idx + 1.
     ].
     ^ s contents
 !
@@ -766,8 +766,8 @@
     idx := 1.
     s := WriteStream on:Unicode16String new.
     [(word := self unsignedShortAt:idx) ~~ 0] whileTrue:[
-        s nextPut:(Character value:word).
-        idx := idx + 2.
+	s nextPut:(Character value:word).
+	idx := idx + 2.
     ].
     ^ s contents
 !
@@ -1081,24 +1081,24 @@
     "/ what a kludge - Dolphin and Squeak mean: printOn: a stream;
     "/ ST/X (and some old ST80's) mean: draw-yourself on a GC.
     (aGCOrStream isStream and:[aGCOrStream ~~ Transcript]) ifFalse:[
-        ^ super displayOn:aGCOrStream
+	^ super displayOn:aGCOrStream
     ].
 
     aGCOrStream nextPutAll:self className.
     addr := self address.
     addr isNil ifTrue:[
-        aGCOrStream nextPutAll:'[free]'.
+	aGCOrStream nextPutAll:'[free]'.
     ] ifFalse:[
-        size notNil ifTrue:[
-            aGCOrStream nextPutAll:'[sz:'. 
-            size printOn:aGCOrStream. 
-            aGCOrStream space.
-        ] ifFalse:[
-            aGCOrStream nextPut:$[.
-        ].
-        aGCOrStream nextPutAll:'at:'.
-        addr printOn:aGCOrStream base:16.
-        aGCOrStream nextPut:$].
+	size notNil ifTrue:[
+	    aGCOrStream nextPutAll:'[sz:'.
+	    size printOn:aGCOrStream.
+	    aGCOrStream space.
+	] ifFalse:[
+	    aGCOrStream nextPut:$[.
+	].
+	aGCOrStream nextPutAll:'at:'.
+	addr printOn:aGCOrStream base:16.
+	aGCOrStream nextPut:$].
     ].
 
     "Modified: / 24.2.2000 / 19:02:19 / cg"
@@ -1305,11 +1305,11 @@
 !ExternalBytes class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.80 2011-01-05 15:11:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.81 2011-09-15 12:22:19 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.80 2011-01-05 15:11:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.81 2011-09-15 12:22:19 cg Exp $'
 ! !
 
 ExternalBytes initialize!