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:
parent
bf734c1f73
commit
3c07f96d34
@ -80,7 +80,7 @@ struct cruft::coord::store< \
|
|||||||
> \
|
> \
|
||||||
> { \
|
> { \
|
||||||
union { \
|
union { \
|
||||||
std::array<T,VA_ARGS_COUNT(__VA_ARGS__)> data; \
|
T data[VA_ARGS_COUNT(__VA_ARGS__)]; \
|
||||||
struct { T __VA_ARGS__; }; \
|
struct { T __VA_ARGS__; }; \
|
||||||
}; \
|
}; \
|
||||||
};
|
};
|
||||||
@ -104,7 +104,7 @@ DEFINE_STORE(vector, x, y, z, w)
|
|||||||
namespace cruft::coord {
|
namespace cruft::coord {
|
||||||
template <size_t S, typename T, typename SelfT>
|
template <size_t S, typename T, typename SelfT>
|
||||||
struct store {
|
struct store {
|
||||||
std::array<T,S> data;
|
T data[S];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,11 +4,13 @@ import struct
|
|||||||
|
|
||||||
|
|
||||||
class CoordPrinter(object):
|
class CoordPrinter(object):
|
||||||
def __init__(self, val):
|
val: gdb.Value
|
||||||
|
|
||||||
|
def __init__(self, val: gdb.Value):
|
||||||
self.val = val
|
self.val = val
|
||||||
|
|
||||||
def to_string(self) -> str:
|
def to_string(self) -> str:
|
||||||
return self.val
|
return self.val['data']
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def display_hint() -> str:
|
def display_hint() -> str:
|
||||||
@ -23,7 +25,7 @@ class CoordPrinter(object):
|
|||||||
|
|
||||||
|
|
||||||
class ViewPrinter(object):
|
class ViewPrinter(object):
|
||||||
def __init__(self, val):
|
def __init__(self, val: gdb.Value):
|
||||||
self.val = val
|
self.val = val
|
||||||
|
|
||||||
def to_string(self) -> str:
|
def to_string(self) -> str:
|
||||||
|
Loading…
Reference in New Issue
Block a user