Skip to content

Commit

Permalink
Add 0x40, 0x43 and fix 0x41 bytecode
Browse files Browse the repository at this point in the history
  • Loading branch information
h3x4n1um committed Sep 15, 2019
1 parent 11f6696 commit b7833a7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rton-json/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 14 additions & 2 deletions rton-json/src/rton2json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <char*> (&num), sizeof num);
res.push_back(num);
break;
}
//0???
case 0x41:{
res.push_back(0.0);
res.push_back(0);
break;
}
//float64
Expand All @@ -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()));
Expand Down

0 comments on commit b7833a7

Please sign in to comment.