1
0
mirror of https://github.com/pdewacht/brlaser synced 2025-04-05 12:36:43 +02:00

Changes to support GCC 4.6

GCC 4.6 is the oldest release that can compile this code without significant
changes.
This commit is contained in:
Peter De Wachter 2014-01-26 15:07:53 +01:00
parent d2c108d303
commit 66ea095ede
3 changed files with 10 additions and 6 deletions

View File

@ -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
---------

View File

@ -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();
}
}

View File

@ -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