void-packages/srcpkgs/afterstep/patches/43-Fix-gcc-warning.patch
Đoàn Trần Công Danh ae69000001 srcpkgs/a*: convert patches to -Np1
* arduino and antiword is kept at -Np0

```sh

git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

32 lines
1.1 KiB
Diff

From: Robert Luberda <robert@debian.org>
Date: Sat, 25 Oct 2014 16:59:17 +0200
Subject: 43 Fix gcc warning
Fix "undefined behaviour" warning
---
libAfterConf/Database.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libAfterConf/Database.c b/libAfterConf/Database.c
index c10df0d..1cfc7f9 100644
--- a/libAfterConf/Database.c
+++ b/libAfterConf/Database.c
@@ -578,7 +578,8 @@ void delete_name_list (name_list ** head)
style_delete (*head, head);
}
-static unsigned long window_style_cross[][2] =
+#define WINDOW_STYLE_CROSS_STYLES 4
+static unsigned long window_style_cross[WINDOW_STYLE_CROSS_STYLES][2] =
{ {DATABASE_FocusStyle_ID, BACK_FOCUSED},
{DATABASE_UnfocusStyle_ID, BACK_UNFOCUSED},
{DATABASE_StickyStyle_ID, BACK_STICKY},
@@ -631,7 +632,7 @@ void ParseSingleStyle (FreeStorageElem * storage, name_list * style)
case DATABASE_FocusStyle_ID:
case DATABASE_UnfocusStyle_ID:
case DATABASE_StickyStyle_ID:
- for (i = 0; i < BACK_STYLES; i++)
+ for (i = 0; i < WINDOW_STYLE_CROSS_STYLES; i++)
if (window_style_cross[i][0] == storage->term->id) {
char **s = &(style->window_styles[window_style_cross[i][1]]);