-
Notifications
You must be signed in to change notification settings - Fork 40
Fix integral promotion deprecation (#98) #100
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
Conversation
Casting to byte to get negative sign then cast to target type T.
|
Sorry, I haven't check the repository for issue and PR already available. |
| value = cast(T)header; | ||
| } else if (0xe0 <= header && header <= 0xff) { | ||
| value = -(cast(T)-header); | ||
| value = cast(T)cast(byte)header; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#99 take a look at this, I tried that one myself first but x86_64 unittests were broken so I had to rethink it :-D
Since that PR is still not handled you can get that version of msgpack-d here: https://github.com/causal-rt/msgpack-d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RalphBariz I've took. I guess your solution is more general, my one handles the specific case only, but due to this fact is much simpler.
But why x64 unittest fails?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tried to remove the -(-()) double negation and faced broken unittests when running in 64bit. Because of that I reintroduced the -- and made that wild casting stuff.
|
As this repo is rather inactive, but still used by many people of the D community (i.e. DCD) - should we move it to dlang-community? |
|
#99 is merged. So this PR is closed. Thanks and sorry for late response. |
Casting to byte to get negative sign then cast it to the target type T.