aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/bits.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-02-08 15:18:08 +0100
committerJay Berkenbilt <ejb@ql.org>2022-02-08 17:51:15 +0100
commitcb769c62e55599e9f980001830bc61d9fcaa64a9 (patch)
tree0bf980c385a61cbc8720cf990762ffc1200f9d6a /libtests/bits.cc
parent716381f65a2b2dc72f8da2426ba71aeab02c507f (diff)
downloadqpdf-cb769c62e55599e9f980001830bc61d9fcaa64a9.tar.zst
WHITESPACE ONLY -- expand tabs in source code
This comment expands all tabs using an 8-character tab-width. You should ignore this commit when using git blame or use git blame -w. In the early days, I used to use tabs where possible for indentation, since emacs did this automatically. In recent years, I have switched to only using spaces, which means qpdf source code has been a mixture of spaces and tabs. I have avoided cleaning this up because of not wanting gratuitous whitespaces change to cloud the output of git blame, but I changed my mind after discussing with users who view qpdf source code in editors/IDEs that have other tab widths by default and in light of the fact that I am planning to start applying automatic code formatting soon.
Diffstat (limited to 'libtests/bits.cc')
-rw-r--r--libtests/bits.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/libtests/bits.cc b/libtests/bits.cc
index 1dfd42ed..55075f85 100644
--- a/libtests/bits.cc
+++ b/libtests/bits.cc
@@ -15,29 +15,29 @@
static void
print_values(long long byte_offset, size_t bit_offset,
- size_t bits_available)
+ size_t bits_available)
{
std::cout << "byte offset = " << byte_offset << ", "
- << "bit offset = " << bit_offset << ", "
- << "bits available = " << bits_available << std::endl;
+ << "bit offset = " << bit_offset << ", "
+ << "bits available = " << bits_available << std::endl;
}
static void
test_read_bits(unsigned char const* buf,
- unsigned char const*& p, size_t& bit_offset,
- size_t& bits_available, size_t bits_wanted)
+ unsigned char const*& p, size_t& bit_offset,
+ size_t& bits_available, size_t bits_wanted)
{
unsigned long result =
- QIntC::to_ulong(read_bits(p, bit_offset, bits_available, bits_wanted));
+ QIntC::to_ulong(read_bits(p, bit_offset, bits_available, bits_wanted));
std::cout << "bits read: " << bits_wanted << ", result = " << result
- << std::endl;
+ << std::endl;
print_values(p - buf, bit_offset, bits_available);
}
static void
test_write_bits(unsigned char& ch, size_t& bit_offset, unsigned long val,
- size_t bits, Pl_Buffer* bp)
+ size_t bits, Pl_Buffer* bp)
{
write_bits(ch, bit_offset, val, bits, bp);
std::cout << "ch = " << QUtil::uint_to_string_base(ch, 16, 2)
@@ -69,7 +69,7 @@ test()
// Read tests
static unsigned char const buf[] = {
- 0xF5, 0x15, 0x65, 0x79, 0x12, 0x89, 0x75, 0x4B
+ 0xF5, 0x15, 0x65, 0x79, 0x12, 0x89, 0x75, 0x4B
};
unsigned char const* p = buf;
@@ -91,12 +91,12 @@ test()
try
{
- test_read_bits(buf, p, bit_offset, bits_available, 4);
+ test_read_bits(buf, p, bit_offset, bits_available, 4);
}
catch (std::exception& e)
{
- std::cout << "exception: " << e.what() << std::endl;
- print_values(p - buf, bit_offset, bits_available);
+ std::cout << "exception: " << e.what() << std::endl;
+ print_values(p - buf, bit_offset, bits_available);
}
test_read_bits(buf, p, bit_offset, bits_available, 3);
@@ -183,12 +183,12 @@ int main()
{
try
{
- test();
+ test();
}
catch (std::exception& e)
{
- std::cout << "unexpected exception: " << e.what() << std::endl;
- exit(2);
+ std::cout << "unexpected exception: " << e.what() << std::endl;
+ exit(2);
}
std::cout << "done" << std::endl;
return 0;