void-packages/srcpkgs/cdecl/patches/fix-reserved_keyword.patch
Đoàn Trần Công Danh c987560802 srcpkgs/c*: convert patches to -Np1
```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

53 lines
1.4 KiB
Diff

--- a/cdecl.c 2009-10-20 11:25:25.000000000 +0200
+++ b/cdecl.c 2016-10-21 12:29:34.791599362 +0200
@@ -245,7 +245,7 @@
/* for unsupported combinations of types. */
void mbcheck()
{
- register int i, j, restrict;
+ register int i, j, restr;
char *t1, *t2;
/* Loop through the types */
@@ -262,26 +262,26 @@
if (!(modbits & crosstypes[j].bit))
continue;
/* check the type of restriction */
- restrict = crosscheck[i][j];
- if (restrict == ALWAYS)
+ restr = crosscheck[i][j];
+ if (restr == ALWAYS)
continue;
t1 = crosstypes[i].name;
t2 = crosstypes[j].name;
- if (restrict == NEVER)
+ if (restr == NEVER)
{
notsupported("", t1, t2);
}
- else if (restrict == RITCHIE)
+ else if (restr == RITCHIE)
{
if (RitchieFlag)
notsupported(" (Ritchie Compiler)", t1, t2);
}
- else if (restrict == PREANSI)
+ else if (restr == PREANSI)
{
if (PreANSIFlag || RitchieFlag)
notsupported(" (Pre-ANSI Compiler)", t1, t2);
}
- else if (restrict == ANSI)
+ else if (restr == ANSI)
{
if (!RitchieFlag && !PreANSIFlag)
notsupported(" (ANSI Compiler)", t1, t2);
@@ -290,7 +290,7 @@
{
(void) fprintf (stderr,
"%s: Internal error in crosscheck[%d,%d]=%d!\n",
- progname, i, j, restrict);
+ progname, i, j, restr);
exit(1); /* NOTREACHED */
}
}