From 5b8f573337f0a3174ec4f16f55b7824cd87005c8 Mon Sep 17 00:00:00 2001 From: Daniel Krebs Date: Tue, 24 Apr 2018 13:12:32 +0200 Subject: [PATCH] json: parse 64bit numbers, this is required for numbers > 2^31 Our current JSON library jansson only parses signed integers, so it cannot correctly parse numbers between 2^31 and 2^32 into a 32 bit type. --- fpga/lib/ip.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fpga/lib/ip.cpp b/fpga/lib/ip.cpp index 63cffdebc..0a21d16e3 100644 --- a/fpga/lib/ip.cpp +++ b/fpga/lib/ip.cpp @@ -223,8 +223,8 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips) json_t* json_block; json_object_foreach(json_instance, block_name, json_block) { - unsigned int base, high, size; - int ret = json_unpack(json_block, "{ s: i, s: i, s: i }", + json_int_t base, high, size; + int ret = json_unpack(json_block, "{ s: I, s: I, s: I }", "baseaddr", &base, "highaddr", &high, "size", &size);