From 783acb9b724065e8fdc7489ac7a9bd9eec4d52dd Mon Sep 17 00:00:00 2001 From: David Vo Date: Tue, 2 Jan 2024 18:38:02 +1100 Subject: [PATCH] [wpilibj] Store long preferences as integers (#6136) --- .../src/main/java/edu/wpi/first/wpilibj/Preferences.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Preferences.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Preferences.java index 087c156602..69d0fb32e7 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/Preferences.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/Preferences.java @@ -230,7 +230,7 @@ public final class Preferences { */ public static void setLong(String key, long value) { NetworkTableEntry entry = m_table.getEntry(key); - entry.setDouble(value); + entry.setInteger(value); entry.setPersistent(); } @@ -242,7 +242,7 @@ public final class Preferences { */ public static void initLong(String key, long value) { NetworkTableEntry entry = m_table.getEntry(key); - entry.setDefaultDouble(value); + entry.setDefaultInteger(value); entry.setPersistent(); } @@ -345,6 +345,6 @@ public final class Preferences { * @return either the value in the table, or the backup */ public static long getLong(String key, long backup) { - return (long) m_table.getEntry(key).getDouble(backup); + return m_table.getEntry(key).getInteger(backup); } }