void-packages/srcpkgs/openbabel/patches/unsigned_char.patch
Đoàn Trần Công Danh 2fd8d4df94 srcpkgs/o*: 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

34 lines
1.2 KiB
Diff

https://github.com/openbabel/openbabel/commit/ee11c98a655296550710db1207b294f00e168216
--- a/src/formats/pngformat.cpp 2016-09-21 21:55:37.000000000 +0200
+++ b/src/formats/pngformat.cpp 2018-01-04 08:22:33.377616730 +0100
@@ -218,7 +218,7 @@
_count=0;
_hasInputPngFile=true;
}
- const char pngheader[] = {-119,80,78,71,13,10,26,10,0};
+ const unsigned char pngheader[] = {137,80,78,71,13,10,26,10,0};
char readbytes[9];
ifs.read(readbytes, 8);
--- a/src/formats/yasaraformat.cpp 2016-09-21 21:55:37.000000000 +0200
+++ b/src/formats/yasaraformat.cpp 2018-01-04 09:00:45.636003936 +0100
@@ -472,7 +472,7 @@
// bool hetatom;
char buffer[32],/*resname[4],*/atomname[5];
- char double1[8]={0,0,0,0,0,0,-16,0x3f};
+ unsigned char double1[8]={0,0,0,0,0,0,0xf,0x3f};
// char *str;
int i,j,/*m,q,*/pos;
int /*resno,chainNum,link,linktype,*/atoms,element,links/*,chain*/;
@@ -500,7 +500,7 @@
mem_set(buffer,0,8);
for (i=0;i<4;i++)
{ for (j=0;j<4;j++)
- { if (i==j) ofs.write(double1,8);
+ { if (i==j) ofs.write((char*)double1,8);
else ofs.write(buffer,8); } }
storeint32le(buffer,MOB_INFOEND);
storeint32le(&buffer[4],MOB_INFOENDSIZE);