mirror of
https://github.com/pdewacht/brlaser
synced 2025-04-07 05:06:45 +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:
parent
d2c108d303
commit
66ea095ede
@ -17,7 +17,7 @@ Requirements
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
* CUPS: tested with version 1.6.
|
* 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
|
Copyright
|
||||||
---------
|
---------
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
@ -127,9 +128,9 @@ void read_line() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void read_block() {
|
void read_block() {
|
||||||
uint8_t count = get();
|
unsigned count = get();
|
||||||
count = count * 256 + get();
|
count = count * 256 + get();
|
||||||
for (int i = 0; i < count; ++i) {
|
for (unsigned i = 0; i < count; ++i) {
|
||||||
read_line();
|
read_line();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,9 @@ namespace {
|
|||||||
|
|
||||||
class block {
|
class block {
|
||||||
public:
|
public:
|
||||||
|
block(): line_bytes_(0) {
|
||||||
|
}
|
||||||
|
|
||||||
void add_line(vector<uint8_t> &&line) {
|
void add_line(vector<uint8_t> &&line) {
|
||||||
assert(!line.empty());
|
assert(!line.empty());
|
||||||
line_bytes_ += line.size();
|
line_bytes_ += line.size();
|
||||||
@ -52,11 +55,11 @@ class block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const unsigned max_block_size_ = 16350;
|
static const unsigned max_block_size_ = 16350;
|
||||||
const unsigned max_lines_per_block_ = 128;
|
static const unsigned max_lines_per_block_ = 128;
|
||||||
|
|
||||||
vector<vector<uint8_t>> lines_;
|
vector<vector<uint8_t>> lines_;
|
||||||
int line_bytes_ = 0;
|
int line_bytes_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
Loading…
x
Reference in New Issue
Block a user