From 23364f5f5d1d269375d0651b0b04862710ed87b7 Mon Sep 17 00:00:00 2001 From: mkoch Date: Tue, 13 May 2003 20:11:02 +0000 Subject: 2003-05-13 Michael Koch * gnu/java/nio/CharViewBufferImpl.java (CharViewBufferImpl): Fixed super constructor call, initialize offset. (get): Shift bits to the right direction. (put): Likewise. * gnu/java/nio/DoubleViewBufferImpl.java (DoubleViewBufferImpl): Fixed super constructor call, initialize offset. (get): Shift bits to the right direction. (put): Likewise. * gnu/java/nio/FloatViewBufferImpl.java (FloatViewBufferImpl): Fixed super constructor call, initialize offset. (get): Shift bits to the right direction. (put): Likewise. * gnu/java/nio/IntViewBufferImpl.java (IntViewBufferImpl): Fixed super constructor call, initialize offset. (get): Shift bits to the right direction. (put): Likewise. * gnu/java/nio/LongViewBufferImpl.java (LongViewBufferImpl): Fixed super constructor call, initialize offset. (get): Shift bits to the right direction. (put): Likewise. * gnu/java/nio/ShortViewBufferImpl.java (ShortViewBufferImpl): Fixed super constructor call, initialize offset. (get): Shift bits to the right direction. (put): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66780 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/gnu/java/nio/IntViewBufferImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'libjava/gnu/java/nio/IntViewBufferImpl.java') diff --git a/libjava/gnu/java/nio/IntViewBufferImpl.java b/libjava/gnu/java/nio/IntViewBufferImpl.java index 0bf5a08247b..d049eb3f55e 100644 --- a/libjava/gnu/java/nio/IntViewBufferImpl.java +++ b/libjava/gnu/java/nio/IntViewBufferImpl.java @@ -62,8 +62,9 @@ class IntViewBufferImpl extends IntBuffer int limit, int position, int mark, boolean readOnly) { - super (limit, limit, offset, position); + super (limit >> 2, limit >> 2, position >> 2, mark >> 2); this.bb = bb; + this.offset = offset; this.readOnly = readOnly; // FIXME: What if this is called from IntViewBufferImpl and ByteBuffer has changed its endianess ? this.endian = bb.order (); @@ -71,25 +72,26 @@ class IntViewBufferImpl extends IntBuffer public int get () { - int result = bb.getInt ((position () >> 2) + offset); + int result = bb.getInt ((position () << 2) + offset); position (position () + 1); return result; } public int get (int index) { - return bb.getInt ((index >> 2) + offset); + return bb.getInt ((index << 2) + offset); } public IntBuffer put (int value) { - bb.putInt ((position () >> 2) + offset, value); + bb.putInt ((position () << 2) + offset, value); + position (position () + 1); return this; } public IntBuffer put (int index, int value) { - bb.putInt ((index >> 2) + offset, value); + bb.putInt ((index << 2) + offset, value); return this; } -- cgit v1.2.3