Browse Source

Changes to support GCC 4.6

GCC 4.6 is the oldest release that can compile this code without significant
changes.
pull/2/head
Peter De Wachter 12 years ago
parent
commit
66ea095ede
  1. 2
      README.md
  2. 5
      src/brdecode.cc
  3. 9
      src/job.cc

2
README.md

@ -17,7 +17,7 @@ Requirements
------------
* CUPS: tested with version 1.6.
* A C++11 compiler. A recent version of GCC or Clang will work.
* A C++11 compiler: GCC 4.6 or later, or a recent version of Clang.
Copyright
---------

5
src/brdecode.cc

@ -16,6 +16,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include <algorithm>
#include <exception>
@ -127,9 +128,9 @@ void read_line() {
}
void read_block() {
uint8_t count = get();
unsigned count = get();
count = count * 256 + get();
for (int i = 0; i < count; ++i) {
for (unsigned i = 0; i < count; ++i) {
read_line();
}
}

9
src/job.cc

@ -27,6 +27,9 @@ namespace {
class block {
public:
block(): line_bytes_(0) {
}
void add_line(vector<uint8_t> &&line) {
assert(!line.empty());
line_bytes_ += line.size();
@ -52,11 +55,11 @@ class block {
}
private:
const unsigned max_block_size_ = 16350;
const unsigned max_lines_per_block_ = 128;
static const unsigned max_block_size_ = 16350;
static const unsigned max_lines_per_block_ = 128;
vector<vector<uint8_t>> lines_;
int line_bytes_ = 0;
int line_bytes_;
};
} // namespace

Loading…
Cancel
Save