2003-05-13 Michael Koch <konqueror@gmx.de>
authorMichael Koch <konqueror@gmx.de>
Tue, 13 May 2003 20:11:02 +0000 (20:11 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Tue, 13 May 2003 20:11:02 +0000 (20:11 +0000)
* 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.

From-SVN: r66780

libjava/ChangeLog
libjava/gnu/java/nio/CharViewBufferImpl.java
libjava/gnu/java/nio/DoubleViewBufferImpl.java
libjava/gnu/java/nio/FloatViewBufferImpl.java
libjava/gnu/java/nio/IntViewBufferImpl.java
libjava/gnu/java/nio/LongViewBufferImpl.java
libjava/gnu/java/nio/ShortViewBufferImpl.java

index adb3af4040220e1cfb32b90e371e0f787fe5f0c0..1135ea7995b8936c304e94b8d22e615a609f4883 100644 (file)
@@ -1,3 +1,30 @@
+2003-05-13  Michael Koch  <konqueror@gmx.de>
+
+       * 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.
+
 2003-05-13  Michael Koch  <konqueror@gmx.de>
 
        * gnu/java/nio/natDirectByteBufferImpl.cc
index 62c8fdd9dc9d8030f93f988b80c2760609644706..7280de50904a25487adff76b794b1f0052cb461f 100644 (file)
@@ -62,8 +62,9 @@ class CharViewBufferImpl extends CharBuffer
                                int limit, int position, int mark,
                                boolean readOnly)
   {
-    super (limit, limit, offset, position);
+    super (limit >> 1, limit >> 1, position >> 1, mark >> 1);
     this.bb = bb;
+    this.offset = offset;
     this.readOnly = readOnly;
     // FIXME: What if this is called from CharViewBufferImpl and ByteBuffer has changed its endianess ?
     this.endian = bb.order ();
@@ -71,25 +72,26 @@ class CharViewBufferImpl extends CharBuffer
 
   public char get ()
   {
-    char result = bb.getChar ((position () >> 1) + offset);
+    char result = bb.getChar ((position () << 1) + offset);
     position (position () + 1);
     return result;
   }
 
   public char get (int index)
   {
-    return bb.getChar ((index >> 1) + offset);
+    return bb.getChar ((index << 1) + offset);
   }
 
   public CharBuffer put (char value)
   {
-    bb.putChar ((position () >> 1) + offset, value);
+    bb.putChar ((position () << 1) + offset, value);
+    position (position () + 1);
     return this;
   }
   
   public CharBuffer put (int index, char value)
   {
-    bb.putChar ((index >> 1) + offset, value);
+    bb.putChar ((index << 1) + offset, value);
     return this;
   }
 
index d34e88661241f1e5f719dfe9362c33f7df088f93..d9e1b1b6179db737f224e84de16e0819b4713bc6 100644 (file)
@@ -62,8 +62,9 @@ class DoubleViewBufferImpl extends DoubleBuffer
                                int limit, int position, int mark,
                                boolean readOnly)
   {
-    super (limit, limit, offset, position);
+    super (limit >> 3, limit >> 3, position >> 3, mark >> 3);
     this.bb = bb;
+    this.offset = offset;
     this.readOnly = readOnly;
     // FIXME: What if this is called from DoubleViewBufferImpl and ByteBuffer has changed its endianess ?
     this.endian = bb.order ();
@@ -71,25 +72,26 @@ class DoubleViewBufferImpl extends DoubleBuffer
 
   public double get ()
   {
-    double result = bb.getDouble ((position () >> 3) + offset);
+    double result = bb.getDouble ((position () << 3) + offset);
     position (position () + 1);
     return result;
   }
 
   public double get (int index)
   {
-    return bb.getDouble ((index >> 3) + offset);
+    return bb.getDouble ((index << 3) + offset);
   }
 
   public DoubleBuffer put (double value)
   {
-    bb.putDouble ((position () >> 3) + offset, value);
+    bb.putDouble ((position () << 3) + offset, value);
+    position (position () + 1);
     return this;
   }
   
   public DoubleBuffer put (int index, double value)
   {
-    bb.putDouble ((index >> 3) + offset, value);
+    bb.putDouble ((index << 3) + offset, value);
     return this;
   }
 
index 78299f97307fb79c86085519d8110000b328dc2d..946120341a83d1aa3df2afece53428f64cc263da 100644 (file)
@@ -62,8 +62,9 @@ class FloatViewBufferImpl extends FloatBuffer
                                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 FloatViewBufferImpl and ByteBuffer has changed its endianess ?
     this.endian = bb.order ();
@@ -71,25 +72,26 @@ class FloatViewBufferImpl extends FloatBuffer
 
   public float get ()
   {
-    float result = bb.getFloat ((position () >> 2) + offset);
+    float result = bb.getFloat ((position () << 2) + offset);
     position (position () + 1);
     return result;
   }
 
   public float get (int index)
   {
-    return bb.getFloat ((index >> 2) + offset);
+    return bb.getFloat ((index << 2) + offset);
   }
 
   public FloatBuffer put (float value)
   {
-    bb.putFloat ((position () >> 2) + offset, value);
+    bb.putFloat ((position () << 2) + offset, value);
+    position (position () + 1);
     return this;
   }
   
   public FloatBuffer put (int index, float value)
   {
-    bb.putFloat ((index >> 2) + offset, value);
+    bb.putFloat ((index << 2) + offset, value);
     return this;
   }
 
index 0bf5a08247b73db0f4a46ecb97f753c12f4c9d25..d049eb3f55e1c60e69ecee0e6058a0a7525552b4 100644 (file)
@@ -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;
   }
 
