Browse Source

removed deprecated extension of record to object

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@6622 8c9fc860-2736-0410-a75d-ab315db34111
eth.guenter 9 years ago
parent
commit
8c97ab902c
1 changed files with 9 additions and 15 deletions
  1. 9 15
      source/Unix.UnixFiles.Mod

+ 9 - 15
source/Unix.UnixFiles.Mod

@@ -4,7 +4,7 @@ MODULE UnixFiles;   (** AUTHOR "gf"; PURPOSE "Unix file systems" *)
 
 (*  derived fron (SPARCOberon) Files.Mod by J. Templ 1.12. 89/14.05.93 *)
 
-IMPORT S := SYSTEM, Unix, Machine, Heaps, Objects, Kernel, Modules, Log := KernelLog, Files;
+IMPORT S := SYSTEM, Unix, Machine, Heaps, Kernel, Modules, Log := KernelLog, Files;
 
 
 CONST
@@ -371,18 +371,11 @@ TYPE
 			END UnixFileSystem;
 	
 	
-	Buffer = OBJECT (Files.Hint )
-			VAR
-				chg: BOOLEAN;
-				org, size: LONGINT;
-				data: ARRAY Bufsize OF CHAR;
-				
-				PROCEDURE &Init;
-				BEGIN 
-					chg := FALSE;  org := -1; 
-				END Init;
-				
-			END Buffer;
+	Buffer =	POINTER TO RECORD (Files.Hint)
+					chg: BOOLEAN;
+					org, size: LONGINT;
+					data: ARRAY Bufsize OF CHAR;
+				END;
 	
 	File* = OBJECT (Files.File)
 			VAR
@@ -456,7 +449,7 @@ TYPE
 						res := Unix.fstat( fd, stat );  mtime := stat.mtime.sec
 					END
 				END Flush;
-				
+		
 	
 				PROCEDURE Set*( VAR r: Files.Rider;  pos: LONGINT );
 				BEGIN {EXCLUSIVE}
@@ -474,7 +467,8 @@ TYPE
 					WHILE (i < NBufs) & (bufs[i] # NIL) & (org # bufs[i].org) DO  INC( i )  END;
 					IF i < NBufs THEN
 						IF bufs[i] = NIL THEN  
-							NEW( buf );  bufs[i] := buf;  
+							NEW( buf );  buf.chg := FALSE;  buf.org := -1;
+							bufs[i] := buf
 						ELSE  
 							swapper := i;
 							buf := bufs[swapper];  Flush( buf )