mirror of https://github.com/tstack/lnav.git
[port] more endianness stuff
This commit is contained in:
parent
5a70e62003
commit
9ff1daf032
|
@ -104,34 +104,34 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
array_t to_array() {
|
||||
array_t to_array()
|
||||
{
|
||||
uint64_t h1;
|
||||
uint64_t h2;
|
||||
array_t retval;
|
||||
|
||||
this->h_context.Final(retval.out(0), retval.out(0));
|
||||
this->h_context.Final(&h1, &h2);
|
||||
*retval.out(0) = SPOOKYHASH_LITTLE_ENDIAN_64(h1);
|
||||
*retval.out(1) = SPOOKYHASH_LITTLE_ENDIAN_64(h2);
|
||||
return retval;
|
||||
}
|
||||
|
||||
void to_string(auto_buffer& buf)
|
||||
{
|
||||
array_t bits;
|
||||
array_t bits = this->to_array();
|
||||
|
||||
this->h_context.Final(bits.out(0), bits.out(1));
|
||||
bits.to_string(std::back_inserter(buf));
|
||||
}
|
||||
|
||||
std::string to_string()
|
||||
{
|
||||
array_t bits;
|
||||
|
||||
this->h_context.Final(bits.out(0), bits.out(1));
|
||||
array_t bits = this->to_array();
|
||||
return bits.to_string();
|
||||
}
|
||||
|
||||
std::string to_uuid_string()
|
||||
{
|
||||
array_t bits;
|
||||
|
||||
this->h_context.Final(bits.out(0), bits.out(1));
|
||||
array_t bits = this->to_array();
|
||||
return bits.to_uuid_string();
|
||||
}
|
||||
|
||||
|
@ -215,10 +215,7 @@ template<typename A>
|
|||
struct final_action { // slightly simplified
|
||||
A act;
|
||||
final_action(A a) : act{a} {}
|
||||
~final_action()
|
||||
{
|
||||
act();
|
||||
}
|
||||
~final_action() { act(); }
|
||||
};
|
||||
|
||||
template<typename A>
|
||||
|
|
|
@ -109,7 +109,7 @@ TEST_CASE("hex-dump")
|
|||
lnav::text_anonymizer ta;
|
||||
|
||||
CHECK(ta.next(string_fragment::from_const("key f2:09:1a:a2"))
|
||||
== "key 2d:20:0d:cc");
|
||||
== "key 68:48:d3:93");
|
||||
}
|
||||
|
||||
TEST_CASE("cc")
|
||||
|
|
Loading…
Reference in New Issue