From a46133082b8c524a57bcb6282c000e417478a90c Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 11 Dec 2021 13:54:53 +0000 Subject: puzzles: Upgrade to latest git with patches merged This upgrades to the latest upstream version where our fixes have equivalent fixes merged upstream so our patches are no longer needed. (From OE-Core rev: 987077008c89a9086247d5bcdf35aef7413fb954) Signed-off-by: Richard Purdie --- ...lloc-Check-for-excessive-values-to-malloc.patch | 45 -------------- .../0001-map-Fix-stringop-overflow-warning.patch | 34 ---------- ...1-palisade-Fix-warnings-with-clang-on-arm.patch | 72 ---------------------- ...hange-string-lenght-parameter-to-be-size_.patch | 30 --------- .../fix-compiling-failure-with-option-g-O.patch | 33 ---------- .../puzzles/files/fix-ki-uninitialized.patch | 32 ---------- meta/recipes-sato/puzzles/puzzles_git.bb | 11 +--- 7 files changed, 2 insertions(+), 255 deletions(-) delete mode 100644 meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch delete mode 100644 meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch delete mode 100644 meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch delete mode 100644 meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch delete mode 100644 meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch delete mode 100644 meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch (limited to 'meta') 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 b572b55d1c..0000000000 --- a/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch +++ /dev/null @@ -1,45 +0,0 @@ -tree234: Avoid excessive values to malloc - -with whole program optimizers like lto, smalloc() is inlined the excessive -constant argument is propagated to malloc() and ultimately triggers the warning. - -| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c: In function 'disptree': -| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:46:17: error: argument 1 value '18446744073709551612' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=] -| 46 | #define smalloc malloc -| | ^ -| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:1631:17: note: in expansion of macro 'smalloc' -| 1631 | leveldata = smalloc(ht * (width+2)); -| | ^~~~~~~ -| In file included from tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:29: -| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/recipe-sysroot/usr/include/stdlib.h:539:14: note: in a call to allocation function 'malloc' declared here -| 539 | extern void *malloc (size_t __size) __THROW __attribute_malloc__ -| | ^~~~~~ -| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:46:17: error: argument 1 value '18446744073709551600' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=] -| 46 | #define smalloc malloc -| | ^ -| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:1632:18: note: in expansion of macro 'smalloc' -| 1632 | ctx.levels = smalloc(ht * sizeof(char *)); -| | ^~~~~~~ -| In file included from tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:29: -| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/recipe-sysroot/usr/include/stdlib.h:539:14: note: in a call to allocation function 'malloc' declared here -| 539 | extern void *malloc (size_t __size) __THROW __attribute_malloc__ -| | ^~~~~~ -| cc1: some warnings being treated as errors - -Upstream-Status: Submitted [email discussion with upstream] - -Signed-off-by: Richard Purdie - -Index: git/tree234.c -=================================================================== ---- git.orig/tree234.c -+++ git/tree234.c -@@ -1621,7 +1621,7 @@ void disptree(tree234 *t) { - dispctx ctx; - char *leveldata; - int width = count234(t); -- int ht = height234(t) * 3 - 2; -+ unsigned int ht = height234(t) * 3 - 2; - int i; - - if (!t->root) { 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 7f46d3ec0e..0000000000 --- a/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Khem Raj -map: Fix stringop-overflow warning - -Fixes - -../git/map.c: In function 'new_game_desc': -../git/map.c:1663:23: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] - 1663 | ret[retlen++] = ','; - | ~~~~~~~~~~~~~~^~~~~ -../git/./map.c: In function 'new_game_desc': -../git/./map.c:1663:23: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] - 1663 | ret[retlen++] = ','; - | ~~~~~~~~~~~~~~^~~~~ - -Upstream-Status: Submitted [email discussion with upstream] - -Signed-off-by: Richard Purdie -Signed-off-by: Khem Raj - -Index: git/map.c -=================================================================== ---- git.orig/map.c -+++ git/map.c -@@ -1659,6 +1659,10 @@ static char *new_game_desc(const game_pa - } - } - -+ if (retlen + 10 >= retsize) { -+ retsize = retlen + 256; -+ ret = sresize(ret, retsize, char); -+ } - ret[retlen++] = 'a'-1 + run; - ret[retlen++] = ','; - 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 07eb1d32f6..0000000000 --- a/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch +++ /dev/null @@ -1,72 +0,0 @@ -From: Khem Raj - -palisade: Fix warnings with clang on arm - -ARM treats 'char' as unsigned char when 'char' is not qualified with -'signed' or 'unsigned' explicitly. - -This results in warnings e.g. - -palisade.c:531:22: error: comparison of constant -1 with expression of -type 'clue' (aka 'char') is always false -[-Werror,-Wtautological-constant-out-of-range-compare] - if (clues[i] == EMPTY) continue; - -Therefore, typcast the contant to char in such places to be explicit - -Upstream-Status: Submitted [email discussion with upstream] - -Signed-off-by: Richard Purdie -Signed-off-by: Khem Raj - -Index: git/palisade.c -=================================================================== ---- git.orig/palisade.c -+++ git/palisade.c -@@ -46,7 +46,7 @@ struct game_params { - int w, h, k; - }; - --typedef char clue; -+typedef signed char clue; - typedef unsigned char borderflag; - - typedef struct shared_state { -@@ -242,7 +242,7 @@ typedef struct solver_ctx { - * thing is done. See how it is propagated across multiple squares.] - */ - --#define EMPTY (~0) -+#define EMPTY ((clue)-1) - - #define BIT(i) (1 << (i)) - #define BORDER(i) BIT(i) -@@ -622,7 +622,7 @@ static char *new_game_desc(const game_pa - { - int w = params->w, h = params->h, wh = w*h, k = params->k; - -- clue *numbers = snewn(wh + 1, clue), *p; -+ clue *numbers = snewn(wh + 1, clue); - borderflag *rim = snewn(wh, borderflag); - borderflag *scratch_borders = snewn(wh, borderflag); - -@@ -682,7 +682,8 @@ static char *new_game_desc(const game_pa - sfree(shuf); - sfree(dsf); - -- p = numbers; -+ char *output = snewn(wh + 1, char), *p = output; -+ - r = 0; - for (i = 0; i < wh; ++i) { - if (numbers[i] != EMPTY) { -@@ -699,7 +700,8 @@ static char *new_game_desc(const game_pa - } - *p++ = '\0'; - -- return sresize(numbers, p - numbers, clue); -+ sfree(numbers); -+ return sresize(output, p - output, char); - } - - static const char *validate_desc(const game_params *params, const char *desc) 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 5e240bfea5..0000000000 --- a/meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Khem Raj - -pattern.c: Change string lenght parameter to be size_t in do_row() - -This fixes below error on some architectures e.g. RISC-V - -pattern.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); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Upstream-Status: Submitted [email discussion with upstream] - -Signed-off-by: Richard Purdie -Signed-off-by: Khem Raj - ---- - pattern.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: git/pattern.c -=================================================================== ---- git.orig/pattern.c -+++ git/pattern.c -@@ -429,7 +429,7 @@ static bool do_row(unsigned char *known, - unsigned char *row, - unsigned char *minpos_done, unsigned char *maxpos_done, - unsigned char *minpos_ok, unsigned char *maxpos_ok, -- unsigned char *start, int len, int step, int *data, -+ unsigned char *start, size_t len, int step, int *data, - unsigned int *changed - #ifdef STANDALONE_SOLVER - , const char *rowcol, int index, int cluewid 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 4ee7543166..0000000000 --- a/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: Hongxu Jia - -gtk.c: fix compiling failure with option -g -O - -There was a compile failure with option -g -O -... -././gtk.c: In function 'main': -././gtk.c:2911:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized] - fprintf(stderr, "%s: %s\n", pname, error); - ^ -cc1: all warnings being treated as errors -... - -Fix by initializing pointer 'error' with NULL - -Upstream-Status: Submitted [email discussion with upstream] - -Signed-off-by: Richard Purdie -Signed-off-by: Hongxu Jia - -Index: git/gtk.c -=================================================================== ---- git.orig/gtk.c -+++ git/gtk.c -@@ -3578,7 +3578,7 @@ static void list_presets_from_menu(struc - int main(int argc, char **argv) - { - char *pname = argv[0]; -- char *error; -+ char *error = NULL; - int ngenerate = 0, px = 1, py = 1; - bool print = false; - 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 b182240240..0000000000 --- a/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch +++ /dev/null @@ -1,32 +0,0 @@ -tree123: avoid compiler unitialized variable error - -The compiler does not realize that we must go through the while() -loop at least once, so we replace it with a for() loop. - -Upstream-Status: Submitted [email discussion with upstream] - -Signed-off-by: Richard Purdie -Signed-off-by: Joe Slater - -Index: git/tree234.c -=================================================================== ---- git.orig/tree234.c -+++ git/tree234.c -@@ -335,7 +335,7 @@ static void *add234_internal(tree234 *t, - } - - n = t->root; -- while (n) { -+ do { - LOG((" node %p: %p/%d \"%s\" %p/%d \"%s\" %p/%d \"%s\" %p/%d\n", - n, - n->kids[0], n->counts[0], n->elems[0], -@@ -388,7 +388,7 @@ static void *add234_internal(tree234 *t, - if (!n->kids[ki]) - break; - n = n->kids[ki]; -- } -+ } while (n); - - add234_insert(NULL, e, NULL, &t->root, n, ki); - diff --git a/meta/recipes-sato/puzzles/puzzles_git.bb b/meta/recipes-sato/puzzles/puzzles_git.bb index 8ac62d52e5..f2fe7d7b96 100644 --- a/meta/recipes-sato/puzzles/puzzles_git.bb +++ b/meta/recipes-sato/puzzles/puzzles_git.bb @@ -7,17 +7,10 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=6e7d24cf1c949887ee9447a1e2a4a24c" # gtk support includes a bunch of x11 headers REQUIRED_DISTRO_FEATURES = "x11" -SRC_URI = "git://git.tartarus.org/simon/puzzles.git;branch=main \ - file://fix-compiling-failure-with-option-g-O.patch \ - file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \ - file://0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch \ - file://fix-ki-uninitialized.patch \ - file://0001-malloc-Check-for-excessive-values-to-malloc.patch \ - file://0001-map-Fix-stringop-overflow-warning.patch \ - " +SRC_URI = "git://git.tartarus.org/simon/puzzles.git;branch=main" UPSTREAM_CHECK_COMMITS = "1" -SRCREV = "640f9235c79cdb1a924b0148cb312b0f02253364" +SRCREV = "b56c994b721f7cb5c5bcf09c5d695d4ae07d3052" PE = "2" PV = "0.0+git${SRCPV}" -- cgit v1.2.3-54-g00ecf