diff --git a/src/pmwebapi/pmgraphite.cxx b/src/pmwebapi/pmgraphite.cxx index 5c0c166..cf93a4d 100644 --- a/src/pmwebapi/pmgraphite.cxx +++ b/src/pmwebapi/pmgraphite.cxx @@ -1456,7 +1459,7 @@ float nicenum (float x, bool round_p) double nf;/* nice, rounded fraction */ expv = (int) floor (log10f (x)); - f = x/exp10f (expv); /* between 1 and 10 */ + f = x/powf (10., expv); /* between 1 and 10 */ if (round_p) if (f<1.5) { nf = 1.; @@ -1476,7 +1479,7 @@ float nicenum (float x, bool round_p) } else { nf = 10.; } - return nf*exp10f (expv); + return nf*powf (10., expv); } vector round_linear (float& ymin, float& ymax, unsigned nticks) @@ -1733,9 +1736,9 @@ pmgraphite_respond_render_gfx (struct MHD_Connection *connection, // What makes us tick? yticks = round_linear (ymin, ymax, - (unsigned) (0.3 * sqrt (height))); // flot heuristic + (unsigned) (0.3 * sqrtf (height))); // flot heuristic xticks = round_time (t_start, t_end, - (unsigned) (0.3 * sqrt (width)), // flot heuristic + (unsigned) (0.3 * sqrtf (width)), // flot heuristic & strf_format); diff --git a/src/pmwebapi/pmresapi.cxx b/src/pmwebapi/pmresapi.cxx index 03d64c7..d4cedad 100644 --- a/src/pmwebapi/pmresapi.cxx +++ b/src/pmwebapi/pmresapi.cxx @@ -31,7 +31,7 @@ using namespace std; static const char * guess_content_type (const char *filename) { - const char *extension = rindex (filename, '.'); + const char *extension = strrchr (filename, '.'); if (extension == NULL) { return NULL; } diff --git a/src/pmwebapi/util.cxx b/src/pmwebapi/util.cxx index 82524f0..ed5b85e 100644 --- a/src/pmwebapi/util.cxx +++ b/src/pmwebapi/util.cxx @@ -12,7 +12,7 @@ * for more details. */ -#define _XOPEN_SOURCE 500 +#define _XOPEN_SOURCE 600 #include "pmapi.h" #include "impl.h"