@@ -51,7 +51,7 @@ unittest
5151 Quaternion opBinary (string op)(auto ref const Quaternion rhs) const
5252 if (op == " +" || op == " -" )
5353 {
54- Quaternion ret = void ;
54+ Quaternion ret ;
5555 foreach (i, ref e; ret.rijk)
5656 mixin (" e = rijk[i] " ~ op~ " rhs.rijk[i];" );
5757 return ret;
@@ -446,7 +446,7 @@ struct Summator(T, Summation summation)
446446 static import std.math ;
447447 private :
448448 enum F M = (cast (F)(2 )) ^^ (T.max_exp - 1 );
449- F[16 ] scopeBufferArray = void ;
449+ F[16 ] scopeBufferArray = 0 ;
450450 ScopeBuffer! F partials;
451451 // sum for NaN and infinity.
452452 F s;
@@ -472,7 +472,7 @@ struct Summator(T, Summation summation)
472472 }
473473 body
474474 {
475- bool _break = void ;
475+ bool _break;
476476 foreach_reverse (i, y; partials)
477477 {
478478 s = partialsReducePred(s, y, i ? partials[i- 1 ] : 0 , _break);
@@ -554,23 +554,23 @@ struct Summator(T, Summation summation)
554554 else
555555 static if (summation == Summation.kb2)
556556 {
557- F s = void ;
558- F cs = void ;
559- F ccs = void ;
557+ F s = 0 ;
558+ F cs = 0 ;
559+ F ccs = 0 ;
560560 }
561561 else
562562 static if (summation == Summation.kbn)
563563 {
564- F s = void ;
565- F c = void ;
564+ F s = 0 ;
565+ F c = 0 ;
566566 }
567567 else
568568 static if (summation == Summation.kahan)
569569 {
570- F s = void ;
571- F c = void ;
572- F y = void ; // do not declare in the loop/put (algo can be used for matrixes and etc)
573- F t = void ; // ditto
570+ F s = F.init ;
571+ F c = F.init ;
572+ F y = F.init ; // do not declare in the loop/put (algo can be used for matrixes and etc)
573+ F t = F.init ; // ditto
574574 }
575575 else
576576 static if (summation == Summation.pairwise)
@@ -580,22 +580,22 @@ struct Summator(T, Summation summation)
580580 static if (fastPairwise)
581581 {
582582 enum registersCount= 16 ;
583- F[size_t .sizeof * 8 ] partials = void ;
583+ F[size_t .sizeof * 8 ] partials = F.init ;
584584 }
585585 else
586586 {
587- F[size_t .sizeof * 8 ] partials = void ;
587+ F[size_t .sizeof * 8 ] partials = F.init ;
588588 }
589589 }
590590 else
591591 static if (summation == Summation.naive)
592592 {
593- F s = void ;
593+ F s = F.init ;
594594 }
595595 else
596596 static if (summation == Summation.fast)
597597 {
598- F s = void ;
598+ F s = F.init ;
599599 }
600600 else
601601 static assert (0 , " Unsupported summation type for std.numeric.Summator." );
@@ -759,7 +759,7 @@ public:
759759 static if (isFloatingPoint! F)
760760 {
761761 F t = s + x;
762- F c = void ;
762+ F c = 0 ;
763763 if (fabs(s) >= fabs(x))
764764 {
765765 F d = s - t;
@@ -911,7 +911,7 @@ public:
911911 {
912912 static if (summation == Summation.pairwise && fastPairwise && isDynamicArray! Range )
913913 {
914- F[registersCount] v = void ;
914+ F[registersCount] v;
915915 foreach (i, n; chainSeq! registersCount)
916916 {
917917 if (r.length >= n * 2 ) do
@@ -1180,7 +1180,7 @@ public:
11801180 else
11811181 static if (summation == Summation.precise)
11821182 {
1183- typeof ( return ) ret = void ;
1183+ auto ret = typeof ( return ).init ;
11841184 ret.s = s;
11851185 ret.o = o;
11861186 ret.partials = scopeBuffer(ret.scopeBufferArray);
@@ -1204,7 +1204,7 @@ public:
12041204 else
12051205 static if (summation == Summation.kb2)
12061206 {
1207- typeof ( return ) ret = void ;
1207+ auto ret = typeof ( return ).init ;
12081208 ret.s = s;
12091209 ret.cs = cs;
12101210 ret.ccs = ccs;
@@ -1213,23 +1213,23 @@ public:
12131213 else
12141214 static if (summation == Summation.kbn)
12151215 {
1216- typeof ( return ) ret = void ;
1216+ auto ret = typeof ( return ).init ;
12171217 ret.s = s;
12181218 ret.c = c;
12191219 return ret;
12201220 }
12211221 else
12221222 static if (summation == Summation.kahan)
12231223 {
1224- typeof ( return ) ret = void ;
1224+ auto ret = typeof ( return ).init ;
12251225 ret.s = s;
12261226 ret.c = c;
12271227 return ret;
12281228 }
12291229 else
12301230 static if (summation == Summation.pairwise)
12311231 {
1232- typeof ( return ) ret = void ;
1232+ auto ret = typeof ( return ).init ;
12331233 ret.counter = counter;
12341234 ret.index = index;
12351235 foreach (i; 0 .. index)
@@ -1239,14 +1239,14 @@ public:
12391239 else
12401240 static if (summation == Summation.naive)
12411241 {
1242- typeof ( return ) ret = void ;
1242+ auto ret = typeof ( return ).init ;
12431243 ret.s = s;
12441244 return ret;
12451245 }
12461246 else
12471247 static if (summation == Summation.fast)
12481248 {
1249- typeof ( return ) ret = void ;
1249+ auto ret = typeof ( return ).init ;
12501250 ret.s = s;
12511251 return ret;
12521252 }
0 commit comments