Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 58d5eaec authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] drxd: Don't use a macro for CHK_ERROR with a break inside



The macro is defined as:
	#define CHK_ERROR(s) if( (status = s)<0 ) break

This sucks, as makes harder to debug if something got wrong and
there are more than one level of loops. Also, violates CodingStyle.

Fixed by this simple perl script:

	while (<>) { $f.=$_; };

	$f=~ s,\n\#define CHK_ERROR[^\n]+\n,\n,;

	$f=~ s=(CHK_ERROR\(.*\,)\n\s+=\1 =g;
	$f=~ s=(CHK_ERROR\(.*\,)\n\s+=\1 =g;
	$f=~ s=(CHK_ERROR\(.*\,)\n\s+=\1 =g;
	$f=~ s=(CHK_ERROR\(.*)\s+(\,)\n\s+=\1\2 =g;
	$f=~ s=(CHK_ERROR\(.*)\s+(\,)\n\s+=\1\2 =g;
	$f=~ s=(CHK_ERROR\(.*)\s+(\,)\n\s+=\1\2 =g;

	$f=~ s,\n(\t+)CHK_ERROR\((.*)\)\;,\n\1status = \2;\n\1if (status < 0)\n\1\tbreak;,g;

	print $f;

Plus a few manual adjustments

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 7fc7356f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment