coord/store: prefer raw arrays to std::array

We don't really gain anything by using std::array and it greatly
simplifies fucking about with GDB pretty printers.
This commit is contained in:
Danny Robson 2019-03-06 17:09:26 +11:00
parent bf734c1f73
commit 3c07f96d34
2 changed files with 7 additions and 5 deletions

View File

@ -80,7 +80,7 @@ struct cruft::coord::store< \
> \
> { \
union { \
std::array<T,VA_ARGS_COUNT(__VA_ARGS__)> data; \
T data[VA_ARGS_COUNT(__VA_ARGS__)]; \
struct { T __VA_ARGS__; }; \
}; \
};
@ -104,7 +104,7 @@ DEFINE_STORE(vector, x, y, z, w)
namespace cruft::coord {
template <size_t S, typename T, typename SelfT>
struct store {
std::array<T,S> data;
T data[S];
};
}

View File

@ -4,11 +4,13 @@ import struct
class CoordPrinter(object):
def __init__(self, val):
val: gdb.Value
def __init__(self, val: gdb.Value):
self.val = val
def to_string(self) -> str:
return self.val
return self.val['data']
@staticmethod
def display_hint() -> str:
@ -23,7 +25,7 @@ class CoordPrinter(object):
class ViewPrinter(object):
def __init__(self, val):
def __init__(self, val: gdb.Value):
self.val = val
def to_string(self) -> str: