From b18347ffc9db9641e215995edea1c04c363b2bdf Mon Sep 17 00:00:00 2001 From: Angelo Rossi Date: Wed, 21 Jun 2023 12:04:16 +0000 Subject: Initial commit. --- sources/location.cpp | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/location.cpp (limited to 'sources/location.cpp') diff --git a/sources/location.cpp b/sources/location.cpp new file mode 100644 index 0000000..3d13e38 --- /dev/null +++ b/sources/location.cpp @@ -0,0 +1,65 @@ +//-*- mode: c++; indent-tabs-mode: t; coding: utf-8; show-trailing-whitespace: t -*- + +// file location.cpp + +#include "location.hpp" + +namespace location { + + std::vector sLocate = std::vector ({ + reinterpret_cast(&blkcom::sBus1), + reinterpret_cast(&blkcom::sBus2), + reinterpret_cast(&blkcom::sBus3), + reinterpret_cast(&blkcom::sBus4), + reinterpret_cast(&blkcom::sBus5), + reinterpret_cast(&blkcom::sBus6), + reinterpret_cast(&blkcom::sTrash), + reinterpret_cast(&blkcom::sBlank), + reinterpret_cast(&blkcom::sTerra), + reinterpret_cast(&blkcom::sUserID), + reinterpret_cast(&blkcom::sBranch), + reinterpret_cast(&blkcom::sChCopy), + reinterpret_cast(&blkcom::cCSepar), + reinterpret_cast(&blkcom::sChCont), + reinterpret_cast(&blkcom::sTexCol), + reinterpret_cast(&blkcom::pTextA6[ 0 ]), + reinterpret_cast(&blkcom::pDate1[ 0 ]), + reinterpret_cast(&blkcom::pTClock[ 0 ]), + // To be continued + }); + + void locatn(void) + { + // + } + + // + + template <> size_t index(char *a) + { + return ((size_t) &a[ 0 ] / sizeof(char)); + } + + template <> size_t index(int *a) + { + return ((size_t) &a[ 0 ] / sizeof(int)); + } + + template <> size_t index(long int *a) + { + return ((size_t) &a[ 0 ] / sizeof(long int)); + } + + template <> size_t index(double *a) + { + return ((size_t) &a[ 0 ] / sizeof(double)); + } + + template <> size_t index(std::string *a) + { + return index((char *) a -> c_str()); + } + +} + +// end of file location.cpp -- cgit v1.2.3