Skip to content

Commit 25c8a9e

Browse files
Merge branch 'hzeller:master' into master
2 parents c4a766c + e257078 commit 25c8a9e

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

examples-api-use/clock.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <stdlib.h>
1515
#include <string.h>
1616
#include <time.h>
17-
#include <unistd.h>
17+
#include <iostream>
1818

1919
#include <vector>
2020
#include <string>
@@ -193,6 +193,6 @@ int main(int argc, char *argv[]) {
193193
// Finished. Shut down the RGB matrix.
194194
delete matrix;
195195

196-
write(STDOUT_FILENO, "\n", 1); // Create a fresh new line after ^C on screen
196+
std::cout << std::endl; // Create a fresh new line after ^C on screen
197197
return 0;
198198
}

examples-api-use/demo-main.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class ImageScroller : public DemoRunner {
267267
line = ReadLine(f, header_buf, sizeof(header_buf));
268268
if (!line || sscanf(line, "%d ", &value) != 1 || value != 255)
269269
EXIT_WITH_MSG("Only 255 for maxval allowed.");
270-
const size_t pixel_count = new_width * new_height;
270+
const size_t pixel_count = (size_t)new_width * (size_t)new_height;
271271
Pixel *new_image = new Pixel [ pixel_count ];
272272
assert(sizeof(Pixel) == 3); // we make that assumption.
273273
if (fread(new_image, sizeof(Pixel), pixel_count, f) != pixel_count) {

examples-api-use/ledcat.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int main(int argc, char *argv[]) {
4040
signal(SIGTERM, InterruptHandler);
4141
signal(SIGINT, InterruptHandler);
4242

43-
ssize_t frame_size = canvas->width() * canvas->height() * 3;
43+
ssize_t frame_size = (ssize_t)canvas->width() * (ssize_t)canvas->height() * 3;
4444
uint8_t buf[frame_size];
4545

4646
while (1) {

lib/framebuffer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ Framebuffer::Framebuffer(int rows, int columns, int parallel,
296296
inverse_color_(inverse_color),
297297
pwm_bits_(kBitPlanes), do_luminance_correct_(true), brightness_(100),
298298
double_rows_(rows / SUB_PANELS_),
299-
buffer_size_(double_rows_ * columns_ * kBitPlanes * sizeof(gpio_bits_t)),
299+
buffer_size_((size_t)double_rows_ * (size_t)columns_ * kBitPlanes * sizeof(gpio_bits_t)),
300300
shared_mapper_(mapper) {
301301
assert(hardware_mapping_ != NULL); // Called InitHardwareMapping() ?
302302
assert(shared_mapper_ != NULL); // Storage should be provided by RGBMatrix.
@@ -842,7 +842,7 @@ void Framebuffer::DumpToMatrix(GPIO *io, int pwm_low_bit) {
842842
const int start_bit = std::max(pwm_low_bit, kBitPlanes - pwm_bits_);
843843

844844
const uint8_t half_double = double_rows_/2;
845-
for (uint8_t row_loop = 0; row_loop < double_rows_; ++row_loop) {
845+
for (int row_loop = 0; row_loop < double_rows_; ++row_loop) {
846846
uint8_t d_row;
847847
switch (scan_mode_) {
848848
case 0: // progressive

0 commit comments

Comments
 (0)