aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-03-07 23:55:11 +0100
committerJay Berkenbilt <ejb@ql.org>2022-03-08 00:01:27 +0100
commitf0307891048688780525c1f43a4a04ccf788ffb3 (patch)
tree9b687cfb36bafd18e20ac468b27ea795aab93c79
parent17c0e38c8efa7882f8e6a13c6030edf3e768257c (diff)
downloadqpdf-f0307891048688780525c1f43a4a04ccf788ffb3.tar.zst
Rename bits_include.cc to qpdf/bits_functions.hh
It's better to just make it a .hh file to reduce confusion.
-rw-r--r--libqpdf/BitStream.cc4
-rw-r--r--libqpdf/BitWriter.cc4
-rw-r--r--libqpdf/qpdf/bits_functions.hh (renamed from libqpdf/bits_include.cc)22
-rw-r--r--libtests/bits.cc4
-rw-r--r--libtests/build.mk2
5 files changed, 17 insertions, 19 deletions
diff --git a/libqpdf/BitStream.cc b/libqpdf/BitStream.cc
index 3b8e7022..d0e991df 100644
--- a/libqpdf/BitStream.cc
+++ b/libqpdf/BitStream.cc
@@ -2,9 +2,9 @@
#include <qpdf/QIntC.hh>
-// See comments in bits_include.cc
+// See comments in bits_functions.hh
#define BITS_READ 1
-#include "bits_include.cc"
+#include <qpdf/bits_functions.hh>
BitStream::BitStream(unsigned char const* p, size_t nbytes) :
start(p),
diff --git a/libqpdf/BitWriter.cc b/libqpdf/BitWriter.cc
index 81c47db8..9d324734 100644
--- a/libqpdf/BitWriter.cc
+++ b/libqpdf/BitWriter.cc
@@ -1,8 +1,8 @@
#include <qpdf/BitWriter.hh>
-// See comments in bits_include.cc
+// See comments in bits_functions.hh
#define BITS_WRITE 1
-#include "bits_include.cc"
+#include <qpdf/bits_functions.hh>
BitWriter::BitWriter(Pipeline* pl) :
pl(pl),
diff --git a/libqpdf/bits_include.cc b/libqpdf/qpdf/bits_functions.hh
index 0f52b4e7..c00a0bcb 100644
--- a/libqpdf/bits_include.cc
+++ b/libqpdf/qpdf/bits_functions.hh
@@ -1,7 +1,5 @@
-// This file is #included in other source files.
-
-#ifndef __BITS_CC__
-#define __BITS_CC__
+#ifndef __BITS_FUNCTIONS_HH__
+#define __BITS_FUNCTIONS_HH__
#include <algorithm>
#include <stdexcept>
@@ -9,12 +7,13 @@
#include <qpdf/Pipeline.hh>
#include <qpdf/QUtil.hh>
-// These functions may be run at places where the function call
-// overhead from test coverage testing would be too high. Therefore,
-// we make the test coverage cases conditional upon a preprocessor
-// symbol. BitStream.cc includes this file without defining the
-// symbol, and the specially designed test code that fully exercises
-// this code includes with the symbol defined.
+// This file is #included by specific source files, which must define
+// certain preprocessor symbols. These functions may be run at places
+// where the function call overhead from test coverage testing would
+// be too high. Therefore, we make the test coverage cases conditional
+// upon a preprocessor symbol. Library code includes this file without
+// BITS_TESTING, and the specially designed test code that fully
+// exercises this code includes with the symbol defined.
#ifdef BITS_READ
static unsigned long long
@@ -151,5 +150,4 @@ write_bits(unsigned char& ch, size_t& bit_offset,
}
#endif
-
-#endif // __BITS_CC__
+#endif // __BITS_FUNCTIONS_HH__
diff --git a/libtests/bits.cc b/libtests/bits.cc
index 81b44566..2c3dc349 100644
--- a/libtests/bits.cc
+++ b/libtests/bits.cc
@@ -7,11 +7,11 @@
#include <stdio.h>
#include <stdlib.h>
-// See comments in bits_include.cc
+// See comments in bits_functions.hh
#define BITS_TESTING 1
#define BITS_READ 1
#define BITS_WRITE 1
-#include "../libqpdf/bits_include.cc"
+#include <qpdf/bits_functions.hh>
static void
print_values(long long byte_offset, size_t bit_offset,
diff --git a/libtests/build.mk b/libtests/build.mk
index 0b9f6fae..6d3371f1 100644
--- a/libtests/build.mk
+++ b/libtests/build.mk
@@ -38,7 +38,7 @@ $(TARGETS_libtests): $(TARGETS_libqpdf) $(TARGETS_qpdf)
INCLUDES_libtests = include libqpdf
-TC_SRCS_libtests = $(wildcard libqpdf/*.cc) $(wildcard libtests/*.cc)
+TC_SRCS_libtests = $(wildcard libqpdf/*.cc) $(wildcard libtests/*.cc) libqpdf/qpdf/bits_functions.hh
# -----