aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/BitWriter.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-04-02 23:14:10 +0200
committerJay Berkenbilt <ejb@ql.org>2022-04-04 14:10:40 +0200
commit12f1eb15ca3fed6310402847559a7c99d3c77847 (patch)
tree8935675b623c6f3b4914b8b44f7fa5f2816a9241 /libqpdf/BitWriter.cc
parentf20fa61eb4c323eb1642c69c236b3d9a1f8b2cdb (diff)
downloadqpdf-12f1eb15ca3fed6310402847559a7c99d3c77847.tar.zst
Programmatically apply new formatting to code
Run this: for i in **/*.cc **/*.c **/*.h **/*.hh; do clang-format < $i >| $i.new && mv $i.new $i done
Diffstat (limited to 'libqpdf/BitWriter.cc')
-rw-r--r--libqpdf/BitWriter.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/libqpdf/BitWriter.cc b/libqpdf/BitWriter.cc
index 9d324734..25585924 100644
--- a/libqpdf/BitWriter.cc
+++ b/libqpdf/BitWriter.cc
@@ -21,12 +21,9 @@ void
BitWriter::writeBitsSigned(long long val, size_t bits)
{
unsigned long long uval = 0;
- if (val < 0)
- {
+ if (val < 0) {
uval = (1ULL << bits) + static_cast<unsigned long long>(val);
- }
- else
- {
+ } else {
uval = static_cast<unsigned long long>(val);
}
writeBits(uval, bits);
@@ -41,8 +38,7 @@ BitWriter::writeBitsInt(int val, size_t bits)
void
BitWriter::flush()
{
- if (bit_offset < 7)
- {
+ if (bit_offset < 7) {
size_t bits_to_write = bit_offset + 1;
write_bits(this->ch, this->bit_offset, 0, bits_to_write, this->pl);
}