Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSoC Midterm Evaluation: Changing the way the serialize, serialize_into and deserialize functions work #2345

Open
wants to merge 32 commits into
base: AST-Generation
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
35b82ac
first commit
FaresAtef1 Jun 15, 2023
4d72ef7
Dhruv fixes
FaresAtef1 Jun 22, 2023
139c0a9
Merge branch 'AST-Generation' into GSoC-Part1
FaresAtef1 Jun 22, 2023
1895c11
Better detect_serialization
FaresAtef1 Jun 27, 2023
2efaa6f
Better detect_serialization 2
FaresAtef1 Jun 29, 2023
7cf28b9
enigma_internal_sizeof & detect_size.h
FaresAtef1 Jul 3, 2023
69a30b6
new macro
FaresAtef1 Jul 4, 2023
3dc2a85
adding RET to the macro
FaresAtef1 Jul 4, 2023
7b849d3
test clang
FaresAtef1 Jul 5, 2023
fcff099
enigma_internal_deserialize & byte_size base
FaresAtef1 Jul 7, 2023
c508114
serialize_into
FaresAtef1 Jul 7, 2023
087020d
serialize
FaresAtef1 Jul 7, 2023
791561e
deserialize
FaresAtef1 Jul 7, 2023
7ce89ca
resize_buffer_for
FaresAtef1 Jul 7, 2023
4b2bac0
bug fixes
FaresAtef1 Jul 9, 2023
67e3ce2
SOG test
FaresAtef1 Jul 9, 2023
76fb496
integral & floating types SOG
FaresAtef1 Jul 9, 2023
9929afc
serialization.h better naming & cleaning
FaresAtef1 Jul 10, 2023
21e131f
Serialization directory
FaresAtef1 Jul 10, 2023
c9d40a2
HAS_INTERNAL_SERIALIZE_INTO_FUNCTION
FaresAtef1 Jul 10, 2023
9d03e57
HAS_INTERNAL_SERIALIZE_FUNCTION
FaresAtef1 Jul 10, 2023
dfae483
cleaning
FaresAtef1 Jul 10, 2023
cea578c
HAS_byte_size_FUNCTION
FaresAtef1 Jul 15, 2023
8b2d69f
HAS_internal_deserialize_FUNCTION
FaresAtef1 Jul 15, 2023
12cb1ba
serialization_fwd_decl.h
FaresAtef1 Jul 24, 2023
1ec12df
remove format1
FaresAtef1 Jul 25, 2023
ff96c66
is_fn_available for all
FaresAtef1 Jul 25, 2023
1f128a5
remove formatting2
FaresAtef1 Jul 26, 2023
5375f4a
cleaning
FaresAtef1 Jul 26, 2023
9087a65
clean `serialization.h` & fwd_decl
FaresAtef1 Aug 6, 2023
38393bc
Delete .vscode directory
FaresAtef1 Sep 6, 2023
9dfdae9
Update gcc.ey
FaresAtef1 Sep 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
FaresAtef1 marked this conversation as resolved.
Show resolved Hide resolved
81 changes: 81 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"files.associations": {
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"csetjmp": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"array": "cpp",
"atomic": "cpp",
"hash_set": "cpp",
"strstream": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"chrono": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"complex": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"cstdint": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"numbers": "cpp",
"ostream": "cpp",
"semaphore": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cfenv": "cpp",
"cinttypes": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"valarray": "cpp",
"variant": "cpp",
"*.ipp": "cpp",
"any": "cpp"
},
"C_Cpp.errorSquiggles": "enabled"
}
FaresAtef1 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
show_debug_message("Starting the test");

myInteger = 5;
myfloat = 3.14;
myBoolean = true;

show_debug_message("Starting the saving");
var buf = buffer_create(1, buffer_grow, 1);
game_save_buffer(buf);
buffer_save(buf, "/tmp/test.bin");

myInteger = 0;
myfloat = 1.2;
myBoolean = false;

show_debug_message("Loading the file");
buffer_delete(buf);
buf = buffer_load("/tmp/test.bin");
game_load_buffer(buf);

gtest_assert_eq(int(id.myInteger), 5);
gtest_assert_eq(double(id.myfloat), 3.14);
gtest_assert_eq(bool(id.myBoolean), true);

show_debug_message("Loading successful");

game_end();
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
show_debug_message("Starting the test");

myint8_t = 127;
myint16_t = 32767;
myint32_t = 2147483647;
myint64_t= 2147483647;
myuint8_t= 255;
myuint16_t= 65535;
myuint32_t= 4294967295;
myuint64_t= 4294967295;
mydouble= 1.234567890123456789012345678901234567890123456789012345678901234;

show_debug_message("Starting the saving");
var buf = buffer_create(1, buffer_grow, 1);
game_save_buffer(buf);
buffer_save(buf, "/tmp/test.bin");

myint8_t = -128;
myint16_t = -32768;
myint32_t = -2147483648;
myint64_t= -2147483648;
myuint8_t= 0;
myuint16_t= 0;
myuint32_t= 0;
myuint64_t= 0;
mydouble= -1.234567890123456789012345678901234567890123456789012345678901234;

show_debug_message("Loading the file");
buffer_delete(buf);
buf = buffer_load("/tmp/test.bin");
game_load_buffer(buf);

gtest_assert_eq(int8_t(id.myint8_t), 127);
gtest_assert_eq(int16_t(id.myint16_t), 32767);
gtest_assert_eq(int32_t(id.myint32_t), 2147483647);
gtest_assert_eq(int64_t(id.myint64_t), 2147483647);
gtest_assert_eq(uint8_t(id.myuint8_t), 255);
gtest_assert_eq(uint16_t(id.myuint16_t), 65535);
gtest_assert_eq(uint32_t(id.myuint32_t), 4294967295);
gtest_assert_eq(uint64_t(id.myuint64_t), 4294967295);
gtest_assert_eq(double(id.mydouble), 1.234567890123456789012345678901234567890123456789012345678901234);

show_debug_message("Loading successful");

game_end();
4 changes: 2 additions & 2 deletions CompilerSource/compiler/components/write_defragged_events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int lang_CPP::compile_writeDefraggedEvents(

wto << "#include <vector>\n";
wto << "#include <cstddef>\n";
wto << "#include \"Universal_System/Object_Tiers/serialization.h\"\n";
wto << "#include \"Universal_System/Serialization/serialization.h\"\n";

//Write timeline/moment names. Timelines are like scripts, but we don't have to worry about arguments or return types.
for (size_t i = 0; i < game.timelines.size(); i++) {
Expand Down Expand Up @@ -253,4 +253,4 @@ int lang_CPP::compile_writeDefraggedEvents(
wto.close();

return 0;
}
}
Loading
Loading