Skip to content
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

Use type hint in pointer arithmetic #3413

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ds5678
Copy link
Contributor

@ds5678 ds5678 commented Feb 25, 2025

Resolves #3411

Problem

This makes pointer arithmetic prettier with the help of available type hints.

Solution

  • Any comments on the approach taken, its consistency with surrounding code, etc.
    • I tried to be as surgical as possible.
  • Which part of this PR is most in need of attention/improvement?
    • There was a slight behavior change involving sbyte* vs byte*. I want to know if that's okay or not. Previously, byte* got picked because it's the default when things go wrong. However, now the type hint (which is often signed) prevents some of those situations.
    • I think the type hints could be better if they had sign information in more cases, but I was hesitant to change the code that sets the type hint.
  • At least one test covering the code changed

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

Successfully merging this pull request may close these issues.

Pointer Arithmetic Prettiness
1 participant