Skip to content

Commit

Permalink
Merge pull request #94 from benjones/fixbodydeprecations
Browse files Browse the repository at this point in the history
replace deprecated body keyword with do
  • Loading branch information
Dav1dde committed Jun 11, 2021
2 parents 2d3683f + c5e653d commit 4759466
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gl3n/ext/matrixstack.d
Expand Up @@ -52,7 +52,7 @@ struct MatrixStack(T) if(is_matrix!T) {
/// Also returns a reference to the new top matrix.
ref Matrix pop() pure nothrow
in { assert(_top_pos >= 1, "popped too often from matrix stack"); }
body {
do {
top = stack[--_top_pos];
return top;
}
Expand Down
12 changes: 6 additions & 6 deletions gl3n/linalg.d
Expand Up @@ -1214,7 +1214,7 @@ struct Matrix(type, int rows_, int cols_) if((rows_ > 0) && (cols_ > 0)) {
static if(isFloatingPoint!mt) {
static private mt[6] cperspective(mt width, mt height, mt fov, mt near, mt far)
in { assert(height != 0); }
body {
do {
mt aspect = width/height;
mt top = near * tan(fov*(PI/360.0));
mt bottom = -top;
Expand All @@ -1237,7 +1237,7 @@ struct Matrix(type, int rows_, int cols_) if((rows_ > 0) && (cols_ > 0)) {
assert(top-bottom != 0);
assert(far-near != 0);
}
body {
do {
Matrix ret;
ret.clear(0);

Expand All @@ -1264,7 +1264,7 @@ struct Matrix(type, int rows_, int cols_) if((rows_ > 0) && (cols_ > 0)) {
assert(near != 0);
assert(far != 0);
}
body {
do {
Matrix ret;
ret.clear(0);

Expand All @@ -1287,7 +1287,7 @@ struct Matrix(type, int rows_, int cols_) if((rows_ > 0) && (cols_ > 0)) {
assert(top-bottom != 0);
assert(far-near != 0);
}
body {
do {
Matrix ret;
ret.clear(0);

Expand Down Expand Up @@ -1615,7 +1615,7 @@ struct Matrix(type, int rows_, int cols_) if((rows_ > 0) && (cols_ > 0)) {
/// Sets the translation of the matrix (nxn matrices, n >= 3).
void set_translation(mt[] values...) // intended to be a property
in { assert(values.length >= (rows-1)); }
body {
do {
foreach(r; TupleRange!(0, rows-1)) {
matrix[r][rows-1] = values[r];
}
Expand Down Expand Up @@ -1671,7 +1671,7 @@ struct Matrix(type, int rows_, int cols_) if((rows_ > 0) && (cols_ > 0)) {
/// Sets the scale of the matrix (nxn matrices, n >= 3).
void set_scale(mt[] values...)
in { assert(values.length >= (rows-1)); }
body {
do {
foreach(r; TupleRange!(0, rows-1)) {
matrix[r][r] = values[r];
}
Expand Down

0 comments on commit 4759466

Please sign in to comment.