From b7833a738744b9d3d0c1a2bebbd1d85b1ff452b7 Mon Sep 17 00:00:00 2001 From: h3x4n1um Date: Sun, 15 Sep 2019 22:46:59 +0700 Subject: [PATCH] Add 0x40, 0x43 and fix 0x41 bytecode --- README.md | 4 +++- rton-json/CMakeLists.txt | 2 +- rton-json/src/rton2json.cpp | 16 ++++++++++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1a28ce3..663f7fa 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,10 @@ Bytecode | Type | Note `0x27` | 0 | 0 in uint32_t? `0x28` | [uRTON_t](#unsigned-rton-number) | unsigned RTON number `0x29` | [RTON_t](#rton-number) | RTON number -`0x41` | 0.0 | 0 in double +`0x40` | int64_t | int 64 bit +`0x41` | 0 | 0 in int64_t? `0x42` | double | [Double-precision floating-point](https://en.wikipedia.org/wiki/Double-precision_floating-point_format) +`0x43` | 0.0 | 0 in double? `0x44` | [uRTON_t](#unsigned-rton-number) | unsigned RTON number `0x45` | [RTON_t](#rton-number) | RTON number `0x46` | uint64_t | unsigned int 64 bit diff --git a/rton-json/CMakeLists.txt b/rton-json/CMakeLists.txt index 1fb8d7c..b47da15 100644 --- a/rton-json/CMakeLists.txt +++ b/rton-json/CMakeLists.txt @@ -27,7 +27,7 @@ find_package(nlohmann_json 3.7.0 REQUIRED) # semver set(VERSION_MAJOR 2) set(VERSION_MINOR 7) -set(VERSION_PATCH 3) +set(VERSION_PATCH 4) # configure a header file to pass some of the CMake settings # to the source code diff --git a/rton-json/src/rton2json.cpp b/rton-json/src/rton2json.cpp index 9d2aa5e..c047c9e 100644 --- a/rton-json/src/rton2json.cpp +++ b/rton-json/src/rton2json.cpp @@ -173,9 +173,16 @@ json read_RTON_block(){ res.push_back(num); break; } - //0.0??? + //int64_t + case 0x40:{ + int64_t num; + input.read(reinterpret_cast (&num), sizeof num); + res.push_back(num); + break; + } + //0??? case 0x41:{ - res.push_back(0.0); + res.push_back(0); break; } //float64 @@ -185,6 +192,11 @@ json read_RTON_block(){ res.push_back(num); break; } + //0.0??? + case 0x43:{ + res.push_back(0.0); + break; + } //unsigned RTON number??? case 0x44:{ res.push_back(unsigned_RTON_num2int(read_RTON_num()));