Skip to content

Change types for width/height to match definitions in BufferRegion #29894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kraj
Copy link

@kraj kraj commented Apr 10, 2025

This is found with clang

Fixes
../matplotlib-3.10.1/src/_backend_agg_wrapper.cpp:253:17: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list [-Wc++11-narrowing]

PR summary

PR checklist

This is found with clang

Fixes
../matplotlib-3.10.1/src/_backend_agg_wrapper.cpp:253:17: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list [-Wc++11-narrowing]
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@tacaswell
Copy link
Member

It is not immediately clear to me why we should flip both to int rather than both to unsigned int ?

@kraj
Copy link
Author

kraj commented Apr 10, 2025

It is not immediately clear to me why we should flip both to int rather than both to unsigned int ?

this was simpler fix, tbh using unsigned int would have required more changes but it might be semantically better Idk

@oscargus
Copy link
Member

I think going to unsigned in BufferRegion is the better fix.

Internally, we use the values for attach and there, unsigned is expected.

void attach(T* buf, unsigned width, unsigned height, int stride)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants