summaryrefslogtreecommitdiffstats
path: root/meta/recipes-sato/puzzles
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-sato/puzzles')
-rw-r--r--meta/recipes-sato/puzzles/files/0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch32
-rw-r--r--meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch49
-rw-r--r--meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch42
-rw-r--r--meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch68
-rw-r--r--meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch34
-rw-r--r--meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch44
-rw-r--r--meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch25
-rw-r--r--meta/recipes-sato/puzzles/puzzles_git.bb52
8 files changed, 9 insertions, 337 deletions
diff --git a/meta/recipes-sato/puzzles/files/0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch b/meta/recipes-sato/puzzles/files/0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch
deleted file mode 100644
index d40a3b1ef9..0000000000
--- a/meta/recipes-sato/puzzles/files/0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1From 337799e40350b3db2441cc98f65ec36a74dfb356 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 21 Apr 2017 12:18:08 -0700
4Subject: [PATCH] Use -Wno-error=format-overflow= if the compiler supports it
5
6we need this warning to be suppressed with gcc7+
7however older compilers dont support it so we need
8a way to disble it only if compiler supports it
9
10Upstream-Status: Pending
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 configure.ac | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/configure.ac b/configure.ac
18index 3a38c95..bb9035e 100644
19--- a/configure.ac
20+++ b/configure.ac
21@@ -42,7 +42,7 @@ fi
22 if test "x$GCC" = "xyes"; then
23 AC_MSG_CHECKING([for usable gcc warning flags])
24 gccwarningflags=
25- for flag in -Wall -Werror -std=c89 -pedantic; do
26+ for flag in -Wall -Werror -std=c89 -pedantic -Wno-error=format-overflow=; do
27 ac_save_CFLAGS="$CFLAGS"
28 ac_save_LIBS="$LIBS"
29 CFLAGS="$CFLAGS$gccwarningflags $flag $GTK_CFLAGS"
30--
312.12.2
32
diff --git a/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch b/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch
deleted file mode 100644
index 66af6afa2f..0000000000
--- a/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1From 1c01a5bc9ac7f8aaa484b1a8e0e74aa5f8899d0e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 8 Nov 2020 11:17:59 -0800
4Subject: [PATCH] malloc: Check for excessive values to malloc
5
6with whole program optimizers like lto smalloc()
7is inlined the excessive constant argument is propagated to
8malloc() and ultimately triggers the warning.
9
10malloc.c:15:9: error: argument 1 range [18446744065119617024, 18446744073709551580] exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
11
12therefore add a check before excessive constant argument before calling
13malloc
14
15Note that this will not happen with normal compile since they happen to
16be in different translation units and compiler can not semantically
17analyze as much
18
19Upstream-Status: Pending
20
21Signed-off-by: Khem Raj <raj.khem@gmail.com>
22---
23 malloc.c | 3 +++
24 1 file changed, 3 insertions(+)
25
26diff --git a/malloc.c b/malloc.c
27index a7fa7c5..520377c 100644
28--- a/malloc.c
29+++ b/malloc.c
30@@ -2,6 +2,7 @@
31 * malloc.c: safe wrappers around malloc, realloc, free, strdup
32 */
33
34+#include <stdint.h>
35 #include <stdlib.h>
36 #include <string.h>
37 #include "puzzles.h"
38@@ -12,6 +13,8 @@
39 */
40 void *smalloc(size_t size) {
41 void *p;
42+ if (size > PTRDIFF_MAX)
43+ fatal("exceeds maximum object size");
44 p = malloc(size);
45 if (!p)
46 fatal("out of memory");
47--
482.29.2
49
diff --git a/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch b/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch
deleted file mode 100644
index a02d8732ab..0000000000
--- a/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1From 3d78d4cffcdc1242892b6c21c26d1c96938c48d1 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 27 Feb 2021 10:02:43 -0800
4Subject: [PATCH] map: Fix stringop-overflow warning
5
6Fixes
7
8../git/map.c: In function 'new_game_desc':
9../git/map.c:1663:23: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
10 1663 | ret[retlen++] = ',';
11 | ~~~~~~~~~~~~~~^~~~~
12../git/./map.c: In function 'new_game_desc':
13../git/./map.c:1663:23: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
14 1663 | ret[retlen++] = ',';
15 | ~~~~~~~~~~~~~~^~~~~
16
17Upstream-Status: Pending
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19---
20 map.c | 6 ++++--
21 1 file changed, 4 insertions(+), 2 deletions(-)
22
23diff --git a/map.c b/map.c
24index 412305c..fa0c493 100644
25--- a/map.c
26+++ b/map.c
27@@ -1659,8 +1659,10 @@ static char *new_game_desc(const game_params *params, random_state *rs,
28 }
29 }
30
31- ret[retlen++] = 'a'-1 + run;
32- ret[retlen++] = ',';
33+ if(ret != NULL) {
34+ ret[retlen++] = 'a'-1 + run;
35+ ret[retlen++] = ',';
36+ }
37
38 run = 0;
39 for (i = 0; i < n; i++) {
40--
412.30.1
42
diff --git a/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch b/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch
deleted file mode 100644
index 143e898a51..0000000000
--- a/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch
+++ /dev/null
@@ -1,68 +0,0 @@
1From 453587d714473b806473b309727f865b673cbc06 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 13 Jan 2016 23:10:19 -0800
4Subject: [PATCH] palisade: Fix warnings with clang on arm
5
6ARM treats 'char' as unsigned char when 'char' is not qualified with
7'signed' or 'unsigned' explicitly.
8
9This results in warnings e.g.
10
11palisade.c:531:22: error: comparison of constant -1 with expression of
12type 'clue' (aka 'char') is always false
13[-Werror,-Wtautological-constant-out-of-range-compare]
14 if (clues[i] == EMPTY) continue;
15
16Therefore, typcast the contant to char in such places to be explicit
17
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19Upstream-Status: Submitted
20---
21 palisade.c | 10 +++++-----
22 1 file changed, 5 insertions(+), 5 deletions(-)
23
24diff --git a/palisade.c b/palisade.c
25index 6ffbf2d..8b54d42 100644
26--- a/palisade.c
27+++ b/palisade.c
28@@ -304,11 +304,11 @@ static void solver_connected_clues_versus_region_size(solver_ctx *ctx)
29 * If p = q = 3 then the region has size exactly 2. */
30
31 for (i = 0; i < wh; ++i) {
32- if (ctx->clues[i] == EMPTY) continue;
33+ if (ctx->clues[i] == (char)EMPTY) continue;
34 for (dir = 0; dir < 4; ++dir) {
35 int j = i + dx[dir] + w*dy[dir];
36 if (disconnected(ctx, i, j, dir)) continue;
37- if (ctx->clues[j] == EMPTY) continue;
38+ if (ctx->clues[j] == (char)EMPTY) continue;
39 if ((8 - ctx->clues[i] - ctx->clues[j] > ctx->params->k) ||
40 (ctx->clues[i] == 3 && ctx->clues[j] == 3 &&
41 ctx->params->k != 2))
42@@ -326,7 +326,7 @@ static bool solver_number_exhausted(solver_ctx *ctx)
43 bool changed = false;
44
45 for (i = 0; i < wh; ++i) {
46- if (ctx->clues[i] == EMPTY) continue;
47+ if (ctx->clues[i] == (char)EMPTY) continue;
48
49 if (bitcount[(ctx->borders[i] & BORDER_MASK)] == ctx->clues[i]) {
50 for (dir = 0; dir < 4; ++dir) {
51@@ -538,7 +538,7 @@ static bool is_solved(const game_params *params, clue *clues,
52 for (i = 0; i < wh; ++i) {
53 if (dsf[i] == UNVISITED) dfs_dsf(i, params->w, border, dsf, true);
54 if (dsf_size(dsf, i) != k) goto error;
55- if (clues[i] == EMPTY) continue;
56+ if (clues[i] == (char)EMPTY) continue;
57 if (clues[i] != bitcount[border[i] & BORDER_MASK]) goto error;
58 }
59
60@@ -685,7 +685,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
61 p = numbers;
62 r = 0;
63 for (i = 0; i < wh; ++i) {
64- if (numbers[i] != EMPTY) {
65+ if (numbers[i] != (char)EMPTY) {
66 while (r) {
67 while (r > 26) {
68 *p++ = 'z';
diff --git a/meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch b/meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch
deleted file mode 100644
index 7ca582fe5d..0000000000
--- a/meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From 3af5a1e579e3324a13ba1f892c7befb3ab32d899 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Mar 2019 21:56:57 -0800
4Subject: [PATCH] pattern.c: Change string lenght parameter to be size_t in
5 do_row()
6
7This fixes below error on some architectures e.g. RISC-V
8
9pattern.c:455:9: error: 'memset' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] 455 | memset(deduced, DOT, (size_t)len); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10
11Upstream-Status: Pending
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14
15---
16 pattern.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/pattern.c b/pattern.c
20index ffadd3f..4e5f187 100644
21--- a/pattern.c
22+++ b/pattern.c
23@@ -428,7 +428,7 @@ static bool do_row(unsigned char *known, unsigned char *deduced,
24 unsigned char *row,
25 unsigned char *minpos_done, unsigned char *maxpos_done,
26 unsigned char *minpos_ok, unsigned char *maxpos_ok,
27- unsigned char *start, int len, int step, int *data,
28+ unsigned char *start, size_t len, int step, int *data,
29 unsigned int *changed
30 #ifdef STANDALONE_SOLVER
31 , const char *rowcol, int index, int cluewid
32--
332.17.1
34
diff --git a/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch b/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
deleted file mode 100644
index 28040523d4..0000000000
--- a/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1From 876c6ff1e20f51b0921acda99861f476b6423f26 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Mon, 11 Aug 2014 12:39:53 +0800
4Subject: [PATCH] gtk.c: fix compiling failure with option -g -O
5
6There were compiling failure with option -g -O
7...
8././gtk.c: In function 'configure_area':
9././gtk.c:397:2: error: 'cr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
10 cairo_set_source_rgb(cr,
11 ^
12././gtk.c:384:14: note: 'cr' was declared here
13 cairo_t *cr;
14 ^
15././gtk.c: In function 'main':
16././gtk.c:2911:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized]
17 fprintf(stderr, "%s: %s\n", pname, error);
18 ^
19cc1: all warnings being treated as errors
20...
21
22Initialized pointer 'cr' and 'error' with NULL
23
24Upstream-Status: Pending
25
26Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
27
28---
29 gtk.c | 2 +-
30 1 file changed, 1 insertion(+), 1 deletion(-)
31
32diff --git a/gtk.c b/gtk.c
33index 4565836..5e83b48 100644
34--- a/gtk.c
35+++ b/gtk.c
36@@ -2944,7 +2944,7 @@ static void list_presets_from_menu(struct preset_menu *menu)
37 int main(int argc, char **argv)
38 {
39 char *pname = argv[0];
40- char *error;
41+ char *error = NULL;
42 int ngenerate = 0, px = 1, py = 1;
43 bool print = false;
44 bool time_generation = false, test_solve = false, list_presets = false;
diff --git a/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch b/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch
deleted file mode 100644
index 7218d620ec..0000000000
--- a/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch
+++ /dev/null
@@ -1,25 +0,0 @@
1puzzles: avoid compiler unitialized variable error
2
3The compiler does not realize that we must go through the while()
4loop at least once, so we replace it with a for() loop.
5
6Upstream-Status: Pending
7
8Signed-off-by: Joe Slater <joe.slater@windriver.com>
9
10--- a/tree234.c
11+++ b/tree234.c
12@@ -326,8 +326,11 @@ static void *add234_internal(tree234 *t,
13 return orig_e;
14 }
15
16- n = t->root;
17- while (n) {
18+ /*
19+ * We know t->root is not NULL. The logic
20+ * to break out of this is at the end of the loop.
21+ */
22+ for (n = t->root;;) {
23 LOG((" node %p: %p/%d \"%s\" %p/%d \"%s\" %p/%d \"%s\" %p/%d\n",
24 n,
25 n->kids[0], n->counts[0], n->elems[0],
diff --git a/meta/recipes-sato/puzzles/puzzles_git.bb b/meta/recipes-sato/puzzles/puzzles_git.bb
index 16a08585cc..e9403ee130 100644
--- a/meta/recipes-sato/puzzles/puzzles_git.bb
+++ b/meta/recipes-sato/puzzles/puzzles_git.bb
@@ -2,49 +2,28 @@ SUMMARY = "Simon Tatham's Portable Puzzle Collection"
2DESCRIPTION = "Collection of small computer programs which implement one-player puzzle games." 2DESCRIPTION = "Collection of small computer programs which implement one-player puzzle games."
3HOMEPAGE = "http://www.chiark.greenend.org.uk/~sgtatham/puzzles/" 3HOMEPAGE = "http://www.chiark.greenend.org.uk/~sgtatham/puzzles/"
4LICENSE = "MIT" 4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://LICENCE;md5=6099f4981f9461d7f411091e69a7f07a" 5LIC_FILES_CHKSUM = "file://LICENCE;md5=191542b32377bde254e9799e0a46f18b"
6 6
7DEPENDS = "libxt" 7# gtk support includes a bunch of x11 headers
8
9# The libxt requires x11 in DISTRO_FEATURES
10REQUIRED_DISTRO_FEATURES = "x11" 8REQUIRED_DISTRO_FEATURES = "x11"
11 9
12SRC_URI = "git://git.tartarus.org/simon/puzzles.git \ 10SRC_URI = "git://git.tartarus.org/simon/puzzles.git;branch=main;protocol=https"
13 file://fix-compiling-failure-with-option-g-O.patch \
14 file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \
15 file://0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch \
16 file://0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch \
17 file://fix-ki-uninitialized.patch \
18 file://0001-malloc-Check-for-excessive-values-to-malloc.patch \
19 file://0001-map-Fix-stringop-overflow-warning.patch \
20 "
21 11
22UPSTREAM_CHECK_COMMITS = "1" 12UPSTREAM_CHECK_COMMITS = "1"
23SRCREV = "84cb4c6701e027090ff3fd955ce08065e20121b2" 13SRCREV = "80aac3104096aee4057b675c53ece8e60793aa90"
24PE = "2" 14PE = "2"
25PV = "0.0+git${SRCPV}" 15PV = "0.0+git"
26 16
27S = "${WORKDIR}/git" 17S = "${WORKDIR}/git"
28 18
29inherit autotools features_check pkgconfig 19inherit cmake features_check pkgconfig
30
31PACKAGECONFIG ??= "gtk3"
32PACKAGECONFIG[gtk2] = "--with-gtk=2,,gtk+,"
33PACKAGECONFIG[gtk3] = "--with-gtk=3,,gtk+3,"
34
35CFLAGS_append = " -Wno-deprecated-declarations"
36
37ASNEEDED = ""
38 20
39do_configure_prepend () { 21DEPENDS += "gtk+3"
40 cd ${S}
41 ./mkfiles.pl
42 cd ${B}
43}
44 22
45do_install_append () { 23do_install:append () {
46 # net conflicts with Samba, so rename it 24 # net conflicts with Samba, so rename it
47 mv ${D}${bindir}/net ${D}${bindir}/puzzles-net 25 mv ${D}${bindir}/net ${D}${bindir}/puzzles-net
26 rm ${D}/${datadir}/applications/net.desktop
48 27
49 # Create desktop shortcuts 28 # Create desktop shortcuts
50 install -d ${D}/${datadir}/applications/ 29 install -d ${D}/${datadir}/applications/
@@ -68,16 +47,3 @@ STOP
68 done 47 done
69} 48}
70 49
71PACKAGES += "${PN}-extra"
72
73FILES_${PN} = ""
74FILES_${PN}-extra = "${prefix}/bin ${datadir}/applications"
75
76python __anonymous () {
77 var = d.expand("FILES_${PN}")
78 data = d.getVar(var, False)
79 for name in ("bridges", "fifteen", "inertia", "map", "samegame", "slant"):
80 data = data + " ${bindir}/%s" % name
81 data = data + " ${datadir}/applications/%s.desktop" % name
82 d.setVar(var, data)
83}