From aa1b8875364f23b4c39d3c81b592e6325b6fe6c6 Mon Sep 17 00:00:00 2001 From: Chris Vest Date: Thu, 25 Mar 2021 16:49:43 +0100 Subject: [PATCH] Fix offset type for new PlatformDependent.put* methods Motivation: The offsets were accidentally typed as int, where they should have been typed as long. Modification: Change type of offset arguments to PlatformDependent.put*(Object,int,?) from int to long. Result: It is now possible to use these methods to store to memory at absolute memory addresses. --- .../io/netty/util/internal/PlatformDependent.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/io/netty/util/internal/PlatformDependent.java b/common/src/main/java/io/netty/util/internal/PlatformDependent.java index e731023981..7a371ecfc2 100644 --- a/common/src/main/java/io/netty/util/internal/PlatformDependent.java +++ b/common/src/main/java/io/netty/util/internal/PlatformDependent.java @@ -616,27 +616,27 @@ public final class PlatformDependent { PlatformDependent0.putByte(data, offset, value); } - public static void putShort(Object data, int offset, short value) { + public static void putShort(Object data, long offset, short value) { PlatformDependent0.putShort(data, offset, value); } - public static void putChar(Object data, int offset, char value) { + public static void putChar(Object data, long offset, char value) { PlatformDependent0.putChar(data, offset, value); } - public static void putInt(Object data, int offset, int value) { + public static void putInt(Object data, long offset, int value) { PlatformDependent0.putInt(data, offset, value); } - public static void putFloat(Object data, int offset, float value) { + public static void putFloat(Object data, long offset, float value) { PlatformDependent0.putFloat(data, offset, value); } - public static void putLong(Object data, int offset, long value) { + public static void putLong(Object data, long offset, long value) { PlatformDependent0.putLong(data, offset, value); } - public static void putDouble(Object data, int offset, double value) { + public static void putDouble(Object data, long offset, double value) { PlatformDependent0.putDouble(data, offset, value); }