summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/blocks.cxx4
-rw-r--r--test/unittest_circles.cxx10
2 files changed, 7 insertions, 7 deletions
diff --git a/test/blocks.cxx b/test/blocks.cxx
index a08e6ed40..f6fbbb48c 100644
--- a/test/blocks.cxx
+++ b/test/blocks.cxx
@@ -712,7 +712,7 @@ void BlockWindow::draw() {
time_t curtime = time(NULL);
frames_ ++;
if (curtime > frame_time_) {
- frames_per_second_ = (frames_per_second_ + 3 * frames_ / (curtime - frame_time_)) / 4;
+ frames_per_second_ = (frames_per_second_ + 3 * frames_ / int(curtime - frame_time_)) / 4;
frames_ = 0;
frame_time_ = curtime;
}
@@ -1054,7 +1054,7 @@ void BlockWindow::timeout_cb(BlockWindow *bw) {
for (j = 0, b = c->blocks; j < BLOCK_ROWS; j ++, b ++) {
b->bomb = bw->num_colors_ > 3 && (rand() & 127) < bw->num_colors_;
b->color = 1 + (rand() % bw->num_colors_);
- b->y = j * (BLOCK_SIZE + 8) + 24;
+ b->y = float(j * (BLOCK_SIZE + 8) + 24);
}
}
}
diff --git a/test/unittest_circles.cxx b/test/unittest_circles.cxx
index b816a4b6d..13759a0cb 100644
--- a/test/unittest_circles.cxx
+++ b/test/unittest_circles.cxx
@@ -37,20 +37,20 @@ void arc(int xi, int yi, int w, int h, double a1, double a2)
double x = xi + rx + 0.5;
double y = yi + ry + 0.5;
double circ = M_PI*0.5*(rx+ry);
- int i, segs = circ * (a2-a1) / 100;
+ int i, segs = int(circ * (a2-a1) / 100);
if (segs<3) segs = 3;
a1 = a1/180*M_PI;
a2 = a2/180*M_PI;
double step = (a2-a1)/segs;
- int nx = x + cos(a1)*rx;
- int ny = y - sin(a1)*ry;
+ int nx = int(x + cos(a1)*rx);
+ int ny = int(y - sin(a1)*ry);
fl_point(nx, ny);
for (i=segs; i>0; i--) {
a1 += step;
- nx = x + cos(a1)*rx;
- ny = y - sin(a1)*ry;
+ nx = int(x + cos(a1)*rx);
+ ny = int(y - sin(a1)*ry);
fl_point(nx, ny);
}
}