-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
308 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
#include <fstream> | ||
|
||
namespace chai::utils { | ||
|
||
/** | ||
* Writes bytes of data of a given type from a given address to a given output | ||
* stream. | ||
* | ||
* @tparam T type of data. | ||
* @param os output stream. | ||
* @param pdata pointer to data. | ||
*/ | ||
template <typename T> void writeBytes(std::ostream &os, const T *pdata) { | ||
os.write(reinterpret_cast<const char *>(pdata), sizeof(T)); | ||
} | ||
|
||
/** | ||
* Reads bytes of data of a given type from a given output stream. | ||
* | ||
* @tparam T type of data. | ||
* @param is input stream. | ||
* @return | ||
*/ | ||
template <typename T> T readBytes(std::istream &is) { | ||
T data; | ||
is.read(reinterpret_cast<char *>(&data), sizeof(T)); | ||
return data; | ||
} | ||
|
||
} // namespace chai::utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
f885ea3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
1-083ca17e
disappeared frominclude/ChaiVM/interpreter/code-manager/code-manager.hpp
), that's why I closed #63. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.f885ea3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
41-4dc1c56c
disappeared frominclude/frontend/assembler/assembler.hpp
), that's why I closed #71. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.f885ea3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
76-b32f7d66
discovered ininclude/frontend/assembler/assembler.hpp
) and submitted as #90. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.f885ea3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
76-5ab331a4
discovered ininclude/frontend/assembler/assembler.hpp
) and submitted as #91. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.f885ea3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
87-19a57d9f
discovered insrc/ChaiVM/interpreter/code-manager/code-manager.cpp
) and submitted as #92. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.