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

Add constants for unsigned values #111

Merged
merged 4 commits into from
Sep 12, 2022
Merged

Add constants for unsigned values #111

merged 4 commits into from
Sep 12, 2022

Conversation

tenderlove
Copy link
Member

This commit adds constants for unsigned values. Currently we can use - to mean "unsigned", but I think having a specific name makes Fiddle more user friendly. This commit continues to support -, but introduces negative constants with "unsigned" names

I think this will help to eliminate this code

This commit adds constants for unsigned values.  Currently we can use
`-` to mean "unsigned", but I think having a specific name makes Fiddle
more user friendly.  This commit continues to support `-`, but
introduces negative constants with "unsigned" names
Copy link
Member

@k0kubun k0kubun left a comment

Choose a reason for hiding this comment

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

I'd be happy to have these constants 🙂

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

lib/fiddle/cparser.rb Outdated Show resolved Hide resolved
test/fiddle/test_import.rb Outdated Show resolved Hide resolved
@tenderlove tenderlove merged commit 2bef0f1 into master Sep 12, 2022
@tenderlove tenderlove deleted the unsigned branch September 12, 2022 16:53
matzbot pushed a commit to ruby/ruby that referenced this pull request Oct 7, 2022
This commit adds constants for unsigned values. Currently we can use `-`
to mean "unsigned", but I think having a specific name makes Fiddle more
user friendly. This commit continues to support `-`, but introduces
negative constants with "unsigned" names

I think this will help to eliminate [this
code](https://github.com/ruby/ruby/blob/3a56bf0bcc66e14ffe5ec89efc32ecfceed180f4/lib/mjit/c_type.rb#L31-L38)

ruby/fiddle@2bef0f1082

Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants