summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fluid/Shortcut_Button.cxx3
-rw-r--r--src/Fl_Message.cxx2
-rw-r--r--test/blocks.cxx4
-rw-r--r--test/unittest_circles.cxx10
4 files changed, 10 insertions, 9 deletions
diff --git a/fluid/Shortcut_Button.cxx b/fluid/Shortcut_Button.cxx
index fabe1ea11..517eee624 100644
--- a/fluid/Shortcut_Button.cxx
+++ b/fluid/Shortcut_Button.cxx
@@ -27,6 +27,7 @@
#include <FL/Fl_Window.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Menu_.H>
+#include <FL/fl_string_functions.h>
#include "../src/flstring.h"
/** \class Shortcut_Button
@@ -299,7 +300,7 @@ int Fluid_Coord_Input::eval(uchar *&s, int prio) const {
int Fluid_Coord_Input::eval(const char *s) const
{
// duplicate the text, so we can modify it
- uchar *buf = (uchar*)strdup(s);
+ uchar *buf = (uchar*)fl_strdup(s);
uchar *src = buf, *dst = buf;
// remove all whitespace to make the parser easier
for (;;) {
diff --git a/src/Fl_Message.cxx b/src/Fl_Message.cxx
index a6588f8b5..06c2e76f6 100644
--- a/src/Fl_Message.cxx
+++ b/src/Fl_Message.cxx
@@ -556,7 +556,7 @@ int Fl_Message_Box::handle(int e) {
case FL_KEYBOARD:
case FL_SHORTCUT:
if (Fl::event_key() == 'c' && mods == FL_COMMAND) {
- Fl::copy(label(), strlen(label()), 1);
+ Fl::copy(label(), int(strlen(label())), 1);
return 1;
}
break;
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);
}
}