Commit Graph

4 Commits

Author SHA1 Message Date
Peter Jones
9c64b6278c Make sure MIN() and MAX() are always defined.
Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-16 09:12:48 +01:00
Peter Jones
aedb8470bd Fix up a bunch of our license statements and add SPDX most places
The license statements in our source files were getting to be a giant
mess, and mostly they all just say the same thing.  I've switched most
of it to SPDX labels, but left copyright statements in place (where they
were not obviously incorrect copy-paste jobs that I did...).

If there's some change here you don't think is valid, let me know and
we can fix it up together.

Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-16 09:12:48 +01:00
Peter Jones
0172d43507 Work around some clang-format oddnesses
In the version of clang-format I've got locally[0],
WhitespaceSensitiveMacros seems to only work sometimes.  That means that
if we ever run it on some particular things, it could seriously mess up
a bunch of our debugging output.  That's not great.

In this patch, I've gone ahead and run clang-format on all the macros
that use __LINE__, which are the obvious places this is dangerous, and
then audited the result and fixed anything that's broken (including a
couple of places where it was already broken.)

[0] random:~/devel/github.com/shim/clang-format$ clang-format --version
    clang-format version 11.0.0 (Fedora 11.0.0-2.fc33)

Signed-off-by: Peter Jones <pjones@redhat.com>
2021-01-29 18:24:57 -05:00
Peter Jones
1b382ef850 shim: Rework pause functions and add read_counter()
Signed-off-by: Peter Jones <pjones@redhat.com>
Upstream-commit-id: fc6b0bca84e
2020-07-23 20:52:12 -04:00