Commit Graph

9 Commits

Author SHA1 Message Date
Avi Kivity
fcb8d040e8 treewide: use Software Package Data Exchange (SPDX) license identifiers
Instead of lengthy blurbs, switch to single-line, machine-readable
standardized (https://spdx.dev) license identifiers. The Linux kernel
switched long ago, so there is strong precedent.

Three cases are handled: AGPL-only, Apache-only, and dual licensed.
For the latter case, I chose (AGPL-3.0-or-later and Apache-2.0),
reasoning that our changes are extensive enough to apply our license.

The changes we applied mechanically with a script, except to
licenses/README.md.

Closes #9937
2022-01-18 12:15:18 +01:00
Avi Kivity
9059514335 build, treewide: enable -Wpessimizing-move warning
This warning prevents using std::move() where it can hurt
- on an unnamed temporary or a named automatic variable being
returned from a function. In both cases the value could be
constructed directly in its final destination, but std::move()
prevents it.

Fix the handful of cases (all trivial), and enable the warning.

Closes #8992
2021-07-08 17:52:34 +03:00
Avi Kivity
a55b434a2b treewide: extent copyright statements to present day 2021-06-06 19:18:49 +03:00
Avi Kivity
ee980ee32f hashers: convert illegal contraint to static_assert
The constraint on on cryptopp_hasher<>::impl is illegal, since it's not
on the base template. Convert it to a static_assert.

We could have moved it to the base template, but that would have undone
the work to push all the implementation details in .cc and reduce #include
load.

Found by clang.
2020-09-21 16:32:10 +03:00
Avi Kivity
c5312618d0 hashers: relax noexcept requirement from CryptoPP Update() functions
While we need CryptoPP Update() functions not to throw, they aren't
marked noexcept.

Since there is no reason for them to throw, we'll just hope they
don't, and relax the requirement.

Found by clang. Apparently gcc didn't bother to check the constraint
here.
2020-09-21 16:32:10 +03:00
Avi Kivity
22781ab7e3 hashers: add missing typename in Hashers concept
Found by clang. Likely due to clang not implementing p0634r3, not a gcc
bug.
2020-09-21 16:31:40 +03:00
Pavel Emelyanov
5adb8e555c hashers: Mark hash updates noexcept
All those methods end up with library calls, whose code
is not marked noexcept, but is such according to code
itself or docs.

The primary goal is to make some repair partition_hasher
methods noexcept (next patch).

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
2020-09-07 23:17:41 +03:00
Tomasz Grabiec
5c2f5b522d hashers: Rename hasher to cryptopp_hasher
So that we can introduce a truly generic interface named "hasher".
2019-05-10 12:54:08 +02:00
Rafael Ávila de Espíndola
fd5ea2df5a Avoid including cryptopp headers
cryptopp's config.h has the following pragma:

 #pragma GCC diagnostic ignored "-Wunused-function"

It is not wrapped in a push/pop. Because of that, including cryptopp
headers disables that warning on scylla code too.

The issue has been reported as
https://github.com/weidai11/cryptopp/issues/793

To work around it, this patch uses a pimpl to have a single .cc file
that has to include cryptopp headers.

While at it, it also reduces the differences and code duplication
between the md5 and sha1 hashers.

Signed-off-by: Rafael Ávila de Espíndola <espindola@scylladb.com>
2019-02-20 08:03:46 -08:00