Skip to content

Commit 52d9e75

Browse files
committed
Fix pedantic warnings on MSVC, GCC, and Clang
1 parent 42ab5eb commit 52d9e75

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+651
-453
lines changed

examples/appearance/multiplot/colororder/colororder_2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ int main() {
1010

1111
hold(on);
1212
for (size_t r = 1; r <= 7; ++r) {
13-
auto x = linspace(0, r, 500);
13+
auto x = linspace(0., static_cast<double>(r), 500);
1414
auto y =
1515
transform(x, [&](double x) { return sqrt(pow(r, 2) - pow(x, 2)); });
1616
plot(x, y)->line_width(15);

examples/data_distribution/binscatter/binscatter_1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ int main() {
1515
scatter(ax1, x_reduced, y_reduced);
1616
title(ax1, "Scatter plot (n=1000)");
1717

18-
auto x = randn(1e6, 0, 1);
18+
auto x = randn(1000000, 0., 1.);
1919
auto y = transform(x, [](double x) { return 2 * x + randn(0, 1); });
2020
auto ax2 = subplot(1, 2, 1);
2121
binscatter(ax2, x, y);

examples/data_distribution/binscatter/binscatter_2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ int main() {
1010
f->x_position(200);
1111
f->y_position(100);
1212

13-
auto x = randn(1e6, 0, 1);
13+
auto x = randn(1000000, 0., 1.);
1414
auto y = transform(x, [](double x) { return 2 * x + randn(0, 1); });
1515
std::vector x_line(x.begin(), x.begin() + 1000);
1616
std::vector y_line(y.begin(), y.begin() + 1000);

examples/data_distribution/binscatter/binscatter_3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ int main() {
1111
f->x_position(200);
1212
f->y_position(100);
1313

14-
auto x = randn(1e6, 0, 1);
14+
auto x = randn(1000000, 0., 1.);
1515
auto y = transform(x, [](double x) { return 2 * x + randn(0, 1); });
1616

1717
bin_scatter_style b = bin_scatter_style::automatic;

examples/data_distribution/binscatter/binscatter_4.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ int main() {
1111
f->x_position(200);
1212
f->y_position(100);
1313

14-
auto x = randn(1e6, 0, 1);
14+
auto x = randn(1000000, 0., 1.);
1515
auto y = transform(x, [](double x) { return 2 * x + randn(0, 1); });
1616

1717
bin_scatter_style b = bin_scatter_style::heatmap;

examples/data_distribution/binscatter/binscatter_5.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ int main() {
1212
f->y_position(100);
1313
f->quiet_mode(true);
1414

15-
auto x = randn(1e4, 0, 1);
16-
auto y = randn(1e4, 0, 1);
15+
auto x = randn(10000, 0., 1.);
16+
auto y = randn(10000, 0., 1.);
1717

1818
subplot(2, 3, 0);
1919
scatter(x, y);

examples/data_distribution/binscatter/binscatter_6.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
int main() {
66
using namespace matplot;
77

8-
auto x = randn(1e5, 0, 1);
9-
auto y = randn(1e5, 0, 1);
8+
auto x = randn(100000, 0., 1.);
9+
auto y = randn(100000, 0., 1.);
1010

1111
binscatter(x, y, bin_scatter_style::point_colormap);
1212
colormap(gca(), palette::parula());

examples/data_distribution/binscatter/binscatter_7.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
int main() {
66
using namespace matplot;
77

8-
auto x = randn(100000, 0, 1);
9-
auto y = randn(100000, 0, 1);
8+
auto x = randn(100000, 0., 1.);
9+
auto y = randn(100000, 0., 1.);
1010

1111
binscatter(x, y, 20, 30, bin_scatter_style::heatmap);
1212
axis(tight);

examples/data_distribution/heatmap/heatmap_5.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ int main() {
1818
"Severe Storm", "Thunder Storm", "Unknown", "Wind", "Winter Storm"});
1919
xlabel(ax, "Region");
2020
ylabel(ax, "Cause");
21-
double w = ax->width();
22-
ax->width(w * 0.85);
23-
ax->x_origin(ax->x_origin() + w * 0.1);
21+
float w = ax->width();
22+
ax->width(w * 0.85f);
23+
ax->x_origin(ax->x_origin() + w * 0.1f);
2424

2525
show();
2626
return 0;

examples/data_distribution/heatmap/heatmap_6.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ int main() {
2020
"Severe Storm", "Thunder Storm", "Unknown", "Wind", "Winter Storm"});
2121
xlabel(ax, "Region");
2222
ylabel(ax, "Cause");
23-
double w = ax->width();
24-
ax->width(w * 0.85);
25-
ax->x_origin(ax->x_origin() + w * 0.1);
23+
float w = ax->width();
24+
ax->width(w * 0.85f);
25+
ax->x_origin(ax->x_origin() + w * 0.1f);
2626

2727
show();
2828
return 0;

0 commit comments

Comments
 (0)