Skip to content

Commit

Permalink
Static cast patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthomas23 committed Jan 20, 2025
1 parent f4df662 commit 2094c7c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions recipes/recipes_emscripten/matplotlib/patches/static-cast.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 1b919a42a6be3090d4553cafff8f0c0f9e221d60 Mon Sep 17 00:00:00 2001
From: Ian Thomas <ianthomas23@gmail.com>
Date: Tue, 14 Jan 2025 14:34:34 +0000
Subject: [PATCH] Static cast patch

---
src/_backend_agg_wrapper.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/_backend_agg_wrapper.cpp b/src/_backend_agg_wrapper.cpp
index 269e2aaa9e..2bad7f4d0b 100644
--- a/src/_backend_agg_wrapper.cpp
+++ b/src/_backend_agg_wrapper.cpp
@@ -250,12 +250,12 @@ PYBIND11_MODULE(_backend_agg, m, py::mod_gil_not_used())

.def_buffer([](RendererAgg *renderer) -> py::buffer_info {
std::vector<py::ssize_t> shape {
- renderer->get_height(),
- renderer->get_width(),
+ static_cast<py::ssize_t>(renderer->get_height()),
+ static_cast<py::ssize_t>(renderer->get_width()),
4
};
std::vector<py::ssize_t> strides {
- renderer->get_width() * 4,
+ static_cast<py::ssize_t>(renderer->get_width() * 4),
4,
1
};
--
2.39.3 (Apple Git-146)
1 change: 1 addition & 0 deletions recipes/recipes_emscripten/matplotlib/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ source:
sha256: 825919da8957bbc19cec35caf8663b734d34af72a0b040c43b7d8c1b76fdcab7
patches:
- patches/fix-threading-and-font-cache.patch
- patches/static-cast.patch

build:
number: 0
Expand Down

0 comments on commit 2094c7c

Please sign in to comment.