general updates

This commit is contained in:
2026-07-30 08:46:55 -06:00
parent a23f9f7855
commit 32c21781d9
3 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ namespace ckitty {
: _data(new T[length]), _length(length) {}
array(const T* begin, const T* end)
: _data(new T[end - begin]), _length(end - begin) {
: _data(new T[end - begin]), _length(isize(end - begin)) {
std::copy(begin, end, this->begin());
}
+6 -6
View File
@@ -93,7 +93,7 @@ namespace ckitty {
}
inline data_view view(std::string& str) {
return data_view((const u8*) str.c_str(), str.length());
return data_view(reinterpret_cast<const u8*>(str.c_str()), str.length());
}
inline void copy(buffer& buff, isize& index, const std::string& str) {
@@ -119,8 +119,8 @@ namespace ckitty {
// how many rows chars to use?
double logv = std::log(std::max<isize>(1, view.length()));
double spaces = std::floor((long double) (logv / std::log(16) + 1));
isize rowchars = std::max<isize>(2, spaces) - 1;
double spaces = std::floor(logv / std::log(16) + 1);
isize rowchars = std::max<isize>(2, isize(spaces)) - 1;
// print header
os << prefix << std::string(rowchars, ' ') << " X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 XA XB XC XD XE XF | -------- --------\n";
@@ -143,7 +143,7 @@ namespace ckitty {
// add header
os << prefix;
os << std::hex << std::setfill('0') << std::setw(rowchars) << row << std::dec << "X ";
os << std::hex << std::setfill('0') << std::setw(int(rowchars)) << row << std::dec << "X ";
// print a line of the characters
for(int g = 0; g < 2; g++) {
@@ -167,7 +167,7 @@ namespace ckitty {
}
// add to ascii?
char ch = value;
char ch = char(value);
if(!std::isgraph(ch)) ch = ' ';
ascii += ch;
@@ -199,7 +199,7 @@ namespace ckitty {
}
inline buffer from(const std::string& str) {
return buffer((const u8*) str.begin().base(), (const u8*) str.end().base());
return buffer(reinterpret_cast<const u8*>(str.begin().base()), reinterpret_cast<const u8*>(str.end().base()));
}
}
+2 -2
View File
@@ -23,8 +23,8 @@ namespace ckitty {
: _begin(data), _end(data + length) {}
data_view(const std::string& str)
: _begin((const u8*) str.begin().base()),
_end((const u8*) str.end().base()) {}
: _begin(reinterpret_cast<const u8*>(str.begin().base())),
_end(reinterpret_cast<const u8*>(str.end().base())) {}
const u8* begin() const {
return _begin;