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

Separate bit twiddling from buffer accesses in sets #489

Closed
jnj opened this issue Aug 3, 2017 · 3 comments
Closed

Separate bit twiddling from buffer accesses in sets #489

jnj opened this issue Aug 3, 2017 · 3 comments
Assignees

Comments

@jnj
Copy link

jnj commented Aug 3, 2017

This is a wish list item. It would be nice in the generated output to separate the buffer accesses from the bit manipulation in bit sets because we may not always have a buffer to work with. For example:

// This decoder requires a buffer containing our byte.
public boolean lastVolumeMsg()
{
        return 0 != (buffer.getByte(offset) & (1 << 1));
}

I'd like to have, say, a static method that doesn't require a buffer:

// No buffer needed.
public static boolean lastVolumeMsg(byte b)
{
        return 0 != (b & (1 << 1));
}
@mjpt777
Copy link
Contributor

mjpt777 commented Aug 3, 2017

Seems reasonable. I'll look at adding this.

@tmontgomery
Copy link
Contributor

I think this makes sense as well.

mjpt777 added a commit that referenced this issue Aug 4, 2017
@mjpt777 mjpt777 closed this as completed Aug 22, 2017
@tmontgomery
Copy link
Contributor

Needed for C++ also.

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

No branches or pull requests

3 participants