From 897fa3c89674460aa4fad275f263cea2b341420d Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 4 May 2004 20:08:57 -0700 Subject: [PATCH] de-eclipseify darcs-hash:20040505030857-24bed-6e015f821835edd9fcb16037a1ff0630bf0954a7.gz --- src/org/ibex/nestedvm/ClassFileCompiler.java | 4 +- src/org/ibex/nestedvm/Runtime.java | 94 +++++++++++++------------- src/org/ibex/nestedvm/RuntimeCompiler.java | 6 +- src/org/ibex/nestedvm/UnixRuntime.java | 88 ++++++++++++------------ src/org/ibex/nestedvm/util/InodeCache.java | 22 +++--- src/org/ibex/nestedvm/util/Seekable.java | 8 +-- 6 files changed, 111 insertions(+), 111 deletions(-) diff --git a/src/org/ibex/nestedvm/ClassFileCompiler.java b/src/org/ibex/nestedvm/ClassFileCompiler.java index 931f1b9..a7f035c 100644 --- a/src/org/ibex/nestedvm/ClassFileCompiler.java +++ b/src/org/ibex/nestedvm/ClassFileCompiler.java @@ -391,7 +391,7 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const new Type[]{Type.getType("Lorg/ibex/nestedvm/UnixRuntime;"),Type.STRING,new ArrayType(Type.STRING,1)}, INVOKESTATIC)); else - a(fac.createInvoke(fullClassName,"run",Type.INT,new Type[]{Type.STRING,new ArrayType(Type.STRING,1)},INVOKEVIRTUAL)); + a(fac.createInvoke(fullClassName,"run",Type.INT,new Type[]{Type.STRING,new ArrayType(Type.STRING,1)},INVOKEVIRTUAL)); a(fac.createInvoke("java.lang.System","exit",Type.VOID,new Type[]{Type.INT},INVOKESTATIC)); a(InstructionConstants.RETURN); main.setMaxLocals(); @@ -404,7 +404,7 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const } private void addConstReturnMethod(String name, int val) { - MethodGen method = newMethod(ACC_PROTECTED,Type.INT, Type.NO_ARGS,name); + MethodGen method = newMethod(ACC_PROTECTED,Type.INT, Type.NO_ARGS,name); selectMethod(method); pushConst(val); a(InstructionConstants.IRETURN); diff --git a/src/org/ibex/nestedvm/Runtime.java b/src/org/ibex/nestedvm/Runtime.java index 2f23d1c..b790374 100644 --- a/src/org/ibex/nestedvm/Runtime.java +++ b/src/org/ibex/nestedvm/Runtime.java @@ -102,7 +102,7 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable { protected abstract void setCPUState(CPUState state); protected Object clone() throws CloneNotSupportedException { - Runtime r = (Runtime) super.clone(); + Runtime r = (Runtime) super.clone(); r._byteBuf = null; r.startTime = 0; r.fds = new FD[OPEN_MAX]; @@ -111,7 +111,7 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable { r.readPages = new int[totalPages][]; r.writePages = new int[totalPages][]; for(int i=0;i>2]; } else { - for(int i=(stackBottom >>> pageShift);i>2]; + for(int i=(stackBottom >>> pageShift);i>2]; } } @@ -505,8 +505,8 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable { } static String[] concatArgv(String argv0, String[] rest) { - String[] argv = new String[rest.length+1]; - System.arraycopy(rest,0,argv,1,rest.length); + String[] argv = new String[rest.length+1]; + System.arraycopy(rest,0,argv,1,rest.length); argv[0] = argv0; return argv; } @@ -539,8 +539,8 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable { sp = top = writePages.length*(1<fdn and returns the new fs */ public final int dupFD(int fdn) { - int i; - if(fdn < 0 || fdn >= OPEN_MAX) return -1; - if(fds[fdn] == null) return -1; - for(i=0;i= OPEN_MAX) return -1; + if(fds[fdn] == null) return -1; + for(i=0;i " + r.pid + " tasks[" + r.pid + "] = " + gd.tasks[r.pid]); @@ -278,7 +278,7 @@ public abstract class UnixRuntime extends Runtime implements Cloneable { public static int runAndExec(UnixRuntime r, String[] argv) { r.start(argv); return executeAndExec(r); } public static int executeAndExec(UnixRuntime r) { - for(;;) { + for(;;) { for(;;) { if(r.execute()) break; if(STDERR_DIAG) System.err.println("WARNING: Pause requested while executing runAndExec()"); @@ -289,7 +289,7 @@ public abstract class UnixRuntime extends Runtime implements Cloneable { } private String[] readStringArray(int addr) throws ReadFaultException { - int count = 0; + int count = 0; for(int p=addr;memRead(p) != 0;p+=4) count++; String[] a = new String[count]; for(int i=0,p=addr;i 0 && pos < size();pos++){ switch(pos) { - case -2: + case -2: case -1: - ino = pos == -1 ? parentInode() : myInode(); + ino = pos == -1 ? parentInode() : myInode(); if(ino == -1) continue; reclen = 9 + (pos == -1 ? 2 : 1); if(reclen > len) break OUTER; @@ -987,7 +987,7 @@ public abstract class UnixRuntime extends Runtime implements Cloneable { public String name(int n) { switch(n) { - case 0: return "null"; + case 0: return "null"; case 1: return "zero"; case 2: return "fd"; default: return null; diff --git a/src/org/ibex/nestedvm/util/InodeCache.java b/src/org/ibex/nestedvm/util/InodeCache.java index 99d2a98..c4cedb9 100644 --- a/src/org/ibex/nestedvm/util/InodeCache.java +++ b/src/org/ibex/nestedvm/util/InodeCache.java @@ -56,7 +56,7 @@ public class InodeCache { while((k = keys[dest]) != null) { if(k == PLACEHOLDER) { - if(placeholder == -1) placeholder = dest; + if(placeholder == -1) placeholder = dest; } else if(k.equals(key)) { short inode = inodes[dest]; if(dest == mru) return inode; @@ -130,8 +130,8 @@ public class InodeCache { reverse[dest] = (short) slot; inodes[slot] = (short) inode; if(mru != -1) { - prev[slot] = mru; - next[mru] = (short) slot; + prev[slot] = mru; + next[mru] = (short) slot; } mru = (short) slot; return (short) inode; @@ -152,7 +152,7 @@ public class InodeCache { return null; } - private void dump() { + /*private void dump() { System.err.println("Size " + size); System.err.println("UsedSlots " + usedSlots); System.err.println("MRU " + mru); @@ -184,20 +184,20 @@ public class InodeCache { String s; boolean good = false; try { - while((s = br.readLine()) != null) { + while((s = br.readLine()) != null) { if(s.charAt(0) == '#') { short n = Short.parseShort(s.substring(1)); - System.err.println("" + n + " -> " + c.reverse(n)); + System.err.println("" + n + " -> " + c.reverse(n)); } else { - //System.err.println("Adding " + s); - short n = c.get(s); - System.err.println("Added " + s + " -> " + n); - //c.dump(); + //System.err.println("Adding " + s); + short n = c.get(s); + System.err.println("Added " + s + " -> " + n); + //c.dump(); } } good = true; } finally { if(!good) c.stats(); } - } + }*/ } diff --git a/src/org/ibex/nestedvm/util/Seekable.java b/src/org/ibex/nestedvm/util/Seekable.java index 2e48a7d..cf8cca7 100644 --- a/src/org/ibex/nestedvm/util/Seekable.java +++ b/src/org/ibex/nestedvm/util/Seekable.java @@ -19,10 +19,10 @@ public abstract class Seekable { public int tryReadFully(byte[] buf, int off, int len) throws IOException { int total = 0; while(len > 0) { - int n = read(buf,off,len); - if(n == -1) break; - off += n; - len -= n; + int n = read(buf,off,len); + if(n == -1) break; + off += n; + len -= n; total += n; } return total == 0 ? -1 : total; -- 1.7.10.4