From e51dea0b6e34c2959b3b0f4a5db6b11d4b619960 Mon Sep 17 00:00:00 2001 From: Alexey Gavrilov Date: Wed, 27 Mar 2024 19:49:10 +0700 Subject: Some updates: rename memAddr, define architecture --- include/StringOperations.cpp | 6 +++--- include/StringOperations.h | 10 +++++----- include/arch | 6 ++++++ include/types.h | 17 ++++++++++++++--- 4 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 include/arch (limited to 'include') diff --git a/include/StringOperations.cpp b/include/StringOperations.cpp index 01e7a76..055892e 100644 --- a/include/StringOperations.cpp +++ b/include/StringOperations.cpp @@ -6,7 +6,7 @@ MemArea::MemArea() start = final = NULL; }; -MemArea::MemArea(const memAddr start, const memAddr final) +MemArea::MemArea(const uintptr start, const uintptr final) { this->start = start; this->final = final; @@ -17,12 +17,12 @@ MemArea::MemArea(const memAddr start, const memAddr final) } }; -memAddr MemArea::begin() +uintptr MemArea::begin() { return start; } -memAddr MemArea::end() +uintptr MemArea::end() { if(start == final) return start; else return final + 1; diff --git a/include/StringOperations.h b/include/StringOperations.h index 81d7144..5d2826c 100644 --- a/include/StringOperations.h +++ b/include/StringOperations.h @@ -7,15 +7,15 @@ class MemArea { private: - memAddr start, final; + uintptr start, final; public: MemArea(); - MemArea(const memAddr start, const memAddr final); - memAddr begin(); - memAddr end(); + MemArea(const uintptr start, const uintptr final); + uintptr begin(); + uintptr end(); bool valid(); - typedef memAddr iterator; + typedef uintptr iterator; }; class StringOperations diff --git a/include/arch b/include/arch new file mode 100644 index 0000000..f5fc8f7 --- /dev/null +++ b/include/arch @@ -0,0 +1,6 @@ +#ifndef ARCH_H +#define ARCH_H + +#define __IAPC + +#endif diff --git a/include/types.h b/include/types.h index e578adb..f7c0eb6 100644 --- a/include/types.h +++ b/include/types.h @@ -1,13 +1,24 @@ -#define NULL 0 +#ifndef TYPES_H +#define TYPES_H + +#include +#define NULL 0 + +#if defined(__IAPC) typedef unsigned char uint8; typedef unsigned short int uint16; typedef unsigned long uint32; typedef unsigned long long uint64; #if defined(__x86_64) - typedef uint64 memAddr; + typedef uint64 uintptr; #else - typedef uint32 memAddr; + typedef uint32 uintptr; +#endif +#else + #error IA-PC only support +#endif + #endif -- cgit v1.2.3