Skip to content

Commit 7fd8c9e

Browse files
Merge pull request #129 from avocadoboi/remove_warnings
Fix float conversion warnings.
2 parents e3e48e2 + d3bd62b commit 7fd8c9e

File tree

11 files changed

+28
-28
lines changed

11 files changed

+28
-28
lines changed

source/matplot/axes_objects/bars.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ namespace matplot {
104104
std::vector<std::vector<double>> ys_;
105105

106106
// color and style
107-
std::vector<color_array> face_colors_{{0.4, 0, 0, 0}};
107+
std::vector<color_array> face_colors_{{0.4f, 0, 0, 0}};
108108
bool manual_face_color_{false};
109109
color_array edge_color_{0, 0, 0, 0};
110110
line_spec edge_style_{"-"};
111111
float line_width_{0.5};
112112
bool vertical_orientation_{true};
113-
float bar_width_{0.8};
114-
float cluster_width_{0.8};
113+
float bar_width_{0.8f};
114+
float cluster_width_{0.8f};
115115

116116
// True if visible
117117
bool visible_{true};

source/matplot/axes_objects/box_chart.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ namespace matplot {
126126
std::vector<double> x_data_;
127127

128128
// color and style
129-
color_array face_color_{{0.4, 0, 0, 0}};
129+
color_array face_color_{{0.4f, 0, 0, 0}};
130130
bool manual_face_color_{false};
131131
color_array edge_color_{0, 0, 0, 0};
132132
float edge_width_{0.5};

source/matplot/axes_objects/error_bar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ namespace matplot {
8080
std::vector<double> y_positive_delta_{};
8181

8282
bool filled_curve_{false};
83-
float filled_curve_alpha_{0.90};
83+
float filled_curve_alpha_{0.9f};
8484

8585
float cap_size_{3.};
8686
};

source/matplot/axes_objects/histogram.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ namespace matplot {
248248
enum normalization normalization_ { normalization::count };
249249

250250
// color and style
251-
color_array face_color_{0.4, 0, 0, 0};
251+
color_array face_color_{0.4f, 0, 0, 0};
252252
bool manual_face_color_{false};
253253
color_array edge_color_{0, 0, 0, 0};
254254
bool manual_edge_color_{false};

source/matplot/axes_objects/matrix.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ namespace matplot {
126126
std::string labels_data_string();
127127

128128
inline double x_width() {
129-
return (w_ - 1) / (matrices_[0][0].size() - 1);
129+
return (w_ - 1) / static_cast<double>(matrices_[0][0].size() - 1);
130130
}
131131

132-
inline double y_width() { return (h_ - 1) / (matrices_[0].size() - 1); }
132+
inline double y_width() { return (h_ - 1) / static_cast<double>(matrices_[0].size() - 1); }
133133

134134
protected:
135135
// Main matrix

source/matplot/axes_objects/surface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ namespace matplot {
214214
size_t norm_{2};
215215
bool hidden3d_{false};
216216
bool depthorder_{false};
217-
float face_alpha_{.95};
217+
float face_alpha_{.95f};
218218
class line_spec line_spec_;
219219
bool lighting_{false};
220220
float primary_{-1.};

source/matplot/core/axes_type.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ namespace matplot {
2424
class axes_type : public std::enable_shared_from_this<class axes_type> {
2525
public:
2626
// {left bottom right top}
27-
static constexpr std::array<float, 4> default_subplot_inset{.2, .18,
28-
.04, .1};
27+
static constexpr std::array<float, 4> default_subplot_inset{.2f, .18f,
28+
.04f, .1f};
2929
// {x, y, width, height}
30-
static constexpr std::array<float, 4> default_axes_position{.13, .11,
31-
.775, .815};
30+
static constexpr std::array<float, 4> default_axes_position{.13f, .11f,
31+
.775f, .815f};
3232

3333
public:
3434
axes_type();
@@ -2783,7 +2783,7 @@ namespace matplot {
27832783

27842784
// colors for children object
27852785
std::array<float, 4> color_{0, 1.0, 1.0, 1.0};
2786-
std::array<float, 4> color_outside_{0, 0.97, 0.97, 0.97};
2786+
std::array<float, 4> color_outside_{0, 0.97f, 0.97f, 0.97f};
27872787
std::vector<std::array<float, 4>> colororder_{
27882788
default_color(0), default_color(1), default_color(2),
27892789
default_color(3), default_color(4), default_color(5),

source/matplot/core/axis_type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ namespace matplot {
132132
float tickangle_{0};
133133
std::vector<std::string> ticklabels_;
134134
bool ticklabels_mode_{true};
135-
std::array<float, 4> color_{0, 0.15, 0.15, 0.15};
135+
std::array<float, 4> color_{0, 0.15f, 0.15f, 0.15f};
136136
float tick_length_{0.75};
137137

138138
// minor tics

source/matplot/core/figure_type.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,11 @@ namespace matplot {
297297
std::string name_;
298298
std::string title_;
299299
color_array title_color_{0, 0, 0, 0};
300-
float title_font_size_multiplier_{1.4};
300+
float title_font_size_multiplier_{1.4f};
301301
size_t number_{1};
302302
bool number_title_{true};
303303
// ARGB
304-
color_array color_{0., 0.9400, 0.9400, 0.9400};
304+
color_array color_{0., 0.94f, 0.94f, 0.94f};
305305
bool custom_color_{false}; // was this color defined by the user
306306
std::string font_{"Helvetica"};
307307
float font_size_{10.};

source/matplot/core/line_spec.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,21 @@ namespace matplot {
159159
// linewidth 3 linetype 4 unset label
160160
private:
161161
// Line
162-
std::array<float, 4> color_{0, 0, 0.4470, 0.7410};
162+
std::array<float, 4> color_{0, 0, 0.447f, 0.741f};
163163
// Did the user provide a color or is the color just a placeholder
164164
bool user_color_{false};
165165
enum line_style line_style_ { line_style::none };
166166
float line_width_{0.5000};
167167

168168
// Marker
169169
enum marker_style marker_style_ { marker_style::none };
170-
std::array<float, 4> marker_color_{0, 0, 0.4470, 0.7410};
170+
std::array<float, 4> marker_color_{0, 0, 0.447f, 0.741f};
171171
bool marker_user_color_{false};
172172
std::string custom_marker_{""};
173173
float marker_size_{6};
174174

175175
// Marker face
176-
std::array<float, 4> marker_face_color_{0, 0.84, 1., 1.};
176+
std::array<float, 4> marker_face_color_{0, 0.84f, 1., 1.};
177177
bool marker_face_user_color_{false};
178178
bool marker_face_ = false;
179179

0 commit comments

Comments
 (0)