Added Error type.
This commit is contained in:
@@ -20,6 +20,8 @@ typedef unsigned uint_t;
|
|||||||
typedef long long int64_t;
|
typedef long long int64_t;
|
||||||
typedef unsigned long long uint64_t;
|
typedef unsigned long long uint64_t;
|
||||||
|
|
||||||
|
typedef uint32_t Error;
|
||||||
|
|
||||||
#ifdef _LP64
|
#ifdef _LP64
|
||||||
typedef uint64_t size_t;
|
typedef uint64_t size_t;
|
||||||
#elif _LP32
|
#elif _LP32
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ void MemFs::Record::setData(uint8_t *data, int size) {
|
|||||||
|
|
||||||
// MemFs
|
// MemFs
|
||||||
|
|
||||||
MemFs::MemFs(uint8_t *begin, uint8_t *end, uint32_t *error): m_version(*((uint32_t*) begin)), m_lastRec(*(MemFsPtr*) (begin + sizeof(m_version))) {
|
MemFs::MemFs(uint8_t *begin, uint8_t *end, Error *error): m_version(*((uint32_t*) begin)), m_lastRec(*(MemFsPtr*) (begin + sizeof(m_version))) {
|
||||||
if (error) {
|
if (error) {
|
||||||
if (version != m_version) {
|
if (version != m_version) {
|
||||||
// version mismatch
|
// version mismatch
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class MemFs {
|
|||||||
* @param end pointer to the end of this MemFs's memory chunk
|
* @param end pointer to the end of this MemFs's memory chunk
|
||||||
* @param error pointer to a integer return errors into
|
* @param error pointer to a integer return errors into
|
||||||
*/
|
*/
|
||||||
MemFs(uint8_t *begin, uint8_t *end, uint32_t *error = nullptr);
|
MemFs(uint8_t *begin, uint8_t *end, Error *error = nullptr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the memory chunk of this MemFs was given.
|
* Initializes the memory chunk of this MemFs was given.
|
||||||
|
|||||||
Reference in New Issue
Block a user