diff options
author | Kenneth Russel <[email protected]> | 2006-01-01 22:51:07 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-01-01 22:51:07 +0000 |
commit | 875a3de8f54704604d006badf0f0747347319025 (patch) | |
tree | 904c468f43c9c818c57bb0f7f17608066172cf29 /src/classes/com/sun/gluegen/FunctionEmitter.java | |
parent | 0747964f0b88d0c9da9c38bf9eff96eb6561f0c1 (diff) |
Fixed more problems related to recent restructuring of glue code
generation to support simultaneous 32- and 64-bit ports. Now uses
size() (on Java side) and sizeof (on C side) when creating direct
Buffers for struct accessors rather than passing MachineDescription
down to JavaMethodBindingEmitter and CMethodBindingEmitter. Now uses
64-bit MachineDescription when sizing outgoing arguments and return
types for bound methods.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@506 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/gluegen/FunctionEmitter.java')
-rw-r--r-- | src/classes/com/sun/gluegen/FunctionEmitter.java | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/classes/com/sun/gluegen/FunctionEmitter.java b/src/classes/com/sun/gluegen/FunctionEmitter.java index 2f52a9f36..3fa6f0341 100644 --- a/src/classes/com/sun/gluegen/FunctionEmitter.java +++ b/src/classes/com/sun/gluegen/FunctionEmitter.java @@ -50,16 +50,14 @@ public abstract class FunctionEmitter private HashSet modifiers = new HashSet(4); private CommentEmitter commentEmitter = null; private PrintWriter defaultOutput; - private MachineDescription defaultMachDesc; /** * Constructs the FunctionEmitter with a CommentEmitter that emits nothing. */ - public FunctionEmitter(PrintWriter defaultOutput, MachineDescription defaultMachDesc) + public FunctionEmitter(PrintWriter defaultOutput) { assert(defaultOutput != null); this.defaultOutput = defaultOutput; - this.defaultMachDesc = defaultMachDesc; } /** @@ -69,13 +67,10 @@ public abstract class FunctionEmitter modifiers = (HashSet) arg.modifiers.clone(); commentEmitter = arg.commentEmitter; defaultOutput = arg.defaultOutput; - defaultMachDesc = arg.defaultMachDesc; } public PrintWriter getDefaultOutput() { return defaultOutput; } - public MachineDescription getDefaultMachineDescription() { return defaultMachDesc; } - public void addModifiers(Iterator/*<EmissionModifier>*/ mi) { while (mi.hasNext()) @@ -99,35 +94,29 @@ public abstract class FunctionEmitter * Emit the function to the specified output (instead of the default * output). */ - public void emit(PrintWriter output, MachineDescription machDesc) + public void emit(PrintWriter output) { emitDocComment(output); //output.println(" // Emitter: " + getClass().getName()); emitSignature(output); - emitBody(output, machDesc); + emitBody(output); } /** * Emit the function to the default output (the output that was passed to * the constructor) */ - public final void emit(MachineDescription machDesc) + public final void emit() { - emit(getDefaultOutput(), machDesc); + emit(getDefaultOutput()); } /** Returns, as a String, whatever {@link #emit} would output. */ public String toString() { - return toString(getDefaultMachineDescription()); - } - - /** Returns, as a String, whatever {@link #emit} would output. */ - public String toString(MachineDescription machDesc) - { StringWriter sw = new StringWriter(500); PrintWriter w = new PrintWriter(sw); - emit(w, machDesc); + emit(w); return sw.toString(); } @@ -207,7 +196,7 @@ public abstract class FunctionEmitter protected abstract void emitName(PrintWriter writer); /** Returns the number of arguments emitted. */ protected abstract int emitArguments(PrintWriter writer); - protected abstract void emitBody(PrintWriter writer, MachineDescription machDesc); + protected abstract void emitBody(PrintWriter writer); public static class EmissionModifier { |