Enforce Allman style for do {

This commit is contained in:
Sebastian Wilzbach 2016-12-09 17:39:47 +01:00
parent b100b859a5
commit c352281212
3 changed files with 13 additions and 6 deletions

View file

@ -508,6 +508,9 @@ style: ../dscanner/dsc
@echo "Enforce Allman style" @echo "Enforce Allman style"
grep -nrE '(if|for|foreach|foreach_reverse|while|unittest|switch|else|version) .*{$$' $$(find . -name '*.d'); test $$? -eq 1 grep -nrE '(if|for|foreach|foreach_reverse|while|unittest|switch|else|version) .*{$$' $$(find . -name '*.d'); test $$? -eq 1
@echo "Enforce do { to be in Allman style"
grep -nr 'do *{$$' $$(find . -name '*.d') ; test $$? -eq 1
# at the moment libdparse has problems to parse some modules (->excludes) # at the moment libdparse has problems to parse some modules (->excludes)
@echo "Running DScanner" @echo "Running DScanner"
../dscanner/dsc --config .dscanner.ini --styleCheck $$(find etc std -type f -name '*.d' | grep -vE 'std/traits.d|std/typecons.d') -I. ../dscanner/dsc --config .dscanner.ini --styleCheck $$(find etc std -type f -name '*.d' | grep -vE 'std/traits.d|std/typecons.d') -I.

View file

@ -1009,7 +1009,8 @@ private:
if (comp(next.front, r.front)) if (comp(next.front, r.front))
{ {
do { do
{
next.popFront(); next.popFront();
if (next.empty) return; if (next.empty) return;
} while (comp(next.front, r.front)); } while (comp(next.front, r.front));

View file

@ -1089,7 +1089,8 @@ real betaDistExpansion1(real a, real b, real x )
r = 1.0L; r = 1.0L;
n = 0; n = 0;
const real thresh = 3.0L * real.epsilon; const real thresh = 3.0L * real.epsilon;
do { do
{
xk = -( x * k1 * k2 )/( k3 * k4 ); xk = -( x * k1 * k2 )/( k3 * k4 );
pk = pkm1 + pkm2 * xk; pk = pkm1 + pkm2 * xk;
qk = qkm1 + qkm2 * xk; qk = qkm1 + qkm2 * xk;
@ -1177,8 +1178,8 @@ real betaDistExpansion2(real a, real b, real x )
r = 1.0L; r = 1.0L;
int n = 0; int n = 0;
const real thresh = 3.0L * real.epsilon; const real thresh = 3.0L * real.epsilon;
do { do
{
xk = -( z * k1 * k2 )/( k3 * k4 ); xk = -( z * k1 * k2 )/( k3 * k4 );
pk = pkm1 + pkm2 * xk; pk = pkm1 + pkm2 * xk;
qk = qkm1 + qkm2 * xk; qk = qkm1 + qkm2 * xk;
@ -1327,7 +1328,8 @@ body {
real c = 1.0L; real c = 1.0L;
real ans = 1.0L; real ans = 1.0L;
do { do
{
r += 1.0L; r += 1.0L;
c *= x/r; c *= x/r;
ans += c; ans += c;
@ -1374,7 +1376,8 @@ body {
real qkm1 = z * x; real qkm1 = z * x;
real ans = pkm1/qkm1; real ans = pkm1/qkm1;
do { do
{
c += 1.0L; c += 1.0L;
y += 1.0L; y += 1.0L;
z += 2.0L; z += 2.0L;