index 2311fee5945cffe71e844d3c4f7049051d20ef27..3742fca1d0b6460a2ac87ef84b1d662cbc8c0a35 100644 (file)
@@ -62,8 +62,9 @@ class LongViewBufferImpl extends LongBuffer
                                int limit, int position, int mark,
                                boolean readOnly)
   {
-    super (limit, limit, offset, position);
+    super (limit >> 3, limit >> 3, position >> 3, mark >> 3);
     this.bb = bb;
+    this.offset = offset;
     this.readOnly = readOnly;
     // FIXME: What if this is called from LongViewBufferImpl and ByteBuffer has changed its endianess ?
     this.endian = bb.order ();
@@ -71,25 +72,26 @@ class LongViewBufferImpl extends LongBuffer
 
   public long get ()
   {
-    long result = bb.getLong ((position () >> 3) + offset);
+    long result = bb.getLong ((position () << 3) + offset);
     position (position () + 1);
     return result;
   }
 
   public long get (int index)
   {
-    return bb.getLong ((index >> 3) + offset);
+    return bb.getLong ((index << 3) + offset);
   }
 
   public LongBuffer put (long value)
   {
-    bb.putLong ((position () >> 3) + offset, value);
+    bb.putLong ((position () << 3) + offset, value);
+    position (position () + 1);
     return this;
   }
   
   public LongBuffer put (int index, long value)
   {
-    bb.putLong ((index >> 3) + offset, value);
+    bb.putLong ((index << 3) + offset, value);
     return this;
   }
 
index 91cbff7b0fb53ffdcd5219ad13d295bf5d9ad75e..e7853bcfeb6e18514bdcfcc2667e9ebe6a73a543 100644 (file)
@@ -62,8 +62,9 @@ class ShortViewBufferImpl extends ShortBuffer
                                int limit, int position, int mark,
                                boolean readOnly)
   {
-    super (limit, limit, offset, position);
+    super (limit >> 1, limit >> 1, position >> 1, mark >> 1);
     this.bb = bb;
+    this.offset = offset;
     this.readOnly = readOnly;
     // FIXME: What if this is called from ShortViewBufferImpl and ByteBuffer has changed its endianess ?
     this.endian = bb.order ();
@@ -71,25 +72,26 @@ class ShortViewBufferImpl extends ShortBuffer
 
   public short get ()
   {
-    short result = bb.getShort ((position () >> 1) + offset);
+    short result = bb.getShort ((position () << 1) + offset);
     position (position () + 1);
     return result;
   }
 
   public short get (int index)
   {
-    return bb.getShort ((index >> 1) + offset);
+    return bb.getShort ((index << 1) + offset);
   }
 
   public ShortBuffer put (short value)
   {
-    bb.putShort ((position () >> 1) + offset, value);
+    bb.putShort ((position () << 1) + offset, value);
+    position (position () + 1);
     return this;
   }
   
   public ShortBuffer put (int index, short value)
   {
-    bb.putShort ((index >> 1) + offset, value);
+    bb.putShort ((index << 1) + offset, value);
     return this;
   }