From ec13a58ec3ab349e67d4ed200f36c06c595049c9 Mon Sep 17 00:00:00 2001 From: sanni Date: Tue, 10 Sep 2019 17:38:56 +0200 Subject: [PATCH] Get rid of compiler warning --- Cart_Reader/SMS.ino | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Cart_Reader/SMS.ino b/Cart_Reader/SMS.ino index cd4700e..6234be7 100644 --- a/Cart_Reader/SMS.ino +++ b/Cart_Reader/SMS.ino @@ -152,31 +152,32 @@ void getCartInfo_SMS() { // Rom size switch (readByte_SMS(0x7fff) & 0xFF) { case 0xa: - cartSize = 8 * 1024; + // Adding UL gets rid of integer overflow compiler warning + cartSize = 8 * 1024UL; break; case 0xb: - cartSize = 16 * 1024; + cartSize = 16 * 1024UL; break; case 0xc: - cartSize = 32 * 1024; + cartSize = 32 * 1024UL; break; case 0xd: - cartSize = 48 * 1024; + cartSize = 48 * 1024UL; break; case 0xe: - cartSize = 64 * 1024; + cartSize = 64 * 1024UL; break; case 0xf: - cartSize = 128 * 1024; + cartSize = 128 * 1024UL; break; case 0x0: - cartSize = 256 * 1024; + cartSize = 256 * 1024UL; break; case 0x1: - cartSize = 512 * 1024; + cartSize = 512 * 1024UL; break; case 0x2: - cartSize = 512 * 1024; + cartSize = 512 * 1024UL; break; }