Skip to content

Commit 1541544

Browse files
committed
PAGE_SIZE shouldn't be unsigned
Fixes #2559
1 parent ac82fa7 commit 1541544

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1010
### Changed
1111
### Added
1212
### Fixed
13+
* Fix building with gcc (#2559)
1314

1415
3.2.2
1516
==================

src/Canvas.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ Canvas::StreamPDFSync(const Napi::CallbackInfo& info) {
643643
static uint32_t getSafeBufSize(Canvas* canvas) {
644644
// Don't allow the buffer size to exceed the size of the canvas (#674)
645645
// TODO not sure if this is really correct, but it fixed #674
646-
return (std::min)((uint32_t)canvas->getWidth() * canvas->getHeight() * 4, PAGE_SIZE);
646+
return (std::min)((uint32_t)canvas->getWidth() * canvas->getHeight() * 4, (uint32_t)PAGE_SIZE);
647647
}
648648

649649
void

src/closure.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Canvas;
1919
#include <vector>
2020

2121
#ifndef PAGE_SIZE
22-
#define PAGE_SIZE 4096u
22+
#define PAGE_SIZE 4096
2323
#endif
2424

2525
/*

0 commit comments

Comments
 (0)