All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/rpi-rgb-led-matrix: fix musl build
@ 2022-01-03 22:07 Fabrice Fontaine
  0 siblings, 0 replies; only message in thread
From: Fabrice Fontaine @ 2022-01-03 22:07 UTC (permalink / raw)
  To: buildroot; +Cc: Grzegorz Blach, Fabrice Fontaine

Fix the following build failure on musl raised since the addition of the
package in commit e821078031e14df69e5142f23e9cb7b5a1ea0e77:

text-scroller.cc: In function 'int main(int, char**)':
text-scroller.cc:220:3: error: 'uint' was not declared in this scope; did you mean 'rint'?
  220 |   uint frame_counter = 0;
      |   ^~~~
      |   rint

Fixes:
 - http://autobuild.buildroot.org/results/1a230bd46eac35081bdb6fe9aaacbb7b62ea6b73

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...-utils-text-scroller.cc-replace-uint.patch | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 package/rpi-rgb-led-matrix/0002-utils-text-scroller.cc-replace-uint.patch

diff --git a/package/rpi-rgb-led-matrix/0002-utils-text-scroller.cc-replace-uint.patch b/package/rpi-rgb-led-matrix/0002-utils-text-scroller.cc-replace-uint.patch
new file mode 100644
index 0000000000..627415bac8
--- /dev/null
+++ b/package/rpi-rgb-led-matrix/0002-utils-text-scroller.cc-replace-uint.patch
@@ -0,0 +1,50 @@
+From a56338db0f003d5236f2ce98c73a591d64a70852 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Mon, 3 Jan 2022 22:57:11 +0100
+Subject: [PATCH] utils/text-scroller.cc: replace uint (#1383)
+
+Replace uint by uint64_t to avoid the following build failure on musl:
+
+text-scroller.cc: In function 'int main(int, char**)':
+text-scroller.cc:220:3: error: 'uint' was not declared in this scope; did you mean 'rint'?
+  220 |   uint frame_counter = 0;
+      |   ^~~~
+      |   rint
+
+Fixes:
+ - http://autobuild.buildroot.org/results/1a230bd46eac35081bdb6fe9aaacbb7b62ea6b73
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Retrieved from:
+https://github.com/hzeller/rpi-rgb-led-matrix/commit/a56338db0f003d5236f2ce98c73a591d64a70852]
+---
+ utils/text-scroller.cc | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/utils/text-scroller.cc b/utils/text-scroller.cc
+index a64ba0c89..28d4f7182 100644
+--- a/utils/text-scroller.cc
++++ b/utils/text-scroller.cc
+@@ -21,6 +21,7 @@
+ #include <getopt.h>
+ #include <math.h>
+ #include <signal.h>
++#include <stdint.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -217,12 +218,12 @@ int main(int argc, char *argv[]) {
+ 
+   struct timespec next_frame = {0, 0};
+ 
+-  uint frame_counter = 0;
++  uint64_t frame_counter = 0;
+   while (!interrupt_received && loops != 0) {
+     ++frame_counter;
+     offscreen_canvas->Fill(bg_color.r, bg_color.g, bg_color.b);
+     const bool draw_on_frame = (blink_on <= 0)
+-      || (frame_counter % (blink_on + blink_off) < (uint)blink_on);
++      || (frame_counter % (blink_on + blink_off) < (uint64_t)blink_on);
+ 
+     if (draw_on_frame) {
+       if (outline_font) {
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-03 22:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03 22:07 [Buildroot] [PATCH 1/1] package/rpi-rgb-led-matrix: fix musl build Fabrice Fontaine

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.