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

Adagruit_GFX::getTextBounds(...) should have their 'out ' arguments nullable, or passed as refs. #363

Open
jlarnal opened this issue Oct 29, 2021 · 0 comments

Comments

@jlarnal
Copy link

jlarnal commented Oct 29, 2021

The current signature of Adafruit_GFX::getTextBounds are :

getTextBounds( [multiple_string_types] , int16_t , int16_t , int16_t*, int16_t* , uint16_t*, uint16_t*)

However, there is no non-null enforcement for the last 4 pointer arguments.
Then one could believe (like I did), that passing NULL for unwanted out argument is an option.
But it's not. 😅 ( dang, I just needed the height, nothing else) -wink-

If implementing the nullability of those args agrees to everyone's fancy, I'd be happy to do it.
The function will stay backward-compatible doing this, and the caller won't have its stack hogged with 3 more ushorts.

Originally, wouldn't it be more reasonable to pass those as references ? What motivated the choice of pointers here ?

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

No branches or pull requests

1 participant